@dharma-ai-labs/agent-fabric 0.2.171 → 0.2.172

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/index.js CHANGED
@@ -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.171';
95
+ const VERSION = '0.2.172';
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
- await step(async () => {
4835
- const start = () => spawn(process.execPath, args, { cwd: item.path, detached: !hostScope && !supervisorOwner,
4836
- stdio: setupSessionScope ? ['ignore', 'ignore', 'ignore', 'ipc'] : 'ignore', env: process.env });
4837
- if (supervisorOwner) {
4838
- const child = await supervisorOwner.spawn(name, start);
4839
- if (setupSessionScope)
4840
- await sendCodexSetupChildStart({ owner: supervisorOwner, child, scope: setupSessionScope });
4841
- return;
4842
- }
4843
- const child = start();
4844
- if (hostScope)
4845
- captureBootstrapHostChild(hostScope, child);
4846
- else {
4847
- child.on('error', () => { });
4848
- child.unref();
4849
- }
4850
- });
4851
- return waitForNamedSessionStartup({ step,
4852
- assertActive: async () => { await hostScope?.assert(); },
4853
- observe: () => namedSessionRequest(dharmaHome(), name, { action: 'status' }),
4854
- maximumWaitMs: setupSessionScope
4855
- ? Math.min(120_000, Date.parse(setupSessionScope.request.expiresAt) - Date.now()) : 120_000 });
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') });