@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,103 @@
|
|
|
1
|
+
import type { createAgentSession } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { WakeMemoryContext, MemoryWakeMode } from "@noopolis/mneme";
|
|
3
|
+
import type { WakeEvent, WakeResult } from "../core/types.js";
|
|
4
|
+
import { type PiRawTrainingCapture, type PiRawTrainingCaptureOptions } from "./rawTrainingCapture.js";
|
|
5
|
+
import { type PiTurnTraceModel, type PiTurnTraceToolEvent } from "./turnTrace.js";
|
|
6
|
+
import type { PiWorldTurnContext } from "./worldNudge.js";
|
|
7
|
+
import { type WakeAcceptanceCapability, type WakeAcceptanceStoreLike } from "./wakeAcceptance.js";
|
|
8
|
+
import { type PiWorldTrajectoryCapture, type PiWorldTrajectoryIdentity } from "./worldTrajectory.js";
|
|
9
|
+
export type PiSession = Awaited<ReturnType<typeof createAgentSession>>["session"];
|
|
10
|
+
export interface PiSessionLike {
|
|
11
|
+
subscribe(listener: Parameters<PiSession["subscribe"]>[0]): () => void;
|
|
12
|
+
prompt(text: string, options?: Parameters<PiSession["prompt"]>[1]): Promise<void>;
|
|
13
|
+
/** Optional per-turn context for isolated CLI child environments. */
|
|
14
|
+
bindWake?(event?: WakeEvent): void;
|
|
15
|
+
/** Kept synchronous for existing Pi session implementations. */
|
|
16
|
+
dispose(): void;
|
|
17
|
+
/** Optional additive hook for sessions that must asynchronously quiesce children. */
|
|
18
|
+
disposeAsync?(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export type PiWakeEnvironmentContextRef = {
|
|
21
|
+
current?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Set to the delivery id of the current wake once `moltnet_send` has been
|
|
24
|
+
* accepted during it. Bookkeeping only: it no longer gates whether the wake
|
|
25
|
+
* completion path publishes terminal text (see `hasSendCapability`), but it
|
|
26
|
+
* still records, per wake, whether this agent actually spoke. Never a
|
|
27
|
+
* boolean: a boolean could survive a stale reset and silently misattribute
|
|
28
|
+
* a later wake.
|
|
29
|
+
*/
|
|
30
|
+
spokeFor?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Set once per agent, at harness construction, to whether a `moltnet_send`
|
|
33
|
+
* tool is mounted for it (`piHarness.ts`, from `productionTools`) — never
|
|
34
|
+
* reset per wake, unlike `current`/`spokeFor`.
|
|
35
|
+
*
|
|
36
|
+
* A turn that fails partway (a tool error the model narrates back as
|
|
37
|
+
* terminal text, e.g. "Blocked: Moltnet auth is not mounted...") still
|
|
38
|
+
* completes structurally and used to publish that narration through the
|
|
39
|
+
* terminal-text fallback even though `moltnet_send` was never actually
|
|
40
|
+
* called — a second, unintended echo into the room. An agent with a
|
|
41
|
+
* mounted send tool has exactly one legitimate publication channel
|
|
42
|
+
* (`moltnet_send`); its terminal text is always a private note to the
|
|
43
|
+
* runtime, whether it spoke, stayed silent, or failed. Only an agent with
|
|
44
|
+
* no send tool at all keeps the documented terminal-text fallback
|
|
45
|
+
* (`moltnet/internal/bridge/daimon/AGENTS.md`).
|
|
46
|
+
*/
|
|
47
|
+
hasSendCapability?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare function disposePiSession(session: PiSessionLike): Promise<void>;
|
|
50
|
+
export type PiSessionCreator = (mode: MemoryWakeMode, sessionDirectory: string) => Promise<PiSessionLike>;
|
|
51
|
+
export type PiNativeSessionCreator = (mode: MemoryWakeMode, sessionDirectory: string) => Promise<PiSession>;
|
|
52
|
+
export interface WakeSessionSelection {
|
|
53
|
+
disposeAfterWake: boolean;
|
|
54
|
+
mode: MemoryWakeMode;
|
|
55
|
+
session: PiSessionLike;
|
|
56
|
+
threadId: string;
|
|
57
|
+
}
|
|
58
|
+
type WakeRunner = (event: WakeEvent, transitionToInvoking?: () => Promise<WakeAcceptanceCapability>) => Promise<WakeResult>;
|
|
59
|
+
export declare class PiWakeDeliveryQueue {
|
|
60
|
+
private readonly agentId;
|
|
61
|
+
private readonly acceptance;
|
|
62
|
+
private queue;
|
|
63
|
+
private readonly inProgress;
|
|
64
|
+
constructor(agentId: string, acceptance: WakeAcceptanceStoreLike);
|
|
65
|
+
wake(event: WakeEvent, run: WakeRunner): Promise<WakeResult>;
|
|
66
|
+
private enqueue;
|
|
67
|
+
private runDelivery;
|
|
68
|
+
}
|
|
69
|
+
export declare const cloneWakeEvent: (event: WakeEvent) => WakeEvent;
|
|
70
|
+
export declare const selectPiSessionForWake: (input: {
|
|
71
|
+
agentId: string;
|
|
72
|
+
createSession: PiSessionCreator;
|
|
73
|
+
event: WakeEvent;
|
|
74
|
+
memoryContext: WakeMemoryContext;
|
|
75
|
+
runtimeHomePath: string;
|
|
76
|
+
session: PiSessionLike;
|
|
77
|
+
}) => Promise<WakeSessionSelection>;
|
|
78
|
+
export declare const subscribeToPiTurnEvents: (input: {
|
|
79
|
+
chunks: string[];
|
|
80
|
+
rawTrainingCapture?: PiRawTrainingCapture;
|
|
81
|
+
session: PiSessionLike;
|
|
82
|
+
tools: PiTurnTraceToolEvent[];
|
|
83
|
+
worldTrajectory?: PiWorldTrajectoryCapture;
|
|
84
|
+
}) => (() => void);
|
|
85
|
+
export declare const persistPiTurnArtifacts: (input: {
|
|
86
|
+
agentId: string;
|
|
87
|
+
completedAt: Date;
|
|
88
|
+
model: PiTurnTraceModel;
|
|
89
|
+
piSessionForRawCapture?: PiSession;
|
|
90
|
+
promptText: string;
|
|
91
|
+
rawTrainingCapture?: PiRawTrainingCapture;
|
|
92
|
+
rawTrainingCaptureOptions?: PiRawTrainingCaptureOptions;
|
|
93
|
+
runtimeHomePath: string;
|
|
94
|
+
startedAt: Date;
|
|
95
|
+
status: "completed" | "failed";
|
|
96
|
+
totalMs: number;
|
|
97
|
+
turnId: string;
|
|
98
|
+
worldContext?: PiWorldTurnContext;
|
|
99
|
+
worldTrajectory?: PiWorldTrajectoryCapture;
|
|
100
|
+
worldTrajectoryIdentity?: PiWorldTrajectoryIdentity;
|
|
101
|
+
}) => Promise<void>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=piAgentWakeSupport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piAgentWakeSupport.d.ts","sourceRoot":"","sources":["../../src/pi/piAgentWakeSupport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,KAAK,w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AAO,MAAM,sBAAsB,GAAU,OAAO;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;IACxB,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,yBAAyB,CAAC,EAAE,2BAA2B,CAAC;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,uBAAuB,CAAC,EAAE,yBAAyB,CAAC;CACrD,KAAG,OAAO,CAAC,IAAI,CAqCf,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { capturePiRawTrainingEvent, persistPiRawTrainingCapture, } from "./rawTrainingCapture.js";
|
|
2
|
+
import { summarizeSessionEvent, } from "./turnTrace.js";
|
|
3
|
+
import { createAwakeThreadId, createDreamSessionDirectory, createDreamSessionKey, createDreamThreadId, } from "./wakeModes.js";
|
|
4
|
+
import { WakeAcceptanceError, } from "./wakeAcceptance.js";
|
|
5
|
+
import { capturePiWorldTrajectoryEvent, persistPiWorldTrajectory, } from "./worldTrajectory.js";
|
|
6
|
+
export async function disposePiSession(session) {
|
|
7
|
+
await Promise.resolve(session.dispose());
|
|
8
|
+
await session.disposeAsync?.();
|
|
9
|
+
}
|
|
10
|
+
export class PiWakeDeliveryQueue {
|
|
11
|
+
agentId;
|
|
12
|
+
acceptance;
|
|
13
|
+
queue = Promise.resolve();
|
|
14
|
+
inProgress = new Map();
|
|
15
|
+
constructor(agentId, acceptance) {
|
|
16
|
+
this.agentId = agentId;
|
|
17
|
+
this.acceptance = acceptance;
|
|
18
|
+
}
|
|
19
|
+
async wake(event, run) {
|
|
20
|
+
const candidate = event.delivery === undefined
|
|
21
|
+
? undefined
|
|
22
|
+
: this.acceptance.candidateFromDelivery(event);
|
|
23
|
+
if (candidate === undefined)
|
|
24
|
+
return this.enqueue(() => run(event));
|
|
25
|
+
const active = this.inProgress.get(candidate.identity);
|
|
26
|
+
if (active !== undefined) {
|
|
27
|
+
if (active.digest !== candidate.digest) {
|
|
28
|
+
throw new WakeAcceptanceError("wake_delivery_conflict");
|
|
29
|
+
}
|
|
30
|
+
return active.promise;
|
|
31
|
+
}
|
|
32
|
+
const queued = this.enqueue(() => this.runDelivery(event, run));
|
|
33
|
+
const promise = queued.finally(() => {
|
|
34
|
+
if (this.inProgress.get(candidate.identity)?.promise === promise) {
|
|
35
|
+
this.inProgress.delete(candidate.identity);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this.inProgress.set(candidate.identity, { digest: candidate.digest, promise });
|
|
39
|
+
return promise;
|
|
40
|
+
}
|
|
41
|
+
enqueue(run) {
|
|
42
|
+
const queued = this.queue.then(run, run);
|
|
43
|
+
this.queue = queued.then(() => undefined, () => undefined);
|
|
44
|
+
return queued;
|
|
45
|
+
}
|
|
46
|
+
async runDelivery(event, run) {
|
|
47
|
+
const admission = await this.acceptance.begin(event);
|
|
48
|
+
if (admission.mode === "replay") {
|
|
49
|
+
return { agentId: this.agentId, text: "", durationMs: 0 };
|
|
50
|
+
}
|
|
51
|
+
let capability = admission.capability;
|
|
52
|
+
try {
|
|
53
|
+
const result = await run(event, async () => {
|
|
54
|
+
capability = await this.acceptance.markInvoking(capability);
|
|
55
|
+
return capability;
|
|
56
|
+
});
|
|
57
|
+
await this.acceptance.markCompleted(capability);
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
await this.acceptance.markIncomplete(capability).catch(() => undefined);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const cloneContext = (context) => ({
|
|
67
|
+
...context,
|
|
68
|
+
...(context?.pairPeers === undefined ? {} : { pairPeers: [...context.pairPeers] }),
|
|
69
|
+
...(context?.artifactPaths === undefined ? {} : { artifactPaths: [...context.artifactPaths] }),
|
|
70
|
+
});
|
|
71
|
+
export const cloneWakeEvent = (event) => ({
|
|
72
|
+
...event,
|
|
73
|
+
...(event.delivery === undefined ? {} : { delivery: { ...event.delivery } }),
|
|
74
|
+
...(event.context === undefined ? {} : { context: cloneContext(event.context) }),
|
|
75
|
+
});
|
|
76
|
+
export const selectPiSessionForWake = async (input) => {
|
|
77
|
+
if (input.event.kind !== "dream") {
|
|
78
|
+
return {
|
|
79
|
+
disposeAfterWake: false,
|
|
80
|
+
mode: "awake",
|
|
81
|
+
session: input.session,
|
|
82
|
+
threadId: createAwakeThreadId(input.memoryContext, input.agentId),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const sessionKey = createDreamSessionKey(input.event);
|
|
86
|
+
return {
|
|
87
|
+
disposeAfterWake: true,
|
|
88
|
+
mode: "dream",
|
|
89
|
+
session: await input.createSession("dream", createDreamSessionDirectory(input.runtimeHomePath, sessionKey)),
|
|
90
|
+
threadId: createDreamThreadId(sessionKey),
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export const subscribeToPiTurnEvents = (input) => {
|
|
94
|
+
const unsubscribe = input.session.subscribe((event) => {
|
|
95
|
+
if (input.rawTrainingCapture !== undefined) {
|
|
96
|
+
capturePiRawTrainingEvent(input.rawTrainingCapture, event);
|
|
97
|
+
}
|
|
98
|
+
if (input.worldTrajectory !== undefined) {
|
|
99
|
+
capturePiWorldTrajectoryEvent(input.worldTrajectory, event);
|
|
100
|
+
}
|
|
101
|
+
const toolEvent = summarizeSessionEvent(event);
|
|
102
|
+
if (toolEvent !== undefined)
|
|
103
|
+
input.tools.push(toolEvent);
|
|
104
|
+
if (event.type !== "turn_end" || !("content" in event.message))
|
|
105
|
+
return;
|
|
106
|
+
const { content } = event.message;
|
|
107
|
+
input.chunks.push(typeof content === "string"
|
|
108
|
+
? content
|
|
109
|
+
: content.filter((entry) => entry.type === "text")
|
|
110
|
+
.map((entry) => entry.text).join(""));
|
|
111
|
+
});
|
|
112
|
+
return unsubscribe;
|
|
113
|
+
};
|
|
114
|
+
export const persistPiTurnArtifacts = async (input) => {
|
|
115
|
+
if (input.rawTrainingCapture !== undefined
|
|
116
|
+
&& input.rawTrainingCaptureOptions !== undefined
|
|
117
|
+
&& input.piSessionForRawCapture !== undefined) {
|
|
118
|
+
await persistPiRawTrainingCapture({
|
|
119
|
+
agentId: input.agentId,
|
|
120
|
+
capture: input.rawTrainingCapture,
|
|
121
|
+
completedAt: input.completedAt,
|
|
122
|
+
options: input.rawTrainingCaptureOptions,
|
|
123
|
+
runtimeHomePath: input.runtimeHomePath,
|
|
124
|
+
session: input.piSessionForRawCapture,
|
|
125
|
+
startedAt: input.startedAt,
|
|
126
|
+
status: input.status,
|
|
127
|
+
totalMs: input.totalMs,
|
|
128
|
+
turnId: input.turnId,
|
|
129
|
+
world: input.worldContext,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
if (input.worldContext !== undefined
|
|
133
|
+
&& input.worldTrajectory !== undefined
|
|
134
|
+
&& input.worldTrajectoryIdentity !== undefined) {
|
|
135
|
+
await persistPiWorldTrajectory({
|
|
136
|
+
agentId: input.agentId,
|
|
137
|
+
capture: input.worldTrajectory,
|
|
138
|
+
completedAt: input.completedAt,
|
|
139
|
+
context: input.worldContext,
|
|
140
|
+
instructions: input.worldTrajectoryIdentity.instructions,
|
|
141
|
+
model: input.model,
|
|
142
|
+
promptText: input.promptText,
|
|
143
|
+
runtimeHomePath: input.runtimeHomePath,
|
|
144
|
+
startedAt: input.startedAt,
|
|
145
|
+
status: input.status,
|
|
146
|
+
thinkingLevel: input.worldTrajectoryIdentity.thinkingLevel,
|
|
147
|
+
totalMs: input.totalMs,
|
|
148
|
+
turnId: input.turnId,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
};
|
package/dist/pi/piHarness.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { createAgentSession } from "@earendil-works/pi-coding-agent";
|
|
1
|
+
import { createAgentSession, type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type MemoryAuthorityConfig } from "@noopolis/mneme";
|
|
2
3
|
import type { AgentHandle, AgentHarnessAdapter, AgentStartInput, HarnessModelSpec } from "../core/types.js";
|
|
3
|
-
|
|
4
|
+
import { type PiSessionLike } from "./piAgentHandle.js";
|
|
5
|
+
import { type PiWakeEnvironmentContextRef } from "./piAgentWakeSupport.js";
|
|
6
|
+
import { type PiWorldBinding } from "./worldTools.js";
|
|
7
|
+
import { type PiRawTrainingCaptureOptions } from "./rawTrainingCapture.js";
|
|
8
|
+
type HarnessMemoryEmbeddingProvider = {
|
|
9
|
+
dimensions?: number;
|
|
10
|
+
embed(text: string): Promise<number[]>;
|
|
11
|
+
};
|
|
12
|
+
export type PiThinkingLevel = NonNullable<NonNullable<Parameters<typeof createAgentSession>[0]>["thinkingLevel"]>;
|
|
13
|
+
type PiHarnessBaseOptions = {
|
|
4
14
|
authPath: string;
|
|
5
|
-
sessionFactory?: PiSessionFactory;
|
|
6
15
|
model?: {
|
|
7
16
|
auth?: HarnessModelSpec["auth"];
|
|
8
17
|
endpoint?: HarnessModelSpec["endpoint"];
|
|
@@ -10,12 +19,37 @@ export interface PiHarnessOptions {
|
|
|
10
19
|
name: string;
|
|
11
20
|
};
|
|
12
21
|
modelsPath?: string;
|
|
22
|
+
/** Host-only names removed from every engine and Pi bash child environment. */
|
|
23
|
+
protectedEnvironmentNames?: readonly string[];
|
|
13
24
|
memory?: {
|
|
25
|
+
authority?: MemoryAuthorityConfig;
|
|
26
|
+
embeddingProvider?: HarnessMemoryEmbeddingProvider;
|
|
14
27
|
source?: string;
|
|
15
28
|
tokenBudget?: number;
|
|
29
|
+
runtimeHomePath?: string;
|
|
16
30
|
};
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
thinkingLevel?: PiThinkingLevel;
|
|
32
|
+
world?: PiWorldBinding;
|
|
33
|
+
productionTools?: readonly ToolDefinition[];
|
|
34
|
+
/** Engine-owned default; an empty list disables Pi builtins for confined CLI engines. */
|
|
35
|
+
toolNames?: readonly string[];
|
|
36
|
+
wakeEnvironmentContext?: PiWakeEnvironmentContextRef;
|
|
37
|
+
};
|
|
38
|
+
export type PiHarnessOptions = PiHarnessBaseOptions & ({
|
|
39
|
+
rawTrainingCapture?: PiRawTrainingCaptureOptions;
|
|
40
|
+
sessionFactory?: never;
|
|
41
|
+
} | {
|
|
42
|
+
rawTrainingCapture?: never;
|
|
43
|
+
sessionFactory: PiSessionFactory;
|
|
44
|
+
});
|
|
45
|
+
export type PiSessionFactoryInput = Exclude<Parameters<typeof createAgentSession>[0], undefined> & {
|
|
46
|
+
daimonSecretEnvironmentNames?: readonly string[];
|
|
47
|
+
/** The isolated runtime home assigned by Daimon to this one agent. */
|
|
48
|
+
runtimeHomePath?: string;
|
|
49
|
+
};
|
|
50
|
+
export type PiSessionFactory = (input: PiSessionFactoryInput) => Promise<{
|
|
51
|
+
session: PiSessionLike;
|
|
52
|
+
}>;
|
|
19
53
|
export declare class PiHarnessAdapter implements AgentHarnessAdapter {
|
|
20
54
|
private readonly options;
|
|
21
55
|
private readonly authStorage;
|
|
@@ -24,4 +58,5 @@ export declare class PiHarnessAdapter implements AgentHarnessAdapter {
|
|
|
24
58
|
constructor(options: PiHarnessOptions);
|
|
25
59
|
startAgent(input: AgentStartInput): Promise<AgentHandle>;
|
|
26
60
|
}
|
|
61
|
+
export {};
|
|
27
62
|
//# sourceMappingURL=piHarness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piHarness.d.ts","sourceRoot":"","sources":["../../src/pi/piHarness.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"pi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