@eloxiv/testing 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Admin.d.ts +20 -0
- package/dist/Admin.d.ts.map +1 -0
- package/dist/Admin.js +61 -0
- package/dist/Admin.js.map +1 -0
- package/dist/Agent.d.ts +97 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +210 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSurface.d.ts +20 -0
- package/dist/AgentSurface.d.ts.map +1 -0
- package/dist/AgentSurface.js +36 -0
- package/dist/AgentSurface.js.map +1 -0
- package/dist/Embedder.d.ts +21 -0
- package/dist/Embedder.d.ts.map +1 -0
- package/dist/Embedder.js +54 -0
- package/dist/Embedder.js.map +1 -0
- package/dist/EvalMain.d.ts +2 -0
- package/dist/EvalMain.d.ts.map +1 -0
- package/dist/EvalMain.js +80 -0
- package/dist/EvalMain.js.map +1 -0
- package/dist/Evals.d.ts +95 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +389 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Kernel.d.ts +88 -0
- package/dist/Kernel.d.ts.map +1 -0
- package/dist/Kernel.js +108 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Launch.d.ts +86 -0
- package/dist/Launch.d.ts.map +1 -0
- package/dist/Launch.js +370 -0
- package/dist/Launch.js.map +1 -0
- package/dist/Locks.d.ts +39 -0
- package/dist/Locks.d.ts.map +1 -0
- package/dist/Locks.js +94 -0
- package/dist/Locks.js.map +1 -0
- package/dist/Routes.d.ts +19 -0
- package/dist/Routes.d.ts.map +1 -0
- package/dist/Routes.js +38 -0
- package/dist/Routes.js.map +1 -0
- package/dist/ScriptedChatModel.d.ts +51 -0
- package/dist/ScriptedChatModel.d.ts.map +1 -0
- package/dist/ScriptedChatModel.js +135 -0
- package/dist/ScriptedChatModel.js.map +1 -0
- package/dist/SmtpSink.d.ts +36 -0
- package/dist/SmtpSink.d.ts.map +1 -0
- package/dist/SmtpSink.js +185 -0
- package/dist/SmtpSink.js.map +1 -0
- package/dist/System.d.ts +271 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +908 -0
- package/dist/System.js.map +1 -0
- package/dist/TcpProxy.d.ts +17 -0
- package/dist/TcpProxy.d.ts.map +1 -0
- package/dist/TcpProxy.js +100 -0
- package/dist/TcpProxy.js.map +1 -0
- package/dist/auth/TrustedProxyAuth.d.ts +28 -0
- package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
- package/dist/auth/TrustedProxyAuth.js +128 -0
- package/dist/auth/TrustedProxyAuth.js.map +1 -0
- package/dist/conformance/ActionConsent.d.ts +3 -0
- package/dist/conformance/ActionConsent.d.ts.map +1 -0
- package/dist/conformance/ActionConsent.js +347 -0
- package/dist/conformance/ActionConsent.js.map +1 -0
- package/dist/conformance/ActionRegistry.d.ts +64 -0
- package/dist/conformance/ActionRegistry.d.ts.map +1 -0
- package/dist/conformance/ActionRegistry.js +136 -0
- package/dist/conformance/ActionRegistry.js.map +1 -0
- package/dist/conformance/Actor.d.ts +43 -0
- package/dist/conformance/Actor.d.ts.map +1 -0
- package/dist/conformance/Actor.js +171 -0
- package/dist/conformance/Actor.js.map +1 -0
- package/dist/conformance/AgentReference.d.ts +30 -0
- package/dist/conformance/AgentReference.d.ts.map +1 -0
- package/dist/conformance/AgentReference.js +137 -0
- package/dist/conformance/AgentReference.js.map +1 -0
- package/dist/conformance/AgentResources.d.ts +3 -0
- package/dist/conformance/AgentResources.d.ts.map +1 -0
- package/dist/conformance/AgentResources.js +454 -0
- package/dist/conformance/AgentResources.js.map +1 -0
- package/dist/conformance/AgentRuntime.d.ts +3 -0
- package/dist/conformance/AgentRuntime.d.ts.map +1 -0
- package/dist/conformance/AgentRuntime.js +302 -0
- package/dist/conformance/AgentRuntime.js.map +1 -0
- package/dist/conformance/AgentSubject.d.ts +87 -0
- package/dist/conformance/AgentSubject.d.ts.map +1 -0
- package/dist/conformance/AgentSubject.js +18 -0
- package/dist/conformance/AgentSubject.js.map +1 -0
- package/dist/conformance/Approvals.d.ts +3 -0
- package/dist/conformance/Approvals.d.ts.map +1 -0
- package/dist/conformance/Approvals.js +258 -0
- package/dist/conformance/Approvals.js.map +1 -0
- package/dist/conformance/Audit.d.ts +3 -0
- package/dist/conformance/Audit.d.ts.map +1 -0
- package/dist/conformance/Audit.js +221 -0
- package/dist/conformance/Audit.js.map +1 -0
- package/dist/conformance/CalendarProvider.d.ts +4 -0
- package/dist/conformance/CalendarProvider.d.ts.map +1 -0
- package/dist/conformance/CalendarProvider.js +108 -0
- package/dist/conformance/CalendarProvider.js.map +1 -0
- package/dist/conformance/CapabilityKit.d.ts +191 -0
- package/dist/conformance/CapabilityKit.d.ts.map +1 -0
- package/dist/conformance/CapabilityKit.js +375 -0
- package/dist/conformance/CapabilityKit.js.map +1 -0
- package/dist/conformance/ClientSDK.d.ts +78 -0
- package/dist/conformance/ClientSDK.d.ts.map +1 -0
- package/dist/conformance/ClientSDK.js +163 -0
- package/dist/conformance/ClientSDK.js.map +1 -0
- package/dist/conformance/CollabDocument.d.ts +3 -0
- package/dist/conformance/CollabDocument.d.ts.map +1 -0
- package/dist/conformance/CollabDocument.js +934 -0
- package/dist/conformance/CollabDocument.js.map +1 -0
- package/dist/conformance/CollabReference.d.ts +8 -0
- package/dist/conformance/CollabReference.d.ts.map +1 -0
- package/dist/conformance/CollabReference.js +138 -0
- package/dist/conformance/CollabReference.js.map +1 -0
- package/dist/conformance/CollabSubject.d.ts +68 -0
- package/dist/conformance/CollabSubject.d.ts.map +1 -0
- package/dist/conformance/CollabSubject.js +2 -0
- package/dist/conformance/CollabSubject.js.map +1 -0
- package/dist/conformance/Command.d.ts +3 -0
- package/dist/conformance/Command.d.ts.map +1 -0
- package/dist/conformance/Command.js +73 -0
- package/dist/conformance/Command.js.map +1 -0
- package/dist/conformance/Connections.d.ts +4 -0
- package/dist/conformance/Connections.d.ts.map +1 -0
- package/dist/conformance/Connections.js +308 -0
- package/dist/conformance/Connections.js.map +1 -0
- package/dist/conformance/ConnectionsReference.d.ts +56 -0
- package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
- package/dist/conformance/ConnectionsReference.js +74 -0
- package/dist/conformance/ConnectionsReference.js.map +1 -0
- package/dist/conformance/ConnectorReference.d.ts +86 -0
- package/dist/conformance/ConnectorReference.d.ts.map +1 -0
- package/dist/conformance/ConnectorReference.js +185 -0
- package/dist/conformance/ConnectorReference.js.map +1 -0
- package/dist/conformance/ContextAccounting.d.ts +8 -0
- package/dist/conformance/ContextAccounting.d.ts.map +1 -0
- package/dist/conformance/ContextAccounting.js +125 -0
- package/dist/conformance/ContextAccounting.js.map +1 -0
- package/dist/conformance/Daemon.d.ts +150 -0
- package/dist/conformance/Daemon.d.ts.map +1 -0
- package/dist/conformance/Daemon.js +718 -0
- package/dist/conformance/Daemon.js.map +1 -0
- package/dist/conformance/DaemonReference.d.ts +15 -0
- package/dist/conformance/DaemonReference.d.ts.map +1 -0
- package/dist/conformance/DaemonReference.js +163 -0
- package/dist/conformance/DaemonReference.js.map +1 -0
- package/dist/conformance/DbTx.d.ts +17 -0
- package/dist/conformance/DbTx.d.ts.map +1 -0
- package/dist/conformance/DbTx.js +184 -0
- package/dist/conformance/DbTx.js.map +1 -0
- package/dist/conformance/DecisionTokens.d.ts +3 -0
- package/dist/conformance/DecisionTokens.d.ts.map +1 -0
- package/dist/conformance/DecisionTokens.js +551 -0
- package/dist/conformance/DecisionTokens.js.map +1 -0
- package/dist/conformance/Delegation.d.ts +3 -0
- package/dist/conformance/Delegation.d.ts.map +1 -0
- package/dist/conformance/Delegation.js +149 -0
- package/dist/conformance/Delegation.js.map +1 -0
- package/dist/conformance/DeskReference.d.ts +21 -0
- package/dist/conformance/DeskReference.d.ts.map +1 -0
- package/dist/conformance/DeskReference.js +47 -0
- package/dist/conformance/DeskReference.js.map +1 -0
- package/dist/conformance/DeviceControl.d.ts +3 -0
- package/dist/conformance/DeviceControl.d.ts.map +1 -0
- package/dist/conformance/DeviceControl.js +579 -0
- package/dist/conformance/DeviceControl.js.map +1 -0
- package/dist/conformance/Directory.d.ts +36 -0
- package/dist/conformance/Directory.d.ts.map +1 -0
- package/dist/conformance/Directory.js +253 -0
- package/dist/conformance/Directory.js.map +1 -0
- package/dist/conformance/DirectoryProvider.d.ts +4 -0
- package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
- package/dist/conformance/DirectoryProvider.js +58 -0
- package/dist/conformance/DirectoryProvider.js.map +1 -0
- package/dist/conformance/DocumentSource.d.ts +4 -0
- package/dist/conformance/DocumentSource.d.ts.map +1 -0
- package/dist/conformance/DocumentSource.js +43 -0
- package/dist/conformance/DocumentSource.js.map +1 -0
- package/dist/conformance/EndpointReference.d.ts +40 -0
- package/dist/conformance/EndpointReference.d.ts.map +1 -0
- package/dist/conformance/EndpointReference.js +67 -0
- package/dist/conformance/EndpointReference.js.map +1 -0
- package/dist/conformance/Files.d.ts +40 -0
- package/dist/conformance/Files.d.ts.map +1 -0
- package/dist/conformance/Files.js +592 -0
- package/dist/conformance/Files.js.map +1 -0
- package/dist/conformance/FilesReference.d.ts +31 -0
- package/dist/conformance/FilesReference.d.ts.map +1 -0
- package/dist/conformance/FilesReference.js +116 -0
- package/dist/conformance/FilesReference.js.map +1 -0
- package/dist/conformance/FilesSubject.d.ts +46 -0
- package/dist/conformance/FilesSubject.d.ts.map +1 -0
- package/dist/conformance/FilesSubject.js +3 -0
- package/dist/conformance/FilesSubject.js.map +1 -0
- package/dist/conformance/Flags.d.ts +3 -0
- package/dist/conformance/Flags.d.ts.map +1 -0
- package/dist/conformance/Flags.js +183 -0
- package/dist/conformance/Flags.js.map +1 -0
- package/dist/conformance/Host.d.ts +64 -0
- package/dist/conformance/Host.d.ts.map +1 -0
- package/dist/conformance/Host.js +152 -0
- package/dist/conformance/Host.js.map +1 -0
- package/dist/conformance/HttpApi.d.ts +5 -0
- package/dist/conformance/HttpApi.d.ts.map +1 -0
- package/dist/conformance/HttpApi.js +131 -0
- package/dist/conformance/HttpApi.js.map +1 -0
- package/dist/conformance/InboxReference.d.ts +28 -0
- package/dist/conformance/InboxReference.d.ts.map +1 -0
- package/dist/conformance/InboxReference.js +331 -0
- package/dist/conformance/InboxReference.js.map +1 -0
- package/dist/conformance/InboxSubject.d.ts +92 -0
- package/dist/conformance/InboxSubject.d.ts.map +1 -0
- package/dist/conformance/InboxSubject.js +16 -0
- package/dist/conformance/InboxSubject.js.map +1 -0
- package/dist/conformance/Ingestion.d.ts +10 -0
- package/dist/conformance/Ingestion.d.ts.map +1 -0
- package/dist/conformance/Ingestion.js +335 -0
- package/dist/conformance/Ingestion.js.map +1 -0
- package/dist/conformance/Ingress.d.ts +62 -0
- package/dist/conformance/Ingress.d.ts.map +1 -0
- package/dist/conformance/Ingress.js +346 -0
- package/dist/conformance/Ingress.js.map +1 -0
- package/dist/conformance/Invocation.d.ts +3 -0
- package/dist/conformance/Invocation.d.ts.map +1 -0
- package/dist/conformance/Invocation.js +665 -0
- package/dist/conformance/Invocation.js.map +1 -0
- package/dist/conformance/IsolationMatrix.d.ts +60 -0
- package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
- package/dist/conformance/IsolationMatrix.js +196 -0
- package/dist/conformance/IsolationMatrix.js.map +1 -0
- package/dist/conformance/LiveConnection.d.ts +72 -0
- package/dist/conformance/LiveConnection.d.ts.map +1 -0
- package/dist/conformance/LiveConnection.js +125 -0
- package/dist/conformance/LiveConnection.js.map +1 -0
- package/dist/conformance/LocalClient.d.ts +70 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +576 -0
- package/dist/conformance/LocalClient.js.map +1 -0
- package/dist/conformance/Locale.d.ts +28 -0
- package/dist/conformance/Locale.d.ts.map +1 -0
- package/dist/conformance/Locale.js +115 -0
- package/dist/conformance/Locale.js.map +1 -0
- package/dist/conformance/MachineIdentity.d.ts +39 -0
- package/dist/conformance/MachineIdentity.d.ts.map +1 -0
- package/dist/conformance/MachineIdentity.js +595 -0
- package/dist/conformance/MachineIdentity.js.map +1 -0
- package/dist/conformance/MailProvider.d.ts +4 -0
- package/dist/conformance/MailProvider.d.ts.map +1 -0
- package/dist/conformance/MailProvider.js +167 -0
- package/dist/conformance/MailProvider.js.map +1 -0
- package/dist/conformance/Memory.d.ts +10 -0
- package/dist/conformance/Memory.d.ts.map +1 -0
- package/dist/conformance/Memory.js +179 -0
- package/dist/conformance/Memory.js.map +1 -0
- package/dist/conformance/Messaging.d.ts +49 -0
- package/dist/conformance/Messaging.d.ts.map +1 -0
- package/dist/conformance/Messaging.js +117 -0
- package/dist/conformance/Messaging.js.map +1 -0
- package/dist/conformance/Metering.d.ts +26 -0
- package/dist/conformance/Metering.d.ts.map +1 -0
- package/dist/conformance/Metering.js +236 -0
- package/dist/conformance/Metering.js.map +1 -0
- package/dist/conformance/ModelProvider.d.ts +32 -0
- package/dist/conformance/ModelProvider.d.ts.map +1 -0
- package/dist/conformance/ModelProvider.js +100 -0
- package/dist/conformance/ModelProvider.js.map +1 -0
- package/dist/conformance/ModuleManifest.d.ts +9 -0
- package/dist/conformance/ModuleManifest.d.ts.map +1 -0
- package/dist/conformance/ModuleManifest.js +542 -0
- package/dist/conformance/ModuleManifest.js.map +1 -0
- package/dist/conformance/NotebookAgent.d.ts +32 -0
- package/dist/conformance/NotebookAgent.d.ts.map +1 -0
- package/dist/conformance/NotebookAgent.js +31 -0
- package/dist/conformance/NotebookAgent.js.map +1 -0
- package/dist/conformance/NotificationChannel.d.ts +40 -0
- package/dist/conformance/NotificationChannel.d.ts.map +1 -0
- package/dist/conformance/NotificationChannel.js +78 -0
- package/dist/conformance/NotificationChannel.js.map +1 -0
- package/dist/conformance/Notifications.d.ts +3 -0
- package/dist/conformance/Notifications.d.ts.map +1 -0
- package/dist/conformance/Notifications.js +240 -0
- package/dist/conformance/Notifications.js.map +1 -0
- package/dist/conformance/OAuthClient.d.ts +123 -0
- package/dist/conformance/OAuthClient.d.ts.map +1 -0
- package/dist/conformance/OAuthClient.js +204 -0
- package/dist/conformance/OAuthClient.js.map +1 -0
- package/dist/conformance/Outbox.d.ts +3 -0
- package/dist/conformance/Outbox.d.ts.map +1 -0
- package/dist/conformance/Outbox.js +266 -0
- package/dist/conformance/Outbox.js.map +1 -0
- package/dist/conformance/PlatformReference.d.ts +5 -0
- package/dist/conformance/PlatformReference.d.ts.map +1 -0
- package/dist/conformance/PlatformReference.js +66 -0
- package/dist/conformance/PlatformReference.js.map +1 -0
- package/dist/conformance/PlatformSubject.d.ts +45 -0
- package/dist/conformance/PlatformSubject.d.ts.map +1 -0
- package/dist/conformance/PlatformSubject.js +3 -0
- package/dist/conformance/PlatformSubject.js.map +1 -0
- package/dist/conformance/Privacy.d.ts +3 -0
- package/dist/conformance/Privacy.d.ts.map +1 -0
- package/dist/conformance/Privacy.js +437 -0
- package/dist/conformance/Privacy.js.map +1 -0
- package/dist/conformance/Progress.d.ts +3 -0
- package/dist/conformance/Progress.d.ts.map +1 -0
- package/dist/conformance/Progress.js +153 -0
- package/dist/conformance/Progress.js.map +1 -0
- package/dist/conformance/Push.d.ts +38 -0
- package/dist/conformance/Push.d.ts.map +1 -0
- package/dist/conformance/Push.js +649 -0
- package/dist/conformance/Push.js.map +1 -0
- package/dist/conformance/PushReference.d.ts +3 -0
- package/dist/conformance/PushReference.d.ts.map +1 -0
- package/dist/conformance/PushReference.js +97 -0
- package/dist/conformance/PushReference.js.map +1 -0
- package/dist/conformance/QuerySurface.d.ts +9 -0
- package/dist/conformance/QuerySurface.d.ts.map +1 -0
- package/dist/conformance/QuerySurface.js +349 -0
- package/dist/conformance/QuerySurface.js.map +1 -0
- package/dist/conformance/Readiness.d.ts +23 -0
- package/dist/conformance/Readiness.d.ts.map +1 -0
- package/dist/conformance/Readiness.js +110 -0
- package/dist/conformance/Readiness.js.map +1 -0
- package/dist/conformance/Reference.d.ts +17 -0
- package/dist/conformance/Reference.d.ts.map +1 -0
- package/dist/conformance/Reference.js +246 -0
- package/dist/conformance/Reference.js.map +1 -0
- package/dist/conformance/Release.d.ts +73 -0
- package/dist/conformance/Release.d.ts.map +1 -0
- package/dist/conformance/Release.js +556 -0
- package/dist/conformance/Release.js.map +1 -0
- package/dist/conformance/ReleaseReference.d.ts +5 -0
- package/dist/conformance/ReleaseReference.d.ts.map +1 -0
- package/dist/conformance/ReleaseReference.js +124 -0
- package/dist/conformance/ReleaseReference.js.map +1 -0
- package/dist/conformance/ResultRendering.d.ts +3 -0
- package/dist/conformance/ResultRendering.d.ts.map +1 -0
- package/dist/conformance/ResultRendering.js +120 -0
- package/dist/conformance/ResultRendering.js.map +1 -0
- package/dist/conformance/Sandbox.d.ts +58 -0
- package/dist/conformance/Sandbox.d.ts.map +1 -0
- package/dist/conformance/Sandbox.js +213 -0
- package/dist/conformance/Sandbox.js.map +1 -0
- package/dist/conformance/SandboxReference.d.ts +3 -0
- package/dist/conformance/SandboxReference.d.ts.map +1 -0
- package/dist/conformance/SandboxReference.js +44 -0
- package/dist/conformance/SandboxReference.js.map +1 -0
- package/dist/conformance/Scheduler.d.ts +106 -0
- package/dist/conformance/Scheduler.d.ts.map +1 -0
- package/dist/conformance/Scheduler.js +576 -0
- package/dist/conformance/Scheduler.js.map +1 -0
- package/dist/conformance/ScreenContext.d.ts +84 -0
- package/dist/conformance/ScreenContext.d.ts.map +1 -0
- package/dist/conformance/ScreenContext.js +290 -0
- package/dist/conformance/ScreenContext.js.map +1 -0
- package/dist/conformance/Search.d.ts +3 -0
- package/dist/conformance/Search.d.ts.map +1 -0
- package/dist/conformance/Search.js +333 -0
- package/dist/conformance/Search.js.map +1 -0
- package/dist/conformance/Secrets.d.ts +8 -0
- package/dist/conformance/Secrets.d.ts.map +1 -0
- package/dist/conformance/Secrets.js +231 -0
- package/dist/conformance/Secrets.js.map +1 -0
- package/dist/conformance/SecretsReference.d.ts +44 -0
- package/dist/conformance/SecretsReference.d.ts.map +1 -0
- package/dist/conformance/SecretsReference.js +73 -0
- package/dist/conformance/SecretsReference.js.map +1 -0
- package/dist/conformance/ServicesReference.d.ts +8 -0
- package/dist/conformance/ServicesReference.d.ts.map +1 -0
- package/dist/conformance/ServicesReference.js +273 -0
- package/dist/conformance/ServicesReference.js.map +1 -0
- package/dist/conformance/ServicesSubject.d.ts +104 -0
- package/dist/conformance/ServicesSubject.d.ts.map +1 -0
- package/dist/conformance/ServicesSubject.js +2 -0
- package/dist/conformance/ServicesSubject.js.map +1 -0
- package/dist/conformance/Settings.d.ts +3 -0
- package/dist/conformance/Settings.d.ts.map +1 -0
- package/dist/conformance/Settings.js +177 -0
- package/dist/conformance/Settings.js.map +1 -0
- package/dist/conformance/Sharing.d.ts +3 -0
- package/dist/conformance/Sharing.d.ts.map +1 -0
- package/dist/conformance/Sharing.js +368 -0
- package/dist/conformance/Sharing.js.map +1 -0
- package/dist/conformance/ShellSubject.d.ts +29 -0
- package/dist/conformance/ShellSubject.d.ts.map +1 -0
- package/dist/conformance/ShellSubject.js +13 -0
- package/dist/conformance/ShellSubject.js.map +1 -0
- package/dist/conformance/SignOutRace.d.ts +23 -0
- package/dist/conformance/SignOutRace.d.ts.map +1 -0
- package/dist/conformance/SignOutRace.js +49 -0
- package/dist/conformance/SignOutRace.js.map +1 -0
- package/dist/conformance/Slot.d.ts +3 -0
- package/dist/conformance/Slot.d.ts.map +1 -0
- package/dist/conformance/Slot.js +79 -0
- package/dist/conformance/Slot.js.map +1 -0
- package/dist/conformance/Space.d.ts +63 -0
- package/dist/conformance/Space.d.ts.map +1 -0
- package/dist/conformance/Space.js +294 -0
- package/dist/conformance/Space.js.map +1 -0
- package/dist/conformance/StorageAdapter.d.ts +76 -0
- package/dist/conformance/StorageAdapter.d.ts.map +1 -0
- package/dist/conformance/StorageAdapter.js +181 -0
- package/dist/conformance/StorageAdapter.js.map +1 -0
- package/dist/conformance/StorageBackend.d.ts +23 -0
- package/dist/conformance/StorageBackend.d.ts.map +1 -0
- package/dist/conformance/StorageBackend.js +274 -0
- package/dist/conformance/StorageBackend.js.map +1 -0
- package/dist/conformance/Subject.d.ts +198 -0
- package/dist/conformance/Subject.d.ts.map +1 -0
- package/dist/conformance/Subject.js +26 -0
- package/dist/conformance/Subject.js.map +1 -0
- package/dist/conformance/Sync.d.ts +3 -0
- package/dist/conformance/Sync.d.ts.map +1 -0
- package/dist/conformance/Sync.js +190 -0
- package/dist/conformance/Sync.js.map +1 -0
- package/dist/conformance/Telemetry.d.ts +3 -0
- package/dist/conformance/Telemetry.d.ts.map +1 -0
- package/dist/conformance/Telemetry.js +218 -0
- package/dist/conformance/Telemetry.js.map +1 -0
- package/dist/conformance/ThemeTokens.d.ts +22 -0
- package/dist/conformance/ThemeTokens.d.ts.map +1 -0
- package/dist/conformance/ThemeTokens.js +121 -0
- package/dist/conformance/ThemeTokens.js.map +1 -0
- package/dist/conformance/ToolSource.d.ts +5 -0
- package/dist/conformance/ToolSource.d.ts.map +1 -0
- package/dist/conformance/ToolSource.js +520 -0
- package/dist/conformance/ToolSource.js.map +1 -0
- package/dist/conformance/Versioning.d.ts +3 -0
- package/dist/conformance/Versioning.d.ts.map +1 -0
- package/dist/conformance/Versioning.js +160 -0
- package/dist/conformance/Versioning.js.map +1 -0
- package/dist/conformance/View.d.ts +3 -0
- package/dist/conformance/View.d.ts.map +1 -0
- package/dist/conformance/View.js +121 -0
- package/dist/conformance/View.js.map +1 -0
- package/dist/conformance/WorkItems.d.ts +3 -0
- package/dist/conformance/WorkItems.d.ts.map +1 -0
- package/dist/conformance/WorkItems.js +152 -0
- package/dist/conformance/WorkItems.js.map +1 -0
- package/dist/conformance/Workflow.d.ts +63 -0
- package/dist/conformance/Workflow.d.ts.map +1 -0
- package/dist/conformance/Workflow.js +235 -0
- package/dist/conformance/Workflow.js.map +1 -0
- package/dist/conformance/acme/chatlog.d.ts +591 -0
- package/dist/conformance/acme/chatlog.d.ts.map +1 -0
- package/dist/conformance/acme/chatlog.js +101 -0
- package/dist/conformance/acme/chatlog.js.map +1 -0
- package/dist/conformance/acme/connector.d.ts +12 -0
- package/dist/conformance/acme/connector.d.ts.map +1 -0
- package/dist/conformance/acme/connector.js +123 -0
- package/dist/conformance/acme/connector.js.map +1 -0
- package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
- package/dist/conformance/archive/app.d.ts +728 -0
- package/dist/conformance/archive/app.d.ts.map +1 -0
- package/dist/conformance/archive/app.js +30 -0
- package/dist/conformance/archive/app.js.map +1 -0
- package/dist/conformance/archive/contract.d.ts +467 -0
- package/dist/conformance/archive/contract.d.ts.map +1 -0
- package/dist/conformance/archive/contract.js +187 -0
- package/dist/conformance/archive/contract.js.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.js +23 -0
- package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
- package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/dist/conformance/archive/schema.d.ts +185 -0
- package/dist/conformance/archive/schema.d.ts.map +1 -0
- package/dist/conformance/archive/schema.js +22 -0
- package/dist/conformance/archive/schema.js.map +1 -0
- package/dist/conformance/archive/server.d.ts +273 -0
- package/dist/conformance/archive/server.d.ts.map +1 -0
- package/dist/conformance/archive/server.js +127 -0
- package/dist/conformance/archive/server.js.map +1 -0
- package/dist/conformance/archive/sync.gen.d.ts +319 -0
- package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/sync.gen.js +29 -0
- package/dist/conformance/archive/sync.gen.js.map +1 -0
- package/dist/conformance/atlas/app.d.ts +3 -0
- package/dist/conformance/atlas/app.d.ts.map +1 -0
- package/dist/conformance/atlas/app.js +15 -0
- package/dist/conformance/atlas/app.js.map +1 -0
- package/dist/conformance/atlas/contract.d.ts +489 -0
- package/dist/conformance/atlas/contract.d.ts.map +1 -0
- package/dist/conformance/atlas/contract.js +114 -0
- package/dist/conformance/atlas/contract.js.map +1 -0
- package/dist/conformance/crm/app.d.ts +304 -0
- package/dist/conformance/crm/app.d.ts.map +1 -0
- package/dist/conformance/crm/app.js +95 -0
- package/dist/conformance/crm/app.js.map +1 -0
- package/dist/conformance/crm/contract.d.ts +586 -0
- package/dist/conformance/crm/contract.d.ts.map +1 -0
- package/dist/conformance/crm/contract.js +153 -0
- package/dist/conformance/crm/contract.js.map +1 -0
- package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/dist/conformance/crm/schema.d.ts +261 -0
- package/dist/conformance/crm/schema.d.ts.map +1 -0
- package/dist/conformance/crm/schema.js +25 -0
- package/dist/conformance/crm/schema.js.map +1 -0
- package/dist/conformance/crm/sync.gen.d.ts +188 -0
- package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
- package/dist/conformance/crm/sync.gen.js +25 -0
- package/dist/conformance/crm/sync.gen.js.map +1 -0
- package/dist/conformance/desk/contract.d.ts +306 -0
- package/dist/conformance/desk/contract.d.ts.map +1 -0
- package/dist/conformance/desk/contract.js +56 -0
- package/dist/conformance/desk/contract.js.map +1 -0
- package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
- package/dist/conformance/desk/server.d.ts +231 -0
- package/dist/conformance/desk/server.d.ts.map +1 -0
- package/dist/conformance/desk/server.js +123 -0
- package/dist/conformance/desk/server.js.map +1 -0
- package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/dist/conformance/drafts/module.d.ts +571 -0
- package/dist/conformance/drafts/module.d.ts.map +1 -0
- package/dist/conformance/drafts/module.js +190 -0
- package/dist/conformance/drafts/module.js.map +1 -0
- package/dist/conformance/fixture/app.d.ts +24 -0
- package/dist/conformance/fixture/app.d.ts.map +1 -0
- package/dist/conformance/fixture/app.js +26 -0
- package/dist/conformance/fixture/app.js.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.js +22 -0
- package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
- package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
- package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/contract.js +277 -0
- package/dist/conformance/fixture/docs/contract.js.map +1 -0
- package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/dist/conformance/fixture/docs/policy.cedar +110 -0
- package/dist/conformance/fixture/docs/schema.d.ts +308 -0
- package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/schema.js +36 -0
- package/dist/conformance/fixture/docs/schema.js.map +1 -0
- package/dist/conformance/fixture/docs/server.d.ts +552 -0
- package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/server.js +192 -0
- package/dist/conformance/fixture/docs/server.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.d.ts +402 -0
- package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.js +48 -0
- package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.js +23 -0
- package/dist/conformance/fixture/docs/sync.js.map +1 -0
- package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/dist/conformance/fixture/peer/module.d.ts +306 -0
- package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
- package/dist/conformance/fixture/peer/module.js +44 -0
- package/dist/conformance/fixture/peer/module.js.map +1 -0
- package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/module.d.ts +1878 -0
- package/dist/conformance/fixture/release/module.d.ts.map +1 -0
- package/dist/conformance/fixture/release/module.js +102 -0
- package/dist/conformance/fixture/release/module.js.map +1 -0
- package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/dist/conformance/kit-hash.d.ts +8 -0
- package/dist/conformance/kit-hash.d.ts.map +1 -0
- package/dist/conformance/kit-hash.js +20 -0
- package/dist/conformance/kit-hash.js.map +1 -0
- package/dist/conformance/ledger/contract.d.ts +380 -0
- package/dist/conformance/ledger/contract.d.ts.map +1 -0
- package/dist/conformance/ledger/contract.js +81 -0
- package/dist/conformance/ledger/contract.js.map +1 -0
- package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/dist/conformance/ledger/server.d.ts +312 -0
- package/dist/conformance/ledger/server.d.ts.map +1 -0
- package/dist/conformance/ledger/server.js +152 -0
- package/dist/conformance/ledger/server.js.map +1 -0
- package/dist/conformance/library/app.d.ts +616 -0
- package/dist/conformance/library/app.d.ts.map +1 -0
- package/dist/conformance/library/app.js +35 -0
- package/dist/conformance/library/app.js.map +1 -0
- package/dist/conformance/library/contract.d.ts +377 -0
- package/dist/conformance/library/contract.d.ts.map +1 -0
- package/dist/conformance/library/contract.js +63 -0
- package/dist/conformance/library/contract.js.map +1 -0
- package/dist/conformance/library/migrations/0000_library.sql +14 -0
- package/dist/conformance/library/schema.d.ts +174 -0
- package/dist/conformance/library/schema.d.ts.map +1 -0
- package/dist/conformance/library/schema.js +24 -0
- package/dist/conformance/library/schema.js.map +1 -0
- package/dist/conformance/library/server.d.ts +191 -0
- package/dist/conformance/library/server.d.ts.map +1 -0
- package/dist/conformance/library/server.js +52 -0
- package/dist/conformance/library/server.js.map +1 -0
- package/dist/conformance/library/sync.gen.d.ts +519 -0
- package/dist/conformance/library/sync.gen.d.ts.map +1 -0
- package/dist/conformance/library/sync.gen.js +42 -0
- package/dist/conformance/library/sync.gen.js.map +1 -0
- package/dist/conformance/locale/catalog.d.ts +93 -0
- package/dist/conformance/locale/catalog.d.ts.map +1 -0
- package/dist/conformance/locale/catalog.js +104 -0
- package/dist/conformance/locale/catalog.js.map +1 -0
- package/dist/conformance/notebook/app.d.ts +1039 -0
- package/dist/conformance/notebook/app.d.ts.map +1 -0
- package/dist/conformance/notebook/app.js +88 -0
- package/dist/conformance/notebook/app.js.map +1 -0
- package/dist/conformance/notebook/evals/pages.evals.json +94 -0
- package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/dist/conformance/notebook/module.d.ts +717 -0
- package/dist/conformance/notebook/module.d.ts.map +1 -0
- package/dist/conformance/notebook/module.js +188 -0
- package/dist/conformance/notebook/module.js.map +1 -0
- package/dist/conformance/pad/app.d.ts +9 -0
- package/dist/conformance/pad/app.d.ts.map +1 -0
- package/dist/conformance/pad/app.js +13 -0
- package/dist/conformance/pad/app.js.map +1 -0
- package/dist/conformance/pad/contract.d.ts +281 -0
- package/dist/conformance/pad/contract.d.ts.map +1 -0
- package/dist/conformance/pad/contract.js +66 -0
- package/dist/conformance/pad/contract.js.map +1 -0
- package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/dist/conformance/pad/schema.d.ts +127 -0
- package/dist/conformance/pad/schema.d.ts.map +1 -0
- package/dist/conformance/pad/schema.js +17 -0
- package/dist/conformance/pad/schema.js.map +1 -0
- package/dist/conformance/pad/server.d.ts +149 -0
- package/dist/conformance/pad/server.d.ts.map +1 -0
- package/dist/conformance/pad/server.js +81 -0
- package/dist/conformance/pad/server.js.map +1 -0
- package/dist/conformance/purchases/app.d.ts +480 -0
- package/dist/conformance/purchases/app.d.ts.map +1 -0
- package/dist/conformance/purchases/app.js +32 -0
- package/dist/conformance/purchases/app.js.map +1 -0
- package/dist/conformance/purchases/contract.d.ts +720 -0
- package/dist/conformance/purchases/contract.d.ts.map +1 -0
- package/dist/conformance/purchases/contract.js +148 -0
- package/dist/conformance/purchases/contract.js.map +1 -0
- package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/dist/conformance/purchases/server.d.ts +250 -0
- package/dist/conformance/purchases/server.d.ts.map +1 -0
- package/dist/conformance/purchases/server.js +85 -0
- package/dist/conformance/purchases/server.js.map +1 -0
- package/dist/conformance/studio/app.d.ts +996 -0
- package/dist/conformance/studio/app.d.ts.map +1 -0
- package/dist/conformance/studio/app.js +251 -0
- package/dist/conformance/studio/app.js.map +1 -0
- package/dist/conformance/studio/contract.d.ts +1318 -0
- package/dist/conformance/studio/contract.d.ts.map +1 -0
- package/dist/conformance/studio/contract.js +280 -0
- package/dist/conformance/studio/contract.js.map +1 -0
- package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/dist/conformance/workshop/app.d.ts +8 -0
- package/dist/conformance/workshop/app.d.ts.map +1 -0
- package/dist/conformance/workshop/app.js +13 -0
- package/dist/conformance/workshop/app.js.map +1 -0
- package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/dist/conformance/workshop/module.d.ts +407 -0
- package/dist/conformance/workshop/module.d.ts.map +1 -0
- package/dist/conformance/workshop/module.js +71 -0
- package/dist/conformance/workshop/module.js.map +1 -0
- package/dist/fakes/AcmeFake.d.ts +46 -0
- package/dist/fakes/AcmeFake.d.ts.map +1 -0
- package/dist/fakes/AcmeFake.js +131 -0
- package/dist/fakes/AcmeFake.js.map +1 -0
- package/dist/fakes/ApnsFake.d.ts +79 -0
- package/dist/fakes/ApnsFake.d.ts.map +1 -0
- package/dist/fakes/ApnsFake.js +220 -0
- package/dist/fakes/ApnsFake.js.map +1 -0
- package/dist/fakes/FcmFake.d.ts +46 -0
- package/dist/fakes/FcmFake.d.ts.map +1 -0
- package/dist/fakes/FcmFake.js +185 -0
- package/dist/fakes/FcmFake.js.map +1 -0
- package/dist/fakes/GoogleFake.d.ts +221 -0
- package/dist/fakes/GoogleFake.d.ts.map +1 -0
- package/dist/fakes/GoogleFake.js +1035 -0
- package/dist/fakes/GoogleFake.js.map +1 -0
- package/dist/fakes/HttpApiFake.d.ts +22 -0
- package/dist/fakes/HttpApiFake.d.ts.map +1 -0
- package/dist/fakes/HttpApiFake.js +74 -0
- package/dist/fakes/HttpApiFake.js.map +1 -0
- package/dist/fakes/McpFake.d.ts +80 -0
- package/dist/fakes/McpFake.d.ts.map +1 -0
- package/dist/fakes/McpFake.js +312 -0
- package/dist/fakes/McpFake.js.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.js +850 -0
- package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
- package/dist/fakes/S3Fake.d.ts +29 -0
- package/dist/fakes/S3Fake.d.ts.map +1 -0
- package/dist/fakes/S3Fake.js +347 -0
- package/dist/fakes/S3Fake.js.map +1 -0
- package/dist/fakes/Server.d.ts +137 -0
- package/dist/fakes/Server.d.ts.map +1 -0
- package/dist/fakes/Server.js +357 -0
- package/dist/fakes/Server.js.map +1 -0
- package/dist/fakes/SignInProviderFake.d.ts +21 -0
- package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
- package/dist/fakes/SignInProviderFake.js +56 -0
- package/dist/fakes/SignInProviderFake.js.map +1 -0
- package/dist/fakes/SlackFake.d.ts +136 -0
- package/dist/fakes/SlackFake.d.ts.map +1 -0
- package/dist/fakes/SlackFake.js +787 -0
- package/dist/fakes/SlackFake.js.map +1 -0
- package/dist/fakes/Store.d.ts +40 -0
- package/dist/fakes/Store.d.ts.map +1 -0
- package/dist/fakes/Store.js +82 -0
- package/dist/fakes/Store.js.map +1 -0
- package/dist/fakes/TelemetryFakes.d.ts +77 -0
- package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
- package/dist/fakes/TelemetryFakes.js +121 -0
- package/dist/fakes/TelemetryFakes.js.map +1 -0
- package/dist/fakes/TestCa.d.ts +11 -0
- package/dist/fakes/TestCa.d.ts.map +1 -0
- package/dist/fakes/TestCa.js +115 -0
- package/dist/fakes/TestCa.js.map +1 -0
- package/dist/fakes/WorkOsFake.d.ts +40 -0
- package/dist/fakes/WorkOsFake.d.ts.map +1 -0
- package/dist/fakes/WorkOsFake.js +103 -0
- package/dist/fakes/WorkOsFake.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/make/reference.d.ts +520 -0
- package/dist/make/reference.d.ts.map +1 -0
- package/dist/make/reference.js +182 -0
- package/dist/make/reference.js.map +1 -0
- package/dist/make/sources.d.ts +48 -0
- package/dist/make/sources.d.ts.map +1 -0
- package/dist/make/sources.js +806 -0
- package/dist/make/sources.js.map +1 -0
- package/package.json +77 -3
- package/src/Admin.ts +82 -0
- package/src/Agent.ts +289 -0
- package/src/AgentSurface.ts +51 -0
- package/src/Embedder.ts +69 -0
- package/src/EvalMain.ts +81 -0
- package/src/Evals.ts +490 -0
- package/src/Kernel.ts +228 -0
- package/src/Launch.ts +428 -0
- package/src/Locks.ts +123 -0
- package/src/Routes.ts +65 -0
- package/src/ScriptedChatModel.ts +189 -0
- package/src/SmtpSink.ts +205 -0
- package/src/System.ts +1075 -0
- package/src/TcpProxy.ts +102 -0
- package/src/auth/TrustedProxyAuth.ts +173 -0
- package/src/conformance/ActionConsent.ts +437 -0
- package/src/conformance/ActionRegistry.ts +174 -0
- package/src/conformance/Actor.ts +216 -0
- package/src/conformance/AgentReference.ts +171 -0
- package/src/conformance/AgentResources.ts +548 -0
- package/src/conformance/AgentRuntime.ts +388 -0
- package/src/conformance/AgentSubject.ts +103 -0
- package/src/conformance/Approvals.ts +363 -0
- package/src/conformance/Audit.ts +257 -0
- package/src/conformance/CalendarProvider.ts +156 -0
- package/src/conformance/CapabilityKit.ts +564 -0
- package/src/conformance/ClientSDK.ts +233 -0
- package/src/conformance/CollabDocument.ts +1203 -0
- package/src/conformance/CollabReference.ts +152 -0
- package/src/conformance/CollabSubject.ts +64 -0
- package/src/conformance/Command.ts +75 -0
- package/src/conformance/Connections.ts +357 -0
- package/src/conformance/ConnectionsReference.ts +172 -0
- package/src/conformance/ConnectorReference.ts +280 -0
- package/src/conformance/ContextAccounting.ts +169 -0
- package/src/conformance/Daemon.ts +936 -0
- package/src/conformance/DaemonReference.ts +189 -0
- package/src/conformance/DbTx.ts +253 -0
- package/src/conformance/DecisionTokens.ts +652 -0
- package/src/conformance/Delegation.ts +177 -0
- package/src/conformance/DeskReference.ts +73 -0
- package/src/conformance/DeviceControl.ts +700 -0
- package/src/conformance/Directory.ts +315 -0
- package/src/conformance/DirectoryProvider.ts +72 -0
- package/src/conformance/DocumentSource.ts +62 -0
- package/src/conformance/EndpointReference.ts +117 -0
- package/src/conformance/Files.ts +685 -0
- package/src/conformance/FilesReference.ts +154 -0
- package/src/conformance/FilesSubject.ts +50 -0
- package/src/conformance/Flags.ts +215 -0
- package/src/conformance/Host.ts +197 -0
- package/src/conformance/HttpApi.ts +169 -0
- package/src/conformance/InboxReference.ts +401 -0
- package/src/conformance/InboxSubject.ts +101 -0
- package/src/conformance/Ingestion.ts +425 -0
- package/src/conformance/Ingress.ts +498 -0
- package/src/conformance/Invocation.ts +780 -0
- package/src/conformance/IsolationMatrix.ts +215 -0
- package/src/conformance/LiveConnection.ts +197 -0
- package/src/conformance/LocalClient.ts +707 -0
- package/src/conformance/Locale.ts +141 -0
- package/src/conformance/MachineIdentity.ts +828 -0
- package/src/conformance/MailProvider.ts +217 -0
- package/src/conformance/Memory.ts +223 -0
- package/src/conformance/Messaging.ts +185 -0
- package/src/conformance/Metering.ts +293 -0
- package/src/conformance/ModelProvider.ts +139 -0
- package/src/conformance/ModuleManifest.ts +630 -0
- package/src/conformance/NotebookAgent.ts +41 -0
- package/src/conformance/NotificationChannel.ts +122 -0
- package/src/conformance/Notifications.ts +316 -0
- package/src/conformance/OAuthClient.ts +240 -0
- package/src/conformance/Outbox.ts +342 -0
- package/src/conformance/PlatformReference.ts +73 -0
- package/src/conformance/PlatformSubject.ts +50 -0
- package/src/conformance/Privacy.ts +577 -0
- package/src/conformance/Progress.ts +244 -0
- package/src/conformance/Push.ts +820 -0
- package/src/conformance/PushReference.ts +101 -0
- package/src/conformance/QuerySurface.ts +408 -0
- package/src/conformance/Readiness.ts +157 -0
- package/src/conformance/Reference.ts +326 -0
- package/src/conformance/Release.ts +690 -0
- package/src/conformance/ReleaseReference.ts +179 -0
- package/src/conformance/ResultRendering.ts +149 -0
- package/src/conformance/Sandbox.ts +313 -0
- package/src/conformance/SandboxReference.ts +52 -0
- package/src/conformance/Scheduler.ts +764 -0
- package/src/conformance/ScreenContext.ts +402 -0
- package/src/conformance/Search.ts +419 -0
- package/src/conformance/Secrets.ts +277 -0
- package/src/conformance/SecretsReference.ts +131 -0
- package/src/conformance/ServicesReference.ts +330 -0
- package/src/conformance/ServicesSubject.ts +105 -0
- package/src/conformance/Settings.ts +204 -0
- package/src/conformance/Sharing.ts +486 -0
- package/src/conformance/ShellSubject.ts +47 -0
- package/src/conformance/SignOutRace.ts +77 -0
- package/src/conformance/Slot.ts +84 -0
- package/src/conformance/Space.ts +432 -0
- package/src/conformance/StorageAdapter.ts +253 -0
- package/src/conformance/StorageBackend.ts +327 -0
- package/src/conformance/Subject.ts +208 -0
- package/src/conformance/Sync.ts +215 -0
- package/src/conformance/Telemetry.ts +287 -0
- package/src/conformance/ThemeTokens.ts +163 -0
- package/src/conformance/ToolSource.ts +632 -0
- package/src/conformance/Versioning.ts +199 -0
- package/src/conformance/View.ts +143 -0
- package/src/conformance/WorkItems.ts +186 -0
- package/src/conformance/Workflow.ts +304 -0
- package/src/conformance/acme/chatlog.ts +115 -0
- package/src/conformance/acme/connector.ts +151 -0
- package/src/conformance/acme/migrations/0000_messages.sql +8 -0
- package/src/conformance/archive/app.ts +33 -0
- package/src/conformance/archive/contract.ts +191 -0
- package/src/conformance/archive/memo.sync.gen.ts +25 -0
- package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/src/conformance/archive/schema.ts +25 -0
- package/src/conformance/archive/server.ts +146 -0
- package/src/conformance/archive/sync.gen.ts +32 -0
- package/src/conformance/atlas/app.ts +16 -0
- package/src/conformance/atlas/contract.ts +118 -0
- package/src/conformance/crm/app.ts +107 -0
- package/src/conformance/crm/contract.ts +163 -0
- package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/src/conformance/crm/schema.ts +28 -0
- package/src/conformance/crm/sync.gen.ts +27 -0
- package/src/conformance/desk/contract.ts +61 -0
- package/src/conformance/desk/migrations/0000_notes.sql +7 -0
- package/src/conformance/desk/server.ts +131 -0
- package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/src/conformance/drafts/module.ts +211 -0
- package/src/conformance/fixture/app.ts +37 -0
- package/src/conformance/fixture/docs/bad-sync.ts +34 -0
- package/src/conformance/fixture/docs/contract.ts +297 -0
- package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/src/conformance/fixture/docs/policy.cedar +110 -0
- package/src/conformance/fixture/docs/schema.ts +41 -0
- package/src/conformance/fixture/docs/server.ts +292 -0
- package/src/conformance/fixture/docs/sync.gen.ts +54 -0
- package/src/conformance/fixture/docs/sync.ts +24 -0
- package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/src/conformance/fixture/peer/module.ts +51 -0
- package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/module.ts +119 -0
- package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/src/conformance/kit-hash.ts +18 -0
- package/src/conformance/ledger/contract.ts +92 -0
- package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/src/conformance/ledger/server.ts +174 -0
- package/src/conformance/library/app.ts +38 -0
- package/src/conformance/library/contract.ts +66 -0
- package/src/conformance/library/migrations/0000_library.sql +14 -0
- package/src/conformance/library/schema.ts +27 -0
- package/src/conformance/library/server.ts +65 -0
- package/src/conformance/library/sync.gen.ts +47 -0
- package/src/conformance/locale/catalog.ts +111 -0
- package/src/conformance/notebook/app.ts +115 -0
- package/src/conformance/notebook/evals/pages.evals.json +94 -0
- package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/src/conformance/notebook/module.ts +215 -0
- package/src/conformance/notebook/skills/meeting-notes.md +4 -0
- package/src/conformance/pad/app.ts +21 -0
- package/src/conformance/pad/contract.ts +69 -0
- package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/src/conformance/pad/schema.ts +18 -0
- package/src/conformance/pad/server.ts +102 -0
- package/src/conformance/purchases/app.ts +34 -0
- package/src/conformance/purchases/contract.ts +161 -0
- package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/src/conformance/purchases/server.ts +95 -0
- package/src/conformance/replica-search.mjs +22 -0
- package/src/conformance/studio/app.ts +298 -0
- package/src/conformance/studio/contract.ts +319 -0
- package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/src/conformance/workshop/app.ts +14 -0
- package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/src/conformance/workshop/module.ts +79 -0
- package/src/fakes/AcmeFake.ts +182 -0
- package/src/fakes/ApnsFake.ts +245 -0
- package/src/fakes/FcmFake.ts +231 -0
- package/src/fakes/GoogleFake.ts +1346 -0
- package/src/fakes/HttpApiFake.ts +116 -0
- package/src/fakes/McpFake.ts +355 -0
- package/src/fakes/MicrosoftGraphFake.ts +1191 -0
- package/src/fakes/S3Fake.ts +376 -0
- package/src/fakes/Server.ts +445 -0
- package/src/fakes/SignInProviderFake.ts +70 -0
- package/src/fakes/SlackFake.ts +893 -0
- package/src/fakes/Store.ts +96 -0
- package/src/fakes/TelemetryFakes.ts +197 -0
- package/src/fakes/TestCa.ts +166 -0
- package/src/fakes/WorkOsFake.ts +136 -0
- package/src/index.ts +9 -0
- package/src/make/reference.ts +259 -0
- package/src/make/sources.ts +836 -0
|
@@ -0,0 +1,936 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Daemon contract (docs/contracts/daemon.md): pairing, custody of the device
|
|
3
|
+
* credential, the loopback relay's per-client authentication, local harness turns through the relay, consent
|
|
4
|
+
* on relayed calls, and the headless runner serving turns sent from the browser SDK and from a scheduled job,
|
|
5
|
+
* exactly once across a SIGKILL.
|
|
6
|
+
*
|
|
7
|
+
* It runs against a kernel serving the workshop app (`./workshop/app.ts`) and daemons the harness starts (in
|
|
8
|
+
* this process, or as their own process for the restart check) with the fake harness, which speaks Claude
|
|
9
|
+
* Code's and Codex's stream formats and calls tools through the daemon's MCP relay. The Eloxiv reference is
|
|
10
|
+
* `./DaemonReference.ts`; the kernel runs it in `packages/testing/test/daemon.test.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import { makeClient } from "@eloxiv/client"
|
|
13
|
+
import type { CommandKind, TurnView } from "@eloxiv/contracts"
|
|
14
|
+
import { devicesContract } from "@eloxiv/contracts/devices"
|
|
15
|
+
import { turnRootFor, type Daemon } from "@eloxiv/daemon"
|
|
16
|
+
import assert from "node:assert/strict"
|
|
17
|
+
import { execFileSync } from "node:child_process"
|
|
18
|
+
import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs"
|
|
19
|
+
import { join } from "node:path"
|
|
20
|
+
import { describe, it } from "vitest"
|
|
21
|
+
import type { HarnessUser } from "./MachineIdentity.ts"
|
|
22
|
+
|
|
23
|
+
export interface TestDaemon {
|
|
24
|
+
readonly url: string
|
|
25
|
+
readonly port: number
|
|
26
|
+
readonly stateDir: string
|
|
27
|
+
readonly daemon: Daemon
|
|
28
|
+
readonly close: () => Promise<void>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface RunnerProcess {
|
|
32
|
+
readonly pid: number
|
|
33
|
+
readonly port: number
|
|
34
|
+
readonly kill: (signal: NodeJS.Signals) => void
|
|
35
|
+
readonly exited: Promise<{ code: number | null; signal: NodeJS.Signals | null }>
|
|
36
|
+
readonly output: () => string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DaemonHarness {
|
|
40
|
+
/** The kernel's base URL. */
|
|
41
|
+
readonly kernelUrl: string
|
|
42
|
+
/** A signed-in member of `org` (created if missing); `admin` grants eloxiv.machine.manage. */
|
|
43
|
+
readonly member: (name: string, org: string, roles?: ReadonlyArray<string>) => Promise<HarnessUser>
|
|
44
|
+
/** Superuser queries (module tables, audit). */
|
|
45
|
+
readonly query: <A extends object>(sql: string, params?: ReadonlyArray<unknown>) => Promise<ReadonlyArray<A>>
|
|
46
|
+
/** Make every pending pairing expired (stands in for waiting ten minutes). */
|
|
47
|
+
readonly expirePairings: () => Promise<void>
|
|
48
|
+
/** A daemon in this process, with the fake harnesses and the file secret store, in a fresh state directory. */
|
|
49
|
+
readonly startDaemon: (options?: {
|
|
50
|
+
readonly mode?: "desktop" | "headless"
|
|
51
|
+
readonly stateDir?: string
|
|
52
|
+
readonly hostSecret?: string
|
|
53
|
+
/** Use the installed `claude` and `codex` CLIs instead of the fake harness. */
|
|
54
|
+
readonly realHarnesses?: boolean
|
|
55
|
+
/** The device command kinds the daemon serves (`--allow-commands`). */
|
|
56
|
+
readonly commands?: ReadonlyArray<CommandKind>
|
|
57
|
+
/** The workspace (`--workspace`): turns' default directory, and where terminal and files commands act. */
|
|
58
|
+
readonly workspace?: string
|
|
59
|
+
/** The tools-only profile (`--tools-only`). */
|
|
60
|
+
readonly toolsOnly?: boolean
|
|
61
|
+
}) => Promise<TestDaemon>
|
|
62
|
+
/** The daemon as its own process (`--headless`) over a state directory a paired daemon left. */
|
|
63
|
+
readonly spawnRunner: (stateDir: string) => Promise<RunnerProcess>
|
|
64
|
+
/** The state of a turn's durable workflow (`eloxiv.device-turn`). */
|
|
65
|
+
readonly turnWorkflow: (turnId: string) => Promise<{ readonly state: string; readonly output?: unknown }>
|
|
66
|
+
/** A fresh temporary directory, removed when the harness is disposed. */
|
|
67
|
+
readonly tempDir: () => string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const PASSWORD_HEADER = "content-type"
|
|
71
|
+
|
|
72
|
+
export const until = async <A>(probe: () => Promise<A | undefined>, what: string, timeoutMs = 20_000): Promise<A> => {
|
|
73
|
+
const deadline = Date.now() + timeoutMs
|
|
74
|
+
while (Date.now() < deadline) {
|
|
75
|
+
const value = await probe()
|
|
76
|
+
if (value !== undefined) return value
|
|
77
|
+
await new Promise((resolve) => setTimeout(resolve, 100))
|
|
78
|
+
}
|
|
79
|
+
throw new Error(`Timed out waiting for ${what}`)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const post = (url: string, body: unknown, headers: Record<string, string> = {}) =>
|
|
83
|
+
fetch(url, {
|
|
84
|
+
method: "POST",
|
|
85
|
+
headers: { [PASSWORD_HEADER]: "application/json", ...headers },
|
|
86
|
+
body: JSON.stringify(body),
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
/** A management operation of the kernel's devices, as a signed-in person. */
|
|
90
|
+
export const manage = async (kernelUrl: string, user: HarnessUser, operation: string, body: unknown) => {
|
|
91
|
+
const response = await post(`${kernelUrl}/kernel/devices/${operation}`, body, {
|
|
92
|
+
authorization: `Bearer ${user.session}`,
|
|
93
|
+
})
|
|
94
|
+
return { status: response.status, body: (await response.json()) as Record<string, any> }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Pair `daemon` with the kernel as `user` (the person confirms the code the daemon shows). */
|
|
98
|
+
export const pairDaemon = async (
|
|
99
|
+
harness: DaemonHarness,
|
|
100
|
+
daemon: TestDaemon,
|
|
101
|
+
user: HarnessUser,
|
|
102
|
+
options: { readonly kind?: "desktop" | "runner"; readonly principalId?: string } = {},
|
|
103
|
+
) => {
|
|
104
|
+
const pairing = await daemon.daemon.startKernelPairing(harness.kernelUrl, { kind: options.kind ?? "desktop" })
|
|
105
|
+
const confirmed = await manage(harness.kernelUrl, user, "confirmPairing", {
|
|
106
|
+
userCode: pairing.started.userCode,
|
|
107
|
+
...(options.principalId === undefined ? {} : { principalId: options.principalId }),
|
|
108
|
+
})
|
|
109
|
+
assert.equal(confirmed.status, 200, JSON.stringify(confirmed.body))
|
|
110
|
+
await pairing.done
|
|
111
|
+
return daemon.daemon.state.current.kernel!
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Pair a local client (a CLI) with the daemon: the code comes from the host's view, as a person would read it. */
|
|
115
|
+
export const localClient = async (daemon: TestDaemon, hostSecret: string) => {
|
|
116
|
+
const start = await post(`${daemon.url}/local/pair/start`, { clientName: "test cli", kind: "cli" })
|
|
117
|
+
const { pairingId } = (await start.json()) as { pairingId: string }
|
|
118
|
+
// The host approves the request and shows the person its code.
|
|
119
|
+
const approved = await post(
|
|
120
|
+
`${daemon.url}/local/pairings/${pairingId}/approve`,
|
|
121
|
+
{},
|
|
122
|
+
{
|
|
123
|
+
authorization: `Bearer ${hostSecret}`,
|
|
124
|
+
},
|
|
125
|
+
)
|
|
126
|
+
const { code } = (await approved.json()) as { code: string }
|
|
127
|
+
const confirmed = await post(`${daemon.url}/local/pair/confirm`, {
|
|
128
|
+
pairingId,
|
|
129
|
+
code,
|
|
130
|
+
clientName: "test cli",
|
|
131
|
+
kind: "cli",
|
|
132
|
+
})
|
|
133
|
+
return ((await confirmed.json()) as { token: string }).token
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Server-sent events of `POST /turns`, collected until the stream ends. */
|
|
137
|
+
export const localTurn = async (daemon: TestDaemon, token: string, body: unknown) => {
|
|
138
|
+
const response = await post(`${daemon.url}/turns`, body, { authorization: `Bearer ${token}` })
|
|
139
|
+
assert.equal(response.status, 200, await response.clone().text())
|
|
140
|
+
const text = await response.text()
|
|
141
|
+
const events: Array<{ event: string; data: any }> = []
|
|
142
|
+
for (const block of text.split("\n\n")) {
|
|
143
|
+
const event = /^event: (.+)$/mu.exec(block)?.[1]
|
|
144
|
+
const data = /^data: (.+)$/mu.exec(block)?.[1]
|
|
145
|
+
if (event !== undefined && data !== undefined) events.push({ event, data: JSON.parse(data) })
|
|
146
|
+
}
|
|
147
|
+
return { events, result: events.find((e) => e.event === "result")?.data as Record<string, any> }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const getTurn = async (kernelUrl: string, user: HarnessUser, id: string) => {
|
|
151
|
+
const answer = await manage(kernelUrl, user, "getTurn", { id })
|
|
152
|
+
return answer.status === 200 ? (answer.body as unknown as TurnView) : undefined
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const settledTurn = (harness: DaemonHarness, user: HarnessUser, id: string, timeoutMs = 30_000) =>
|
|
156
|
+
until(
|
|
157
|
+
async () => {
|
|
158
|
+
const view = await getTurn(harness.kernelUrl, user, id)
|
|
159
|
+
return view !== undefined && ["succeeded", "failed", "cancelled"].includes(view.turn.status) ? view : undefined
|
|
160
|
+
},
|
|
161
|
+
`turn ${id} to settle`,
|
|
162
|
+
timeoutMs,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
const notes = (harness: DaemonHarness, body: string) =>
|
|
166
|
+
harness.query<{ ownerId: string; origin: string; id: string }>(
|
|
167
|
+
`SELECT id, owner_id AS "ownerId", origin FROM workshop.note WHERE body = $1`,
|
|
168
|
+
[body],
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
export const daemonConformance = (harness: DaemonHarness) => {
|
|
172
|
+
const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
|
|
173
|
+
|
|
174
|
+
describe("Daemon: pairing and custody", () => {
|
|
175
|
+
it("pairs with a code a signed-in person confirms; the credential is issued once and kept in the secret store", async () => {
|
|
176
|
+
const user = await harness.member(unique("pairer"), "acme")
|
|
177
|
+
const daemon = await harness.startDaemon()
|
|
178
|
+
try {
|
|
179
|
+
const kernel = await pairDaemon(harness, daemon, user)
|
|
180
|
+
assert.equal(kernel.subject, user.id)
|
|
181
|
+
assert.equal(kernel.orgId, "acme")
|
|
182
|
+
// Custody: the credential is in the secret store, never in the state file, and hashed on the kernel.
|
|
183
|
+
const files = readdirSync(daemon.stateDir).filter((file) => file.endsWith(".json"))
|
|
184
|
+
const secrets = JSON.parse(readFileSync(join(daemon.stateDir, "secrets.json"), "utf8")) as Record<
|
|
185
|
+
string,
|
|
186
|
+
string
|
|
187
|
+
>
|
|
188
|
+
const credential = Object.values(secrets)[0]!
|
|
189
|
+
assert.match(credential, /^elxv_/u)
|
|
190
|
+
assert.ok(!readFileSync(join(daemon.stateDir, "state.json"), "utf8").includes(credential))
|
|
191
|
+
assert.ok(files.includes("state.json"))
|
|
192
|
+
const stored = await harness.query<{ n: number }>(
|
|
193
|
+
`SELECT count(*)::int AS n FROM eloxiv.device WHERE token_hash = encode(sha256($1::bytea), 'hex')`,
|
|
194
|
+
[credential],
|
|
195
|
+
)
|
|
196
|
+
assert.equal(stored[0]!.n, 1)
|
|
197
|
+
const leaked = await harness.query<{ n: number }>(
|
|
198
|
+
`SELECT count(*)::int AS n FROM eloxiv.device d WHERE d.token_hash = $1 OR d.name = $1`,
|
|
199
|
+
[credential],
|
|
200
|
+
)
|
|
201
|
+
assert.equal(leaked[0]!.n, 0)
|
|
202
|
+
// The device lists for its person.
|
|
203
|
+
const listed = await manage(harness.kernelUrl, user, "listDevices", {})
|
|
204
|
+
assert.ok((listed.body as unknown as Array<{ id: string }>).some((d) => d.id === kernel.deviceId))
|
|
205
|
+
} finally {
|
|
206
|
+
await daemon.close()
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it("refuses wrong, expired and reused codes, and a second claim of the credential", async () => {
|
|
211
|
+
const user = await harness.member(unique("codes"), "acme")
|
|
212
|
+
const wrong = await manage(harness.kernelUrl, user, "confirmPairing", { userCode: "BBBB-BBBB" })
|
|
213
|
+
assert.equal(wrong.status, 400)
|
|
214
|
+
assert.equal(wrong.body["_tag"], "InvalidInput")
|
|
215
|
+
|
|
216
|
+
// Expired: started, never confirmed in time.
|
|
217
|
+
const started = await post(`${harness.kernelUrl}/kernel/device/pair/start`, {
|
|
218
|
+
name: "late",
|
|
219
|
+
kind: "desktop",
|
|
220
|
+
platform: "test",
|
|
221
|
+
capabilities: { harnesses: ["claude-code"], computerUse: false, browserExtension: false },
|
|
222
|
+
})
|
|
223
|
+
const late = (await started.json()) as { userCode: string; pairingId: string; pollSecret: string }
|
|
224
|
+
await harness.expirePairings()
|
|
225
|
+
const expired = await manage(harness.kernelUrl, user, "confirmPairing", { userCode: late.userCode })
|
|
226
|
+
assert.equal(expired.status, 400)
|
|
227
|
+
assert.match(String(expired.body["message"]), /expired/u)
|
|
228
|
+
const polled = await post(`${harness.kernelUrl}/kernel/device/pair/poll`, {
|
|
229
|
+
pairingId: late.pairingId,
|
|
230
|
+
pollSecret: late.pollSecret,
|
|
231
|
+
})
|
|
232
|
+
assert.deepEqual(await polled.json(), { status: "expired" })
|
|
233
|
+
|
|
234
|
+
// Reused: a code confirmed once cannot be confirmed again, and the credential is claimed once.
|
|
235
|
+
const fresh = (await (
|
|
236
|
+
await post(`${harness.kernelUrl}/kernel/device/pair/start`, {
|
|
237
|
+
name: "once",
|
|
238
|
+
kind: "runner",
|
|
239
|
+
platform: "test",
|
|
240
|
+
capabilities: { harnesses: ["codex"], computerUse: false, browserExtension: false },
|
|
241
|
+
})
|
|
242
|
+
).json()) as { userCode: string; pairingId: string; pollSecret: string }
|
|
243
|
+
const wrongSecret = await post(`${harness.kernelUrl}/kernel/device/pair/poll`, {
|
|
244
|
+
pairingId: fresh.pairingId,
|
|
245
|
+
pollSecret: "elxp_wrong",
|
|
246
|
+
})
|
|
247
|
+
assert.equal(wrongSecret.status, 400)
|
|
248
|
+
assert.equal((await manage(harness.kernelUrl, user, "confirmPairing", { userCode: fresh.userCode })).status, 200)
|
|
249
|
+
const again = await manage(harness.kernelUrl, user, "confirmPairing", { userCode: fresh.userCode })
|
|
250
|
+
assert.equal(again.status, 400)
|
|
251
|
+
assert.match(String(again.body["message"]), /already used/u)
|
|
252
|
+
const claim = await post(`${harness.kernelUrl}/kernel/device/pair/poll`, {
|
|
253
|
+
pairingId: fresh.pairingId,
|
|
254
|
+
pollSecret: fresh.pollSecret,
|
|
255
|
+
})
|
|
256
|
+
const claimed = (await claim.json()) as { status: string; credential: string }
|
|
257
|
+
assert.equal(claimed.status, "paired")
|
|
258
|
+
// A lost answer may be claimed again once, shortly after: a new credential, and the first stops working.
|
|
259
|
+
const poll = () =>
|
|
260
|
+
post(`${harness.kernelUrl}/kernel/device/pair/poll`, {
|
|
261
|
+
pairingId: fresh.pairingId,
|
|
262
|
+
pollSecret: fresh.pollSecret,
|
|
263
|
+
})
|
|
264
|
+
const second = (await (await poll()).json()) as { status: string; credential: string }
|
|
265
|
+
assert.equal(second.status, "paired")
|
|
266
|
+
assert.notEqual(second.credential, claimed.credential)
|
|
267
|
+
const me = (credential: string) =>
|
|
268
|
+
fetch(`${harness.kernelUrl}/kernel/device/me`, { headers: { authorization: `Bearer ${credential}` } })
|
|
269
|
+
assert.equal((await me(claimed.credential)).status, 401)
|
|
270
|
+
assert.equal((await me(second.credential)).status, 200)
|
|
271
|
+
// Never a third time.
|
|
272
|
+
assert.equal((await poll()).status, 400)
|
|
273
|
+
|
|
274
|
+
// A denied pairing never pairs.
|
|
275
|
+
const denied = (await (
|
|
276
|
+
await post(`${harness.kernelUrl}/kernel/device/pair/start`, {
|
|
277
|
+
name: "denied",
|
|
278
|
+
kind: "desktop",
|
|
279
|
+
platform: "test",
|
|
280
|
+
capabilities: { harnesses: [], computerUse: false, browserExtension: false },
|
|
281
|
+
})
|
|
282
|
+
).json()) as { userCode: string; pairingId: string; pollSecret: string }
|
|
283
|
+
assert.equal((await manage(harness.kernelUrl, user, "denyPairing", { userCode: denied.userCode })).status, 200)
|
|
284
|
+
const deniedPoll = await post(`${harness.kernelUrl}/kernel/device/pair/poll`, {
|
|
285
|
+
pairingId: denied.pairingId,
|
|
286
|
+
pollSecret: denied.pollSecret,
|
|
287
|
+
})
|
|
288
|
+
assert.deepEqual(await deniedPoll.json(), { status: "denied" })
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
it("pairs a runner for a service principal only with eloxiv.machine.manage", async () => {
|
|
292
|
+
const member = await harness.member(unique("plain"), "acme")
|
|
293
|
+
const started = (await (
|
|
294
|
+
await post(`${harness.kernelUrl}/kernel/device/pair/start`, {
|
|
295
|
+
name: "sp runner",
|
|
296
|
+
kind: "runner",
|
|
297
|
+
platform: "test",
|
|
298
|
+
capabilities: { harnesses: ["codex"], computerUse: false, browserExtension: false },
|
|
299
|
+
})
|
|
300
|
+
).json()) as { userCode: string }
|
|
301
|
+
const refused = await manage(harness.kernelUrl, member, "confirmPairing", {
|
|
302
|
+
userCode: started.userCode,
|
|
303
|
+
principalId: "sp_missing",
|
|
304
|
+
})
|
|
305
|
+
assert.equal(refused.status, 403)
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
it("revoking a device cuts a running daemon off at its next request, with its relay sessions", async () => {
|
|
309
|
+
const user = await harness.member(unique("revoke"), "acme")
|
|
310
|
+
const other = await harness.member(unique("bystander"), "acme")
|
|
311
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
312
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
313
|
+
try {
|
|
314
|
+
const kernel = await pairDaemon(harness, daemon, user)
|
|
315
|
+
const body = unique("before-revoke")
|
|
316
|
+
const before = await post(
|
|
317
|
+
`${daemon.url}/relay/actions/workshop.write`,
|
|
318
|
+
{ body },
|
|
319
|
+
{
|
|
320
|
+
authorization: `Bearer ${hostSecret}`,
|
|
321
|
+
},
|
|
322
|
+
)
|
|
323
|
+
assert.equal(before.status, 200)
|
|
324
|
+
// Someone else cannot revoke it; its person can.
|
|
325
|
+
assert.equal((await manage(harness.kernelUrl, other, "revokeDevice", { id: kernel.deviceId })).status, 403)
|
|
326
|
+
const revoked = await manage(harness.kernelUrl, user, "revokeDevice", { id: kernel.deviceId })
|
|
327
|
+
assert.equal(revoked.status, 200)
|
|
328
|
+
assert.notEqual(revoked.body["revokedAt"], null)
|
|
329
|
+
const after = await post(
|
|
330
|
+
`${daemon.url}/relay/actions/workshop.write`,
|
|
331
|
+
{ body: unique("after") },
|
|
332
|
+
{
|
|
333
|
+
authorization: `Bearer ${hostSecret}`,
|
|
334
|
+
},
|
|
335
|
+
)
|
|
336
|
+
assert.equal(after.status, 401)
|
|
337
|
+
assert.equal(daemon.daemon.paired, false)
|
|
338
|
+
const status = (await (
|
|
339
|
+
await fetch(`${daemon.url}/status`, { headers: { authorization: `Bearer ${hostSecret}` } })
|
|
340
|
+
).json()) as { kernel: { state: string } }
|
|
341
|
+
assert.equal(status.kernel.state, "revoked")
|
|
342
|
+
// Its agent sessions were revoked with it.
|
|
343
|
+
const sessions = await harness.query<{ n: number }>(
|
|
344
|
+
`SELECT count(*)::int AS n FROM eloxiv.agent_session WHERE device_id = $1 AND revoked_at IS NULL`,
|
|
345
|
+
[kernel.deviceId],
|
|
346
|
+
)
|
|
347
|
+
assert.equal(sessions[0]!.n, 0)
|
|
348
|
+
} finally {
|
|
349
|
+
await daemon.close()
|
|
350
|
+
}
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
|
|
354
|
+
describe("Daemon: loopback relay", () => {
|
|
355
|
+
it("listens on loopback only and authenticates every client: token, Host and Origin", async () => {
|
|
356
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
357
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
358
|
+
try {
|
|
359
|
+
const health = await fetch(`${daemon.url}/health`)
|
|
360
|
+
assert.equal(health.status, 200)
|
|
361
|
+
// No token, an unknown token.
|
|
362
|
+
assert.equal((await fetch(`${daemon.url}/status`)).status, 401)
|
|
363
|
+
assert.equal(
|
|
364
|
+
(await fetch(`${daemon.url}/status`, { headers: { authorization: "Bearer elxl_nope" } })).status,
|
|
365
|
+
401,
|
|
366
|
+
)
|
|
367
|
+
// The host's secret.
|
|
368
|
+
assert.equal(
|
|
369
|
+
(await fetch(`${daemon.url}/status`, { headers: { authorization: `Bearer ${hostSecret}` } })).status,
|
|
370
|
+
200,
|
|
371
|
+
)
|
|
372
|
+
// A foreign Origin is refused even with a valid token.
|
|
373
|
+
const foreign = await fetch(`${daemon.url}/status`, {
|
|
374
|
+
headers: { authorization: `Bearer ${hostSecret}`, origin: "https://evil.example" },
|
|
375
|
+
})
|
|
376
|
+
assert.equal(foreign.status, 403)
|
|
377
|
+
const trusted = await fetch(`${daemon.url}/status`, {
|
|
378
|
+
headers: { authorization: `Bearer ${hostSecret}`, origin: "tauri://localhost" },
|
|
379
|
+
})
|
|
380
|
+
assert.equal(trusted.status, 200)
|
|
381
|
+
assert.equal(trusted.headers.get("access-control-allow-origin"), "tauri://localhost")
|
|
382
|
+
// A rebound DNS name (Host not loopback) is refused.
|
|
383
|
+
const rebound = await rawRequest(daemon.port, "/status", {
|
|
384
|
+
host: `evil.example:${daemon.port}`,
|
|
385
|
+
authorization: `Bearer ${hostSecret}`,
|
|
386
|
+
})
|
|
387
|
+
assert.equal(rebound, 403)
|
|
388
|
+
// A local client pairs with the code shown to the host only, once.
|
|
389
|
+
const start = await post(`${daemon.url}/local/pair/start`, {})
|
|
390
|
+
const startBody = (await start.json()) as Record<string, unknown>
|
|
391
|
+
assert.equal(startBody["code"], undefined)
|
|
392
|
+
const forbidden = await fetch(`${daemon.url}/local/pairings`)
|
|
393
|
+
assert.equal(forbidden.status, 401)
|
|
394
|
+
// A code alone is not enough: until the host approves the request, even the right code is refused.
|
|
395
|
+
const listed = (await (
|
|
396
|
+
await fetch(`${daemon.url}/local/pairings`, { headers: { authorization: `Bearer ${hostSecret}` } })
|
|
397
|
+
).json()) as ReadonlyArray<{ pairingId: string; code: string; approved: boolean }>
|
|
398
|
+
const first = listed.find((p) => p.pairingId === startBody["pairingId"])!
|
|
399
|
+
assert.equal(first.approved, false)
|
|
400
|
+
const unapproved = await post(`${daemon.url}/local/pair/confirm`, {
|
|
401
|
+
pairingId: first.pairingId,
|
|
402
|
+
code: first.code,
|
|
403
|
+
clientName: "eager",
|
|
404
|
+
})
|
|
405
|
+
assert.equal(unapproved.status, 403)
|
|
406
|
+
assert.equal(((await unapproved.json()) as { error: string }).error, "PairingNotApproved")
|
|
407
|
+
const token = await localClient(daemon, hostSecret)
|
|
408
|
+
assert.match(token, /^elxl_/u)
|
|
409
|
+
assert.equal(
|
|
410
|
+
(await fetch(`${daemon.url}/status`, { headers: { authorization: `Bearer ${token}` } })).status,
|
|
411
|
+
200,
|
|
412
|
+
)
|
|
413
|
+
// A local client cannot see other clients' pairing codes.
|
|
414
|
+
assert.equal(
|
|
415
|
+
(await fetch(`${daemon.url}/local/pairings`, { headers: { authorization: `Bearer ${token}` } })).status,
|
|
416
|
+
403,
|
|
417
|
+
)
|
|
418
|
+
// A wrong code is counted; five discard the pairing.
|
|
419
|
+
const second = (await (await post(`${daemon.url}/local/pair/start`, {})).json()) as { pairingId: string }
|
|
420
|
+
const mismatch = await post(`${daemon.url}/local/pair/confirm`, {
|
|
421
|
+
pairingId: second.pairingId,
|
|
422
|
+
code: "x",
|
|
423
|
+
clientName: "guess",
|
|
424
|
+
})
|
|
425
|
+
assert.equal(mismatch.status, 403)
|
|
426
|
+
// The client token is stored only as a hash.
|
|
427
|
+
assert.ok(!readFileSync(join(daemon.stateDir, "state.json"), "utf8").includes(token))
|
|
428
|
+
} finally {
|
|
429
|
+
await daemon.close()
|
|
430
|
+
}
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
it("relays a local client's call as the person; no response to a local client carries a kernel credential", async () => {
|
|
434
|
+
const user = await harness.member(unique("relay"), "acme")
|
|
435
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
436
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
437
|
+
try {
|
|
438
|
+
await pairDaemon(harness, daemon, user)
|
|
439
|
+
const token = await localClient(daemon, hostSecret)
|
|
440
|
+
const body = unique("relayed")
|
|
441
|
+
const relayed = await post(
|
|
442
|
+
`${daemon.url}/relay/actions/workshop.write`,
|
|
443
|
+
{ body },
|
|
444
|
+
{ authorization: `Bearer ${token}` },
|
|
445
|
+
)
|
|
446
|
+
const text = await relayed.text()
|
|
447
|
+
assert.equal(relayed.status, 200, text)
|
|
448
|
+
assert.equal(JSON.parse(text).kind, "output")
|
|
449
|
+
const rows = await notes(harness, body)
|
|
450
|
+
assert.deepEqual(
|
|
451
|
+
rows.map((r) => [r.ownerId, r.origin]),
|
|
452
|
+
[[user.id, "person"]],
|
|
453
|
+
)
|
|
454
|
+
const secrets = JSON.parse(readFileSync(join(daemon.stateDir, "secrets.json"), "utf8")) as Record<
|
|
455
|
+
string,
|
|
456
|
+
string
|
|
457
|
+
>
|
|
458
|
+
const credential = Object.values(secrets)[0]!
|
|
459
|
+
const responses = [
|
|
460
|
+
text,
|
|
461
|
+
await (await fetch(`${daemon.url}/status`, { headers: { authorization: `Bearer ${token}` } })).text(),
|
|
462
|
+
await (await fetch(`${daemon.url}/sessions`, { headers: { authorization: `Bearer ${token}` } })).text(),
|
|
463
|
+
await (await fetch(`${daemon.url}/health`)).text(),
|
|
464
|
+
await (
|
|
465
|
+
await post(
|
|
466
|
+
`${daemon.url}/relay/actions/workshop.discard`,
|
|
467
|
+
{ id: "missing" },
|
|
468
|
+
{
|
|
469
|
+
authorization: `Bearer ${token}`,
|
|
470
|
+
},
|
|
471
|
+
)
|
|
472
|
+
).text(),
|
|
473
|
+
]
|
|
474
|
+
for (const response of responses) {
|
|
475
|
+
assert.ok(!response.includes(credential), "a response carried the device credential")
|
|
476
|
+
assert.ok(!response.includes("elxv_"), "a response carried a device credential")
|
|
477
|
+
assert.ok(!response.includes("eloxiv_agent."), "a response carried an agent session")
|
|
478
|
+
}
|
|
479
|
+
} finally {
|
|
480
|
+
await daemon.close()
|
|
481
|
+
}
|
|
482
|
+
})
|
|
483
|
+
|
|
484
|
+
it("a fake-harness turn calls an Eloxiv action through the relay as the person's agent (both stream formats)", async () => {
|
|
485
|
+
const user = await harness.member(unique("agent"), "acme")
|
|
486
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
487
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
488
|
+
try {
|
|
489
|
+
await pairDaemon(harness, daemon, user)
|
|
490
|
+
for (const kind of ["claude-code", "codex"] as const) {
|
|
491
|
+
const body = unique(`by-${kind}`)
|
|
492
|
+
const turn = await localTurn(daemon, hostSecret, {
|
|
493
|
+
harness: kind,
|
|
494
|
+
prompt: `CALL workshop_write {"body":"${body}"}\nSAY wrote ${body}`,
|
|
495
|
+
})
|
|
496
|
+
assert.equal(turn.result["outcome"], "succeeded", JSON.stringify(turn.result))
|
|
497
|
+
assert.equal(turn.result["result"], `wrote ${body}`)
|
|
498
|
+
assert.ok(turn.result["usage"]["outputTokens"] > 0)
|
|
499
|
+
const kinds = turn.events.filter((e) => e.event === "harness").map((e) => e.data.type)
|
|
500
|
+
assert.deepEqual(
|
|
501
|
+
kinds.filter((k) => k !== "usage"),
|
|
502
|
+
["started", "tool-call", "tool-result", "text", "finished"],
|
|
503
|
+
)
|
|
504
|
+
const rows = await notes(harness, body)
|
|
505
|
+
assert.deepEqual(
|
|
506
|
+
rows.map((r) => [r.ownerId, r.origin]),
|
|
507
|
+
[[user.id, "agent"]],
|
|
508
|
+
)
|
|
509
|
+
// The audit shows the person, on the agent's surface (MCP: agent-originated).
|
|
510
|
+
const audits = await harness.query<{ surface: string; actor: string; outcome: string }>(
|
|
511
|
+
`SELECT surface, actor_user_id AS actor, outcome FROM eloxiv.audit_log
|
|
512
|
+
WHERE action = 'workshop.write' AND actor_user_id = $1 ORDER BY at DESC LIMIT 1`,
|
|
513
|
+
[user.id],
|
|
514
|
+
)
|
|
515
|
+
assert.deepEqual(audits[0], { surface: "mcp", actor: user.id, outcome: "succeeded" })
|
|
516
|
+
}
|
|
517
|
+
} finally {
|
|
518
|
+
await daemon.close()
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
|
|
522
|
+
it("an ACP agent runs a turn without workspace tools only when declared tools-only (never OpenCode), and follows up its session", async () => {
|
|
523
|
+
const user = await harness.member(unique("acp"), "acme")
|
|
524
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
525
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
526
|
+
try {
|
|
527
|
+
await pairDaemon(harness, daemon, user)
|
|
528
|
+
// OpenCode runs code its working directory configures (plugins) before any permission request: it is never
|
|
529
|
+
// limited to the Eloxiv tools, so a turn without workspace tools fails without starting it.
|
|
530
|
+
const refused = await localTurn(daemon, hostSecret, { harness: "opencode", prompt: "SAY hi" })
|
|
531
|
+
assert.equal(refused.result["outcome"], "failed")
|
|
532
|
+
assert.match(String(refused.result["error"]), /cannot be limited to the Eloxiv tools/u)
|
|
533
|
+
assert.ok(!refused.events.some((e) => e.event === "harness" && e.data.type === "started"))
|
|
534
|
+
// A configured agent the person declared tools-only: Eloxiv tools only, its built-in tool refused.
|
|
535
|
+
const body = unique("by-acp")
|
|
536
|
+
const turn = await localTurn(daemon, hostSecret, {
|
|
537
|
+
harness: "acp",
|
|
538
|
+
prompt: `CALL workshop_write {"body":"${body}"}\nBUILTIN bash`,
|
|
539
|
+
resumable: true,
|
|
540
|
+
})
|
|
541
|
+
assert.equal(turn.result["outcome"], "succeeded", JSON.stringify(turn.result))
|
|
542
|
+
assert.deepEqual(
|
|
543
|
+
(await notes(harness, body)).map((r) => [r.ownerId, r.origin]),
|
|
544
|
+
[[user.id, "agent"]],
|
|
545
|
+
)
|
|
546
|
+
assert.equal(turn.result["result"], "bash refused")
|
|
547
|
+
const kinds = turn.events.filter((e) => e.event === "harness").map((e) => e.data.type)
|
|
548
|
+
assert.deepEqual(kinds.slice(0, 3), ["started", "tool-call", "tool-result"])
|
|
549
|
+
assert.ok(
|
|
550
|
+
!JSON.stringify(turn.events).includes("secret file contents"),
|
|
551
|
+
"a built-in tool's output was forwarded",
|
|
552
|
+
)
|
|
553
|
+
// A follow-up loads the session (its replayed history is not this turn's).
|
|
554
|
+
const next = await localTurn(daemon, hostSecret, {
|
|
555
|
+
harness: "acp",
|
|
556
|
+
prompt: "RECALL",
|
|
557
|
+
resume: turn.result["sessionId"],
|
|
558
|
+
})
|
|
559
|
+
assert.equal(next.result["result"], "recalled bash refused")
|
|
560
|
+
// With workspace tools, OpenCode runs, its own tools allowed.
|
|
561
|
+
const workspace = await localTurn(daemon, hostSecret, {
|
|
562
|
+
harness: "opencode",
|
|
563
|
+
prompt: "BUILTIN bash\nPERMISSIONS",
|
|
564
|
+
workspaceTools: true,
|
|
565
|
+
})
|
|
566
|
+
assert.equal(workspace.result["outcome"], "succeeded", JSON.stringify(workspace.result))
|
|
567
|
+
assert.equal(workspace.result["result"], `bash allowed\n${JSON.stringify({ permission: { "*": "allow" } })}`)
|
|
568
|
+
} finally {
|
|
569
|
+
await daemon.close()
|
|
570
|
+
}
|
|
571
|
+
})
|
|
572
|
+
|
|
573
|
+
it("consent holds a destructive relayed call until the person decides", async () => {
|
|
574
|
+
const user = await harness.member(unique("consent"), "acme")
|
|
575
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
576
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
577
|
+
try {
|
|
578
|
+
await pairDaemon(harness, daemon, user)
|
|
579
|
+
const body = unique("keep")
|
|
580
|
+
const created = await post(
|
|
581
|
+
`${daemon.url}/relay/actions/workshop.write`,
|
|
582
|
+
{ body },
|
|
583
|
+
{
|
|
584
|
+
authorization: `Bearer ${hostSecret}`,
|
|
585
|
+
},
|
|
586
|
+
)
|
|
587
|
+
const id = ((await created.json()) as { output: { id: string } }).output.id
|
|
588
|
+
const turn = await localTurn(daemon, hostSecret, {
|
|
589
|
+
harness: "claude-code",
|
|
590
|
+
prompt: `CALL workshop_discard {"id":"${id}"}\nSAY tried`,
|
|
591
|
+
})
|
|
592
|
+
const result = turn.events.find((e) => e.event === "harness" && e.data.type === "tool-result")!.data.data
|
|
593
|
+
assert.equal(result.isError, true)
|
|
594
|
+
assert.match(String(result.output), /ConsentRequired|consent/iu)
|
|
595
|
+
assert.equal((await notes(harness, body)).length, 1)
|
|
596
|
+
const held = await harness.query<{ status: string; action: string }>(
|
|
597
|
+
`SELECT status, action FROM eloxiv_consent.request WHERE user_id = $1`,
|
|
598
|
+
[user.id],
|
|
599
|
+
)
|
|
600
|
+
assert.deepEqual(held, [{ status: "pending", action: "workshop.discard" }])
|
|
601
|
+
// The person's own relayed call (the device credential: person-originated) is not held.
|
|
602
|
+
const own = await post(
|
|
603
|
+
`${daemon.url}/relay/actions/workshop.discard`,
|
|
604
|
+
{ id },
|
|
605
|
+
{
|
|
606
|
+
authorization: `Bearer ${hostSecret}`,
|
|
607
|
+
},
|
|
608
|
+
)
|
|
609
|
+
assert.equal(own.status, 200)
|
|
610
|
+
assert.equal((await notes(harness, body)).length, 0)
|
|
611
|
+
} finally {
|
|
612
|
+
await daemon.close()
|
|
613
|
+
}
|
|
614
|
+
})
|
|
615
|
+
})
|
|
616
|
+
|
|
617
|
+
describe("Daemon: headless runner", () => {
|
|
618
|
+
it("serves a turn sent by a browser-side SDK call; only the device's person may address it", async () => {
|
|
619
|
+
const user = await harness.member(unique("browser"), "acme")
|
|
620
|
+
const other = await harness.member(unique("stranger"), "acme")
|
|
621
|
+
const daemon = await harness.startDaemon({ mode: "headless" })
|
|
622
|
+
try {
|
|
623
|
+
const kernel = await pairDaemon(harness, daemon, user, { kind: "runner" })
|
|
624
|
+
daemon.daemon.startRunner()
|
|
625
|
+
const client = makeClient({ baseUrl: harness.kernelUrl, modules: [devicesContract], token: () => user.session })
|
|
626
|
+
const stranger = makeClient({
|
|
627
|
+
baseUrl: harness.kernelUrl,
|
|
628
|
+
modules: [devicesContract],
|
|
629
|
+
token: () => other.session,
|
|
630
|
+
})
|
|
631
|
+
try {
|
|
632
|
+
await assert.rejects(
|
|
633
|
+
stranger.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "SAY no" }),
|
|
634
|
+
(error: { _tag?: string }) => error._tag === "Forbidden",
|
|
635
|
+
)
|
|
636
|
+
const body = unique("from-browser")
|
|
637
|
+
const sent = await client.call("devices.sendTurn", {
|
|
638
|
+
deviceId: kernel.deviceId,
|
|
639
|
+
prompt: `CALL workshop_write {"body":"${body}"}\nSAY done ${body}`,
|
|
640
|
+
harness: "codex",
|
|
641
|
+
})
|
|
642
|
+
assert.equal(sent.kind, "output")
|
|
643
|
+
const turnId = sent.kind === "output" ? sent.output.turnId : ""
|
|
644
|
+
const view = await settledTurn(harness, user, turnId)
|
|
645
|
+
assert.equal(view.turn.status, "succeeded")
|
|
646
|
+
assert.equal(view.turn.result, `done ${body}`)
|
|
647
|
+
assert.equal(view.turn.source, "person")
|
|
648
|
+
assert.ok(view.turn.usage !== null && view.turn.usage.outputTokens > 0)
|
|
649
|
+
assert.ok(view.events.some((e) => e.type === "tool-call"))
|
|
650
|
+
assert.deepEqual(
|
|
651
|
+
(await notes(harness, body)).map((r) => r.origin),
|
|
652
|
+
["agent"],
|
|
653
|
+
)
|
|
654
|
+
const workflow = await until(async () => {
|
|
655
|
+
const status = await harness.turnWorkflow(turnId)
|
|
656
|
+
return status.state === "succeeded" ? status : undefined
|
|
657
|
+
}, "the turn's workflow to finish")
|
|
658
|
+
assert.equal((workflow.output as { status: string }).status, "succeeded")
|
|
659
|
+
// The stranger cannot read it either.
|
|
660
|
+
assert.equal(await getTurn(harness.kernelUrl, other, turnId), undefined)
|
|
661
|
+
} finally {
|
|
662
|
+
await client.dispose()
|
|
663
|
+
await stranger.dispose()
|
|
664
|
+
}
|
|
665
|
+
} finally {
|
|
666
|
+
await daemon.daemon.stopRunner()
|
|
667
|
+
await daemon.close()
|
|
668
|
+
}
|
|
669
|
+
})
|
|
670
|
+
|
|
671
|
+
it("serves a turn sent by a scheduled job", async () => {
|
|
672
|
+
const user = await harness.member(unique("scheduled"), "acme")
|
|
673
|
+
const daemon = await harness.startDaemon({ mode: "headless" })
|
|
674
|
+
try {
|
|
675
|
+
const kernel = await pairDaemon(harness, daemon, user, { kind: "runner" })
|
|
676
|
+
daemon.daemon.startRunner()
|
|
677
|
+
const body = unique("from-job")
|
|
678
|
+
const client = makeClient({ baseUrl: harness.kernelUrl, modules: [], token: () => user.session })
|
|
679
|
+
const created = await post(
|
|
680
|
+
`${harness.kernelUrl}/api/actions/scheduler.create`,
|
|
681
|
+
{
|
|
682
|
+
name: "nightly turn",
|
|
683
|
+
schedule: { kind: "interval", everyMs: 2000 },
|
|
684
|
+
target: {
|
|
685
|
+
kind: "action",
|
|
686
|
+
action: "devices.sendTurn",
|
|
687
|
+
input: { deviceId: kernel.deviceId, prompt: `CALL workshop_write {"body":"${body}"}\nSAY job ${body}` },
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
{ authorization: `Bearer ${user.session}` },
|
|
691
|
+
)
|
|
692
|
+
await client.dispose()
|
|
693
|
+
assert.equal(created.status, 200, await created.clone().text())
|
|
694
|
+
const scheduleId = ((await created.json()) as { output: { id: string } }).output.id
|
|
695
|
+
const turn = await until(
|
|
696
|
+
async () => {
|
|
697
|
+
const rows = await harness.query<{ id: string; source: string }>(
|
|
698
|
+
`SELECT id, source FROM eloxiv_devices.turn WHERE device_id = $1 ORDER BY created_at LIMIT 1`,
|
|
699
|
+
[kernel.deviceId],
|
|
700
|
+
)
|
|
701
|
+
return rows[0]
|
|
702
|
+
},
|
|
703
|
+
"the scheduled run to send a turn",
|
|
704
|
+
30_000,
|
|
705
|
+
)
|
|
706
|
+
assert.equal(turn.source, "system")
|
|
707
|
+
await post(
|
|
708
|
+
`${harness.kernelUrl}/api/actions/scheduler.delete`,
|
|
709
|
+
{ id: scheduleId },
|
|
710
|
+
{
|
|
711
|
+
authorization: `Bearer ${user.session}`,
|
|
712
|
+
},
|
|
713
|
+
)
|
|
714
|
+
const view = await settledTurn(harness, user, turn.id)
|
|
715
|
+
assert.equal(view.turn.status, "succeeded")
|
|
716
|
+
assert.equal(view.turn.result, `job ${body}`)
|
|
717
|
+
assert.equal(view.turn.requestedBy, user.id)
|
|
718
|
+
const written = await notes(harness, body)
|
|
719
|
+
assert.ok(written.length >= 1 && written.every((r) => r.ownerId === user.id && r.origin === "agent"))
|
|
720
|
+
} finally {
|
|
721
|
+
await daemon.daemon.stopRunner()
|
|
722
|
+
await daemon.close()
|
|
723
|
+
}
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
it("two follow-ups of one turn never fork its session: one runs, the other is told to follow up the latest", async () => {
|
|
727
|
+
const user = await harness.member(unique("fork"), "acme")
|
|
728
|
+
const daemon = await harness.startDaemon({ mode: "headless" })
|
|
729
|
+
const client = makeClient({ baseUrl: harness.kernelUrl, modules: [devicesContract], token: () => user.session })
|
|
730
|
+
try {
|
|
731
|
+
const kernel = await pairDaemon(harness, daemon, user, { kind: "runner" })
|
|
732
|
+
daemon.daemon.startRunner()
|
|
733
|
+
const tag = unique("fork")
|
|
734
|
+
const first = await client.call("devices.sendTurn", {
|
|
735
|
+
deviceId: kernel.deviceId,
|
|
736
|
+
prompt: `SAY first ${tag}`,
|
|
737
|
+
harness: "codex",
|
|
738
|
+
resumable: true,
|
|
739
|
+
})
|
|
740
|
+
assert.equal(first.kind, "output")
|
|
741
|
+
const firstId = first.kind === "output" ? (first.output as { turnId: string }).turnId : ""
|
|
742
|
+
assert.equal((await settledTurn(harness, user, firstId)).turn.status, "succeeded")
|
|
743
|
+
// Two follow-ups of the same turn at once: exactly one is accepted.
|
|
744
|
+
const both = await Promise.allSettled(
|
|
745
|
+
[1, 2].map(() =>
|
|
746
|
+
client.call("devices.sendTurn", {
|
|
747
|
+
deviceId: kernel.deviceId,
|
|
748
|
+
prompt: "RECALL",
|
|
749
|
+
followUp: firstId,
|
|
750
|
+
}),
|
|
751
|
+
),
|
|
752
|
+
)
|
|
753
|
+
const accepted = both.filter((r) => r.status === "fulfilled")
|
|
754
|
+
const refused = both.filter((r): r is PromiseRejectedResult => r.status === "rejected")
|
|
755
|
+
assert.equal(accepted.length, 1, JSON.stringify(both))
|
|
756
|
+
assert.equal(refused.length, 1)
|
|
757
|
+
assert.equal(refused[0]!.reason._tag, "InvalidInput")
|
|
758
|
+
const winner = (accepted[0] as PromiseFulfilledResult<{ kind: string; output: { turnId: string } }>).value
|
|
759
|
+
.output.turnId
|
|
760
|
+
assert.match(String(refused[0]!.reason.message), new RegExp(`already followed up by turn ${winner}`, "u"))
|
|
761
|
+
// The accepted one continues the session; the session goes on from it, not from the turn it followed.
|
|
762
|
+
assert.equal((await settledTurn(harness, user, winner)).turn.result, `recalled first ${tag}`)
|
|
763
|
+
await assert.rejects(
|
|
764
|
+
client.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "RECALL", followUp: firstId }),
|
|
765
|
+
(error: { _tag?: string }) => error._tag === "InvalidInput",
|
|
766
|
+
)
|
|
767
|
+
const third = await client.call("devices.sendTurn", {
|
|
768
|
+
deviceId: kernel.deviceId,
|
|
769
|
+
prompt: "RECALL",
|
|
770
|
+
followUp: winner,
|
|
771
|
+
})
|
|
772
|
+
const thirdId = third.kind === "output" ? (third.output as { turnId: string }).turnId : ""
|
|
773
|
+
assert.equal((await settledTurn(harness, user, thirdId)).turn.result, `recalled recalled first ${tag}`)
|
|
774
|
+
} finally {
|
|
775
|
+
await daemon.daemon.stopRunner()
|
|
776
|
+
await daemon.close()
|
|
777
|
+
}
|
|
778
|
+
})
|
|
779
|
+
|
|
780
|
+
it("a follow-up turn resumes the harness session its resumable turn kept; only that session, only for its person", async () => {
|
|
781
|
+
const user = await harness.member(unique("follow"), "acme")
|
|
782
|
+
const other = await harness.member(unique("nosy"), "acme")
|
|
783
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
784
|
+
const daemon = await harness.startDaemon({ mode: "headless", hostSecret })
|
|
785
|
+
const client = makeClient({ baseUrl: harness.kernelUrl, modules: [devicesContract], token: () => user.session })
|
|
786
|
+
const stranger = makeClient({
|
|
787
|
+
baseUrl: harness.kernelUrl,
|
|
788
|
+
modules: [devicesContract],
|
|
789
|
+
token: () => other.session,
|
|
790
|
+
})
|
|
791
|
+
try {
|
|
792
|
+
const kernel = await pairDaemon(harness, daemon, user, { kind: "runner" })
|
|
793
|
+
daemon.daemon.startRunner()
|
|
794
|
+
const send = async (input: Record<string, unknown>) => {
|
|
795
|
+
const sent = await client.call("devices.sendTurn", { deviceId: kernel.deviceId, ...input } as never)
|
|
796
|
+
assert.equal(sent.kind, "output", JSON.stringify(sent))
|
|
797
|
+
return sent.kind === "output" ? (sent.output as { turnId: string }).turnId : ""
|
|
798
|
+
}
|
|
799
|
+
for (const kind of ["claude-code", "codex"] as const) {
|
|
800
|
+
const tag = unique(kind)
|
|
801
|
+
const first = await send({ prompt: `SAY first ${tag}`, harness: kind, resumable: true })
|
|
802
|
+
assert.equal((await settledTurn(harness, user, first)).turn.status, "succeeded")
|
|
803
|
+
const next = await send({ prompt: "RECALL", followUp: first })
|
|
804
|
+
const view = await settledTurn(harness, user, next)
|
|
805
|
+
assert.equal(view.turn.status, "succeeded", view.turn.error ?? "")
|
|
806
|
+
assert.equal(view.turn.result, `recalled first ${tag}`)
|
|
807
|
+
assert.equal(view.turn.harness, kind)
|
|
808
|
+
assert.equal(view.turn.followUpOf, first)
|
|
809
|
+
// A follow-up of the follow-up continues the same conversation.
|
|
810
|
+
const third = await send({ prompt: "RECALL", followUp: next })
|
|
811
|
+
assert.equal((await settledTurn(harness, user, third)).turn.result, `recalled recalled first ${tag}`)
|
|
812
|
+
}
|
|
813
|
+
// A turn that kept no session cannot be followed up, and nobody else may follow one up.
|
|
814
|
+
const plain = await send({ prompt: "SAY plain" })
|
|
815
|
+
await settledTurn(harness, user, plain)
|
|
816
|
+
await assert.rejects(
|
|
817
|
+
client.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "RECALL", followUp: plain }),
|
|
818
|
+
(error: { _tag?: string }) => error._tag === "InvalidInput",
|
|
819
|
+
)
|
|
820
|
+
await assert.rejects(
|
|
821
|
+
stranger.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "RECALL", followUp: plain }),
|
|
822
|
+
(error: { _tag?: string }) => error._tag === "Forbidden",
|
|
823
|
+
)
|
|
824
|
+
// The daemon resumes only a session it kept: any other fails without starting the harness.
|
|
825
|
+
const unknown = await localTurn(daemon, hostSecret, {
|
|
826
|
+
harness: "codex",
|
|
827
|
+
prompt: "RECALL",
|
|
828
|
+
resume: crypto.randomUUID(),
|
|
829
|
+
})
|
|
830
|
+
assert.equal(unknown.result["outcome"], "failed")
|
|
831
|
+
assert.match(String(unknown.result["error"]), /keeps no codex session/u)
|
|
832
|
+
assert.ok(!unknown.events.some((e) => e.event === "harness"))
|
|
833
|
+
} finally {
|
|
834
|
+
await client.dispose()
|
|
835
|
+
await stranger.dispose()
|
|
836
|
+
await daemon.daemon.stopRunner()
|
|
837
|
+
await daemon.close()
|
|
838
|
+
}
|
|
839
|
+
})
|
|
840
|
+
|
|
841
|
+
it("a runner SIGKILLed mid-turn and restarted completes the turn exactly once", async () => {
|
|
842
|
+
const user = await harness.member(unique("restart"), "acme")
|
|
843
|
+
const daemon = await harness.startDaemon({ mode: "headless" })
|
|
844
|
+
const kernel = await pairDaemon(harness, daemon, user, { kind: "runner" })
|
|
845
|
+
await daemon.close()
|
|
846
|
+
const dir = harness.tempDir()
|
|
847
|
+
const called = join(dir, "called")
|
|
848
|
+
const release = join(dir, "release")
|
|
849
|
+
const body = unique("exactly-once")
|
|
850
|
+
const client = makeClient({ baseUrl: harness.kernelUrl, modules: [devicesContract], token: () => user.session })
|
|
851
|
+
let runner = await harness.spawnRunner(daemon.stateDir)
|
|
852
|
+
try {
|
|
853
|
+
const sent = await client.call("devices.sendTurn", {
|
|
854
|
+
deviceId: kernel.deviceId,
|
|
855
|
+
prompt: `CALL workshop_write {"body":"${body}"}\nMARK ${called}\nWAITFILE ${release}\nSAY finished ${body}`,
|
|
856
|
+
})
|
|
857
|
+
const turnId = sent.kind === "output" ? sent.output.turnId : ""
|
|
858
|
+
// The tool call has committed; the harness waits. Kill the runner (and with it the harness).
|
|
859
|
+
await until(async () => (existsSync(called) ? true : undefined), "the first attempt's tool call", 30_000)
|
|
860
|
+
runner.kill("SIGKILL")
|
|
861
|
+
await runner.exited
|
|
862
|
+
// The first attempt's harness (its prompt names the body) does not outlive its daemon.
|
|
863
|
+
await until(
|
|
864
|
+
async () => (processesNamed(body) === "" ? true : undefined),
|
|
865
|
+
"the orphaned harness to exit",
|
|
866
|
+
10_000,
|
|
867
|
+
)
|
|
868
|
+
const mid = await harness.query<{ status: string; attempt: number }>(
|
|
869
|
+
`SELECT status, attempt FROM eloxiv_devices.turn WHERE id = $1`,
|
|
870
|
+
[turnId],
|
|
871
|
+
)
|
|
872
|
+
assert.deepEqual(mid[0], { status: "running", attempt: 1 })
|
|
873
|
+
writeFileSync(release, "")
|
|
874
|
+
runner = await harness.spawnRunner(daemon.stateDir)
|
|
875
|
+
const view = await settledTurn(harness, user, turnId, 40_000)
|
|
876
|
+
assert.equal(view.turn.status, "succeeded")
|
|
877
|
+
assert.equal(view.turn.attempt, 2)
|
|
878
|
+
// Neither attempt's working directory is left: the killed one's went when the runner restarted.
|
|
879
|
+
await until(
|
|
880
|
+
async () => {
|
|
881
|
+
const root = turnRootFor(daemon.stateDir)
|
|
882
|
+
return !existsSync(root) || readdirSync(root).length === 0 ? true : undefined
|
|
883
|
+
},
|
|
884
|
+
"the turns' working directories to be removed",
|
|
885
|
+
10_000,
|
|
886
|
+
)
|
|
887
|
+
assert.equal(view.turn.result, `finished ${body}`)
|
|
888
|
+
// One side effect: the second attempt's identical call replayed under the turn's idempotency key.
|
|
889
|
+
assert.equal((await notes(harness, body)).length, 1)
|
|
890
|
+
const audits = await harness.query<{ n: number }>(
|
|
891
|
+
`SELECT count(*)::int AS n FROM eloxiv.audit_log WHERE action = 'workshop.write' AND actor_user_id = $1
|
|
892
|
+
AND idempotency_key LIKE $2`,
|
|
893
|
+
[user.id, `device-turn:${turnId}:%`],
|
|
894
|
+
)
|
|
895
|
+
assert.equal(audits[0]!.n, 2)
|
|
896
|
+
// Settled once: one settlement event, and the workflow's outcome.
|
|
897
|
+
const settled = await harness.query<{ n: number }>(
|
|
898
|
+
`SELECT count(*)::int AS n FROM eloxiv.outbox WHERE type = 'devices.turnSettled' AND payload->>'id' = $1`,
|
|
899
|
+
[turnId],
|
|
900
|
+
)
|
|
901
|
+
assert.equal(settled[0]!.n, 1)
|
|
902
|
+
const workflow = await until(async () => {
|
|
903
|
+
const status = await harness.turnWorkflow(turnId)
|
|
904
|
+
return status.state === "succeeded" ? status : undefined
|
|
905
|
+
}, "the turn's workflow to finish")
|
|
906
|
+
assert.deepEqual(workflow.output, { status: "succeeded", attempt: 2, result: `finished ${body}`, error: null })
|
|
907
|
+
} finally {
|
|
908
|
+
runner.kill("SIGTERM")
|
|
909
|
+
await runner.exited
|
|
910
|
+
await client.dispose()
|
|
911
|
+
}
|
|
912
|
+
})
|
|
913
|
+
})
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/** Processes whose command line contains `marker` (pgrep), or "" when none is left. */
|
|
917
|
+
const processesNamed = (marker: string) => {
|
|
918
|
+
try {
|
|
919
|
+
return execFileSync("pgrep", ["-f", marker], { encoding: "utf8" }).trim()
|
|
920
|
+
} catch {
|
|
921
|
+
return ""
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/** A request with a chosen Host header (fetch does not let callers set it). */
|
|
926
|
+
const rawRequest = async (port: number, path: string, headers: Record<string, string>) => {
|
|
927
|
+
const { request } = await import("node:http")
|
|
928
|
+
return new Promise<number>((resolve, reject) => {
|
|
929
|
+
const req = request({ host: "127.0.0.1", port, path, method: "GET", headers }, (res) => {
|
|
930
|
+
res.resume()
|
|
931
|
+
resolve(res.statusCode ?? 0)
|
|
932
|
+
})
|
|
933
|
+
req.on("error", reject)
|
|
934
|
+
req.end()
|
|
935
|
+
})
|
|
936
|
+
}
|