@dharma-ai-labs/agent-fabric 0.2.186 → 0.2.188

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.
Files changed (42) hide show
  1. package/dist/index.d.ts +74 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +296 -12
  4. package/dist/index.js.map +1 -1
  5. package/dist/namedSessionNativeAudit.d.ts +20 -25
  6. package/dist/namedSessionNativeAudit.d.ts.map +1 -1
  7. package/dist/namedSessionNativeAudit.js.map +1 -1
  8. package/dist/repositoryCandidateSync.d.ts +109 -2
  9. package/dist/repositoryCandidateSync.d.ts.map +1 -1
  10. package/dist/repositoryCandidateSync.js +327 -22
  11. package/dist/repositoryCandidateSync.js.map +1 -1
  12. package/dist/repositoryCandidateSync.test.js +912 -6
  13. package/dist/repositoryCandidateSync.test.js.map +1 -1
  14. package/dist/repositoryKnowledgeRetention.test.js +319 -3
  15. package/dist/repositoryKnowledgeRetention.test.js.map +1 -1
  16. package/dist/repositorySourceInventoryClient.d.ts +1 -0
  17. package/dist/repositorySourceInventoryClient.d.ts.map +1 -1
  18. package/dist/repositorySourceInventoryClient.js +4 -1
  19. package/dist/repositorySourceInventoryClient.js.map +1 -1
  20. package/dist/repositorySourceRestoration.d.ts +47 -0
  21. package/dist/repositorySourceRestoration.d.ts.map +1 -0
  22. package/dist/repositorySourceRestoration.js +140 -0
  23. package/dist/repositorySourceRestoration.js.map +1 -0
  24. package/dist/repositorySourceRestorationCommand.test.d.ts +2 -0
  25. package/dist/repositorySourceRestorationCommand.test.d.ts.map +1 -0
  26. package/dist/repositorySourceRestorationCommand.test.js +754 -0
  27. package/dist/repositorySourceRestorationCommand.test.js.map +1 -0
  28. package/dist/repositorySourceSync.d.ts +1 -0
  29. package/dist/repositorySourceSync.d.ts.map +1 -1
  30. package/dist/repositorySourceSync.js +10 -4
  31. package/dist/repositorySourceSync.js.map +1 -1
  32. package/dist/repositorySourceSync.test.js +38 -4
  33. package/dist/repositorySourceSync.test.js.map +1 -1
  34. package/dist/schemas/repository-candidate-fence-v1.schema.json +55 -0
  35. package/dist/schemas/repository-candidate-upload-v1.schema.json +60 -0
  36. package/dist/schemas/repository-knowledge-restoration-v1.schema.json +16 -0
  37. package/dist/schemas/task-action.schema.json +1 -1
  38. package/dist/schemas/task-envelope.schema.json +5 -1
  39. package/dist/usage.d.ts.map +1 -1
  40. package/dist/usage.js +3 -1
  41. package/dist/usage.js.map +1 -1
  42. package/package.json +5 -5
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.dharma-ai.io/repository-candidate-upload/v1",
4
+ "title": "Repository Candidate Upload",
5
+ "description": "Device-signed source submission. Restoration context and attempt are operation provenance, not enrollment or activation authority.",
6
+ "type": "object", "additionalProperties": false,
7
+ "required": ["schema", "operationId", "workspaceId", "repositoryBindingId", "repositoryAgentId", "sourceSnapshotHash", "sourceManifestHash", "consolidation", "snapshot"],
8
+ "properties": {
9
+ "schema": { "const": "dharma.repository-candidate-upload/v1" },
10
+ "operationId": { "$ref": "#/$defs/hash" },
11
+ "workspaceId": { "$ref": "#/$defs/uuid" },
12
+ "repositoryBindingId": { "$ref": "#/$defs/uuid" },
13
+ "repositoryAgentId": { "$ref": "#/$defs/uuid" },
14
+ "sourceSnapshotHash": { "$ref": "#/$defs/hash" },
15
+ "sourceManifestHash": { "$ref": "#/$defs/hash" },
16
+ "restorationAttempt": { "$ref": "#/$defs/uuid" },
17
+ "restorationContext": {
18
+ "type": "object", "additionalProperties": false, "required": ["headCandidateId", "priorReleaseId"],
19
+ "properties": { "headCandidateId": { "$ref": "#/$defs/uuid" }, "priorReleaseId": { "$ref": "#/$defs/uuid" } }
20
+ },
21
+ "consolidation": {
22
+ "type": "object", "additionalProperties": false,
23
+ "required": ["mode", "includeApprovedOutputs", "requireAtlasAssociation"],
24
+ "properties": {
25
+ "mode": { "enum": ["initial_repository", "repository_update"] },
26
+ "includeApprovedOutputs": { "const": true }, "requireAtlasAssociation": { "const": true },
27
+ "expectedLatestSourceFingerprint": { "$ref": "#/$defs/hash" }
28
+ }
29
+ },
30
+ "snapshot": {
31
+ "type": "object", "additionalProperties": false, "required": ["schema", "capturedAt", "manifest", "blobs"],
32
+ "properties": {
33
+ "schema": { "const": "dharma.repository-package-snapshot/v1" },
34
+ "capturedAt": { "type": "string", "format": "date-time" },
35
+ "manifest": { "anyOf": [
36
+ { "$ref": "https://schemas.dharma-ai.io/repository-package/v1" },
37
+ { "$ref": "https://schemas.dharma-ai.io/repository-package/v2" },
38
+ { "$ref": "https://schemas.dharma-ai.io/repository-package/v3" }
39
+ ] },
40
+ "blobs": { "type": "array", "maxItems": 4096, "items": {
41
+ "type": "object", "additionalProperties": false, "required": ["sha256", "contentBase64"],
42
+ "properties": { "sha256": { "$ref": "#/$defs/hash" },
43
+ "contentBase64": { "type": "string", "maxLength": 8388608, "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$(?![\\s\\S])" } }
44
+ } }
45
+ }
46
+ }
47
+ },
48
+ "allOf": [
49
+ { "if": { "properties": { "consolidation": { "type": "object", "properties": { "mode": { "const": "initial_repository" } } } } },
50
+ "then": { "properties": { "consolidation": { "type": "object", "properties": { "expectedLatestSourceFingerprint": false } } } } },
51
+ { "if": { "anyOf": [{ "required": ["restorationAttempt"] }, { "required": ["restorationContext"] }] },
52
+ "then": { "properties": { "consolidation": {
53
+ "type": "object", "properties": { "mode": { "const": "repository_update" }, "expectedLatestSourceFingerprint": { "$ref": "#/$defs/hash" } }, "required": ["expectedLatestSourceFingerprint"]
54
+ } } } }
55
+ ],
56
+ "$defs": {
57
+ "hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$(?![\\s\\S])" },
58
+ "uuid": { "type": "string", "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[1-8][0-9a-f]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$(?![\\s\\S])" }
59
+ }
60
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.dharma-ai.io/repository-knowledge-restoration/v1",
4
+ "title": "Candidate-only Repository Knowledge Restoration Reference",
5
+ "description": "Metadata from a currently usable prior signed release, returned only after current same-repository device and source-policy authorization. This is not installation or reactivation authority. A fresh candidate must independently pass current-head, evaluation, signing and activation gates.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema", "authority", "envelope", "catalogBase64", "manifestBase64"],
9
+ "properties": {
10
+ "schema": { "const": "dharma.repository-knowledge-restoration/v1" },
11
+ "authority": { "const": "candidate_reference_only" },
12
+ "envelope": { "$ref": "https://schemas.dharma-ai.io/repository-package-envelope/v1" },
13
+ "catalogBase64": { "type": "string", "minLength": 4, "maxLength": 349528, "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$(?![\\s\\S])" },
14
+ "manifestBase64": { "type": "string", "minLength": 4, "maxLength": 349528, "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$(?![\\s\\S])" }
15
+ }
16
+ }
@@ -34,7 +34,7 @@
34
34
  "requiredSkills": { "type": "array", "maxItems": 50, "items": { "type": "object", "additionalProperties": false, "required": ["skillId", "version", "commit", "contentHash"], "properties": { "skillId": { "type": "string", "minLength": 1, "maxLength": 200 }, "version": { "type": "string", "minLength": 1, "maxLength": 100 }, "commit": { "type": "string", "pattern": "^[A-Fa-f0-9]{40,64}$" }, "contentHash": { "type": "string", "pattern": "^(sha256|blake3):[A-Fa-f0-9]{32,128}$" } } } },
35
35
  "authority": { "type": "object", "additionalProperties": false, "required": ["readPaths", "writePaths", "commands", "network", "git"], "properties": { "readPaths": { "type": "array", "items": { "type": "string" } }, "writePaths": { "type": "array", "items": { "type": "string" } }, "commands": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["commandId"], "properties": { "commandId": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" } } } }, "network": { "type": "string", "enum": ["deny", "package_registry_only", "allowlisted_domains", "inherit_local_provider"] }, "git": { "type": "string", "enum": ["read_only", "task_branch", "merge_allowed", "deploy_allowed"] }, "allowlistedDomains": { "type": "array", "items": { "type": "string" }, "default": [] } } },
36
36
  "execution": { "type": "object", "additionalProperties": false, "required": ["isolation", "timeoutSeconds", "leaseSeconds", "maximumConcurrentAgents"], "properties": { "isolation": { "const": "git_worktree" }, "timeoutSeconds": { "type": "integer", "minimum": 1 }, "leaseSeconds": { "type": "integer", "minimum": 1 }, "maximumConcurrentAgents": { "type": "integer", "minimum": 1 } } },
37
- "acceptance": { "type": "object", "additionalProperties": false, "required": ["commands", "requiredArtifacts"], "properties": { "commands": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["commandId"], "properties": { "commandId": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" } } } }, "requiredArtifacts": { "type": "array", "items": { "type": "string" } }, "externalEffectReceiptCommandId": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" } } },
37
+ "acceptance": { "type": "object", "additionalProperties": false, "required": ["commands", "requiredArtifacts"], "properties": { "commands": { "type": "array", "maxItems": 98, "items": { "type": "object", "additionalProperties": false, "required": ["commandId"], "properties": { "commandId": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" } } } }, "requiredArtifacts": { "type": "array", "maxItems": 100, "items": { "type": "string", "minLength": 1, "maxLength": 1000 } }, "externalEffectReceiptCommandId": { "type": "string", "minLength": 1, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" } } },
38
38
  "budget": { "type": "object", "additionalProperties": false, "required": ["mode", "maximumDharmaCostCents"], "properties": { "mode": { "type": "string", "enum": ["byok_local", "byok_cloud", "dharma_managed"] }, "maximumDharmaCostCents": { "type": "integer", "minimum": 0 }, "maximumProviderCostCents": { "type": ["integer", "null"], "minimum": 0 } } },
39
39
  "expiresAt": { "type": "string", "format": "date-time" }
40
40
  },
@@ -316,6 +316,7 @@
316
316
  "properties": {
317
317
  "commands": {
318
318
  "type": "array",
319
+ "maxItems": 98,
319
320
  "items": {
320
321
  "type": "object",
321
322
  "additionalProperties": false,
@@ -331,8 +332,11 @@
331
332
  },
332
333
  "requiredArtifacts": {
333
334
  "type": "array",
335
+ "maxItems": 100,
334
336
  "items": {
335
- "type": "string"
337
+ "type": "string",
338
+ "minLength": 1,
339
+ "maxLength": 1000
336
340
  }
337
341
  },
338
342
  "externalEffectReceiptCommandId": {
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,QAE4W,CAAC"}
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,QAIyY,CAAC"}
package/dist/usage.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const COMMAND_USAGE = 'Usage: dharma <bootstrap|onboard|login|status|sessions start|sessions status|sessions work|sessions stop|sessions audit|demo connect|demo transport-connect|demo status|demo package|demo package-status|demo watch|demo watch-enable|demo watch-status|demo watch-disable|demo role|demo peers|demo ask|demo reply|demo inbox|demo ack|demo resume|demo signing-client-proof|demo signing-owner-proof|providers list|repositories discover|repositories connect|repositories list|repositories status|repositories snapshot|repositories recover-installer|repositories role-register|repositories role-discover|repositories ask|repositories reply|workspace add|workspace sync|workspace recover-registry|evidence preview|evidence capture|evidence capture-batch|evidence sync|evidence run-request|relay container-entrypoint|relay probe|relay start|relay stop|relay upgrade|relay autostart status|relay autostart disable|assistant chat|assistant history|assistant status|assistant approve|assistant reject|organization status|agents list|agents bind-runtime|evaluations validate|evaluations launch|evaluations status|evaluations results|experiments list|experiments run|failures list|remediations list|remediations act|tasks list|tasks dispatch|handoffs list|skills list|skills release|skills rollout|skills rollback|skills sync|skills status|skills verify|usage list> [options]';
2
2
  export const CLI_USAGE = COMMAND_USAGE + '\n\nAgent setup: bootstrap --setup-reference <public-reference> --setup-recipient-membership-id <membership> --setup-scope-digest <sha256> --setup-contract-digest <sha256> --complete [exact source/portal options]. Run inside the coding agent; approve the exact device in the browser. No terminal secret input. --dry-run produces a grant-free plan. Reference setup cannot combine with --grant, --grant-prompt, --resume, replacement, join or disabled relay startup. Legacy private setup: bootstrap --grant-prompt [exact portal options], with USER-only private terminal entry. Enrolled recovery: bootstrap --resume --complete [exact scoped options], with no grant/reference.'
3
3
  + '\n\nReturning device: login --unattended opts in to reuse the approved identity; login --no-unattended disables automatic selection; --dry-run plans either change. login --resume connects once without opting in. login --reauthenticate explicitly requests fresh browser approval for the original protected identity to recover its enrollment anchor; it never replaces keys or configuration. Opted-in bootstrap --complete can omit grants only for the same registered repository and approved policy revision. A compatible membership-guarded server admission response is required. Device admission does not sign in a provider or establish repository readiness. Standing relay lifecycle remains controlled by relay autostart commands.'
4
- + '\n\nRepository source conflicts: repositories source-resolve --workspace-id <workspace> [--dry-run | --prepare | --apply --plan-hash <sha256> --choose-reviewed-local]. Default is a read-only plan. Review and merge authorized source before preparation; approval is exact-input, expires after 15 minutes and does not publish. Existing relay/evaluation/signing gates remain required.';
4
+ + '\n\nRepository source conflicts: repositories source-resolve --workspace-id <workspace> [--dry-run | --prepare | --apply --plan-hash <sha256> --choose-reviewed-local]. Default is a read-only plan. Review and merge authorized source before preparation; approval is exact-input, expires after 15 minutes and does not publish. Existing relay/evaluation/signing gates remain required.'
5
+ + '\n\nAfter a clear-baseline rollback: repositories restore --workspace-id <workspace> --dry-run reads a current-policy stable signed catalog and plans a fresh candidate. With the owned relay stopped, --apply --plan-hash <reviewed-hash> submits that exact plan through normal evaluation/signing. It never reactivates an archived release, changes enrollment or resets history. Resume the owned relay only after submission; readiness and activation remain separate checks.'
6
+ + '\n\nFor an unresolved restoration upload, an empty lookup is not cancellation. With the owned relay stopped, --apply --plan-hash <original-hash> --fence-upload requests metadata-only fencing under current authority. An admitted operation is returned for ordinary recovery; only a terminal server fence permits checkpoint archival and a new dry-run plan. Fencing does not upload source or activate a release.';
5
7
  //# sourceMappingURL=usage.js.map
package/dist/usage.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,g1CAAg1C,CAAC;AAEv2C,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,GAAG,iqBAAiqB;MACtsB,0tBAA0tB;MAC1tB,8XAA8X,CAAC"}
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,g1CAAg1C,CAAC;AAEv2C,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,GAAG,iqBAAiqB;MACtsB,0tBAA0tB;MACxtB,8XAA8X;MAC9X,sdAAsd;MACtd,yZAAyZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dharma-ai-labs/agent-fabric",
3
- "version": "0.2.186",
3
+ "version": "0.2.188",
4
4
  "description": "Local-first CLI for connecting coding agents to Dharma evaluation, orchestration, and signed Skill delivery",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/dharma-ai-labs/dharma-agent-fabric/tree/main/packages/cli#readme",
@@ -34,16 +34,16 @@
34
34
  "test": "node --test dist/*.test.js"
35
35
  },
36
36
  "dependencies": {
37
- "@dharma-ai-labs/agent-fabric-contracts": "0.1.15",
38
- "@dharma-ai-labs/agent-fabric-evidence-reduction": "0.2.32",
37
+ "@dharma-ai-labs/agent-fabric-contracts": "0.1.16",
38
+ "@dharma-ai-labs/agent-fabric-evidence-reduction": "0.2.33",
39
39
  "@dharma-ai-labs/agent-fabric-local-vault": "0.1.28",
40
40
  "@dharma-ai-labs/agent-fabric-policy": "0.1.4",
41
- "@dharma-ai-labs/agent-fabric-provider-adapters": "0.1.33",
41
+ "@dharma-ai-labs/agent-fabric-provider-adapters": "0.1.34",
42
42
  "@dharma-ai-labs/agent-fabric-relay-client": "0.2.32",
43
43
  "@dharma-ai-labs/agent-fabric-sdk": "0.1.10",
44
44
  "@dharma-ai-labs/agent-fabric-secure-store": "0.1.9",
45
45
  "@dharma-ai-labs/agent-fabric-skill-manager": "0.2.11",
46
- "@dharma-ai-labs/agent-fabric-task-runner": "0.1.35",
46
+ "@dharma-ai-labs/agent-fabric-task-runner": "0.1.36",
47
47
  "ajv": "8.20.0",
48
48
  "ajv-formats": "3.0.1",
49
49
  "fs-native-extensions": "1.5.1"