@dharma-ai-labs/agent-fabric 0.2.171 → 0.2.173
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/dist/bootstrapProcessCaller.test.js +2 -1
- package/dist/bootstrapProcessCaller.test.js.map +1 -1
- package/dist/codexSetupDiagnostic.d.ts.map +1 -1
- package/dist/codexSetupDiagnostic.js +4 -0
- package/dist/codexSetupDiagnostic.js.map +1 -1
- package/dist/codexSetupSessionCaller.test.js +80 -66
- package/dist/codexSetupSessionCaller.test.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -33
- package/dist/index.js.map +1 -1
- package/dist/namedSessionStartup.d.ts +2 -0
- package/dist/namedSessionStartup.d.ts.map +1 -1
- package/dist/namedSessionStartup.js +12 -2
- package/dist/namedSessionStartup.js.map +1 -1
- package/dist/namedSessionStartup.test.js +27 -0
- package/dist/namedSessionStartup.test.js.map +1 -1
- package/dist/namedSessionStartupChild.d.ts +19 -0
- package/dist/namedSessionStartupChild.d.ts.map +1 -0
- package/dist/namedSessionStartupChild.js +62 -0
- package/dist/namedSessionStartupChild.js.map +1 -0
- package/dist/namedSessionStartupChild.test.d.ts +2 -0
- package/dist/namedSessionStartupChild.test.d.ts.map +1 -0
- package/dist/namedSessionStartupChild.test.js +80 -0
- package/dist/namedSessionStartupChild.test.js.map +1 -0
- package/dist/repositoryOnboardingCaller.test.js +36 -0
- package/dist/repositoryOnboardingCaller.test.js.map +1 -1
- package/dist/repositorySourceSync.d.ts +5 -0
- package/dist/repositorySourceSync.d.ts.map +1 -1
- package/dist/repositorySourceSync.js +9 -0
- package/dist/repositorySourceSync.js.map +1 -1
- package/dist/repositorySourceSync.test.js +87 -1
- package/dist/repositorySourceSync.test.js.map +1 -1
- package/dist/schemas/codex-setup-failure-diagnostic.schema.json +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import { initializeRepositoryKnowledge, readRepositoryKnowledgeSource } from './
|
|
|
30
30
|
import { inventoryRepositoryPackage, readRepositoryPackageSnapshot, readRepositorySourceBaselineSnapshot, serializeRepositoryPackageSnapshot, writeRepositoryPackageSnapshot } from './repositoryPackage.js';
|
|
31
31
|
import { validateRepositorySourceAuthorization } from './repositorySourceAuthorization.js';
|
|
32
32
|
import { createNamedPeerContentAuthorization } from './namedPeerContentAuthorization.js';
|
|
33
|
-
import { advanceRepositorySourceBaseline, BlockedRepositorySourceRetry, fetchRepositorySourceAuthorization, recoverPublishedLocalSourceBaseline, repositorySourcePollInvalidatesWatcher, RepositorySourceWatcher, scanRepositorySourceChanges, seedRepositorySourceWatcher } from './repositorySourceSync.js';
|
|
33
|
+
import { advanceRepositorySourceBaseline, BlockedRepositorySourceRetry, fetchRepositorySourceAuthorization, recoverPublishedLocalSourceBaseline, repositorySourceComparisonBaseline, repositorySourcePollInvalidatesWatcher, RepositorySourceWatcher, scanRepositorySourceChanges, seedRepositorySourceWatcher } from './repositorySourceSync.js';
|
|
34
34
|
import { captureRepositoryInstallerInput, prepareRepositoryInstallerWorkspace, writeRepositoryInstallerFile } from './repositoryInstallerFiles.js';
|
|
35
35
|
import { installRepositoryJoinConnection } from './repositoryJoinConnection.js';
|
|
36
36
|
import { recoverLegacyRepositoryInstaller, selectLegacyInstallerRecoveryWorkspace } from './legacyInstallerRecovery.js';
|
|
@@ -65,6 +65,7 @@ import { demoWatchStatus, disableDemoWatch, enableDemoWatch, inspectDemoWatchSup
|
|
|
65
65
|
import { namedSessionPaths, namedSessionRequest, readNamedSession, saveNamedSession, runNamedSessionService } from './namedSessionService.js';
|
|
66
66
|
import { queueNamedSessionEvidence } from './namedSessionEvidence.js';
|
|
67
67
|
import { waitForNamedSessionStartup } from './namedSessionStartup.js';
|
|
68
|
+
import { observeNamedSessionStartupChild } from './namedSessionStartupChild.js';
|
|
68
69
|
import { retainNamedSessionRepositoryState } from './namedSessionRepositoryState.js';
|
|
69
70
|
import { syncNamedSessionTaskExports } from './namedSessionTaskExportSync.js';
|
|
70
71
|
import { readNamedSessionPackageContent, readNamedSessionRepositoryContext, verifyNamedSessionVisibleSkill } from './namedSessionPackageGate.js';
|
|
@@ -91,7 +92,7 @@ import { assertCodexSetupExecutionLease } from './codexSetupAdmission.js';
|
|
|
91
92
|
import { parseLocalCodexSetupReadiness } from '@dharma-ai-labs/agent-fabric-local-vault/setup-readiness';
|
|
92
93
|
import { writeBootstrapHostJson, writeBootstrapHostText } from './bootstrapHostFiles.js';
|
|
93
94
|
export { openCooperativeInboxSession } from './cooperativeInboxSession.js';
|
|
94
|
-
const VERSION = '0.2.
|
|
95
|
+
const VERSION = '0.2.173';
|
|
95
96
|
const USAGE = CLI_USAGE;
|
|
96
97
|
const execFileAsync = promisify(execFile);
|
|
97
98
|
const LOCAL_PROVIDER_IDS = ['codex', 'claude', 'agy', 'hermes'];
|
|
@@ -3133,6 +3134,7 @@ async function bootstrap(flags, hostScope) {
|
|
|
3133
3134
|
recipientApproval.browserOpened = flags.has('no-browser') ? false : await step(() => openVerificationUri(approval.url));
|
|
3134
3135
|
await hostScope?.assert();
|
|
3135
3136
|
process.stderr.write(`Approve this exact device in the authenticated portal before ${approval.expiresAt}: ${approval.url}\n`);
|
|
3137
|
+
process.stderr.write(`Device fingerprint: ${approval.fingerprint}\nRepository fingerprint: ${approval.repositoryFingerprint}\n`);
|
|
3136
3138
|
},
|
|
3137
3139
|
}));
|
|
3138
3140
|
config = result.config;
|
|
@@ -4831,28 +4833,39 @@ async function namedSessionCommand(action, flags) {
|
|
|
4831
4833
|
if (flags.has(key))
|
|
4832
4834
|
args.push(`--${key}`, required(flags, key));
|
|
4833
4835
|
}
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4836
|
+
let startupChild;
|
|
4837
|
+
try {
|
|
4838
|
+
await step(async () => {
|
|
4839
|
+
const start = () => {
|
|
4840
|
+
const child = spawn(process.execPath, args, { cwd: item.path, detached: !hostScope && !supervisorOwner,
|
|
4841
|
+
stdio: setupSessionScope ? ['ignore', 'ignore', 'pipe', 'ipc'] : ['ignore', 'ignore', 'pipe'], env: process.env });
|
|
4842
|
+
startupChild = observeNamedSessionStartupChild(child);
|
|
4843
|
+
return child;
|
|
4844
|
+
};
|
|
4845
|
+
if (supervisorOwner) {
|
|
4846
|
+
const child = await supervisorOwner.spawn(name, start);
|
|
4847
|
+
if (setupSessionScope)
|
|
4848
|
+
await sendCodexSetupChildStart({ owner: supervisorOwner, child, scope: setupSessionScope });
|
|
4849
|
+
return;
|
|
4850
|
+
}
|
|
4851
|
+
const child = start();
|
|
4852
|
+
if (hostScope)
|
|
4853
|
+
captureBootstrapHostChild(hostScope, child);
|
|
4854
|
+
else {
|
|
4855
|
+
child.on('error', () => { });
|
|
4856
|
+
child.unref();
|
|
4857
|
+
}
|
|
4858
|
+
});
|
|
4859
|
+
return await waitForNamedSessionStartup({ step,
|
|
4860
|
+
assertActive: async () => { await hostScope?.assert(); },
|
|
4861
|
+
observe: () => namedSessionRequest(dharmaHome(), name, { action: 'status' }),
|
|
4862
|
+
readFailure: () => startupChild?.readFailure(),
|
|
4863
|
+
maximumWaitMs: setupSessionScope
|
|
4864
|
+
? Math.min(120_000, Date.parse(setupSessionScope.request.expiresAt) - Date.now()) : 120_000 });
|
|
4865
|
+
}
|
|
4866
|
+
finally {
|
|
4867
|
+
startupChild?.dispose();
|
|
4868
|
+
}
|
|
4856
4869
|
}
|
|
4857
4870
|
await mkdir(paths.root, { recursive: true, mode: 0o700 });
|
|
4858
4871
|
const vault = await openBootstrapVault({ root: resolve(dharmaHome(), 'vault') });
|
|
@@ -7798,24 +7811,26 @@ async function relayWorkspaceLoop(flags, signal, serialized) {
|
|
|
7798
7811
|
repositorySourceBaselineAvailable = false;
|
|
7799
7812
|
}
|
|
7800
7813
|
}
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7814
|
+
try {
|
|
7815
|
+
const comparisonBaselineHash = canonicalWorkspace.repositoryPackage
|
|
7816
|
+
? repositorySourceComparisonBaseline(canonicalWorkspace.repositoryPackage, publishedLocalSnapshotHash) : null;
|
|
7817
|
+
if (comparisonBaselineHash) {
|
|
7818
|
+
await readRepositoryPackageSnapshot(canonicalWorkspace.path, comparisonBaselineHash);
|
|
7804
7819
|
const localHash = canonicalWorkspace.repositoryPackage?.localBaselineSnapshotHash;
|
|
7805
|
-
if (localHash && (localHash ===
|
|
7820
|
+
if (localHash && (localHash === comparisonBaselineHash
|
|
7806
7821
|
|| canonicalWorkspace.repositoryPackage?.pendingLocalSnapshotHash === localHash)) {
|
|
7807
7822
|
await seedRepositorySourceWatcher({ workspace: canonicalWorkspace.path,
|
|
7808
7823
|
organizationId: canonicalWorkspace.organizationId, workspaceId: canonicalWorkspace.workspaceId,
|
|
7809
7824
|
repositoryBindingId: canonicalWorkspace.repositoryBindingId,
|
|
7810
7825
|
repositoryAgentId: canonicalWorkspace.repositoryAgentId,
|
|
7811
|
-
publishedHash:
|
|
7826
|
+
publishedHash: comparisonBaselineHash,
|
|
7812
7827
|
localHash,
|
|
7813
7828
|
watcher: repositorySourceWatcher });
|
|
7814
7829
|
}
|
|
7815
7830
|
}
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7831
|
+
}
|
|
7832
|
+
catch {
|
|
7833
|
+
repositorySourceBaselineAvailable = false;
|
|
7819
7834
|
}
|
|
7820
7835
|
let nextRepositorySourceScanAt = 0;
|
|
7821
7836
|
let repositorySourceCandidates = 0;
|
|
@@ -8101,9 +8116,10 @@ async function relayWorkspaceLoop(flags, signal, serialized) {
|
|
|
8101
8116
|
if (canonicalWorkspace.accessMode !== 'knowledge_only' && !stopping && !sourceScanFlight
|
|
8102
8117
|
&& performance.now() >= nextRepositorySourceScanAt) {
|
|
8103
8118
|
const sourceWorkspace = canonicalWorkspace;
|
|
8104
|
-
const sourceBaselineHash = publishedLocalSnapshotHash;
|
|
8105
8119
|
sourceScanFlight = (async () => {
|
|
8106
8120
|
try {
|
|
8121
|
+
const sourceBaselineHash = sourceWorkspace.repositoryPackage
|
|
8122
|
+
? repositorySourceComparisonBaseline(sourceWorkspace.repositoryPackage, publishedLocalSnapshotHash) : null;
|
|
8107
8123
|
if (!repositorySourceBaselineAvailable) {
|
|
8108
8124
|
throw new Error('Repository source baseline is unavailable; refusing an unanchored update.');
|
|
8109
8125
|
}
|