@kindgi/specs 0.0.0-bootstrap.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +124 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/examples/flow.example.with-loop.json +88 -0
- package/examples/pack-index.example.python-pack.json +70 -0
- package/examples/pack-protocol.example.check-invoke.json +15 -0
- package/examples/pack-protocol.example.info.json +8 -0
- package/examples/pack-protocol.example.input-invalid.json +16 -0
- package/examples/pack-protocol.example.tool-invoke.json +12 -0
- package/package.json +53 -4
- package/schemas/agent.schema.json +238 -0
- package/schemas/audit-bundle.schema.json +173 -0
- package/schemas/capability.schema.json +250 -0
- package/schemas/compliance-evidence.schema.json +142 -0
- package/schemas/discoverable.schema.json +142 -0
- package/schemas/eval-suite.schema.json +40 -0
- package/schemas/event.schema.json +69 -0
- package/schemas/flow.schema.json +517 -0
- package/schemas/guardrail.schema.json +261 -0
- package/schemas/memory.schema.json +283 -0
- package/schemas/pack-index.schema.json +277 -0
- package/schemas/pack-protocol.schema.json +228 -0
- package/schemas/pack.schema.json +320 -0
- package/schemas/policy.schema.json +180 -0
- package/schemas/provenance.schema.json +183 -0
- package/schemas/run-event.schema.json +66 -0
- package/schemas/tool.schema.json +297 -0
- package/src/index.ts +25 -0
- package/type-manifest.json +18 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/agent.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.3.0",
|
|
5
|
+
"title": "Agent",
|
|
6
|
+
"description": "An agent definition. Declarative composition of instructions + capabilities + tools + memory retrieval + guardrails + conversation policy. The same definition is durable across restarts and versioned like flows — provenance references agents by (id, version).",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"version",
|
|
11
|
+
"name",
|
|
12
|
+
"instructions",
|
|
13
|
+
"capabilities",
|
|
14
|
+
"tools",
|
|
15
|
+
"retrieval",
|
|
16
|
+
"guardrails"
|
|
17
|
+
],
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"id": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Agent identifier. Convention: '<pack>.<agent>' (e.g. 'acme.citation-verifier')."
|
|
24
|
+
},
|
|
25
|
+
"version": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$",
|
|
28
|
+
"description": "Semver identifying this iteration of the agent. Different versions are different agents for audit purposes."
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"description": "Human-readable display name."
|
|
34
|
+
},
|
|
35
|
+
"description": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Prose describing what the agent does. Shown in catalog + provenance metadata."
|
|
38
|
+
},
|
|
39
|
+
"instructions": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"minLength": 1,
|
|
42
|
+
"description": "System-prompt rendered at the top of every turn. LiquidJS template — {{ variable }} substitution, {% if %} / {% for %} control flow, {{ value | filter }} filters. Every referenced variable must be a declared PromptParameter or a framework auto-var (today, now, agent.*, conversation.*). Rendered with strictVariables — unresolved refs are hard errors."
|
|
43
|
+
},
|
|
44
|
+
"parameters": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"items": { "$ref": "#/$defs/PromptParameter" },
|
|
47
|
+
"description": "Typed parameters supplied at invoke time. UI reads this to build a configuration form; runtime validates required parameters are provided before the model call."
|
|
48
|
+
},
|
|
49
|
+
"capabilities": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"minItems": 1,
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "One Capability declaration — see capability.schema.json."
|
|
55
|
+
},
|
|
56
|
+
"description": "Capability declarations consumed by the router at turn time. One entry per resource kind the agent needs (e.g. LLM inference, embedding, gpu-compute). The router matches each entry by its kind (`Capability.kind`, default `llm-inference`) and its requirements; the array shape lets new kinds arrive without a schema break."
|
|
57
|
+
},
|
|
58
|
+
"tools": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": { "$ref": "#/$defs/ToolRef" },
|
|
61
|
+
"description": "Tools the agent may invoke, as `{ id, version }` references; an empty array makes the agent chat-only. At run start each reference resolves to the highest registered version that satisfies its range; an unresolvable reference fails the turn. Schema-version 1.1.0 replaced the bare-string tool ids of 1.0.0, which `defineAgent` already rejected."
|
|
62
|
+
},
|
|
63
|
+
"retrieval": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": { "$ref": "#/$defs/RetrievalIntent" },
|
|
66
|
+
"description": "Fact-retrieval intents run before every turn to ground the model's context."
|
|
67
|
+
},
|
|
68
|
+
"guardrails": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": { "type": "string", "minLength": 1 },
|
|
71
|
+
"description": "Guardrail ids the agent is subject to. Resolved at turn start against the guardrails bound for the run (an unknown id fails the turn); evaluated on each turn's final response, before it is stored."
|
|
72
|
+
},
|
|
73
|
+
"preferredProvider": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 1,
|
|
76
|
+
"description": "Preferred model provider id. Soft hint: the router prefers this provider when it satisfies the agent's capabilities and tenant policy, and otherwise routes normally."
|
|
77
|
+
},
|
|
78
|
+
"preferredModel": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"minLength": 1,
|
|
81
|
+
"description": "Preferred model name within the selected provider. Soft hint, combined with preferredProvider."
|
|
82
|
+
},
|
|
83
|
+
"conversationPolicy": { "$ref": "#/$defs/ConversationPolicy" },
|
|
84
|
+
"budget": { "$ref": "#/$defs/TurnBudget" },
|
|
85
|
+
"tags": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": { "type": "string", "minLength": 1 },
|
|
88
|
+
"description": "Free-form filter tags for the catalog. Not consumed by execution."
|
|
89
|
+
},
|
|
90
|
+
"output": { "$ref": "#/$defs/AgentOutputSpec" },
|
|
91
|
+
"toolErrors": { "$ref": "#/$defs/ToolErrorsSpec" }
|
|
92
|
+
},
|
|
93
|
+
"$defs": {
|
|
94
|
+
"ToolErrorsSpec": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"description": "What the turn does when a tool call fails (schema-version 1.3.0): the failure goes back to the model as the call's result, so it can correct the call, up to `maxRetries` times per turn, for the kinds in `retryOn`. Default: one retry, for `invalid-arguments` and `unknown-tool`. A tenant `tool-errors` policy can lower it.",
|
|
98
|
+
"properties": {
|
|
99
|
+
"maxRetries": {
|
|
100
|
+
"type": "integer",
|
|
101
|
+
"minimum": 0,
|
|
102
|
+
"maximum": 10,
|
|
103
|
+
"description": "Failed calls sent back to the model per turn. Default 1."
|
|
104
|
+
},
|
|
105
|
+
"retryOn": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"uniqueItems": true,
|
|
108
|
+
"items": { "enum": ["invalid-arguments", "unknown-tool", "tool-error"] },
|
|
109
|
+
"description": "Which failures are sent back: arguments that don't fit the input schema, a tool the agent doesn't have, a tool that ran and failed. Default `invalid-arguments`, `unknown-tool`."
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"AgentOutputSpec": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["schema"],
|
|
117
|
+
"description": "A typed result (schema-version 1.2.0): the final answer must be JSON matching `schema`. An invalid answer is sent back to the model with the problems listed, up to `maxRepairs` times; then the turn fails with `output-schema-violation`.",
|
|
118
|
+
"properties": {
|
|
119
|
+
"schema": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"description": "JSON Schema (draft 2020-12) the final answer must match."
|
|
122
|
+
},
|
|
123
|
+
"name": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"minLength": 1,
|
|
126
|
+
"description": "A name for the output, shown to the model and in errors. Default `output`."
|
|
127
|
+
},
|
|
128
|
+
"maxRepairs": {
|
|
129
|
+
"type": "integer",
|
|
130
|
+
"minimum": 0,
|
|
131
|
+
"description": "How many times the model is asked to repair an invalid answer. Default 1."
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"ToolRef": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": ["id", "version"],
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"description": "A typed tool reference: a tool id plus a semver range. Bare-string ids are not accepted — every reference names both.",
|
|
140
|
+
"properties": {
|
|
141
|
+
"id": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"minLength": 1,
|
|
144
|
+
"pattern": "\\S",
|
|
145
|
+
"description": "Tool id (e.g. 'acme.verify-citation'). Must not be blank."
|
|
146
|
+
},
|
|
147
|
+
"version": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"minLength": 1,
|
|
150
|
+
"pattern": "\\S",
|
|
151
|
+
"description": "npm-style semver range: '1.2.3' pins exactly, '^1.2.3' allows compatible updates, '~1.2.3' patch updates only, '>=1.0.0 <2.0.0' an explicit range. Must not be blank; the range grammar is checked when the reference resolves at run start."
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"PromptParameter": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"required": ["name", "type"],
|
|
158
|
+
"additionalProperties": false,
|
|
159
|
+
"properties": {
|
|
160
|
+
"name": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"minLength": 1,
|
|
163
|
+
"description": "Variable name referenced in the instructions template. Must NOT collide with reserved auto-var namespaces: today, now, agent, conversation."
|
|
164
|
+
},
|
|
165
|
+
"description": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"description": "UI-facing description of what the caller should supply."
|
|
168
|
+
},
|
|
169
|
+
"type": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"enum": ["string", "number", "boolean", "date"]
|
|
172
|
+
},
|
|
173
|
+
"required": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"description": "Default true. Set false to allow the parameter to be omitted."
|
|
176
|
+
},
|
|
177
|
+
"default": {
|
|
178
|
+
"description": "Value used when the caller omits this parameter. Must match the declared type."
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"RetrievalIntent": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"required": ["types", "scope"],
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"properties": {
|
|
187
|
+
"types": {
|
|
188
|
+
"type": "array",
|
|
189
|
+
"minItems": 1,
|
|
190
|
+
"items": { "type": "string", "minLength": 1 }
|
|
191
|
+
},
|
|
192
|
+
"scope": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": ["same-conversation", "same-project", "tenant"]
|
|
195
|
+
},
|
|
196
|
+
"limit": {
|
|
197
|
+
"type": "integer",
|
|
198
|
+
"minimum": 1,
|
|
199
|
+
"description": "Cap on facts per turn. Default 10."
|
|
200
|
+
},
|
|
201
|
+
"mode": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"enum": ["keyword", "semantic", "both"]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"ConversationPolicy": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"additionalProperties": false,
|
|
210
|
+
"properties": {
|
|
211
|
+
"historyLimit": { "type": "integer", "minimum": 1 },
|
|
212
|
+
"autoCloseAfterInactiveSeconds": { "type": "integer", "minimum": 1 },
|
|
213
|
+
"hitlAfterTurns": { "type": "integer", "minimum": 1 }
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"TurnBudget": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"additionalProperties": false,
|
|
219
|
+
"properties": {
|
|
220
|
+
"maxSteps": {
|
|
221
|
+
"type": "integer",
|
|
222
|
+
"minimum": 1,
|
|
223
|
+
"description": "Maximum model→tool→model iterations per turn. Default 8."
|
|
224
|
+
},
|
|
225
|
+
"maxCostUsd": {
|
|
226
|
+
"type": "number",
|
|
227
|
+
"minimum": 0,
|
|
228
|
+
"description": "Maximum USD spend per turn."
|
|
229
|
+
},
|
|
230
|
+
"maxWallMs": {
|
|
231
|
+
"type": "integer",
|
|
232
|
+
"minimum": 1,
|
|
233
|
+
"description": "Wall-clock cap in ms. Default 120000."
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/audit-bundle.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.0.0",
|
|
5
|
+
"title": "HITL audit bundle",
|
|
6
|
+
"description": "A signed export bundling one or more HITL approvals + their decisions + references to the provenance DAGs those approvals concern. Produced by the Kindgi runtime's HITL audit export. Ed25519-signed with the same key material used for provenance signing. Verifiable outside the runtime by an external auditor with only the public key.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"tenantId",
|
|
11
|
+
"generatedAt",
|
|
12
|
+
"approvals",
|
|
13
|
+
"decisions",
|
|
14
|
+
"provenanceRefs",
|
|
15
|
+
"signature"
|
|
16
|
+
],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"id": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"minLength": 1,
|
|
22
|
+
"description": "Unique bundle identifier (UUID). Stable across re-reads."
|
|
23
|
+
},
|
|
24
|
+
"tenantId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1,
|
|
27
|
+
"description": "Sovereignty boundary. All included approvals + decisions belong to this tenant."
|
|
28
|
+
},
|
|
29
|
+
"generatedAt": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"format": "date-time",
|
|
32
|
+
"description": "ISO 8601 UTC timestamp when the bundle was materialized."
|
|
33
|
+
},
|
|
34
|
+
"approvals": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "The approval records included in this bundle. Ordering is not guaranteed; consumers must key by `id`.",
|
|
37
|
+
"items": { "$ref": "#/$defs/approval" }
|
|
38
|
+
},
|
|
39
|
+
"decisions": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"description": "The decision records for approvals in this bundle. Some approvals may not yet have a decision (bundle exported mid-flight); a consumer joins by `approvalId`.",
|
|
42
|
+
"items": { "$ref": "#/$defs/reviewDecision" }
|
|
43
|
+
},
|
|
44
|
+
"provenanceRefs": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"description": "Back-references to the provenance DAGs the approvals concern. Only present when an approval carried a `provenanceRef`. Consumers fetch the DAGs from the provenance API separately — they are NOT embedded here to keep bundles small.",
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"required": ["runId"],
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"properties": {
|
|
52
|
+
"runId": { "type": "string", "minLength": 1 },
|
|
53
|
+
"provenanceId": { "type": "string", "minLength": 1 }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"signature": {
|
|
58
|
+
"$ref": "#/$defs/signature"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"$defs": {
|
|
62
|
+
"approval": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"required": [
|
|
65
|
+
"id",
|
|
66
|
+
"tenantId",
|
|
67
|
+
"subjectKind",
|
|
68
|
+
"subjectRef",
|
|
69
|
+
"requiredRole",
|
|
70
|
+
"status",
|
|
71
|
+
"createdAt",
|
|
72
|
+
"updatedAt"
|
|
73
|
+
],
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"properties": {
|
|
76
|
+
"id": { "type": "string", "minLength": 1 },
|
|
77
|
+
"tenantId": { "type": "string", "minLength": 1 },
|
|
78
|
+
"projectId": { "type": "string", "minLength": 1 },
|
|
79
|
+
"subjectKind": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"minLength": 1,
|
|
82
|
+
"description": "Free-form kind identifier (e.g. 'agent-turn:session-hitl-gate', 'supervisor:fix-proposal', 'pack:install'). Callers namespace their kinds."
|
|
83
|
+
},
|
|
84
|
+
"subjectRef": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"description": "Polymorphic payload describing what needs approval. Shape depends on `subjectKind`.",
|
|
87
|
+
"additionalProperties": true
|
|
88
|
+
},
|
|
89
|
+
"requiredRole": { "$ref": "#/$defs/reviewerRole" },
|
|
90
|
+
"status": { "$ref": "#/$defs/approvalStatus" },
|
|
91
|
+
"assignedTo": { "type": "string", "minLength": 1 },
|
|
92
|
+
"batchKey": { "type": "string" },
|
|
93
|
+
"title": { "type": "string" },
|
|
94
|
+
"description": { "type": "string" },
|
|
95
|
+
"context": { "type": "object", "additionalProperties": true },
|
|
96
|
+
"provenanceRef": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"required": ["runId"],
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"properties": {
|
|
101
|
+
"runId": { "type": "string", "minLength": 1 },
|
|
102
|
+
"provenanceId": { "type": "string", "minLength": 1 }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"waitTokenId": { "type": "string" },
|
|
106
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
107
|
+
"updatedAt": { "type": "string", "format": "date-time" },
|
|
108
|
+
"decidedAt": { "type": "string", "format": "date-time" },
|
|
109
|
+
"expiresAt": { "type": "string", "format": "date-time" }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"reviewDecision": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"id",
|
|
116
|
+
"tenantId",
|
|
117
|
+
"approvalId",
|
|
118
|
+
"reviewerId",
|
|
119
|
+
"decision",
|
|
120
|
+
"reviewerRoleAtDecision",
|
|
121
|
+
"decidedAt"
|
|
122
|
+
],
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"properties": {
|
|
125
|
+
"id": { "type": "string", "minLength": 1 },
|
|
126
|
+
"tenantId": { "type": "string", "minLength": 1 },
|
|
127
|
+
"approvalId": { "type": "string", "minLength": 1 },
|
|
128
|
+
"reviewerId": { "type": "string", "minLength": 1 },
|
|
129
|
+
"decision": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"enum": ["approve", "reject", "escalate", "withdraw"]
|
|
132
|
+
},
|
|
133
|
+
"rationale": { "type": "string" },
|
|
134
|
+
"evidence": { "type": "object", "additionalProperties": true },
|
|
135
|
+
"reviewerRoleAtDecision": {
|
|
136
|
+
"$ref": "#/$defs/reviewerRole",
|
|
137
|
+
"description": "Snapshot of the reviewer's role at the moment of decision. A subsequent role rotation does not rewrite this audit record."
|
|
138
|
+
},
|
|
139
|
+
"decidedAt": { "type": "string", "format": "date-time" }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"reviewerRole": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"enum": ["standard", "senior", "admin"],
|
|
145
|
+
"description": "Reviewer role class. Ordered by escalation authority: standard < senior < admin. `requiredRole` on an approval is the minimum; a higher-ranked reviewer can always decide a lower-tier approval."
|
|
146
|
+
},
|
|
147
|
+
"approvalStatus": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"enum": [
|
|
150
|
+
"pending",
|
|
151
|
+
"assigned",
|
|
152
|
+
"in_review",
|
|
153
|
+
"approved",
|
|
154
|
+
"rejected",
|
|
155
|
+
"escalated",
|
|
156
|
+
"expired",
|
|
157
|
+
"withdrawn"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"signature": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"required": ["algorithm", "keyId", "value", "signedAt"],
|
|
163
|
+
"additionalProperties": false,
|
|
164
|
+
"description": "Ed25519 signature over the canonical JSON projection of the bundle (all fields except this signature). Same algorithm and canonicalization as signed provenance exports.",
|
|
165
|
+
"properties": {
|
|
166
|
+
"algorithm": { "type": "string", "enum": ["ed25519"] },
|
|
167
|
+
"keyId": { "type": "string", "minLength": 1 },
|
|
168
|
+
"value": { "type": "string", "pattern": "^[A-Za-z0-9+/]+={0,2}$" },
|
|
169
|
+
"signedAt": { "type": "string", "format": "date-time" }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/capability.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.1.0",
|
|
5
|
+
"title": "Capability declaration",
|
|
6
|
+
"description": "An agent's model requirements as declarative constraints. The model router matches capabilities against registered providers, respecting per-tenant policy. `defineCapability` validates a declaration against this schema; a declaration that no registered provider satisfies fails at routing time with `capability-unsatisfiable`.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["needs"],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"kind": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"default": "llm-inference",
|
|
15
|
+
"examples": ["llm-inference", "embedding", "gpu-compute", "sandbox-exec", "browser-session"],
|
|
16
|
+
"description": "Resource kind this capability requests. Open string: `examples` lists the well-known kinds, and adapters can declare their own. Absent means `llm-inference`. The router only considers providers whose `capabilityKind` equals it (a provider that declares none counts as `llm-inference`). Added in schema-version 1.1.0."
|
|
17
|
+
},
|
|
18
|
+
"needs": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"items": {
|
|
22
|
+
"$ref": "#/$defs/Requirement"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"prefer": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"$ref": "#/$defs/Preference"
|
|
29
|
+
},
|
|
30
|
+
"description": "Soft preferences: the router picks the highest-scoring model that also satisfies all 'needs'."
|
|
31
|
+
},
|
|
32
|
+
"budget": {
|
|
33
|
+
"$ref": "#/$defs/Budget",
|
|
34
|
+
"description": "Per-invocation budget. Declarative: carried with the declaration but not enforced by the runtime (per-turn spend is capped by the agent's `budget.maxCostUsd`)."
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"$defs": {
|
|
38
|
+
"Requirement": {
|
|
39
|
+
"oneOf": [
|
|
40
|
+
{
|
|
41
|
+
"$ref": "#/$defs/FeatureRequirement"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"$ref": "#/$defs/ContextRequirement"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"$ref": "#/$defs/CostRequirement"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"$ref": "#/$defs/RegionRequirement"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"$ref": "#/$defs/LatencyRequirement"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"$ref": "#/$defs/ProviderRequirement"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"$ref": "#/$defs/ModelRequirement"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"FeatureRequirement": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["feature"],
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"feature": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": [
|
|
71
|
+
"structured-output",
|
|
72
|
+
"vision",
|
|
73
|
+
"audio-input",
|
|
74
|
+
"audio-output",
|
|
75
|
+
"tool-use",
|
|
76
|
+
"parallel-tool-use",
|
|
77
|
+
"thinking",
|
|
78
|
+
"long-context",
|
|
79
|
+
"code-execution",
|
|
80
|
+
"web-search",
|
|
81
|
+
"file-search",
|
|
82
|
+
"streaming",
|
|
83
|
+
"batch"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"ContextRequirement": {
|
|
89
|
+
"type": "object",
|
|
90
|
+
"required": ["contextWindow"],
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"properties": {
|
|
93
|
+
"contextWindow": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"required": ["op", "value"],
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"properties": {
|
|
98
|
+
"op": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": [">=", ">", "=", "<=", "<"]
|
|
101
|
+
},
|
|
102
|
+
"value": {
|
|
103
|
+
"type": "integer",
|
|
104
|
+
"minimum": 1
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"CostRequirement": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"required": ["costPerCall"],
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"properties": {
|
|
115
|
+
"costPerCall": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"required": ["op", "usd"],
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"properties": {
|
|
120
|
+
"op": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": [">=", ">", "=", "<=", "<"]
|
|
123
|
+
},
|
|
124
|
+
"usd": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"minimum": 0
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"RegionRequirement": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"required": ["region"],
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"properties": {
|
|
137
|
+
"region": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "Geographic region constraint (e.g. 'eu-only', 'us-only', 'us-gov'). Enforced by the router against each provider's declared region; a tenant policy's `regionAllow` can constrain it further."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"LatencyRequirement": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"required": ["p95LatencyMs"],
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"properties": {
|
|
148
|
+
"p95LatencyMs": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"required": ["op", "value"],
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"properties": {
|
|
153
|
+
"op": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"enum": ["<=", "<"]
|
|
156
|
+
},
|
|
157
|
+
"value": {
|
|
158
|
+
"type": "integer",
|
|
159
|
+
"minimum": 0
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"ProviderRequirement": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"required": ["providers"],
|
|
168
|
+
"additionalProperties": false,
|
|
169
|
+
"description": "Hard constraint on allowed providers (allowlist) or disallowed providers (denylist). Tenant policy can narrow the set further.",
|
|
170
|
+
"properties": {
|
|
171
|
+
"providers": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"properties": {
|
|
175
|
+
"allow": {
|
|
176
|
+
"type": "array",
|
|
177
|
+
"items": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"deny": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"ModelRequirement": {
|
|
192
|
+
"type": "object",
|
|
193
|
+
"required": ["models"],
|
|
194
|
+
"additionalProperties": false,
|
|
195
|
+
"description": "Hard constraint on allowed models (allowlist) or disallowed models (denylist), matched against each provider's model names (`ModelInfo.name`). Can be combined with a providers requirement. Tenant policy can narrow the set further. Added in schema-version 1.1.0.",
|
|
196
|
+
"properties": {
|
|
197
|
+
"models": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"additionalProperties": false,
|
|
200
|
+
"properties": {
|
|
201
|
+
"allow": {
|
|
202
|
+
"type": "array",
|
|
203
|
+
"items": {
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"deny": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"Preference": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"required": ["feature", "weight"],
|
|
220
|
+
"additionalProperties": false,
|
|
221
|
+
"properties": {
|
|
222
|
+
"feature": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"description": "A capability feature or a soft attribute (e.g. 'lower-cost', 'lower-latency', 'higher-accuracy')."
|
|
225
|
+
},
|
|
226
|
+
"weight": {
|
|
227
|
+
"type": "number"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"Budget": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"additionalProperties": false,
|
|
234
|
+
"properties": {
|
|
235
|
+
"maxCostUsd": {
|
|
236
|
+
"type": "number",
|
|
237
|
+
"minimum": 0
|
|
238
|
+
},
|
|
239
|
+
"maxTokens": {
|
|
240
|
+
"type": "integer",
|
|
241
|
+
"minimum": 0
|
|
242
|
+
},
|
|
243
|
+
"maxDurationMs": {
|
|
244
|
+
"type": "integer",
|
|
245
|
+
"minimum": 0
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|