@dharma-ai-labs/agent-fabric 0.1.13 → 0.1.19
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/README.md +39 -4
- package/dist/bin.js +2 -3
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +533 -45
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +210 -3
- package/dist/index.test.js.map +1 -1
- package/dist/usage.d.ts +2 -0
- package/dist/usage.d.ts.map +1 -0
- package/dist/usage.js +2 -0
- package/dist/usage.js.map +1 -0
- package/package.json +32 -12
package/README.md
CHANGED
|
@@ -11,13 +11,31 @@ installs signed Skill releases with receipts and rollback ancestry.
|
|
|
11
11
|
Requires Node.js 22.20 or later.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
npm install --global @dharma-ai-labs/agent-fabric
|
|
15
|
+
dharma login \
|
|
16
|
+
--portal-url https://www.dharma-ai.io \
|
|
17
|
+
--organization-id <organization-id>
|
|
18
|
+
dharma repositories discover --root "$HOME/work"
|
|
19
|
+
dharma repositories connect \
|
|
20
|
+
--repo "$PWD" \
|
|
21
|
+
--provider codex \
|
|
22
|
+
--provider claude \
|
|
16
23
|
--organization-id <organization-id> \
|
|
17
|
-
--policy-revision <dashboard-policy-revision>
|
|
18
|
-
|
|
24
|
+
--policy-revision <dashboard-policy-revision>
|
|
25
|
+
dharma repositories status --repo "$PWD" --json
|
|
19
26
|
```
|
|
20
27
|
|
|
28
|
+
Repeat `--provider` to attach only the local runtimes that should serve the
|
|
29
|
+
selected repository agent. Omitting it preserves compatibility by attaching
|
|
30
|
+
every installed supported provider.
|
|
31
|
+
|
|
32
|
+
One selected source repository becomes one logical organization agent and one
|
|
33
|
+
permanent branch in the organization's private Dharma control repository.
|
|
34
|
+
Connecting that repository from another machine or provider adds an endpoint to
|
|
35
|
+
the same agent. The CLI derives repository identity from a credential-free
|
|
36
|
+
normalized Git remote. Repositories without a remote require an explicit stable
|
|
37
|
+
`--repository-key`; absolute paths are never identity.
|
|
38
|
+
|
|
21
39
|
Current provider adapters are Codex, Claude Code, and Agy. Run
|
|
22
40
|
`dharma providers list` because evidence, task, continuation, Skill installation,
|
|
23
41
|
activation, and usage capabilities are reported independently.
|
|
@@ -35,6 +53,23 @@ Local metadata analysis is operational triage, not semantic Cognitive Integrity
|
|
|
35
53
|
evaluation. Nuanced scoring and remediation require approved, redacted evidence;
|
|
36
54
|
missing evidence must produce `insufficient_evidence`.
|
|
37
55
|
|
|
56
|
+
After a candidate pull request exists and 20 later non-source trajectories have
|
|
57
|
+
been captured, an authorized operator can run the same held-out gate exposed in
|
|
58
|
+
the portal:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
dharma remediations act \
|
|
62
|
+
--organization-id <organization-id> \
|
|
63
|
+
--target-id <repository-remediation-target-id> \
|
|
64
|
+
--action run_backtest \
|
|
65
|
+
--body-file held-out-trajectories.json \
|
|
66
|
+
--confirm
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`held-out-trajectories.json` contains a `trajectoryIds` array with 20 to 100
|
|
70
|
+
UUIDs for that repository agent. HQ rejects source, older, cross-agent, deleted,
|
|
71
|
+
or unavailable evidence.
|
|
72
|
+
|
|
38
73
|
- [Dharma AI](https://www.dharma-ai.io)
|
|
39
74
|
- [Source and issue tracker](https://github.com/dharma-ai-labs/dharma-agent-fabric)
|
|
40
75
|
- [Customer onboarding guide](https://github.com/dharma-ai-labs/dharma-agent-fabric/blob/main/docs/onboarding/customer-guide.md)
|
package/dist/bin.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { CLI_USAGE } from './usage.js';
|
|
2
3
|
const args = process.argv.slice(2);
|
|
3
|
-
const HELP = 'Usage: dharma <onboard|login|status|providers list|workspace add|workspace sync|evidence preview|evidence capture|evidence capture-batch|evidence sync|evidence run-request|relay start|tasks run-once|skills sync|skills status|skills verify> [options]';
|
|
4
4
|
const [major, minor] = process.versions.node.split('.').map(Number);
|
|
5
5
|
if (args.includes('--help') || args.includes('-h')) {
|
|
6
|
-
process.stdout.write(`${
|
|
6
|
+
process.stdout.write(`${CLI_USAGE}\n`);
|
|
7
7
|
}
|
|
8
8
|
else if ((major ?? 0) < 22 || ((major ?? 0) === 22 && (minor ?? 0) < 20)) {
|
|
9
9
|
process.stderr.write(`Dharma Agent Fabric requires Node.js 22.20 or newer. Current runtime: ${process.versions.node}. `
|
|
@@ -19,5 +19,4 @@ else {
|
|
|
19
19
|
process.exitCode = 2;
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
export {};
|
|
23
22
|
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpE,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IACnD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;AACzC,CAAC;KAAM,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;IAC3E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yEAAyE,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI;UAChG,2FAA2F,CAC9F,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3C,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAc,EAAE,EAAE;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ import { type SecureSecretStore } from '@dharma-ai-labs/agent-fabric-relay-clien
|
|
|
5
5
|
import { type SkillBundle } from '@dharma-ai-labs/agent-fabric-skill-manager';
|
|
6
6
|
import { type TaskEnvelope, type TaskReceipt } from '@dharma-ai-labs/agent-fabric-task-runner';
|
|
7
7
|
type Output = unknown;
|
|
8
|
+
export declare function parseCliOptions(args: string[]): {
|
|
9
|
+
positional: string[];
|
|
10
|
+
flags: Map<string, string | boolean>;
|
|
11
|
+
repeated: Map<string, Array<string | boolean>>;
|
|
12
|
+
};
|
|
13
|
+
export declare function portalUrl(flags: Map<string, string | boolean>, fallback?: string): string;
|
|
8
14
|
export declare function isDirectExecution(argvPath: string | undefined, moduleUrl: string): boolean;
|
|
9
15
|
export declare function rawLocalRetentionDays(policy: Pick<OrganizationPolicy, 'retention'>): number;
|
|
10
16
|
export declare function assertCapsuleIntegrity(capsule: Record<string, unknown>): void;
|
|
@@ -27,6 +33,11 @@ export declare function materializeWorkspacePolicy(input: {
|
|
|
27
33
|
applied: boolean;
|
|
28
34
|
}>;
|
|
29
35
|
export declare function applyServerEvidencePolicy(base: OrganizationPolicy, value: unknown, serverPublicKeyEd25519: string, organizationId: string, workspaceId: string, now?: Date): OrganizationPolicy;
|
|
36
|
+
export declare function normalizeGitRemoteIdentity(value: string): string;
|
|
37
|
+
export declare function sourceRepositoryFingerprint(remote: string | null, explicitKey?: string | null): {
|
|
38
|
+
fingerprint: string;
|
|
39
|
+
source: 'remote' | 'explicit_key';
|
|
40
|
+
};
|
|
30
41
|
export declare function taskResponsePreview(receipt: TaskReceipt): {
|
|
31
42
|
text: string;
|
|
32
43
|
truncated: boolean;
|
|
@@ -35,15 +46,21 @@ export declare function taskResponsePreview(receipt: TaskReceipt): {
|
|
|
35
46
|
} | null;
|
|
36
47
|
export declare function assertTaskSkillPin(pinned: TaskEnvelope['skillBundle'], activeBundleId: string | null): void;
|
|
37
48
|
export declare function taskSkillPinFailureCode(error: unknown): string;
|
|
49
|
+
export declare function requireExplicitConfirmation(flags: Map<string, string | boolean>, action: string): void;
|
|
50
|
+
export declare function parseSelectedProviderIds(values: Array<string | boolean>): ProviderId[] | null;
|
|
38
51
|
export declare function installRepositoryAgentFabricSkill(input: {
|
|
39
52
|
workspace: string;
|
|
40
53
|
hqUrl: string;
|
|
41
54
|
organizationId: string;
|
|
42
55
|
workspaceId: string;
|
|
43
56
|
policyRevision: string;
|
|
57
|
+
repositoryAgentId?: string | null;
|
|
58
|
+
repositoryAgentKey?: string | null;
|
|
59
|
+
controlBranch?: string | null;
|
|
44
60
|
}): Promise<{
|
|
45
61
|
skillPath: string;
|
|
46
62
|
connectionPath: string;
|
|
63
|
+
repositoryAgentPath: string;
|
|
47
64
|
}>;
|
|
48
65
|
export declare function nativeSkillDirectory(provider: ProviderId, env?: NodeJS.ProcessEnv, home?: string): string;
|
|
49
66
|
export declare function installNativeAgentFabricBootstrap(input: {
|
|
@@ -100,6 +117,7 @@ export declare function verifyAgentFabricSkillInstallation(input: {
|
|
|
100
117
|
repositorySkillPath: string;
|
|
101
118
|
connectionPath: string;
|
|
102
119
|
nativeSkillPath: string;
|
|
120
|
+
workspaceId: string | null;
|
|
103
121
|
activeBundleId: string | null;
|
|
104
122
|
activation: string;
|
|
105
123
|
nextAction: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAiE,KAAK,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAExI,OAAO,EAAsE,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAElJ,OAAO,EAEgC,KAAK,iBAAiB,EAC5D,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAiE,KAAK,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAExI,OAAO,EAAsE,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAElJ,OAAO,EAEgC,KAAK,iBAAiB,EAC5D,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAiE,KAAK,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAC7I,OAAO,EAAqC,K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