dev.cocore.inference.dispatch
Schema Diff
+72 -0
Compatibility Analysis
Breaking Changes Detected
3 breaking changes, 23 non-breaking changes.
Breaking Changes (3)
- RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.type", kind: "prop", name: Some("type") }
- RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.function", kind: "prop", name: Some("function") }
- RequiredEdgeAdded RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function", src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.name", kind: "prop", name: Some("name") }
Non-Breaking Changes (23)
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.name" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.schema" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.strict" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoice" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoiceFunction" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.description" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.name" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.parameters" }
- AddedVertex AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.type" }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.outputSchema", kind: "prop", name: Some("outputSchema") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoice", kind: "prop", name: Some("toolChoice") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoiceFunction", kind: "prop", name: Some("toolChoiceFunction") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.tools", kind: "prop", name: Some("tools") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.name", kind: "prop", name: Some("name") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.schema", kind: "prop", name: Some("schema") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.strict", kind: "prop", name: Some("strict") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools", tgt: "dev.cocore.inference.dispatch:input.tools:items", kind: "items", name: None }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.description", kind: "prop", name: Some("description") }
- AddedEdge AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.parameters", kind: "prop", name: Some("parameters") }
Migration Guidance
Added Elements
AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.name" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.schema" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.outputSchema.strict" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoice" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.toolChoiceFunction" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.description" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.name" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function.parameters" }AddedVertex { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.type" }
Additional Notes
- Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items.function", src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.name", kind: "prop", name: Some("name") }
- Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.type", kind: "prop", name: Some("type") }
- Breaking: RequiredEdgeAdded { vertex_id: "dev.cocore.inference.dispatch:input.tools:items", src: "dev.cocore.inference.dispatch:input.tools:items", tgt: "dev.cocore.inference.dispatch:input.tools:items.function", kind: "prop", name: Some("function") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.outputSchema", kind: "prop", name: Some("outputSchema") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoice", kind: "prop", name: Some("toolChoice") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.toolChoiceFunction", kind: "prop", name: Some("toolChoiceFunction") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input", tgt: "dev.cocore.inference.dispatch:input.tools", kind: "prop", name: Some("tools") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.name", kind: "prop", name: Some("name") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.schema", kind: "prop", name: Some("schema") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.outputSchema", tgt: "dev.cocore.inference.dispatch:input.outputSchema.strict", kind: "prop", name: Some("strict") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools", tgt: "dev.cocore.inference.dispatch:input.tools:items", kind: "items", name: None }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.description", kind: "prop", name: Some("description") }
- Non-breaking: AddedEdge { src: "dev.cocore.inference.dispatch:input.tools:items.function", tgt: "dev.cocore.inference.dispatch:input.tools:items.function.parameters", kind: "prop", name: Some("parameters") }
1
1
{
2
2
"id": "dev.cocore.inference.dispatch",
3
3
"defs": {
4
4
"main": {
5
5
"type": "procedure",
6
6
"input": {
7
7
"schema": {
8
8
"type": "object",
9
9
"required": [
10
10
"model",
11
11
"prompt",
12
12
"maxTokensOut",
13
13
"priceCeiling"
14
14
],
15
15
"properties": {
16
16
"model": {
17
17
"type": "string",
18
18
"minLength": 1
19
19
},
20
20
"nonce": {
21
21
"type": "string",
22
22
"maxLength": 64,
23
23
"minLength": 32,
24
24
"description": "Fresh lowercase-hex freshness challenge (>=16 random bytes) supplied by the caller when `requireConfidential` is set. The provider's enclave signs (ephemeralPubKey || nonce || attestationCid) so the caller can prove the ephemeral seal key was minted for THIS request and is not replayed. Required when requireConfidential is true; ignored otherwise."
25
25
},
26
+
"tools": {
27
+
"type": "array",
28
+
"items": {
29
+
"type": "object",
30
+
"required": [
31
+
"type",
32
+
"function"
33
+
],
34
+
"properties": {
35
+
"type": {
36
+
"type": "string",
37
+
"knownValues": [
38
+
"function"
39
+
]
40
+
},
41
+
"function": {
42
+
"type": "object",
43
+
"required": [
44
+
"name"
45
+
],
46
+
"properties": {
47
+
"name": {
48
+
"type": "string",
49
+
"maxLength": 256
50
+
},
51
+
"parameters": {
52
+
"type": "object",
53
+
"description": "JSON Schema for the function's arguments."
54
+
},
55
+
"description": {
56
+
"type": "string",
57
+
"maxLength": 4096
58
+
}
59
+
}
60
+
}
61
+
}
62
+
},
63
+
"maxLength": 128,
64
+
"description": "Optional list of tool/function definitions the model may call. Public (not encrypted). The published job record carries this list and the provider passes it to the inference engine."
65
+
},
26
66
"prompt": {
27
67
"type": "string",
28
68
"minLength": 1
29
69
},
70
+
"toolChoice": {
71
+
"type": "string",
72
+
"description": "Optional tool choice strategy. 'auto' (default), 'none', or 'required'. Additive.",
73
+
"knownValues": [
74
+
"auto",
75
+
"none",
76
+
"required"
77
+
]
78
+
},
30
79
"maxTokensOut": {
31
80
"type": "integer",
32
81
"minimum": 1
33
82
},
83
+
"outputSchema": {
84
+
"type": "object",
85
+
"properties": {
86
+
"name": {
87
+
"type": "string",
88
+
"description": "Schema name (maps to OpenAI response_format.json_schema.name)."
89
+
},
90
+
"schema": {
91
+
"type": "object",
92
+
"description": "The actual JSON Schema object that constrains the model output."
93
+
},
94
+
"strict": {
95
+
"type": "boolean",
96
+
"description": "Whether to enforce strict schema adherence."
97
+
}
98
+
},
99
+
"description": "Optional JSON Schema to constrain the model output. When present, the published job record carries this schema and the provider passes it to the inference engine as response_format guided decoding. The schema is public (not encrypted) — it describes the output shape, not the input."
100
+
},
34
101
"priceCeiling": {
35
102
"type": "object",
36
103
"required": [
37
104
"amount",
38
105
"currency"
39
106
],
40
107
"properties": {
41
108
"amount": {
42
109
"type": "integer",
43
110
"minimum": 0
44
111
},
45
112
"currency": {
46
113
"type": "string",
47
114
"minLength": 1
48
115
}
49
116
}
50
117
},
51
118
"targetProviderDid": {
52
119
"type": "string",
53
120
"format": "did",
54
121
"description": "Pin dispatch to a specific provider DID instead of letting the advisor route."
55
122
},
123
+
"toolChoiceFunction": {
124
+
"type": "string",
125
+
"maxLength": 256,
126
+
"description": "When toolChoice is 'required', force the model to call this specific function. Maps to OpenAI tool_choice object form. Additive."
127
+
},
56
128
"requireConfidential": {
57
129
"type": "boolean",
58
130
"description": "Demand the `attested-confidential` tier: the chosen provider must present a verified, signing-key-bound Apple MDA chain, a known-good measured cdHash, the hardened-runtime posture, and a fresh enclave-signed ephemeral session key bound to `nonce`. If no eligible provider is available the request fails closed with `ConfidentialUnavailable` rather than silently downgrading to best-effort. Optional / additive; absent or false means best-effort."
59
131
}
60
132
}
61
133
},
62
134
"encoding": "application/json"
63
135
},
64
136
"errors": [
65
137
{
66
138
"name": "AuthRequired",
67
139
"description": "The caller is not authenticated."
68
140
},
69
141
{
70
142
"name": "InvalidRequest",
71
143
"description": "The body failed validation."
72
144
},
73
145
{
74
146
"name": "ConfidentialUnavailable",
75
147
"description": "requireConfidential was set but no provider could satisfy the attested-confidential tier (no verified+bound MDA chain, cdHash not in the known-good set, posture failed, or the ephemeral session handshake did not verify). The request was NOT downgraded; no prompt was sealed."
76
148
}
77
149
],
78
150
"output": {
79
151
"encoding": "text/event-stream",
80
152
"description": "A Server-Sent Events stream of `meta`, `chunk`, `complete`, and `error` frames (see the method description for payloads)."
81
153
},
82
154
"description": "Submit an inference request and stream the result back as Server-Sent Events. Authenticates the requester, runs the dispatch core, and emits typed SSE frames. Unlike `submit` (which returns URIs to poll), `dispatch` drives the full request and streams plaintext output chunks until completion.\n\nConfidentiality: by default the AppView seals the prompt to the chosen provider on the caller's behalf (`best-effort` tier) — convenient, but the AppView is in the plaintext path. A caller that needs privacy FROM the provider sets `requireConfidential` and supplies a fresh `nonce`; the AppView then runs the verified, enclave-bound ephemeral handshake and either confirms an `attested-confidential` session or fails closed with the `ConfidentialUnavailable` error. For genuine end-to-end confidentiality the prompt is sealed at the client edge (SDK/browser) and the AppView forwards ciphertext only; this method's server-side seal path is always `best-effort`.\n\nSSE events:\n * `meta` — { jobUri, jobCid, authUri, inputCommitment, providerDid, sessionId, tier }\n * `sessionKey` — { ephemeralPubKey, nonce, attestationCid, signature } (only when `requireConfidential`; the enclave-signed fresh key the requester verifies before sealing)\n * `chunk` — { seq, text } (plaintext, decrypted)\n * `complete` — { tokensIn, tokensOut, receiptUri, tier, providerCredit? }\n * `error` — { reason, code }"
83
155
}
84
156
},
85
157
"$type": "com.atproto.lexicon.schema",
86
158
"lexicon": 1
87
159
}