@dharma-ai-labs/agent-fabric 0.1.26 → 0.2.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.dharma-ai.io/skill-bundle/v1",
3
+ "$id": "https://schemas.dharma-ai.io/skill-bundle/v2",
4
4
  "title": "Signed Organization Skill Bundle",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "properties": {
24
24
  "schema": {
25
- "const": "dharma.skill-bundle/v1"
25
+ "const": "dharma.skill-bundle/v2"
26
26
  },
27
27
  "bundleId": {
28
28
  "type": "string",
@@ -75,7 +75,41 @@
75
75
  "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
76
76
  },
77
77
  "path": {
78
- "type": "string"
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 1024,
81
+ "pattern": "^(?!/)(?!.*\\\\)(?!.*//)(?!\\.{1,2}(?:/|$))(?!.*(?:/)\\.{1,2}(?:/|$))(?:[^/]+/)*[^/]+$"
82
+ },
83
+ "files": {
84
+ "type": "array",
85
+ "minItems": 1,
86
+ "maxItems": 32,
87
+ "items": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "path",
92
+ "contentBase64",
93
+ "sha256"
94
+ ],
95
+ "properties": {
96
+ "path": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "maxLength": 1024,
100
+ "pattern": "^(?!/)(?!.*\\\\)(?!.*//)(?!\\.{1,2}(?:/|$))(?!.*(?:/)\\.{1,2}(?:/|$))(?:[^/]+/)*[^/]+$"
101
+ },
102
+ "contentBase64": {
103
+ "type": "string",
104
+ "maxLength": 1398104,
105
+ "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
106
+ },
107
+ "sha256": {
108
+ "type": "string",
109
+ "pattern": "^sha256:[A-Fa-f0-9]{64}$"
110
+ }
111
+ }
112
+ }
79
113
  }
80
114
  }
81
115
  }
@@ -91,7 +125,36 @@
91
125
  ]
92
126
  },
93
127
  "targetSelectors": {
94
- "type": "object"
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "organizationAgentIds",
132
+ "deviceIds",
133
+ "workspaceIds",
134
+ "providers"
135
+ ],
136
+ "properties": {
137
+ "organizationAgentIds": {
138
+ "type": "array",
139
+ "uniqueItems": true,
140
+ "items": { "type": "string", "format": "uuid" }
141
+ },
142
+ "deviceIds": {
143
+ "type": "array",
144
+ "uniqueItems": true,
145
+ "items": { "type": "string", "format": "uuid" }
146
+ },
147
+ "workspaceIds": {
148
+ "type": "array",
149
+ "uniqueItems": true,
150
+ "items": { "type": "string", "format": "uuid" }
151
+ },
152
+ "providers": {
153
+ "type": "array",
154
+ "uniqueItems": true,
155
+ "items": { "type": "string", "enum": ["codex", "claude", "agy"] }
156
+ }
157
+ }
95
158
  },
96
159
  "activationPolicy": {
97
160
  "type": "string",
@@ -0,0 +1,427 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.dharma-ai.io/trajectory-capsule/v2",
4
+ "title": "Dharma Trajectory Capsule",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema",
9
+ "trajectoryId",
10
+ "revision",
11
+ "organizationId",
12
+ "deviceId",
13
+ "workspaceId",
14
+ "provider",
15
+ "sessionId",
16
+ "captureProvenance",
17
+ "timeRange",
18
+ "status",
19
+ "evidenceMode",
20
+ "coverage",
21
+ "events",
22
+ "contentIndex",
23
+ "redactionReceipt",
24
+ "localEvidenceAvailable",
25
+ "capsuleHash",
26
+ "createdAt"
27
+ ],
28
+ "properties": {
29
+ "schema": {
30
+ "const": "dharma.trajectory-capsule/v2"
31
+ },
32
+ "trajectoryId": {
33
+ "type": "string",
34
+ "format": "uuid"
35
+ },
36
+ "revision": {
37
+ "type": "integer",
38
+ "minimum": 1
39
+ },
40
+ "previousRevisionHash": {
41
+ "type": [
42
+ "string",
43
+ "null"
44
+ ],
45
+ "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
46
+ },
47
+ "organizationId": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "deviceId": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "workspaceId": {
56
+ "type": "string",
57
+ "minLength": 1
58
+ },
59
+ "provider": {
60
+ "type": "string"
61
+ },
62
+ "sessionId": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "taskId": {
67
+ "type": [
68
+ "string",
69
+ "null"
70
+ ]
71
+ },
72
+ "captureProvenance": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["sourceClass", "collectedAt", "taskReceiptHash"],
76
+ "properties": {
77
+ "sourceClass": {
78
+ "type": "string",
79
+ "enum": ["provider_discovery", "explicit_import"]
80
+ },
81
+ "collectedAt": { "type": "string", "format": "date-time" },
82
+ "taskReceiptHash": {
83
+ "type": ["string", "null"],
84
+ "pattern": "^sha256:[A-Fa-f0-9]{64}$"
85
+ }
86
+ }
87
+ },
88
+ "timeRange": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": [
92
+ "start",
93
+ "end"
94
+ ],
95
+ "properties": {
96
+ "start": {
97
+ "type": "string",
98
+ "format": "date-time"
99
+ },
100
+ "end": {
101
+ "type": "string",
102
+ "format": "date-time"
103
+ }
104
+ }
105
+ },
106
+ "status": {
107
+ "type": "string",
108
+ "enum": [
109
+ "open",
110
+ "completed",
111
+ "failed",
112
+ "cancelled",
113
+ "partial"
114
+ ]
115
+ },
116
+ "evidenceMode": {
117
+ "type": "string",
118
+ "enum": [
119
+ "structured",
120
+ "deep",
121
+ "reduced_full_session",
122
+ "incident_capture"
123
+ ]
124
+ },
125
+ "automaticDisclosureMode": {
126
+ "type": "string",
127
+ "enum": ["metadata_only", "local_analysis", "customer_authorized_content"]
128
+ },
129
+ "coverage": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": [
133
+ "state",
134
+ "admittedSessions",
135
+ "excludedSessions",
136
+ "missingFields"
137
+ ],
138
+ "properties": {
139
+ "state": {
140
+ "type": "string",
141
+ "enum": [
142
+ "observed",
143
+ "partial",
144
+ "unavailable"
145
+ ]
146
+ },
147
+ "admittedSessions": {
148
+ "type": "integer",
149
+ "minimum": 0
150
+ },
151
+ "excludedSessions": {
152
+ "type": "integer",
153
+ "minimum": 0
154
+ },
155
+ "missingFields": {
156
+ "type": "array",
157
+ "items": {
158
+ "type": "string"
159
+ },
160
+ "uniqueItems": true
161
+ }
162
+ }
163
+ },
164
+ "repoState": {
165
+ "type": "object"
166
+ },
167
+ "skillState": {
168
+ "type": "object"
169
+ },
170
+ "events": {
171
+ "type": "array",
172
+ "items": {
173
+ "$ref": "https://schemas.dharma-ai.io/agent-event/v1"
174
+ }
175
+ },
176
+ "contentIndex": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "object",
180
+ "additionalProperties": false,
181
+ "required": [
182
+ "contentId",
183
+ "kind",
184
+ "bytes",
185
+ "uploaded",
186
+ "availableLocally"
187
+ ],
188
+ "properties": {
189
+ "contentId": {
190
+ "type": "string",
191
+ "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
192
+ },
193
+ "kind": {
194
+ "type": "string"
195
+ },
196
+ "bytes": {
197
+ "type": "integer",
198
+ "minimum": 0
199
+ },
200
+ "uploaded": {
201
+ "type": "boolean"
202
+ },
203
+ "availableLocally": {
204
+ "type": "boolean"
205
+ },
206
+ "mimeType": {
207
+ "type": [
208
+ "string",
209
+ "null"
210
+ ]
211
+ },
212
+ "normalizedPath": {
213
+ "type": [
214
+ "string",
215
+ "null"
216
+ ]
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "validationResults": {
222
+ "type": "array",
223
+ "items": {
224
+ "type": "object"
225
+ },
226
+ "default": []
227
+ },
228
+ "localAnalysis": {
229
+ "type": ["object", "null"],
230
+ "additionalProperties": false,
231
+ "required": ["schema", "analyzer", "recordCount", "recordBytes", "eventKinds", "toolDiscipline", "outcomeSignals", "durationMs", "semanticReviewRecommended", "reasonCodes"],
232
+ "properties": {
233
+ "schema": { "const": "dharma.local-trajectory-analysis/v1" },
234
+ "analyzer": { "const": "deterministic" },
235
+ "recordCount": { "type": "integer", "minimum": 0 },
236
+ "recordBytes": {
237
+ "type": "object",
238
+ "additionalProperties": false,
239
+ "required": ["total", "maximum"],
240
+ "properties": {
241
+ "total": { "type": "integer", "minimum": 0 },
242
+ "maximum": { "type": "integer", "minimum": 0 }
243
+ }
244
+ },
245
+ "eventKinds": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } },
246
+ "toolDiscipline": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": ["calls", "results", "unmatchedCalls", "orphanResults"],
250
+ "properties": {
251
+ "calls": { "type": "integer", "minimum": 0 },
252
+ "results": { "type": "integer", "minimum": 0 },
253
+ "unmatchedCalls": { "type": "integer", "minimum": 0 },
254
+ "orphanResults": { "type": "integer", "minimum": 0 }
255
+ }
256
+ },
257
+ "outcomeSignals": {
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": ["errorRecords", "incomplete", "coverage"],
261
+ "properties": {
262
+ "errorRecords": { "type": "integer", "minimum": 0 },
263
+ "incomplete": { "type": "boolean" },
264
+ "coverage": { "type": "string", "enum": ["observed", "partial", "unavailable"] }
265
+ }
266
+ },
267
+ "durationMs": { "type": "integer", "minimum": 0 },
268
+ "semanticReviewRecommended": { "type": "boolean" },
269
+ "reasonCodes": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
270
+ }
271
+ },
272
+ "redactionReceipt": {
273
+ "type": "object",
274
+ "additionalProperties": false,
275
+ "required": [
276
+ "policyRevision",
277
+ "disclosureClass",
278
+ "disclosureMode",
279
+ "consentReceiptId",
280
+ "disclosedClasses",
281
+ "excludedClasses",
282
+ "classes",
283
+ "redactedValues",
284
+ "excludedPaths",
285
+ "inputBytes",
286
+ "outputBytes"
287
+ ],
288
+ "properties": {
289
+ "policyRevision": {
290
+ "type": "string"
291
+ },
292
+ "disclosureClass": {
293
+ "const": "automatic_capsule"
294
+ },
295
+ "disclosureMode": {
296
+ "type": "string",
297
+ "enum": ["metadata_only", "local_analysis", "customer_authorized_content"]
298
+ },
299
+ "consentReceiptId": {
300
+ "type": ["string", "null"]
301
+ },
302
+ "disclosedClasses": {
303
+ "type": "array",
304
+ "items": {
305
+ "type": "string"
306
+ },
307
+ "uniqueItems": true,
308
+ "minItems": 1
309
+ },
310
+ "excludedClasses": {
311
+ "type": "array",
312
+ "items": {
313
+ "type": "string"
314
+ },
315
+ "uniqueItems": true,
316
+ "minItems": 1
317
+ },
318
+ "classes": {
319
+ "type": "array",
320
+ "items": {
321
+ "type": "string"
322
+ },
323
+ "uniqueItems": true
324
+ },
325
+ "redactedValues": {
326
+ "type": "integer",
327
+ "minimum": 0
328
+ },
329
+ "excludedPaths": {
330
+ "type": "integer",
331
+ "minimum": 0
332
+ },
333
+ "inputBytes": {
334
+ "type": "integer",
335
+ "minimum": 0
336
+ },
337
+ "outputBytes": {
338
+ "type": "integer",
339
+ "minimum": 0
340
+ }
341
+ }
342
+ },
343
+ "localEvidenceAvailable": {
344
+ "type": "array",
345
+ "items": {
346
+ "type": "object",
347
+ "additionalProperties": false,
348
+ "required": [
349
+ "contentId",
350
+ "kind",
351
+ "bytes"
352
+ ],
353
+ "properties": {
354
+ "contentId": {
355
+ "type": "string",
356
+ "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
357
+ },
358
+ "kind": {
359
+ "type": "string"
360
+ },
361
+ "bytes": {
362
+ "type": "integer",
363
+ "minimum": 0
364
+ }
365
+ }
366
+ }
367
+ },
368
+ "capsuleHash": {
369
+ "type": "string",
370
+ "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$"
371
+ },
372
+ "createdAt": {
373
+ "type": "string",
374
+ "format": "date-time"
375
+ }
376
+ },
377
+ "allOf": [
378
+ {
379
+ "if": {
380
+ "properties": {
381
+ "captureProvenance": {
382
+ "type": "object",
383
+ "properties": {
384
+ "sourceClass": { "const": "signed_task_execution" }
385
+ },
386
+ "required": ["sourceClass"]
387
+ }
388
+ },
389
+ "required": ["captureProvenance"]
390
+ },
391
+ "then": {
392
+ "type": "object",
393
+ "properties": {
394
+ "taskId": { "type": "string", "format": "uuid" },
395
+ "captureProvenance": {
396
+ "type": "object",
397
+ "properties": {
398
+ "taskReceiptHash": { "type": "string", "pattern": "^sha256:[A-Fa-f0-9]{64}$" }
399
+ }
400
+ }
401
+ },
402
+ "required": ["taskId"]
403
+ },
404
+ "else": {
405
+ "type": "object",
406
+ "properties": {
407
+ "taskId": { "type": "null" },
408
+ "captureProvenance": {
409
+ "type": "object",
410
+ "properties": {
411
+ "taskReceiptHash": { "type": "null" }
412
+ }
413
+ },
414
+ "events": {
415
+ "type": "array",
416
+ "items": {
417
+ "type": "object",
418
+ "properties": {
419
+ "skillBundleId": { "type": "null" }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+ ]
427
+ }