Skip to content

TypeSafe Swift SDK

SwiftPM client for System One following the official JS SDK, with enum-typed choices and struct-declared question sets.

Librarybeta

Overview

Marcin Krzyżanowski's TypeSafe Swift SDK is a Swift Package Manager client for the System One API whose behavior follows the official JavaScript SDK. Question sets are declared as structs conforming to SystemOneQuestions, with Choice generic over your own enum, Noul and Score fields, and a matching Answers type, so results come back as your enum and typed values.

The key is read from TYPESAFE_API_KEY or passed in configuration, and the README warns that a key shipped inside an iOS or macOS app is visible to users, so calls should go through a server you control. A demo target asks noul, choice and score questions about a sample ticket. Developers can run swift test and a TypeSafeDemo executable that asks noul, choice and score questions about a sample billing ticket.

What the decision model decides

TypeQuestionAnswers
ChoiceWhat is this ticket about?billing · technical · other
Yes / noIs this ticket about billing?yes · no
ScoreHow urgent is this ticket?can wait · this week · today

How it works

  1. Declare a SystemOneQuestions struct.
  2. Create TypeSafeClient.
  3. Call systemOne with state and the struct.
  4. Read typed answers.

Strengths

  • Enum-typed choices.
  • Clear warning about key exposure in apps.
  • Demo target included.

Caveats

  • Early version (0.1.x).
  • Community SDK.

Getting started

.package(url: "https://github.com/krzyzanowskim/TypeSafe", .upToNextMinor(from: "0.1.0"))

At a glance

Type
Library
Status
beta
Language
Swift
Runtime
Apple platforms library
Has code
yes
Has tests
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

Can I ship the key in my app?

The README warns against it; call the API from your own server.

How are questions declared?

As a struct conforming to SystemOneQuestions with a matching Answers type.

What does it follow?

The official JavaScript SDK's behavior.

Related projects

  • Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.

    MCP serverproductionTypeScript
  • Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.

    PluginproductionTypeScript
  • Effect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.

    ProjectproductionTypeScript
  • PHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.

    ProjectproductionPHP
  • Go MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.

    MCP serverproductionGo
  • Simon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.

    PluginproductionPython