@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.
@@ -0,0 +1,320 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kindgi.com/schemas/v1/pack.schema.json",
4
+ "$comment": "schema-version: 1.1.0",
5
+ "title": "Pack manifest",
6
+ "description": "An installable vertical application. Bundles agents, tools, guardrails, memory schemas, capability declarations, and UI metadata — all as data. Installation is 'load this manifest into tenant config'. Pack tools reach the runtime over MCP (`mcpEndpoint`), as a handler artifact (`codeArtifactRef`), or as a declarative `spec`; pack code runs outside the runtime server process, in a separate process or container.",
7
+ "type": "object",
8
+ "required": ["id", "version", "name", "manifestVersion"],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "manifestVersion": {
12
+ "type": "string",
13
+ "const": "1.0",
14
+ "description": "Version of the pack manifest schema itself. Bumped on breaking manifest changes."
15
+ },
16
+ "id": {
17
+ "type": "string",
18
+ "pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)*$",
19
+ "minLength": 1,
20
+ "description": "Globally unique pack id (dotted lowercase, e.g. 'com.acme.support')."
21
+ },
22
+ "version": {
23
+ "type": "string",
24
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
25
+ },
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "description": {
31
+ "type": "string"
32
+ },
33
+ "author": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "properties": {
37
+ "name": {
38
+ "type": "string"
39
+ },
40
+ "url": {
41
+ "type": "string",
42
+ "format": "uri"
43
+ },
44
+ "email": {
45
+ "type": "string",
46
+ "format": "email"
47
+ }
48
+ }
49
+ },
50
+ "homepage": {
51
+ "type": "string",
52
+ "format": "uri"
53
+ },
54
+ "license": {
55
+ "type": "string"
56
+ },
57
+ "requiresOsVersion": {
58
+ "type": "string",
59
+ "description": "Semver range of Kindgi runtime versions this pack is compatible with (e.g. '>=1.0.0 <2.0.0')."
60
+ },
61
+ "agents": {
62
+ "type": "array",
63
+ "items": {
64
+ "$ref": "#/$defs/AgentDecl"
65
+ },
66
+ "description": "Agents this pack contributes. Each is a full agent definition (declarative)."
67
+ },
68
+ "flows": {
69
+ "type": "array",
70
+ "items": {
71
+ "$ref": "#/$defs/FlowDecl"
72
+ },
73
+ "description": "Task flows this pack contributes (references to flow documents)."
74
+ },
75
+ "tools": {
76
+ "type": "array",
77
+ "items": {
78
+ "$ref": "#/$defs/ToolDecl"
79
+ },
80
+ "description": "Tools this pack contributes. Tools that run pack code point at it through an `mcpEndpoint` (the pack's MCP server) or a `codeArtifactRef` (a handler artifact); declarative tools carry a `spec`."
81
+ },
82
+ "guardrails": {
83
+ "type": "array",
84
+ "items": {
85
+ "$ref": "#/$defs/GuardrailDecl"
86
+ }
87
+ },
88
+ "memorySchemas": {
89
+ "type": "array",
90
+ "items": {
91
+ "$ref": "#/$defs/MemorySchemaDecl"
92
+ },
93
+ "description": "Fact type schemas this pack defines. Registered so the memory layer knows how to validate writes."
94
+ },
95
+ "capabilities": {
96
+ "type": "array",
97
+ "items": {
98
+ "$ref": "#/$defs/CapabilityDecl"
99
+ },
100
+ "description": "Capability declarations named by this pack (referenced by pack agents)."
101
+ },
102
+ "ui": {
103
+ "$ref": "#/$defs/UiMetadata",
104
+ "description": "Optional metadata for how Kindgi UIs display this pack (icon, category, tags, external app URL)."
105
+ },
106
+ "requiredNeeds": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "string"
110
+ },
111
+ "description": "Context slots this pack requires the tenant to have configured (e.g. 'model:vision-capable', 'blob', 'compliance-provider'). Install fails if any is unmet."
112
+ },
113
+ "permissions": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string"
117
+ },
118
+ "description": "Permissions this pack asks the admin to grant on install (e.g. 'memory:write:facts', 'blob:write', 'events:emit'). Enforced by the tenant policy engine."
119
+ },
120
+ "signature": {
121
+ "$ref": "#/$defs/PackSignature"
122
+ }
123
+ },
124
+ "$defs": {
125
+ "AgentDecl": {
126
+ "type": "object",
127
+ "required": ["id", "instructions", "capabilities"],
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "id": {
131
+ "type": "string",
132
+ "minLength": 1
133
+ },
134
+ "name": {
135
+ "type": "string"
136
+ },
137
+ "description": {
138
+ "type": "string"
139
+ },
140
+ "instructions": {
141
+ "type": "string",
142
+ "description": "System prompt / instructions for the agent."
143
+ },
144
+ "capabilities": {
145
+ "description": "Reference to a capability declaration by id, or an inline capability declaration.",
146
+ "oneOf": [
147
+ {
148
+ "type": "string"
149
+ },
150
+ {
151
+ "$ref": "https://kindgi.com/schemas/v1/capability.schema.json"
152
+ }
153
+ ]
154
+ },
155
+ "tools": {
156
+ "type": "array",
157
+ "items": {
158
+ "$ref": "https://kindgi.com/schemas/v1/agent.schema.json#/$defs/ToolRef"
159
+ },
160
+ "description": "Tools this agent is allowed to call, as `{ id, version }` references — the same `ToolRef` shape as `agent.schema.json`. Schema-version 1.1.0 replaced the bare-string tool ids of 1.0.0."
161
+ },
162
+ "memory": {
163
+ "type": "object",
164
+ "additionalProperties": true,
165
+ "description": "Memory binding configuration (which fact types the agent reads/writes, retrieval hints)."
166
+ },
167
+ "guardrails": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ },
172
+ "description": "Guardrail ids that apply to this agent."
173
+ },
174
+ "exitConditions": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "maxTurns": {
179
+ "type": "integer",
180
+ "minimum": 1
181
+ },
182
+ "maxToolCalls": {
183
+ "type": "integer",
184
+ "minimum": 0
185
+ },
186
+ "maxDurationMs": {
187
+ "type": "integer",
188
+ "minimum": 0
189
+ }
190
+ }
191
+ }
192
+ }
193
+ },
194
+ "FlowDecl": {
195
+ "type": "object",
196
+ "required": ["path"],
197
+ "additionalProperties": false,
198
+ "properties": {
199
+ "path": {
200
+ "type": "string",
201
+ "description": "Relative path (within the pack bundle) to a JSON file conforming to flow.schema.json."
202
+ }
203
+ }
204
+ },
205
+ "ToolDecl": {
206
+ "oneOf": [
207
+ {
208
+ "type": "object",
209
+ "required": ["path"],
210
+ "additionalProperties": false,
211
+ "properties": {
212
+ "path": {
213
+ "type": "string",
214
+ "description": "Relative path to a JSON file conforming to tool.schema.json."
215
+ }
216
+ }
217
+ },
218
+ {
219
+ "$ref": "https://kindgi.com/schemas/v1/tool.schema.json"
220
+ }
221
+ ]
222
+ },
223
+ "GuardrailDecl": {
224
+ "oneOf": [
225
+ {
226
+ "type": "object",
227
+ "required": ["path"],
228
+ "additionalProperties": false,
229
+ "properties": {
230
+ "path": {
231
+ "type": "string"
232
+ }
233
+ }
234
+ },
235
+ {
236
+ "$ref": "https://kindgi.com/schemas/v1/guardrail.schema.json"
237
+ }
238
+ ]
239
+ },
240
+ "MemorySchemaDecl": {
241
+ "type": "object",
242
+ "required": ["factType", "schema"],
243
+ "additionalProperties": false,
244
+ "properties": {
245
+ "factType": {
246
+ "type": "string",
247
+ "description": "Fact type identifier this schema governs."
248
+ },
249
+ "schema": {
250
+ "type": "object",
251
+ "description": "JSON Schema (Draft 2020-12) for the fact content."
252
+ },
253
+ "retrieve": {
254
+ "type": "string",
255
+ "enum": ["semantic", "recency", "exact", "flow", "none"],
256
+ "description": "Default retrieval hint for facts of this type."
257
+ }
258
+ }
259
+ },
260
+ "CapabilityDecl": {
261
+ "type": "object",
262
+ "required": ["id", "declaration"],
263
+ "additionalProperties": false,
264
+ "properties": {
265
+ "id": {
266
+ "type": "string",
267
+ "minLength": 1
268
+ },
269
+ "declaration": {
270
+ "$ref": "https://kindgi.com/schemas/v1/capability.schema.json"
271
+ }
272
+ }
273
+ },
274
+ "UiMetadata": {
275
+ "type": "object",
276
+ "additionalProperties": false,
277
+ "properties": {
278
+ "icon": {
279
+ "type": "string"
280
+ },
281
+ "category": {
282
+ "type": "string"
283
+ },
284
+ "tags": {
285
+ "type": "array",
286
+ "items": {
287
+ "type": "string"
288
+ }
289
+ },
290
+ "externalAppUrl": {
291
+ "type": "string",
292
+ "format": "uri",
293
+ "description": "URL of the pack's own user-facing UI (separate app consuming the Kindgi client SDK). A pack's own drafting UI, for example, lives here — not embedded in Kindgi's own UI."
294
+ }
295
+ }
296
+ },
297
+ "PackSignature": {
298
+ "type": "object",
299
+ "required": ["algorithm", "keyId", "value", "signedAt"],
300
+ "additionalProperties": false,
301
+ "properties": {
302
+ "algorithm": {
303
+ "type": "string",
304
+ "enum": ["ed25519"]
305
+ },
306
+ "keyId": {
307
+ "type": "string"
308
+ },
309
+ "value": {
310
+ "type": "string",
311
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$"
312
+ },
313
+ "signedAt": {
314
+ "type": "string",
315
+ "format": "date-time"
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
@@ -0,0 +1,180 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kindgi.com/schemas/v1/policy.schema.json",
4
+ "$comment": "schema-version: 1.0.0",
5
+ "title": "Tenant policy",
6
+ "description": "Kernel-level access control for a tenant. Enforced at every boundary — agent construction, tool invocation, memory read/write, blob access, model routing, event subscription. Applications cannot bypass; they inherit. The decision engine is pluggable (e.g. OpenFGA, Zanzibar-style) — this schema is transport-neutral.",
7
+ "type": "object",
8
+ "required": ["id", "tenantId", "version", "rules"],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "id": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "tenantId": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "version": {
20
+ "type": "string",
21
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
22
+ "description": "Semver — policy edits produce a new version. Decisions are traceable back to the version in force at the time."
23
+ },
24
+ "description": {
25
+ "type": "string"
26
+ },
27
+ "rules": {
28
+ "type": "array",
29
+ "items": {
30
+ "$ref": "#/$defs/Rule"
31
+ }
32
+ },
33
+ "defaults": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "description": "Fail-closed defaults. If no rule matches a decision request, these apply.",
37
+ "properties": {
38
+ "onNoMatch": {
39
+ "type": "string",
40
+ "enum": ["deny", "allow"],
41
+ "default": "deny"
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "$defs": {
47
+ "Rule": {
48
+ "type": "object",
49
+ "required": ["id", "effect", "principal", "resource", "action"],
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "id": {
53
+ "type": "string",
54
+ "minLength": 1
55
+ },
56
+ "effect": {
57
+ "type": "string",
58
+ "enum": ["allow", "deny"]
59
+ },
60
+ "principal": {
61
+ "$ref": "#/$defs/PrincipalSelector"
62
+ },
63
+ "resource": {
64
+ "$ref": "#/$defs/ResourceSelector"
65
+ },
66
+ "action": {
67
+ "type": "array",
68
+ "minItems": 1,
69
+ "items": {
70
+ "type": "string",
71
+ "description": "Action verb (e.g. 'read', 'write', 'invoke', 'subscribe', 'delete', 'approve', 'route', 'sign')."
72
+ }
73
+ },
74
+ "condition": {
75
+ "type": "object",
76
+ "additionalProperties": true,
77
+ "description": "Optional structured condition (e.g. time window, IP allowlist, attribute match). Engine-specific evaluation."
78
+ },
79
+ "description": {
80
+ "type": "string"
81
+ }
82
+ }
83
+ },
84
+ "PrincipalSelector": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "description": "Who this rule applies to. At least one selector field required.",
88
+ "minProperties": 1,
89
+ "properties": {
90
+ "userIds": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "string"
94
+ }
95
+ },
96
+ "roles": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "string"
100
+ }
101
+ },
102
+ "groups": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ },
108
+ "agentIds": {
109
+ "type": "array",
110
+ "items": {
111
+ "type": "string"
112
+ }
113
+ },
114
+ "toolIds": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string"
118
+ }
119
+ },
120
+ "packIds": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string"
124
+ }
125
+ },
126
+ "any": {
127
+ "type": "boolean",
128
+ "description": "If true, applies to any principal (used for public/anonymous rules — rare)."
129
+ }
130
+ }
131
+ },
132
+ "ResourceSelector": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "description": "What this rule governs.",
136
+ "minProperties": 1,
137
+ "properties": {
138
+ "kind": {
139
+ "type": "string",
140
+ "enum": [
141
+ "memory-fact",
142
+ "memory-log",
143
+ "blob",
144
+ "run",
145
+ "flow",
146
+ "agent",
147
+ "tool",
148
+ "model",
149
+ "event-subscription",
150
+ "provenance",
151
+ "approval-queue",
152
+ "pack-config",
153
+ "tenant-config",
154
+ "secret",
155
+ "audit-log"
156
+ ]
157
+ },
158
+ "ids": {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "string"
162
+ },
163
+ "description": "Specific resource ids. If absent, applies to all resources of the kind."
164
+ },
165
+ "scope": {
166
+ "type": "object",
167
+ "additionalProperties": true,
168
+ "description": "Scope match (project, thread, session, org). Fields interpreted per resource kind."
169
+ },
170
+ "tags": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "string"
174
+ },
175
+ "description": "Match resources bearing all these tags."
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
@@ -0,0 +1,183 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kindgi.com/schemas/v1/provenance.schema.json",
4
+ "$comment": "schema-version: 1.0.0",
5
+ "title": "Provenance DAG",
6
+ "description": "Causal DAG for a run. Every output node has edges back to every input that influenced it — prompts, retrieved chunks, tool results, prior turns, model version, tenant policy in effect. This is the PRIMARY audit artifact, not a derivative of OTel spans. Signed with Ed25519 for verification outside the runtime.",
7
+ "type": "object",
8
+ "required": ["id", "runId", "tenantId", "version", "nodes", "edges", "createdAt"],
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "id": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "description": "Unique provenance record identifier."
15
+ },
16
+ "runId": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "description": "The kernel run this DAG describes."
20
+ },
21
+ "tenantId": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "description": "Tenant that owns this provenance record. Cross-tenant reads are denied by policy."
25
+ },
26
+ "version": {
27
+ "type": "string",
28
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
29
+ "description": "Schema version for this DAG document (semver)."
30
+ },
31
+ "createdAt": {
32
+ "type": "string",
33
+ "format": "date-time",
34
+ "description": "When this DAG was emitted (ISO-8601 UTC)."
35
+ },
36
+ "flowRef": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "description": "The flow and version this run executed.",
40
+ "required": ["id", "version"],
41
+ "properties": {
42
+ "id": {
43
+ "type": "string"
44
+ },
45
+ "version": {
46
+ "type": "string"
47
+ }
48
+ }
49
+ },
50
+ "nodes": {
51
+ "type": "array",
52
+ "items": {
53
+ "$ref": "#/$defs/Node"
54
+ }
55
+ },
56
+ "edges": {
57
+ "type": "array",
58
+ "items": {
59
+ "$ref": "#/$defs/Edge"
60
+ }
61
+ },
62
+ "signature": {
63
+ "$ref": "#/$defs/Signature"
64
+ }
65
+ },
66
+ "$defs": {
67
+ "Node": {
68
+ "type": "object",
69
+ "required": ["id", "kind", "timestamp"],
70
+ "additionalProperties": false,
71
+ "properties": {
72
+ "id": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "kind": {
77
+ "type": "string",
78
+ "enum": [
79
+ "input",
80
+ "prompt",
81
+ "retrieval",
82
+ "tool-call",
83
+ "tool-result",
84
+ "model-call",
85
+ "model-output",
86
+ "artifact",
87
+ "guardrail-check",
88
+ "event",
89
+ "policy-decision",
90
+ "memory-read",
91
+ "memory-write",
92
+ "wait",
93
+ "resume"
94
+ ],
95
+ "description": "What this node represents in the causal chain."
96
+ },
97
+ "actor": {
98
+ "type": "string",
99
+ "description": "Which agent/tool/subsystem produced this node (id or name)."
100
+ },
101
+ "timestamp": {
102
+ "type": "string",
103
+ "format": "date-time"
104
+ },
105
+ "contentHash": {
106
+ "type": "string",
107
+ "pattern": "^sha256:[0-9a-f]{64}$",
108
+ "description": "Content-addressed hash of the node's payload. Enables dedup + tamper detection without storing the payload inline."
109
+ },
110
+ "contentRef": {
111
+ "type": "string",
112
+ "description": "Optional blob reference for large payloads (e.g. full model outputs). Format: 'blob://<provider>/<bucket>/<key>'."
113
+ },
114
+ "modelVersion": {
115
+ "type": "string",
116
+ "description": "Model + version, for model-call and model-output nodes (e.g. 'anthropic/claude-opus-4-7@2026-06-01')."
117
+ },
118
+ "policyDecisionId": {
119
+ "type": "string",
120
+ "description": "For policy-decision nodes: the ID that resolves to the full decision record."
121
+ },
122
+ "attributes": {
123
+ "type": "object",
124
+ "additionalProperties": true,
125
+ "description": "Kind-specific attributes. Interpreted per node kind; consumers should tolerate unknown attributes for forward compatibility."
126
+ }
127
+ }
128
+ },
129
+ "Edge": {
130
+ "type": "object",
131
+ "required": ["from", "to", "kind"],
132
+ "additionalProperties": false,
133
+ "properties": {
134
+ "from": {
135
+ "type": "string",
136
+ "minLength": 1
137
+ },
138
+ "to": {
139
+ "type": "string",
140
+ "minLength": 1
141
+ },
142
+ "kind": {
143
+ "type": "string",
144
+ "enum": [
145
+ "caused-by",
146
+ "influenced-by",
147
+ "retrieved-from",
148
+ "invoked",
149
+ "produced",
150
+ "checked-against",
151
+ "waited-on",
152
+ "resumed-from"
153
+ ]
154
+ }
155
+ }
156
+ },
157
+ "Signature": {
158
+ "type": "object",
159
+ "required": ["algorithm", "keyId", "value", "signedAt"],
160
+ "additionalProperties": false,
161
+ "description": "Cryptographic signature over the canonical serialization of (nodes, edges, id, runId, tenantId, createdAt, flowRef).",
162
+ "properties": {
163
+ "algorithm": {
164
+ "type": "string",
165
+ "enum": ["ed25519"]
166
+ },
167
+ "keyId": {
168
+ "type": "string",
169
+ "description": "Identifier of the signing key (per-tenant or per-deployment)."
170
+ },
171
+ "value": {
172
+ "type": "string",
173
+ "description": "Base64-encoded signature bytes.",
174
+ "pattern": "^[A-Za-z0-9+/]+={0,2}$"
175
+ },
176
+ "signedAt": {
177
+ "type": "string",
178
+ "format": "date-time"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ }