@eloxiv/testing 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +905 -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 +62 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +526 -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 +1072 -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 +651 -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,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HttpApi conformance kit (docs/contracts/http-api.md): any HTTP API over a kernel endpoint Connection, against the
|
|
3
|
+
* HTTP API protocol fake (an OpenAPI document, paged items, a reading POST, a write, a large answer, a redirect away).
|
|
4
|
+
* Run it with a subject whose kernel installs an endpoint connector providing `api` (the registry's `http-openapi`)
|
|
5
|
+
* and allows only the fakes' hosts as private destinations; the fake's second server ("elsewhere") is allowed too, so
|
|
6
|
+
* what keeps a credential from it is the Connection's origin, not the destination policy.
|
|
7
|
+
*/
|
|
8
|
+
import type { Connection } from "@eloxiv/contracts"
|
|
9
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest"
|
|
10
|
+
import { startHttpApiFake, type HttpApiFake } from "../fakes/HttpApiFake.ts"
|
|
11
|
+
import type { CallResult } from "./CapabilityKit.ts"
|
|
12
|
+
import type { EndpointSubject } from "./EndpointReference.ts"
|
|
13
|
+
|
|
14
|
+
const ok = (result: CallResult): any => {
|
|
15
|
+
if (!result.ok) throw new Error(`Expected success, got ${JSON.stringify(result.error)}`)
|
|
16
|
+
return result.value
|
|
17
|
+
}
|
|
18
|
+
const failed = (result: CallResult): any => {
|
|
19
|
+
if (result.ok) throw new Error(`Expected a failure, got ${JSON.stringify(result.value)}`)
|
|
20
|
+
return result.error
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const httpApiConformance = (
|
|
24
|
+
start: (allow: ReadonlyArray<string>) => Promise<EndpointSubject>,
|
|
25
|
+
options: { readonly provider?: string } = {},
|
|
26
|
+
) => {
|
|
27
|
+
const provider = options.provider ?? "http-openapi"
|
|
28
|
+
describe("HttpApi contract", () => {
|
|
29
|
+
let s: EndpointSubject
|
|
30
|
+
let api: HttpApiFake
|
|
31
|
+
let connection: Connection
|
|
32
|
+
const KEY = "api-key-value-0123456789abcdef"
|
|
33
|
+
|
|
34
|
+
beforeAll(async () => {
|
|
35
|
+
api = await startHttpApiFake({ key: KEY })
|
|
36
|
+
s = await start([api.host, api.otherHost])
|
|
37
|
+
const put = await s.secrets(s.owner, "put", {
|
|
38
|
+
scope: { kind: "user", orgId: s.owner.org, userId: s.owner.id },
|
|
39
|
+
name: "items-key",
|
|
40
|
+
value: KEY,
|
|
41
|
+
})
|
|
42
|
+
if (put.status !== 200) throw new Error(JSON.stringify(put.body))
|
|
43
|
+
connection = ok(
|
|
44
|
+
await s.action(s.owner, "connections.add", {
|
|
45
|
+
provider,
|
|
46
|
+
endpoint: api.endpoint,
|
|
47
|
+
auth: { kind: "secret", scope: "user", name: "items-key", header: "x-api-key" },
|
|
48
|
+
options: { openapi: "/openapi.json", readOnlyPosts: ["/search"] },
|
|
49
|
+
}),
|
|
50
|
+
).connection
|
|
51
|
+
}, 120_000)
|
|
52
|
+
afterAll(async () => {
|
|
53
|
+
await s?.dispose()
|
|
54
|
+
await api?.close()
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const read = (input: Record<string, unknown>) =>
|
|
58
|
+
s.action(s.owner, "connections.apiRead", { connectionId: connection.id, method: "GET", ...input })
|
|
59
|
+
|
|
60
|
+
it("lists the OpenAPI document's operations and tells reads from writes", async () => {
|
|
61
|
+
const catalog = ok(await s.action(s.owner, "connections.apiCatalog", { connectionId: connection.id }))
|
|
62
|
+
expect(catalog.title).toBe("Items API")
|
|
63
|
+
expect(catalog.operations).toEqual([
|
|
64
|
+
{ id: "listItems", method: "GET", path: "/items", summary: "List items", readOnly: true },
|
|
65
|
+
{ id: "createItem", method: "POST", path: "/items", summary: "Create an item", readOnly: false },
|
|
66
|
+
{ id: "search", method: "POST", path: "/search", summary: "Search items", readOnly: true },
|
|
67
|
+
{ id: "deleteItem", method: "DELETE", path: "/items/{id}", summary: null, readOnly: false },
|
|
68
|
+
])
|
|
69
|
+
const described = ok(
|
|
70
|
+
await s.action(s.owner, "connections.apiDescribe", { connectionId: connection.id, operationId: "listItems" }),
|
|
71
|
+
)
|
|
72
|
+
expect(described.parameters).toEqual([{ name: "page", in: "query" }])
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("reads with the secret in its header, following next links only on the same API, up to the pages asked", async () => {
|
|
76
|
+
const elsewhere = api.elsewhere.length
|
|
77
|
+
const { pages } = ok(await read({ path: "/items", maxPages: 10 }))
|
|
78
|
+
// Pages 1 to 3; page 3's next link is another origin, which is not followed.
|
|
79
|
+
expect(pages.map((p: any) => p.body.page)).toEqual([1, 2, 3])
|
|
80
|
+
expect(api.elsewhere.length).toBe(elsewhere)
|
|
81
|
+
expect(ok(await read({ path: "/items", maxPages: 2 })).pages).toHaveLength(2)
|
|
82
|
+
expect(api.requests.filter((r) => r.path === "/api/items").every((r) => r.headers["x-api-key"] === KEY)).toBe(
|
|
83
|
+
true,
|
|
84
|
+
)
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it("keeps every request under the base URL and refuses credential headers, sending nothing", async () => {
|
|
88
|
+
const before = api.requests.length
|
|
89
|
+
for (const path of [
|
|
90
|
+
"../private",
|
|
91
|
+
"/../private",
|
|
92
|
+
"%2e%2e/private",
|
|
93
|
+
"https://evil.example/x",
|
|
94
|
+
"//evil.example/x",
|
|
95
|
+
]) {
|
|
96
|
+
expect(failed(await read({ path })), path).toMatchObject({ _tag: "InvalidInput" })
|
|
97
|
+
}
|
|
98
|
+
for (const header of ["authorization", "cookie", "x-forwarded-for", "Proxy-Authorization"]) {
|
|
99
|
+
expect(failed(await read({ path: "/items", headers: { [header]: "x" } })), header).toMatchObject({
|
|
100
|
+
_tag: "InvalidInput",
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
expect(api.requests.length).toBe(before)
|
|
104
|
+
expect(api.requests.some((r) => r.path === "/private")).toBe(false)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it("follows a redirect to another origin without the secret", async () => {
|
|
108
|
+
const { pages } = ok(await read({ path: "/away" }))
|
|
109
|
+
expect(pages[0]).toMatchObject({ status: 200, body: { landed: true } })
|
|
110
|
+
const landed = api.elsewhere.findLast((r) => r.path === "/landing")!
|
|
111
|
+
expect(landed.headers["x-api-key"]).toBeUndefined()
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it("follows a redirect without reading its body", async () => {
|
|
115
|
+
const started = Date.now()
|
|
116
|
+
const { pages } = ok(await read({ path: "/endless-redirect" }))
|
|
117
|
+
expect(pages[0]).toMatchObject({ status: 200, body: { page: 1 } })
|
|
118
|
+
expect(Date.now() - started).toBeLessThan(5_000)
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it("refuses a redirect to an address that is not public", async () => {
|
|
122
|
+
expect(failed(await read({ path: "/metadata" }))).toMatchObject({ _tag: "InvalidInput" })
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it("reads with a POST only where the Connection names it, and writes only through apiWrite", async () => {
|
|
126
|
+
expect(ok(await read({ method: "POST", path: "/search", json: { q: "a" } })).pages[0]).toMatchObject({
|
|
127
|
+
body: { hits: 1 },
|
|
128
|
+
})
|
|
129
|
+
const writes = api.writes.length
|
|
130
|
+
expect(failed(await read({ method: "POST", path: "/items", json: { name: "x" } }))).toMatchObject({
|
|
131
|
+
_tag: "InvalidInput",
|
|
132
|
+
})
|
|
133
|
+
expect(api.writes.length).toBe(writes)
|
|
134
|
+
const written = ok(
|
|
135
|
+
await s.action(s.owner, "connections.apiWrite", {
|
|
136
|
+
connectionId: connection.id,
|
|
137
|
+
method: "POST",
|
|
138
|
+
path: "/items",
|
|
139
|
+
json: { name: "x" },
|
|
140
|
+
}),
|
|
141
|
+
)
|
|
142
|
+
expect(written).toMatchObject({ status: 201, body: { created: { name: "x" } } })
|
|
143
|
+
expect(api.writes.length).toBe(writes + 1)
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
it("holds every agent's write for the person's consent", async () => {
|
|
147
|
+
const writes = api.writes.length
|
|
148
|
+
for (const name of ["one", "two"]) {
|
|
149
|
+
const held = failed(
|
|
150
|
+
await s.action(
|
|
151
|
+
s.owner,
|
|
152
|
+
"connections.apiWrite",
|
|
153
|
+
{ connectionId: connection.id, method: "POST", path: "/items", json: { name } },
|
|
154
|
+
"agent",
|
|
155
|
+
),
|
|
156
|
+
)
|
|
157
|
+
expect(held).toMatchObject({ _tag: "ConsentRequired" })
|
|
158
|
+
}
|
|
159
|
+
expect(api.writes.length).toBe(writes)
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
it("cuts an answer past the bound and says so", async () => {
|
|
163
|
+
const [page] = ok(await read({ path: "/big" })).pages
|
|
164
|
+
expect(page.truncated).toBe(true)
|
|
165
|
+
expect(typeof page.body).toBe("string")
|
|
166
|
+
expect((page.body as string).length).toBeLessThanOrEqual(256 * 1024)
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Eloxiv kernel as an inbox conformance subject: an in-process kernel on a fresh database serving the
|
|
3
|
+
* inbox conformance app, with system email going to an SMTP server this process runs (`../SmtpSink.ts`).
|
|
4
|
+
* Calls reach the kernel on the surface each check names: the typed RPC client, HTTP, an MCP client, the
|
|
5
|
+
* agent tools (driven by a mock model), or in process.
|
|
6
|
+
*/
|
|
7
|
+
import { makeClient, signIn } from "@eloxiv/client"
|
|
8
|
+
import type { AuditFilter } from "@eloxiv/contracts"
|
|
9
|
+
import { Audit, Directory, Identity, Invocation, Notifications, PolicyCompiler, type KernelApp } from "@eloxiv/kernel"
|
|
10
|
+
import { Client as McpClient } from "@modelcontextprotocol/sdk/client/index.js"
|
|
11
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
|
|
12
|
+
import { Effect, Exit } from "effect"
|
|
13
|
+
import { resolve } from "node:path"
|
|
14
|
+
import { callAgentTool } from "../AgentSurface.ts"
|
|
15
|
+
import { adminQuery } from "../Admin.ts"
|
|
16
|
+
import { startKernel } from "../Kernel.ts"
|
|
17
|
+
import { startSmtpSink } from "../SmtpSink.ts"
|
|
18
|
+
import { defaultRuntime, dropDatabase } from "../System.ts"
|
|
19
|
+
import type { InboxCall, InboxOutcome, InboxSubject } from "./InboxSubject.ts"
|
|
20
|
+
import { inboxApp } from "./purchases/app.ts"
|
|
21
|
+
import type { SyncAnswer } from "./Subject.ts"
|
|
22
|
+
|
|
23
|
+
const root = resolve(import.meta.dirname, "../../../..")
|
|
24
|
+
/** The password of every user the reference makes. */
|
|
25
|
+
export const INBOX_PASSWORD = "inbox-password"
|
|
26
|
+
const PASSWORD = INBOX_PASSWORD
|
|
27
|
+
|
|
28
|
+
const failed = (error: unknown): InboxOutcome => {
|
|
29
|
+
const value = (error ?? {}) as { _tag?: string }
|
|
30
|
+
return {
|
|
31
|
+
ok: false,
|
|
32
|
+
error: {
|
|
33
|
+
...(value as object),
|
|
34
|
+
...(typeof (value as { message?: unknown }).message === "string"
|
|
35
|
+
? { message: (value as { message: string }).message }
|
|
36
|
+
: {}),
|
|
37
|
+
_tag: value._tag ?? "defect",
|
|
38
|
+
...(value._tag === undefined ? { cause: JSON.stringify(error)?.slice(0, 2000) } : {}),
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Evaluating a sync answer: the scoped query's `where` (Zero's AST) over the table's rows
|
|
45
|
+
|
|
46
|
+
type Ast = Record<string, any>
|
|
47
|
+
|
|
48
|
+
const literal = (value: Ast): unknown => (value["type"] === "literal" ? value["value"] : undefined)
|
|
49
|
+
|
|
50
|
+
type Rows = ReadonlyArray<Record<string, unknown>>
|
|
51
|
+
|
|
52
|
+
/** The kernel tables a scoped query's subqueries read (server names), as zero-cache's replica holds them. */
|
|
53
|
+
export const KERNEL_SYNC_TABLES = [
|
|
54
|
+
"eloxiv.share_grant",
|
|
55
|
+
"eloxiv.share_redemption",
|
|
56
|
+
"eloxiv.sync_fact",
|
|
57
|
+
"eloxiv.sync_org",
|
|
58
|
+
] as const
|
|
59
|
+
|
|
60
|
+
export const evaluate = (
|
|
61
|
+
condition: Ast | undefined,
|
|
62
|
+
row: Record<string, unknown>,
|
|
63
|
+
tables: Readonly<Record<string, Rows>>,
|
|
64
|
+
): boolean => {
|
|
65
|
+
if (condition === undefined) return true
|
|
66
|
+
switch (condition["type"]) {
|
|
67
|
+
case "and":
|
|
68
|
+
return (condition["conditions"] as Array<Ast>).every((c) => evaluate(c, row, tables))
|
|
69
|
+
case "or":
|
|
70
|
+
return (condition["conditions"] as Array<Ast>).some((c) => evaluate(c, row, tables))
|
|
71
|
+
case "simple": {
|
|
72
|
+
const left = row[condition["left"]["name"]]
|
|
73
|
+
const right = literal(condition["right"])
|
|
74
|
+
switch (condition["op"]) {
|
|
75
|
+
case "=":
|
|
76
|
+
return left !== null && left !== undefined && left === right
|
|
77
|
+
case "!=":
|
|
78
|
+
return left !== null && left !== undefined && left !== right
|
|
79
|
+
case "IN":
|
|
80
|
+
return Array.isArray(right) && right.includes(left)
|
|
81
|
+
case "IS":
|
|
82
|
+
return left === right || (right === null && left === undefined)
|
|
83
|
+
case "IS NOT":
|
|
84
|
+
return !(left === right || (right === null && left === undefined))
|
|
85
|
+
case "<":
|
|
86
|
+
return left !== null && left !== undefined && (left as number) < (right as number)
|
|
87
|
+
case "<=":
|
|
88
|
+
return left !== null && left !== undefined && (left as number) <= (right as number)
|
|
89
|
+
case ">":
|
|
90
|
+
return left !== null && left !== undefined && (left as number) > (right as number)
|
|
91
|
+
case ">=":
|
|
92
|
+
return left !== null && left !== undefined && (left as number) >= (right as number)
|
|
93
|
+
case "LIKE":
|
|
94
|
+
return typeof left === "string" && PolicyCompiler.likeMatches(left, String(right))
|
|
95
|
+
case "NOT LIKE":
|
|
96
|
+
return typeof left === "string" && !PolicyCompiler.likeMatches(left, String(right))
|
|
97
|
+
default:
|
|
98
|
+
throw new Error(`Unsupported operator ${condition["op"]}`)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
case "correlatedSubquery": {
|
|
102
|
+
// The kernel's subqueries (sharing grants, live directory facts): EXISTS a row of the subquery's table
|
|
103
|
+
// correlated with this record and matching the subquery's where.
|
|
104
|
+
const related = condition["related"]
|
|
105
|
+
const sub = related["subquery"]
|
|
106
|
+
const rows = tables[sub["table"] as string]
|
|
107
|
+
if (rows === undefined) throw new Error(`Unexpected subquery table ${String(sub["table"])}`)
|
|
108
|
+
const parents = related["correlation"]["parentField"] as ReadonlyArray<string>
|
|
109
|
+
const children = related["correlation"]["childField"] as ReadonlyArray<string>
|
|
110
|
+
const exists = rows.some(
|
|
111
|
+
(child) =>
|
|
112
|
+
parents.every((field, i) => child[children[i]!] === row[field]) && evaluate(sub["where"], child, tables),
|
|
113
|
+
)
|
|
114
|
+
return condition["op"] === "NOT EXISTS" ? !exists : exists
|
|
115
|
+
}
|
|
116
|
+
default:
|
|
117
|
+
throw new Error(`Unsupported condition ${JSON.stringify(condition).slice(0, 200)}`)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type InboxReference = InboxSubject & {
|
|
122
|
+
/** Run an effect against the kernel's services (for this kernel's own tests). */
|
|
123
|
+
readonly run: <A, E>(effect: Effect.Effect<A, E, any>) => Promise<A>
|
|
124
|
+
/** The kernel's base URL. */
|
|
125
|
+
readonly url: string
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const startInboxReference = async (options: {
|
|
129
|
+
readonly name: string
|
|
130
|
+
/** The inbox conformance app, or a variant of it (extra workflows, say). */
|
|
131
|
+
readonly app?: KernelApp | undefined
|
|
132
|
+
/** Kernel settings to override (the query surface's, say). */
|
|
133
|
+
readonly config?: Parameters<typeof startKernel>[0]["config"]
|
|
134
|
+
/** Kernel options beyond the defaults (a storage backend, a file scanner, further privacy sources). */
|
|
135
|
+
readonly options?: Parameters<typeof startKernel>[0]["options"]
|
|
136
|
+
}): Promise<InboxReference> => {
|
|
137
|
+
const database = `eloxiv_t_${options.name}_${defaultRuntime()}`
|
|
138
|
+
await dropDatabase(database, root)
|
|
139
|
+
const sink = await startSmtpSink()
|
|
140
|
+
const kernel = await startKernel({
|
|
141
|
+
app: options.app ?? inboxApp,
|
|
142
|
+
database,
|
|
143
|
+
email: { smtpUrl: sink.url, from: "Eloxiv <noreply@eloxiv.test>" },
|
|
144
|
+
config: options.config,
|
|
145
|
+
options: options.options,
|
|
146
|
+
})
|
|
147
|
+
const admin = adminQuery(database)
|
|
148
|
+
|
|
149
|
+
const run = <A, E>(effect: Effect.Effect<A, E, any>) => kernel.run(effect)
|
|
150
|
+
|
|
151
|
+
const headersFor = (call: InboxCall) => {
|
|
152
|
+
const headers: Record<string, string> = { authorization: `Bearer ${call.token}`, ...call.headers }
|
|
153
|
+
if (call.org !== undefined) headers["x-eloxiv-org"] = call.org
|
|
154
|
+
return headers
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const invoke = async (call: InboxCall): Promise<InboxOutcome> => {
|
|
158
|
+
const headers = headersFor(call)
|
|
159
|
+
const keyHeader: Record<string, string> =
|
|
160
|
+
call.idempotencyKey === undefined ? {} : { "idempotency-key": call.idempotencyKey }
|
|
161
|
+
switch (call.surface ?? "internal") {
|
|
162
|
+
case "internal": {
|
|
163
|
+
const exit = await kernel.run(
|
|
164
|
+
Effect.gen(function* () {
|
|
165
|
+
const invocation = yield* Invocation
|
|
166
|
+
return yield* invocation.invoke({
|
|
167
|
+
action: call.action,
|
|
168
|
+
input: { encoded: call.input },
|
|
169
|
+
surface: "internal",
|
|
170
|
+
headers: new Headers(headers),
|
|
171
|
+
idempotencyKey: call.idempotencyKey,
|
|
172
|
+
})
|
|
173
|
+
}).pipe(Effect.exit),
|
|
174
|
+
)
|
|
175
|
+
if (Exit.isSuccess(exit)) return { ok: true, result: exit.value.encoded }
|
|
176
|
+
return failed(
|
|
177
|
+
exit.cause.reasons.find((r) => r._tag === "Fail")?.error ?? { _tag: "defect", cause: String(exit.cause) },
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
case "rpc": {
|
|
181
|
+
const client = makeClient({
|
|
182
|
+
baseUrl: kernel.url,
|
|
183
|
+
modules: (options.app ?? inboxApp).modules.map((m) => m.contract),
|
|
184
|
+
token: () => call.token,
|
|
185
|
+
...(call.org === undefined ? {} : { orgId: call.org }),
|
|
186
|
+
} as Parameters<typeof makeClient>[0])
|
|
187
|
+
try {
|
|
188
|
+
return {
|
|
189
|
+
ok: true,
|
|
190
|
+
result: await client.call(call.action as never, call.input as never, {
|
|
191
|
+
idempotencyKey: call.idempotencyKey,
|
|
192
|
+
}),
|
|
193
|
+
}
|
|
194
|
+
} catch (error) {
|
|
195
|
+
return failed(error)
|
|
196
|
+
} finally {
|
|
197
|
+
await client.dispose()
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
case "http": {
|
|
201
|
+
const response = await fetch(`${kernel.url}/api/actions/${call.action}`, {
|
|
202
|
+
method: "POST",
|
|
203
|
+
headers: { ...headers, ...keyHeader, "content-type": "application/json" },
|
|
204
|
+
body: JSON.stringify(call.input),
|
|
205
|
+
})
|
|
206
|
+
const text = await response.text()
|
|
207
|
+
const body = (text.length > 0 ? JSON.parse(text) : {}) as Record<string, unknown>
|
|
208
|
+
return response.ok ? { ok: true, result: body } : failed(body)
|
|
209
|
+
}
|
|
210
|
+
case "mcp": {
|
|
211
|
+
const mcp = new McpClient({ name: "eloxiv-inbox-kit", version: "0.0.0" })
|
|
212
|
+
await mcp.connect(
|
|
213
|
+
new StreamableHTTPClientTransport(new URL(`${kernel.url}/mcp`), {
|
|
214
|
+
requestInit: { headers: { ...headers, ...keyHeader } },
|
|
215
|
+
}),
|
|
216
|
+
)
|
|
217
|
+
try {
|
|
218
|
+
const result = await mcp.callTool({
|
|
219
|
+
name: call.action.replaceAll(".", "_"),
|
|
220
|
+
arguments: call.input as Record<string, unknown>,
|
|
221
|
+
})
|
|
222
|
+
const text = (result.content as Array<{ type: string; text?: string }>)[0]?.text
|
|
223
|
+
const value = result.structuredContent ?? (text === undefined ? undefined : JSON.parse(text))
|
|
224
|
+
return result.isError ? failed(value) : { ok: true, result: value }
|
|
225
|
+
} finally {
|
|
226
|
+
await mcp.close()
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
case "agent": {
|
|
230
|
+
const { result } = await callAgentTool(
|
|
231
|
+
kernel,
|
|
232
|
+
new Headers(headers),
|
|
233
|
+
call.action,
|
|
234
|
+
call.input,
|
|
235
|
+
call.idempotencyKey,
|
|
236
|
+
)
|
|
237
|
+
return result.ok ? { ok: true, result: result.output } : failed(result.error)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const ensureOrg = (org: string) =>
|
|
243
|
+
run(
|
|
244
|
+
Effect.gen(function* () {
|
|
245
|
+
const directory = yield* Directory
|
|
246
|
+
yield* directory.createOrganization({ id: org, name: org })
|
|
247
|
+
}),
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
const subject: InboxReference = {
|
|
251
|
+
url: kernel.url,
|
|
252
|
+
run,
|
|
253
|
+
user: async (name, org, options = {}) => {
|
|
254
|
+
const email = `${name}@example.com`
|
|
255
|
+
await ensureOrg(org)
|
|
256
|
+
const id = await run(
|
|
257
|
+
Effect.gen(function* () {
|
|
258
|
+
const directory = yield* Directory
|
|
259
|
+
const userId = yield* directory.ensureUser({ email, name, password: PASSWORD })
|
|
260
|
+
yield* directory.addMember({ orgId: org, userId, roles: ["member", ...(options.roles ?? [])] })
|
|
261
|
+
return userId
|
|
262
|
+
}),
|
|
263
|
+
)
|
|
264
|
+
return { id, email, token: (await signIn(kernel.url, { email, password: PASSWORD })).token }
|
|
265
|
+
},
|
|
266
|
+
role: async (org, role, permissions) => {
|
|
267
|
+
await ensureOrg(org)
|
|
268
|
+
await admin(`INSERT INTO eloxiv.role (org_id, id, name) VALUES ($1, $2, $2) ON CONFLICT DO NOTHING`, [org, role])
|
|
269
|
+
await admin(`DELETE FROM eloxiv.role_permission WHERE org_id = $1 AND role_id = $2`, [org, role])
|
|
270
|
+
for (const permission of permissions) {
|
|
271
|
+
await admin(`INSERT INTO eloxiv.role_permission (org_id, role_id, permission) VALUES ($1, $2, $3)`, [
|
|
272
|
+
org,
|
|
273
|
+
role,
|
|
274
|
+
permission,
|
|
275
|
+
])
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
assignRole: async (userId, org, role) =>
|
|
279
|
+
void (await admin(
|
|
280
|
+
`INSERT INTO eloxiv.membership_role (org_id, user_id, role_id) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`,
|
|
281
|
+
[org, userId, role],
|
|
282
|
+
)),
|
|
283
|
+
unassignRole: async (userId, org, role) =>
|
|
284
|
+
void (await admin(`DELETE FROM eloxiv.membership_role WHERE org_id = $1 AND user_id = $2 AND role_id = $3`, [
|
|
285
|
+
org,
|
|
286
|
+
userId,
|
|
287
|
+
role,
|
|
288
|
+
])),
|
|
289
|
+
joinGroup: async (userId, org, group) => {
|
|
290
|
+
await admin(`INSERT INTO eloxiv.org_group (org_id, id, name) VALUES ($1, $2, $2) ON CONFLICT DO NOTHING`, [
|
|
291
|
+
org,
|
|
292
|
+
group,
|
|
293
|
+
])
|
|
294
|
+
await admin(
|
|
295
|
+
`INSERT INTO eloxiv.group_member (org_id, group_id, user_id) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`,
|
|
296
|
+
[org, group, userId],
|
|
297
|
+
)
|
|
298
|
+
},
|
|
299
|
+
leave: async (userId, org) =>
|
|
300
|
+
void (await admin(`DELETE FROM eloxiv.membership WHERE user_id = $1 AND org_id = $2`, [userId, org])),
|
|
301
|
+
invoke,
|
|
302
|
+
agentSession: (user, org) =>
|
|
303
|
+
run(
|
|
304
|
+
Effect.gen(function* () {
|
|
305
|
+
const identity = yield* Identity
|
|
306
|
+
const issued = yield* identity.issueAgentSession({
|
|
307
|
+
userId: user.id,
|
|
308
|
+
orgId: org,
|
|
309
|
+
label: "conformance agent",
|
|
310
|
+
authority: { scope: null, chain: [] },
|
|
311
|
+
})
|
|
312
|
+
return { id: issued.id, token: issued.token }
|
|
313
|
+
}),
|
|
314
|
+
),
|
|
315
|
+
revokeAgentSession: (id) =>
|
|
316
|
+
run(
|
|
317
|
+
Effect.gen(function* () {
|
|
318
|
+
const identity = yield* Identity
|
|
319
|
+
yield* identity.revokeAgentSession(id)
|
|
320
|
+
}),
|
|
321
|
+
),
|
|
322
|
+
sql: (text, params = []) => admin(text, params),
|
|
323
|
+
audit: (filter: AuditFilter) =>
|
|
324
|
+
run(
|
|
325
|
+
Effect.gen(function* () {
|
|
326
|
+
const audit = yield* Audit
|
|
327
|
+
return yield* audit.list(filter)
|
|
328
|
+
}),
|
|
329
|
+
),
|
|
330
|
+
query: async (token, name, org) => {
|
|
331
|
+
const headers: Record<string, string> = { authorization: `Bearer ${token}`, "content-type": "application/json" }
|
|
332
|
+
if (org !== undefined) headers["x-eloxiv-org"] = org
|
|
333
|
+
const response = await fetch(`${kernel.url}/zero/query`, {
|
|
334
|
+
method: "POST",
|
|
335
|
+
headers,
|
|
336
|
+
body: JSON.stringify(["transform", [{ id: "q1", name, args: [] }]]),
|
|
337
|
+
})
|
|
338
|
+
if (response.status === 401) {
|
|
339
|
+
await response.body?.cancel()
|
|
340
|
+
return { status: 401 } satisfies SyncAnswer
|
|
341
|
+
}
|
|
342
|
+
if (response.status !== 200)
|
|
343
|
+
throw new Error(`Unexpected sync response ${response.status}: ${await response.text()}`)
|
|
344
|
+
const body = (await response.json()) as { queries: Array<Record<string, unknown>> }
|
|
345
|
+
return { status: 200, answer: body.queries[0] ?? {} } satisfies SyncAnswer
|
|
346
|
+
},
|
|
347
|
+
selected: async (answer, table) => {
|
|
348
|
+
if (answer.status !== 200) return []
|
|
349
|
+
const ast = answer.answer["ast"] as Ast | undefined
|
|
350
|
+
if (ast === undefined) throw new Error(`The query was refused: ${JSON.stringify(answer.answer)}`)
|
|
351
|
+
// The scoped AST names database columns (Zero maps them back for the client).
|
|
352
|
+
if (!/^[a-z_]+\.[a-z_]+$/.test(table)) throw new Error(`Not a table name: ${table}`)
|
|
353
|
+
const rows = await admin<Record<string, unknown>>(`SELECT * FROM ${table}`)
|
|
354
|
+
const tables: Record<string, Rows> = {}
|
|
355
|
+
// Every table the filter's subqueries read: the kernel's live tables, and any entity table a related()
|
|
356
|
+
// or whereExists() child, or a one-hop reference, reaches.
|
|
357
|
+
const reached = new Set<string>(KERNEL_SYNC_TABLES)
|
|
358
|
+
const visit = (node: unknown): void => {
|
|
359
|
+
if (Array.isArray(node)) return node.forEach(visit)
|
|
360
|
+
if (node === null || typeof node !== "object") return
|
|
361
|
+
const record = node as Ast
|
|
362
|
+
if (typeof record["table"] === "string" && /^[a-z_]+\.[a-z_]+$/.test(record["table"]))
|
|
363
|
+
reached.add(record["table"])
|
|
364
|
+
Object.values(record).forEach(visit)
|
|
365
|
+
}
|
|
366
|
+
visit(ast["where"])
|
|
367
|
+
for (const name of reached) tables[name] = await admin<Record<string, unknown>>(`SELECT * FROM ${name}`)
|
|
368
|
+
return rows.filter((row) => evaluate(ast["where"], row, tables)).map((row) => String(row["id"]))
|
|
369
|
+
},
|
|
370
|
+
mail: { messages: sink.messages, failNext: sink.failNext, refuse: sink.refuse },
|
|
371
|
+
preview: (org, template, variables) =>
|
|
372
|
+
run(
|
|
373
|
+
Effect.gen(function* () {
|
|
374
|
+
const notifications = yield* Notifications
|
|
375
|
+
return yield* notifications.preview({ orgId: org, template, variables })
|
|
376
|
+
}),
|
|
377
|
+
),
|
|
378
|
+
deliveries: (org, notificationId) =>
|
|
379
|
+
run(
|
|
380
|
+
Effect.gen(function* () {
|
|
381
|
+
const notifications = yield* Notifications
|
|
382
|
+
return yield* notifications.deliveries({ orgId: org, notificationId })
|
|
383
|
+
}),
|
|
384
|
+
),
|
|
385
|
+
unsubscribe: async (url) => {
|
|
386
|
+
const response = await fetch(url, {
|
|
387
|
+
method: "POST",
|
|
388
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
389
|
+
body: "List-Unsubscribe=One-Click",
|
|
390
|
+
})
|
|
391
|
+
await response.body?.cancel()
|
|
392
|
+
return { status: response.status }
|
|
393
|
+
},
|
|
394
|
+
dispose: async () => {
|
|
395
|
+
await admin.dispose()
|
|
396
|
+
await kernel.dispose()
|
|
397
|
+
await sink.close()
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
return subject
|
|
401
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a kernel implementation supplies to run the inbox kits (Approvals, ActionConsent, WorkItems,
|
|
3
|
+
* Notifications): a running kernel serving the inbox conformance app (`./purchases/app.ts`: the purchases
|
|
4
|
+
* fixture with the kernel's inbox modules), delivering system email to an SMTP server the subject runs, and
|
|
5
|
+
* a handful of controls. Nothing here reaches into the Eloxiv kernel's internals; `./InboxReference.ts` is
|
|
6
|
+
* the Eloxiv kernel's own subject.
|
|
7
|
+
*/
|
|
8
|
+
import type { AuditFilter, AuditRecord } from "@eloxiv/contracts"
|
|
9
|
+
import type { ReceivedMail } from "../SmtpSink.ts"
|
|
10
|
+
import type { SyncAnswer } from "./Subject.ts"
|
|
11
|
+
|
|
12
|
+
/** The surfaces a call can arrive on. `internal` is the in-process path (a person's call, not an agent's). */
|
|
13
|
+
export type InboxSurface = "rpc" | "http" | "mcp" | "agent" | "internal"
|
|
14
|
+
|
|
15
|
+
export interface InboxUser {
|
|
16
|
+
readonly id: string
|
|
17
|
+
readonly email: string
|
|
18
|
+
/** The person's own session credential. */
|
|
19
|
+
readonly token: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface InboxCall {
|
|
23
|
+
readonly action: string
|
|
24
|
+
readonly input: unknown
|
|
25
|
+
/** A bearer credential: a person's session token or an agent session token. */
|
|
26
|
+
readonly token: string
|
|
27
|
+
readonly org?: string | undefined
|
|
28
|
+
readonly idempotencyKey?: string | undefined
|
|
29
|
+
/** Default `internal`. */
|
|
30
|
+
readonly surface?: InboxSurface | undefined
|
|
31
|
+
/** Extra request headers (a client trying to claim an origin or a session, say). */
|
|
32
|
+
readonly headers?: Readonly<Record<string, string>> | undefined
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A call's outcome: the JSON result envelope, or the error with all its fields (`approvalId`, `consentId`). */
|
|
36
|
+
export type InboxOutcome =
|
|
37
|
+
| { readonly ok: true; readonly result: unknown }
|
|
38
|
+
| { readonly ok: false; readonly error: { readonly _tag: string; readonly [field: string]: unknown } }
|
|
39
|
+
|
|
40
|
+
export interface InboxSubject {
|
|
41
|
+
/** A password user `<name>@example.com`, a member of `org` (created if missing) with `roles`, signed in. */
|
|
42
|
+
readonly user: (name: string, org: string, options?: { readonly roles?: ReadonlyArray<string> }) => Promise<InboxUser>
|
|
43
|
+
/** Create (or replace) a role of `org` that grants `permissions`. */
|
|
44
|
+
readonly role: (org: string, role: string, permissions: ReadonlyArray<string>) => Promise<void>
|
|
45
|
+
readonly assignRole: (userId: string, org: string, role: string) => Promise<void>
|
|
46
|
+
readonly unassignRole: (userId: string, org: string, role: string) => Promise<void>
|
|
47
|
+
/** Create a group of `org` (if missing) and add the member. */
|
|
48
|
+
readonly joinGroup: (userId: string, org: string, group: string) => Promise<void>
|
|
49
|
+
readonly leave: (userId: string, org: string) => Promise<void>
|
|
50
|
+
readonly invoke: (call: InboxCall) => Promise<InboxOutcome>
|
|
51
|
+
/** Issue an agent session for the user in `org` (ActionConsent `issueAgentSession`); returns its token. */
|
|
52
|
+
readonly agentSession: (user: InboxUser, org: string) => Promise<{ readonly id: string; readonly token: string }>
|
|
53
|
+
readonly revokeAgentSession: (id: string) => Promise<void>
|
|
54
|
+
/** Superuser SQL on the app's database (the kernel modules' and the fixture's tables). */
|
|
55
|
+
readonly sql: <A extends object = Record<string, unknown>>(
|
|
56
|
+
text: string,
|
|
57
|
+
params?: ReadonlyArray<unknown>,
|
|
58
|
+
) => Promise<ReadonlyArray<A>>
|
|
59
|
+
readonly audit: (filter: AuditFilter) => Promise<ReadonlyArray<AuditRecord>>
|
|
60
|
+
/** The sync query endpoint, as a caller (the query's scoped AST, or 401). */
|
|
61
|
+
readonly query: (token: string, name: string, org?: string) => Promise<SyncAnswer>
|
|
62
|
+
/** Run the sync answer's filter: the ids of the rows of `table` (schema-qualified) it selects. */
|
|
63
|
+
readonly selected: (answer: SyncAnswer, table: string) => Promise<ReadonlyArray<string>>
|
|
64
|
+
/** System email the kernel sent, as the subject's SMTP server received it. */
|
|
65
|
+
readonly mail: {
|
|
66
|
+
readonly messages: () => ReadonlyArray<ReceivedMail>
|
|
67
|
+
readonly failNext: (count: number) => void
|
|
68
|
+
readonly refuse: (address: string) => void
|
|
69
|
+
}
|
|
70
|
+
/** Notifications.preview and deliveries. */
|
|
71
|
+
readonly preview: (org: string, template: string, variables: Readonly<Record<string, unknown>>) => Promise<unknown>
|
|
72
|
+
readonly deliveries: (
|
|
73
|
+
org: string,
|
|
74
|
+
notificationId: string,
|
|
75
|
+
) => Promise<ReadonlyArray<{ readonly status: string; readonly channel: string; readonly attempts: number }>>
|
|
76
|
+
/** Follow an unsubscribe link (as a mail client would, with one-click `POST`). */
|
|
77
|
+
readonly unsubscribe: (url: string) => Promise<{ readonly status: number }>
|
|
78
|
+
readonly dispose: () => Promise<void>
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type StartInboxSubject = () => Promise<InboxSubject>
|
|
82
|
+
|
|
83
|
+
/** Poll until `check` returns a value `done` accepts, or fail after `timeoutMs`. */
|
|
84
|
+
export const until = async <A>(
|
|
85
|
+
what: string,
|
|
86
|
+
check: () => Promise<A>,
|
|
87
|
+
done: (value: A) => boolean,
|
|
88
|
+
timeoutMs = 20_000,
|
|
89
|
+
): Promise<A> => {
|
|
90
|
+
const deadline = Date.now() + timeoutMs
|
|
91
|
+
let last: A | undefined
|
|
92
|
+
for (;;) {
|
|
93
|
+
last = await check()
|
|
94
|
+
if (done(last)) return last
|
|
95
|
+
if (Date.now() > deadline) throw new Error(`Timed out waiting for ${what}; last value: ${JSON.stringify(last)}`)
|
|
96
|
+
await new Promise((resolve) => setTimeout(resolve, 50))
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** A short unique suffix, so checks sharing a database never see each other's rows. */
|
|
101
|
+
export const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
|