@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 @@
|
|
|
1
|
+
{"version":3,"file":"NotebookAgent.js","sourceRoot":"","sources":["../../src/conformance/NotebookAgent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAUrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAA6B,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IACrF,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;QAC/B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE;YACH,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;YACvD,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;SAC7F;KACF,CAAC,CAAA;IACF,MAAM,MAAM,CAAC,GAAG,CACd,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAA;QAClC,KAAK,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1D,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC1E,CAAC,CAAC,CACH,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the NotificationChannel contract (docs/contracts/notification-channel.md), for an
|
|
3
|
+
* email channel: a message delivered to one recipient arrives at a real SMTP server with its headers (From,
|
|
4
|
+
* To, Subject, Message-ID, one-click unsubscribe, the channel's extra headers) and its text and HTML bodies
|
|
5
|
+
* intact; a temporary failure is a retryable `ChannelError`, a refused recipient or a message of another
|
|
6
|
+
* kind a permanent one, and an unreachable server a retryable one.
|
|
7
|
+
*
|
|
8
|
+
* The push channel's kit is `pushConformance` (`./Push.ts`, exported here too): the kernel's channel against APNs
|
|
9
|
+
* and FCM protocol fakes. Chat is a contract only (Messaging provides it).
|
|
10
|
+
*
|
|
11
|
+
* Usage: `emailChannelConformance(() => startMyChannel())`, where the subject delivers through the channel to
|
|
12
|
+
* an SMTP server it controls (see `EmailChannelSubject`).
|
|
13
|
+
*/
|
|
14
|
+
import type { ChannelMessage } from "@eloxiv/contracts";
|
|
15
|
+
import type { ReceivedMail } from "../SmtpSink.ts";
|
|
16
|
+
export { pushConformance, type PushSubject } from "./Push.ts";
|
|
17
|
+
export type Delivery = {
|
|
18
|
+
readonly ok: true;
|
|
19
|
+
readonly providerId: string | null;
|
|
20
|
+
} | {
|
|
21
|
+
readonly ok: false;
|
|
22
|
+
readonly error: {
|
|
23
|
+
readonly _tag: string;
|
|
24
|
+
readonly retryable: boolean;
|
|
25
|
+
readonly message: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export interface EmailChannelSubject {
|
|
29
|
+
/** NotificationChannel.deliver on the channel under test. */
|
|
30
|
+
readonly deliver: (message: ChannelMessage) => Promise<Delivery>;
|
|
31
|
+
/** The same channel pointed at a server that does not answer. */
|
|
32
|
+
readonly deliverUnreachable: (message: ChannelMessage) => Promise<Delivery>;
|
|
33
|
+
/** What the SMTP server received, and controls over it. */
|
|
34
|
+
readonly received: () => ReadonlyArray<ReceivedMail>;
|
|
35
|
+
readonly failNext: (count: number) => void;
|
|
36
|
+
readonly refuse: (address: string) => void;
|
|
37
|
+
readonly dispose: () => Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare const emailChannelConformance: (start: () => Promise<EmailChannelSubject>) => import("vitest").SuiteCollector<object>;
|
|
40
|
+
//# sourceMappingURL=NotificationChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationChannel.d.ts","sourceRoot":"","sources":["../../src/conformance/NotificationChannel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CA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push.js";
|
|
3
|
+
const message = (overrides = {}) => ({
|
|
4
|
+
kind: "email",
|
|
5
|
+
messageId: `kit-${crypto.randomUUID()}@eloxiv`,
|
|
6
|
+
from: "Eloxiv Kit <kit@eloxiv.test>",
|
|
7
|
+
to: `rcpt-${crypto.randomUUID().slice(0, 8)}@example.com`,
|
|
8
|
+
subject: "Kit subject",
|
|
9
|
+
text: "Plain text body",
|
|
10
|
+
html: "<p>HTML body</p>",
|
|
11
|
+
unsubscribeUrl: "https://app.example.com/notifications/unsubscribe?token=abc.def",
|
|
12
|
+
headers: { "X-Eloxiv-Category": "kit.category" },
|
|
13
|
+
...overrides,
|
|
14
|
+
});
|
|
15
|
+
export const emailChannelConformance = (start) => describe("NotificationChannel contract (email)", () => {
|
|
16
|
+
let s;
|
|
17
|
+
beforeAll(async () => {
|
|
18
|
+
s = await start();
|
|
19
|
+
});
|
|
20
|
+
afterAll(() => s?.dispose());
|
|
21
|
+
const arrived = (to) => s.received().filter((m) => m.to.includes(to));
|
|
22
|
+
it("delivers a message that arrives with its headers and both bodies", async () => {
|
|
23
|
+
const sent = message({
|
|
24
|
+
subject: "Grüße from Eloxiv — ünïcode",
|
|
25
|
+
text: "Hello\nsecond line",
|
|
26
|
+
html: "<p>Hello <b>you</b></p>",
|
|
27
|
+
});
|
|
28
|
+
const result = await s.deliver(sent);
|
|
29
|
+
expect(result.ok).toBe(true);
|
|
30
|
+
const [mail] = arrived(sent.to);
|
|
31
|
+
expect(mail).toBeDefined();
|
|
32
|
+
expect(mail.from).toBe("kit@eloxiv.test");
|
|
33
|
+
expect(mail.headers["from"]).toBe("Eloxiv Kit <kit@eloxiv.test>");
|
|
34
|
+
expect(mail.headers["to"]).toBe(sent.to);
|
|
35
|
+
expect(mail.headers["subject"]).toBe("Grüße from Eloxiv — ünïcode");
|
|
36
|
+
expect(mail.headers["message-id"]).toBe(`<${sent.messageId}>`);
|
|
37
|
+
expect(mail.headers["list-unsubscribe"]).toBe(`<${sent.unsubscribeUrl}>`);
|
|
38
|
+
expect(mail.headers["list-unsubscribe-post"]).toBe("List-Unsubscribe=One-Click");
|
|
39
|
+
expect(mail.headers["x-eloxiv-category"]).toBe("kit.category");
|
|
40
|
+
expect(mail.headers["date"]).toBeDefined();
|
|
41
|
+
expect(mail.text?.replaceAll("\r\n", "\n")).toBe("Hello\nsecond line");
|
|
42
|
+
expect(mail.html).toBe("<p>Hello <b>you</b></p>");
|
|
43
|
+
});
|
|
44
|
+
it("delivers text-only messages and keeps lines that start with a dot", async () => {
|
|
45
|
+
const sent = message({ html: null, unsubscribeUrl: null, text: ".leading dot\n..two dots\n.\nend" });
|
|
46
|
+
expect((await s.deliver(sent)).ok).toBe(true);
|
|
47
|
+
const [mail] = arrived(sent.to);
|
|
48
|
+
expect(mail.html).toBeUndefined();
|
|
49
|
+
expect(mail.headers["list-unsubscribe"]).toBeUndefined();
|
|
50
|
+
expect(mail.text?.replaceAll("\r\n", "\n")).toBe(".leading dot\n..two dots\n.\nend");
|
|
51
|
+
});
|
|
52
|
+
it("reports a temporary failure as retryable, and delivers on the retry", async () => {
|
|
53
|
+
const sent = message();
|
|
54
|
+
s.failNext(1);
|
|
55
|
+
const first = await s.deliver(sent);
|
|
56
|
+
expect(first).toMatchObject({ ok: false, error: { _tag: "ChannelError", retryable: true } });
|
|
57
|
+
expect(arrived(sent.to)).toEqual([]);
|
|
58
|
+
expect((await s.deliver(sent)).ok).toBe(true);
|
|
59
|
+
expect(arrived(sent.to)).toHaveLength(1);
|
|
60
|
+
});
|
|
61
|
+
it("reports a refused recipient as permanent", async () => {
|
|
62
|
+
const sent = message();
|
|
63
|
+
s.refuse(sent.to);
|
|
64
|
+
expect(await s.deliver(sent)).toMatchObject({ ok: false, error: { _tag: "ChannelError", retryable: false } });
|
|
65
|
+
expect(arrived(sent.to)).toEqual([]);
|
|
66
|
+
});
|
|
67
|
+
it("reports an unreachable server as retryable", async () => {
|
|
68
|
+
expect(await s.deliverUnreachable(message())).toMatchObject({
|
|
69
|
+
ok: false,
|
|
70
|
+
error: { _tag: "ChannelError", retryable: true },
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
it("refuses a message of another kind, permanently", async () => {
|
|
74
|
+
const push = { kind: "push", messageId: "p1", userId: "u1", title: "t", body: "b", url: null };
|
|
75
|
+
expect(await s.deliver(push)).toMatchObject({ ok: false, error: { _tag: "ChannelError", retryable: false } });
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=NotificationChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationChannel.js","sourceRoot":"","sources":["../../src/conformance/NotificationChannel.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAGlE,OAAO,EAAE,eAAe,EAAoB,MAAM,WAAW,CAAA;AAqB7D,MAAM,OAAO,GAAG,CAAC,SAAS,GAA0B,EAAE,EAAgB,EAAE,CAAC,CAAC;IACxE,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,OAAO,MAAM,CAAC,UAAU,EAAE,SAAS;IAC9C,IAAI,EAAE,8BAA8B;IACpC,EAAE,EAAE,QAAQ,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc;IACzD,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,kBAAkB;IACxB,cAAc,EAAE,iEAAiE;IACjF,OAAO,EAAE,EAAE,mBAAmB,EAAE,cAAc,EAAE;IAChD,GAAG,SAAS;CACb,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAyC,EAAE,EAAE,CACnF,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,IAAI,CAAsB,CAAA;IAC1B,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,CAAC,GAAG,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AAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;YAC1D,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE;SACjD,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,IAAI,GAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;QAC9G,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;IAC/G,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notifications.d.ts","sourceRoot":"","sources":["../../src/conformance/Notifications.ts"],"names":[],"mappings":"AAWA,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAA;AAK1B,eAAO,MAAM,wBAAwB,UAAW,iBAAiB,4CAoS7D,CAAA"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Notifications contract (docs/contracts/notifications.md) on the inbox conformance
|
|
3
|
+
* app: durable in-app notifications per recipient (sent by a subscriber through the kernel API, synced to
|
|
4
|
+
* the recipient only, marked and dismissed by them alone), and system email through the email channel to the
|
|
5
|
+
* subject's SMTP server: templates, organisation overrides and preview, per-user preferences, retries and
|
|
6
|
+
* permanent failures in the delivery log, and the one-click unsubscribe link with suppression.
|
|
7
|
+
*
|
|
8
|
+
* Usage, in a Vitest file: `notificationsConformance(() => startMyKernel())`.
|
|
9
|
+
*/
|
|
10
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
11
|
+
import { unique, until, } from "./InboxSubject.js";
|
|
12
|
+
const ORG = "acme";
|
|
13
|
+
const MANAGE = "notifications.manage";
|
|
14
|
+
export const notificationsConformance = (start) => describe("Notifications contract", () => {
|
|
15
|
+
let s;
|
|
16
|
+
let nina;
|
|
17
|
+
let omar;
|
|
18
|
+
beforeAll(async () => {
|
|
19
|
+
s = await start();
|
|
20
|
+
nina = await s.user("nina", ORG);
|
|
21
|
+
omar = await s.user("omar", ORG);
|
|
22
|
+
}, 120_000);
|
|
23
|
+
afterAll(() => s?.dispose());
|
|
24
|
+
const notificationsOf = (who, category) => s.sql(`SELECT id, title, body, read_at, dismissed_at, link_id FROM eloxiv_notifications.notification
|
|
25
|
+
WHERE recipient_id = $1 AND category = $2 ORDER BY created_at`, [who.id, category]);
|
|
26
|
+
const mailTo = (who) => s.mail.messages().filter((m) => m.to.includes(who.email));
|
|
27
|
+
/** An agent asks for consent: the person gets a `consent.requested` notification, and email. */
|
|
28
|
+
const askConsent = async (who, payee = unique("payee")) => {
|
|
29
|
+
const outcome = await s.invoke({
|
|
30
|
+
action: "purchases.wire",
|
|
31
|
+
input: { amount: 1, payee },
|
|
32
|
+
token: who.token,
|
|
33
|
+
surface: "agent",
|
|
34
|
+
});
|
|
35
|
+
if (outcome.ok || outcome.error._tag !== "ConsentRequired")
|
|
36
|
+
throw new Error(JSON.stringify(outcome));
|
|
37
|
+
return outcome.error["consentId"];
|
|
38
|
+
};
|
|
39
|
+
const notificationFor = async (who, consentId) => (await notificationsOf(who, "consent.requested")).find((n) => n.link_id === consentId);
|
|
40
|
+
/** The email sent for the notification of a consent request (matched on the notification's id header). */
|
|
41
|
+
const emailFor = async (who, consentId) => {
|
|
42
|
+
const id = notificationIdCache.get(consentId) ?? (await remember(who, consentId));
|
|
43
|
+
const mail = await until(`the email for ${consentId}`, async () => mailTo(who).find((m) => m.headers["x-eloxiv-notification"] === id), (m) => m !== undefined);
|
|
44
|
+
return mail;
|
|
45
|
+
};
|
|
46
|
+
const notificationIdCache = new Map();
|
|
47
|
+
const remember = async (who, consentId) => {
|
|
48
|
+
const n = await notificationFor(who, consentId);
|
|
49
|
+
notificationIdCache.set(consentId, n.id);
|
|
50
|
+
return n.id;
|
|
51
|
+
};
|
|
52
|
+
const act = (who, action, input) => s.invoke({ action: `notifications.${action}`, input, token: who.token });
|
|
53
|
+
it("lets a subscriber notify through the kernel API: the recipient gets a durable in-app notification", async () => {
|
|
54
|
+
const outcome = await s.invoke({
|
|
55
|
+
action: "purchases.order",
|
|
56
|
+
input: { item: unique("cups"), amount: 9 },
|
|
57
|
+
token: nina.token,
|
|
58
|
+
});
|
|
59
|
+
const orderId = outcome.result.output.id;
|
|
60
|
+
const [note] = await until("the order notification", () => notificationsOf(nina, "purchases.ordered"), (rows) => rows.some((r) => r.link_id === orderId)).then((rows) => rows.filter((r) => r.link_id === orderId));
|
|
61
|
+
expect(note).toMatchObject({ title: "Order placed", read_at: null, dismissed_at: null });
|
|
62
|
+
});
|
|
63
|
+
it("syncs a notification to its recipient only, who alone marks and dismisses it", async () => {
|
|
64
|
+
const consentId = await askConsent(nina);
|
|
65
|
+
const id = await remember(nina, consentId);
|
|
66
|
+
const mine = await s.selected(await s.query(nina.token, "notifications.mine"), "eloxiv_notifications.notification");
|
|
67
|
+
expect(mine).toContain(id);
|
|
68
|
+
const theirs = await s.selected(await s.query(omar.token, "notifications.mine"), "eloxiv_notifications.notification");
|
|
69
|
+
expect(theirs).not.toContain(id);
|
|
70
|
+
expect(await act(omar, "markRead", { id })).toMatchObject({ ok: false, error: { _tag: "Forbidden" } });
|
|
71
|
+
expect(await act(nina, "markRead", { id })).toMatchObject({ ok: true });
|
|
72
|
+
expect((await notificationFor(nina, consentId)).read_at).not.toBeNull();
|
|
73
|
+
expect(await act(nina, "markUnread", { id })).toMatchObject({ ok: true });
|
|
74
|
+
expect((await notificationFor(nina, consentId)).read_at).toBeNull();
|
|
75
|
+
expect(await act(omar, "dismiss", { id })).toMatchObject({ ok: false, error: { _tag: "Forbidden" } });
|
|
76
|
+
expect(await act(nina, "dismiss", { id })).toMatchObject({ ok: true });
|
|
77
|
+
expect((await notificationFor(nina, consentId)).dismissed_at).not.toBeNull();
|
|
78
|
+
});
|
|
79
|
+
it("lists and counts a person's own unread notifications, which marking and dismissing change", async () => {
|
|
80
|
+
const category = unique("reminders");
|
|
81
|
+
const titles = [unique("first"), unique("second")];
|
|
82
|
+
for (const title of titles) {
|
|
83
|
+
expect(await act(nina, "notify", { title, body: "later", category })).toMatchObject({ ok: true });
|
|
84
|
+
}
|
|
85
|
+
const count = async (who) => (await act(who, "count", { category })).result.output.unread;
|
|
86
|
+
const listed = async (who, input = {}) => (await act(who, "list", { category, ...input })).result.output.notifications;
|
|
87
|
+
expect(await count(nina)).toBe(2);
|
|
88
|
+
// Newest first; never another person's.
|
|
89
|
+
expect((await listed(nina)).map((n) => n.title)).toEqual(titles.toReversed());
|
|
90
|
+
expect(await listed(omar)).toEqual([]);
|
|
91
|
+
expect(await count(omar)).toBe(0);
|
|
92
|
+
const [newest, oldest] = await listed(nina);
|
|
93
|
+
expect(await act(nina, "markRead", { id: newest.id })).toMatchObject({ ok: true });
|
|
94
|
+
expect(await count(nina)).toBe(1);
|
|
95
|
+
expect((await listed(nina, { unreadOnly: true })).map((n) => n.id)).toEqual([oldest.id]);
|
|
96
|
+
expect(await act(nina, "dismiss", { id: oldest.id })).toMatchObject({ ok: true });
|
|
97
|
+
expect(await count(nina)).toBe(0);
|
|
98
|
+
expect((await listed(nina)).map((n) => n.id)).toEqual([newest.id]);
|
|
99
|
+
});
|
|
100
|
+
it("lets a person or their agent notify themselves, and other members only with notifications.send", async () => {
|
|
101
|
+
const category = unique("sent");
|
|
102
|
+
const session = await s.agentSession(nina, ORG);
|
|
103
|
+
const toSelf = await s.invoke({
|
|
104
|
+
action: "notifications.notify",
|
|
105
|
+
input: { title: "Report ready", body: "The export finished", category },
|
|
106
|
+
token: session.token,
|
|
107
|
+
surface: "agent",
|
|
108
|
+
});
|
|
109
|
+
expect(toSelf).toMatchObject({ ok: true });
|
|
110
|
+
expect((await notificationsOf(nina, category)).map((n) => n.title)).toEqual(["Report ready"]);
|
|
111
|
+
const toOmar = { title: "Heads up", body: "Look at this", category, recipients: [omar.id] };
|
|
112
|
+
expect(await act(nina, "notify", toOmar)).toMatchObject({ ok: false, error: { _tag: "Forbidden" } });
|
|
113
|
+
expect(await notificationsOf(omar, category)).toEqual([]);
|
|
114
|
+
const role = unique("senders");
|
|
115
|
+
await s.role(ORG, role, ["notifications.send"]);
|
|
116
|
+
await s.assignRole(nina.id, ORG, role);
|
|
117
|
+
const sender = await s.user("nina", ORG);
|
|
118
|
+
expect(await act(sender, "notify", toOmar)).toMatchObject({ ok: true });
|
|
119
|
+
expect((await notificationsOf(omar, category)).map((n) => n.title)).toEqual(["Heads up"]);
|
|
120
|
+
await s.unassignRole(nina.id, ORG, role);
|
|
121
|
+
});
|
|
122
|
+
it("lists the delivery log: a person's own deliveries, and with notifications.manage the organisation's", async () => {
|
|
123
|
+
const consentId = await askConsent(nina);
|
|
124
|
+
const id = await remember(nina, consentId);
|
|
125
|
+
await emailFor(nina, consentId);
|
|
126
|
+
const log = async (who) => (await act(who, "deliveryLog", { notificationId: id })).result.output.deliveries;
|
|
127
|
+
expect((await log(nina)).map((d) => [d.recipientId, d.channel, d.status])).toEqual([[nina.id, "email", "sent"]]);
|
|
128
|
+
// Another member sees none of it; one who manages notifications does.
|
|
129
|
+
expect(await log(omar)).toEqual([]);
|
|
130
|
+
const role = unique("mail-admins");
|
|
131
|
+
await s.role(ORG, role, [MANAGE]);
|
|
132
|
+
await s.assignRole(omar.id, ORG, role);
|
|
133
|
+
const manager = await s.user("omar", ORG);
|
|
134
|
+
expect((await log(manager)).map((d) => d.recipientId)).toEqual([nina.id]);
|
|
135
|
+
await s.unassignRole(omar.id, ORG, role);
|
|
136
|
+
});
|
|
137
|
+
it("sends system email from the template, with a stable Message-ID and a one-click unsubscribe link", async () => {
|
|
138
|
+
const consentId = await askConsent(nina);
|
|
139
|
+
const id = await remember(nina, consentId);
|
|
140
|
+
const mail = await emailFor(nina, consentId);
|
|
141
|
+
expect(mail.from).toBe("noreply@eloxiv.test");
|
|
142
|
+
expect(mail.to).toEqual([nina.email]);
|
|
143
|
+
expect(mail.headers["from"]).toBe("Eloxiv <noreply@eloxiv.test>");
|
|
144
|
+
// Named as people see the action (its title), never by its id.
|
|
145
|
+
expect(mail.headers["subject"]).toBe("Your agent wants to: Wire money");
|
|
146
|
+
expect(mail.headers["message-id"]).toMatch(/^<dlv_[0-9a-f]+@eloxiv>$/);
|
|
147
|
+
expect(mail.headers["x-eloxiv-category"]).toBe("consent.requested");
|
|
148
|
+
expect(mail.headers["list-unsubscribe"]).toMatch(/^<https?:\/\/[^>]+\/notifications\/unsubscribe\?token=[^>]+>$/);
|
|
149
|
+
expect(mail.headers["list-unsubscribe-post"]).toBe("List-Unsubscribe=One-Click");
|
|
150
|
+
expect(mail.text).toContain("Your agent wants to: Wire money.");
|
|
151
|
+
expect(mail.html).toContain("<strong>Wire money</strong>");
|
|
152
|
+
expect(mail.text).not.toContain("purchases.wire");
|
|
153
|
+
// Variables are escaped in HTML (the details are JSON with quotes).
|
|
154
|
+
expect(mail.html).toContain(""payee"");
|
|
155
|
+
// The delivery log records the send once the delivery commits (just after the server accepted it).
|
|
156
|
+
const [delivery] = await until("the delivery log", () => s.deliveries(ORG, id), (d) => d[0]?.status !== "pending");
|
|
157
|
+
expect(delivery).toMatchObject({ channel: "email", status: "sent", attempts: 1 });
|
|
158
|
+
});
|
|
159
|
+
it("retries a temporary failure through the outbox, and records the attempts", async () => {
|
|
160
|
+
s.mail.failNext(2);
|
|
161
|
+
const consentId = await askConsent(nina);
|
|
162
|
+
const id = await remember(nina, consentId);
|
|
163
|
+
await emailFor(nina, consentId);
|
|
164
|
+
const [delivery] = await until("the delivery log", () => s.deliveries(ORG, id), (d) => d[0]?.status === "sent");
|
|
165
|
+
expect(delivery).toMatchObject({ status: "sent", attempts: 3 });
|
|
166
|
+
});
|
|
167
|
+
it("records a permanent failure once, without retrying", async () => {
|
|
168
|
+
const pat = await s.user(unique("pat"), ORG);
|
|
169
|
+
s.mail.refuse(pat.email);
|
|
170
|
+
const consentId = await askConsent(pat);
|
|
171
|
+
const id = await remember(pat, consentId);
|
|
172
|
+
const [delivery] = await until("the failed delivery", () => s.deliveries(ORG, id), (d) => d[0]?.status === "failed");
|
|
173
|
+
expect(delivery).toMatchObject({ status: "failed", attempts: 1 });
|
|
174
|
+
expect(mailTo(pat)).toEqual([]);
|
|
175
|
+
});
|
|
176
|
+
it("follows each person's preference: a category without email stays in-app", async () => {
|
|
177
|
+
const quiet = await s.user(unique("quiet"), ORG);
|
|
178
|
+
expect(await act(quiet, "setPreference", { category: "consent.requested", channels: ["in-app"] })).toMatchObject({
|
|
179
|
+
ok: true,
|
|
180
|
+
});
|
|
181
|
+
const consentId = await askConsent(quiet);
|
|
182
|
+
const id = await remember(quiet, consentId);
|
|
183
|
+
expect(await s.deliveries(ORG, id)).toEqual([]);
|
|
184
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
185
|
+
expect(mailTo(quiet)).toEqual([]);
|
|
186
|
+
});
|
|
187
|
+
it("lets managers override a template for the organisation, previewed and then sent", async () => {
|
|
188
|
+
const mona = await s.user(unique("mona"), ORG);
|
|
189
|
+
const override = {
|
|
190
|
+
template: "consent.requested",
|
|
191
|
+
subject: "Agent request: {{action}}",
|
|
192
|
+
text: "Please look at {{action}} ({{actionName}}).",
|
|
193
|
+
html: "<p>Please look at <em>{{action}}</em>.</p>",
|
|
194
|
+
};
|
|
195
|
+
expect(await act(mona, "setEmailTemplate", override)).toMatchObject({ ok: false, error: { _tag: "Forbidden" } });
|
|
196
|
+
await s.role(ORG, "notifier", [MANAGE]);
|
|
197
|
+
await s.assignRole(mona.id, ORG, "notifier");
|
|
198
|
+
expect(await act(mona, "setEmailTemplate", override)).toMatchObject({ ok: true });
|
|
199
|
+
expect(await s.preview(ORG, "consent.requested", { action: "x.y", actionName: "x.y", details: "" })).toEqual({
|
|
200
|
+
subject: "Agent request: x.y",
|
|
201
|
+
text: "Please look at x.y (x.y).",
|
|
202
|
+
html: "<p>Please look at <em>x.y</em>.</p>",
|
|
203
|
+
overridden: true,
|
|
204
|
+
});
|
|
205
|
+
// Another organisation keeps the registered template.
|
|
206
|
+
expect(await s.preview("globex", "consent.requested", { action: "x.y", details: "" })).toMatchObject({
|
|
207
|
+
subject: "Your agent wants to: x.y",
|
|
208
|
+
overridden: false,
|
|
209
|
+
});
|
|
210
|
+
await expect(s.preview(ORG, "no.such.template", {})).rejects.toMatchObject({ _tag: "UnknownTemplate" });
|
|
211
|
+
const consentId = await askConsent(omar);
|
|
212
|
+
await remember(omar, consentId);
|
|
213
|
+
const mail = await until("the overridden email", async () => mailTo(omar).find((m) => m.headers["subject"] === "Agent request: Wire money"), (m) => m !== undefined);
|
|
214
|
+
// `{{action}}` is what people see the action called (its title); `{{actionName}}` its id.
|
|
215
|
+
expect(mail?.text).toBe("Please look at Wire money (purchases.wire).");
|
|
216
|
+
});
|
|
217
|
+
it("unsubscribes the recipient from a category through the link, suppressing that address, audited", async () => {
|
|
218
|
+
const una = await s.user(unique("una"), ORG);
|
|
219
|
+
const first = await askConsent(una);
|
|
220
|
+
await remember(una, first);
|
|
221
|
+
const mail = await emailFor(una, first);
|
|
222
|
+
const url = /^<(.+)>$/.exec(mail.headers["list-unsubscribe"])[1];
|
|
223
|
+
expect((await s.unsubscribe(url.replace(/token=[^&]+/, "token=forged.signature"))).status).toBe(400);
|
|
224
|
+
expect((await s.unsubscribe(url)).status).toBe(200);
|
|
225
|
+
const audited = (await s.audit({ action: "notifications.unsubscribe" })).filter((r) => r.actorUserId === una.id);
|
|
226
|
+
expect(audited).toHaveLength(1);
|
|
227
|
+
// Email is off for the category now.
|
|
228
|
+
const second = await askConsent(una);
|
|
229
|
+
const secondId = await remember(una, second);
|
|
230
|
+
expect(await s.deliveries(ORG, secondId)).toEqual([]);
|
|
231
|
+
// Turning email back on still reaches no one: the address is suppressed for the category.
|
|
232
|
+
await act(una, "setPreference", { category: "consent.requested", channels: ["email"] });
|
|
233
|
+
const third = await askConsent(una);
|
|
234
|
+
const thirdId = await remember(una, third);
|
|
235
|
+
expect(await s.deliveries(ORG, thirdId)).toMatchObject([{ channel: "email", status: "suppressed" }]);
|
|
236
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
237
|
+
expect(mailTo(una)).toHaveLength(1);
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
//# sourceMappingURL=Notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../src/conformance/Notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAElE,OAAO,EACL,MAAM,EACN,KAAK,GAKN,MAAM,mBAAmB,CAAA;AAE1B,MAAM,GAAG,GAAG,MAAM,CAAA;AAClB,MAAM,MAAM,GAAG,sBAAsB,CAAA;AAErC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAwB,EAAE,EAAE,CACnE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,CAAe,CAAA;IACnB,IAAI,IAAe,CAAA;IACnB,IAAI,IAAe,CAAA;IAEnB,SAAS,CAAC,KA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CAAC,CAAA;QACpC,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QAC5C,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACrD,0FAA0F;QAC1F,MAAM,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACvF,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAA;QACpG,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;QAC5C,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an outside client does against a kernel's OAuth authorisation server, in plain HTTP: register,
|
|
3
|
+
* authorise with PKCE through the kernel's pages (a cookie jar and form posts, as a browser would), exchange
|
|
4
|
+
* codes, refresh, revoke, run the device flow, and call actions with the resulting tokens. Used by the
|
|
5
|
+
* MachineIdentity kit and by tests of the CLI.
|
|
6
|
+
*/
|
|
7
|
+
import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
8
|
+
export declare const pkcePair: () => {
|
|
9
|
+
verifier: string;
|
|
10
|
+
challenge: string;
|
|
11
|
+
};
|
|
12
|
+
export interface Registered {
|
|
13
|
+
readonly client_id: string;
|
|
14
|
+
readonly client_secret?: string | undefined;
|
|
15
|
+
readonly redirect_uris: ReadonlyArray<string>;
|
|
16
|
+
}
|
|
17
|
+
export interface TokenSet {
|
|
18
|
+
readonly access_token: string;
|
|
19
|
+
readonly refresh_token: string;
|
|
20
|
+
readonly expires_in: number;
|
|
21
|
+
readonly scope: string;
|
|
22
|
+
readonly token_type: string;
|
|
23
|
+
}
|
|
24
|
+
export type TokenAnswer = {
|
|
25
|
+
readonly ok: true;
|
|
26
|
+
readonly tokens: TokenSet;
|
|
27
|
+
} | {
|
|
28
|
+
readonly ok: false;
|
|
29
|
+
readonly status: number;
|
|
30
|
+
readonly error: string;
|
|
31
|
+
readonly description: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const REDIRECT = "http://127.0.0.1:7/callback";
|
|
34
|
+
/** A browser: cookies kept across requests, redirects not followed (the caller follows what it must). */
|
|
35
|
+
export declare const browser: (base: string) => {
|
|
36
|
+
request: (path: string, init?: RequestInit) => Promise<Response>;
|
|
37
|
+
post: (path: string, form: Record<string, string>, extra?: Record<string, string>) => Promise<Response>;
|
|
38
|
+
cookies: Map<string, string>;
|
|
39
|
+
};
|
|
40
|
+
export type Browser = ReturnType<typeof browser>;
|
|
41
|
+
/** A hidden or named input's value in a page. */
|
|
42
|
+
export declare const field: (html: string, name: string) => string | undefined;
|
|
43
|
+
/** The first option of the organisation select whose value is `org`, if the page offers it. */
|
|
44
|
+
export declare const offersOrg: (html: string, org: string) => boolean;
|
|
45
|
+
export declare const signInThroughPage: (b: Browser, page: string, email: string, password: string) => Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Drive the authorisation page as `email`: open the authorisation URL, sign in if asked, pick `org` and
|
|
48
|
+
* answer. Returns the final redirect (to the client's redirect URI) or the page the kernel showed instead.
|
|
49
|
+
*/
|
|
50
|
+
export declare const authorizeInBrowser: (b: Browser, authorizationUrl: string, user: {
|
|
51
|
+
readonly email: string;
|
|
52
|
+
readonly password: string;
|
|
53
|
+
}, org: string, decision?: "approve" | "deny") => Promise<{
|
|
54
|
+
readonly redirect: URL;
|
|
55
|
+
} | {
|
|
56
|
+
readonly status: number;
|
|
57
|
+
readonly page: string;
|
|
58
|
+
}>;
|
|
59
|
+
export declare const oauthClient: (base: string) => {
|
|
60
|
+
register: (metadata: Record<string, unknown>) => Promise<{
|
|
61
|
+
status: number;
|
|
62
|
+
body: Registered & {
|
|
63
|
+
error?: string;
|
|
64
|
+
};
|
|
65
|
+
}>;
|
|
66
|
+
registerPublic: (grantTypes?: string[], redirect?: string) => Promise<Registered & {
|
|
67
|
+
error?: string;
|
|
68
|
+
}>;
|
|
69
|
+
token: (params: Record<string, string | undefined>, basic?: string) => Promise<TokenAnswer>;
|
|
70
|
+
authorizationUrl: (params: Record<string, string | undefined>) => string;
|
|
71
|
+
revoke: (params: Record<string, string | undefined>) => Promise<Response>;
|
|
72
|
+
deviceAuthorization: (params: Record<string, string | undefined>) => Promise<{
|
|
73
|
+
status: number;
|
|
74
|
+
body: Record<string, any>;
|
|
75
|
+
}>;
|
|
76
|
+
form: (path: string, params: Record<string, string | undefined>, basic?: string) => Promise<Response>;
|
|
77
|
+
};
|
|
78
|
+
/** Call an action over HTTP with a bearer token; the envelope, or the error's tag and status. */
|
|
79
|
+
export declare const callAction: (base: string, token: string, action: string, input: unknown, headers?: Record<string, string>) => Promise<{
|
|
80
|
+
readonly status: number;
|
|
81
|
+
readonly body: Record<string, any>;
|
|
82
|
+
}>;
|
|
83
|
+
/** A JSON-RPC `tools/call` to `/mcp` in one request (no session), with a bearer token. */
|
|
84
|
+
export declare const callMcpTool: (base: string, token: string, tool: string, args: unknown) => Promise<{
|
|
85
|
+
status: number;
|
|
86
|
+
challenge: string | null;
|
|
87
|
+
text: string;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* The OAuth side of an MCP host (`@modelcontextprotocol/sdk`'s `OAuthClientProvider`), as Claude Code or another
|
|
91
|
+
* host implements it: it registers dynamically as a public client, keeps the PKCE verifier and the tokens, and
|
|
92
|
+
* records where it was sent to authorise (a host opens that URL in the person's browser; tests drive the pages
|
|
93
|
+
* with `authorizeInBrowser`). `scope` asks for a narrower scope than the default `actions`.
|
|
94
|
+
*/
|
|
95
|
+
export declare class McpOAuthProvider implements OAuthClientProvider {
|
|
96
|
+
authorization: URL | undefined;
|
|
97
|
+
private info;
|
|
98
|
+
private saved;
|
|
99
|
+
private verifier;
|
|
100
|
+
private readonly options;
|
|
101
|
+
constructor(options?: {
|
|
102
|
+
readonly name?: string;
|
|
103
|
+
readonly scope?: string;
|
|
104
|
+
readonly redirect?: string;
|
|
105
|
+
});
|
|
106
|
+
get redirectUrl(): string;
|
|
107
|
+
get clientMetadata(): {
|
|
108
|
+
client_name: string;
|
|
109
|
+
redirect_uris: string[];
|
|
110
|
+
grant_types: string[];
|
|
111
|
+
response_types: string[];
|
|
112
|
+
token_endpoint_auth_method: string;
|
|
113
|
+
scope?: string;
|
|
114
|
+
};
|
|
115
|
+
clientInformation(): any;
|
|
116
|
+
saveClientInformation(info: unknown): void;
|
|
117
|
+
tokens(): any;
|
|
118
|
+
saveTokens(tokens: unknown): void;
|
|
119
|
+
redirectToAuthorization(url: URL): void;
|
|
120
|
+
saveCodeVerifier(verifier: string): void;
|
|
121
|
+
codeVerifier(): string;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=OAuthClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthClient.d.ts","sourceRoot":"","sources":["../../src/conformance/OAuthClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAGnF,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAED,MAAM,WAAW,UAAU;IAC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