@dharma-ai-labs/agent-fabric 0.2.92 → 0.2.94
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/demoEnrollment.d.ts +6 -0
- package/dist/demoEnrollment.d.ts.map +1 -1
- package/dist/demoEnrollment.js +35 -2
- package/dist/demoEnrollment.js.map +1 -1
- package/dist/demoEnrollment.test.js +43 -9
- package/dist/demoEnrollment.test.js.map +1 -1
- package/dist/demoPackage.d.ts +62 -0
- package/dist/demoPackage.d.ts.map +1 -0
- package/dist/demoPackage.js +403 -0
- package/dist/demoPackage.js.map +1 -0
- package/dist/demoPackage.test.d.ts +2 -0
- package/dist/demoPackage.test.d.ts.map +1 -0
- package/dist/demoPackage.test.js +354 -0
- package/dist/demoPackage.test.js.map +1 -0
- package/dist/demoPeer.test.js +14 -2
- package/dist/demoPeer.test.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -8
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +2 -2
- package/dist/repositorySourceSync.d.ts +6 -0
- package/dist/repositorySourceSync.d.ts.map +1 -1
- package/dist/repositorySourceSync.js +13 -1
- package/dist/repositorySourceSync.js.map +1 -1
- package/dist/repositorySourceSync.test.js +23 -2
- package/dist/repositorySourceSync.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.js
CHANGED
|
@@ -19,7 +19,7 @@ import { CLI_USAGE } from './usage.js';
|
|
|
19
19
|
import { initializeRepositoryKnowledge, readRepositoryKnowledgeSource } from './repositoryKnowledge.js';
|
|
20
20
|
import { inventoryRepositoryPackage, readRepositorySourceBaselineSnapshot, writeRepositoryPackageSnapshot } from './repositoryPackage.js';
|
|
21
21
|
import { validateRepositorySourceAuthorization } from './repositorySourceAuthorization.js';
|
|
22
|
-
import { BlockedRepositorySourceRetry, fetchRepositorySourceAuthorization, RepositorySourceWatcher, scanRepositorySourceChanges } from './repositorySourceSync.js';
|
|
22
|
+
import { BlockedRepositorySourceRetry, fetchRepositorySourceAuthorization, RepositorySourceWatcher, scanRepositorySourceChanges, seedRepositorySourceWatcher } from './repositorySourceSync.js';
|
|
23
23
|
import { assertRepositoryInstallerOwnership, writeRepositoryInstallerFile } from './repositoryInstallerFiles.js';
|
|
24
24
|
import { receiveRepositoryPackageDelivery } from './repositoryPackageDelivery.js';
|
|
25
25
|
import { selectInstalledRepositoryKnowledge } from './repositoryInstalledKnowledge.js';
|
|
@@ -35,7 +35,8 @@ import { withOnboardingStage } from './onboardingStage.js';
|
|
|
35
35
|
import { waitForRepositoryReadiness } from './repositoryReadinessWait.js';
|
|
36
36
|
import { connectDemoDevice, verifyDemoDevice } from './demoEnrollment.js';
|
|
37
37
|
import { performDemoPeerAction, withDemoDeviceLock } from './demoPeer.js';
|
|
38
|
-
|
|
38
|
+
import { demoRepositoryPackage } from './demoPackage.js';
|
|
39
|
+
const VERSION = '0.2.94';
|
|
39
40
|
const USAGE = CLI_USAGE;
|
|
40
41
|
const execFileAsync = promisify(execFile);
|
|
41
42
|
const LOCAL_PROVIDER_IDS = ['codex', 'claude', 'agy', 'hermes'];
|
|
@@ -2807,6 +2808,8 @@ async function bindRepositoryAgent(fabric, item) {
|
|
|
2807
2808
|
repositoryPackage: {
|
|
2808
2809
|
...canonicalRepositoryPackage(response.repositoryPackage),
|
|
2809
2810
|
sourcePolicyGenerationId: canonicalRepositoryPackagePolicyGeneration(response.repositoryPackageSourcePolicyGenerationId),
|
|
2811
|
+
localBaselineSnapshotHash: item.repositoryBindingId === repositoryAgent?.id
|
|
2812
|
+
? item.repositoryPackage?.localBaselineSnapshotHash : null,
|
|
2810
2813
|
},
|
|
2811
2814
|
repositoryRole: canonicalEndpointRole(response.endpointRole),
|
|
2812
2815
|
repositoryAgentKey: String(repositoryAgent?.agent_key || ''),
|
|
@@ -3255,6 +3258,8 @@ async function onboard(flags) {
|
|
|
3255
3258
|
const initialSnapshot = await staged('package_snapshot', async () => inventoryRepositoryPackage({ workspace, organizationId,
|
|
3256
3259
|
workspaceId: boundRepository.workspaceId, repositoryAgentId: boundRepository.repositoryAgentId,
|
|
3257
3260
|
repositoryBindingId: boundRepository.repositoryBindingId, sourceAuthorization }));
|
|
3261
|
+
await staged('package_snapshot', async () => writeRepositoryPackageSnapshot({ workspace,
|
|
3262
|
+
snapshot: initialSnapshot, candidateOnly: true }));
|
|
3258
3263
|
const candidateScope = { organizationId, workspaceId: registered.workspaceId,
|
|
3259
3264
|
repositoryBindingId: registered.repositoryBindingId, repositoryAgentId: registered.repositoryAgentId };
|
|
3260
3265
|
const outboxRoot = resolve(dharmaHome(), 'relay', 'repository-candidates');
|
|
@@ -3280,6 +3285,7 @@ async function onboard(flags) {
|
|
|
3280
3285
|
consolidationMode: canonicalPackage.state === 'absent' ? 'initial_repository'
|
|
3281
3286
|
: refreshPolicy ? 'repository_update' : canonicalPackage.consolidationMode,
|
|
3282
3287
|
sourcePolicyGenerationId: refreshPolicy ? sourceAuthorization.generationId : canonicalPackage.sourcePolicyGenerationId,
|
|
3288
|
+
localBaselineSnapshotHash: initialSnapshot.manifest.snapshotHash,
|
|
3283
3289
|
} };
|
|
3284
3290
|
await saveWorkspaceRecord(registered);
|
|
3285
3291
|
const providers = await staged('role_registration', async () => receiptAwareProviderCapabilities(await Promise.all(selectedProviderAdapters(providerIds).map((adapter) => adapter.capability()))));
|
|
@@ -5183,10 +5189,13 @@ async function relayStart(flags) {
|
|
|
5183
5189
|
let repositorySourceBaselineAvailable = true;
|
|
5184
5190
|
if (canonicalWorkspace.repositoryPackage?.snapshotHash) {
|
|
5185
5191
|
try {
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5192
|
+
await seedRepositorySourceWatcher({ workspace: canonicalWorkspace.path,
|
|
5193
|
+
organizationId: canonicalWorkspace.organizationId, workspaceId: canonicalWorkspace.workspaceId,
|
|
5194
|
+
repositoryBindingId: canonicalWorkspace.repositoryBindingId,
|
|
5195
|
+
repositoryAgentId: canonicalWorkspace.repositoryAgentId,
|
|
5196
|
+
publishedHash: canonicalWorkspace.repositoryPackage.snapshotHash,
|
|
5197
|
+
localHash: canonicalWorkspace.repositoryPackage.localBaselineSnapshotHash,
|
|
5198
|
+
watcher: repositorySourceWatcher });
|
|
5190
5199
|
}
|
|
5191
5200
|
catch {
|
|
5192
5201
|
repositorySourceBaselineAvailable = false;
|
|
@@ -5392,8 +5401,13 @@ async function relayStart(flags) {
|
|
|
5392
5401
|
snapshot, initialRepository: false }),
|
|
5393
5402
|
});
|
|
5394
5403
|
repositorySourceState = sourceCycle.state;
|
|
5395
|
-
if (sourceCycle.localMutation)
|
|
5404
|
+
if (sourceCycle.localMutation) {
|
|
5396
5405
|
repositorySourceCandidates += 1;
|
|
5406
|
+
if (canonicalWorkspace.repositoryPackage && sourceCycle.persisted) {
|
|
5407
|
+
canonicalWorkspace.repositoryPackage.localBaselineSnapshotHash = sourceCycle.persisted.snapshotHash;
|
|
5408
|
+
await saveWorkspaceRecord(canonicalWorkspace);
|
|
5409
|
+
}
|
|
5410
|
+
}
|
|
5397
5411
|
nextRepositorySourceScanAt = performance.now() + (sourceCycle.state === 'debouncing' ? 15_000 : 60_000);
|
|
5398
5412
|
}
|
|
5399
5413
|
}
|
|
@@ -5434,7 +5448,8 @@ export async function run(argv) {
|
|
|
5434
5448
|
return USAGE;
|
|
5435
5449
|
if (flags.has('version') || command === 'version')
|
|
5436
5450
|
return { version: VERSION };
|
|
5437
|
-
if (command === 'demo' && ['connect', 'status', 'role', 'peers', 'ask', 'reply', 'inbox', 'ack', 'resume'
|
|
5451
|
+
if (command === 'demo' && ['connect', 'status', 'role', 'peers', 'ask', 'reply', 'inbox', 'ack', 'resume',
|
|
5452
|
+
'package', 'package-status']
|
|
5438
5453
|
.includes(String(subcommand))) {
|
|
5439
5454
|
const hqUrl = normalizeHqUrl(portalUrl(flags));
|
|
5440
5455
|
const organizationId = required(flags, 'organization-id');
|
|
@@ -5473,6 +5488,21 @@ export async function run(argv) {
|
|
|
5473
5488
|
const { configPath: _configPath, ...receipt } = connected;
|
|
5474
5489
|
return receipt;
|
|
5475
5490
|
}
|
|
5491
|
+
if (subcommand === 'package' || subcommand === 'package-status') {
|
|
5492
|
+
const requestedProvider = String(flags.get('provider') || 'auto').trim().toLowerCase();
|
|
5493
|
+
const provider = subcommand === 'package-status' && requestedProvider === 'auto' ? 'codex'
|
|
5494
|
+
: requestedProvider === 'auto'
|
|
5495
|
+
? await detectBootstrapProvider(workspace) : requestedProvider;
|
|
5496
|
+
if (!isLocalProviderId(provider)) {
|
|
5497
|
+
throw new Error('Demo package provider must be auto, codex, claude, agy, or hermes.');
|
|
5498
|
+
}
|
|
5499
|
+
const demoNativeSkillDirectory = provider === 'codex' ? resolve(workspace, '.agents', 'skills')
|
|
5500
|
+
: provider === 'claude' ? resolve(workspace, '.claude', 'skills')
|
|
5501
|
+
: nativeSkillDirectory(provider);
|
|
5502
|
+
return demoRepositoryPackage({ scope, workspace,
|
|
5503
|
+
statusOnly: subcommand === 'package-status', provider,
|
|
5504
|
+
nativeSkillDirectory: demoNativeSkillDirectory });
|
|
5505
|
+
}
|
|
5476
5506
|
let action = null;
|
|
5477
5507
|
if (subcommand === 'role') {
|
|
5478
5508
|
const categories = repeated.get('category') || [];
|