@dharma-ai-labs/agent-fabric 0.2.143 → 0.2.145
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/codexBoundSession.d.ts.map +1 -1
- package/dist/codexBoundSession.js +4 -3
- package/dist/codexBoundSession.js.map +1 -1
- package/dist/codexBoundSession.test.js +84 -1
- package/dist/codexBoundSession.test.js.map +1 -1
- package/dist/codexInboxSession.d.ts +26 -3
- package/dist/codexInboxSession.d.ts.map +1 -1
- package/dist/codexInboxSession.js +26 -0
- package/dist/codexInboxSession.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -27
- package/dist/index.js.map +1 -1
- package/dist/relayRuntimeUpgrade.d.ts +1 -0
- package/dist/relayRuntimeUpgrade.d.ts.map +1 -1
- package/dist/relayRuntimeUpgrade.js +11 -8
- package/dist/relayRuntimeUpgrade.js.map +1 -1
- package/dist/relayRuntimeUpgrade.test.js +33 -0
- package/dist/relayRuntimeUpgrade.test.js.map +1 -1
- package/dist/relayRuntimeUpgradeCaller.test.js +11 -1
- package/dist/relayRuntimeUpgradeCaller.test.js.map +1 -1
- package/dist/repositoryLaunchers.d.ts +15 -0
- package/dist/repositoryLaunchers.d.ts.map +1 -0
- package/dist/repositoryLaunchers.js +94 -0
- package/dist/repositoryLaunchers.js.map +1 -0
- package/dist/repositoryLaunchers.test.d.ts +2 -0
- package/dist/repositoryLaunchers.test.d.ts.map +1 -0
- package/dist/repositoryLaunchers.test.js +92 -0
- package/dist/repositoryLaunchers.test.js.map +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4,9 +4,10 @@ import { createHash, createPrivateKey, createPublicKey, randomUUID } from 'node:
|
|
|
4
4
|
import { realpathSync } from 'node:fs';
|
|
5
5
|
import { access, chmod, link, lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from 'node:fs/promises';
|
|
6
6
|
import { homedir } from 'node:os';
|
|
7
|
-
import { basename, dirname, isAbsolute,
|
|
7
|
+
import { basename, dirname, isAbsolute, relative, resolve } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { promisify } from 'node:util';
|
|
10
|
+
import { stableRepositoryLauncherContents as repositoryLauncherContents, verifyRecordedRepositoryLaunchers } from './repositoryLaunchers.js';
|
|
10
11
|
import { canonicalize, createActionDecisionPublicKeyResolver, sha256, validateContract, validateTrustedServerSigningKeysetContract, verifyCanonicalObject, verifyInitialServerSigningKeyset, } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
11
12
|
import { buildTrajectoryCapsule, containsDisallowedLocalPath, redactValue, referencesExcludedPath, trajectoryCapsuleHash } from '@dharma-ai-labs/agent-fabric-evidence-reduction';
|
|
12
13
|
import { assertPolicy, loadOrganizationPolicy, verifyServerAuthorizedPolicy } from '@dharma-ai-labs/agent-fabric-policy';
|
|
@@ -71,7 +72,7 @@ import { startNamedCodexThread } from './namedCodexThread.js';
|
|
|
71
72
|
import { namedCodexEnvironment } from './namedCodexEnvironment.js';
|
|
72
73
|
import { namedCodexFilesystem } from './namedCodexFilesystem.js';
|
|
73
74
|
export { openCooperativeInboxSession } from './cooperativeInboxSession.js';
|
|
74
|
-
const VERSION = '0.2.
|
|
75
|
+
const VERSION = '0.2.145';
|
|
75
76
|
const USAGE = CLI_USAGE;
|
|
76
77
|
const execFileAsync = promisify(execFile);
|
|
77
78
|
const LOCAL_PROVIDER_IDS = ['codex', 'claude', 'agy', 'hermes'];
|
|
@@ -1554,31 +1555,7 @@ async function archiveEnrollmentForAuthorizedRebind(existing) {
|
|
|
1554
1555
|
});
|
|
1555
1556
|
}
|
|
1556
1557
|
export function stableRepositoryLauncherContents(version = VERSION, runtime) {
|
|
1557
|
-
|
|
1558
|
-
throw new Error('Managed launcher version is invalid.');
|
|
1559
|
-
}
|
|
1560
|
-
let shellEnvironment = '';
|
|
1561
|
-
let windowsEnvironment = '';
|
|
1562
|
-
if (runtime) {
|
|
1563
|
-
const directory = runtime.nodeDirectory;
|
|
1564
|
-
if (!directory || directory.length > 4096 || /[\r\n\0]/.test(directory)
|
|
1565
|
-
|| !(runtime.platform === 'win32' ? win32 : posix).isAbsolute(directory)) {
|
|
1566
|
-
throw new Error('Managed launcher runtime directory is invalid.');
|
|
1567
|
-
}
|
|
1568
|
-
if (runtime.platform === 'win32') {
|
|
1569
|
-
if (directory.includes('"'))
|
|
1570
|
-
throw new Error('Managed launcher runtime directory is invalid.');
|
|
1571
|
-
windowsEnvironment = `setlocal DisableDelayedExpansion\r\nset "PATH=${directory.replace(/%/g, '%%')};%PATH%"\r\n`;
|
|
1572
|
-
}
|
|
1573
|
-
else {
|
|
1574
|
-
shellEnvironment = `export PATH='${directory.replace(/'/g, "'\\''")}':"$PATH"\n`;
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
const invocation = `npm exec --yes -- @dharma-ai-labs/agent-fabric@${version}`;
|
|
1578
|
-
return {
|
|
1579
|
-
shell: `#!/bin/sh\n${shellEnvironment}exec ${invocation} "$@"\n`,
|
|
1580
|
-
windows: `@echo off\r\n${windowsEnvironment}${invocation} %*\r\n`,
|
|
1581
|
-
};
|
|
1558
|
+
return repositoryLauncherContents(version, runtime);
|
|
1582
1559
|
}
|
|
1583
1560
|
async function installStableRepositoryLauncher(workspace) {
|
|
1584
1561
|
const launcherRoot = resolve(workspace, '.dharma', 'bin');
|
|
@@ -1640,6 +1617,7 @@ async function relayUpgrade(flags) {
|
|
|
1640
1617
|
},
|
|
1641
1618
|
launcherContents: version => stableRepositoryLauncherContents(version, { platform: process.platform, nodeDirectory: dirname(process.execPath) }),
|
|
1642
1619
|
legacyLauncherContents: version => stableRepositoryLauncherContents(version),
|
|
1620
|
+
verifyPriorLaunchers: verifyRecordedRepositoryLaunchers,
|
|
1643
1621
|
configureStartup: version => enableRelayAutostart({ home, workspace,
|
|
1644
1622
|
launcher: startup.launcher, policy: startup.policy, version }),
|
|
1645
1623
|
start: () => startRelayAutostart({ home }),
|