@noopolis/daimon 0.1.1 → 0.2.0
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 +307 -45
- package/dist/contracts/attentionContract.d.ts +117 -0
- package/dist/contracts/attentionContract.d.ts.map +1 -0
- package/dist/contracts/attentionContract.js +14 -0
- package/dist/contracts/canonicalJson.d.ts +3 -0
- package/dist/contracts/canonicalJson.d.ts.map +1 -0
- package/dist/contracts/canonicalJson.js +54 -0
- package/dist/contracts/grokWorkerContract.d.ts +74 -0
- package/dist/contracts/grokWorkerContract.d.ts.map +1 -0
- package/dist/contracts/grokWorkerContract.js +88 -0
- package/dist/contracts/organizationRuntimeContract.d.ts +765 -0
- package/dist/contracts/organizationRuntimeContract.d.ts.map +1 -0
- package/dist/contracts/organizationRuntimeContract.js +121 -0
- package/dist/contracts/runtimeContractManifest.d.ts +1615 -0
- package/dist/contracts/runtimeContractManifest.d.ts.map +1 -0
- package/dist/contracts/runtimeContractManifest.js +181 -0
- package/dist/core/credentialRedaction.d.ts +4 -0
- package/dist/core/credentialRedaction.d.ts.map +1 -0
- package/dist/core/credentialRedaction.js +28 -0
- package/dist/core/siblingBuildFreshness.d.ts +21 -0
- package/dist/core/siblingBuildFreshness.d.ts.map +1 -0
- package/dist/core/siblingBuildFreshness.js +25 -0
- package/dist/core/types.d.ts +10 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/examples/exampleCausalId.d.ts +3 -0
- package/dist/examples/exampleCausalId.d.ts.map +1 -0
- package/dist/examples/exampleCausalId.js +8 -0
- package/dist/examples/jungian-play-org.js +3 -2
- package/dist/examples/jungian-triad-org.js +3 -2
- package/dist/examples/jungianPlayAgent.d.ts +1 -1
- package/dist/examples/jungianPlayAgent.d.ts.map +1 -1
- package/dist/examples/jungianPlayAgent.js +1 -1
- package/dist/examples/jungianProfiles.d.ts +1 -1
- package/dist/examples/jungianProfiles.d.ts.map +1 -1
- package/dist/examples/jungianTriadProfiles.d.ts +1 -1
- package/dist/examples/jungianTriadProfiles.d.ts.map +1 -1
- package/dist/examples/pi-agent.js +3 -2
- package/dist/examples/pi-memory-org.js +6 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/mcp/toolServer.d.ts +31 -0
- package/dist/mcp/toolServer.d.ts.map +1 -0
- package/dist/mcp/toolServer.js +145 -0
- package/dist/observability/causalEvents.d.ts +118 -0
- package/dist/observability/causalEvents.d.ts.map +1 -0
- package/dist/observability/causalEvents.js +223 -0
- package/dist/observability/controlCausal.d.ts +117 -0
- package/dist/observability/controlCausal.d.ts.map +1 -0
- package/dist/observability/controlCausal.js +107 -0
- package/dist/observability/emitCausalFixture.d.ts +25 -0
- package/dist/observability/emitCausalFixture.d.ts.map +1 -0
- package/dist/observability/emitCausalFixture.js +98 -0
- package/dist/observability/index.d.ts +2 -0
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +2 -0
- package/dist/observability/orgObserver.d.ts.map +1 -1
- package/dist/observability/orgObserver.js +3 -3
- package/dist/pi/agyHeadlessResult.d.ts +60 -0
- package/dist/pi/agyHeadlessResult.d.ts.map +1 -0
- package/dist/pi/agyHeadlessResult.js +95 -0
- package/dist/pi/cliChildOutput.d.ts +67 -0
- package/dist/pi/cliChildOutput.d.ts.map +1 -0
- package/dist/pi/cliChildOutput.js +269 -0
- package/dist/pi/cliEngineRun.d.ts +16 -0
- package/dist/pi/cliEngineRun.d.ts.map +1 -0
- package/dist/pi/cliEngineRun.js +27 -0
- package/dist/pi/cliEngineSpawn.d.ts +55 -0
- package/dist/pi/cliEngineSpawn.d.ts.map +1 -0
- package/dist/pi/cliEngineSpawn.js +164 -0
- package/dist/pi/cliEnvironment.d.ts +12 -0
- package/dist/pi/cliEnvironment.d.ts.map +1 -0
- package/dist/pi/cliEnvironment.js +32 -0
- package/dist/pi/cliMcpRegistration.d.ts +61 -0
- package/dist/pi/cliMcpRegistration.d.ts.map +1 -0
- package/dist/pi/cliMcpRegistration.js +75 -0
- package/dist/pi/cliProcess.d.ts +7 -0
- package/dist/pi/cliProcess.d.ts.map +1 -0
- package/dist/pi/cliProcess.js +132 -0
- package/dist/pi/cliSession.d.ts +106 -0
- package/dist/pi/cliSession.d.ts.map +1 -0
- package/dist/pi/cliSession.js +379 -0
- package/dist/pi/cliTurnMetering.d.ts +60 -0
- package/dist/pi/cliTurnMetering.d.ts.map +1 -0
- package/dist/pi/cliTurnMetering.js +60 -0
- package/dist/pi/codexFilesystemRules.d.ts +3 -0
- package/dist/pi/codexFilesystemRules.d.ts.map +1 -0
- package/dist/pi/codexFilesystemRules.js +28 -0
- package/dist/pi/codexHeadlessResult.d.ts +68 -0
- package/dist/pi/codexHeadlessResult.d.ts.map +1 -0
- package/dist/pi/codexHeadlessResult.js +122 -0
- package/dist/pi/codexRolloutUsage.d.ts +95 -0
- package/dist/pi/codexRolloutUsage.d.ts.map +1 -0
- package/dist/pi/codexRolloutUsage.js +221 -0
- package/dist/pi/engineWakeLimits.d.ts +39 -0
- package/dist/pi/engineWakeLimits.d.ts.map +1 -0
- package/dist/pi/engineWakeLimits.js +55 -0
- package/dist/pi/grokHeadlessResult.d.ts +36 -0
- package/dist/pi/grokHeadlessResult.d.ts.map +1 -0
- package/dist/pi/grokHeadlessResult.js +118 -0
- package/dist/pi/grokHomeMcpRegistration.d.ts +21 -0
- package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -0
- package/dist/pi/grokHomeMcpRegistration.js +57 -0
- package/dist/pi/grokSandbox.d.ts +11 -0
- package/dist/pi/grokSandbox.d.ts.map +1 -0
- package/dist/pi/grokSandbox.js +216 -0
- package/dist/pi/grokStreamUsage.d.ts +31 -0
- package/dist/pi/grokStreamUsage.d.ts.map +1 -0
- package/dist/pi/grokStreamUsage.js +51 -0
- package/dist/pi/index.d.ts +5 -0
- package/dist/pi/index.d.ts.map +1 -1
- package/dist/pi/index.js +5 -0
- package/dist/pi/memoryTools.d.ts +55 -1
- package/dist/pi/memoryTools.d.ts.map +1 -1
- package/dist/pi/memoryTools.js +144 -24
- package/dist/pi/modelRegistry.d.ts +13 -0
- package/dist/pi/modelRegistry.d.ts.map +1 -0
- package/dist/pi/modelRegistry.js +19 -0
- package/dist/pi/piAgentHandle.d.ts +46 -0
- package/dist/pi/piAgentHandle.d.ts.map +1 -0
- package/dist/pi/piAgentHandle.js +351 -0
- package/dist/pi/piAgentWakeSupport.d.ts +103 -0
- package/dist/pi/piAgentWakeSupport.d.ts.map +1 -0
- package/dist/pi/piAgentWakeSupport.js +151 -0
- package/dist/pi/piHarness.d.ts +40 -5
- package/dist/pi/piHarness.d.ts.map +1 -1
- package/dist/pi/piHarness.js +151 -256
- package/dist/pi/prompts.d.ts +10 -0
- package/dist/pi/prompts.d.ts.map +1 -0
- package/dist/pi/prompts.js +63 -0
- package/dist/pi/rawTrainingCapture.d.ts +59 -0
- package/dist/pi/rawTrainingCapture.d.ts.map +1 -0
- package/dist/pi/rawTrainingCapture.js +175 -0
- package/dist/pi/turnCausal.d.ts +73 -0
- package/dist/pi/turnCausal.d.ts.map +1 -0
- package/dist/pi/turnCausal.js +75 -0
- package/dist/pi/turnTrace.d.ts +128 -0
- package/dist/pi/turnTrace.d.ts.map +1 -0
- package/dist/pi/turnTrace.js +138 -0
- package/dist/pi/wakeAcceptance.d.ts +49 -0
- package/dist/pi/wakeAcceptance.d.ts.map +1 -0
- package/dist/pi/wakeAcceptance.js +281 -0
- package/dist/pi/wakeAcceptanceFs.d.ts +44 -0
- package/dist/pi/wakeAcceptanceFs.d.ts.map +1 -0
- package/dist/pi/wakeAcceptanceFs.js +318 -0
- package/dist/pi/wakeAcceptanceSchema.d.ts +75 -0
- package/dist/pi/wakeAcceptanceSchema.d.ts.map +1 -0
- package/dist/pi/wakeAcceptanceSchema.js +265 -0
- package/dist/pi/wakeModes.d.ts +9 -0
- package/dist/pi/wakeModes.d.ts.map +1 -0
- package/dist/pi/wakeModes.js +19 -0
- package/dist/pi/worldNudge.d.ts +22 -0
- package/dist/pi/worldNudge.d.ts.map +1 -0
- package/dist/pi/worldNudge.js +62 -0
- package/dist/pi/worldToolProtocol.d.ts +13 -0
- package/dist/pi/worldToolProtocol.d.ts.map +1 -0
- package/dist/pi/worldToolProtocol.js +49 -0
- package/dist/pi/worldTools.d.ts +32 -0
- package/dist/pi/worldTools.d.ts.map +1 -0
- package/dist/pi/worldTools.js +373 -0
- package/dist/pi/worldTrajectory.d.ts +52 -0
- package/dist/pi/worldTrajectory.d.ts.map +1 -0
- package/dist/pi/worldTrajectory.js +131 -0
- package/dist/runtime/agySubscriptionBootstrap.d.ts +16 -0
- package/dist/runtime/agySubscriptionBootstrap.d.ts.map +1 -0
- package/dist/runtime/agySubscriptionBootstrap.js +80 -0
- package/dist/runtime/agySubscriptionRealm.d.ts +38 -0
- package/dist/runtime/agySubscriptionRealm.d.ts.map +1 -0
- package/dist/runtime/agySubscriptionRealm.js +242 -0
- package/dist/runtime/attention.d.ts +21 -0
- package/dist/runtime/attention.d.ts.map +1 -0
- package/dist/runtime/attention.js +36 -0
- package/dist/runtime/attentionDispatcher.d.ts +66 -0
- package/dist/runtime/attentionDispatcher.d.ts.map +1 -0
- package/dist/runtime/attentionDispatcher.js +271 -0
- package/dist/runtime/cli.d.ts +7 -0
- package/dist/runtime/cli.d.ts.map +1 -0
- package/dist/runtime/cli.js +251 -0
- package/dist/runtime/codexSandboxProjection.d.ts +17 -0
- package/dist/runtime/codexSandboxProjection.d.ts.map +1 -0
- package/dist/runtime/codexSandboxProjection.js +40 -0
- package/dist/runtime/contract-manifest.json +1 -0
- package/dist/runtime/contract-manifest.sha256 +1 -0
- package/dist/runtime/contractManifest.d.ts +8 -0
- package/dist/runtime/contractManifest.d.ts.map +1 -0
- package/dist/runtime/contractManifest.js +4 -0
- package/dist/runtime/engineBrokerCapabilities.d.ts +30 -0
- package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -0
- package/dist/runtime/engineBrokerCapabilities.js +59 -0
- package/dist/runtime/engineBrokerControlClient.d.ts +44 -0
- package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -0
- package/dist/runtime/engineBrokerControlClient.js +132 -0
- package/dist/runtime/engineBrokerCredentialJournal.d.ts +10 -0
- package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -0
- package/dist/runtime/engineBrokerCredentialJournal.js +17 -0
- package/dist/runtime/engineBrokerInferenceProtocol.d.ts +52 -0
- package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -0
- package/dist/runtime/engineBrokerInferenceProtocol.js +65 -0
- package/dist/runtime/engineBrokerMcpCallLog.d.ts +160 -0
- package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -0
- package/dist/runtime/engineBrokerMcpCallLog.js +219 -0
- package/dist/runtime/engineBrokerMcpFacade.d.ts +56 -0
- package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -0
- package/dist/runtime/engineBrokerMcpFacade.js +343 -0
- package/dist/runtime/engineBrokerNativeClient.d.ts +52 -0
- package/dist/runtime/engineBrokerNativeClient.d.ts.map +1 -0
- package/dist/runtime/engineBrokerNativeClient.js +151 -0
- package/dist/runtime/engineBrokerProtocol.d.ts +135 -0
- package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -0
- package/dist/runtime/engineBrokerProtocol.js +274 -0
- package/dist/runtime/engineBrokerSealLedger.d.ts +70 -0
- package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -0
- package/dist/runtime/engineBrokerSealLedger.js +123 -0
- package/dist/runtime/engineBrokerService.d.ts +37 -0
- package/dist/runtime/engineBrokerService.d.ts.map +1 -0
- package/dist/runtime/engineBrokerService.js +138 -0
- package/dist/runtime/engineBrokerServiceCli.d.ts +5 -0
- package/dist/runtime/engineBrokerServiceCli.d.ts.map +1 -0
- package/dist/runtime/engineBrokerServiceCli.js +32 -0
- package/dist/runtime/engineBrokerServiceConfig.d.ts +50 -0
- package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -0
- package/dist/runtime/engineBrokerServiceConfig.js +92 -0
- package/dist/runtime/engineBrokerSingleflight.d.ts +13 -0
- package/dist/runtime/engineBrokerSingleflight.d.ts.map +1 -0
- package/dist/runtime/engineBrokerSingleflight.js +24 -0
- package/dist/runtime/engineBrokerTurnAccounting.d.ts +76 -0
- package/dist/runtime/engineBrokerTurnAccounting.d.ts.map +1 -0
- package/dist/runtime/engineBrokerTurnAccounting.js +108 -0
- package/dist/runtime/engineBrokerTurnRegistry.d.ts +57 -0
- package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -0
- package/dist/runtime/engineBrokerTurnRegistry.js +158 -0
- package/dist/runtime/engineDispatcher.d.ts +36 -0
- package/dist/runtime/engineDispatcher.d.ts.map +1 -0
- package/dist/runtime/engineDispatcher.js +216 -0
- package/dist/runtime/engineReadiness.d.ts +23 -0
- package/dist/runtime/engineReadiness.d.ts.map +1 -0
- package/dist/runtime/engineReadiness.js +222 -0
- package/dist/runtime/grokAuthenticationError.d.ts +8 -0
- package/dist/runtime/grokAuthenticationError.d.ts.map +1 -0
- package/dist/runtime/grokAuthenticationError.js +20 -0
- package/dist/runtime/grokBrokerCredentialAuthority.d.ts +22 -0
- package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -0
- package/dist/runtime/grokBrokerCredentialAuthority.js +124 -0
- package/dist/runtime/grokBrokerCredentialReader.d.ts +5 -0
- package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -0
- package/dist/runtime/grokBrokerCredentialReader.js +37 -0
- package/dist/runtime/grokBrokerModelPolicy.d.ts +23 -0
- package/dist/runtime/grokBrokerModelPolicy.d.ts.map +1 -0
- package/dist/runtime/grokBrokerModelPolicy.js +28 -0
- package/dist/runtime/grokBrokerProjection.d.ts +106 -0
- package/dist/runtime/grokBrokerProjection.d.ts.map +1 -0
- package/dist/runtime/grokBrokerProjection.js +94 -0
- package/dist/runtime/grokBrokerProxy.d.ts +55 -0
- package/dist/runtime/grokBrokerProxy.d.ts.map +1 -0
- package/dist/runtime/grokBrokerProxy.js +262 -0
- package/dist/runtime/grokBrokerProxyRequest.d.ts +30 -0
- package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -0
- package/dist/runtime/grokBrokerProxyRequest.js +74 -0
- package/dist/runtime/grokBrokerRealmLease.d.ts +4 -0
- package/dist/runtime/grokBrokerRealmLease.d.ts.map +1 -0
- package/dist/runtime/grokBrokerRealmLease.js +33 -0
- package/dist/runtime/grokBrokerRefresh.d.ts +2 -0
- package/dist/runtime/grokBrokerRefresh.d.ts.map +1 -0
- package/dist/runtime/grokBrokerRefresh.js +15 -0
- package/dist/runtime/grokBrokerTurnMeter.d.ts +128 -0
- package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -0
- package/dist/runtime/grokBrokerTurnMeter.js +251 -0
- package/dist/runtime/grokBrokerWorkerConfig.d.ts +86 -0
- package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -0
- package/dist/runtime/grokBrokerWorkerConfig.js +135 -0
- package/dist/runtime/grokEngineBroker.d.ts +48 -0
- package/dist/runtime/grokEngineBroker.d.ts.map +1 -0
- package/dist/runtime/grokEngineBroker.js +114 -0
- package/dist/runtime/grokEngineBrokerLedger.d.ts +52 -0
- package/dist/runtime/grokEngineBrokerLedger.d.ts.map +1 -0
- package/dist/runtime/grokEngineBrokerLedger.js +114 -0
- package/dist/runtime/grokEngineBrokerMetering.d.ts +51 -0
- package/dist/runtime/grokEngineBrokerMetering.d.ts.map +1 -0
- package/dist/runtime/grokEngineBrokerMetering.js +34 -0
- package/dist/runtime/grokEngineBrokerTurn.d.ts +58 -0
- package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -0
- package/dist/runtime/grokEngineBrokerTurn.js +165 -0
- package/dist/runtime/grokInferenceClientConfig.d.ts +41 -0
- package/dist/runtime/grokInferenceClientConfig.d.ts.map +1 -0
- package/dist/runtime/grokInferenceClientConfig.js +62 -0
- package/dist/runtime/grokInferenceGrants.d.ts +77 -0
- package/dist/runtime/grokInferenceGrants.d.ts.map +1 -0
- package/dist/runtime/grokInferenceGrants.js +116 -0
- package/dist/runtime/grokInferenceProxy.d.ts +29 -0
- package/dist/runtime/grokInferenceProxy.d.ts.map +1 -0
- package/dist/runtime/grokInferenceProxy.js +82 -0
- package/dist/runtime/grokInferenceProxyRequest.d.ts +23 -0
- package/dist/runtime/grokInferenceProxyRequest.d.ts.map +1 -0
- package/dist/runtime/grokInferenceProxyRequest.js +63 -0
- package/dist/runtime/grokSlotPreflightReceipt.d.ts +70 -0
- package/dist/runtime/grokSlotPreflightReceipt.d.ts.map +1 -0
- package/dist/runtime/grokSlotPreflightReceipt.js +101 -0
- package/dist/runtime/grokSubscriptionRealm.d.ts +4 -0
- package/dist/runtime/grokSubscriptionRealm.d.ts.map +1 -0
- package/dist/runtime/grokSubscriptionRealm.js +435 -0
- package/dist/runtime/grokSubscriptionRealmTypes.d.ts +26 -0
- package/dist/runtime/grokSubscriptionRealmTypes.d.ts.map +1 -0
- package/dist/runtime/grokSubscriptionRealmTypes.js +1 -0
- package/dist/runtime/grokWorkerAttestation.d.ts +170 -0
- package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -0
- package/dist/runtime/grokWorkerAttestation.js +266 -0
- package/dist/runtime/grokWorkerDenyPlacement.d.ts +80 -0
- package/dist/runtime/grokWorkerDenyPlacement.d.ts.map +1 -0
- package/dist/runtime/grokWorkerDenyPlacement.js +128 -0
- package/dist/runtime/grokWorkerHomeAttestation.d.ts +30 -0
- package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -0
- package/dist/runtime/grokWorkerHomeAttestation.js +69 -0
- package/dist/runtime/grokWorkerSandboxProfile.d.ts +27 -0
- package/dist/runtime/grokWorkerSandboxProfile.d.ts.map +1 -0
- package/dist/runtime/grokWorkerSandboxProfile.js +44 -0
- package/dist/runtime/grokWorkerTmpAttestation.d.ts +55 -0
- package/dist/runtime/grokWorkerTmpAttestation.d.ts.map +1 -0
- package/dist/runtime/grokWorkerTmpAttestation.js +63 -0
- package/dist/runtime/index.d.ts +26 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +23 -0
- package/dist/runtime/inferenceUsageLedger.d.ts +38 -0
- package/dist/runtime/inferenceUsageLedger.d.ts.map +1 -0
- package/dist/runtime/inferenceUsageLedger.js +53 -0
- package/dist/runtime/mcpToolResult.d.ts +127 -0
- package/dist/runtime/mcpToolResult.d.ts.map +1 -0
- package/dist/runtime/mcpToolResult.js +214 -0
- package/dist/runtime/moltnetMachineRead.d.ts +97 -0
- package/dist/runtime/moltnetMachineRead.d.ts.map +1 -0
- package/dist/runtime/moltnetMachineRead.js +183 -0
- package/dist/runtime/native/daimon-engine-broker +0 -0
- package/dist/runtime/organizationRuntime.d.ts +165 -0
- package/dist/runtime/organizationRuntime.d.ts.map +1 -0
- package/dist/runtime/organizationRuntime.js +3 -0
- package/dist/runtime/organizationRuntimeControl.d.ts +42 -0
- package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeControl.js +235 -0
- package/dist/runtime/organizationRuntimeHost.d.ts +19 -0
- package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeHost.js +359 -0
- package/dist/runtime/organizationRuntimeParsing.d.ts +6 -0
- package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeParsing.js +370 -0
- package/dist/runtime/organizationRuntimeReadiness.d.ts +12 -0
- package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -0
- package/dist/runtime/organizationRuntimeReadiness.js +59 -0
- package/dist/runtime/physicalReadiness.d.ts +47 -0
- package/dist/runtime/physicalReadiness.d.ts.map +1 -0
- package/dist/runtime/physicalReadiness.js +142 -0
- package/dist/runtime/portableCredentialAuth.d.ts +6 -0
- package/dist/runtime/portableCredentialAuth.d.ts.map +1 -0
- package/dist/runtime/portableCredentialAuth.js +70 -0
- package/dist/runtime/portableCredentialMaterial.d.ts +8 -0
- package/dist/runtime/portableCredentialMaterial.d.ts.map +1 -0
- package/dist/runtime/portableCredentialMaterial.js +169 -0
- package/dist/runtime/productionAgentTools.d.ts +5 -0
- package/dist/runtime/productionAgentTools.d.ts.map +1 -0
- package/dist/runtime/productionAgentTools.js +328 -0
- package/dist/runtime/runtimeHomeLayout.d.ts +48 -0
- package/dist/runtime/runtimeHomeLayout.d.ts.map +1 -0
- package/dist/runtime/runtimeHomeLayout.js +84 -0
- package/dist/runtime/schedule.d.ts +40 -0
- package/dist/runtime/schedule.d.ts.map +1 -0
- package/dist/runtime/schedule.js +371 -0
- package/dist/runtime/storeCoordination.d.ts +23 -0
- package/dist/runtime/storeCoordination.d.ts.map +1 -0
- package/dist/runtime/storeCoordination.js +94 -0
- package/dist/runtime/toolResultSpill.d.ts +152 -0
- package/dist/runtime/toolResultSpill.d.ts.map +1 -0
- package/dist/runtime/toolResultSpill.js +351 -0
- package/dist/runtime/turnRequestLedger.d.ts +160 -0
- package/dist/runtime/turnRequestLedger.d.ts.map +1 -0
- package/dist/runtime/turnRequestLedger.js +249 -0
- package/dist/runtime/turnUsageLedger.d.ts +143 -0
- package/dist/runtime/turnUsageLedger.d.ts.map +1 -0
- package/dist/runtime/turnUsageLedger.js +203 -0
- package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +17 -0
- package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceProcessIdentity.js +50 -0
- package/dist/runtime/wakeAcceptanceReconciliation.d.ts +211 -0
- package/dist/runtime/wakeAcceptanceReconciliation.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceReconciliation.js +289 -0
- package/dist/runtime/wakeAcceptanceRecord.d.ts +23 -0
- package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceRecord.js +56 -0
- package/dist/runtime/wakeAcceptanceRetention.d.ts +12 -0
- package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceRetention.js +12 -0
- package/dist/runtime/wakeAcceptanceStore.d.ts +113 -0
- package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceStore.js +558 -0
- package/dist/runtime/wakeAcceptanceTypes.d.ts +179 -0
- package/dist/runtime/wakeAcceptanceTypes.d.ts.map +1 -0
- package/dist/runtime/wakeAcceptanceTypes.js +95 -0
- package/dist/runtime/wakeFuse.d.ts +69 -0
- package/dist/runtime/wakeFuse.d.ts.map +1 -0
- package/dist/runtime/wakeFuse.js +367 -0
- package/package.json +25 -17
- package/dist/examples/mixed-engine-org.d.ts +0 -2
- package/dist/examples/mixed-engine-org.d.ts.map +0 -1
- package/dist/examples/mixed-engine-org.js +0 -351
- package/dist/examples/mixedEngineCli.d.ts +0 -15
- package/dist/examples/mixedEngineCli.d.ts.map +0 -1
- package/dist/examples/mixedEngineCli.js +0 -174
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeContractManifest.d.ts","sourceRoot":"","sources":["../../src/contracts/runtimeContractManifest.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iCAAiC,EAAG,8CAAuD,CAAC;AACzG,eAAO,MAAM,wCAAwC,EAAG,kDAA2D,CAAC;AACpH,eAAO,MAAM,0BAA0B;;;;;;;;CAE7B,CAAC;AACX,eAAO,MAAM,uBAAuB;;;;;;;;CAQ1B,CAAC;AACX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHrB,CAAC;AACX,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AASX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC5B,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { WORK_AVAILABILITY_SCHEMA, WORK_BLOCKED_SCHEMA } from "./attentionContract.js";
|
|
2
|
+
import { GROK_BROKER_MODELS, GROK_BROKER_REASONING_EFFORTS, GROK_WORKER_MAX_TURNS, GROK_WORKER_TOOL_IDS, GROK_WORKER_VISIBLE_TOOLS } from "./grokWorkerContract.js";
|
|
3
|
+
import { ORGANIZATION_RUNTIME_CONFIG_SCHEMA, ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA, ORGANIZATION_RUNTIME_MAX_AGENTS, ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS } from "./organizationRuntimeContract.js";
|
|
4
|
+
export const RUNTIME_CONTRACT_MANIFEST_VERSION = "noopolis.daimon.runtime-contract-manifest.v3";
|
|
5
|
+
export const ORGANIZATION_RUNTIME_ACTIVITY_V2_VERSION = "noopolis.daimon.organization-runtime-activity.v2";
|
|
6
|
+
export const ENGINE_CREDENTIAL_MATERIAL = {
|
|
7
|
+
codex: { sourceSlot: "codex-auth", sourceRelativePath: ".daimon-inbound/codex-auth", destinationRelativePath: ".codex/auth.json", directoryMode: 0o700, fileMode: 0o600 }
|
|
8
|
+
};
|
|
9
|
+
export const GROK_SUBSCRIPTION_REALM = {
|
|
10
|
+
agentCredentialRelativePath: ".grok/auth.json",
|
|
11
|
+
bootstrapMountPath: "/var/lib/spawnfile/daimon/grok-bootstrap-auth",
|
|
12
|
+
bootstrapSourceSlot: "grok-auth",
|
|
13
|
+
directoryMode: 0o700,
|
|
14
|
+
durableMountPath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
|
|
15
|
+
fileMode: 0o600,
|
|
16
|
+
maxCredentialBytes: 64 * 1024
|
|
17
|
+
};
|
|
18
|
+
export const GROK_ENGINE_BROKER = {
|
|
19
|
+
nativeAbiVersion: 2,
|
|
20
|
+
nativeExecutablePath: "/opt/daimon/bin/daimon-engine-broker",
|
|
21
|
+
grokExecutablePath: "/usr/local/bin/grok",
|
|
22
|
+
registrationPath: "/etc/daimon-engine-broker/registrations.bin",
|
|
23
|
+
credentialHomePath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
|
|
24
|
+
turnStorePath: "/var/lib/spawnfile/daimon/grok-subscription-realm/turns",
|
|
25
|
+
controlSocketPath: "/run/daimon-engine-broker/control.sock",
|
|
26
|
+
backendSocketPath: "/run/daimon-engine-broker/backend.sock",
|
|
27
|
+
launcherSocketPath: "/run/daimon-engine-broker/launcher.sock",
|
|
28
|
+
serviceConfigPath: "/etc/daimon-engine-broker/service.json",
|
|
29
|
+
providerProxy: { host: "127.0.0.1", port: 43_123 },
|
|
30
|
+
mcpFacade: { host: "127.0.0.1", port: 43_124, path: "/mcp" },
|
|
31
|
+
identities: { organizationUid: 2_000, brokerUid: 2_100, firstWorkerUid: 2_200 },
|
|
32
|
+
grokCliVersion: "1.0.34",
|
|
33
|
+
grokCliBuild: "3736acbc8658",
|
|
34
|
+
grokCliArtifacts: {
|
|
35
|
+
arm64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-aarch64", sha256: "39ab87666877d64ef3a40aa60fbe0c3b6a6acd7001b78fe60e2c76bb6cfc4a94", bytes: 136_090_504 },
|
|
36
|
+
x64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-x86_64", sha256: "be5905e107d2b8b5f3c142d21ecfe4c8fd32a913d2fd551b788707930c4dc80d", bytes: 163_035_648 }
|
|
37
|
+
},
|
|
38
|
+
worker: {
|
|
39
|
+
modelId: "daimon-broker-grok",
|
|
40
|
+
models: GROK_BROKER_MODELS,
|
|
41
|
+
reasoningEfforts: GROK_BROKER_REASONING_EFFORTS,
|
|
42
|
+
defaultModel: "grok-4.6",
|
|
43
|
+
defaultReasoningEffort: "low",
|
|
44
|
+
toolIds: GROK_WORKER_TOOL_IDS,
|
|
45
|
+
visibleTools: GROK_WORKER_VISIBLE_TOOLS,
|
|
46
|
+
maxTurns: GROK_WORKER_MAX_TURNS,
|
|
47
|
+
systemPromptSha256: "2c31c0085a54a4efbf9c0cf0b8124c56e47f38691b7f0c7fa233a74abaa8ddf8",
|
|
48
|
+
// sha256 of `renderGrokBrokerWorkerConfig({ model, reasoningEffort })`, the only accepted config.toml bytes.
|
|
49
|
+
configSha256: {
|
|
50
|
+
"grok-4.6": { low: "ab58499ac32678097c146479896f2b8a8e2b0e39aea22dc0a60b6227e370538e", medium: "df1a5cc84346e7f6bf6090492fbd19faaefb42953e3bb2e8c6cbc0572242403f", high: "65b0212564fb74042b1503d293fb8d3620276033264c0efade2a539ca09218e3" },
|
|
51
|
+
"grok-4.5": { low: "8247127c3625ff7c5d8d527a53596b89ec6557a821ac46cfd00bd122b90daff6", medium: "59288cee61297bb8c002097061a48f77b09d310754187a253ee089f7172a9155", high: "c63c3387ce92d94ec3f690abfe98942afcd7c9e17ff84816bbe751f340ab251f" },
|
|
52
|
+
"grok-build": { low: "fb343f2809903f26d21681470943235031f946e99085542fd89555eb7782cbb5", medium: "8a587ef75c90eab70d19b24583e60051d6fba9d90c558839fdbb15588b4cc656", high: "a23724e00d670caee185ba7690d2daa868173e53905cf446f5329666f01ab4e3" }
|
|
53
|
+
},
|
|
54
|
+
// Worker `GROK_HOME` layout the broker attests before every turn. The home and
|
|
55
|
+
// its `sessions/` directory are root-owned, worker-group writable and sticky so
|
|
56
|
+
// Grok can create its own state but never replace a root-owned file.
|
|
57
|
+
home: {
|
|
58
|
+
directory: { uid: 0, group: "worker", mode: 0o1771 },
|
|
59
|
+
sessionsDirectory: { relativePath: "sessions", uid: 0, group: "worker", mode: 0o1771 },
|
|
60
|
+
readOnlyFiles: { names: ["config.toml", "managed_config.toml", "requirements.toml", "sandbox.toml", "trusted_folders.toml"], uid: 0, gid: 0, mode: 0o444 },
|
|
61
|
+
sandboxEvents: { relativePath: "sessions/sandbox-events.jsonl", owner: "worker", group: "broker", mode: 0o640 },
|
|
62
|
+
// The launcher exports TMPDIR=<worker home>/tmp; Grok's strict profile grants TMPDIR read-write.
|
|
63
|
+
privateTmp: { relativeToWorkerHome: "tmp", owner: "worker", mode: 0o700 },
|
|
64
|
+
// Strict also grants shared /tmp and /var/tmp read-write and refuses to start if either is
|
|
65
|
+
// denied, so the deployment keeps them from every worker by mode: root-owned, a non-worker
|
|
66
|
+
// group (< 2200), others read-only (Grok needs to open the directory) and no search/write.
|
|
67
|
+
sharedTmp: { paths: ["/tmp", "/var/tmp"], uid: 0, maxGroupExclusive: 2_200, otherMode: 0o4, mode: 0o1774 },
|
|
68
|
+
// The organization runtime home of a brokered Grok agent: traverse-only for the
|
|
69
|
+
// worker group so the worker can reach `tool-output/` and nothing else (no group
|
|
70
|
+
// read, no group write, no world bits; `physicalReadiness.ts` refuses anything else).
|
|
71
|
+
organizationRuntimeHome: { owner: "organization", group: "worker", mode: 0o710 },
|
|
72
|
+
// Spilled tool output the worker reads with read_file: setgid directory in the worker's group,
|
|
73
|
+
// files written 0640 by the runtime, never other-readable.
|
|
74
|
+
spillDirectory: { relativeToRuntimeHome: "tool-output", owner: "organization", group: "worker", mode: 0o2750, fileMode: 0o640 }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
bounds: { promptBytes: 65_536, capabilityBytes: 4_096, capabilityBundleBytes: 8_196, outputBytes: 262_144 },
|
|
78
|
+
// Accounting and limits (P2). The broker is the single sealed usage writer.
|
|
79
|
+
controlProtocolVersion: "noopolis.daimon.engine-broker.v2",
|
|
80
|
+
turnRecordVersions: ["noopolis.daimon.engine-broker-turn.v1", "noopolis.daimon.engine-broker-turn.v2"],
|
|
81
|
+
serviceConfigVersions: ["noopolis.daimon.engine-broker-service.v1", "noopolis.daimon.engine-broker-service.v2"],
|
|
82
|
+
turnLimits: {
|
|
83
|
+
keys: ["maxRequests", "maxTokens", "timeoutMs"],
|
|
84
|
+
v1Defaults: { maxRequests: 32, maxTokens: 300_000, timeoutMs: 240_000 },
|
|
85
|
+
bounds: { maxRequests: [1, GROK_WORKER_MAX_TURNS], maxTokens: [1, 10_000_000], timeoutMs: [1_000, 3_600_000] },
|
|
86
|
+
limitReasons: ["tokens", "requests", "timeout", "none"],
|
|
87
|
+
wakeMayOnlyLower: true,
|
|
88
|
+
tokenCeilingOvershoot: "at-most-one-request",
|
|
89
|
+
maxInFlightRequests: 1,
|
|
90
|
+
// A per-request usage block above this is implausible (beyond the model
|
|
91
|
+
// context window) and treated as invalid rather than added to any total.
|
|
92
|
+
requestUsageMaxTokens: 500_000,
|
|
93
|
+
// A request whose response carries no valid usage is charged this estimate.
|
|
94
|
+
missingUsageEstimate: { inputBytesPerToken: 2, outputTokens: 4_096 }
|
|
95
|
+
},
|
|
96
|
+
wakeLimitEnvironment: { timeoutMs: "DAIMON_ENGINE_WAKE_TIMEOUT_MS", maxTokens: "DAIMON_ENGINE_WAKE_TOKEN_CEILING" },
|
|
97
|
+
// Evaluator inference grants (P2c). Judges and the optimizer (organization uid
|
|
98
|
+
// only, over the control socket) borrow the broker's Grok credential through
|
|
99
|
+
// the provider proxy; they never hold it, and their spend never reaches the
|
|
100
|
+
// subject usage ledger or wake fuse.
|
|
101
|
+
inferenceGrants: {
|
|
102
|
+
requestKinds: ["request_inference_grant", "release_inference_grant"],
|
|
103
|
+
purposes: ["judge", "optimizer"],
|
|
104
|
+
tokenPrefix: "inference_",
|
|
105
|
+
ttlMs: 600_000,
|
|
106
|
+
limits: { maxRequests: 64, maxTokens: 2_000_000 },
|
|
107
|
+
maxLiveGrants: 8,
|
|
108
|
+
maxInFlightRequestsPerGrant: 1,
|
|
109
|
+
// Top-level request members Grok 1.0.34 sends for a Paideia judge/optimizer call
|
|
110
|
+
// (live stub capture); `tools` and `tool_choice` are refused outright.
|
|
111
|
+
bodyMembers: ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"],
|
|
112
|
+
messageRoles: ["system", "user", "assistant"],
|
|
113
|
+
failureCodes: ["auth_stale", "grant_limit", "invalid_request", "unavailable"],
|
|
114
|
+
ledgerVersion: "noopolis.daimon.inference-usage.v1",
|
|
115
|
+
ledgerDedupeKey: ["grant", "request"],
|
|
116
|
+
client: {
|
|
117
|
+
modelId: "daimon-inference-grok",
|
|
118
|
+
envKey: "DAIMON_INFERENCE_GRANT",
|
|
119
|
+
// sha256 of `renderGrokInferenceClientConfig` for the production proxy base URL and this env key.
|
|
120
|
+
configSha256: {
|
|
121
|
+
"grok-4.6": { low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f", medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8", high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac" },
|
|
122
|
+
"grok-4.5": { low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74", medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9", high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2" },
|
|
123
|
+
"grok-build": { low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1", medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d", high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c" }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
projectionVersion: "noopolis.daimon.grok-broker-projection.v1",
|
|
128
|
+
slotPreflightVersion: "noopolis.daimon.grok-slot-preflight.v2",
|
|
129
|
+
artifacts: {
|
|
130
|
+
sourceSha256: "dd39aacfece496cc6528f6acdb4f1066a848a0fb5b0961f5c70b0ba00440dc24",
|
|
131
|
+
x64Sha256: "67e3624d3198e9c59e1ffafa4eca7c895dfe265d5b8bb0614cb547b68b8b93a7",
|
|
132
|
+
arm64Sha256: "c07d22225ff968bc289e5ddf0981cdd5d64040eee6e3ea45da7d03e1439dea98"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
export const AGY_SUBSCRIPTION_REALM = {
|
|
136
|
+
durableMountPath: "/var/lib/spawnfile/daimon/agy-subscription-realm",
|
|
137
|
+
unlockMountPath: "/var/lib/spawnfile/daimon/agy-unlock-secret",
|
|
138
|
+
unlockSourceSlot: "agy-unlock-secret",
|
|
139
|
+
directoryMode: 0o700,
|
|
140
|
+
fileMode: 0o600,
|
|
141
|
+
maxUnlockBytes: 4_096
|
|
142
|
+
};
|
|
143
|
+
const text = { type: "string", minLength: 1, maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS, pattern: "\\S" };
|
|
144
|
+
const boundedText = { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS };
|
|
145
|
+
const timestamp = { type: "string", format: "date-time", pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" };
|
|
146
|
+
const wakeEvent = { type: "object", additionalProperties: false, required: ["version", "id", "kind", "text", "occurredAt"], properties: { version: { const: "noopolis.daimon.wake.v1" }, id: text, kind: { enum: ["manual", "message", "schedule", "external"] }, text: boundedText, occurredAt: timestamp } };
|
|
147
|
+
const wakeResultBase = { version: { const: "noopolis.daimon.wake-result.v1" }, agentId: text, wakeId: text };
|
|
148
|
+
const activityItem = { type: "object", additionalProperties: false, required: ["id", "agentId", "kind", "occurredAt"], properties: { id: { type: "string", format: "uuid", pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }, agentId: text, wakeId: text, kind: { enum: ["wake_started", "wake_completed", "wake_rejected", "wake_aborted", "agent_stopped"] }, occurredAt: timestamp } };
|
|
149
|
+
export const RUNTIME_CONTRACT_MANIFEST = {
|
|
150
|
+
version: RUNTIME_CONTRACT_MANIFEST_VERSION,
|
|
151
|
+
consumedConfigFields: ["version", "host.bindHost", "host.port", "host.controlTokenEnv", "agents[].id", "agents[].name", "agents[].instructions", "agents[].workspacePath", "agents[].runtimeHomePath", "agents[].engine.kind", "agents[].engine.model", "agents[].engine.reasoningEffort", "agents[].engine.codexSandbox", "agents[].schedule.kind", "agents[].schedule.interval_ms", "agents[].schedule.cron", "agents[].schedule.timezone", "agents[].schedule.prompt", "agents[].schedule.jitter_seconds", "agents[].mcp", "agents[].moltnet", "agents[].memory", "agents[].attention"],
|
|
152
|
+
organizationRuntimeConfigSchema: ORGANIZATION_RUNTIME_CONFIG_SCHEMA,
|
|
153
|
+
organizationRuntimeConfigV2Schema: ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA,
|
|
154
|
+
wakeAcceptanceTypes: ["manual", "message", "schedule", "external"],
|
|
155
|
+
deliverySemantics: {
|
|
156
|
+
activeDeliveryIdempotency: "unbounded-until-terminal",
|
|
157
|
+
terminalReceiptHorizon: 2_048,
|
|
158
|
+
recovery: "at-least-once-with-stable-wake-id",
|
|
159
|
+
concurrentSameAgentTurns: false,
|
|
160
|
+
externalEffectsExactlyOnce: false
|
|
161
|
+
},
|
|
162
|
+
attention: { enabledBy: "agents[].attention", defaultMaxBatchMessages: 8, defaultMaxBatchBytes: 12000, idleDispatch: "immediate", busyDispatch: "bounded-pending-message-batch", completion: "explicit-per-delivery", unhandled: "deferred-until-new-input", accounting: "execution-start-reservations" },
|
|
163
|
+
workAvailabilityResponseSchema: WORK_AVAILABILITY_SCHEMA,
|
|
164
|
+
workBlockedSchema: WORK_BLOCKED_SCHEMA,
|
|
165
|
+
supportedEngineKinds: ["agy", "codex", "grok"],
|
|
166
|
+
engineCredentialMaterial: ENGINE_CREDENTIAL_MATERIAL,
|
|
167
|
+
grokSubscriptionRealm: GROK_SUBSCRIPTION_REALM,
|
|
168
|
+
grokEngineBroker: GROK_ENGINE_BROKER,
|
|
169
|
+
agySubscriptionRealm: AGY_SUBSCRIPTION_REALM,
|
|
170
|
+
wakeRequestSchema: { type: "object", additionalProperties: false, required: ["agentId", "event"], properties: { agentId: text, event: wakeEvent } },
|
|
171
|
+
wakeResultSchema: { oneOf: [
|
|
172
|
+
{ type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "text", "durationMs"], properties: { ...wakeResultBase, status: { const: "completed" }, text: boundedText, durationMs: { type: "integer", minimum: 0 } } },
|
|
173
|
+
{ type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "rejected" }, code: { enum: ["unauthorized", "unknown_agent", "queue_full", "durable_inbox_required"] } } },
|
|
174
|
+
{ type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { version: { const: "noopolis.daimon.wake-result.v1" }, status: { const: "rejected" }, agentId: { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS }, wakeId: { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS }, code: { const: "invalid_request" } } },
|
|
175
|
+
{ type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "stopped" }, code: { enum: ["host_stopping", "host_stopped", "queued_wake_stopped", "active_wake_aborted"] } } },
|
|
176
|
+
{ type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "failed" }, code: { const: "engine_failed" } } }
|
|
177
|
+
] },
|
|
178
|
+
healthResponseSchema: { type: "object", additionalProperties: false, required: ["version", "state", "agents"], properties: { version: { const: "noopolis.daimon.organization-runtime-health.v1" }, state: { enum: ["starting", "running", "stopping", "stopped"] }, agents: { type: "array", maxItems: ORGANIZATION_RUNTIME_MAX_AGENTS, items: { type: "object", additionalProperties: false, required: ["agentId", "state"], properties: { agentId: text, state: { enum: ["starting", "running", "stopping", "stopped", "idle", "failed"] } } } } } },
|
|
179
|
+
activityResponseSchema: { type: "object", additionalProperties: false, required: ["version", "items"], properties: { version: { const: "noopolis.daimon.organization-runtime-activity.v1" }, items: { type: "array", maxItems: 100, items: activityItem }, nextCursor: { type: "string", minLength: 1, maxLength: 16, pattern: "^(0|[1-9][0-9]{0,15})$" } } },
|
|
180
|
+
activityV2ResponseSchema: { type: "object", additionalProperties: false, required: ["version", "items"], properties: { version: { const: ORGANIZATION_RUNTIME_ACTIVITY_V2_VERSION }, state: { enum: ["running", "stopped"] }, executions: { type: "array", maxItems: ORGANIZATION_RUNTIME_MAX_AGENTS, items: { type: "object", additionalProperties: false, required: ["agent_id", "execution_id", "state", "delivery_ids"], properties: { agent_id: text, execution_id: { type: "string" }, state: { const: "running" }, delivery_ids: { type: "array", maxItems: 32, items: text } } } }, items: { type: "array", maxItems: 2_112, items: { type: "object", additionalProperties: false, required: ["version", "acceptance_id", "agent_id", "delivery_id", "request_digest", "state", "accepted_at", "updated_at", "active"], properties: { version: { const: "noopolis.daimon.wake-receipt-status.v2" }, acceptance_id: { type: "string" }, agent_id: text, delivery_id: text, request_digest: { type: "string" }, state: { enum: ["accepted", "running", "completed", "failed", "stopped"] }, accepted_at: timestamp, updated_at: timestamp, active: { type: "boolean" }, execution_id: { type: "string" }, deferred: { type: "boolean" }, text: { type: "string", maxLength: 16384 }, queue_position: { type: "integer", minimum: 1 }, code: { enum: ["engine_failed", "host_stopped", "host_stopping", "queued_wake_stopped", "active_wake_aborted", "queue_full", "unknown_agent"] } } } } } }
|
|
181
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Redacts provider credentials before text crosses any reply or diagnostic boundary. */
|
|
2
|
+
export declare function redactCredentialText(value: unknown, exactSecrets?: readonly string[], maxBytes?: number): string;
|
|
3
|
+
export declare function redactCredentialError(error: unknown, exactSecrets?: readonly string[], maxBytes?: number): Error;
|
|
4
|
+
//# sourceMappingURL=credentialRedaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialRedaction.d.ts","sourceRoot":"","sources":["../../src/core/credentialRedaction.ts"],"names":[],"mappings":"AASA,yFAAyF;AACzF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,EACpC,QAAQ,GAAE,MAA0B,GACnC,MAAM,CAoBR;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,EACpC,QAAQ,GAAE,MAA0B,GACnC,KAAK,CAEP"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const DEFAULT_MAX_BYTES = 16_384;
|
|
2
|
+
const truncateUtf8 = (value, maxBytes) => {
|
|
3
|
+
if (Buffer.byteLength(value, "utf8") <= maxBytes)
|
|
4
|
+
return value;
|
|
5
|
+
let result = Buffer.from(value, "utf8").subarray(0, maxBytes).toString("utf8");
|
|
6
|
+
while (result.endsWith("\uFFFD"))
|
|
7
|
+
result = result.slice(0, -1);
|
|
8
|
+
return result;
|
|
9
|
+
};
|
|
10
|
+
/** Redacts provider credentials before text crosses any reply or diagnostic boundary. */
|
|
11
|
+
export function redactCredentialText(value, exactSecrets = [], maxBytes = DEFAULT_MAX_BYTES) {
|
|
12
|
+
let result = String(value);
|
|
13
|
+
for (const secret of [...new Set(exactSecrets.filter((entry) => entry.length > 0))]
|
|
14
|
+
.sort((left, right) => right.length - left.length)) {
|
|
15
|
+
result = result.split(secret).join("[REDACTED]");
|
|
16
|
+
}
|
|
17
|
+
result = result
|
|
18
|
+
.replace(/\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/giu, "Bearer [REDACTED]")
|
|
19
|
+
.replace(/\bmagt_v1_[A-Za-z0-9_-]{16,}\b/gu, "[REDACTED]")
|
|
20
|
+
.replace(/\b(?:sk|sk-proj|xai)-[A-Za-z0-9_-]{20,}\b/gu, "[REDACTED]")
|
|
21
|
+
.replace(/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/gu, "[REDACTED]")
|
|
22
|
+
.replace(/("(?:api[_-]?key|authorization|client[_-]?secret|credential|key|password|secret|(?:access|refresh|id)[_-]?token|token)"\s*:\s*")([^"\\]*(?:\\.[^"\\]*)*)(")/giu, "$1[REDACTED]$3")
|
|
23
|
+
.replace(/\b(api[_-]?key|authorization|client[_-]?secret|credential|password|secret|(?:access|refresh|id)[_-]?token|token)\b(\s*[:=]\s*)(["']?)[^\s"',&]{8,}\3/giu, "$1$2[REDACTED]");
|
|
24
|
+
return truncateUtf8(result, maxBytes);
|
|
25
|
+
}
|
|
26
|
+
export function redactCredentialError(error, exactSecrets = [], maxBytes = DEFAULT_MAX_BYTES) {
|
|
27
|
+
return new Error(redactCredentialText(error instanceof Error ? error.message : error, exactSecrets, maxBytes));
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type SiblingFileFact = {
|
|
2
|
+
path: string;
|
|
3
|
+
mtimeMs: number;
|
|
4
|
+
};
|
|
5
|
+
export type SiblingBuildFacts = {
|
|
6
|
+
packageName: string;
|
|
7
|
+
packageDirectory: string;
|
|
8
|
+
hasSourceDirectory: boolean;
|
|
9
|
+
sourceFiles: SiblingFileFact[];
|
|
10
|
+
outputFiles: SiblingFileFact[];
|
|
11
|
+
};
|
|
12
|
+
export type SiblingBuildFreshness = {
|
|
13
|
+
packageName: string;
|
|
14
|
+
linked: boolean;
|
|
15
|
+
sourcesScanned: number;
|
|
16
|
+
outputsScanned: number;
|
|
17
|
+
ok: boolean;
|
|
18
|
+
message?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function checkSiblingBuildFreshness(facts: SiblingBuildFacts): SiblingBuildFreshness;
|
|
21
|
+
//# sourceMappingURL=siblingBuildFreshness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siblingBuildFreshness.d.ts","sourceRoot":"","sources":["../../src/core/siblingBuildFreshness.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,CA2B1F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const excludedSource = /(?:\.test\.ts|\.test-helper\.ts|\.d\.ts)$/u;
|
|
2
|
+
export function checkSiblingBuildFreshness(facts) {
|
|
3
|
+
if (!facts.hasSourceDirectory) {
|
|
4
|
+
return { packageName: facts.packageName, linked: false, sourcesScanned: 0, outputsScanned: 0, ok: true };
|
|
5
|
+
}
|
|
6
|
+
const sourceFiles = facts.sourceFiles.filter(({ path }) => !excludedSource.test(path));
|
|
7
|
+
const outputFiles = facts.outputFiles.filter(({ path }) => path.endsWith(".js"));
|
|
8
|
+
const command = `run "npm run build" in ${facts.packageDirectory}`;
|
|
9
|
+
if (sourceFiles.length === 0) {
|
|
10
|
+
return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} scanned zero source files; ${command}`);
|
|
11
|
+
}
|
|
12
|
+
if (outputFiles.length === 0) {
|
|
13
|
+
return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} has no emitted JavaScript; ${command}`);
|
|
14
|
+
}
|
|
15
|
+
const newestSource = sourceFiles.reduce((newest, file) => file.mtimeMs > newest.mtimeMs ? file : newest);
|
|
16
|
+
const oldestOutput = outputFiles.reduce((oldest, file) => file.mtimeMs < oldest.mtimeMs ? file : oldest);
|
|
17
|
+
if (newestSource.mtimeMs > oldestOutput.mtimeMs) {
|
|
18
|
+
return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} is stale: newest source ${newestSource.path} (${newestSource.mtimeMs}) `
|
|
19
|
+
+ `is newer than oldest output ${oldestOutput.path} (${oldestOutput.mtimeMs}); ${command}`);
|
|
20
|
+
}
|
|
21
|
+
return { packageName: facts.packageName, linked: true, sourcesScanned: sourceFiles.length, outputsScanned: outputFiles.length, ok: true };
|
|
22
|
+
}
|
|
23
|
+
function failure(packageName, sourcesScanned, outputsScanned, message) {
|
|
24
|
+
return { packageName, linked: true, sourcesScanned, outputsScanned, ok: false, message };
|
|
25
|
+
}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -20,9 +20,15 @@ export interface HarnessModelSpec {
|
|
|
20
20
|
name: string;
|
|
21
21
|
provider: string;
|
|
22
22
|
}
|
|
23
|
+
export interface WakeDeliveryMetadata {
|
|
24
|
+
eventId: string;
|
|
25
|
+
sender: string;
|
|
26
|
+
target: string;
|
|
27
|
+
contextId: string;
|
|
28
|
+
}
|
|
23
29
|
export interface WakeEvent {
|
|
24
30
|
id: string;
|
|
25
|
-
kind: "manual" | "message" | "schedule";
|
|
31
|
+
kind: "manual" | "message" | "schedule" | "dream";
|
|
26
32
|
from?: string;
|
|
27
33
|
text: string;
|
|
28
34
|
context?: {
|
|
@@ -35,6 +41,9 @@ export interface WakeEvent {
|
|
|
35
41
|
pairPeers?: string[];
|
|
36
42
|
artifactPaths?: string[];
|
|
37
43
|
};
|
|
44
|
+
delivery?: WakeDeliveryMetadata;
|
|
45
|
+
/** Exact transport body retained outside the runtime-enriched model prompt. */
|
|
46
|
+
transportText?: string;
|
|
38
47
|
}
|
|
39
48
|
export interface WakeResult {
|
|
40
49
|
agentId: AgentId;
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,WAAW,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;KACtD,CAAC;IACF,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,WAAW,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;KACtD,CAAC;IACF,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,IAAI,WAAW,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exampleCausalId.d.ts","sourceRoot":"","sources":["../../src/examples/exampleCausalId.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,KAAG,MAKjD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const LOCAL_CAUSAL_ID = /^[a-z0-9][a-z0-9._-]{0,255}$/u;
|
|
2
|
+
/** Namespaces caller-authored example wakes for the shared causal contract. */
|
|
3
|
+
export const exampleCausalId = (localId) => {
|
|
4
|
+
if (!LOCAL_CAUSAL_ID.test(localId)) {
|
|
5
|
+
throw new Error("Daimon example causal id must be a bounded local id");
|
|
6
|
+
}
|
|
7
|
+
return `daimon:${localId}`;
|
|
8
|
+
};
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { JsonlMemoryStore } from "@noopolis/mneme";
|
|
5
5
|
import { OrgObserver } from "../observability/index.js";
|
|
6
6
|
import { beatsFor, defaultDialogueTurns, selectVoicesForBeat } from "./jungianConversationPlan.js";
|
|
7
|
+
import { exampleCausalId } from "./exampleCausalId.js";
|
|
7
8
|
import { JungianVoice, runLimited } from "./jungianPlayAgent.js";
|
|
8
9
|
import { jungianSelves, playScenario } from "./jungianProfiles.js";
|
|
9
10
|
import { JungianTrace, parseInnerUsed, parseSpeakLine } from "./jungianTrace.js";
|
|
@@ -132,7 +133,7 @@ const runCouncil = async (self, eventId, focus, transcript, voices) => {
|
|
|
132
133
|
console.log(`\n== ${self.profile.name} inner council: ${focus} ==`);
|
|
133
134
|
const turns = await runLimited(voices, councilConcurrency, async (voice) => {
|
|
134
135
|
const event = {
|
|
135
|
-
id: `${eventId}-${voice.config.id}
|
|
136
|
+
id: exampleCausalId(`${eventId}-${voice.config.id}`),
|
|
136
137
|
kind: "manual",
|
|
137
138
|
context: roomContext,
|
|
138
139
|
text: councilPrompt(self.profile, focus, transcript)
|
|
@@ -155,7 +156,7 @@ const runCouncil = async (self, eventId, focus, transcript, voices) => {
|
|
|
155
156
|
};
|
|
156
157
|
const runRepresentative = async (self, eventId, focus, transcript, counsel) => {
|
|
157
158
|
const event = {
|
|
158
|
-
id: eventId,
|
|
159
|
+
id: exampleCausalId(eventId),
|
|
159
160
|
kind: "manual",
|
|
160
161
|
context: roomContext,
|
|
161
162
|
text: representativePrompt(self.profile, focus, transcript, counsel)
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { JsonlMemoryStore } from "@noopolis/mneme";
|
|
5
5
|
import { OrgObserver } from "../observability/index.js";
|
|
6
6
|
import { PiHarnessAdapter } from "../pi/piHarness.js";
|
|
7
|
+
import { exampleCausalId } from "./exampleCausalId.js";
|
|
7
8
|
import { JungianPiRepresentative, seedPiCodexAuth } from "./jungianPiRepresentative.js";
|
|
8
9
|
import { JungianVoice, runLimited } from "./jungianPlayAgent.js";
|
|
9
10
|
import { JungianTrace, parseInnerUsed, parseSpeakLine } from "./jungianTrace.js";
|
|
@@ -134,7 +135,7 @@ const runCouncil = async (self, eventBase, focus, transcript, voices) => {
|
|
|
134
135
|
console.log(`\n== ${self.profile.name} inner counsel ==`);
|
|
135
136
|
return runLimited(voices, 2, async (voice) => {
|
|
136
137
|
const event = {
|
|
137
|
-
id: `${eventBase}-council-${voice.config.id}
|
|
138
|
+
id: exampleCausalId(`${eventBase}-council-${voice.config.id}`),
|
|
138
139
|
kind: "manual",
|
|
139
140
|
context: roomContext,
|
|
140
141
|
text: councilPrompt(self.profile, focus, transcript)
|
|
@@ -171,7 +172,7 @@ const assertUsedCounsel = (self, eventId, output, counsel) => {
|
|
|
171
172
|
};
|
|
172
173
|
const runRepresentative = async (self, eventBase, focus, transcript, counsel) => {
|
|
173
174
|
const event = {
|
|
174
|
-
id: `${eventBase}-speaks
|
|
175
|
+
id: exampleCausalId(`${eventBase}-speaks`),
|
|
175
176
|
kind: "manual",
|
|
176
177
|
context: roomContext,
|
|
177
178
|
text: representativePrompt(self.profile, focus, transcript, counsel)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WakeEvent } from "../core/types.js";
|
|
2
2
|
import type { MemoryRecallAudit } from "@noopolis/mneme";
|
|
3
|
-
import { type EngineKind, type EngineRunResult } from "
|
|
3
|
+
import { type CliEngineKind as EngineKind, type EngineRunResult } from "../pi/cliSession.js";
|
|
4
4
|
export interface JungianVoiceConfig {
|
|
5
5
|
archetype?: string;
|
|
6
6
|
engine: EngineKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jungianPlayAgent.d.ts","sourceRoot":"","sources":["../../src/examples/jungianPlayAgent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"jungianPlayAgent.d.ts","sourceRoot":"","sources":["../../src/examples/jungianPlayAgent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAqB,KAAK,aAAa,IAAI,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEhH,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,eAAe,CAAC;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAUD,qBAAa,YAAY;IAKX,QAAQ,CAAC,MAAM,EAAE,kBAAkB;IAJ/C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,kBAAkB;IAWzC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC;CA4DxD;AAED,eAAO,MAAM,UAAU,GAAU,CAAC,EAAE,CAAC,EACnC,QAAQ,SAAS,CAAC,EAAE,EACpB,OAAO,MAAM,EACb,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,EAAE,CAYb,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { createMemoryRuntime } from "@noopolis/mneme";
|
|
4
|
-
import { runEngineDetailed } from "
|
|
4
|
+
import { runEngineDetailed } from "../pi/cliSession.js";
|
|
5
5
|
const maxMemoryChars = 2200;
|
|
6
6
|
const truncate = (text, maxChars) => text.length <= maxChars ? text : `${text.slice(0, maxChars).trim()}\n[truncated]`;
|
|
7
7
|
const memorySections = (turnPrompt) => truncate(turnPrompt, maxMemoryChars);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jungianProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"jungianProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC;AA+JD,eAAO,MAAM,aAAa,EAAE,kBAAkB,EAiC7C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAMxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jungianTriadProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTriadProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"jungianTriadProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTriadProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,IAAI,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAsDD,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAqCzC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAMzB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { seedPiOpenAICodexAuthFromCodex } from "../pi/auth.js";
|
|
5
5
|
import { PiHarnessAdapter } from "../pi/piHarness.js";
|
|
6
|
+
import { exampleCausalId } from "./exampleCausalId.js";
|
|
6
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
8
|
const daimonRoot = path.resolve(__dirname, "../..");
|
|
8
9
|
const runtimeRoot = path.join(daimonRoot, ".runtime", "pi-agent");
|
|
@@ -66,7 +67,7 @@ const run = async () => {
|
|
|
66
67
|
try {
|
|
67
68
|
console.log("started", JSON.stringify([mapper.status(), reviewer.status()], null, 2));
|
|
68
69
|
const mapped = await mapper.wake({
|
|
69
|
-
id: "wake-mapper-1",
|
|
70
|
+
id: exampleCausalId("wake-mapper-1"),
|
|
70
71
|
kind: "manual",
|
|
71
72
|
from: "caller",
|
|
72
73
|
text: [
|
|
@@ -78,7 +79,7 @@ const run = async () => {
|
|
|
78
79
|
});
|
|
79
80
|
console.log("mapper", JSON.stringify(mapped, null, 2));
|
|
80
81
|
const reviewed = await reviewer.wake({
|
|
81
|
-
id: "wake-reviewer-1",
|
|
82
|
+
id: exampleCausalId("wake-reviewer-1"),
|
|
82
83
|
kind: "message",
|
|
83
84
|
from: "mapper",
|
|
84
85
|
text: [
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { JsonlMemoryStore } from "@noopolis/mneme";
|
|
5
5
|
import { seedPiOpenAICodexAuthFromCodex } from "../pi/auth.js";
|
|
6
6
|
import { PiHarnessAdapter } from "../pi/piHarness.js";
|
|
7
|
+
import { exampleCausalId } from "./exampleCausalId.js";
|
|
7
8
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const daimonRoot = path.resolve(__dirname, "../..");
|
|
9
10
|
const runtimeRoot = path.join(daimonRoot, ".runtime", "pi-memory-org");
|
|
@@ -92,7 +93,7 @@ const seedPrivateMemories = async (handles) => {
|
|
|
92
93
|
console.log("\n== Private seed phase ==");
|
|
93
94
|
for (const agent of demoAgents) {
|
|
94
95
|
const result = await handles.get(agent.id)?.wake({
|
|
95
|
-
id: `seed-${agent.id}
|
|
96
|
+
id: exampleCausalId(`seed-${agent.id}`),
|
|
96
97
|
kind: "manual",
|
|
97
98
|
text: [
|
|
98
99
|
"Private memory seed.",
|
|
@@ -107,7 +108,7 @@ const runRoomConversation = async (handles) => {
|
|
|
107
108
|
console.log("\n== Room recall phase ==");
|
|
108
109
|
const transcript = [];
|
|
109
110
|
const atlas = await wake(handles.get("atlas"), {
|
|
110
|
-
id: "room-atlas-1",
|
|
111
|
+
id: exampleCausalId("room-atlas-1"),
|
|
111
112
|
kind: "manual",
|
|
112
113
|
context: roomContext,
|
|
113
114
|
text: [
|
|
@@ -121,7 +122,7 @@ const runRoomConversation = async (handles) => {
|
|
|
121
122
|
assertIncludes("atlas room reply", atlas.text, "ATLAS_BLUE_17");
|
|
122
123
|
transcript.push(`atlas: ${atlas.text}`);
|
|
123
124
|
const oracle = await wake(handles.get("oracle"), {
|
|
124
|
-
id: "room-oracle-1",
|
|
125
|
+
id: exampleCausalId("room-oracle-1"),
|
|
125
126
|
kind: "manual",
|
|
126
127
|
context: roomContext,
|
|
127
128
|
text: [
|
|
@@ -135,7 +136,7 @@ const runRoomConversation = async (handles) => {
|
|
|
135
136
|
assertIncludes("oracle room reply", oracle.text, "ATLAS_BLUE_17");
|
|
136
137
|
transcript.push(`oracle: ${oracle.text}`);
|
|
137
138
|
const keeper = await wake(handles.get("keeper"), {
|
|
138
|
-
id: "room-keeper-1",
|
|
139
|
+
id: exampleCausalId("room-keeper-1"),
|
|
139
140
|
kind: "manual",
|
|
140
141
|
context: roomContext,
|
|
141
142
|
text: [
|
|
@@ -162,7 +163,7 @@ const verifyFreshSessionRecall = async (adapter, previousKeeper) => {
|
|
|
162
163
|
const keeper = await startAgent(adapter, demoAgents.find((agent) => agent.id === "keeper"));
|
|
163
164
|
try {
|
|
164
165
|
const event = {
|
|
165
|
-
id: "room-keeper-2",
|
|
166
|
+
id: exampleCausalId("room-keeper-2"),
|
|
166
167
|
kind: "manual",
|
|
167
168
|
context: roomContext,
|
|
168
169
|
text: [
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
export declare class McpToolTurnLimitError extends Error {
|
|
4
|
+
constructor(maxToolTurns: number);
|
|
5
|
+
}
|
|
6
|
+
export declare class McpWakeDeadlineError extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A non-standard request AGY issues during its MCP handshake.
|
|
11
|
+
*
|
|
12
|
+
* Captured live from `agy --print … --output-format stream-json`, the client
|
|
13
|
+
* sends `initialize`, `notifications/initialized`, **`server/discover`**,
|
|
14
|
+
* `tools/list`, `tools/call`. `server/discover` is not in the MCP
|
|
15
|
+
* specification, and the throwaway probe that proved AGY's headless tool
|
|
16
|
+
* calling answered it with `{}`. Codex and Grok never send it.
|
|
17
|
+
*
|
|
18
|
+
* This server answers it the same way that working probe did, rather than the
|
|
19
|
+
* SDK default of `MethodNotFound`, because a refusal here is the one observable
|
|
20
|
+
* difference between this server and the one AGY is known to work against, and
|
|
21
|
+
* the cost of being wrong is that every AGY agent silently loses every tool.
|
|
22
|
+
* The allowance is exactly this one method: any other unknown method still gets
|
|
23
|
+
* `MethodNotFound`, so a genuine protocol mistake is never hidden.
|
|
24
|
+
*/
|
|
25
|
+
export declare const AGY_SERVER_DISCOVER_METHOD: "server/discover";
|
|
26
|
+
export interface PiToolMcpServerOptions {
|
|
27
|
+
readonly maxToolTurns?: number;
|
|
28
|
+
readonly wakeDeadline?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const createPiToolMcpServer: (tools: ToolDefinition[], options: PiToolMcpServerOptions) => Server;
|
|
31
|
+
//# sourceMappingURL=toolServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolServer.d.ts","sourceRoot":"","sources":["../../src/mcp/toolServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,qBAAa,qBAAsB,SAAQ,KAAK;gBAC3B,YAAY,EAAE,MAAM;CAIxC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,EAAG,iBAA0B,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAyDD,eAAO,MAAM,qBAAqB,GAChC,OAAO,cAAc,EAAE,EACvB,SAAS,sBAAsB,KAC9B,MAgEF,CAAC"}
|