@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,118 @@
|
|
|
1
|
+
const PUBLISHABLE_STOP_REASONS = new Set(["end_turn", "stop_sequence"]);
|
|
2
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
const invalidResult = (detail) => new Error(`Grok CLI returned no publishable terminal response: ${detail}`);
|
|
4
|
+
/**
|
|
5
|
+
* The four disjoint token buckets grok emits on `result.usage`. All four must be
|
|
6
|
+
* present and be non-negative safe integers; a renamed, stringified, negative,
|
|
7
|
+
* or fractional field rejects the whole block rather than silently contributing
|
|
8
|
+
* a zero, because a zero bucket is byte-indistinguishable from a real one.
|
|
9
|
+
*/
|
|
10
|
+
const USAGE_TOKEN_FIELDS = ["input_tokens", "output_tokens", "cache_read_input_tokens", "cache_creation_input_tokens"];
|
|
11
|
+
const tokenCount = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
12
|
+
const nonNegativeAmount = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : 0;
|
|
13
|
+
/**
|
|
14
|
+
* Extract per-turn usage from the terminal `result` frame.
|
|
15
|
+
*
|
|
16
|
+
* Advisory: a malformed or absent usage block yields `undefined` rather than
|
|
17
|
+
* failing a turn that published correctly, and never throws.
|
|
18
|
+
*
|
|
19
|
+
* `complete` is a stated heuristic, not a wire-observable signal. grok's own
|
|
20
|
+
* embedded documentation for this stream says any bucket it cannot account for
|
|
21
|
+
* "falls back to `0`, because the Messages API schema has no marker for
|
|
22
|
+
* incomplete or absent usage", and instructs consumers to "read an all-zero
|
|
23
|
+
* `usage` here as 'unknown', not 'free'". That is exactly the rule below. It
|
|
24
|
+
* cannot catch a *partially* zero-filled turn, which sums to a plausible total
|
|
25
|
+
* and is stamped `complete: true` while under-counting — so every count this
|
|
26
|
+
* decoder produces is a lower bound.
|
|
27
|
+
*/
|
|
28
|
+
const decodeTurnUsage = (result) => {
|
|
29
|
+
if (!isRecord(result.usage))
|
|
30
|
+
return undefined;
|
|
31
|
+
const usage = result.usage;
|
|
32
|
+
const counts = USAGE_TOKEN_FIELDS.map((field) => tokenCount(usage[field]));
|
|
33
|
+
if (counts.some((count) => count === undefined))
|
|
34
|
+
return undefined;
|
|
35
|
+
const [input, output, cacheRead, cacheWrite] = counts;
|
|
36
|
+
const total = input + cacheRead + cacheWrite + output;
|
|
37
|
+
return { input, output, cacheRead, cacheWrite, total, calls: tokenCount(result.num_turns) ?? 0, notionalUsd: nonNegativeAmount(result.total_cost_usd), complete: total > 0 };
|
|
38
|
+
};
|
|
39
|
+
const decodeTerminalAssistant = (event) => {
|
|
40
|
+
if (event.type !== "assistant" || event.parent_tool_use_id !== null)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (typeof event.session_id !== "string" || !isRecord(event.message))
|
|
43
|
+
throw invalidResult("invalid assistant event");
|
|
44
|
+
const message = event.message;
|
|
45
|
+
if (message.role !== "assistant" || typeof message.stop_reason !== "string" || !Array.isArray(message.content)) {
|
|
46
|
+
throw invalidResult("invalid assistant event");
|
|
47
|
+
}
|
|
48
|
+
if (!PUBLISHABLE_STOP_REASONS.has(message.stop_reason))
|
|
49
|
+
return { sessionId: event.session_id, stopReason: message.stop_reason, text: "" };
|
|
50
|
+
let text = "";
|
|
51
|
+
let textBlocks = 0;
|
|
52
|
+
for (const block of message.content) {
|
|
53
|
+
if (!isRecord(block) || typeof block.type !== "string")
|
|
54
|
+
throw invalidResult("invalid assistant content");
|
|
55
|
+
if (block.type === "thinking")
|
|
56
|
+
continue;
|
|
57
|
+
if (block.type !== "text" || typeof block.text !== "string")
|
|
58
|
+
throw invalidResult("invalid terminal content");
|
|
59
|
+
text += block.text;
|
|
60
|
+
textBlocks += 1;
|
|
61
|
+
}
|
|
62
|
+
if (textBlocks === 0 || text.trim().length === 0)
|
|
63
|
+
throw invalidResult("empty response");
|
|
64
|
+
return { sessionId: event.session_id, stopReason: message.stop_reason, text };
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Decode Grok's terminal message stream without treating progress messages as a
|
|
68
|
+
* reply, and extract the turn's own token accounting from the same frame.
|
|
69
|
+
*/
|
|
70
|
+
export const decodeGrokHeadlessTurn = (output) => {
|
|
71
|
+
const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
|
|
72
|
+
if (lines.length === 0)
|
|
73
|
+
throw invalidResult("empty stream");
|
|
74
|
+
let finalAssistant;
|
|
75
|
+
let result;
|
|
76
|
+
for (const [index, line] of lines.entries()) {
|
|
77
|
+
let event;
|
|
78
|
+
try {
|
|
79
|
+
event = JSON.parse(line);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw invalidResult("invalid JSON");
|
|
83
|
+
}
|
|
84
|
+
if (!isRecord(event) || typeof event.type !== "string")
|
|
85
|
+
throw invalidResult("invalid event");
|
|
86
|
+
if (event.type === "error") {
|
|
87
|
+
const rejection = asGrokAuthenticationRejected(JSON.stringify(event));
|
|
88
|
+
if (rejection !== undefined)
|
|
89
|
+
throw rejection;
|
|
90
|
+
throw invalidResult("engine error");
|
|
91
|
+
}
|
|
92
|
+
const assistant = decodeTerminalAssistant(event);
|
|
93
|
+
if (assistant !== undefined)
|
|
94
|
+
finalAssistant = assistant;
|
|
95
|
+
if (event.type === "result") {
|
|
96
|
+
if (index !== lines.length - 1)
|
|
97
|
+
throw invalidResult("non-terminal result");
|
|
98
|
+
result = event;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (result === undefined || result.subtype !== "success" || result.is_error !== false)
|
|
102
|
+
throw invalidResult("unsuccessful result");
|
|
103
|
+
if (typeof result.stop_reason !== "string" || !PUBLISHABLE_STOP_REASONS.has(result.stop_reason))
|
|
104
|
+
throw invalidResult("non-terminal stop");
|
|
105
|
+
if ("errors" in result && (!Array.isArray(result.errors) || result.errors.length > 0))
|
|
106
|
+
throw invalidResult("engine error");
|
|
107
|
+
if (typeof result.result !== "string" || result.result.trim().length === 0)
|
|
108
|
+
throw invalidResult("empty response");
|
|
109
|
+
if (finalAssistant === undefined || finalAssistant.stopReason !== result.stop_reason ||
|
|
110
|
+
finalAssistant.sessionId !== result.session_id || finalAssistant.text !== result.result) {
|
|
111
|
+
throw invalidResult("terminal result mismatch");
|
|
112
|
+
}
|
|
113
|
+
const usage = decodeTurnUsage(result);
|
|
114
|
+
return usage === undefined ? { text: result.result.trim() } : { text: result.result.trim(), usage };
|
|
115
|
+
};
|
|
116
|
+
/** Text-only view of {@link decodeGrokHeadlessTurn}, for callers that do not meter. */
|
|
117
|
+
export const decodeGrokHeadlessResult = (output) => decodeGrokHeadlessTurn(output).text;
|
|
118
|
+
import { asGrokAuthenticationRejected } from "../runtime/grokAuthenticationError.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CliMcpRegistration } from "./cliMcpRegistration.js";
|
|
2
|
+
/**
|
|
3
|
+
* Per-wake MCP registration for the direct (non-broker) Grok CLI path.
|
|
4
|
+
*
|
|
5
|
+
* `grok mcp add --scope project` writes `<cwd>/.grok/config.toml`, which Grok
|
|
6
|
+
* 1.0.34 skips entirely in an untrusted workspace — and Daimon keeps every
|
|
7
|
+
* workspace untrusted so cwd `AGENTS.md` and project skills never load. The
|
|
8
|
+
* endpoint therefore goes into the agent's own Daimon-owned `GROK_HOME`
|
|
9
|
+
* config, rendered from the same lean base the broker worker uses
|
|
10
|
+
* (`renderGrokLeanBaseConfig`), and is removed again after the turn by
|
|
11
|
+
* rewriting the base alone.
|
|
12
|
+
*
|
|
13
|
+
* There is no fallback to the operator's `~/.grok`: without an explicit
|
|
14
|
+
* `engineHomePath` the session refuses, rather than editing a human's config.
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerGrokHomeMcpServer(input: Readonly<{
|
|
17
|
+
engineHomePath: string | undefined;
|
|
18
|
+
endpoint: string;
|
|
19
|
+
verify?: () => Promise<void>;
|
|
20
|
+
}>): Promise<CliMcpRegistration>;
|
|
21
|
+
//# sourceMappingURL=grokHomeMcpRegistration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grokHomeMcpRegistration.d.ts","sourceRoot":"","sources":["../../src/pi/grokHomeMcpRegistration.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC;IAAE,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAepL"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { lstat, mkdir, open, rename, unlink } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { renderGrokLeanBaseConfig } from "../runtime/grokBrokerWorkerConfig.js";
|
|
6
|
+
/**
|
|
7
|
+
* Per-wake MCP registration for the direct (non-broker) Grok CLI path.
|
|
8
|
+
*
|
|
9
|
+
* `grok mcp add --scope project` writes `<cwd>/.grok/config.toml`, which Grok
|
|
10
|
+
* 1.0.34 skips entirely in an untrusted workspace — and Daimon keeps every
|
|
11
|
+
* workspace untrusted so cwd `AGENTS.md` and project skills never load. The
|
|
12
|
+
* endpoint therefore goes into the agent's own Daimon-owned `GROK_HOME`
|
|
13
|
+
* config, rendered from the same lean base the broker worker uses
|
|
14
|
+
* (`renderGrokLeanBaseConfig`), and is removed again after the turn by
|
|
15
|
+
* rewriting the base alone.
|
|
16
|
+
*
|
|
17
|
+
* There is no fallback to the operator's `~/.grok`: without an explicit
|
|
18
|
+
* `engineHomePath` the session refuses, rather than editing a human's config.
|
|
19
|
+
*/
|
|
20
|
+
export async function registerGrokHomeMcpServer(input) {
|
|
21
|
+
const home = input.engineHomePath;
|
|
22
|
+
if (home === undefined || !path.isAbsolute(home)) {
|
|
23
|
+
throw new Error("Grok direct CLI sessions require a Daimon-owned GROK_HOME (engineHomePath): Grok 1.0.34 ignores project-scoped MCP servers in untrusted workspaces");
|
|
24
|
+
}
|
|
25
|
+
if (!/^http:\/\/127\.0\.0\.1:\d{1,5}\/[A-Za-z0-9/_-]*$/u.test(input.endpoint))
|
|
26
|
+
throw new Error("Grok MCP endpoint must be a loopback http URL");
|
|
27
|
+
await input.verify?.();
|
|
28
|
+
await writeConfig(home, `${renderGrokLeanBaseConfig()}[mcp_servers.daimon]\nurl = ${JSON.stringify(input.endpoint)}\n`);
|
|
29
|
+
let closePromise;
|
|
30
|
+
return {
|
|
31
|
+
close: () => closePromise ??= (async () => {
|
|
32
|
+
await input.verify?.();
|
|
33
|
+
await writeConfig(home, renderGrokLeanBaseConfig());
|
|
34
|
+
})()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async function writeConfig(home, text) {
|
|
38
|
+
await mkdir(home, { recursive: true, mode: 0o700 });
|
|
39
|
+
const directory = await lstat(home);
|
|
40
|
+
if (!directory.isDirectory() || directory.isSymbolicLink())
|
|
41
|
+
throw new Error("Grok engine home is not a private directory");
|
|
42
|
+
const target = path.join(home, "config.toml");
|
|
43
|
+
const temporary = path.join(home, `.config.toml.${randomUUID()}.tmp`);
|
|
44
|
+
let handle;
|
|
45
|
+
try {
|
|
46
|
+
handle = await open(temporary, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600);
|
|
47
|
+
await handle.writeFile(text);
|
|
48
|
+
await handle.sync();
|
|
49
|
+
await handle.close();
|
|
50
|
+
handle = undefined;
|
|
51
|
+
await rename(temporary, target);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await handle?.close().catch(() => undefined);
|
|
55
|
+
await unlink(temporary).catch(() => undefined);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const GROK_DAIMON_SANDBOX_PROFILE: "daimon-strict";
|
|
2
|
+
export interface GrokSandboxAuthority {
|
|
3
|
+
readonly command: string;
|
|
4
|
+
readonly commandArgs?: readonly string[];
|
|
5
|
+
readonly cwd: string;
|
|
6
|
+
readonly engineHomePath: string;
|
|
7
|
+
readonly protectedPaths: readonly string[];
|
|
8
|
+
readonly runtimeHomePath: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function prepareAndVerifyGrokSandbox(authority: GrokSandboxAuthority): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=grokSandbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grokSandbox.d.ts","sourceRoot":"","sources":["../../src/pi/grokSandbox.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,2BAA2B,iBAA8B,CAAC;AAOvE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,oBAAoB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAsCf"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { constants } from "node:fs";
|
|
4
|
+
import { lstat, mkdir, open, realpath, rename, unlink } from "node:fs/promises";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { readChild } from "./cliChildOutput.js";
|
|
7
|
+
import { cliChildEnvironment } from "./cliEnvironment.js";
|
|
8
|
+
import { terminateChild, trackCliChild } from "./cliProcess.js";
|
|
9
|
+
import { renderGrokSandboxArgs } from "./cliEngineSpawn.js";
|
|
10
|
+
import { assertGrokWorkerDenyPathsPlaceable } from "../runtime/grokWorkerDenyPlacement.js";
|
|
11
|
+
import { GROK_WORKER_SANDBOX_EVENTS_RELATIVE_PATH, GROK_WORKER_SANDBOX_PROFILE, renderGrokWorkerSandboxProfile } from "../runtime/grokWorkerSandboxProfile.js";
|
|
12
|
+
export const GROK_DAIMON_SANDBOX_PROFILE = GROK_WORKER_SANDBOX_PROFILE;
|
|
13
|
+
const SANDBOX_CONFIG = "sandbox.toml";
|
|
14
|
+
/** Grok 1.0.34 logs sandbox events under `sessions/`; the root file stays empty. */
|
|
15
|
+
const SANDBOX_EVENTS = GROK_WORKER_SANDBOX_EVENTS_RELATIVE_PATH;
|
|
16
|
+
const MAX_EVENTS_BYTES = 16 * 1024 * 1024;
|
|
17
|
+
const ROTATE_EVENTS_BYTES = 8 * 1024 * 1024;
|
|
18
|
+
export async function prepareAndVerifyGrokSandbox(authority) {
|
|
19
|
+
const engineHome = await realpath(authority.engineHomePath);
|
|
20
|
+
const cwd = await realpath(authority.cwd);
|
|
21
|
+
await assertPrivateDirectory(engineHome);
|
|
22
|
+
const denied = [...new Set(await Promise.all(authority.protectedPaths.map((entry) => realpath(entry))))].sort();
|
|
23
|
+
if (denied.some((entry) => overlaps(entry, cwd) || overlaps(entry, engineHome))) {
|
|
24
|
+
throw unavailable();
|
|
25
|
+
}
|
|
26
|
+
// Grok 1.0.34 materializes every deny target inside bubblewrap as the uid it
|
|
27
|
+
// runs Grok under — here, this process's own — and refuses the whole profile
|
|
28
|
+
// if one cannot be resolved. Refusing now names the path; letting it through
|
|
29
|
+
// would kill every turn with a bare `bwrap: Can't create file at …`.
|
|
30
|
+
await assertGrokWorkerDenyPathsPlaceable(denied, { uid: process.getuid?.() ?? 0, gid: process.getgid?.() ?? 0 });
|
|
31
|
+
await writeProfile(engineHome, denied);
|
|
32
|
+
const beforeBytes = await eventFileSize(path.join(engineHome, SANDBOX_EVENTS));
|
|
33
|
+
const child = trackCliChild(spawn(authority.command, [
|
|
34
|
+
...renderGrokSandboxArgs(authority.commandArgs, GROK_DAIMON_SANDBOX_PROFILE),
|
|
35
|
+
"--cwd", cwd,
|
|
36
|
+
"inspect"
|
|
37
|
+
], {
|
|
38
|
+
cwd,
|
|
39
|
+
detached: process.platform !== "win32",
|
|
40
|
+
env: cliChildEnvironment([], authority.runtimeHomePath, {
|
|
41
|
+
engine: "grok",
|
|
42
|
+
engineHomePath: engineHome,
|
|
43
|
+
executablePath: authority.command
|
|
44
|
+
}),
|
|
45
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
46
|
+
}));
|
|
47
|
+
try {
|
|
48
|
+
await readChild(child, 10_000, []);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
throw unavailable();
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await terminateChild(child).catch(() => undefined);
|
|
55
|
+
}
|
|
56
|
+
await verifyEnforcementEvent(path.join(engineHome, SANDBOX_EVENTS), beforeBytes, cwd, denied);
|
|
57
|
+
await verifyProfile(engineHome, denied);
|
|
58
|
+
}
|
|
59
|
+
const profileText = (denied) => renderGrokWorkerSandboxProfile(denied);
|
|
60
|
+
async function writeProfile(engineHome, denied) {
|
|
61
|
+
const target = path.join(engineHome, SANDBOX_CONFIG);
|
|
62
|
+
const temporary = path.join(engineHome, `.${SANDBOX_CONFIG}.${randomUUID()}.tmp`);
|
|
63
|
+
let handle;
|
|
64
|
+
try {
|
|
65
|
+
handle = await open(temporary, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | noFollow(), 0o600);
|
|
66
|
+
await handle.writeFile(profileText(denied));
|
|
67
|
+
await handle.chmod(0o600);
|
|
68
|
+
await handle.sync();
|
|
69
|
+
await handle.close();
|
|
70
|
+
handle = undefined;
|
|
71
|
+
await rename(temporary, target);
|
|
72
|
+
await syncDirectory(engineHome);
|
|
73
|
+
await verifyProfile(engineHome, denied);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
throw unavailable();
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
await handle?.close().catch(() => undefined);
|
|
80
|
+
await unlink(temporary).catch(() => undefined);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function verifyProfile(engineHome, denied) {
|
|
84
|
+
const file = path.join(engineHome, SANDBOX_CONFIG);
|
|
85
|
+
let handle;
|
|
86
|
+
try {
|
|
87
|
+
const before = await lstat(file);
|
|
88
|
+
assertPrivateFile(before, 64 * 1024);
|
|
89
|
+
handle = await open(file, constants.O_RDONLY | noFollow());
|
|
90
|
+
const opened = await handle.stat();
|
|
91
|
+
assertPrivateFile(opened, 64 * 1024);
|
|
92
|
+
if (!sameIdentity(before, opened) || await handle.readFile("utf8") !== profileText(denied))
|
|
93
|
+
throw new Error("changed");
|
|
94
|
+
const after = await handle.stat();
|
|
95
|
+
if (!sameIdentity(opened, after))
|
|
96
|
+
throw new Error("changed");
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
throw unavailable();
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
await handle?.close().catch(() => undefined);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async function verifyEnforcementEvent(file, beforeBytes, cwd, denied) {
|
|
106
|
+
let handle;
|
|
107
|
+
try {
|
|
108
|
+
const before = await lstat(file);
|
|
109
|
+
assertPrivateFile(before, MAX_EVENTS_BYTES);
|
|
110
|
+
if (before.size <= beforeBytes)
|
|
111
|
+
throw new Error("missing event");
|
|
112
|
+
handle = await open(file, constants.O_RDONLY | noFollow());
|
|
113
|
+
const opened = await handle.stat();
|
|
114
|
+
if (!sameIdentity(before, opened))
|
|
115
|
+
throw new Error("changed");
|
|
116
|
+
const bytes = await handle.readFile();
|
|
117
|
+
const after = await handle.stat();
|
|
118
|
+
if (!sameIdentity(opened, after))
|
|
119
|
+
throw new Error("changed");
|
|
120
|
+
const appended = bytes.subarray(beforeBytes).toString("utf8").trim().split("\n").filter(Boolean);
|
|
121
|
+
const event = JSON.parse(appended.at(-1) ?? "null");
|
|
122
|
+
const observedDenied = Array.isArray(event?.deny_paths)
|
|
123
|
+
? event.deny_paths.filter((entry) => typeof entry === "string").sort()
|
|
124
|
+
: [];
|
|
125
|
+
if (event?.event_type !== "ProfileApplied" || event.profile !== GROK_DAIMON_SANDBOX_PROFILE
|
|
126
|
+
|| event.enforced !== true || event.restrict_network !== true || event.workspace !== cwd
|
|
127
|
+
|| !/^(?:linux\/landlock|macos\/seatbelt)$/u.test(String(event.platform ?? ""))
|
|
128
|
+
|| JSON.stringify(observedDenied) !== JSON.stringify(denied))
|
|
129
|
+
throw new Error("not enforced");
|
|
130
|
+
bytes.fill(0);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
throw unavailable();
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
await handle?.close().catch(() => undefined);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function eventFileSize(file) {
|
|
140
|
+
try {
|
|
141
|
+
const entry = await lstat(file);
|
|
142
|
+
assertPrivateFile(entry, MAX_EVENTS_BYTES, true);
|
|
143
|
+
if (entry.size >= ROTATE_EVENTS_BYTES) {
|
|
144
|
+
await replaceWithEmptyPrivateFile(file);
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
147
|
+
return Number(entry.size);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (error.code === "ENOENT") {
|
|
151
|
+
await mkdir(path.dirname(file), { mode: 0o700, recursive: true });
|
|
152
|
+
const handle = await open(file, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | noFollow(), 0o600);
|
|
153
|
+
try {
|
|
154
|
+
await handle.sync();
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
await handle.close();
|
|
158
|
+
}
|
|
159
|
+
await syncDirectory(path.dirname(file));
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
162
|
+
throw unavailable();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function replaceWithEmptyPrivateFile(file) {
|
|
166
|
+
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
167
|
+
let handle;
|
|
168
|
+
try {
|
|
169
|
+
handle = await open(temporary, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | noFollow(), 0o600);
|
|
170
|
+
await handle.sync();
|
|
171
|
+
await handle.close();
|
|
172
|
+
handle = undefined;
|
|
173
|
+
await rename(temporary, file);
|
|
174
|
+
await syncDirectory(path.dirname(file));
|
|
175
|
+
const entry = await lstat(file);
|
|
176
|
+
assertPrivateFile(entry, 0, true);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
throw unavailable();
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
await handle?.close().catch(() => undefined);
|
|
183
|
+
await unlink(temporary).catch(() => undefined);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async function assertPrivateDirectory(directory) {
|
|
187
|
+
try {
|
|
188
|
+
const entry = await lstat(directory);
|
|
189
|
+
if (!entry.isDirectory() || entry.isSymbolicLink() || entry.uid !== process.getuid?.()
|
|
190
|
+
|| (Number(entry.mode) & 0o777) !== 0o700)
|
|
191
|
+
throw new Error("unsafe");
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
throw unavailable();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
async function syncDirectory(directory) {
|
|
198
|
+
const handle = await open(directory, constants.O_RDONLY);
|
|
199
|
+
try {
|
|
200
|
+
await handle.sync();
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
await handle.close();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const overlaps = (left, right) => left === right || left.startsWith(`${right}${path.sep}`) || right.startsWith(`${left}${path.sep}`);
|
|
207
|
+
const sameIdentity = (left, right) => left.dev === right.dev && left.ino === right.ino && left.mode === right.mode
|
|
208
|
+
&& left.nlink === right.nlink && left.size === right.size && left.uid === right.uid && left.mtimeMs === right.mtimeMs;
|
|
209
|
+
const assertPrivateFile = (entry, maxBytes, allowEmpty = false) => {
|
|
210
|
+
if (!entry.isFile() || entry.isSymbolicLink() || entry.uid !== process.getuid?.()
|
|
211
|
+
|| entry.nlink !== 1 || (Number(entry.mode) & 0o777) !== 0o600
|
|
212
|
+
|| (!allowEmpty && entry.size < 1) || entry.size > maxBytes)
|
|
213
|
+
throw new Error("unsafe");
|
|
214
|
+
};
|
|
215
|
+
const noFollow = () => constants.O_NOFOLLOW ?? 0;
|
|
216
|
+
const unavailable = () => new Error("Grok kernel sandbox enforcement is unavailable");
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-request token accounting read off a Grok `streaming-messages-json`
|
|
3
|
+
* stream.
|
|
4
|
+
*
|
|
5
|
+
* Grok 1.0.34 puts the usage of each model request on that request's
|
|
6
|
+
* top-level `assistant` frame (`message.usage`, the same four disjoint
|
|
7
|
+
* Messages API buckets as the terminal `result.usage`), before any tool result
|
|
8
|
+
* of that request, and the per-request frames sum exactly to the terminal
|
|
9
|
+
* result (P0 host matrix). That makes the stream usable in two places the
|
|
10
|
+
* terminal frame is not: a turn that failed before its `result` frame, and a
|
|
11
|
+
* per-request ledger row.
|
|
12
|
+
*
|
|
13
|
+
* Never throws, and never invents a number: a usage block that is present but
|
|
14
|
+
* does not decode discards *all* requests, because one fabricated zero is
|
|
15
|
+
* byte-identical to a measured one.
|
|
16
|
+
*/
|
|
17
|
+
export type GrokRequestUsage = Readonly<{
|
|
18
|
+
index: number;
|
|
19
|
+
input: number;
|
|
20
|
+
cacheRead: number;
|
|
21
|
+
cacheWrite: number;
|
|
22
|
+
output: number;
|
|
23
|
+
total: number;
|
|
24
|
+
}>;
|
|
25
|
+
export type GrokStreamUsage = Readonly<{
|
|
26
|
+
requests: readonly GrokRequestUsage[];
|
|
27
|
+
sessionId?: string;
|
|
28
|
+
reportedModels: readonly string[];
|
|
29
|
+
}>;
|
|
30
|
+
export declare const decodeGrokStreamUsage: (output: string) => GrokStreamUsage;
|
|
31
|
+
//# sourceMappingURL=grokStreamUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grokStreamUsage.d.ts","sourceRoot":"","sources":["../../src/pi/grokStreamUsage.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAChJ,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC;AAkBzI,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,KAAG,eAmBtD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { GROK_ENGINE_BROKER } from "../contracts/runtimeContractManifest.js";
|
|
2
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
const tokenCount = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
4
|
+
const SESSION_ID = /^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/u;
|
|
5
|
+
const MODEL_KEY = /^[a-z0-9][a-z0-9.-]{0,63}$/u;
|
|
6
|
+
const decodeUsage = (usage) => {
|
|
7
|
+
if (!isRecord(usage))
|
|
8
|
+
return undefined;
|
|
9
|
+
const input = tokenCount(usage.input_tokens), output = tokenCount(usage.output_tokens), cacheRead = tokenCount(usage.cache_read_input_tokens), cacheWrite = tokenCount(usage.cache_creation_input_tokens);
|
|
10
|
+
if (input === undefined || output === undefined || cacheRead === undefined || cacheWrite === undefined)
|
|
11
|
+
return undefined;
|
|
12
|
+
const total = input + cacheRead + cacheWrite + output;
|
|
13
|
+
// Beyond the model context window one request cannot have spent it: invalid, like a malformed block.
|
|
14
|
+
if (total > GROK_ENGINE_BROKER.turnLimits.requestUsageMaxTokens)
|
|
15
|
+
return undefined;
|
|
16
|
+
return { input, cacheRead, cacheWrite, output, total };
|
|
17
|
+
};
|
|
18
|
+
export const decodeGrokStreamUsage = (output) => {
|
|
19
|
+
const byMessage = new Map();
|
|
20
|
+
const reportedModels = new Set();
|
|
21
|
+
let sessionId, corrupt = false;
|
|
22
|
+
for (const line of output.split(/\r?\n/u)) {
|
|
23
|
+
if (line.trim().length === 0)
|
|
24
|
+
continue;
|
|
25
|
+
let event;
|
|
26
|
+
try {
|
|
27
|
+
event = JSON.parse(line);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (!isRecord(event))
|
|
33
|
+
continue;
|
|
34
|
+
if (typeof event.session_id === "string" && SESSION_ID.test(event.session_id))
|
|
35
|
+
sessionId ??= event.session_id;
|
|
36
|
+
if (event.type === "result" && isRecord(event.modelUsage))
|
|
37
|
+
for (const key of Object.keys(event.modelUsage))
|
|
38
|
+
reportedModels.add(MODEL_KEY.test(key) ? key : "invalid");
|
|
39
|
+
if (event.type !== "assistant" || event.parent_tool_use_id !== null || !isRecord(event.message) || event.message.usage === undefined)
|
|
40
|
+
continue;
|
|
41
|
+
const decoded = decodeUsage(event.message.usage);
|
|
42
|
+
if (decoded === undefined || typeof event.message.id !== "string") {
|
|
43
|
+
corrupt = true;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
// One request can surface as more than one frame of the same message; it is one request.
|
|
47
|
+
byMessage.set(event.message.id, decoded);
|
|
48
|
+
}
|
|
49
|
+
const requests = corrupt ? [] : [...byMessage.values()].map((usage, index) => Object.freeze({ index, ...usage }));
|
|
50
|
+
return { requests, ...(sessionId === undefined ? {} : { sessionId }), reportedModels: [...reportedModels].sort() };
|
|
51
|
+
};
|
package/dist/pi/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export * from "./auth.js";
|
|
2
|
+
export * from "./cliSession.js";
|
|
2
3
|
export * from "./modelConfig.js";
|
|
4
|
+
export * from "./piAgentHandle.js";
|
|
3
5
|
export * from "./piHarness.js";
|
|
6
|
+
export * from "./rawTrainingCapture.js";
|
|
7
|
+
export * from "./turnCausal.js";
|
|
8
|
+
export * from "./worldTools.js";
|
|
4
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/pi/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pi/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pi/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/dist/pi/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from "./auth.js";
|
|
2
|
+
export * from "./cliSession.js";
|
|
2
3
|
export * from "./modelConfig.js";
|
|
4
|
+
export * from "./piAgentHandle.js";
|
|
3
5
|
export * from "./piHarness.js";
|
|
6
|
+
export * from "./rawTrainingCapture.js";
|
|
7
|
+
export * from "./turnCausal.js";
|
|
8
|
+
export * from "./worldTools.js";
|
package/dist/pi/memoryTools.d.ts
CHANGED
|
@@ -1,14 +1,68 @@
|
|
|
1
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
1
2
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { MemoryRuntime, MemoryToolExecutionContext } from "@noopolis/mneme";
|
|
3
|
+
import type { MemoryPrepareTurnResult, MemoryRuntime, MemoryToolExecutionContext, MemoryWakeMode } from "@noopolis/mneme";
|
|
3
4
|
export interface PiMemoryToolContextRef {
|
|
4
5
|
current?: MemoryToolExecutionContext;
|
|
6
|
+
observeTool?: (event: PiMemoryToolTraceEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface PiMemoryToolTraceEvent {
|
|
9
|
+
contentCount?: number;
|
|
10
|
+
decision?: string;
|
|
11
|
+
durationMs: number;
|
|
12
|
+
error?: string;
|
|
13
|
+
kind: "memory";
|
|
14
|
+
name: string;
|
|
15
|
+
redactionCount?: number;
|
|
16
|
+
status: "completed" | "failed";
|
|
5
17
|
}
|
|
6
18
|
interface PiMemoryToolInput {
|
|
7
19
|
agentId: string;
|
|
8
20
|
memory: MemoryRuntime;
|
|
9
21
|
contextRef: PiMemoryToolContextRef;
|
|
22
|
+
mode?: MemoryWakeMode;
|
|
10
23
|
}
|
|
11
24
|
type PiMemoryTool = ToolDefinition<any, unknown>;
|
|
25
|
+
export declare const createTrustedPiMemoryToolContext: (input: {
|
|
26
|
+
agentId: string;
|
|
27
|
+
memory: MemoryRuntime;
|
|
28
|
+
mode: MemoryWakeMode;
|
|
29
|
+
prepared: MemoryPrepareTurnResult;
|
|
30
|
+
threadId: string;
|
|
31
|
+
wakeId: string;
|
|
32
|
+
}) => MemoryToolExecutionContext;
|
|
33
|
+
export declare function canonicalToolFieldNames(name: string, representation?: unknown): string[];
|
|
34
|
+
export declare const MEMORY_TOOL_ARGUMENT_FIELDS: Readonly<Record<string, ReadonlySet<string>>>;
|
|
35
|
+
export declare const schemaFor: (name: string) => Type.TObject<{
|
|
36
|
+
scope: Type.TString;
|
|
37
|
+
query: Type.TString;
|
|
38
|
+
limit: Type.TOptional<Type.TNumber>;
|
|
39
|
+
}> | Type.TObject<{
|
|
40
|
+
query: Type.TString;
|
|
41
|
+
limit: Type.TOptional<Type.TNumber>;
|
|
42
|
+
active_scope: Type.TOptional<Type.TString>;
|
|
43
|
+
}> | Type.TObject<{
|
|
44
|
+
scope: Type.TString;
|
|
45
|
+
kind: Type.TString;
|
|
46
|
+
content: Type.TObject<{
|
|
47
|
+
kind: Type.TString;
|
|
48
|
+
}>;
|
|
49
|
+
visibility: Type.TString;
|
|
50
|
+
sensitivity: Type.TString;
|
|
51
|
+
source_type: Type.TString;
|
|
52
|
+
confidence: Type.TOptional<Type.TNumber>;
|
|
53
|
+
memory_id: Type.TOptional<Type.TString>;
|
|
54
|
+
}> | Type.TObject<{
|
|
55
|
+
scope: Type.TString;
|
|
56
|
+
horizon: Type.TOptional<Type.TNumber>;
|
|
57
|
+
}> | Type.TObject<{
|
|
58
|
+
scope: Type.TString;
|
|
59
|
+
memory_id: Type.TString;
|
|
60
|
+
reason: Type.TOptional<Type.TString>;
|
|
61
|
+
}> | Type.TObject<{
|
|
62
|
+
scope: Type.TString;
|
|
63
|
+
event_ids: Type.TArray<Type.TString>;
|
|
64
|
+
reason: Type.TOptional<Type.TString>;
|
|
65
|
+
}>;
|
|
12
66
|
export declare const createPiMemoryTools: (input: PiMemoryToolInput) => PiMemoryTool[];
|
|
13
67
|
export declare const piMemoryToolNames: (tools: PiMemoryTool[]) => string[];
|
|
14
68
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryTools.d.ts","sourceRoot":"","sources":["../../src/pi/memoryTools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memoryTools.d.ts","sourceRoot":"","sources":["../../src/pi/memoryTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQlF,OAAO,KAAK,EAEV,uBAAuB,EACvB,aAAa,EACb,0BAA0B,EAE1B,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;CAChC;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,sBAAsB,CAAC;IACnC,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,KAAK,YAAY,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAyCjD,eAAO,MAAM,gCAAgC,GAAI,OAAO;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,KAAG,0BAqBH,CAAC;AAqBF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAaxF;AAED,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAInF,CAAC;AAqBJ,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,iBAAiB,KAAG,YAAY,EAuCxE,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAAI,OAAO,YAAY,EAAE,KAAG,MAAM,EAChC,CAAC"}
|