@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.
- package/README.md +22 -3
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +731 -123
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +214 -1
- package/dist/index.test.js.map +1 -1
- package/dist/schemas/skill-bundle.schema.json +67 -4
- package/dist/schemas/trajectory-capsule-v2.schema.json +427 -0
- package/dist/schemas/trajectory-capsule-v3.schema.json +568 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -53,11 +53,30 @@ Local metadata analysis is operational triage, not semantic Cognitive Integrity
|
|
|
53
53
|
evaluation. Nuanced scoring and remediation require approved, redacted evidence;
|
|
54
54
|
missing evidence must produce `insufficient_evidence`.
|
|
55
55
|
|
|
56
|
-
After a candidate pull request exists
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
After a candidate pull request exists, an organization admin first authorizes
|
|
57
|
+
the candidate on one exact local endpoint. This is an evaluation-only canary,
|
|
58
|
+
not release approval:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
+
dharma remediations act \
|
|
62
|
+
--organization-id <organization-id> \
|
|
63
|
+
--target-id <repository-remediation-target-id> \
|
|
64
|
+
--action stage_evaluation \
|
|
65
|
+
--json-body '{"endpointId":"<local-endpoint-id>"}' \
|
|
66
|
+
--confirm
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Run `dharma skills sync` with the returned evaluation authorization ID, then
|
|
70
|
+
collect 20 later non-source trajectories on that endpoint. The held-out gate
|
|
71
|
+
rejects trajectories that do not carry the installed candidate bundle ID:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
dharma skills sync \
|
|
75
|
+
--workspace-id <workspace-id> \
|
|
76
|
+
--provider <codex|claude|agy> \
|
|
77
|
+
--policy .dharma/approved-policy.json \
|
|
78
|
+
--approval-id <evaluation-authorization-id>
|
|
79
|
+
|
|
61
80
|
dharma remediations act \
|
|
62
81
|
--organization-id <organization-id> \
|
|
63
82
|
--target-id <repository-remediation-target-id> \
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { type ProviderId } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
3
|
+
import { type TrajectoryCapsule } from '@dharma-ai-labs/agent-fabric-evidence-reduction';
|
|
3
4
|
import { type OrganizationPolicy } from '@dharma-ai-labs/agent-fabric-policy';
|
|
5
|
+
import { type ProviderSession } from '@dharma-ai-labs/agent-fabric-provider-adapters';
|
|
4
6
|
import { type SecureSecretStore } from '@dharma-ai-labs/agent-fabric-relay-client';
|
|
5
7
|
import { type SkillBundle } from '@dharma-ai-labs/agent-fabric-skill-manager';
|
|
6
8
|
import { type TaskEnvelope, type TaskReceipt } from '@dharma-ai-labs/agent-fabric-task-runner';
|
|
@@ -12,6 +14,8 @@ export declare function parseCliOptions(args: string[]): {
|
|
|
12
14
|
};
|
|
13
15
|
export declare function portalUrl(flags: Map<string, string | boolean>, fallback?: string): string;
|
|
14
16
|
export declare function isDirectExecution(argvPath: string | undefined, moduleUrl: string): boolean;
|
|
17
|
+
export declare function pathExistsOrThrow(path: string, check?: (path: string) => Promise<unknown>): Promise<boolean>;
|
|
18
|
+
export declare function canonicalFilesystemPath(path: string): Promise<string>;
|
|
15
19
|
export declare function rawLocalRetentionDays(policy: Pick<OrganizationPolicy, 'retention'>): number;
|
|
16
20
|
export declare function assertCapsuleIntegrity(capsule: Record<string, unknown>): void;
|
|
17
21
|
export declare function assertCapsuleAuthorizedByCurrentPolicy(capsule: Record<string, unknown>, policy: OrganizationPolicy): void;
|
|
@@ -33,6 +37,7 @@ export declare function materializeWorkspacePolicy(input: {
|
|
|
33
37
|
applied: boolean;
|
|
34
38
|
}>;
|
|
35
39
|
export declare function withWorkspacePolicyRefreshLock<T>(workspaceId: string, operation: () => Promise<T>): Promise<T>;
|
|
40
|
+
export declare function withWorkspaceSkillActivationLock<T>(workspaceId: string, provider: ProviderId, operation: () => Promise<T>): Promise<T>;
|
|
36
41
|
export declare function applyServerEvidencePolicy(base: OrganizationPolicy, value: unknown, serverPublicKeyEd25519: string, organizationId: string, workspaceId: string, now?: Date): OrganizationPolicy;
|
|
37
42
|
export declare function normalizeGitRemoteIdentity(value: string): string;
|
|
38
43
|
export declare function sourceRepositoryFingerprint(remote: string | null, explicitKey?: string | null): {
|
|
@@ -63,6 +68,24 @@ export declare function installRepositoryAgentFabricSkill(input: {
|
|
|
63
68
|
connectionPath: string;
|
|
64
69
|
repositoryAgentPath: string;
|
|
65
70
|
}>;
|
|
71
|
+
export declare function taskReceiptSession(task: TaskEnvelope, receipt: TaskReceipt, workspace: string): ProviderSession;
|
|
72
|
+
export declare function assertRecoveredTaskWorkspacePolicy(input: {
|
|
73
|
+
recoveryWorkspaceId: string;
|
|
74
|
+
workspace: {
|
|
75
|
+
workspaceId: string;
|
|
76
|
+
organizationId: string;
|
|
77
|
+
};
|
|
78
|
+
policy: Pick<OrganizationPolicy, 'organizationId' | 'serverAuthorization'>;
|
|
79
|
+
}): void;
|
|
80
|
+
export declare function recoveredTaskPolicyWasSuperseded(capsule: Pick<TrajectoryCapsule, 'redactionReceipt'>, currentPolicy: Pick<OrganizationPolicy, 'revision'>): boolean;
|
|
81
|
+
export declare function assertTaskWorkspacePolicy(input: {
|
|
82
|
+
task: Pick<TaskEnvelope, 'organizationId' | 'workspaceId'>;
|
|
83
|
+
workspace: {
|
|
84
|
+
workspaceId: string;
|
|
85
|
+
organizationId: string;
|
|
86
|
+
};
|
|
87
|
+
policy: Pick<OrganizationPolicy, 'organizationId' | 'serverAuthorization'>;
|
|
88
|
+
}): void;
|
|
66
89
|
export declare function nativeSkillDirectory(provider: ProviderId, env?: NodeJS.ProcessEnv, home?: string): string;
|
|
67
90
|
export declare function installNativeAgentFabricBootstrap(input: {
|
|
68
91
|
provider: ProviderId;
|
|
@@ -132,6 +155,11 @@ export declare function activateAgyPlugin(input?: {
|
|
|
132
155
|
execute?: AgyPluginExecutor;
|
|
133
156
|
}): Promise<void>;
|
|
134
157
|
export declare function materializeInlineSkillFiles(bundle: SkillBundle, sourceRoot: string): Promise<boolean>;
|
|
158
|
+
export declare function recoverLegacySkillBundleIdAfterAuthorizationFailure(input: {
|
|
159
|
+
nativeSkillDirectory: string;
|
|
160
|
+
workspaceId: string;
|
|
161
|
+
authorizationError: unknown;
|
|
162
|
+
}): Promise<string>;
|
|
135
163
|
export declare function run(argv: string[]): Promise<Output>;
|
|
136
164
|
export {};
|
|
137
165
|
//# sourceMappingURL=index.d.ts.map
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAiE,KAAK,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACxI,OAAO,EAA2G,KAAK,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAClM,OAAO,EAAsE,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAClJ,OAAO,EAA6D,KAAK,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACjJ,OAAO,EAG8F,KAAK,iBAAiB,EAC1H,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAgM,KAAK,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAC5Q,OAAO,EAAqC,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAMlI,KAAK,MAAM,GAAG,OAAO,CAAC;AAkBtB,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC/C,UAAU,EAAE,MAAM,EA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