@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,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Eloxiv kernel as a Release conformance subject: setup runs in process against fresh databases; version
|
|
3
|
+
* skew is served by an in-process kernel over the conformance fixture app.
|
|
4
|
+
*/
|
|
5
|
+
import { signIn } from "@eloxiv/client"
|
|
6
|
+
import {
|
|
7
|
+
adminUrlFor,
|
|
8
|
+
Approvals,
|
|
9
|
+
Audit,
|
|
10
|
+
Directory,
|
|
11
|
+
KERNEL_VERSION,
|
|
12
|
+
LEASE_KEY,
|
|
13
|
+
PgLayer,
|
|
14
|
+
Release,
|
|
15
|
+
ReleaseSettings,
|
|
16
|
+
setup,
|
|
17
|
+
type AnyKernelModule,
|
|
18
|
+
type ReleaseShape,
|
|
19
|
+
} from "@eloxiv/kernel"
|
|
20
|
+
import { PgClient } from "@effect/sql-pg"
|
|
21
|
+
import { Cause, Deferred, Effect, Exit, Layer, Redacted } from "effect"
|
|
22
|
+
import * as Reactivity from "effect/reactivity/Reactivity"
|
|
23
|
+
import { resolve } from "node:path"
|
|
24
|
+
import { adminQuery, type AdminQuery } from "../Admin.ts"
|
|
25
|
+
import { platform, startKernel, testConfig, type TestKernel } from "../Kernel.ts"
|
|
26
|
+
import { adminUrl, defaultRuntime, dropDatabase, kernelDatabaseUrl } from "../System.ts"
|
|
27
|
+
import { APPROVAL_REQUIRED, conformanceApp } from "./fixture/app.ts"
|
|
28
|
+
import type { ReleaseDatabase, ReleaseSubject, SetupOutcome } from "./Release.ts"
|
|
29
|
+
|
|
30
|
+
const root = resolve(import.meta.dirname, "../../../..")
|
|
31
|
+
|
|
32
|
+
export const startReferenceRelease = async (options: { readonly name: string }): Promise<ReleaseSubject> => {
|
|
33
|
+
const rt = await platform()
|
|
34
|
+
const databases: Array<string> = []
|
|
35
|
+
const admins: Array<AdminQuery> = []
|
|
36
|
+
const kernels: Array<TestKernel> = []
|
|
37
|
+
const prefix = `eloxiv_t_${options.name}_${defaultRuntime()}`
|
|
38
|
+
|
|
39
|
+
const database = async (name: string): Promise<ReleaseDatabase> => {
|
|
40
|
+
const db = `${prefix}_${name}`
|
|
41
|
+
databases.push(db)
|
|
42
|
+
await dropDatabase(db, root)
|
|
43
|
+
let admin: AdminQuery | undefined
|
|
44
|
+
const sql: ReleaseDatabase["sql"] = (text, params) => {
|
|
45
|
+
admin ??= adminQuery(db)
|
|
46
|
+
if (!admins.includes(admin)) admins.push(admin)
|
|
47
|
+
return admin(text, params)
|
|
48
|
+
}
|
|
49
|
+
/** A Release service over this database, for a build installing `modules`. */
|
|
50
|
+
const release = <A>(modules: ReadonlyArray<AnyKernelModule>, use: (release: ReleaseShape) => Effect.Effect<A>) =>
|
|
51
|
+
Effect.runPromise(
|
|
52
|
+
Effect.flatMap(
|
|
53
|
+
Release.useSync((r) => r),
|
|
54
|
+
use,
|
|
55
|
+
).pipe(
|
|
56
|
+
Effect.provide(
|
|
57
|
+
Release.layer(modules, KERNEL_VERSION).pipe(
|
|
58
|
+
Layer.provide(Layer.succeed(ReleaseSettings, { appVersion: undefined, minClientVersion: undefined })),
|
|
59
|
+
Layer.provide(PgLayer(Redacted.make(kernelDatabaseUrl(db)))),
|
|
60
|
+
Layer.provide(rt.platformServices),
|
|
61
|
+
),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
)
|
|
65
|
+
return {
|
|
66
|
+
setup: async (modules, setupOptions): Promise<SetupOutcome> => {
|
|
67
|
+
const exit = await Effect.runPromise(
|
|
68
|
+
setup({ name: "release-kit", modules }, setupOptions).pipe(
|
|
69
|
+
Effect.provide(testConfig(db)),
|
|
70
|
+
Effect.provide(rt.platformServices),
|
|
71
|
+
Effect.exit,
|
|
72
|
+
),
|
|
73
|
+
)
|
|
74
|
+
if (Exit.isSuccess(exit)) return { ok: true, report: exit.value }
|
|
75
|
+
const error = Cause.squash(exit.cause) as {
|
|
76
|
+
_tag?: string
|
|
77
|
+
message?: string
|
|
78
|
+
module?: string
|
|
79
|
+
migration?: string | null
|
|
80
|
+
owner?: string | null
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
error: {
|
|
85
|
+
_tag: error._tag ?? "Defect",
|
|
86
|
+
message: error.message ?? JSON.stringify(error),
|
|
87
|
+
module: error.module,
|
|
88
|
+
migration: error.migration,
|
|
89
|
+
owner: error.owner,
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
sql,
|
|
94
|
+
status: (modules) => release(modules, (r) => r.status),
|
|
95
|
+
snapshots: () => release([], (r) => r.snapshots),
|
|
96
|
+
history: () => release([], (r) => r.history),
|
|
97
|
+
holdLease: async (owner, holdOptions) => {
|
|
98
|
+
const locked = Effect.runSync(Deferred.make<void>())
|
|
99
|
+
const released = Effect.runSync(Deferred.make<void>())
|
|
100
|
+
const held = Effect.runPromise(
|
|
101
|
+
Effect.scoped(
|
|
102
|
+
Effect.gen(function* () {
|
|
103
|
+
const client = yield* PgClient.make({
|
|
104
|
+
url: adminUrlFor(Redacted.make(adminUrl()), db),
|
|
105
|
+
maxConnections: 1,
|
|
106
|
+
})
|
|
107
|
+
const session = yield* client.reserve
|
|
108
|
+
yield* session.execute(`SELECT pg_advisory_lock($1)`, [LEASE_KEY], undefined)
|
|
109
|
+
yield* session.execute(
|
|
110
|
+
`INSERT INTO eloxiv.release_lease (owner, pid, acquired_at, expires_at)
|
|
111
|
+
VALUES ($1, pg_backend_pid(), now(), now() + $2 * interval '1 millisecond')
|
|
112
|
+
ON CONFLICT (singleton) DO UPDATE SET owner = EXCLUDED.owner, pid = EXCLUDED.pid,
|
|
113
|
+
acquired_at = EXCLUDED.acquired_at, expires_at = EXCLUDED.expires_at`,
|
|
114
|
+
[owner, holdOptions?.expired === true ? -1_000 : 3_600_000],
|
|
115
|
+
undefined,
|
|
116
|
+
)
|
|
117
|
+
yield* Deferred.succeed(locked, undefined)
|
|
118
|
+
yield* Deferred.await(released)
|
|
119
|
+
yield* session.execute(`DELETE FROM eloxiv.release_lease`, [], undefined)
|
|
120
|
+
yield* session.execute(`SELECT pg_advisory_unlock($1)`, [LEASE_KEY], undefined)
|
|
121
|
+
}),
|
|
122
|
+
).pipe(Effect.provide(Reactivity.layer)),
|
|
123
|
+
)
|
|
124
|
+
await Promise.race([Effect.runPromise(Deferred.await(locked)), held])
|
|
125
|
+
return {
|
|
126
|
+
release: async () => {
|
|
127
|
+
await Effect.runPromise(Deferred.succeed(released, undefined))
|
|
128
|
+
await held
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const serve: ReleaseSubject["serve"] = async (minClientVersion) => {
|
|
136
|
+
const db = `${prefix}_serve`
|
|
137
|
+
databases.push(db)
|
|
138
|
+
await dropDatabase(db, root)
|
|
139
|
+
const kernel = await startKernel({
|
|
140
|
+
app: { ...conformanceApp, release: { version: "2.0.0", minClientVersion } },
|
|
141
|
+
database: db,
|
|
142
|
+
approvals: Approvals.requireFor(APPROVAL_REQUIRED, "The conformance app requires sign-off"),
|
|
143
|
+
})
|
|
144
|
+
kernels.push(kernel)
|
|
145
|
+
const email = "release-member@example.com"
|
|
146
|
+
const password = "release-password"
|
|
147
|
+
const id = await kernel.run(
|
|
148
|
+
Effect.gen(function* () {
|
|
149
|
+
const directory = yield* Directory
|
|
150
|
+
const userId = yield* directory.ensureUser({ email, name: "Release member", password })
|
|
151
|
+
yield* directory.createOrganization({ id: "acme", name: "Acme" })
|
|
152
|
+
yield* directory.addMember({ orgId: "acme", userId })
|
|
153
|
+
return userId
|
|
154
|
+
}),
|
|
155
|
+
)
|
|
156
|
+
const { token } = await signIn(kernel.url, { email, password })
|
|
157
|
+
return {
|
|
158
|
+
url: kernel.url,
|
|
159
|
+
member: { token, id },
|
|
160
|
+
audit: (action) =>
|
|
161
|
+
kernel.run(
|
|
162
|
+
Effect.flatMap(
|
|
163
|
+
Audit.useSync((a) => a),
|
|
164
|
+
(audit) => audit.list({ action }),
|
|
165
|
+
),
|
|
166
|
+
),
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
database,
|
|
172
|
+
serve,
|
|
173
|
+
dispose: async () => {
|
|
174
|
+
for (const kernel of kernels) await kernel.dispose()
|
|
175
|
+
for (const admin of admins) await admin.dispose()
|
|
176
|
+
for (const db of databases) await dropDatabase(db, root).catch(() => undefined)
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the ResultRendering contract (docs/contracts/result-rendering.md) on the platform-services
|
|
3
|
+
* conformance app.
|
|
4
|
+
*
|
|
5
|
+
* `journal.find` declares a table over its `entries`, `journal.summary` markdown, `journal.write` a card. The kit
|
|
6
|
+
* checks that the implementation refuses, at startup, a renderer that names a field its output does not have (or
|
|
7
|
+
* a table over something that is not a list of records), publishes every declared renderer in the module's
|
|
8
|
+
* manifest, that a result renders to a headless view holding only the fields the renderer names (the same view
|
|
9
|
+
* from every surface's envelope), and that an agent gets compact text bounded in characters and rows that says
|
|
10
|
+
* what it left out.
|
|
11
|
+
*
|
|
12
|
+
* Usage, in a Vitest file: `resultRenderingConformance(() => startMyKernel())`.
|
|
13
|
+
*/
|
|
14
|
+
import {
|
|
15
|
+
compactResult,
|
|
16
|
+
defineModuleContract,
|
|
17
|
+
type AnyAction,
|
|
18
|
+
type RenderDeclaration,
|
|
19
|
+
renderResult,
|
|
20
|
+
} from "@eloxiv/contracts"
|
|
21
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest"
|
|
22
|
+
import type { InboxOutcome, InboxSurface, InboxUser } from "./InboxSubject.ts"
|
|
23
|
+
import type { ServicesSubject, StartServicesSubject } from "./ServicesSubject.ts"
|
|
24
|
+
|
|
25
|
+
const ORG = "acme"
|
|
26
|
+
|
|
27
|
+
export const resultRenderingConformance = (start: StartServicesSubject) =>
|
|
28
|
+
describe("ResultRendering contract", () => {
|
|
29
|
+
let s: ServicesSubject
|
|
30
|
+
let alice: InboxUser
|
|
31
|
+
|
|
32
|
+
const call = (who: InboxUser, action: string, input: unknown, surface: InboxSurface = "internal") =>
|
|
33
|
+
s.invoke({ action, input, token: who.token, surface })
|
|
34
|
+
const ok = (outcome: InboxOutcome) => {
|
|
35
|
+
if (!outcome.ok) throw new Error(`call failed: ${JSON.stringify(outcome)}`)
|
|
36
|
+
return (outcome.result as { output: Record<string, unknown> }).output
|
|
37
|
+
}
|
|
38
|
+
const findRenderer = () =>
|
|
39
|
+
(s.manifest("journal") as { actions: Record<string, { render?: RenderDeclaration }> }).actions["journal.find"]!
|
|
40
|
+
.render!
|
|
41
|
+
/** The journal module with `journal.find` declaring another renderer. */
|
|
42
|
+
const withFindRenderer = (render: unknown) =>
|
|
43
|
+
s.problems("journal", (c) => {
|
|
44
|
+
const find = (c.actions as Record<string, AnyAction>)["find"]!
|
|
45
|
+
return defineModuleContract({
|
|
46
|
+
...c,
|
|
47
|
+
actions: { ...c.actions, find: { ...find, render: render as RenderDeclaration } },
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
beforeAll(async () => {
|
|
52
|
+
s = await start()
|
|
53
|
+
alice = await s.user("alice", ORG)
|
|
54
|
+
for (let i = 0; i < 30; i++) {
|
|
55
|
+
ok(
|
|
56
|
+
await call(alice, "journal.write", {
|
|
57
|
+
title: `entry ${String(i).padStart(2, "0")}`,
|
|
58
|
+
body: `secret body ${i}`,
|
|
59
|
+
visibility: "org",
|
|
60
|
+
}),
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
}, 120_000)
|
|
64
|
+
afterAll(() => s?.dispose())
|
|
65
|
+
|
|
66
|
+
it("refuses at startup a renderer that does not fit its output", async () => {
|
|
67
|
+
expect(await withFindRenderer({ kind: "table", rows: "entries", columns: [{ field: "title" }] })).toEqual([])
|
|
68
|
+
const unknownColumn = await withFindRenderer({ kind: "table", rows: "entries", columns: [{ field: "author" }] })
|
|
69
|
+
expect(unknownColumn.some((p) => /journal\.find's renderer names unknown field author of each row/.test(p))).toBe(
|
|
70
|
+
true,
|
|
71
|
+
)
|
|
72
|
+
const notAList = await withFindRenderer({ kind: "table", rows: "total", columns: [{ field: "title" }] })
|
|
73
|
+
expect(notAList.some((p) => /journal\.find's renderer names rows field total, which is not a list/.test(p))).toBe(
|
|
74
|
+
true,
|
|
75
|
+
)
|
|
76
|
+
const card = await withFindRenderer({ kind: "card", title: "headline", fields: [] })
|
|
77
|
+
expect(card.some((p) => /names unknown field headline of the output/.test(p))).toBe(true)
|
|
78
|
+
const nonsense = await withFindRenderer({ kind: "gauge", series: [] })
|
|
79
|
+
expect(
|
|
80
|
+
nonsense.some((p) =>
|
|
81
|
+
/is not a table, card, list, markdown, chart, metric, change, file or progress renderer/.test(p),
|
|
82
|
+
),
|
|
83
|
+
).toBe(true)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it("publishes each declared renderer in the module's manifest", async () => {
|
|
87
|
+
const manifest = s.manifest("journal") as { actions: Record<string, { render?: unknown }> }
|
|
88
|
+
expect(manifest.actions["journal.find"]?.render).toEqual({
|
|
89
|
+
kind: "table",
|
|
90
|
+
title: "Journal",
|
|
91
|
+
rows: "entries",
|
|
92
|
+
columns: [{ field: "title" }, { field: "visibility" }, { field: "id", label: "Entry", format: "id" }],
|
|
93
|
+
})
|
|
94
|
+
expect(manifest.actions["journal.summary"]?.render).toEqual({ kind: "markdown", field: "markdown" })
|
|
95
|
+
expect(manifest.actions["journal.edit"]?.render).toBeUndefined()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it("renders a result to a headless view holding only the fields its renderer names, the same from every surface", async () => {
|
|
99
|
+
const render = findRenderer()
|
|
100
|
+
const views = []
|
|
101
|
+
for (const surface of ["internal", "http", "rpc", "mcp"] as const) {
|
|
102
|
+
views.push(renderResult(render, ok(await call(alice, "journal.find", {}, surface)), { maxRows: 10 }))
|
|
103
|
+
}
|
|
104
|
+
for (const view of views) expect(view).toEqual(views[0])
|
|
105
|
+
const view = views[0]!
|
|
106
|
+
if (view.kind !== "table") throw new Error(`expected a table, got ${view.kind}`)
|
|
107
|
+
expect(view.title).toBe("Journal")
|
|
108
|
+
expect(view.columns).toEqual([
|
|
109
|
+
{ key: "title", label: "Title", format: "text" },
|
|
110
|
+
{ key: "visibility", label: "Visibility", format: "text" },
|
|
111
|
+
{ key: "id", label: "Entry", format: "id" },
|
|
112
|
+
])
|
|
113
|
+
expect(view.rows).toHaveLength(10)
|
|
114
|
+
expect(view).toMatchObject({ totalRows: 30, truncated: true })
|
|
115
|
+
// Only what the renderer names: the bodies stay out of the view.
|
|
116
|
+
expect(JSON.stringify(view)).not.toContain("secret body")
|
|
117
|
+
expect(Object.keys(view.rows[0]!).sort()).toEqual(["id", "title", "visibility"])
|
|
118
|
+
// An output of another shape is shown as it is, never refused.
|
|
119
|
+
expect(renderResult(render, { unexpected: true })).toEqual({ kind: "json", value: { unexpected: true } })
|
|
120
|
+
const markdown = renderResult(
|
|
121
|
+
{ kind: "markdown", field: "markdown" },
|
|
122
|
+
ok(await call(alice, "journal.summary", {})),
|
|
123
|
+
)
|
|
124
|
+
expect(markdown).toMatchObject({ kind: "markdown", truncated: false })
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it("gives an agent compact text, bounded in characters and rows, that says what it left out", async () => {
|
|
128
|
+
const result = await s.agentTool(alice, "journal.find", {})
|
|
129
|
+
expect(result.ok).toBe(true)
|
|
130
|
+
expect(result.rendered).toBeDefined()
|
|
131
|
+
const text = result.rendered!
|
|
132
|
+
expect(text.length).toBeLessThanOrEqual(2_000)
|
|
133
|
+
expect(text.split("\n").slice(0, 3)).toEqual(["Journal", "| Title | Visibility | Entry |", "| --- | --- | --- |"])
|
|
134
|
+
expect(text).toContain("| entry 00 | org |")
|
|
135
|
+
expect(text).toMatch(/\(10 more rows not shown; 30 in all\)/)
|
|
136
|
+
expect(text).not.toContain("secret body")
|
|
137
|
+
// The envelope stays complete beside it.
|
|
138
|
+
expect((result.output as { output: { total: number } }).output.total).toBe(30)
|
|
139
|
+
// Without a declared renderer the agent gets the envelope only.
|
|
140
|
+
const plain = await s.agentTool(alice, "journal.edit", { id: "missing", title: "x" })
|
|
141
|
+
expect(plain.rendered).toBeUndefined()
|
|
142
|
+
// Bounded in characters, whatever the output.
|
|
143
|
+
const tight = compactResult(renderResult(findRenderer(), ok(await call(alice, "journal.find", {}))), {
|
|
144
|
+
maxChars: 200,
|
|
145
|
+
})
|
|
146
|
+
expect(tight.length).toBeLessThanOrEqual(200)
|
|
147
|
+
expect(tight).toMatch(/cut at 200 characters/)
|
|
148
|
+
})
|
|
149
|
+
})
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Sandbox conformance kit (docs/contracts/sandbox.md). `sandboxConformance(subject)` registers what code run
|
|
3
|
+
* in the sandbox can and cannot do:
|
|
4
|
+
*
|
|
5
|
+
* - it computes with the language built-ins and reaches the host only through the granted `eloxiv.<name>`
|
|
6
|
+
* functions, with JSON values crossing both ways;
|
|
7
|
+
* - it has no network (`fetch`, `XMLHttpRequest`, `WebSocket`), file system, process, module loader (`import`,
|
|
8
|
+
* `require`), timers (`setTimeout`, `setInterval`) or host internals (`__eloxiv_host` is gone), and an
|
|
9
|
+
* ungranted host function does not exist;
|
|
10
|
+
* - a host refusal fails the run even when the code catches it;
|
|
11
|
+
* - each limit stops the run: time (busy loops, and awaiting forever), steps, memory, stack, host calls and
|
|
12
|
+
* output;
|
|
13
|
+
* - runs share nothing: globals and prototype changes never reach the next run or the host;
|
|
14
|
+
* - `check` lists exports and reports code that does not compile.
|
|
15
|
+
*/
|
|
16
|
+
import type { SandboxLimits } from "@eloxiv/contracts"
|
|
17
|
+
import { describe, expect, it } from "vitest"
|
|
18
|
+
|
|
19
|
+
/** A host function as the kit writes one: a JSON value, or a refusal of the named capability. */
|
|
20
|
+
export type KitHostFunction = (
|
|
21
|
+
args: ReadonlyArray<unknown>,
|
|
22
|
+
) => Promise<{ readonly value: unknown } | { readonly refuse: string }>
|
|
23
|
+
|
|
24
|
+
export type SandboxKitOutcome =
|
|
25
|
+
| {
|
|
26
|
+
readonly ok: true
|
|
27
|
+
readonly value: unknown
|
|
28
|
+
readonly usage: { readonly steps: number; readonly hostCalls: number }
|
|
29
|
+
}
|
|
30
|
+
| {
|
|
31
|
+
readonly ok: false
|
|
32
|
+
readonly error: {
|
|
33
|
+
readonly _tag: string
|
|
34
|
+
readonly limit?: string
|
|
35
|
+
readonly capability?: string
|
|
36
|
+
readonly message: string
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface SandboxSubject {
|
|
41
|
+
readonly run: (request: {
|
|
42
|
+
readonly code: string
|
|
43
|
+
readonly entry: string
|
|
44
|
+
readonly args?: ReadonlyArray<unknown>
|
|
45
|
+
readonly host?: Readonly<Record<string, KitHostFunction>>
|
|
46
|
+
readonly limits?: Partial<SandboxLimits>
|
|
47
|
+
}) => Promise<SandboxKitOutcome>
|
|
48
|
+
readonly check: (
|
|
49
|
+
code: string,
|
|
50
|
+
) => Promise<
|
|
51
|
+
| { readonly ok: true; readonly exports: ReadonlyArray<string> }
|
|
52
|
+
| { readonly ok: false; readonly error: { readonly _tag: string } }
|
|
53
|
+
>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const fn = (body: string) => `export async function main(...args) { ${body} }`
|
|
57
|
+
|
|
58
|
+
export const sandboxConformance = (subject: () => SandboxSubject) =>
|
|
59
|
+
describe("Sandbox conformance", () => {
|
|
60
|
+
const run = (code: string, options: Omit<Parameters<SandboxSubject["run"]>[0], "code" | "entry"> = {}) =>
|
|
61
|
+
subject().run({ code, entry: "main", ...options })
|
|
62
|
+
const failure = (outcome: SandboxKitOutcome) => {
|
|
63
|
+
if (outcome.ok) throw new Error(`Expected the run to fail; it returned ${JSON.stringify(outcome.value)}`)
|
|
64
|
+
return outcome.error
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
it("runs an export with JSON arguments and returns JSON, reaching only the granted host functions", async () => {
|
|
68
|
+
const seen: Array<unknown> = []
|
|
69
|
+
const outcome = await subject().run({
|
|
70
|
+
code: `export const actions = { async add(input) { const r = await eloxiv.store(input.title, { n: input.n }); return { stored: r, keys: Object.keys(eloxiv) } } }`,
|
|
71
|
+
entry: "actions.add",
|
|
72
|
+
args: [{ title: "milk", n: 2 }],
|
|
73
|
+
host: {
|
|
74
|
+
store: async (args) => {
|
|
75
|
+
seen.push(args)
|
|
76
|
+
return { value: { id: "x1" } }
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
expect(outcome).toMatchObject({ ok: true, value: { stored: { id: "x1" }, keys: ["store"] } })
|
|
81
|
+
expect(seen).toEqual([["milk", { n: 2 }]])
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it.each([
|
|
85
|
+
["fetch", `return typeof fetch`],
|
|
86
|
+
["XMLHttpRequest", `return typeof XMLHttpRequest`],
|
|
87
|
+
["WebSocket", `return typeof WebSocket`],
|
|
88
|
+
["setTimeout", `return typeof setTimeout`],
|
|
89
|
+
["setInterval", `return typeof setInterval`],
|
|
90
|
+
["require", `return typeof require`],
|
|
91
|
+
["process", `return typeof process`],
|
|
92
|
+
["Bun", `return typeof Bun`],
|
|
93
|
+
["Deno", `return typeof Deno`],
|
|
94
|
+
["the host's native bridge", `return typeof __eloxiv_host`],
|
|
95
|
+
["the host's globals", `return typeof globalThis.Buffer + typeof globalThis.global`],
|
|
96
|
+
])("has no %s", async (_what, body) => {
|
|
97
|
+
const outcome = await run(fn(body))
|
|
98
|
+
expect(outcome.ok && String(outcome.value)).toMatch(/^(undefined)+$/u)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it.each([
|
|
102
|
+
["a static import", `import fs from "node:fs"; export async function main() { return fs }`],
|
|
103
|
+
["a dynamic import", fn(`return (await import("node:fs")).readFileSync("/etc/passwd", "utf8")`)],
|
|
104
|
+
["a network call", fn(`return await fetch("http://127.0.0.1:1/")`)],
|
|
105
|
+
["the file system", fn(`return require("fs").readFileSync("/etc/passwd")`)],
|
|
106
|
+
["the process", fn(`return process.env`)],
|
|
107
|
+
["a timer", fn(`return await new Promise((r) => setTimeout(r, 1))`)],
|
|
108
|
+
])("cannot reach %s", async (_what, code) => {
|
|
109
|
+
expect(failure(await run(code))._tag).toBe("SandboxCodeFailed")
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("cannot call a host function it was not granted, by name or through the bridge", async () => {
|
|
113
|
+
const host = { allowed: async () => ({ value: 1 }) }
|
|
114
|
+
const direct = await run(fn(`return await eloxiv.secrets("all")`), { host })
|
|
115
|
+
expect(failure(direct)._tag).toBe("SandboxCodeFailed")
|
|
116
|
+
const frozen = await run(
|
|
117
|
+
fn(`try { eloxiv.secrets = () => 1 } catch {} return Object.isFrozen(eloxiv) && eloxiv.secrets === undefined`),
|
|
118
|
+
{ host },
|
|
119
|
+
)
|
|
120
|
+
expect(frozen).toMatchObject({ ok: true, value: true })
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it("fails a run whose host refused a capability, even when the code catches the refusal", async () => {
|
|
124
|
+
const outcome = await run(
|
|
125
|
+
fn(
|
|
126
|
+
`try { await eloxiv.write("other_module.table") } catch (e) { return "caught: " + e.message } return "not refused"`,
|
|
127
|
+
),
|
|
128
|
+
{ host: { write: async () => ({ refuse: "sql:other_module.table" }) } },
|
|
129
|
+
)
|
|
130
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxCapabilityRefused", capability: "sql:other_module.table" })
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
it("stops a busy loop at its time limit", async () => {
|
|
134
|
+
const started = Date.now()
|
|
135
|
+
const outcome = await run(fn(`for (;;) {}`), { limits: { timeMs: 200, steps: 100_000_000 } })
|
|
136
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "time" })
|
|
137
|
+
expect(Date.now() - started).toBeLessThan(5_000)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it("stops computation at its step limit, whatever its time limit", async () => {
|
|
141
|
+
const outcome = await run(fn(`let n = 0; for (;;) n++`), { limits: { timeMs: 10_000, steps: 50 } })
|
|
142
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "steps" })
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it("does not wait for a promise that never settles, nor a host call past the time limit", async () => {
|
|
146
|
+
const started = Date.now()
|
|
147
|
+
const never = await run(fn(`return await new Promise(() => {})`))
|
|
148
|
+
expect(failure(never)._tag).toBe("SandboxCodeFailed")
|
|
149
|
+
const slow = await run(fn(`return await eloxiv.slow()`), {
|
|
150
|
+
host: { slow: () => new Promise((resolve) => setTimeout(() => resolve({ value: 1 }), 5_000)) },
|
|
151
|
+
limits: { timeMs: 200 },
|
|
152
|
+
})
|
|
153
|
+
expect(failure(slow)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "time" })
|
|
154
|
+
expect(Date.now() - started).toBeLessThan(4_000)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
it("stops at its memory limit", async () => {
|
|
158
|
+
const outcome = await run(fn(`const a = []; for (;;) a.push("x".repeat(1024) + a.length)`), {
|
|
159
|
+
limits: { memoryBytes: 4 * 1024 * 1024, steps: 1_000_000, timeMs: 10_000 },
|
|
160
|
+
})
|
|
161
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "memory" })
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it("stops runaway recursion at its stack limit", async () => {
|
|
165
|
+
const outcome = await run(fn(`const f = (n) => f(n + 1) + 1; return f(0)`))
|
|
166
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "stack" })
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
it("stops at its host call limit", async () => {
|
|
170
|
+
let calls = 0
|
|
171
|
+
const outcome = await run(fn(`for (;;) await eloxiv.ping()`), {
|
|
172
|
+
host: { ping: async () => ({ value: ++calls }) },
|
|
173
|
+
limits: { hostCalls: 5 },
|
|
174
|
+
})
|
|
175
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "hostCalls" })
|
|
176
|
+
expect(calls).toBe(5)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
it("refuses output, and host arguments, larger than its limit", async () => {
|
|
180
|
+
const big = await run(fn(`return "x".repeat(4096)`), { limits: { outputBytes: 1024 } })
|
|
181
|
+
expect(failure(big)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "output" })
|
|
182
|
+
let called = false
|
|
183
|
+
const args = await run(fn(`return await eloxiv.store("x".repeat(4096))`), {
|
|
184
|
+
host: { store: async () => ((called = true), { value: 1 }) },
|
|
185
|
+
limits: { outputBytes: 1024 },
|
|
186
|
+
})
|
|
187
|
+
expect(failure(args)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "output" })
|
|
188
|
+
expect(called).toBe(false)
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it("shares nothing between runs, nor with the host", async () => {
|
|
192
|
+
const first = await run(
|
|
193
|
+
fn(`globalThis.leak = "first"; Object.prototype.polluted = "yes"; Array.prototype.push = null; return 1`),
|
|
194
|
+
)
|
|
195
|
+
expect(first.ok).toBe(true)
|
|
196
|
+
const second = await run(fn(`return [typeof globalThis.leak, typeof ({}).polluted]`))
|
|
197
|
+
expect(second).toMatchObject({ ok: true, value: ["undefined", "undefined"] })
|
|
198
|
+
expect(({} as Record<string, unknown>)["polluted"]).toBeUndefined()
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
it("passes only JSON out: a function becomes null, a cycle fails the run", async () => {
|
|
202
|
+
expect(await run(fn(`return () => 1`))).toMatchObject({ ok: true, value: null })
|
|
203
|
+
const cycle = await run(fn(`const a = {}; a.a = a; return a`))
|
|
204
|
+
expect(failure(cycle)._tag).toBe("SandboxCodeFailed")
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
it("reports a throw, a rejection and a missing entry as the code's failure", async () => {
|
|
208
|
+
expect(failure(await run(fn(`throw new Error("boom")`)))).toMatchObject({
|
|
209
|
+
_tag: "SandboxCodeFailed",
|
|
210
|
+
message: expect.stringContaining("boom"),
|
|
211
|
+
})
|
|
212
|
+
expect(failure(await run(fn(`return Promise.reject(new Error("nope"))`)))._tag).toBe("SandboxCodeFailed")
|
|
213
|
+
expect(failure(await subject().run({ code: fn("return 1"), entry: "other" }))._tag).toBe("SandboxCodeFailed")
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
const healthy = async () => {
|
|
217
|
+
const outcome = await run(
|
|
218
|
+
fn(`const a = []; for (let j = 0; j < 50; j++) a.push("z".repeat(100000) + j); return a.length`),
|
|
219
|
+
)
|
|
220
|
+
expect(outcome, "a later, unrelated run").toMatchObject({ ok: true, value: 50 })
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
it.each([
|
|
224
|
+
["deep JSON.parse", fn(`JSON.parse("[".repeat(300000) + "]".repeat(300000)); return 1`)],
|
|
225
|
+
[
|
|
226
|
+
"deep JSON.stringify",
|
|
227
|
+
fn(`let v = []; for (let i = 0; i < 300000; i++) v = [v]; return JSON.stringify(v).length`),
|
|
228
|
+
],
|
|
229
|
+
["a deep regular expression", fn(`return new RegExp("(".repeat(100000) + "a" + ")".repeat(100000)).test("a")`)],
|
|
230
|
+
["deep host-call arguments", fn(`await eloxiv.h(JSON.parse("[".repeat(100000) + "]".repeat(100000))); return 1`)],
|
|
231
|
+
])("stops only itself under %s: the run fails, the next one runs", async (_what, code) => {
|
|
232
|
+
let called = false
|
|
233
|
+
const outcome = await run(code, { host: { h: async () => ((called = true), { value: null }) } })
|
|
234
|
+
expect(outcome.ok).toBe(false)
|
|
235
|
+
expect(called).toBe(false)
|
|
236
|
+
await healthy()
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
it("stays healthy across many hostile runs", async () => {
|
|
240
|
+
for (let i = 0; i < 25; i++) {
|
|
241
|
+
const outcome = await run(
|
|
242
|
+
fn(
|
|
243
|
+
`const pad = []; for (let j = 0; j < 100; j++) pad.push("y".repeat(200000) + j); JSON.parse("[".repeat(300000) + "]".repeat(300000)); return pad.length`,
|
|
244
|
+
),
|
|
245
|
+
{ limits: { memoryBytes: 64 * 1024 * 1024 } },
|
|
246
|
+
)
|
|
247
|
+
expect(outcome.ok).toBe(false)
|
|
248
|
+
}
|
|
249
|
+
await healthy()
|
|
250
|
+
}, 120_000)
|
|
251
|
+
|
|
252
|
+
it("refuses host calls that queue up unawaited, where the code makes them", async () => {
|
|
253
|
+
let calls = 0
|
|
254
|
+
const outcome = await run(
|
|
255
|
+
fn(`const big = "x".repeat(30000); for (let i = 0; i < 1500; i++) eloxiv.h(big); await eloxiv.h(1); return 1`),
|
|
256
|
+
{
|
|
257
|
+
host: { h: async () => ((calls += 1), { value: null }) },
|
|
258
|
+
limits: { outputBytes: 4 * 1024 * 1024, memoryBytes: 64 * 1024 * 1024, timeMs: 10_000, steps: 200_000 },
|
|
259
|
+
},
|
|
260
|
+
)
|
|
261
|
+
expect(failure(outcome)._tag).toBe("SandboxLimitExceeded")
|
|
262
|
+
expect(calls).toBeLessThan(20)
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
it("fails a run that returns while host calls it made still wait, and runs none of them", async () => {
|
|
266
|
+
let called = false
|
|
267
|
+
const outcome = await run(fn(`eloxiv.h(); return "ok"`), {
|
|
268
|
+
host: { h: async () => ((called = true), { value: 1 }) },
|
|
269
|
+
})
|
|
270
|
+
expect(failure(outcome)._tag).toBe("SandboxCodeFailed")
|
|
271
|
+
expect(called).toBe(false)
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
it("keeps its result envelope when the code redefines promises", async () => {
|
|
275
|
+
const outcome = await run(fn(`Promise.prototype.then = function () { return "not json" }; return 1`))
|
|
276
|
+
expect(outcome).toMatchObject({ ok: true, value: 1 })
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
it("never blocks its host: the host answers while code loops", async () => {
|
|
280
|
+
let longest = 0
|
|
281
|
+
let last = Date.now()
|
|
282
|
+
const timer = setInterval(() => {
|
|
283
|
+
const now = Date.now()
|
|
284
|
+
longest = Math.max(longest, now - last)
|
|
285
|
+
last = now
|
|
286
|
+
}, 10)
|
|
287
|
+
const outcome = await run(fn(`for (;;) {}`), { limits: { timeMs: 1_500, steps: 100_000_000 } })
|
|
288
|
+
// (Let the timer see any stall that just ended.)
|
|
289
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
290
|
+
clearInterval(timer)
|
|
291
|
+
expect(failure(outcome)).toMatchObject({ _tag: "SandboxLimitExceeded", limit: "time" })
|
|
292
|
+
expect(longest).toBeLessThan(250)
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
it("checks a module: its exports, or why it does not compile", async () => {
|
|
296
|
+
const checked = await subject().check(
|
|
297
|
+
`export const actions = { async add() {}, async remove() {} }; export function helper() {}; export const n = 1`,
|
|
298
|
+
)
|
|
299
|
+
expect(checked).toMatchObject({ ok: true })
|
|
300
|
+
expect(checked.ok ? [...checked.exports].sort() : []).toEqual([
|
|
301
|
+
"actions",
|
|
302
|
+
"actions.add",
|
|
303
|
+
"actions.remove",
|
|
304
|
+
"helper",
|
|
305
|
+
"n",
|
|
306
|
+
])
|
|
307
|
+
expect(await subject().check(`export const = ;`)).toMatchObject({
|
|
308
|
+
ok: false,
|
|
309
|
+
error: { _tag: "SandboxCodeFailed" },
|
|
310
|
+
})
|
|
311
|
+
expect(await subject().check(`for (;;) {}`)).toMatchObject({ ok: false, error: { _tag: "SandboxLimitExceeded" } })
|
|
312
|
+
})
|
|
313
|
+
})
|