@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,700 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the DeviceControl contract (docs/contracts/device-control.md): paired devices listed to
|
|
3
|
+
* their person and the organisation's administrators only, revocation by the person or an administrator, the
|
|
4
|
+
* sessions a device reports (local clients, harness turns, companions), device commands (the terminal and files
|
|
5
|
+
* in the workspace, browser and computer operations through companions) with consent, per-device enablement and
|
|
6
|
+
* the organisation's switches, what a device offers, push registrations and the tools-only profile. It shares the
|
|
7
|
+
* Daemon kit's harness (`./Daemon.ts`).
|
|
8
|
+
*/
|
|
9
|
+
import { makeClient } from "@eloxiv/client"
|
|
10
|
+
import type { CommandKind } from "@eloxiv/contracts"
|
|
11
|
+
import { devicesContract } from "@eloxiv/contracts/devices"
|
|
12
|
+
import assert from "node:assert/strict"
|
|
13
|
+
import { existsSync, readFileSync, realpathSync, symlinkSync, writeFileSync } from "node:fs"
|
|
14
|
+
import { join } from "node:path"
|
|
15
|
+
import { describe, it } from "vitest"
|
|
16
|
+
import { localClient, localTurn, manage, pairDaemon, until, type DaemonHarness, type TestDaemon } from "./Daemon.ts"
|
|
17
|
+
import type { HarnessUser } from "./MachineIdentity.ts"
|
|
18
|
+
|
|
19
|
+
const post = (url: string, body: unknown, headers: Record<string, string> = {}) =>
|
|
20
|
+
fetch(url, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers: { "content-type": "application/json", ...headers },
|
|
23
|
+
body: JSON.stringify(body),
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
/** Pair a local client of `kind` with the daemon (the host approves it and shows the code). */
|
|
27
|
+
const pairLocal = async (daemon: TestDaemon, hostSecret: string, kind: string, clientName = `test ${kind}`) => {
|
|
28
|
+
const { pairingId } = (await (await post(`${daemon.url}/local/pair/start`, { clientName, kind })).json()) as {
|
|
29
|
+
pairingId: string
|
|
30
|
+
}
|
|
31
|
+
const approved = await post(
|
|
32
|
+
`${daemon.url}/local/pairings/${pairingId}/approve`,
|
|
33
|
+
{},
|
|
34
|
+
{
|
|
35
|
+
authorization: `Bearer ${hostSecret}`,
|
|
36
|
+
},
|
|
37
|
+
)
|
|
38
|
+
const { code } = (await approved.json()) as { code: string }
|
|
39
|
+
const confirmed = await post(`${daemon.url}/local/pair/confirm`, { pairingId, code, clientName, kind })
|
|
40
|
+
return ((await confirmed.json()) as { token: string }).token
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The devices actions as `user`, through the typed client. */
|
|
44
|
+
const devicesClient = (harness: DaemonHarness, user: HarnessUser) =>
|
|
45
|
+
makeClient({ baseUrl: harness.kernelUrl, modules: [devicesContract], token: () => user.session })
|
|
46
|
+
|
|
47
|
+
type DevicesClient = ReturnType<typeof devicesClient>
|
|
48
|
+
|
|
49
|
+
/** The output of an action call that must succeed. */
|
|
50
|
+
const output = <R extends { readonly kind: string }>(
|
|
51
|
+
result: R,
|
|
52
|
+
): Extract<R, { kind: "output" }> extends { output: infer O } ? O : never => {
|
|
53
|
+
assert.equal(result.kind, "output", JSON.stringify(result))
|
|
54
|
+
return (result as unknown as { output: never }).output
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Wait until the device lists `kinds` among the command kinds it offers (its capabilities reached the kernel). */
|
|
58
|
+
const offering = (client: DevicesClient, deviceId: string, kinds: ReadonlyArray<CommandKind>) =>
|
|
59
|
+
until(
|
|
60
|
+
async () => {
|
|
61
|
+
const { devices } = output(await client.call("devices.listDevices", {}))
|
|
62
|
+
const commands = devices.find((device) => device.id === deviceId)?.commands ?? []
|
|
63
|
+
return kinds.every((kind) => commands.includes(kind)) ? commands : undefined
|
|
64
|
+
},
|
|
65
|
+
`the device to offer ${kinds.join(", ")}`,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
/** Send a command and wait until it is no longer queued or running. */
|
|
69
|
+
const command = async (client: DevicesClient, deviceId: string, operation: string, input: unknown) => {
|
|
70
|
+
const { commandId } = output(await client.call("devices.sendCommand", { deviceId, operation, input } as never))
|
|
71
|
+
return settledCommand(client, commandId)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const settledCommand = (client: DevicesClient, id: string) =>
|
|
75
|
+
until(async () => {
|
|
76
|
+
const record = output(await client.call("devices.getCommand", { id }))
|
|
77
|
+
return record.status === "queued" || record.status === "running" ? undefined : record
|
|
78
|
+
}, `command ${id} to finish`)
|
|
79
|
+
|
|
80
|
+
export const deviceControlConformance = (harness: DaemonHarness) => {
|
|
81
|
+
const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
|
|
82
|
+
|
|
83
|
+
describe("DeviceControl", () => {
|
|
84
|
+
it("lists devices to their person and administrators only; an administrator may revoke any", async () => {
|
|
85
|
+
const owner = await harness.member(unique("owner"), "acme")
|
|
86
|
+
const peer = await harness.member(unique("peer"), "acme")
|
|
87
|
+
const admin = await harness.member(unique("admin"), "acme", ["member", "admin"])
|
|
88
|
+
const daemon = await harness.startDaemon()
|
|
89
|
+
try {
|
|
90
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
91
|
+
const ids = async (user: typeof owner) =>
|
|
92
|
+
((await manage(harness.kernelUrl, user, "listDevices", {})).body as unknown as Array<{ id: string }>).map(
|
|
93
|
+
(d) => d.id,
|
|
94
|
+
)
|
|
95
|
+
assert.ok((await ids(owner)).includes(kernel.deviceId))
|
|
96
|
+
assert.ok(!(await ids(peer)).includes(kernel.deviceId))
|
|
97
|
+
assert.ok((await ids(admin)).includes(kernel.deviceId))
|
|
98
|
+
const listed = (await manage(harness.kernelUrl, owner, "listDevices", {})).body as unknown as Array<
|
|
99
|
+
Record<string, unknown>
|
|
100
|
+
>
|
|
101
|
+
const device = listed.find((d) => d["id"] === kernel.deviceId)!
|
|
102
|
+
assert.equal(device["subject"], owner.id)
|
|
103
|
+
assert.equal(device["kind"], "desktop")
|
|
104
|
+
assert.ok(!JSON.stringify(listed).includes("elxv_"), "a listing carried a credential")
|
|
105
|
+
// Machine credentials cannot manage devices.
|
|
106
|
+
const credential = Object.values(
|
|
107
|
+
JSON.parse(readFileSync(join(daemon.stateDir, "secrets.json"), "utf8")) as Record<string, string>,
|
|
108
|
+
)[0]!
|
|
109
|
+
const byDevice = await fetch(`${harness.kernelUrl}/kernel/devices/listDevices`, {
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${credential}` },
|
|
112
|
+
body: "{}",
|
|
113
|
+
})
|
|
114
|
+
assert.equal(byDevice.status, 401)
|
|
115
|
+
const revoked = await manage(harness.kernelUrl, admin, "revokeDevice", { id: kernel.deviceId })
|
|
116
|
+
assert.equal(revoked.status, 200)
|
|
117
|
+
const audits = await harness.query<{ actor: string; outcome: string }>(
|
|
118
|
+
`SELECT actor_user_id AS actor, outcome FROM eloxiv.audit_log WHERE action = 'eloxiv.devices.revokeDevice'
|
|
119
|
+
AND actor_user_id = $1`,
|
|
120
|
+
[admin.id],
|
|
121
|
+
)
|
|
122
|
+
assert.deepEqual(audits, [{ actor: admin.id, outcome: "succeeded" }])
|
|
123
|
+
} finally {
|
|
124
|
+
await daemon.close()
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it("records the sessions a device reports: local clients and harness turns", async () => {
|
|
129
|
+
const owner = await harness.member(unique("sessions"), "acme")
|
|
130
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
131
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
132
|
+
try {
|
|
133
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
134
|
+
await localClient(daemon, hostSecret)
|
|
135
|
+
await localTurn(daemon, hostSecret, { harness: "codex", prompt: "SAY hello" })
|
|
136
|
+
const sessions = await until(async () => {
|
|
137
|
+
const answer = await manage(harness.kernelUrl, owner, "listSessions", { deviceId: kernel.deviceId })
|
|
138
|
+
const list = (answer.body as { sessions: Array<{ kind: string; endedAt: string | null }> }).sessions
|
|
139
|
+
return list.some((s) => s.kind === "harness" && s.endedAt !== null) && list.some((s) => s.kind === "cli")
|
|
140
|
+
? list
|
|
141
|
+
: undefined
|
|
142
|
+
}, "the device to report its sessions")
|
|
143
|
+
assert.ok(sessions.some((s) => s.kind === "cli" && s.endedAt === null))
|
|
144
|
+
const local = (await (
|
|
145
|
+
await fetch(`${daemon.url}/sessions`, { headers: { authorization: `Bearer ${hostSecret}` } })
|
|
146
|
+
).json()) as Array<{ kind: string }>
|
|
147
|
+
assert.ok(local.some((s) => s.kind === "harness"))
|
|
148
|
+
// Another member cannot see them.
|
|
149
|
+
const peer = await harness.member(unique("peeker"), "acme")
|
|
150
|
+
assert.equal((await manage(harness.kernelUrl, peer, "listSessions", { deviceId: kernel.deviceId })).status, 403)
|
|
151
|
+
} finally {
|
|
152
|
+
await daemon.close()
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
it("runs terminal and files commands only inside the device's workspace, and only kinds it offers", async () => {
|
|
157
|
+
const owner = await harness.member(unique("commands"), "acme")
|
|
158
|
+
const workspace = harness.tempDir()
|
|
159
|
+
const outside = harness.tempDir()
|
|
160
|
+
writeFileSync(join(outside, "secret.txt"), "not yours")
|
|
161
|
+
symlinkSync(outside, join(workspace, "link"))
|
|
162
|
+
const daemon = await harness.startDaemon({ commands: ["terminal", "files"], workspace })
|
|
163
|
+
const client = devicesClient(harness, owner)
|
|
164
|
+
try {
|
|
165
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
166
|
+
await offering(client, kernel.deviceId, ["terminal", "files"])
|
|
167
|
+
const run = (operation: string, input: unknown) => command(client, kernel.deviceId, operation, input)
|
|
168
|
+
const shell = await run("terminal.exec", { command: "echo hello && pwd" })
|
|
169
|
+
assert.equal(shell.status, "succeeded", shell.error ?? "")
|
|
170
|
+
const printed = shell.result as { exitCode: number; stdout: string }
|
|
171
|
+
assert.equal(printed.exitCode, 0)
|
|
172
|
+
assert.deepEqual(printed.stdout.trim().split("\n"), ["hello", realpathSync(workspace)])
|
|
173
|
+
assert.equal((await run("files.write", { path: "notes/a.txt", content: "one two" })).status, "succeeded")
|
|
174
|
+
assert.equal(
|
|
175
|
+
(await run("files.edit", { path: "notes/a.txt", oldText: "two", newText: "three" })).status,
|
|
176
|
+
"succeeded",
|
|
177
|
+
)
|
|
178
|
+
assert.deepEqual((await run("files.read", { path: "notes/a.txt" })).result, {
|
|
179
|
+
path: join("notes", "a.txt"),
|
|
180
|
+
content: "one three",
|
|
181
|
+
bytes: 9,
|
|
182
|
+
})
|
|
183
|
+
const found = (await run("files.search", { text: "three" })).result as { matches: Array<{ path: string }> }
|
|
184
|
+
assert.deepEqual(
|
|
185
|
+
found.matches.map((match) => match.path),
|
|
186
|
+
[join("notes", "a.txt")],
|
|
187
|
+
)
|
|
188
|
+
const listed = (await run("files.list", {})).result as { entries: Array<{ name: string }> }
|
|
189
|
+
assert.ok(listed.entries.some((entry) => entry.name === "notes"))
|
|
190
|
+
// Nothing outside the workspace, by a relative path, an absolute one or a symbolic link.
|
|
191
|
+
for (const path of ["../secret.txt", join(outside, "secret.txt"), "link/secret.txt"]) {
|
|
192
|
+
const escaped = await run("files.read", { path })
|
|
193
|
+
assert.equal(escaped.status, "failed", path)
|
|
194
|
+
assert.match(escaped.error ?? "", /workspace/u)
|
|
195
|
+
}
|
|
196
|
+
assert.equal((await run("files.write", { path: "link/planted.txt", content: "x" })).status, "failed")
|
|
197
|
+
assert.ok(!existsSync(join(outside, "planted.txt")))
|
|
198
|
+
// A dangling link is not followed: neither written through, nor a directory to write under.
|
|
199
|
+
symlinkSync(join(outside, "dangling-target.txt"), join(workspace, "dangling"))
|
|
200
|
+
symlinkSync(join(outside, "dangling-dir"), join(workspace, "dangling-dir"))
|
|
201
|
+
for (const path of ["dangling", "dangling-dir/planted.txt"]) {
|
|
202
|
+
const written = await run("files.write", { path, content: "x" })
|
|
203
|
+
assert.equal(written.status, "failed", path)
|
|
204
|
+
assert.match(written.error ?? "", /symbolic link/u)
|
|
205
|
+
}
|
|
206
|
+
assert.ok(!existsSync(join(outside, "dangling-target.txt")) && !existsSync(join(outside, "dangling-dir")))
|
|
207
|
+
// A kind the device does not offer is refused when it is sent.
|
|
208
|
+
await assert.rejects(
|
|
209
|
+
client.call("devices.sendCommand", { deviceId: kernel.deviceId, operation: "browser.observe", input: {} }),
|
|
210
|
+
(error: { _tag?: string }) => error._tag === "InvalidInput",
|
|
211
|
+
)
|
|
212
|
+
} finally {
|
|
213
|
+
await client.dispose()
|
|
214
|
+
await daemon.close()
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
it("starts with its state directory inside the workspace, and no file command reaches it", async () => {
|
|
219
|
+
const owner = await harness.member(unique("state-inside"), "acme")
|
|
220
|
+
const workspace = harness.tempDir()
|
|
221
|
+
writeFileSync(join(workspace, "notes.txt"), "a note about elxv_ and localClients\n")
|
|
222
|
+
// The state directory named through a symbolic link to the workspace: excluded by its real path.
|
|
223
|
+
const alias = join(harness.tempDir(), "alias")
|
|
224
|
+
symlinkSync(workspace, alias)
|
|
225
|
+
const daemon = await harness.startDaemon({ commands: ["files"], workspace, stateDir: join(alias, ".daemon") })
|
|
226
|
+
const client = devicesClient(harness, owner)
|
|
227
|
+
try {
|
|
228
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
229
|
+
await offering(client, kernel.deviceId, ["files"])
|
|
230
|
+
// The state directory holds the control secret and, with the file store, the device credential.
|
|
231
|
+
assert.ok(existsSync(join(workspace, ".daemon", "secrets.json")))
|
|
232
|
+
const run = (operation: string, input: unknown) => command(client, kernel.deviceId, operation, input)
|
|
233
|
+
// A search of the whole workspace finds the note, and nothing in the state directory.
|
|
234
|
+
for (const text of ["elxv_", "localClients"]) {
|
|
235
|
+
const found = (await run("files.search", { text })).result as { matches: Array<{ path: string }> }
|
|
236
|
+
assert.deepEqual(
|
|
237
|
+
found.matches.map((match) => match.path),
|
|
238
|
+
["notes.txt"],
|
|
239
|
+
text,
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
const listed = (await run("files.list", {})).result as { entries: Array<{ name: string }> }
|
|
243
|
+
assert.deepEqual(
|
|
244
|
+
listed.entries.map((entry) => entry.name),
|
|
245
|
+
["notes.txt"],
|
|
246
|
+
)
|
|
247
|
+
for (const [operation, input] of [
|
|
248
|
+
["files.read", { path: ".daemon/control.secret" }],
|
|
249
|
+
["files.read", { path: ".daemon/secrets.json" }],
|
|
250
|
+
["files.list", { path: ".daemon" }],
|
|
251
|
+
["files.search", { text: "elxv_", path: ".daemon" }],
|
|
252
|
+
["files.write", { path: ".daemon/planted.txt", content: "x" }],
|
|
253
|
+
] as const) {
|
|
254
|
+
const refused = await run(operation, input)
|
|
255
|
+
assert.equal(refused.status, "failed", `${operation} ${JSON.stringify(input)}`)
|
|
256
|
+
assert.match(refused.error ?? "", /state directory/u)
|
|
257
|
+
}
|
|
258
|
+
assert.ok(!existsSync(join(workspace, ".daemon", "planted.txt")))
|
|
259
|
+
} finally {
|
|
260
|
+
await client.dispose()
|
|
261
|
+
await daemon.close()
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
it("only the device's person sends it commands; an agent's waits for consent; revoking fails what is left", async () => {
|
|
266
|
+
const owner = await harness.member(unique("command-owner"), "acme")
|
|
267
|
+
const other = await harness.member(unique("command-peer"), "acme")
|
|
268
|
+
const workspace = harness.tempDir()
|
|
269
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
270
|
+
const daemon = await harness.startDaemon({ commands: ["files"], workspace, hostSecret })
|
|
271
|
+
const client = devicesClient(harness, owner)
|
|
272
|
+
const stranger = devicesClient(harness, other)
|
|
273
|
+
try {
|
|
274
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
275
|
+
await offering(client, kernel.deviceId, ["files"])
|
|
276
|
+
await assert.rejects(
|
|
277
|
+
stranger.call("devices.sendCommand", { deviceId: kernel.deviceId, operation: "files.list", input: {} }),
|
|
278
|
+
(error: { _tag?: string }) => error._tag === "Forbidden",
|
|
279
|
+
)
|
|
280
|
+
const own = await command(client, kernel.deviceId, "files.list", {})
|
|
281
|
+
assert.equal(own.status, "succeeded")
|
|
282
|
+
await assert.rejects(
|
|
283
|
+
stranger.call("devices.getCommand", { id: own.id }),
|
|
284
|
+
(error: { _tag?: string }) => error._tag === "InvalidInput",
|
|
285
|
+
)
|
|
286
|
+
// The person's agent (a harness turn, through the relay) is held for the person's consent.
|
|
287
|
+
const input = {
|
|
288
|
+
deviceId: kernel.deviceId,
|
|
289
|
+
operation: "files.write",
|
|
290
|
+
input: { path: "agent.txt", content: "x" },
|
|
291
|
+
}
|
|
292
|
+
const turn = await localTurn(daemon, hostSecret, {
|
|
293
|
+
harness: "claude-code",
|
|
294
|
+
prompt: `CALL devices_sendCommand ${JSON.stringify(input)}\nSAY tried`,
|
|
295
|
+
})
|
|
296
|
+
const result = turn.events.find((e) => e.event === "harness" && e.data.type === "tool-result")!.data.data
|
|
297
|
+
assert.equal(result.isError, true)
|
|
298
|
+
assert.match(String(result.output), /ConsentRequired|consent/iu)
|
|
299
|
+
const held = await harness.query<{ status: string; action: string }>(
|
|
300
|
+
`SELECT status, action FROM eloxiv_consent.request WHERE user_id = $1`,
|
|
301
|
+
[owner.id],
|
|
302
|
+
)
|
|
303
|
+
assert.deepEqual(held, [{ status: "pending", action: "devices.sendCommand" }])
|
|
304
|
+
assert.equal(
|
|
305
|
+
(await harness.query(`SELECT 1 FROM eloxiv_devices.command WHERE requested_by = $1`, [owner.id])).length,
|
|
306
|
+
1,
|
|
307
|
+
)
|
|
308
|
+
// A command still queued when the device is revoked fails.
|
|
309
|
+
await daemon.daemon.stopCommands()
|
|
310
|
+
const queued = output(
|
|
311
|
+
await client.call("devices.sendCommand", { deviceId: kernel.deviceId, operation: "files.list", input: {} }),
|
|
312
|
+
)
|
|
313
|
+
assert.equal((await manage(harness.kernelUrl, owner, "revokeDevice", { id: kernel.deviceId })).status, 200)
|
|
314
|
+
const failed = await settledCommand(client, queued.commandId)
|
|
315
|
+
assert.deepEqual([failed.status, failed.error], ["failed", "The device was revoked"])
|
|
316
|
+
} finally {
|
|
317
|
+
await client.dispose()
|
|
318
|
+
await stranger.dispose()
|
|
319
|
+
await daemon.close()
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
it("a command cancelled before a device takes it never runs; a finished one stays as it was; only its sender or the device's person cancels", async () => {
|
|
324
|
+
const owner = await harness.member(unique("cancel-queued"), "acme")
|
|
325
|
+
const other = await harness.member(unique("cancel-peer"), "acme")
|
|
326
|
+
const workspace = harness.tempDir()
|
|
327
|
+
const daemon = await harness.startDaemon({ commands: ["files"], workspace })
|
|
328
|
+
const client = devicesClient(harness, owner)
|
|
329
|
+
const stranger = devicesClient(harness, other)
|
|
330
|
+
try {
|
|
331
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
332
|
+
await offering(client, kernel.deviceId, ["files"])
|
|
333
|
+
// The device takes nothing meanwhile.
|
|
334
|
+
await daemon.daemon.stopCommands()
|
|
335
|
+
const { commandId } = output(
|
|
336
|
+
await client.call("devices.sendCommand", {
|
|
337
|
+
deviceId: kernel.deviceId,
|
|
338
|
+
operation: "files.write",
|
|
339
|
+
input: { path: "never.txt", content: "x" },
|
|
340
|
+
}),
|
|
341
|
+
)
|
|
342
|
+
await assert.rejects(
|
|
343
|
+
stranger.call("devices.cancelCommand", { id: commandId }),
|
|
344
|
+
(error: { _tag?: string }) => error._tag === "Forbidden" || error._tag === "InvalidInput",
|
|
345
|
+
)
|
|
346
|
+
assert.deepEqual(output(await client.call("devices.cancelCommand", { id: commandId })), {
|
|
347
|
+
id: commandId,
|
|
348
|
+
status: "cancelled",
|
|
349
|
+
cancelRequested: true,
|
|
350
|
+
})
|
|
351
|
+
// The device comes back: it never takes the cancelled command, and serves the next.
|
|
352
|
+
daemon.daemon.startCommands()
|
|
353
|
+
const done = await command(client, kernel.deviceId, "files.write", { path: "done.txt", content: "y" })
|
|
354
|
+
assert.equal(done.status, "succeeded")
|
|
355
|
+
const cancelled = await settledCommand(client, commandId)
|
|
356
|
+
assert.equal(cancelled.status, "cancelled")
|
|
357
|
+
assert.match(cancelled.error ?? "", /never ran/u)
|
|
358
|
+
assert.ok(!existsSync(join(workspace, "never.txt")))
|
|
359
|
+
// A finished command is left as it was: nothing is undone, and no cancellation is recorded.
|
|
360
|
+
assert.deepEqual(output(await client.call("devices.cancelCommand", { id: done.id })), {
|
|
361
|
+
id: done.id,
|
|
362
|
+
status: "succeeded",
|
|
363
|
+
cancelRequested: false,
|
|
364
|
+
})
|
|
365
|
+
const after = await settledCommand(client, done.id)
|
|
366
|
+
assert.deepEqual([after.status, after.cancelRequestedAt], ["succeeded", null])
|
|
367
|
+
assert.ok(existsSync(join(workspace, "done.txt")))
|
|
368
|
+
} finally {
|
|
369
|
+
await client.dispose()
|
|
370
|
+
await stranger.dispose()
|
|
371
|
+
await daemon.close()
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
it("recovers stuck commands without a job: one never taken expires unrun, one taken but never reported fails at its deadline", async () => {
|
|
376
|
+
const owner = await harness.member(unique("stuck"), "acme")
|
|
377
|
+
const workspace = harness.tempDir()
|
|
378
|
+
const daemon = await harness.startDaemon({ commands: ["files"], workspace })
|
|
379
|
+
const client = devicesClient(harness, owner)
|
|
380
|
+
try {
|
|
381
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
382
|
+
await offering(client, kernel.deviceId, ["files"])
|
|
383
|
+
await daemon.daemon.stopCommands()
|
|
384
|
+
const send = async (path: string) =>
|
|
385
|
+
output(
|
|
386
|
+
await client.call("devices.sendCommand", {
|
|
387
|
+
deviceId: kernel.deviceId,
|
|
388
|
+
operation: "files.write",
|
|
389
|
+
input: { path, content: "x" },
|
|
390
|
+
}),
|
|
391
|
+
).commandId
|
|
392
|
+
// Never taken: past its queue time (as two minutes would leave it) it reads expired, and is never handed out.
|
|
393
|
+
const unclaimed = await send("late.txt")
|
|
394
|
+
await harness.query(
|
|
395
|
+
`UPDATE eloxiv_devices.command SET expires_at = now() - interval '1 second' WHERE id = $1`,
|
|
396
|
+
[unclaimed],
|
|
397
|
+
)
|
|
398
|
+
// Taken by a device that then went away: past its deadline and the grace it reads failed.
|
|
399
|
+
const abandoned = await send("abandoned.txt")
|
|
400
|
+
await harness.query(
|
|
401
|
+
`UPDATE eloxiv_devices.command SET status = 'running', lease = 'gone', claimed_at = now(),
|
|
402
|
+
deadline = now() - interval '1 minute' WHERE id = $1`,
|
|
403
|
+
[abandoned],
|
|
404
|
+
)
|
|
405
|
+
daemon.daemon.startCommands()
|
|
406
|
+
// The device serves the next command, but not the expired one.
|
|
407
|
+
assert.equal((await command(client, kernel.deviceId, "files.list", {})).status, "succeeded")
|
|
408
|
+
const expired = output(await client.call("devices.getCommand", { id: unclaimed }))
|
|
409
|
+
assert.deepEqual([expired.status, expired.error], ["expired", "No device took the command in time"])
|
|
410
|
+
assert.ok(!existsSync(join(workspace, "late.txt")))
|
|
411
|
+
const failed = output(await client.call("devices.getCommand", { id: abandoned }))
|
|
412
|
+
assert.deepEqual(
|
|
413
|
+
[failed.status, failed.error],
|
|
414
|
+
["failed", "The device did not report the command before its deadline"],
|
|
415
|
+
)
|
|
416
|
+
} finally {
|
|
417
|
+
await client.dispose()
|
|
418
|
+
await daemon.close()
|
|
419
|
+
}
|
|
420
|
+
})
|
|
421
|
+
|
|
422
|
+
it("a command cancelled after the device took it, before it acted, never runs", async () => {
|
|
423
|
+
const owner = await harness.member(unique("cancel-taken"), "acme")
|
|
424
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
425
|
+
const daemon = await harness.startDaemon({ commands: ["browser"], hostSecret })
|
|
426
|
+
const client = devicesClient(harness, owner)
|
|
427
|
+
try {
|
|
428
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
429
|
+
const extension = await pairLocal(daemon, hostSecret, "browser-extension")
|
|
430
|
+
const ask = (waitMs: number) =>
|
|
431
|
+
post(`${daemon.url}/companion/commands/next`, { waitMs }, { authorization: `Bearer ${extension}` })
|
|
432
|
+
// The companion connects once, then stops asking: the device takes the command and holds it for it.
|
|
433
|
+
assert.deepEqual(await (await ask(0)).json(), { command: null })
|
|
434
|
+
await offering(client, kernel.deviceId, ["browser"])
|
|
435
|
+
const { commandId } = output(
|
|
436
|
+
await client.call("devices.sendCommand", {
|
|
437
|
+
deviceId: kernel.deviceId,
|
|
438
|
+
operation: "browser.navigate",
|
|
439
|
+
input: { url: "https://example.com/" },
|
|
440
|
+
}),
|
|
441
|
+
)
|
|
442
|
+
await until(async () => {
|
|
443
|
+
const record = output(await client.call("devices.getCommand", { id: commandId }))
|
|
444
|
+
return record.status === "running" ? true : undefined
|
|
445
|
+
}, "the device to take the command")
|
|
446
|
+
assert.deepEqual(output(await client.call("devices.cancelCommand", { id: commandId })), {
|
|
447
|
+
id: commandId,
|
|
448
|
+
status: "running",
|
|
449
|
+
cancelRequested: true,
|
|
450
|
+
})
|
|
451
|
+
const settled = await settledCommand(client, commandId)
|
|
452
|
+
assert.equal(settled.status, "cancelled")
|
|
453
|
+
assert.match(settled.error ?? "", /never ran/u)
|
|
454
|
+
assert.ok(settled.cancelRequestedAt !== null)
|
|
455
|
+
// The companion that asks now gets nothing: the command was withdrawn.
|
|
456
|
+
assert.deepEqual(await (await ask(0)).json(), { command: null })
|
|
457
|
+
} finally {
|
|
458
|
+
await client.dispose()
|
|
459
|
+
await daemon.close()
|
|
460
|
+
}
|
|
461
|
+
})
|
|
462
|
+
|
|
463
|
+
it("a running shell command cancelled is stopped and reported failed, interrupted, with what it did left standing", async () => {
|
|
464
|
+
const owner = await harness.member(unique("cancel-running"), "acme")
|
|
465
|
+
const workspace = harness.tempDir()
|
|
466
|
+
const daemon = await harness.startDaemon({ commands: ["terminal"], workspace })
|
|
467
|
+
const client = devicesClient(harness, owner)
|
|
468
|
+
try {
|
|
469
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
470
|
+
await offering(client, kernel.deviceId, ["terminal"])
|
|
471
|
+
const { commandId } = output(
|
|
472
|
+
await client.call("devices.sendCommand", {
|
|
473
|
+
deviceId: kernel.deviceId,
|
|
474
|
+
operation: "terminal.exec",
|
|
475
|
+
input: { command: "touch started && sleep 30 && touch finished" },
|
|
476
|
+
timeoutMs: 60_000,
|
|
477
|
+
}),
|
|
478
|
+
)
|
|
479
|
+
await until(async () => (existsSync(join(workspace, "started")) ? true : undefined), "the command to start")
|
|
480
|
+
assert.deepEqual(output(await client.call("devices.cancelCommand", { id: commandId })), {
|
|
481
|
+
id: commandId,
|
|
482
|
+
status: "running",
|
|
483
|
+
cancelRequested: true,
|
|
484
|
+
})
|
|
485
|
+
const settled = await settledCommand(client, commandId)
|
|
486
|
+
// Not `cancelled`: it had run. It is reported as it ended: stopped, its effects so far standing.
|
|
487
|
+
assert.equal(settled.status, "failed")
|
|
488
|
+
assert.match(settled.error ?? "", /stopped; whatever it did before it stopped was not undone/u)
|
|
489
|
+
assert.equal((settled.result as { signal: string | null }).signal, "SIGKILL")
|
|
490
|
+
assert.ok(settled.cancelRequestedAt !== null)
|
|
491
|
+
assert.ok(existsSync(join(workspace, "started")) && !existsSync(join(workspace, "finished")))
|
|
492
|
+
} finally {
|
|
493
|
+
await client.dispose()
|
|
494
|
+
await daemon.close()
|
|
495
|
+
}
|
|
496
|
+
})
|
|
497
|
+
|
|
498
|
+
it("hands browser commands to the paired browser-extension companion and its answer back", async () => {
|
|
499
|
+
const owner = await harness.member(unique("companion"), "acme")
|
|
500
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
501
|
+
const daemon = await harness.startDaemon({ commands: ["browser", "computer"], hostSecret })
|
|
502
|
+
const client = devicesClient(harness, owner)
|
|
503
|
+
try {
|
|
504
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
505
|
+
const extension = await pairLocal(daemon, hostSecret, "browser-extension")
|
|
506
|
+
const cli = await localClient(daemon, hostSecret)
|
|
507
|
+
const origin = "http://localhost:5173"
|
|
508
|
+
const companion = (token: string, path: string, body: unknown) =>
|
|
509
|
+
post(`${daemon.url}${path}`, body, { authorization: `Bearer ${token}`, origin })
|
|
510
|
+
const computer = (await (
|
|
511
|
+
await fetch(`${daemon.url}/computer-use`, { headers: { authorization: `Bearer ${hostSecret}` } })
|
|
512
|
+
).json()) as { available: boolean; reason: string }
|
|
513
|
+
assert.deepEqual(computer, {
|
|
514
|
+
available: false,
|
|
515
|
+
reason: "No computer-use companion is connected to this daemon",
|
|
516
|
+
})
|
|
517
|
+
// Only a companion asks for work.
|
|
518
|
+
assert.equal((await companion(cli, "/companion/commands/next", {})).status, 403)
|
|
519
|
+
const asked = companion(extension, "/companion/commands/next", { waitMs: 20_000 })
|
|
520
|
+
await offering(client, kernel.deviceId, ["browser"])
|
|
521
|
+
const { commandId } = output(
|
|
522
|
+
await client.call("devices.sendCommand", {
|
|
523
|
+
deviceId: kernel.deviceId,
|
|
524
|
+
operation: "browser.observe",
|
|
525
|
+
input: {},
|
|
526
|
+
}),
|
|
527
|
+
)
|
|
528
|
+
const handed = ((await (await asked).json()) as { command: { id: string; operation: string } }).command
|
|
529
|
+
assert.deepEqual([handed.id, handed.operation], [commandId, "browser.observe"])
|
|
530
|
+
// Only the companion that took the command reports it.
|
|
531
|
+
const result = { outcome: "succeeded", result: { url: "https://example.com/", title: "Example" } }
|
|
532
|
+
assert.equal((await companion(cli, `/companion/commands/${commandId}/result`, result)).status, 404)
|
|
533
|
+
assert.equal((await companion(extension, `/companion/commands/${commandId}/result`, result)).status, 200)
|
|
534
|
+
const settled = await settledCommand(client, commandId)
|
|
535
|
+
assert.equal(settled.status, "succeeded")
|
|
536
|
+
assert.deepEqual(settled.result, result.result)
|
|
537
|
+
// No computer-use companion: the device does not offer computer commands.
|
|
538
|
+
await assert.rejects(
|
|
539
|
+
client.call("devices.sendCommand", { deviceId: kernel.deviceId, operation: "computer.observe", input: {} }),
|
|
540
|
+
(error: { _tag?: string }) => error._tag === "InvalidInput",
|
|
541
|
+
)
|
|
542
|
+
// The extension's session says where it runs.
|
|
543
|
+
const sessions = await until(async () => {
|
|
544
|
+
const answer = await manage(harness.kernelUrl, owner, "listSessions", { deviceId: kernel.deviceId })
|
|
545
|
+
const list = (answer.body as { sessions: Array<{ kind: string; detail: string | null }> }).sessions
|
|
546
|
+
return list.some((s) => s.kind === "browser-extension" && s.detail === origin) ? list : undefined
|
|
547
|
+
}, "the extension's session")
|
|
548
|
+
assert.ok(sessions.length > 0)
|
|
549
|
+
} finally {
|
|
550
|
+
await client.dispose()
|
|
551
|
+
await daemon.close()
|
|
552
|
+
}
|
|
553
|
+
})
|
|
554
|
+
|
|
555
|
+
it("opens a terminal only with the terminal enabled, for the client that opened it; closing it ends the shell", async () => {
|
|
556
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
557
|
+
const plain = await harness.startDaemon({ hostSecret })
|
|
558
|
+
try {
|
|
559
|
+
const refused = await post(`${plain.url}/terminals`, {}, { authorization: `Bearer ${hostSecret}` })
|
|
560
|
+
assert.equal(refused.status, 403)
|
|
561
|
+
} finally {
|
|
562
|
+
await plain.close()
|
|
563
|
+
}
|
|
564
|
+
const workspace = harness.tempDir()
|
|
565
|
+
const daemon = await harness.startDaemon({ commands: ["terminal"], workspace, hostSecret })
|
|
566
|
+
try {
|
|
567
|
+
const cli = await localClient(daemon, hostSecret)
|
|
568
|
+
const other = await localClient(daemon, hostSecret)
|
|
569
|
+
const extension = await pairLocal(daemon, hostSecret, "browser-extension")
|
|
570
|
+
const as = (token: string) => ({ authorization: `Bearer ${token}` })
|
|
571
|
+
assert.equal((await post(`${daemon.url}/terminals`, {}, as(extension))).status, 403)
|
|
572
|
+
const opened = await post(`${daemon.url}/terminals`, { cols: 100, rows: 30 }, as(cli))
|
|
573
|
+
assert.equal(opened.status, 201)
|
|
574
|
+
const { id, pty } = (await opened.json()) as { id: string; pty: boolean }
|
|
575
|
+
assert.equal(pty, typeof process.versions["bun"] === "string")
|
|
576
|
+
const stream = await fetch(`${daemon.url}/terminals/${id}/stream`, { headers: as(cli) })
|
|
577
|
+
const reader = stream.body!.getReader()
|
|
578
|
+
const decoder = new TextDecoder()
|
|
579
|
+
let seen = ""
|
|
580
|
+
const read = (until: (text: string) => boolean) =>
|
|
581
|
+
(async () => {
|
|
582
|
+
while (!until(seen)) {
|
|
583
|
+
const chunk = await reader.read()
|
|
584
|
+
if (chunk.done) break
|
|
585
|
+
seen += decoder.decode(chunk.value, { stream: true })
|
|
586
|
+
}
|
|
587
|
+
return seen
|
|
588
|
+
})()
|
|
589
|
+
// Another client can neither write to it nor watch it.
|
|
590
|
+
assert.equal((await post(`${daemon.url}/terminals/${id}/input`, { data: "echo no\n" }, as(other))).status, 404)
|
|
591
|
+
assert.equal((await fetch(`${daemon.url}/terminals/${id}/stream`, { headers: as(other) })).status, 404)
|
|
592
|
+
await post(`${daemon.url}/terminals/${id}/input`, { data: "echo term-$((40+2)) && pwd\n" }, as(cli))
|
|
593
|
+
const output = await read((text) => text.includes("term-42") && text.includes(realpathSync(workspace)))
|
|
594
|
+
assert.ok(output.includes("term-42"))
|
|
595
|
+
const closed = await fetch(`${daemon.url}/terminals/${id}`, { method: "DELETE", headers: as(cli) })
|
|
596
|
+
assert.equal(closed.status, 200)
|
|
597
|
+
assert.match(await read((text) => text.includes("event: exit")), /event: exit/u)
|
|
598
|
+
const sessions = (await (await fetch(`${daemon.url}/sessions`, { headers: as(hostSecret) })).json()) as Array<{
|
|
599
|
+
kind: string
|
|
600
|
+
endedAt: string | null
|
|
601
|
+
}>
|
|
602
|
+
assert.ok(sessions.some((s) => s.kind === "terminal" && s.endedAt !== null))
|
|
603
|
+
assert.deepEqual(await (await fetch(`${daemon.url}/terminals`, { headers: as(cli) })).json(), [])
|
|
604
|
+
} finally {
|
|
605
|
+
await daemon.close()
|
|
606
|
+
}
|
|
607
|
+
})
|
|
608
|
+
|
|
609
|
+
it("reports what the device offers, and registers its host's push subscription until it is revoked", async () => {
|
|
610
|
+
const owner = await harness.member(unique("push"), "acme")
|
|
611
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
612
|
+
const daemon = await harness.startDaemon({ hostSecret })
|
|
613
|
+
try {
|
|
614
|
+
const offered = (await (
|
|
615
|
+
await fetch(`${daemon.url}/capabilities`, { headers: { authorization: `Bearer ${hostSecret}` } })
|
|
616
|
+
).json()) as Record<string, { enabled: boolean; available: boolean }>
|
|
617
|
+
for (const kind of ["terminal", "files", "browser", "computer"]) {
|
|
618
|
+
assert.deepEqual([offered[kind]!.enabled, offered[kind]!.available], [false, false], kind)
|
|
619
|
+
}
|
|
620
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
621
|
+
const registered = await post(
|
|
622
|
+
`${daemon.url}/push`,
|
|
623
|
+
{ subscription: { kind: "fcm", token: "push-token-123" } },
|
|
624
|
+
{ authorization: `Bearer ${hostSecret}` },
|
|
625
|
+
)
|
|
626
|
+
assert.deepEqual(await registered.json(), { registered: true })
|
|
627
|
+
const listed = (await manage(harness.kernelUrl, owner, "listDevices", {})).body as unknown as Array<{
|
|
628
|
+
id: string
|
|
629
|
+
push?: boolean
|
|
630
|
+
}>
|
|
631
|
+
assert.equal(listed.find((device) => device.id === kernel.deviceId)?.push, true)
|
|
632
|
+
assert.ok(!JSON.stringify(listed).includes("push-token-123"), "a listing carried a push token")
|
|
633
|
+
assert.equal((await manage(harness.kernelUrl, owner, "revokeDevice", { id: kernel.deviceId })).status, 200)
|
|
634
|
+
const left = await harness.query(`SELECT 1 FROM eloxiv.device_push WHERE device_id = $1`, [kernel.deviceId])
|
|
635
|
+
assert.equal(left.length, 0)
|
|
636
|
+
} finally {
|
|
637
|
+
await daemon.close()
|
|
638
|
+
}
|
|
639
|
+
})
|
|
640
|
+
|
|
641
|
+
it("a tools-only device refuses workspace tools; an organisation can turn commands and workspace tools off", async () => {
|
|
642
|
+
const workspace = harness.tempDir()
|
|
643
|
+
await assert.rejects(harness.startDaemon({ toolsOnly: true, commands: ["terminal"], workspace }), /tools-only/u)
|
|
644
|
+
await assert.rejects(harness.startDaemon({ commands: ["files"] }), /workspace/u)
|
|
645
|
+
const org = unique("gated")
|
|
646
|
+
const owner = await harness.member(unique("gated-owner"), org)
|
|
647
|
+
const admin = await harness.member(unique("gated-admin"), org, ["member", "admin"])
|
|
648
|
+
const hostSecret = `host-${crypto.randomUUID()}-${crypto.randomUUID()}`
|
|
649
|
+
const hosted = await harness.startDaemon({ toolsOnly: true, hostSecret })
|
|
650
|
+
try {
|
|
651
|
+
const kernel = await pairDaemon(harness, hosted, owner, { kind: "runner" })
|
|
652
|
+
const refused = await localTurn(hosted, hostSecret, {
|
|
653
|
+
harness: "codex",
|
|
654
|
+
prompt: "SAY no",
|
|
655
|
+
workspaceTools: true,
|
|
656
|
+
})
|
|
657
|
+
assert.equal(refused.result["outcome"], "failed")
|
|
658
|
+
assert.match(String(refused.result["error"]), /tools-only/u)
|
|
659
|
+
await until(async () => {
|
|
660
|
+
const listed = (await manage(harness.kernelUrl, owner, "listDevices", {})).body as unknown as Array<{
|
|
661
|
+
id: string
|
|
662
|
+
capabilities: { toolsOnly?: boolean }
|
|
663
|
+
}>
|
|
664
|
+
return listed.find((device) => device.id === kernel.deviceId)?.capabilities.toolsOnly === true
|
|
665
|
+
? true
|
|
666
|
+
: undefined
|
|
667
|
+
}, "the device to report the tools-only profile")
|
|
668
|
+
} finally {
|
|
669
|
+
await hosted.close()
|
|
670
|
+
}
|
|
671
|
+
const daemon = await harness.startDaemon({ commands: ["files"], workspace })
|
|
672
|
+
const client = devicesClient(harness, owner)
|
|
673
|
+
try {
|
|
674
|
+
const kernel = await pairDaemon(harness, daemon, owner)
|
|
675
|
+
await offering(client, kernel.deviceId, ["files"])
|
|
676
|
+
for (const key of ["devices.commands", "devices.workspaceTools"]) {
|
|
677
|
+
const set = await post(
|
|
678
|
+
`${harness.kernelUrl}/api/actions/settings.set`,
|
|
679
|
+
{ key, level: "org", value: false },
|
|
680
|
+
{ authorization: `Bearer ${admin.session}` },
|
|
681
|
+
)
|
|
682
|
+
assert.equal(set.status, 200, await set.text())
|
|
683
|
+
}
|
|
684
|
+
await assert.rejects(
|
|
685
|
+
client.call("devices.sendCommand", { deviceId: kernel.deviceId, operation: "files.list", input: {} }),
|
|
686
|
+
(error: { _tag?: string; message?: string }) => error._tag === "Forbidden",
|
|
687
|
+
)
|
|
688
|
+
await assert.rejects(
|
|
689
|
+
client.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "SAY x", workspaceTools: true }),
|
|
690
|
+
(error: { _tag?: string }) => error._tag === "Forbidden",
|
|
691
|
+
)
|
|
692
|
+
// A turn without workspace tools is still allowed.
|
|
693
|
+
output(await client.call("devices.sendTurn", { deviceId: kernel.deviceId, prompt: "SAY x" }))
|
|
694
|
+
} finally {
|
|
695
|
+
await client.dispose()
|
|
696
|
+
await daemon.close()
|
|
697
|
+
}
|
|
698
|
+
})
|
|
699
|
+
})
|
|
700
|
+
}
|