@dharma-ai-labs/agent-fabric 0.2.99 → 0.2.101
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/AGENT_FABRIC_ONBOARDING.md +5 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +190 -8
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +33 -4
- package/dist/index.test.js.map +1 -1
- package/dist/onboardingStage.d.ts +1 -1
- package/dist/onboardingStage.d.ts.map +1 -1
- package/dist/onboardingStage.js.map +1 -1
- package/dist/relayAutostart.d.ts +36 -0
- package/dist/relayAutostart.d.ts.map +1 -0
- package/dist/relayAutostart.js +167 -0
- package/dist/relayAutostart.js.map +1 -0
- package/dist/relayAutostart.test.d.ts +2 -0
- package/dist/relayAutostart.test.d.ts.map +1 -0
- package/dist/relayAutostart.test.js +103 -0
- package/dist/relayAutostart.test.js.map +1 -0
- package/dist/relaySupervisor.d.ts +11 -0
- package/dist/relaySupervisor.d.ts.map +1 -0
- package/dist/relaySupervisor.js +56 -0
- package/dist/relaySupervisor.js.map +1 -0
- package/dist/relaySupervisor.test.d.ts +2 -0
- package/dist/relaySupervisor.test.d.ts.map +1 -0
- package/dist/relaySupervisor.test.js +127 -0
- package/dist/relaySupervisor.test.js.map +1 -0
- package/dist/repositoryOnboardingCaller.test.js +9 -2
- package/dist/repositoryOnboardingCaller.test.js.map +1 -1
- package/dist/skillPreparationCache.test.js +2 -0
- package/dist/skillPreparationCache.test.js.map +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +1 -1
- package/dist/usage.js.map +1 -1
- package/package.json +1 -1
package/dist/index.test.js
CHANGED
|
@@ -7,7 +7,7 @@ import { join } from 'node:path';
|
|
|
7
7
|
import test from 'node:test';
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
9
9
|
import { promisify } from 'node:util';
|
|
10
|
-
import { acceptedTrajectoryHead, activateAgyPlugin, attestAgySkillActivation, attestHermesSkillBundleActivation, actionDecisionCapabilityFreshUntil, canonicalFilesystemPath, controlAgentDecisionUrl, installAvailableNativeAgentFabricBootstraps, assertCapsuleAuthorizedByCurrentPolicy, assertRecoveredTaskWorkspacePolicy, assertTaskWorkspacePolicy, assertTaskSkillPin, installNativeAgentFabricBootstrap, installClaudeReadOnlyProjectPermissions, installRepositoryAgentFabricSkill, isDirectExecution, isTransientBootstrapError, loadAgentFabricOnboardingContract, loadOrCreateInstallationId, materializeWorkspacePolicy, applyServerEvidencePolicy, materializeInlineSkillFiles, validateSkillBundleSources, nativeSkillDirectory, nativeSkillDirectoryForWorkspace, nativeSkillRootMatchingAuthorization, normalizeGitRemoteIdentity, postTaskOutcome, parseCliOptions, parseSelectedProviderIds, pathExistsOrThrow, portalUrl, providerHintFromEnvironment, providerHintFromProcessArgv, probeRelayConnection, preflightBootstrapWorkspaceIdentity, rawLocalRetentionDays, syncPendingRetentionCapsules, requireCompletedBootstrapEvidence, retryBootstrapOnboarding, synchronizeBootstrapEvidence, deferUnavailableRelayRetention, recoverLegacySkillBundleIdAfterAuthorizationFailure, installedBundleIdForSkillPollAfterAuthorizationFailure, recoveredTaskPolicyWasSuperseded, acquireRelayProcessLease, relayProcessState, releaseDailyContentUpload, reserveDailyContentUpload, run, runAssistantCommand, sourceRepositoryFingerprint, stableRepositoryLauncherContents, summarizeBootstrapOrganizationApi, ensureAgyReadOnlyAttestationPermission, attestAgySkillBundleActivation, responseTextFromEvent, taskResponsePreview, taskReceiptSession, taskSkillPinFailureCode, verifyAgentFabricSkillInstallation, waitForRelayReadiness, withWorkspacePolicyRefreshLock, withWorkspaceSkillActivationLock, } from './index.js';
|
|
10
|
+
import { acceptedTrajectoryHead, activateAgyPlugin, attestAgySkillActivation, attestHermesSkillBundleActivation, actionDecisionCapabilityFreshUntil, canonicalFilesystemPath, controlAgentDecisionUrl, installAvailableNativeAgentFabricBootstraps, assertCapsuleAuthorizedByCurrentPolicy, assertRecoveredTaskWorkspacePolicy, assertTaskWorkspacePolicy, assertTaskSkillPin, installNativeAgentFabricBootstrap, installClaudeReadOnlyProjectPermissions, installRepositoryAgentFabricSkill, isDirectExecution, isTransientBootstrapError, loadAgentFabricOnboardingContract, loadOrCreateInstallationId, materializeWorkspacePolicy, applyServerEvidencePolicy, materializeInlineSkillFiles, validateSkillBundleSources, nativeSkillDirectory, nativeSkillDirectoryForWorkspace, nativeSkillRootMatchingAuthorization, normalizeGitRemoteIdentity, postTaskOutcome, parseCliOptions, parseSelectedProviderIds, pathExistsOrThrow, portalUrl, providerHintFromEnvironment, providerHintFromProcessArgv, probeRelayConnection, preflightBootstrapWorkspaceIdentity, rawLocalRetentionDays, syncPendingRetentionCapsules, requireCompletedBootstrapEvidence, retryBootstrapOnboarding, synchronizeBootstrapEvidence, deferUnavailableRelayRetention, recoverLegacySkillBundleIdAfterAuthorizationFailure, installedBundleIdForSkillPollAfterAuthorizationFailure, recoveredTaskPolicyWasSuperseded, acquireRelayProcessLease, acquireRelaySupervisorLease, relayProcessState, relaySupervisorProcessState, releaseDailyContentUpload, reserveDailyContentUpload, run, runAssistantCommand, sourceRepositoryFingerprint, stableRepositoryLauncherContents, summarizeBootstrapOrganizationApi, ensureAgyReadOnlyAttestationPermission, attestAgySkillBundleActivation, responseTextFromEvent, taskResponsePreview, taskReceiptSession, taskSkillPinFailureCode, verifyAgentFabricSkillInstallation, waitForRelayReadiness, withWorkspacePolicyRefreshLock, withWorkspaceSkillActivationLock, } from './index.js';
|
|
11
11
|
import { canonicalize, signCanonicalObject } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
12
12
|
import { buildTrajectoryCapsule, trajectoryCapsuleHash } from '@dharma-ai-labs/agent-fabric-evidence-reduction';
|
|
13
13
|
import { CLI_USAGE } from './usage.js';
|
|
@@ -121,6 +121,18 @@ test('relay process lease rejects concurrent starts and preserves a successor PI
|
|
|
121
121
|
await nextRelease();
|
|
122
122
|
assert.equal(await relayProcessState(home), 'stopped');
|
|
123
123
|
});
|
|
124
|
+
test('relay supervisor lease rejects a second supervisor and preserves the relay lease', async () => {
|
|
125
|
+
const home = await mkdtemp(join(tmpdir(), 'dharma-relay-supervisor-lease-'));
|
|
126
|
+
const releaseSupervisor = await acquireRelaySupervisorLease(home);
|
|
127
|
+
const releaseRelay = await acquireRelayProcessLease(home);
|
|
128
|
+
assert.equal(await relaySupervisorProcessState(home), 'running');
|
|
129
|
+
assert.equal(await relayProcessState(home), 'running');
|
|
130
|
+
await assert.rejects(() => acquireRelaySupervisorLease(home), /Another relay supervisor is already running/);
|
|
131
|
+
await releaseSupervisor();
|
|
132
|
+
assert.equal(await relaySupervisorProcessState(home), 'stopped');
|
|
133
|
+
assert.equal(await relayProcessState(home), 'running');
|
|
134
|
+
await releaseRelay();
|
|
135
|
+
});
|
|
124
136
|
test('bootstrap defers policy-rejected evidence without weakening the disclosure boundary', async () => {
|
|
125
137
|
const result = await synchronizeBootstrapEvidence(async () => {
|
|
126
138
|
throw new Error('local_path_disclosure_forbidden: capsule event contains a local path');
|
|
@@ -851,7 +863,24 @@ test('status reports verified relay state and hides local identifiers by default
|
|
|
851
863
|
}));
|
|
852
864
|
const status = await run(['status']);
|
|
853
865
|
const version = await run(['version']);
|
|
854
|
-
assert.deepEqual(status, {
|
|
866
|
+
assert.deepEqual(status, {
|
|
867
|
+
version: version.version, enrolled: true, relay: 'running', supervisor: 'stopped',
|
|
868
|
+
autostart: { state: 'disabled', backend: null },
|
|
869
|
+
reconnect: { state: 'awaiting_acknowledgement', lastSuccessfulPollAt: null },
|
|
870
|
+
});
|
|
871
|
+
const acknowledgedAt = new Date().toISOString();
|
|
872
|
+
await writeFile(join(home, 'relay', 'supervisor.pid'), `${process.pid}\n`);
|
|
873
|
+
await writeFile(join(home, 'relay', 'supervisor-workspace.json'), JSON.stringify({ pid: process.pid, workspaceId: 'workspace_private' }));
|
|
874
|
+
await writeFile(join(home, 'relay', 'last-successful-poll.json'), JSON.stringify({
|
|
875
|
+
at: acknowledgedAt, workspaceId: 'workspace_private', version: '0.2.101',
|
|
876
|
+
}));
|
|
877
|
+
const acknowledged = await run(['status']);
|
|
878
|
+
assert.deepEqual(acknowledged.reconnect, { state: 'acknowledged_recently', lastSuccessfulPollAt: acknowledgedAt });
|
|
879
|
+
await writeFile(join(home, 'relay', 'last-successful-poll.json'), JSON.stringify({
|
|
880
|
+
at: acknowledgedAt, workspaceId: 'foreign_workspace', version: '0.2.101',
|
|
881
|
+
}));
|
|
882
|
+
const foreign = await run(['status']);
|
|
883
|
+
assert.deepEqual(foreign.reconnect, { state: 'awaiting_acknowledgement', lastSuccessfulPollAt: null });
|
|
855
884
|
const diagnostic = await run(['status', '--verbose']);
|
|
856
885
|
assert.equal(diagnostic.organizationId, 'org_private');
|
|
857
886
|
assert.equal(diagnostic.deviceId, 'device_private');
|
|
@@ -1785,13 +1814,13 @@ test('relay probe opens an authenticated session without polling or leasing work
|
|
|
1785
1814
|
},
|
|
1786
1815
|
openSession: async (version) => {
|
|
1787
1816
|
sessions += 1;
|
|
1788
|
-
assert.equal(version, '0.2.
|
|
1817
|
+
assert.equal(version, '0.2.101');
|
|
1789
1818
|
return { ok: true };
|
|
1790
1819
|
},
|
|
1791
1820
|
}));
|
|
1792
1821
|
assert.equal(sessions, 1);
|
|
1793
1822
|
assert.deepEqual(result, {
|
|
1794
|
-
ok: true, connected: true, organizationId: 'org_test', deviceId: 'device_test', relayVersion: '0.2.
|
|
1823
|
+
ok: true, connected: true, organizationId: 'org_test', deviceId: 'device_test', relayVersion: '0.2.101',
|
|
1795
1824
|
});
|
|
1796
1825
|
});
|
|
1797
1826
|
test('relay probe fails closed when the server does not acknowledge the session', async () => {
|