@noopolis/daimon 0.2.0 → 0.2.1
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/README.md +6 -0
- package/dist/contracts/attentionContract.d.ts +25 -0
- package/dist/contracts/attentionContract.d.ts.map +1 -1
- package/dist/contracts/attentionContract.js +8 -1
- package/dist/contracts/grokBrokerTaskClock.d.ts +18 -0
- package/dist/contracts/grokBrokerTaskClock.d.ts.map +1 -0
- package/dist/contracts/grokBrokerTaskClock.js +16 -0
- package/dist/contracts/organizationRuntimeContract.d.ts +76 -0
- package/dist/contracts/organizationRuntimeContract.d.ts.map +1 -1
- package/dist/contracts/organizationRuntimeContract.js +2 -0
- package/dist/contracts/runtimeContractManifest.d.ts +222 -15
- package/dist/contracts/runtimeContractManifest.d.ts.map +1 -1
- package/dist/contracts/runtimeContractManifest.js +35 -10
- package/dist/contracts/shellEnvironmentPolicy.d.ts +3 -0
- package/dist/contracts/shellEnvironmentPolicy.d.ts.map +1 -0
- package/dist/contracts/shellEnvironmentPolicy.js +5 -0
- package/dist/contracts/wakeMomentContract.d.ts +61 -0
- package/dist/contracts/wakeMomentContract.d.ts.map +1 -0
- package/dist/contracts/wakeMomentContract.js +27 -0
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/examples/jungianPlayAgent.d.ts +1 -0
- package/dist/examples/jungianPlayAgent.d.ts.map +1 -1
- package/dist/examples/jungianPlayAgent.js +6 -2
- package/dist/observability/causalEvents.d.ts +3 -3
- package/dist/observability/causalEvents.d.ts.map +1 -1
- package/dist/observability/causalEvents.js +4 -4
- package/dist/pi/cliEngineSpawn.d.ts +2 -2
- package/dist/pi/cliEngineSpawn.d.ts.map +1 -1
- package/dist/pi/cliEngineSpawn.js +7 -2
- package/dist/pi/cliEnvironment.d.ts.map +1 -1
- package/dist/pi/cliEnvironment.js +2 -0
- package/dist/pi/cliMcpRegistration.d.ts +1 -1
- package/dist/pi/cliMcpRegistration.d.ts.map +1 -1
- package/dist/pi/cliMcpRegistration.js +1 -1
- package/dist/pi/cliSession.d.ts +2 -0
- package/dist/pi/cliSession.d.ts.map +1 -1
- package/dist/pi/cliSession.js +3 -80
- package/dist/pi/cliSessionMcp.d.ts +9 -0
- package/dist/pi/cliSessionMcp.d.ts.map +1 -0
- package/dist/pi/cliSessionMcp.js +80 -0
- package/dist/pi/engineTaskClock.d.ts +9 -0
- package/dist/pi/engineTaskClock.d.ts.map +1 -0
- package/dist/pi/engineTaskClock.js +28 -0
- package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -1
- package/dist/pi/grokHomeMcpRegistration.js +2 -1
- package/dist/pi/grokSandbox.js +1 -1
- package/dist/pi/memoryClock.d.ts +25 -0
- package/dist/pi/memoryClock.d.ts.map +1 -0
- package/dist/pi/memoryClock.js +18 -0
- package/dist/pi/piAgentHandle.d.ts +3 -1
- package/dist/pi/piAgentHandle.d.ts.map +1 -1
- package/dist/pi/piAgentHandle.js +5 -2
- package/dist/pi/piHarness.d.ts +8 -2
- package/dist/pi/piHarness.d.ts.map +1 -1
- package/dist/pi/piHarness.js +28 -12
- package/dist/pi/taskClockProcess.d.ts +6 -0
- package/dist/pi/taskClockProcess.d.ts.map +1 -0
- package/dist/pi/taskClockProcess.js +8 -0
- package/dist/pi/turnCausal.d.ts +4 -2
- package/dist/pi/turnCausal.d.ts.map +1 -1
- package/dist/pi/turnCausal.js +4 -4
- package/dist/pi/wakeAcceptance.d.ts +1 -1
- package/dist/pi/wakeAcceptance.d.ts.map +1 -1
- package/dist/pi/wakeAcceptance.js +2 -2
- package/dist/runtime/agySubscriptionBootstrap.js +1 -1
- package/dist/runtime/agySubscriptionRealm.js +1 -1
- package/dist/runtime/attention.d.ts +5 -0
- package/dist/runtime/attention.d.ts.map +1 -1
- package/dist/runtime/attention.js +14 -1
- package/dist/runtime/attentionDispatcher.d.ts +14 -2
- package/dist/runtime/attentionDispatcher.d.ts.map +1 -1
- package/dist/runtime/attentionDispatcher.js +127 -33
- package/dist/runtime/cli.js +5 -0
- package/dist/runtime/contract-manifest.json +1 -1
- package/dist/runtime/contract-manifest.sha256 +1 -1
- package/dist/runtime/engineBrokerCapabilities.d.ts +10 -0
- package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -1
- package/dist/runtime/engineBrokerCapabilities.js +10 -0
- package/dist/runtime/engineBrokerControlClient.d.ts +12 -1
- package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -1
- package/dist/runtime/engineBrokerControlClient.js +139 -43
- package/dist/runtime/engineBrokerCredentialJournal.d.ts +2 -0
- package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -1
- package/dist/runtime/engineBrokerCredentialJournal.js +9 -0
- package/dist/runtime/engineBrokerInferenceProtocol.d.ts +3 -2
- package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -1
- package/dist/runtime/engineBrokerInferenceProtocol.js +4 -4
- package/dist/runtime/engineBrokerMcpCallLog.d.ts +11 -0
- package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -1
- package/dist/runtime/engineBrokerMcpCallLog.js +13 -1
- package/dist/runtime/engineBrokerMcpFacade.d.ts +5 -2
- package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -1
- package/dist/runtime/engineBrokerMcpFacade.js +5 -2
- package/dist/runtime/engineBrokerNativeClient.js +2 -2
- package/dist/runtime/engineBrokerProtocol.d.ts +42 -10
- package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -1
- package/dist/runtime/engineBrokerProtocol.js +97 -14
- package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -1
- package/dist/runtime/engineBrokerSealLedger.js +9 -0
- package/dist/runtime/engineBrokerService.d.ts +8 -2
- package/dist/runtime/engineBrokerService.d.ts.map +1 -1
- package/dist/runtime/engineBrokerService.js +95 -37
- package/dist/runtime/engineBrokerServiceCli.js +1 -1
- package/dist/runtime/engineBrokerServiceConfig.d.ts +5 -0
- package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -1
- package/dist/runtime/engineBrokerServiceConfig.js +47 -9
- package/dist/runtime/engineBrokerTurnRegistry.d.ts +1 -1
- package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -1
- package/dist/runtime/engineBrokerTurnRegistry.js +7 -6
- package/dist/runtime/engineDispatcher.d.ts +2 -0
- package/dist/runtime/engineDispatcher.d.ts.map +1 -1
- package/dist/runtime/engineDispatcher.js +14 -2
- package/dist/runtime/engineReadiness.js +1 -1
- package/dist/runtime/grokBrokerCredentialAuthority.d.ts +1 -0
- package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -1
- package/dist/runtime/grokBrokerCredentialAuthority.js +48 -22
- package/dist/runtime/grokBrokerCredentialReader.d.ts +1 -0
- package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -1
- package/dist/runtime/grokBrokerCredentialReader.js +2 -1
- package/dist/runtime/grokBrokerProjection.d.ts +9 -1
- package/dist/runtime/grokBrokerProjection.d.ts.map +1 -1
- package/dist/runtime/grokBrokerProjection.js +11 -4
- package/dist/runtime/grokBrokerProviderClock.d.ts +26 -0
- package/dist/runtime/grokBrokerProviderClock.d.ts.map +1 -0
- package/dist/runtime/grokBrokerProviderClock.js +133 -0
- package/dist/runtime/grokBrokerProxy.d.ts +17 -3
- package/dist/runtime/grokBrokerProxy.d.ts.map +1 -1
- package/dist/runtime/grokBrokerProxy.js +73 -9
- package/dist/runtime/grokBrokerProxyJson.d.ts +10 -0
- package/dist/runtime/grokBrokerProxyJson.d.ts.map +1 -0
- package/dist/runtime/grokBrokerProxyJson.js +31 -0
- package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -1
- package/dist/runtime/grokBrokerProxyRequest.js +17 -6
- package/dist/runtime/grokBrokerRealmLease.js +1 -1
- package/dist/runtime/grokBrokerRefresh.js +1 -1
- package/dist/runtime/grokBrokerRunBudget.d.ts +20 -0
- package/dist/runtime/grokBrokerRunBudget.d.ts.map +1 -0
- package/dist/runtime/grokBrokerRunBudget.js +85 -0
- package/dist/runtime/grokBrokerSlot.d.ts +6 -0
- package/dist/runtime/grokBrokerSlot.d.ts.map +1 -0
- package/dist/runtime/grokBrokerSlot.js +21 -0
- package/dist/runtime/grokBrokerTaskClock.d.ts +32 -0
- package/dist/runtime/grokBrokerTaskClock.d.ts.map +1 -0
- package/dist/runtime/grokBrokerTaskClock.js +120 -0
- package/dist/runtime/grokBrokerTurnMeter.d.ts +55 -3
- package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -1
- package/dist/runtime/grokBrokerTurnMeter.js +90 -4
- package/dist/runtime/grokBrokerWorkerConfig.d.ts +5 -2
- package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -1
- package/dist/runtime/grokBrokerWorkerConfig.js +22 -3
- package/dist/runtime/grokEngineBroker.d.ts +43 -3
- package/dist/runtime/grokEngineBroker.d.ts.map +1 -1
- package/dist/runtime/grokEngineBroker.js +159 -71
- package/dist/runtime/grokEngineBrokerTurn.d.ts +32 -8
- package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -1
- package/dist/runtime/grokEngineBrokerTurn.js +204 -21
- package/dist/runtime/grokEngineBrokerTurnEnd.d.ts +88 -0
- package/dist/runtime/grokEngineBrokerTurnEnd.d.ts.map +1 -0
- package/dist/runtime/grokEngineBrokerTurnEnd.js +148 -0
- package/dist/runtime/grokInferenceProxy.d.ts.map +1 -1
- package/dist/runtime/grokInferenceProxy.js +3 -0
- package/dist/runtime/grokSubscriptionRealm.js +1 -1
- package/dist/runtime/grokWorkerAttestation.d.ts +9 -4
- package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -1
- package/dist/runtime/grokWorkerAttestation.js +2 -2
- package/dist/runtime/grokWorkerHomeAttestation.d.ts +4 -2
- package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -1
- package/dist/runtime/grokWorkerHomeAttestation.js +10 -4
- package/dist/runtime/index.d.ts +7 -2
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +5 -1
- package/dist/runtime/native/daimon-engine-broker +0 -0
- package/dist/runtime/organizationRuntime.d.ts +3 -0
- package/dist/runtime/organizationRuntime.d.ts.map +1 -1
- package/dist/runtime/organizationRuntimeAdmission.d.ts +6 -0
- package/dist/runtime/organizationRuntimeAdmission.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeAdmission.js +22 -0
- package/dist/runtime/organizationRuntimeControl.d.ts +9 -0
- package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -1
- package/dist/runtime/organizationRuntimeControl.js +72 -24
- package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -1
- package/dist/runtime/organizationRuntimeHost.js +13 -4
- package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -1
- package/dist/runtime/organizationRuntimeParsing.js +4 -1
- package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -1
- package/dist/runtime/organizationRuntimeReadiness.js +8 -0
- package/dist/runtime/organizationRuntimeRecording.d.ts +7 -0
- package/dist/runtime/organizationRuntimeRecording.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeRecording.js +58 -0
- package/dist/runtime/physicalReadiness.d.ts +12 -0
- package/dist/runtime/physicalReadiness.d.ts.map +1 -1
- package/dist/runtime/physicalReadiness.js +43 -9
- package/dist/runtime/productionAgentTools.d.ts.map +1 -1
- package/dist/runtime/productionAgentTools.js +13 -5
- package/dist/runtime/relocateRuntimeConfig.d.ts +14 -0
- package/dist/runtime/relocateRuntimeConfig.d.ts.map +1 -0
- package/dist/runtime/relocateRuntimeConfig.js +38 -0
- package/dist/runtime/schedule.d.ts.map +1 -1
- package/dist/runtime/schedule.js +12 -7
- package/dist/runtime/storeCoordination.d.ts +10 -0
- package/dist/runtime/storeCoordination.d.ts.map +1 -1
- package/dist/runtime/storeCoordination.js +23 -0
- package/dist/runtime/taskClock.d.ts +42 -0
- package/dist/runtime/taskClock.d.ts.map +1 -0
- package/dist/runtime/taskClock.js +102 -0
- package/dist/runtime/taskClockProcess.d.ts +17 -0
- package/dist/runtime/taskClockProcess.d.ts.map +1 -0
- package/dist/runtime/taskClockProcess.js +58 -0
- package/dist/runtime/turnRequestLedger.d.ts +0 -5
- package/dist/runtime/turnRequestLedger.d.ts.map +1 -1
- package/dist/runtime/turnRequestLedger.js +23 -21
- package/dist/runtime/wakeAcceptanceClaimDiagnostics.d.ts +34 -0
- package/dist/runtime/wakeAcceptanceClaimDiagnostics.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceClaimDiagnostics.js +79 -0
- package/dist/runtime/wakeAcceptanceIndex.d.ts +55 -0
- package/dist/runtime/wakeAcceptanceIndex.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceIndex.js +158 -0
- package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +9 -1
- package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -1
- package/dist/runtime/wakeAcceptanceProcessIdentity.js +5 -1
- package/dist/runtime/wakeAcceptanceRecord.d.ts +2 -0
- package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -1
- package/dist/runtime/wakeAcceptanceRecord.js +4 -2
- package/dist/runtime/wakeAcceptanceRetention.d.ts +25 -1
- package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -1
- package/dist/runtime/wakeAcceptanceRetention.js +28 -2
- package/dist/runtime/wakeAcceptanceStore.d.ts +8 -8
- package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -1
- package/dist/runtime/wakeAcceptanceStore.js +66 -63
- package/dist/runtime/wakeFuse.d.ts +58 -3
- package/dist/runtime/wakeFuse.d.ts.map +1 -1
- package/dist/runtime/wakeFuse.js +106 -7
- package/dist/runtime/wakeMomentFs.d.ts +27 -0
- package/dist/runtime/wakeMomentFs.d.ts.map +1 -0
- package/dist/runtime/wakeMomentFs.js +223 -0
- package/dist/runtime/wakeMomentHistory.d.ts +26 -0
- package/dist/runtime/wakeMomentHistory.d.ts.map +1 -0
- package/dist/runtime/wakeMomentHistory.js +109 -0
- package/dist/runtime/wakeMomentIo.d.ts +22 -0
- package/dist/runtime/wakeMomentIo.d.ts.map +1 -0
- package/dist/runtime/wakeMomentIo.js +114 -0
- package/dist/runtime/wakeMomentRecorder.d.ts +33 -0
- package/dist/runtime/wakeMomentRecorder.d.ts.map +1 -0
- package/dist/runtime/wakeMomentRecorder.js +81 -0
- package/dist/runtime/wakeMomentRetention.d.ts +7 -0
- package/dist/runtime/wakeMomentRetention.d.ts.map +1 -0
- package/dist/runtime/wakeMomentRetention.js +143 -0
- package/dist/runtime/wakeMomentRows.d.ts +8 -0
- package/dist/runtime/wakeMomentRows.d.ts.map +1 -0
- package/dist/runtime/wakeMomentRows.js +66 -0
- package/dist/runtime/wakeMomentSnapshot.d.ts +56 -0
- package/dist/runtime/wakeMomentSnapshot.d.ts.map +1 -0
- package/dist/runtime/wakeMomentSnapshot.js +248 -0
- package/package.json +4 -4
|
@@ -100,11 +100,11 @@ export async function prepareGrokWorkerAttestation(input, profileOwner = { uid:
|
|
|
100
100
|
if (workers.some((worker) => worker.home === undefined))
|
|
101
101
|
throw new Error("Grok worker isolation attestation unavailable");
|
|
102
102
|
await verifyGrokWorkerTmp(workers, profileOwner.tmp);
|
|
103
|
-
await verifyGrokWorkerHome(path.dirname(input.profilePath), input.configSha256);
|
|
103
|
+
const configVariant = await verifyGrokWorkerHome(path.dirname(input.profilePath), input.configSha256);
|
|
104
104
|
const events = await secureOpen(input.eventsPath, input.workerUid, input.brokerGid, 0o640, 16 * 1024 * 1024);
|
|
105
105
|
try {
|
|
106
106
|
const stat = await events.stat();
|
|
107
|
-
return { dev: Number(stat.dev), ino: Number(stat.ino), size: Number(stat.size), denyPaths };
|
|
107
|
+
return { dev: Number(stat.dev), ino: Number(stat.ino), size: Number(stat.size), denyPaths, configVariant };
|
|
108
108
|
}
|
|
109
109
|
finally {
|
|
110
110
|
await events.close();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type Stats } from "node:fs";
|
|
2
|
+
import type { GrokWorkerConfigVariant } from "../contracts/grokBrokerTaskClock.js";
|
|
3
|
+
export type GrokWorkerConfigPins = string | Readonly<Record<GrokWorkerConfigVariant, string>>;
|
|
2
4
|
type Entry = Pick<Stats, "uid" | "mode" | "nlink"> & Partial<Pick<Stats, "dev" | "ino">> & Readonly<{
|
|
3
5
|
isFile(): boolean;
|
|
4
6
|
isDirectory(): boolean;
|
|
@@ -20,11 +22,11 @@ type Entry = Pick<Stats, "uid" | "mode" | "nlink"> & Partial<Pick<Stats, "dev" |
|
|
|
20
22
|
*/
|
|
21
23
|
export declare function assertGrokWorkerHomeEntries(entries: Readonly<Record<string, Entry | undefined>>, rootUid?: number): void;
|
|
22
24
|
/** The worker's `config.toml` must be exactly the renderer's bytes for the declared policy. */
|
|
23
|
-
export declare function assertGrokWorkerConfigBytes(bytes: Uint8Array,
|
|
25
|
+
export declare function assertGrokWorkerConfigBytes(bytes: Uint8Array, pins: GrokWorkerConfigPins): GrokWorkerConfigVariant;
|
|
24
26
|
/**
|
|
25
27
|
* Attests the worker home layout and that `config.toml` is exactly the
|
|
26
28
|
* renderer's bytes for the declared model policy (`configSha256`).
|
|
27
29
|
*/
|
|
28
|
-
export declare function verifyGrokWorkerHome(grokHome: string, configSha256:
|
|
30
|
+
export declare function verifyGrokWorkerHome(grokHome: string, configSha256: GrokWorkerConfigPins, rootUid?: number): Promise<GrokWorkerConfigVariant>;
|
|
29
31
|
export {};
|
|
30
32
|
//# sourceMappingURL=grokWorkerHomeAttestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grokWorkerHomeAttestation.d.ts","sourceRoot":"","sources":["../../src/runtime/grokWorkerHomeAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"grokWorkerHomeAttestation.d.ts","sourceRoot":"","sources":["../../src/runtime/grokWorkerHomeAttestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9F,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,QAAQ,CAAC;IAAE,MAAM,IAAI,OAAO,CAAC;IAAC,WAAW,IAAI,OAAO,CAAC;IAAC,cAAc,IAAI,OAAO,CAAA;CAAE,CAAC,CAAC;AAG9K;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC,EAAE,OAAO,GAAE,MAA2B,GAAG,IAAI,CAS5I;AAED,+FAA+F;AAC/F,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,oBAAoB,GAAG,uBAAuB,CAQlH;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,OAAO,GAAE,MAA2B,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAevK"}
|
|
@@ -30,9 +30,15 @@ export function assertGrokWorkerHomeEntries(entries, rootUid = HOME.directory.ui
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/** The worker's `config.toml` must be exactly the renderer's bytes for the declared policy. */
|
|
33
|
-
export function assertGrokWorkerConfigBytes(bytes,
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
export function assertGrokWorkerConfigBytes(bytes, pins) {
|
|
34
|
+
const digest = createHash("sha256").update(bytes).digest("hex");
|
|
35
|
+
const variants = typeof pins === "string" ? { unclocked: pins } : pins;
|
|
36
|
+
for (const variant of ["unclocked", "clocked"]) {
|
|
37
|
+
const pin = variants[variant];
|
|
38
|
+
if (pin !== undefined && /^[0-9a-f]{64}$/u.test(pin) && digest === pin)
|
|
39
|
+
return variant;
|
|
40
|
+
}
|
|
41
|
+
throw unavailable();
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* Attests the worker home layout and that `config.toml` is exactly the
|
|
@@ -57,7 +63,7 @@ export async function verifyGrokWorkerHome(grokHome, configSha256, rootUid = HOM
|
|
|
57
63
|
// Same inode as the lstat above, as in `secureOpen`: a rename between the two cannot swap in other bytes.
|
|
58
64
|
if (!opened.isFile() || opened.size > 65_536 || opened.dev !== before.dev || opened.ino !== before.ino || opened.uid !== before.uid || opened.mode !== before.mode || opened.nlink !== 1)
|
|
59
65
|
throw unavailable();
|
|
60
|
-
assertGrokWorkerConfigBytes(await handle.readFile(), configSha256);
|
|
66
|
+
return assertGrokWorkerConfigBytes(await handle.readFile(), configSha256);
|
|
61
67
|
}
|
|
62
68
|
catch {
|
|
63
69
|
throw unavailable();
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export { brokerTaskClockFileFor } from "./grokBrokerSlot.js";
|
|
2
|
+
export { GROK_BROKER_TASK_CLOCK, GROK_BROKER_TASK_CLOCK_PRELOAD_PATH, GROK_BROKER_TASK_CLOCK_FILE_PATH, type GrokWorkerConfigVariant } from "../contracts/grokBrokerTaskClock.js";
|
|
1
3
|
export * from "./organizationRuntime.js";
|
|
4
|
+
export { relocateRuntimeConfig, type RuntimeConfigLocation } from "./relocateRuntimeConfig.js";
|
|
5
|
+
export { parseTaskClock, TASK_CLOCK_VERSION } from "./taskClock.js";
|
|
2
6
|
export * from "./contractManifest.js";
|
|
3
7
|
export * from "./agySubscriptionRealm.js";
|
|
4
8
|
export { createOrganizationRuntimeHost } from "./organizationRuntimeHost.js";
|
|
@@ -14,7 +18,7 @@ export { GROK_INFERENCE_AUTH_STALE_BODY } from "./grokInferenceProxy.js";
|
|
|
14
18
|
export { assertGrokWorkerDenyPathPlacement, assertGrokWorkerDenyPathShape, assertGrokWorkerDenyPathsPlaceable, GROK_WORKER_BASE_PROFILE_GRANTS, grokWorkerCanSearch, grokWorkerDenyPathChain, GrokWorkerDenyPlacementError, readGrokWorkerDenyPathChain } from "./grokWorkerDenyPlacement.js";
|
|
15
19
|
export type { GrokWorkerDenyPathEntry, GrokWorkerDenyPathStep, GrokWorkerDenyPathWorker } from "./grokWorkerDenyPlacement.js";
|
|
16
20
|
export { grokWorkerSandboxProfileSha256, renderGrokWorkerSandboxProfile } from "./grokWorkerSandboxProfile.js";
|
|
17
|
-
export { engineBrokerRequestLedgerPathFor, engineBrokerSealLedgerPathFor, parseEngineBrokerServiceConfig, type EngineBrokerServiceConfig, type EngineBrokerServiceRegistration } from "./engineBrokerServiceConfig.js";
|
|
21
|
+
export { ENGINE_BROKER_SERVICE_V3, engineBrokerRequestLedgerPathFor, engineBrokerSealLedgerPathFor, parseEngineBrokerServiceConfig, type EngineBrokerServiceConfig, type EngineBrokerServiceRegistration } from "./engineBrokerServiceConfig.js";
|
|
18
22
|
export { TURN_SEAL_LEDGER, TURN_SEAL_LEDGER_VERSION } from "./engineBrokerSealLedger.js";
|
|
19
23
|
export { DEFAULT_GROK_BROKER_TURN_LIMITS, ENGINE_BROKER_LIMIT_REASONS, type EngineBrokerLimitReason, type EngineBrokerTurnAccounting, type EngineBrokerTurnLimits, type EngineBrokerTurnUsage } from "./engineBrokerTurnAccounting.js";
|
|
20
24
|
export { dedupeTurnUsageRows } from "./turnUsageLedger.js";
|
|
@@ -22,5 +26,6 @@ export { WakeTransitionLockBlockedError } from "./wakeAcceptanceStore.js";
|
|
|
22
26
|
export { OFFLINE_RECONCILIATION_BLOCKED_CODE, OFFLINE_RECONCILIATION_REQUEST_SCHEMA, OFFLINE_RECONCILIATION_VERSION, assertOfflineReconciliationLeaseAvailable, OfflineTransitionReconciliationBlockedError, parseOfflineTransitionReconciliationRequest, reconcileOfflineWakeTransition, type OfflineDeploymentAttestation, type OfflineTransitionReconciliationAuthorizationContext, type OfflineTransitionReconciliationOptions, type OfflineTransitionReconciliationProofReceipt, type OfflineTransitionReconciliationReceipt, type OfflineTransitionReconciliationRequest, type OfflineTransitionReconciliationResult } from "./wakeAcceptanceReconciliation.js";
|
|
23
27
|
export { MAX_WAKE_ACCEPTANCE_BYTES, MAX_WAKE_ACCEPTANCE_RECORD_BYTES, WAKE_ACCEPTANCE_VERSION, WAKE_ACCEPTANCE_REQUEST_SCHEMA, WAKE_RECEIPT_STATUS_VERSION, WAKE_RECEIPT_STATUS_SCHEMA, WAKE_V2_VERSION, parseWakeAcceptanceRequest, wakeAcceptanceDigest, type OrganizationRuntimeWakeAcceptance, type OrganizationRuntimeWakeAcceptanceRequest, type OrganizationRuntimeWakeAcceptanceResult, type OrganizationRuntimeWakeReceiptStatus, type WakeReceiptCode, type WakeReceiptState } from "./wakeAcceptanceTypes.js";
|
|
24
28
|
export type { OrganizationRuntimeControlHost, OrganizationRuntimeControlOptions } from "./organizationRuntimeControl.js";
|
|
25
|
-
export { EngineBrokerControlClient, EngineBrokerInferenceGrantRefused, type EngineBrokerInferenceGrant } from "./engineBrokerControlClient.js";
|
|
29
|
+
export { EngineBrokerControlClient, EngineBrokerInferenceGrantRefused, type EngineBrokerInferenceGrant, type EngineBrokerTurnOptions } from "./engineBrokerControlClient.js";
|
|
30
|
+
export type { GrokBrokerProviderClockObservation } from "./grokBrokerProviderClock.js";
|
|
26
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,6BAA6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,EAC3C,KAAK,2CAA2C,EAChD,KAAK,sCAAsC,EAC3C,KAAK,sCAAsC,EAC3C,KAAK,qCAAqC,EAC3C,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,uBAAuB,EACvB,8BAA8B,EAC9B,2BAA2B,EAC3B,0BAA0B,EAC1B,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,KAAK,iCAAiC,EACtC,KAAK,wCAAwC,EAC7C,KAAK,uCAAuC,EAC5C,KAAK,oCAAoC,EACzC,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AACzH,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,KAAK,0BAA0B,EAAE,KAAK,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC7K,YAAY,EAAE,kCAAkC,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export { brokerTaskClockFileFor } from "./grokBrokerSlot.js";
|
|
2
|
+
export { GROK_BROKER_TASK_CLOCK, GROK_BROKER_TASK_CLOCK_PRELOAD_PATH, GROK_BROKER_TASK_CLOCK_FILE_PATH } from "../contracts/grokBrokerTaskClock.js";
|
|
1
3
|
export * from "./organizationRuntime.js";
|
|
4
|
+
export { relocateRuntimeConfig } from "./relocateRuntimeConfig.js";
|
|
5
|
+
export { parseTaskClock, TASK_CLOCK_VERSION } from "./taskClock.js";
|
|
2
6
|
export * from "./contractManifest.js";
|
|
3
7
|
export * from "./agySubscriptionRealm.js";
|
|
4
8
|
export { createOrganizationRuntimeHost } from "./organizationRuntimeHost.js";
|
|
@@ -13,7 +17,7 @@ export { dedupeInferenceUsageRows, INFERENCE_USAGE_LEDGER_VERSION, GROK_INFERENC
|
|
|
13
17
|
export { GROK_INFERENCE_AUTH_STALE_BODY } from "./grokInferenceProxy.js";
|
|
14
18
|
export { assertGrokWorkerDenyPathPlacement, assertGrokWorkerDenyPathShape, assertGrokWorkerDenyPathsPlaceable, GROK_WORKER_BASE_PROFILE_GRANTS, grokWorkerCanSearch, grokWorkerDenyPathChain, GrokWorkerDenyPlacementError, readGrokWorkerDenyPathChain } from "./grokWorkerDenyPlacement.js";
|
|
15
19
|
export { grokWorkerSandboxProfileSha256, renderGrokWorkerSandboxProfile } from "./grokWorkerSandboxProfile.js";
|
|
16
|
-
export { engineBrokerRequestLedgerPathFor, engineBrokerSealLedgerPathFor, parseEngineBrokerServiceConfig } from "./engineBrokerServiceConfig.js";
|
|
20
|
+
export { ENGINE_BROKER_SERVICE_V3, engineBrokerRequestLedgerPathFor, engineBrokerSealLedgerPathFor, parseEngineBrokerServiceConfig } from "./engineBrokerServiceConfig.js";
|
|
17
21
|
export { TURN_SEAL_LEDGER, TURN_SEAL_LEDGER_VERSION } from "./engineBrokerSealLedger.js";
|
|
18
22
|
export { DEFAULT_GROK_BROKER_TURN_LIMITS, ENGINE_BROKER_LIMIT_REASONS } from "./engineBrokerTurnAccounting.js";
|
|
19
23
|
export { dedupeTurnUsageRows } from "./turnUsageLedger.js";
|
|
Binary file
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AttentionConfig } from "../contracts/attentionContract.js";
|
|
2
|
+
import type { WakeMomentRecording } from "../contracts/wakeMomentContract.js";
|
|
3
|
+
export type { WakeMomentRecording } from "../contracts/wakeMomentContract.js";
|
|
2
4
|
import { ORGANIZATION_RUNTIME_CODEX_REASONING_EFFORTS, ORGANIZATION_RUNTIME_CODEX_WORKSPACE_NO_NETWORK_POLICY, ORGANIZATION_RUNTIME_CONFIG_SCHEMA, ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA, ORGANIZATION_RUNTIME_MAX_AGENTS, ORGANIZATION_RUNTIME_MAX_CONFIG_BYTES, ORGANIZATION_RUNTIME_MAX_INSTRUCTIONS_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_STRING_BYTES, ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_WAKE_TEXT_BYTES, ORGANIZATION_RUNTIME_MAX_SCHEDULE_INTERVAL_MS, ORGANIZATION_RUNTIME_MAX_SCHEDULE_JITTER_SECONDS, ORGANIZATION_RUNTIME_V2_VERSION, ORGANIZATION_RUNTIME_VERSION } from "../contracts/organizationRuntimeContract.js";
|
|
3
5
|
export { ORGANIZATION_RUNTIME_CODEX_REASONING_EFFORTS, ORGANIZATION_RUNTIME_CODEX_WORKSPACE_NO_NETWORK_POLICY, ORGANIZATION_RUNTIME_CONFIG_SCHEMA, ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA, ORGANIZATION_RUNTIME_MAX_AGENTS, ORGANIZATION_RUNTIME_MAX_CONFIG_BYTES, ORGANIZATION_RUNTIME_MAX_INSTRUCTIONS_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_STRING_BYTES, ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_WAKE_TEXT_BYTES, ORGANIZATION_RUNTIME_MAX_SCHEDULE_INTERVAL_MS, ORGANIZATION_RUNTIME_MAX_SCHEDULE_JITTER_SECONDS, ORGANIZATION_RUNTIME_V2_VERSION, ORGANIZATION_RUNTIME_VERSION };
|
|
4
6
|
export type OrganizationRuntimeEngineKind = "codex" | "grok" | "agy";
|
|
@@ -67,6 +69,7 @@ export type OrganizationRuntimeAgentConfig = Readonly<{
|
|
|
67
69
|
runtimeHomePath: string;
|
|
68
70
|
engine: OrganizationRuntimeEngineIntent;
|
|
69
71
|
attention?: AttentionConfig;
|
|
72
|
+
recording?: WakeMomentRecording;
|
|
70
73
|
schedule?: OrganizationRuntimeSchedule;
|
|
71
74
|
mcp?: readonly OrganizationRuntimeMcpServer[];
|
|
72
75
|
moltnet?: OrganizationRuntimeMoltnet;
|
|
@@ -1 +1 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AC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC5L,MAAM,MAAM,qCAAqC,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,8CAA8C,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE5I,sEAAsE;AACtE,MAAM,WAAW,uBAAuB;IACtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACtF,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC7D,QAAQ,CAAC,OAAO,EAAE,kCAAkC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAChG,IAAI,IAAI,OAAO,CAAC,qCAAqC,CAAC,CAAC;CACxD;AAED,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,mCAAmC,EACnC,iCAAiC,EAClC,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OrganizationRuntimeHost, OrganizationRuntimeWakeRequest, OrganizationRuntimeWakeResult } from "./organizationRuntime.js";
|
|
2
|
+
export declare function wakeFromDurableInbox(host: OrganizationRuntimeHost, request: OrganizationRuntimeWakeRequest): Promise<OrganizationRuntimeWakeResult>;
|
|
3
|
+
export declare function consumeDurableAdmission(request: OrganizationRuntimeWakeRequest): boolean;
|
|
4
|
+
export declare function registerRecordingVerifier(host: OrganizationRuntimeHost, verify: (agentId: string) => Promise<void>): OrganizationRuntimeHost;
|
|
5
|
+
export declare function verifyHostRecordingStore(host: OrganizationRuntimeHost, agentId: string): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=organizationRuntimeAdmission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationRuntimeAdmission.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeAdmission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAMvI,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAIzJ;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAExF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAG5I;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5G"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Internal capabilities are object identities, never caller-provided wire fields.
|
|
2
|
+
const durableRequests = new WeakSet();
|
|
3
|
+
const recordingVerifiers = new WeakMap();
|
|
4
|
+
export async function wakeFromDurableInbox(host, request) {
|
|
5
|
+
durableRequests.add(request);
|
|
6
|
+
try {
|
|
7
|
+
return await host.wake(request);
|
|
8
|
+
}
|
|
9
|
+
finally {
|
|
10
|
+
durableRequests.delete(request);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function consumeDurableAdmission(request) {
|
|
14
|
+
return durableRequests.delete(request);
|
|
15
|
+
}
|
|
16
|
+
export function registerRecordingVerifier(host, verify) {
|
|
17
|
+
recordingVerifiers.set(host, verify);
|
|
18
|
+
return host;
|
|
19
|
+
}
|
|
20
|
+
export async function verifyHostRecordingStore(host, agentId) {
|
|
21
|
+
await recordingVerifiers.get(host)?.(agentId);
|
|
22
|
+
}
|
|
@@ -4,6 +4,10 @@ import type { AttentionRegistry } from "./attention.js";
|
|
|
4
4
|
import { type ScheduleControllerOptions } from "./schedule.js";
|
|
5
5
|
import { type WakeAcceptanceStoreTestOptions } from "./wakeAcceptanceStore.js";
|
|
6
6
|
import { type OrganizationRuntimeActivityV2, type OrganizationRuntimeWakeAcceptanceResult, type OrganizationRuntimeWakeReceiptStatus } from "./wakeAcceptanceTypes.js";
|
|
7
|
+
export type WorkDrain = Readonly<{
|
|
8
|
+
state: "draining" | "drained";
|
|
9
|
+
since: string;
|
|
10
|
+
}>;
|
|
7
11
|
export type WorkAvailability = Readonly<{
|
|
8
12
|
version: "noopolis.daimon.work-availability.v1";
|
|
9
13
|
state: "running" | "paused" | "stopped";
|
|
@@ -15,12 +19,17 @@ export type WorkAvailability = Readonly<{
|
|
|
15
19
|
budget: WakeBudgetSnapshot;
|
|
16
20
|
error?: string;
|
|
17
21
|
}>[];
|
|
22
|
+
drain?: WorkDrain;
|
|
18
23
|
}>;
|
|
19
24
|
export type OrganizationRuntimeControlHost = OrganizationRuntimeHost & Readonly<{
|
|
20
25
|
accept(request: unknown): Promise<OrganizationRuntimeWakeAcceptanceResult>;
|
|
21
26
|
wakeReceipt(token: string | undefined, acceptanceId: string): Promise<OrganizationRuntimeWakeReceiptStatus | undefined>;
|
|
22
27
|
activityV2(token: string | undefined): Promise<OrganizationRuntimeActivityV2 | undefined>;
|
|
23
28
|
availability(token: string | undefined): Promise<WorkAvailability | undefined>;
|
|
29
|
+
/** Reversible operator drain: new wakes answer work-blocked, queued ones stay durable, running turns finish. */
|
|
30
|
+
drain(token: string | undefined): Promise<WorkAvailability | undefined>;
|
|
31
|
+
/** Ends a drain and dispatches the queue. Never clears the latched `fuse.stop`. */
|
|
32
|
+
resume(token: string | undefined): Promise<WorkAvailability | undefined>;
|
|
24
33
|
}>;
|
|
25
34
|
export type OrganizationRuntimeControlOptions = Readonly<{
|
|
26
35
|
acceptanceStorePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationRuntimeControl.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeControl.ts"],"names":[],"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,kBAAkB,GAAG,8BAA8B,CAE/K;AAoMD,eAAO,MAAM,0BAA0B,OAAO,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { readTaskClock } from "./taskClock.js";
|
|
2
3
|
import { parseOrganizationRuntimeConfig, parseOrganizationRuntimeWakeRequest } from "./organizationRuntime.js";
|
|
3
4
|
import { createOrganizationRuntimeHostWithAttention } from "./organizationRuntimeHost.js";
|
|
4
5
|
import { WakeFuse } from "./wakeFuse.js";
|
|
@@ -28,6 +29,10 @@ function createControl(config, host, options, registry) {
|
|
|
28
29
|
let started = false;
|
|
29
30
|
let stopping = false;
|
|
30
31
|
let sealedActivity;
|
|
32
|
+
/** In-process only: a restarted host admits, so a drained release ends drained-free. */
|
|
33
|
+
let drainedSince;
|
|
34
|
+
/** Synchronous v1 turns bypass the dispatcher; a drain is not drained while one is admitted or running. */
|
|
35
|
+
let v1Turns = 0;
|
|
31
36
|
/**
|
|
32
37
|
* One projection, read the same way live and at shutdown. `active` is decided by
|
|
33
38
|
* the dispatcher's own execution authority rather than the record's flag alone,
|
|
@@ -47,7 +52,7 @@ function createControl(config, host, options, registry) {
|
|
|
47
52
|
const reason = fuse?.tripped();
|
|
48
53
|
return reason === "operator_stop" || reason === "ledger_unavailable" ? reason : undefined;
|
|
49
54
|
};
|
|
50
|
-
const accept = async (value) => {
|
|
55
|
+
const accept = async (value, nativeSchedule = false) => {
|
|
51
56
|
let request;
|
|
52
57
|
try {
|
|
53
58
|
request = parseWakeAcceptanceRequest(value);
|
|
@@ -64,9 +69,12 @@ function createControl(config, host, options, registry) {
|
|
|
64
69
|
const reason = hardReason();
|
|
65
70
|
if (reason)
|
|
66
71
|
return blocked(reason);
|
|
72
|
+
// A drain is an operator stop that can be undone; bridges already defer on this reason.
|
|
73
|
+
if (drainedSince !== undefined)
|
|
74
|
+
return blocked("operator_stop");
|
|
67
75
|
const operation = (async () => {
|
|
68
76
|
try {
|
|
69
|
-
const accepted = await store.accept(request);
|
|
77
|
+
const accepted = await store.accept(request, nativeSchedule);
|
|
70
78
|
// A stop racing this fsync cannot revoke already durable ownership.
|
|
71
79
|
// It remains accepted for restart instead of being terminalized.
|
|
72
80
|
dispatcher?.notify(request.agent_id, accepted.created);
|
|
@@ -88,6 +96,25 @@ function createControl(config, host, options, registry) {
|
|
|
88
96
|
persistence.delete(operation);
|
|
89
97
|
}
|
|
90
98
|
};
|
|
99
|
+
const availability = async (token) => {
|
|
100
|
+
if (!tokensEqual(expectedToken, token) || !store || !fuse)
|
|
101
|
+
return undefined;
|
|
102
|
+
await fuse.pollOperatorStop();
|
|
103
|
+
const items = await store.activityWithExecutionErrors();
|
|
104
|
+
const executionErrors = new Map(items.filter((record) => (record.state === "accepted" || record.state === "running")
|
|
105
|
+
&& record.execution_error !== undefined).map((record) => [record.agent_id, record.execution_error]));
|
|
106
|
+
const agents = await Promise.all(config.agents.map(async (agent) => ({
|
|
107
|
+
agent_id: agent.id, pending: items.filter((item) => item.agent_id === agent.id && (item.state === "accepted" || item.state === "running" && !dispatcher?.activeExecutions().some((execution) => execution.agent_id === agent.id))).length,
|
|
108
|
+
running: dispatcher?.activeExecutions().some((execution) => execution.agent_id === agent.id) ?? false,
|
|
109
|
+
deferred: items.filter((item) => item.agent_id === agent.id && item.state === "accepted" && item.deferred).length,
|
|
110
|
+
budget: await fuse.snapshot(agent.id, agent.attention),
|
|
111
|
+
...((dispatcher?.failure(agent.id) ?? executionErrors.get(agent.id))
|
|
112
|
+
? { error: dispatcher?.failure(agent.id) ?? executionErrors.get(agent.id) } : {})
|
|
113
|
+
})));
|
|
114
|
+
// "drained" only once no inbox loop is alive: nothing runs and nothing can start until resume.
|
|
115
|
+
const drain = drainedSince === undefined ? undefined : { state: dispatcher?.quiescent() === false || v1Turns > 0 ? "draining" : "drained", since: drainedSince };
|
|
116
|
+
return { version: "noopolis.daimon.work-availability.v1", state: hardReason() ? "stopped" : drain !== undefined || agents.some((agent) => agent.budget.state !== "available" || agent.error) ? "paused" : "running", agents, ...(drain === undefined ? {} : { drain }) };
|
|
117
|
+
};
|
|
91
118
|
return {
|
|
92
119
|
wake: async (request) => {
|
|
93
120
|
try {
|
|
@@ -96,23 +123,33 @@ function createControl(config, host, options, registry) {
|
|
|
96
123
|
catch {
|
|
97
124
|
return { version: "noopolis.daimon.wake-result.v1", status: "rejected", agentId: "", wakeId: "", code: "invalid_request" };
|
|
98
125
|
}
|
|
99
|
-
//
|
|
100
|
-
// provide a receipt or leave deferred messages pending.
|
|
126
|
+
// Attention and recording require durable ownership and dispatcher admission.
|
|
101
127
|
if (!tokensEqual(expectedToken, request.token))
|
|
102
128
|
return { version: "noopolis.daimon.wake-result.v1", status: "rejected", agentId: request.agentId, wakeId: request.event.id, code: "unauthorized" };
|
|
103
129
|
if (!knownAgents.has(request.agentId))
|
|
104
130
|
return { version: "noopolis.daimon.wake-result.v1", status: "rejected", agentId: request.agentId, wakeId: request.event.id, code: "unknown_agent" };
|
|
105
|
-
|
|
131
|
+
const agent = config.agents.find((candidate) => candidate.id === request.agentId);
|
|
132
|
+
if (agent.attention !== undefined || agent.recording !== undefined)
|
|
106
133
|
return { version: "noopolis.daimon.wake-result.v1", status: "rejected", agentId: request.agentId, wakeId: request.event.id, code: "durable_inbox_required" };
|
|
107
|
-
|
|
134
|
+
// v1 has no `blocked` member on its wire; a drain answers it exactly as the latched stop does.
|
|
135
|
+
if (hardReason() || drainedSince !== undefined)
|
|
108
136
|
return { version: "noopolis.daimon.wake-result.v1", status: "stopped", agentId: request.agentId, wakeId: request.event.id, code: "host_stopping" };
|
|
109
|
-
|
|
137
|
+
v1Turns += 1;
|
|
138
|
+
try {
|
|
139
|
+
if ((await fuse.admit(request.agentId, request.event.id, config.agents.find((agent) => agent.id === request.agentId)?.attention)).state !== "admitted")
|
|
140
|
+
return { version: "noopolis.daimon.wake-result.v1", status: "stopped", agentId: request.agentId, wakeId: request.event.id, code: "host_stopping" };
|
|
141
|
+
return await host.wake(request);
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
v1Turns -= 1;
|
|
145
|
+
}
|
|
110
146
|
},
|
|
111
147
|
health: async (agentId) => await host.health(agentId),
|
|
112
148
|
activity: async (request) => await host.activity(request),
|
|
113
149
|
async start() {
|
|
114
150
|
if (started)
|
|
115
151
|
return;
|
|
152
|
+
const clock = readTaskClock();
|
|
116
153
|
if (stopping)
|
|
117
154
|
throw new Error("organization runtime control host has been stopped");
|
|
118
155
|
if (!expectedToken?.trim())
|
|
@@ -138,10 +175,12 @@ function createControl(config, host, options, registry) {
|
|
|
138
175
|
fusePoll.unref();
|
|
139
176
|
if (config.version === "noopolis.daimon.organization-runtime.v2") {
|
|
140
177
|
schedules = createScheduleController({ acceptanceStorePath: options.acceptanceStorePath, agents: config.agents, ...options.scheduleOptions,
|
|
178
|
+
// Calendar selection/state use task instants; due - taskNow remains a real delay.
|
|
179
|
+
now: () => { const realNow = (options.scheduleOptions?.now ?? Date.now)(); return clock?.at(realNow) ?? realNow; },
|
|
141
180
|
accept: async (occurrence) => {
|
|
142
|
-
if (dispatcher?.busy(occurrence.agentId) || hardReason())
|
|
181
|
+
if (dispatcher?.busy(occurrence.agentId) || hardReason() || drainedSince !== undefined)
|
|
143
182
|
return false;
|
|
144
|
-
const result = await accept({ token: expectedToken, agent_id: occurrence.agentId, delivery_id: occurrence.deliveryId, event: { version: "noopolis.daimon.wake.v2", kind: "schedule", text: occurrence.prompt, occurred_at: occurrence.occurredAt } });
|
|
183
|
+
const result = await accept({ token: expectedToken, agent_id: occurrence.agentId, delivery_id: occurrence.deliveryId, event: { version: "noopolis.daimon.wake.v2", kind: "schedule", text: occurrence.prompt, occurred_at: occurrence.occurredAt } }, true);
|
|
145
184
|
return result.state === "accepted";
|
|
146
185
|
}
|
|
147
186
|
});
|
|
@@ -157,7 +196,8 @@ function createControl(config, host, options, registry) {
|
|
|
157
196
|
throw error;
|
|
158
197
|
}
|
|
159
198
|
},
|
|
160
|
-
|
|
199
|
+
// Do not expose the private provenance argument, even to JavaScript callers.
|
|
200
|
+
accept: (value) => accept(value),
|
|
161
201
|
async wakeReceipt(token, acceptanceId) {
|
|
162
202
|
if (!tokensEqual(expectedToken, token) || store === undefined)
|
|
163
203
|
return undefined;
|
|
@@ -176,22 +216,30 @@ function createControl(config, host, options, registry) {
|
|
|
176
216
|
return sealedActivity;
|
|
177
217
|
return await projectActivity(store, "running");
|
|
178
218
|
},
|
|
179
|
-
|
|
219
|
+
availability,
|
|
220
|
+
async drain(token) {
|
|
180
221
|
if (!tokensEqual(expectedToken, token) || !store || !fuse)
|
|
181
222
|
return undefined;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
223
|
+
drainedSince ??= new Date().toISOString();
|
|
224
|
+
dispatcher?.pause();
|
|
225
|
+
return await availability(token);
|
|
226
|
+
},
|
|
227
|
+
async resume(token) {
|
|
228
|
+
if (!tokensEqual(expectedToken, token) || !store || !fuse)
|
|
229
|
+
return undefined;
|
|
230
|
+
if (drainedSince !== undefined) {
|
|
231
|
+
drainedSince = undefined;
|
|
232
|
+
// A latched operator stop or fatal fault outlives the drain: resume never reopens it.
|
|
233
|
+
if (!hardReason()) {
|
|
234
|
+
// An owed pass for every agent the drain withheld or that holds queued work;
|
|
235
|
+
// owed passes never count as new input, so deferred deliveries stay deferred.
|
|
236
|
+
const queued = new Set((await store.recoverable(knownAgents).catch(() => [])).filter((record) => !record.deferred).map((record) => record.agent_id));
|
|
237
|
+
if (drainedSince === undefined && !hardReason())
|
|
238
|
+
dispatcher?.resume(queued);
|
|
239
|
+
void schedules?.drain().catch(() => undefined);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return await availability(token);
|
|
195
243
|
},
|
|
196
244
|
async stop() {
|
|
197
245
|
if (!started && stopping)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationRuntimeHost.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"organizationRuntimeHost.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,kBAAkB,CAAC;AAG5E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAK/E,OAAO,EAML,KAAK,8BAA8B,EAInC,KAAK,uBAAuB,EAK7B,MAAM,0BAA0B,CAAC;AAClC,KAAK,gCAAgC,GAAG,CACtC,KAAK,EAAE,8BAA8B,EACrC,KAAK,CAAC,EAAE,UAAU,CAAC,gCAAgC,CAAC,UAAU,CAAC,CAAC,KAC7D,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1B,KAAK,qBAAqB,GAAG,QAAQ,CAAC;IAAE,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC;AAgBpF,iFAAiF;AACjF,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,GAAE,qBAA0B,GAAG,uBAAuB,CAI3H;AACD,uFAAuF;AACvF,wBAAgB,0CAA0C,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,iBAAiB,GAAG,uBAAuB,CAmBjK;AAED,uFAAuF;AACvF,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,gCAAgC,EACzC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,gCAAgC,CAAC,GAC1D,uBAAuB,CAKzB;AA8RD,uFAAuF;AACvF,eAAO,MAAM,+BAA+B,OAAQ,CAAC;AAOrD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMtE"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { consumeDurableAdmission, registerRecordingVerifier } from "./organizationRuntimeAdmission.js";
|
|
2
|
+
import { readTaskClock, taskClockChildEnvironment } from "./taskClock.js";
|
|
1
3
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
2
4
|
import { sanitizeWakeCompletionText } from "./wakeAcceptanceTypes.js";
|
|
3
5
|
import { startOrganizationRuntimeEngine } from "./engineDispatcher.js";
|
|
@@ -123,6 +125,10 @@ function createHost(config, factory, preflight = undefined) {
|
|
|
123
125
|
return startPromise;
|
|
124
126
|
if (stopRequested)
|
|
125
127
|
throw new Error("organization runtime host has been stopped");
|
|
128
|
+
const clock = readTaskClock();
|
|
129
|
+
for (const agent of config.agents)
|
|
130
|
+
for (const server of agent.mcp ?? [])
|
|
131
|
+
taskClockChildEnvironment(server.env, clock);
|
|
126
132
|
if (controlToken === undefined || !controlToken.trim()) {
|
|
127
133
|
throw new Error(`required control token ${config.host.controlTokenEnv} is missing or blank`);
|
|
128
134
|
}
|
|
@@ -200,6 +206,7 @@ function createHost(config, factory, preflight = undefined) {
|
|
|
200
206
|
return startPromise;
|
|
201
207
|
};
|
|
202
208
|
const wake = async (request) => {
|
|
209
|
+
const durable = consumeDurableAdmission(request);
|
|
203
210
|
let parsed;
|
|
204
211
|
try {
|
|
205
212
|
parsed = parseOrganizationRuntimeWakeRequest(request);
|
|
@@ -218,6 +225,8 @@ function createHost(config, factory, preflight = undefined) {
|
|
|
218
225
|
addActivity(parsed.agentId, "wake_rejected", parsed.event.id);
|
|
219
226
|
return rejected(parsed, "unknown_agent");
|
|
220
227
|
}
|
|
228
|
+
if (agent.config.recording && !durable)
|
|
229
|
+
return rejected(parsed, "durable_inbox_required");
|
|
221
230
|
if (agent.pending.length >= maxPendingWakes) {
|
|
222
231
|
addActivity(parsed.agentId, "wake_rejected", parsed.event.id);
|
|
223
232
|
return rejected(parsed, "queue_full");
|
|
@@ -304,13 +313,13 @@ function createHost(config, factory, preflight = undefined) {
|
|
|
304
313
|
stopPromise = undefined; });
|
|
305
314
|
return attempt;
|
|
306
315
|
};
|
|
307
|
-
return { start, wake, health, activity: activityPage, stop }
|
|
316
|
+
return registerRecordingVerifier({ start, wake, health, activity: activityPage, stop }, async (id) => {
|
|
317
|
+
await readiness?.paths.forAgent(agents.get(id).config).verifyRecording?.();
|
|
318
|
+
});
|
|
308
319
|
}
|
|
309
320
|
function toCoreWake(request) {
|
|
310
321
|
return {
|
|
311
|
-
id: request.event.id,
|
|
312
|
-
kind: request.event.kind === "external" ? "manual" : request.event.kind,
|
|
313
|
-
text: request.event.text
|
|
322
|
+
id: request.event.id, kind: request.event.kind === "external" ? "manual" : request.event.kind, text: request.event.text
|
|
314
323
|
};
|
|
315
324
|
}
|
|
316
325
|
function agentHealthState(agent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationRuntimeParsing.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeParsing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organizationRuntimeParsing.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeParsing.ts"],"names":[],"mappings":"AAGA,OAAO,EAcL,KAAK,yBAAyB,EAK9B,KAAK,8BAA8B,EACpC,MAAM,0BAA0B,CAAC;AAOlC,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,CAwBxF;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,OAAO,GAAG,8BAA8B,CAWlG;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,yBAAyB,CAEpG;AAED,eAAO,MAAM,2BAA2B,0CAAoC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GROK_BROKER_MODELS, GROK_BROKER_REASONING_EFFORTS } from "../contracts/grokWorkerContract.js";
|
|
2
2
|
import { parseAttention } from "./attention.js";
|
|
3
|
+
import { isolateRecording, parseRecording } from "./organizationRuntimeRecording.js";
|
|
3
4
|
import { ORGANIZATION_RUNTIME_CODEX_REASONING_EFFORTS, ORGANIZATION_RUNTIME_CODEX_WORKSPACE_NO_NETWORK_POLICY, ORGANIZATION_RUNTIME_MAX_AGENTS, ORGANIZATION_RUNTIME_MAX_CONFIG_BYTES, ORGANIZATION_RUNTIME_MAX_INSTRUCTIONS_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_STRING_BYTES, ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS, ORGANIZATION_RUNTIME_MAX_WAKE_TEXT_BYTES, ORGANIZATION_RUNTIME_MAX_SCHEDULE_INTERVAL_MS, ORGANIZATION_RUNTIME_MAX_SCHEDULE_JITTER_SECONDS, ORGANIZATION_RUNTIME_V2_VERSION, ORGANIZATION_RUNTIME_VERSION } from "./organizationRuntime.js";
|
|
4
5
|
const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
5
6
|
const ENGINE_KINDS = new Set(["codex", "grok", "agy"]);
|
|
@@ -29,6 +30,7 @@ export function parseOrganizationRuntimeConfig(value) {
|
|
|
29
30
|
});
|
|
30
31
|
isolated(agents);
|
|
31
32
|
isolatedMemory(agents);
|
|
33
|
+
isolateRecording(agents);
|
|
32
34
|
return { version: version, host, agents };
|
|
33
35
|
}
|
|
34
36
|
export function parseOrganizationRuntimeWakeRequest(value) {
|
|
@@ -58,10 +60,11 @@ export function validateOrganizationRuntimeConfig(value) {
|
|
|
58
60
|
export const isOrganizationRuntimeConfig = validateOrganizationRuntimeConfig;
|
|
59
61
|
function parseAgent(value, label, v2) {
|
|
60
62
|
const agent = object(value, label);
|
|
61
|
-
exactOptional(agent, v2 ? ["id", "name", "instructions", "workspacePath", "runtimeHomePath", "engine", "schedule"] : ["id", "name", "instructions", "workspacePath", "runtimeHomePath", "engine"], ["mcp", "moltnet", "memory", "attention"], label);
|
|
63
|
+
exactOptional(agent, v2 ? ["id", "name", "instructions", "workspacePath", "runtimeHomePath", "engine", "schedule"] : ["id", "name", "instructions", "workspacePath", "runtimeHomePath", "engine"], ["mcp", "moltnet", "memory", "attention", "recording"], label);
|
|
62
64
|
return {
|
|
63
65
|
id: nonEmpty(agent.id, `${label}.id`), name: nonEmpty(agent.name, `${label}.name`), instructions: nonEmpty(agent.instructions, `${label}.instructions`, ORGANIZATION_RUNTIME_MAX_INSTRUCTIONS_CODEPOINTS), workspacePath: absolute(agent.workspacePath, `${label}.workspacePath`), runtimeHomePath: absolute(agent.runtimeHomePath, `${label}.runtimeHomePath`), engine: engine(agent.engine, `${label}.engine`),
|
|
64
66
|
...(agent.attention === undefined ? {} : { attention: parseAttention(agent.attention) }),
|
|
67
|
+
...(agent.recording === undefined ? {} : { recording: parseRecording(agent.recording) }),
|
|
65
68
|
...(v2 ? { schedule: schedule(agent.schedule, `${label}.schedule`) } : {}),
|
|
66
69
|
...(agent.mcp === undefined ? {} : { mcp: mcpServers(agent.mcp, `${label}.mcp`) }),
|
|
67
70
|
...(agent.moltnet === undefined ? {} : { moltnet: moltnet(agent.moltnet, `${label}.moltnet`) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationRuntimeReadiness.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeReadiness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organizationRuntimeReadiness.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeReadiness.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAmC,KAAK,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAEhH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IACtD,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,KAAK,EAAE,gCAAgC,CAAC;IACxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC,CAAC;AAEH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,gCAAgC,CAAC,CAiE3C"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { reportEngineTaskClockGap } from "../pi/engineTaskClock.js";
|
|
1
2
|
import { startAgySubscriptionRealm } from "./agySubscriptionRealm.js";
|
|
2
3
|
import { prepareEngineExecutable, verifyAgySubscriptionEnrollment } from "./engineReadiness.js";
|
|
4
|
+
import { readTaskClock } from "./taskClock.js";
|
|
5
|
+
import { memoryClockOptions } from "../pi/memoryClock.js";
|
|
3
6
|
import { prepareOrganizationRuntimePaths } from "./physicalReadiness.js";
|
|
4
7
|
import { materializePortableCredential } from "./portableCredentialMaterial.js";
|
|
5
8
|
import { EngineBrokerControlClient } from "./engineBrokerControlClient.js";
|
|
6
9
|
export async function prepareProductionReadiness(config) {
|
|
10
|
+
const clock = readTaskClock();
|
|
11
|
+
for (const agent of config.agents)
|
|
12
|
+
reportEngineTaskClockGap(agent.engine.kind);
|
|
13
|
+
if (config.agents.some((agent) => agent.memory !== undefined))
|
|
14
|
+
memoryClockOptions(clock);
|
|
7
15
|
const paths = await prepareOrganizationRuntimePaths(config.agents);
|
|
8
16
|
let realm;
|
|
9
17
|
let grokBroker;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WakeMomentRecording } from "../contracts/wakeMomentContract.js";
|
|
2
|
+
import type { OrganizationRuntimeAgentConfig } from "./organizationRuntime.js";
|
|
3
|
+
/** Receives the parser's already cloned JSON data; no I/O or caller hooks. */
|
|
4
|
+
export declare function parseRecording(value: unknown): WakeMomentRecording;
|
|
5
|
+
export declare function isolateRecording(agents: readonly OrganizationRuntimeAgentConfig[]): void;
|
|
6
|
+
export declare function pathsOverlap(left: string, right: string): boolean;
|
|
7
|
+
//# sourceMappingURL=organizationRuntimeRecording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationRuntimeRecording.d.ts","sourceRoot":"","sources":["../../src/runtime/organizationRuntimeRecording.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE/E,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAgBlE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,8BAA8B,EAAE,GAAG,IAAI,CAYxF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|