Skip to content

Commit 3761e31

Browse files
committed
Clarify SDK boundaries and usage levels in README
1 parent a81ea92 commit 3761e31

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,40 @@ Use `CodexKit` if you are building a SwiftUI/iOS app and want:
2121

2222
The SDK stays tool-agnostic. Your app defines the tool surface and runtime UX.
2323

24+
## Core Concepts
25+
26+
- `AgentRuntime`
27+
The main entry point. Owns auth state, threads, tool execution, personas, skills, and optional memory.
28+
- `AgentThread`
29+
A persistent conversation with its own status, title, persona stack, skill IDs, and optional memory context.
30+
- `UserMessageRequest`
31+
A single turn request. Can include text, images, imported content, persona override, skill override, and memory selection.
32+
- `CodexResponsesBackend`
33+
The built-in ChatGPT/Codex-style backend used for text/image/tool turns.
34+
- `ToolDefinition`
35+
A host-defined capability the model can call through your app.
36+
- `AgentPersonaStack`
37+
Layered behavior instructions pinned to a thread or applied for one turn.
38+
- `AgentSkill`
39+
A behavior module that can carry instructions plus tool policy.
40+
- `AgentStructuredOutput`
41+
A typed `Decodable` contract for schema-constrained replies.
42+
- `AgentMemoryConfiguration`
43+
Optional local memory storage, retrieval, ranking, and capture policy.
44+
45+
## Choose Your Level
46+
47+
- Simple chat
48+
Sign in, create a thread, and call `streamMessage(...)` or `sendMessage(...)`.
49+
- Typed app flows
50+
Use `sendMessage(..., expecting:)` to get a `Decodable` value back.
51+
- Tool-driven agents
52+
Register host tools and optionally gate them with approvals.
53+
- Rich behavior
54+
Add thread personas, skills, and execution policies.
55+
- Memory-backed agents
56+
Opt into automatic memory capture, guided writing, or raw record management.
57+
2458
## Quickstart (5 Minutes)
2559

2660
1. Add this package to your Xcode project.
@@ -125,6 +159,17 @@ The recommended production path for iOS is:
125159

126160
For browser OAuth, `CodexKit` uses the Codex-compatible redirect `http://localhost:1455/auth/callback` internally and only runs the loopback listener during active auth.
127161

162+
## Platform Boundary
163+
164+
`CodexKit` ships a ChatGPT/Codex-style account flow and backend. It does not provide general OpenAI API platform access.
165+
166+
That means:
167+
168+
- built in: ChatGPT sign-in, Codex-style threaded turns, tools, personas, skills, structured output, and optional local memory
169+
- not built in: separate API-key-based OpenAI platform clients, Realtime voice sessions, or other non-Codex API access
170+
171+
If your app needs capabilities outside the built-in backend path, the intended approach is to expose them through your own host tools or custom backend integration.
172+
128173
`CodexResponsesBackend` also includes built-in retry/backoff for transient failures (`429`, `5xx`, and network-transient URL errors like `networkConnectionLost`). You can tune or disable it:
129174

130175
```swift
@@ -163,6 +208,15 @@ Available values:
163208

164209
## Typed Completions
165210

211+
For most apps, there are now three common send paths:
212+
213+
- `streamMessage(...)`
214+
Stream deltas, tool events, approvals, and final turn completion.
215+
- `sendMessage(...)`
216+
Return the assistant's final text as a `String`.
217+
- `sendMessage(..., expecting:)`
218+
Return a typed `Decodable` value from a structured response.
219+
166220
For App Intents, share flows, widgets, or other non-chat surfaces, `CodexKit` can return a typed value directly from `sendMessage`:
167221

168222
```swift
@@ -560,6 +614,17 @@ The demo app exercises:
560614
- a one-tap skill policy probe that compares tool behavior in normal vs skill-constrained threads
561615
- a Health Coach tab with HealthKit steps, AI-generated coaching, local reminders, and tone switching
562616

617+
Each tab is focused on a single story:
618+
619+
- `Assistant`
620+
Chat runtime, auth, threads, tools, reasoning level, personas, and skills.
621+
- `Structured`
622+
Typed structured output and imported-content flows.
623+
- `Memory`
624+
High-, mid-, and low-level memory APIs.
625+
- `Health Coach`
626+
A product-style demo using tools, memory, notifications, and HealthKit-backed context.
627+
563628
## Skill Examples
564629

565630
`CodexKit` skills are behavior modules, not just tone layers. They can carry both instructions and execution policy (tool allow/require/sequence/call limits).
@@ -687,6 +752,16 @@ print(preview)
687752

688753
`CodexKit` uses Semantic Versioning. The latest stable release is `v1.1.0`, while `main` tracks the upcoming 2.0 development line.
689754

755+
### 2.0 Messaging API
756+
757+
The 2.0 line standardizes runtime sends around:
758+
759+
- `streamMessage(...)` for streaming turn events
760+
- `sendMessage(...)` for final text
761+
- `sendMessage(..., expecting:)` for typed structured replies
762+
763+
This is the shape new examples and docs target on `main`.
764+
690765
- Release notes live in [CHANGELOG.md](CHANGELOG.md)
691766
- CI runs on pushes/PRs via [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
692767
- Pushing a `v*` tag creates a GitHub Release automatically via [`.github/workflows/release.yml`](.github/workflows/release.yml)

0 commit comments

Comments
 (0)