@eloxiv/testing 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Admin.d.ts +20 -0
- package/dist/Admin.d.ts.map +1 -0
- package/dist/Admin.js +61 -0
- package/dist/Admin.js.map +1 -0
- package/dist/Agent.d.ts +97 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +210 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSurface.d.ts +20 -0
- package/dist/AgentSurface.d.ts.map +1 -0
- package/dist/AgentSurface.js +36 -0
- package/dist/AgentSurface.js.map +1 -0
- package/dist/Embedder.d.ts +21 -0
- package/dist/Embedder.d.ts.map +1 -0
- package/dist/Embedder.js +54 -0
- package/dist/Embedder.js.map +1 -0
- package/dist/EvalMain.d.ts +2 -0
- package/dist/EvalMain.d.ts.map +1 -0
- package/dist/EvalMain.js +80 -0
- package/dist/EvalMain.js.map +1 -0
- package/dist/Evals.d.ts +95 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +389 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Kernel.d.ts +88 -0
- package/dist/Kernel.d.ts.map +1 -0
- package/dist/Kernel.js +108 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Launch.d.ts +86 -0
- package/dist/Launch.d.ts.map +1 -0
- package/dist/Launch.js +370 -0
- package/dist/Launch.js.map +1 -0
- package/dist/Locks.d.ts +39 -0
- package/dist/Locks.d.ts.map +1 -0
- package/dist/Locks.js +94 -0
- package/dist/Locks.js.map +1 -0
- package/dist/Routes.d.ts +19 -0
- package/dist/Routes.d.ts.map +1 -0
- package/dist/Routes.js +38 -0
- package/dist/Routes.js.map +1 -0
- package/dist/ScriptedChatModel.d.ts +51 -0
- package/dist/ScriptedChatModel.d.ts.map +1 -0
- package/dist/ScriptedChatModel.js +135 -0
- package/dist/ScriptedChatModel.js.map +1 -0
- package/dist/SmtpSink.d.ts +36 -0
- package/dist/SmtpSink.d.ts.map +1 -0
- package/dist/SmtpSink.js +185 -0
- package/dist/SmtpSink.js.map +1 -0
- package/dist/System.d.ts +271 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +908 -0
- package/dist/System.js.map +1 -0
- package/dist/TcpProxy.d.ts +17 -0
- package/dist/TcpProxy.d.ts.map +1 -0
- package/dist/TcpProxy.js +100 -0
- package/dist/TcpProxy.js.map +1 -0
- package/dist/auth/TrustedProxyAuth.d.ts +28 -0
- package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
- package/dist/auth/TrustedProxyAuth.js +128 -0
- package/dist/auth/TrustedProxyAuth.js.map +1 -0
- package/dist/conformance/ActionConsent.d.ts +3 -0
- package/dist/conformance/ActionConsent.d.ts.map +1 -0
- package/dist/conformance/ActionConsent.js +347 -0
- package/dist/conformance/ActionConsent.js.map +1 -0
- package/dist/conformance/ActionRegistry.d.ts +64 -0
- package/dist/conformance/ActionRegistry.d.ts.map +1 -0
- package/dist/conformance/ActionRegistry.js +136 -0
- package/dist/conformance/ActionRegistry.js.map +1 -0
- package/dist/conformance/Actor.d.ts +43 -0
- package/dist/conformance/Actor.d.ts.map +1 -0
- package/dist/conformance/Actor.js +171 -0
- package/dist/conformance/Actor.js.map +1 -0
- package/dist/conformance/AgentReference.d.ts +30 -0
- package/dist/conformance/AgentReference.d.ts.map +1 -0
- package/dist/conformance/AgentReference.js +137 -0
- package/dist/conformance/AgentReference.js.map +1 -0
- package/dist/conformance/AgentResources.d.ts +3 -0
- package/dist/conformance/AgentResources.d.ts.map +1 -0
- package/dist/conformance/AgentResources.js +454 -0
- package/dist/conformance/AgentResources.js.map +1 -0
- package/dist/conformance/AgentRuntime.d.ts +3 -0
- package/dist/conformance/AgentRuntime.d.ts.map +1 -0
- package/dist/conformance/AgentRuntime.js +302 -0
- package/dist/conformance/AgentRuntime.js.map +1 -0
- package/dist/conformance/AgentSubject.d.ts +87 -0
- package/dist/conformance/AgentSubject.d.ts.map +1 -0
- package/dist/conformance/AgentSubject.js +18 -0
- package/dist/conformance/AgentSubject.js.map +1 -0
- package/dist/conformance/Approvals.d.ts +3 -0
- package/dist/conformance/Approvals.d.ts.map +1 -0
- package/dist/conformance/Approvals.js +258 -0
- package/dist/conformance/Approvals.js.map +1 -0
- package/dist/conformance/Audit.d.ts +3 -0
- package/dist/conformance/Audit.d.ts.map +1 -0
- package/dist/conformance/Audit.js +221 -0
- package/dist/conformance/Audit.js.map +1 -0
- package/dist/conformance/CalendarProvider.d.ts +4 -0
- package/dist/conformance/CalendarProvider.d.ts.map +1 -0
- package/dist/conformance/CalendarProvider.js +108 -0
- package/dist/conformance/CalendarProvider.js.map +1 -0
- package/dist/conformance/CapabilityKit.d.ts +191 -0
- package/dist/conformance/CapabilityKit.d.ts.map +1 -0
- package/dist/conformance/CapabilityKit.js +375 -0
- package/dist/conformance/CapabilityKit.js.map +1 -0
- package/dist/conformance/ClientSDK.d.ts +78 -0
- package/dist/conformance/ClientSDK.d.ts.map +1 -0
- package/dist/conformance/ClientSDK.js +163 -0
- package/dist/conformance/ClientSDK.js.map +1 -0
- package/dist/conformance/CollabDocument.d.ts +3 -0
- package/dist/conformance/CollabDocument.d.ts.map +1 -0
- package/dist/conformance/CollabDocument.js +934 -0
- package/dist/conformance/CollabDocument.js.map +1 -0
- package/dist/conformance/CollabReference.d.ts +8 -0
- package/dist/conformance/CollabReference.d.ts.map +1 -0
- package/dist/conformance/CollabReference.js +138 -0
- package/dist/conformance/CollabReference.js.map +1 -0
- package/dist/conformance/CollabSubject.d.ts +68 -0
- package/dist/conformance/CollabSubject.d.ts.map +1 -0
- package/dist/conformance/CollabSubject.js +2 -0
- package/dist/conformance/CollabSubject.js.map +1 -0
- package/dist/conformance/Command.d.ts +3 -0
- package/dist/conformance/Command.d.ts.map +1 -0
- package/dist/conformance/Command.js +73 -0
- package/dist/conformance/Command.js.map +1 -0
- package/dist/conformance/Connections.d.ts +4 -0
- package/dist/conformance/Connections.d.ts.map +1 -0
- package/dist/conformance/Connections.js +308 -0
- package/dist/conformance/Connections.js.map +1 -0
- package/dist/conformance/ConnectionsReference.d.ts +56 -0
- package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
- package/dist/conformance/ConnectionsReference.js +74 -0
- package/dist/conformance/ConnectionsReference.js.map +1 -0
- package/dist/conformance/ConnectorReference.d.ts +86 -0
- package/dist/conformance/ConnectorReference.d.ts.map +1 -0
- package/dist/conformance/ConnectorReference.js +185 -0
- package/dist/conformance/ConnectorReference.js.map +1 -0
- package/dist/conformance/ContextAccounting.d.ts +8 -0
- package/dist/conformance/ContextAccounting.d.ts.map +1 -0
- package/dist/conformance/ContextAccounting.js +125 -0
- package/dist/conformance/ContextAccounting.js.map +1 -0
- package/dist/conformance/Daemon.d.ts +150 -0
- package/dist/conformance/Daemon.d.ts.map +1 -0
- package/dist/conformance/Daemon.js +718 -0
- package/dist/conformance/Daemon.js.map +1 -0
- package/dist/conformance/DaemonReference.d.ts +15 -0
- package/dist/conformance/DaemonReference.d.ts.map +1 -0
- package/dist/conformance/DaemonReference.js +163 -0
- package/dist/conformance/DaemonReference.js.map +1 -0
- package/dist/conformance/DbTx.d.ts +17 -0
- package/dist/conformance/DbTx.d.ts.map +1 -0
- package/dist/conformance/DbTx.js +184 -0
- package/dist/conformance/DbTx.js.map +1 -0
- package/dist/conformance/DecisionTokens.d.ts +3 -0
- package/dist/conformance/DecisionTokens.d.ts.map +1 -0
- package/dist/conformance/DecisionTokens.js +551 -0
- package/dist/conformance/DecisionTokens.js.map +1 -0
- package/dist/conformance/Delegation.d.ts +3 -0
- package/dist/conformance/Delegation.d.ts.map +1 -0
- package/dist/conformance/Delegation.js +149 -0
- package/dist/conformance/Delegation.js.map +1 -0
- package/dist/conformance/DeskReference.d.ts +21 -0
- package/dist/conformance/DeskReference.d.ts.map +1 -0
- package/dist/conformance/DeskReference.js +47 -0
- package/dist/conformance/DeskReference.js.map +1 -0
- package/dist/conformance/DeviceControl.d.ts +3 -0
- package/dist/conformance/DeviceControl.d.ts.map +1 -0
- package/dist/conformance/DeviceControl.js +579 -0
- package/dist/conformance/DeviceControl.js.map +1 -0
- package/dist/conformance/Directory.d.ts +36 -0
- package/dist/conformance/Directory.d.ts.map +1 -0
- package/dist/conformance/Directory.js +253 -0
- package/dist/conformance/Directory.js.map +1 -0
- package/dist/conformance/DirectoryProvider.d.ts +4 -0
- package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
- package/dist/conformance/DirectoryProvider.js +58 -0
- package/dist/conformance/DirectoryProvider.js.map +1 -0
- package/dist/conformance/DocumentSource.d.ts +4 -0
- package/dist/conformance/DocumentSource.d.ts.map +1 -0
- package/dist/conformance/DocumentSource.js +43 -0
- package/dist/conformance/DocumentSource.js.map +1 -0
- package/dist/conformance/EndpointReference.d.ts +40 -0
- package/dist/conformance/EndpointReference.d.ts.map +1 -0
- package/dist/conformance/EndpointReference.js +67 -0
- package/dist/conformance/EndpointReference.js.map +1 -0
- package/dist/conformance/Files.d.ts +40 -0
- package/dist/conformance/Files.d.ts.map +1 -0
- package/dist/conformance/Files.js +592 -0
- package/dist/conformance/Files.js.map +1 -0
- package/dist/conformance/FilesReference.d.ts +31 -0
- package/dist/conformance/FilesReference.d.ts.map +1 -0
- package/dist/conformance/FilesReference.js +116 -0
- package/dist/conformance/FilesReference.js.map +1 -0
- package/dist/conformance/FilesSubject.d.ts +46 -0
- package/dist/conformance/FilesSubject.d.ts.map +1 -0
- package/dist/conformance/FilesSubject.js +3 -0
- package/dist/conformance/FilesSubject.js.map +1 -0
- package/dist/conformance/Flags.d.ts +3 -0
- package/dist/conformance/Flags.d.ts.map +1 -0
- package/dist/conformance/Flags.js +183 -0
- package/dist/conformance/Flags.js.map +1 -0
- package/dist/conformance/Host.d.ts +64 -0
- package/dist/conformance/Host.d.ts.map +1 -0
- package/dist/conformance/Host.js +152 -0
- package/dist/conformance/Host.js.map +1 -0
- package/dist/conformance/HttpApi.d.ts +5 -0
- package/dist/conformance/HttpApi.d.ts.map +1 -0
- package/dist/conformance/HttpApi.js +131 -0
- package/dist/conformance/HttpApi.js.map +1 -0
- package/dist/conformance/InboxReference.d.ts +28 -0
- package/dist/conformance/InboxReference.d.ts.map +1 -0
- package/dist/conformance/InboxReference.js +331 -0
- package/dist/conformance/InboxReference.js.map +1 -0
- package/dist/conformance/InboxSubject.d.ts +92 -0
- package/dist/conformance/InboxSubject.d.ts.map +1 -0
- package/dist/conformance/InboxSubject.js +16 -0
- package/dist/conformance/InboxSubject.js.map +1 -0
- package/dist/conformance/Ingestion.d.ts +10 -0
- package/dist/conformance/Ingestion.d.ts.map +1 -0
- package/dist/conformance/Ingestion.js +335 -0
- package/dist/conformance/Ingestion.js.map +1 -0
- package/dist/conformance/Ingress.d.ts +62 -0
- package/dist/conformance/Ingress.d.ts.map +1 -0
- package/dist/conformance/Ingress.js +346 -0
- package/dist/conformance/Ingress.js.map +1 -0
- package/dist/conformance/Invocation.d.ts +3 -0
- package/dist/conformance/Invocation.d.ts.map +1 -0
- package/dist/conformance/Invocation.js +665 -0
- package/dist/conformance/Invocation.js.map +1 -0
- package/dist/conformance/IsolationMatrix.d.ts +60 -0
- package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
- package/dist/conformance/IsolationMatrix.js +196 -0
- package/dist/conformance/IsolationMatrix.js.map +1 -0
- package/dist/conformance/LiveConnection.d.ts +72 -0
- package/dist/conformance/LiveConnection.d.ts.map +1 -0
- package/dist/conformance/LiveConnection.js +125 -0
- package/dist/conformance/LiveConnection.js.map +1 -0
- package/dist/conformance/LocalClient.d.ts +70 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +576 -0
- package/dist/conformance/LocalClient.js.map +1 -0
- package/dist/conformance/Locale.d.ts +28 -0
- package/dist/conformance/Locale.d.ts.map +1 -0
- package/dist/conformance/Locale.js +115 -0
- package/dist/conformance/Locale.js.map +1 -0
- package/dist/conformance/MachineIdentity.d.ts +39 -0
- package/dist/conformance/MachineIdentity.d.ts.map +1 -0
- package/dist/conformance/MachineIdentity.js +595 -0
- package/dist/conformance/MachineIdentity.js.map +1 -0
- package/dist/conformance/MailProvider.d.ts +4 -0
- package/dist/conformance/MailProvider.d.ts.map +1 -0
- package/dist/conformance/MailProvider.js +167 -0
- package/dist/conformance/MailProvider.js.map +1 -0
- package/dist/conformance/Memory.d.ts +10 -0
- package/dist/conformance/Memory.d.ts.map +1 -0
- package/dist/conformance/Memory.js +179 -0
- package/dist/conformance/Memory.js.map +1 -0
- package/dist/conformance/Messaging.d.ts +49 -0
- package/dist/conformance/Messaging.d.ts.map +1 -0
- package/dist/conformance/Messaging.js +117 -0
- package/dist/conformance/Messaging.js.map +1 -0
- package/dist/conformance/Metering.d.ts +26 -0
- package/dist/conformance/Metering.d.ts.map +1 -0
- package/dist/conformance/Metering.js +236 -0
- package/dist/conformance/Metering.js.map +1 -0
- package/dist/conformance/ModelProvider.d.ts +32 -0
- package/dist/conformance/ModelProvider.d.ts.map +1 -0
- package/dist/conformance/ModelProvider.js +100 -0
- package/dist/conformance/ModelProvider.js.map +1 -0
- package/dist/conformance/ModuleManifest.d.ts +9 -0
- package/dist/conformance/ModuleManifest.d.ts.map +1 -0
- package/dist/conformance/ModuleManifest.js +542 -0
- package/dist/conformance/ModuleManifest.js.map +1 -0
- package/dist/conformance/NotebookAgent.d.ts +32 -0
- package/dist/conformance/NotebookAgent.d.ts.map +1 -0
- package/dist/conformance/NotebookAgent.js +31 -0
- package/dist/conformance/NotebookAgent.js.map +1 -0
- package/dist/conformance/NotificationChannel.d.ts +40 -0
- package/dist/conformance/NotificationChannel.d.ts.map +1 -0
- package/dist/conformance/NotificationChannel.js +78 -0
- package/dist/conformance/NotificationChannel.js.map +1 -0
- package/dist/conformance/Notifications.d.ts +3 -0
- package/dist/conformance/Notifications.d.ts.map +1 -0
- package/dist/conformance/Notifications.js +240 -0
- package/dist/conformance/Notifications.js.map +1 -0
- package/dist/conformance/OAuthClient.d.ts +123 -0
- package/dist/conformance/OAuthClient.d.ts.map +1 -0
- package/dist/conformance/OAuthClient.js +204 -0
- package/dist/conformance/OAuthClient.js.map +1 -0
- package/dist/conformance/Outbox.d.ts +3 -0
- package/dist/conformance/Outbox.d.ts.map +1 -0
- package/dist/conformance/Outbox.js +266 -0
- package/dist/conformance/Outbox.js.map +1 -0
- package/dist/conformance/PlatformReference.d.ts +5 -0
- package/dist/conformance/PlatformReference.d.ts.map +1 -0
- package/dist/conformance/PlatformReference.js +66 -0
- package/dist/conformance/PlatformReference.js.map +1 -0
- package/dist/conformance/PlatformSubject.d.ts +45 -0
- package/dist/conformance/PlatformSubject.d.ts.map +1 -0
- package/dist/conformance/PlatformSubject.js +3 -0
- package/dist/conformance/PlatformSubject.js.map +1 -0
- package/dist/conformance/Privacy.d.ts +3 -0
- package/dist/conformance/Privacy.d.ts.map +1 -0
- package/dist/conformance/Privacy.js +437 -0
- package/dist/conformance/Privacy.js.map +1 -0
- package/dist/conformance/Progress.d.ts +3 -0
- package/dist/conformance/Progress.d.ts.map +1 -0
- package/dist/conformance/Progress.js +153 -0
- package/dist/conformance/Progress.js.map +1 -0
- package/dist/conformance/Push.d.ts +38 -0
- package/dist/conformance/Push.d.ts.map +1 -0
- package/dist/conformance/Push.js +649 -0
- package/dist/conformance/Push.js.map +1 -0
- package/dist/conformance/PushReference.d.ts +3 -0
- package/dist/conformance/PushReference.d.ts.map +1 -0
- package/dist/conformance/PushReference.js +97 -0
- package/dist/conformance/PushReference.js.map +1 -0
- package/dist/conformance/QuerySurface.d.ts +9 -0
- package/dist/conformance/QuerySurface.d.ts.map +1 -0
- package/dist/conformance/QuerySurface.js +349 -0
- package/dist/conformance/QuerySurface.js.map +1 -0
- package/dist/conformance/Readiness.d.ts +23 -0
- package/dist/conformance/Readiness.d.ts.map +1 -0
- package/dist/conformance/Readiness.js +110 -0
- package/dist/conformance/Readiness.js.map +1 -0
- package/dist/conformance/Reference.d.ts +17 -0
- package/dist/conformance/Reference.d.ts.map +1 -0
- package/dist/conformance/Reference.js +246 -0
- package/dist/conformance/Reference.js.map +1 -0
- package/dist/conformance/Release.d.ts +73 -0
- package/dist/conformance/Release.d.ts.map +1 -0
- package/dist/conformance/Release.js +556 -0
- package/dist/conformance/Release.js.map +1 -0
- package/dist/conformance/ReleaseReference.d.ts +5 -0
- package/dist/conformance/ReleaseReference.d.ts.map +1 -0
- package/dist/conformance/ReleaseReference.js +124 -0
- package/dist/conformance/ReleaseReference.js.map +1 -0
- package/dist/conformance/ResultRendering.d.ts +3 -0
- package/dist/conformance/ResultRendering.d.ts.map +1 -0
- package/dist/conformance/ResultRendering.js +120 -0
- package/dist/conformance/ResultRendering.js.map +1 -0
- package/dist/conformance/Sandbox.d.ts +58 -0
- package/dist/conformance/Sandbox.d.ts.map +1 -0
- package/dist/conformance/Sandbox.js +213 -0
- package/dist/conformance/Sandbox.js.map +1 -0
- package/dist/conformance/SandboxReference.d.ts +3 -0
- package/dist/conformance/SandboxReference.d.ts.map +1 -0
- package/dist/conformance/SandboxReference.js +44 -0
- package/dist/conformance/SandboxReference.js.map +1 -0
- package/dist/conformance/Scheduler.d.ts +106 -0
- package/dist/conformance/Scheduler.d.ts.map +1 -0
- package/dist/conformance/Scheduler.js +576 -0
- package/dist/conformance/Scheduler.js.map +1 -0
- package/dist/conformance/ScreenContext.d.ts +84 -0
- package/dist/conformance/ScreenContext.d.ts.map +1 -0
- package/dist/conformance/ScreenContext.js +290 -0
- package/dist/conformance/ScreenContext.js.map +1 -0
- package/dist/conformance/Search.d.ts +3 -0
- package/dist/conformance/Search.d.ts.map +1 -0
- package/dist/conformance/Search.js +333 -0
- package/dist/conformance/Search.js.map +1 -0
- package/dist/conformance/Secrets.d.ts +8 -0
- package/dist/conformance/Secrets.d.ts.map +1 -0
- package/dist/conformance/Secrets.js +231 -0
- package/dist/conformance/Secrets.js.map +1 -0
- package/dist/conformance/SecretsReference.d.ts +44 -0
- package/dist/conformance/SecretsReference.d.ts.map +1 -0
- package/dist/conformance/SecretsReference.js +73 -0
- package/dist/conformance/SecretsReference.js.map +1 -0
- package/dist/conformance/ServicesReference.d.ts +8 -0
- package/dist/conformance/ServicesReference.d.ts.map +1 -0
- package/dist/conformance/ServicesReference.js +273 -0
- package/dist/conformance/ServicesReference.js.map +1 -0
- package/dist/conformance/ServicesSubject.d.ts +104 -0
- package/dist/conformance/ServicesSubject.d.ts.map +1 -0
- package/dist/conformance/ServicesSubject.js +2 -0
- package/dist/conformance/ServicesSubject.js.map +1 -0
- package/dist/conformance/Settings.d.ts +3 -0
- package/dist/conformance/Settings.d.ts.map +1 -0
- package/dist/conformance/Settings.js +177 -0
- package/dist/conformance/Settings.js.map +1 -0
- package/dist/conformance/Sharing.d.ts +3 -0
- package/dist/conformance/Sharing.d.ts.map +1 -0
- package/dist/conformance/Sharing.js +368 -0
- package/dist/conformance/Sharing.js.map +1 -0
- package/dist/conformance/ShellSubject.d.ts +29 -0
- package/dist/conformance/ShellSubject.d.ts.map +1 -0
- package/dist/conformance/ShellSubject.js +13 -0
- package/dist/conformance/ShellSubject.js.map +1 -0
- package/dist/conformance/SignOutRace.d.ts +23 -0
- package/dist/conformance/SignOutRace.d.ts.map +1 -0
- package/dist/conformance/SignOutRace.js +49 -0
- package/dist/conformance/SignOutRace.js.map +1 -0
- package/dist/conformance/Slot.d.ts +3 -0
- package/dist/conformance/Slot.d.ts.map +1 -0
- package/dist/conformance/Slot.js +79 -0
- package/dist/conformance/Slot.js.map +1 -0
- package/dist/conformance/Space.d.ts +63 -0
- package/dist/conformance/Space.d.ts.map +1 -0
- package/dist/conformance/Space.js +294 -0
- package/dist/conformance/Space.js.map +1 -0
- package/dist/conformance/StorageAdapter.d.ts +76 -0
- package/dist/conformance/StorageAdapter.d.ts.map +1 -0
- package/dist/conformance/StorageAdapter.js +181 -0
- package/dist/conformance/StorageAdapter.js.map +1 -0
- package/dist/conformance/StorageBackend.d.ts +23 -0
- package/dist/conformance/StorageBackend.d.ts.map +1 -0
- package/dist/conformance/StorageBackend.js +274 -0
- package/dist/conformance/StorageBackend.js.map +1 -0
- package/dist/conformance/Subject.d.ts +198 -0
- package/dist/conformance/Subject.d.ts.map +1 -0
- package/dist/conformance/Subject.js +26 -0
- package/dist/conformance/Subject.js.map +1 -0
- package/dist/conformance/Sync.d.ts +3 -0
- package/dist/conformance/Sync.d.ts.map +1 -0
- package/dist/conformance/Sync.js +190 -0
- package/dist/conformance/Sync.js.map +1 -0
- package/dist/conformance/Telemetry.d.ts +3 -0
- package/dist/conformance/Telemetry.d.ts.map +1 -0
- package/dist/conformance/Telemetry.js +218 -0
- package/dist/conformance/Telemetry.js.map +1 -0
- package/dist/conformance/ThemeTokens.d.ts +22 -0
- package/dist/conformance/ThemeTokens.d.ts.map +1 -0
- package/dist/conformance/ThemeTokens.js +121 -0
- package/dist/conformance/ThemeTokens.js.map +1 -0
- package/dist/conformance/ToolSource.d.ts +5 -0
- package/dist/conformance/ToolSource.d.ts.map +1 -0
- package/dist/conformance/ToolSource.js +520 -0
- package/dist/conformance/ToolSource.js.map +1 -0
- package/dist/conformance/Versioning.d.ts +3 -0
- package/dist/conformance/Versioning.d.ts.map +1 -0
- package/dist/conformance/Versioning.js +160 -0
- package/dist/conformance/Versioning.js.map +1 -0
- package/dist/conformance/View.d.ts +3 -0
- package/dist/conformance/View.d.ts.map +1 -0
- package/dist/conformance/View.js +121 -0
- package/dist/conformance/View.js.map +1 -0
- package/dist/conformance/WorkItems.d.ts +3 -0
- package/dist/conformance/WorkItems.d.ts.map +1 -0
- package/dist/conformance/WorkItems.js +152 -0
- package/dist/conformance/WorkItems.js.map +1 -0
- package/dist/conformance/Workflow.d.ts +63 -0
- package/dist/conformance/Workflow.d.ts.map +1 -0
- package/dist/conformance/Workflow.js +235 -0
- package/dist/conformance/Workflow.js.map +1 -0
- package/dist/conformance/acme/chatlog.d.ts +591 -0
- package/dist/conformance/acme/chatlog.d.ts.map +1 -0
- package/dist/conformance/acme/chatlog.js +101 -0
- package/dist/conformance/acme/chatlog.js.map +1 -0
- package/dist/conformance/acme/connector.d.ts +12 -0
- package/dist/conformance/acme/connector.d.ts.map +1 -0
- package/dist/conformance/acme/connector.js +123 -0
- package/dist/conformance/acme/connector.js.map +1 -0
- package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
- package/dist/conformance/archive/app.d.ts +728 -0
- package/dist/conformance/archive/app.d.ts.map +1 -0
- package/dist/conformance/archive/app.js +30 -0
- package/dist/conformance/archive/app.js.map +1 -0
- package/dist/conformance/archive/contract.d.ts +467 -0
- package/dist/conformance/archive/contract.d.ts.map +1 -0
- package/dist/conformance/archive/contract.js +187 -0
- package/dist/conformance/archive/contract.js.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.js +23 -0
- package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
- package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/dist/conformance/archive/schema.d.ts +185 -0
- package/dist/conformance/archive/schema.d.ts.map +1 -0
- package/dist/conformance/archive/schema.js +22 -0
- package/dist/conformance/archive/schema.js.map +1 -0
- package/dist/conformance/archive/server.d.ts +273 -0
- package/dist/conformance/archive/server.d.ts.map +1 -0
- package/dist/conformance/archive/server.js +127 -0
- package/dist/conformance/archive/server.js.map +1 -0
- package/dist/conformance/archive/sync.gen.d.ts +319 -0
- package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/sync.gen.js +29 -0
- package/dist/conformance/archive/sync.gen.js.map +1 -0
- package/dist/conformance/atlas/app.d.ts +3 -0
- package/dist/conformance/atlas/app.d.ts.map +1 -0
- package/dist/conformance/atlas/app.js +15 -0
- package/dist/conformance/atlas/app.js.map +1 -0
- package/dist/conformance/atlas/contract.d.ts +489 -0
- package/dist/conformance/atlas/contract.d.ts.map +1 -0
- package/dist/conformance/atlas/contract.js +114 -0
- package/dist/conformance/atlas/contract.js.map +1 -0
- package/dist/conformance/crm/app.d.ts +304 -0
- package/dist/conformance/crm/app.d.ts.map +1 -0
- package/dist/conformance/crm/app.js +95 -0
- package/dist/conformance/crm/app.js.map +1 -0
- package/dist/conformance/crm/contract.d.ts +586 -0
- package/dist/conformance/crm/contract.d.ts.map +1 -0
- package/dist/conformance/crm/contract.js +153 -0
- package/dist/conformance/crm/contract.js.map +1 -0
- package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/dist/conformance/crm/schema.d.ts +261 -0
- package/dist/conformance/crm/schema.d.ts.map +1 -0
- package/dist/conformance/crm/schema.js +25 -0
- package/dist/conformance/crm/schema.js.map +1 -0
- package/dist/conformance/crm/sync.gen.d.ts +188 -0
- package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
- package/dist/conformance/crm/sync.gen.js +25 -0
- package/dist/conformance/crm/sync.gen.js.map +1 -0
- package/dist/conformance/desk/contract.d.ts +306 -0
- package/dist/conformance/desk/contract.d.ts.map +1 -0
- package/dist/conformance/desk/contract.js +56 -0
- package/dist/conformance/desk/contract.js.map +1 -0
- package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
- package/dist/conformance/desk/server.d.ts +231 -0
- package/dist/conformance/desk/server.d.ts.map +1 -0
- package/dist/conformance/desk/server.js +123 -0
- package/dist/conformance/desk/server.js.map +1 -0
- package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/dist/conformance/drafts/module.d.ts +571 -0
- package/dist/conformance/drafts/module.d.ts.map +1 -0
- package/dist/conformance/drafts/module.js +190 -0
- package/dist/conformance/drafts/module.js.map +1 -0
- package/dist/conformance/fixture/app.d.ts +24 -0
- package/dist/conformance/fixture/app.d.ts.map +1 -0
- package/dist/conformance/fixture/app.js +26 -0
- package/dist/conformance/fixture/app.js.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.js +22 -0
- package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
- package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
- package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/contract.js +277 -0
- package/dist/conformance/fixture/docs/contract.js.map +1 -0
- package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/dist/conformance/fixture/docs/policy.cedar +110 -0
- package/dist/conformance/fixture/docs/schema.d.ts +308 -0
- package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/schema.js +36 -0
- package/dist/conformance/fixture/docs/schema.js.map +1 -0
- package/dist/conformance/fixture/docs/server.d.ts +552 -0
- package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/server.js +192 -0
- package/dist/conformance/fixture/docs/server.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.d.ts +402 -0
- package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.js +48 -0
- package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.js +23 -0
- package/dist/conformance/fixture/docs/sync.js.map +1 -0
- package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/dist/conformance/fixture/peer/module.d.ts +306 -0
- package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
- package/dist/conformance/fixture/peer/module.js +44 -0
- package/dist/conformance/fixture/peer/module.js.map +1 -0
- package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/module.d.ts +1878 -0
- package/dist/conformance/fixture/release/module.d.ts.map +1 -0
- package/dist/conformance/fixture/release/module.js +102 -0
- package/dist/conformance/fixture/release/module.js.map +1 -0
- package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/dist/conformance/kit-hash.d.ts +8 -0
- package/dist/conformance/kit-hash.d.ts.map +1 -0
- package/dist/conformance/kit-hash.js +20 -0
- package/dist/conformance/kit-hash.js.map +1 -0
- package/dist/conformance/ledger/contract.d.ts +380 -0
- package/dist/conformance/ledger/contract.d.ts.map +1 -0
- package/dist/conformance/ledger/contract.js +81 -0
- package/dist/conformance/ledger/contract.js.map +1 -0
- package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/dist/conformance/ledger/server.d.ts +312 -0
- package/dist/conformance/ledger/server.d.ts.map +1 -0
- package/dist/conformance/ledger/server.js +152 -0
- package/dist/conformance/ledger/server.js.map +1 -0
- package/dist/conformance/library/app.d.ts +616 -0
- package/dist/conformance/library/app.d.ts.map +1 -0
- package/dist/conformance/library/app.js +35 -0
- package/dist/conformance/library/app.js.map +1 -0
- package/dist/conformance/library/contract.d.ts +377 -0
- package/dist/conformance/library/contract.d.ts.map +1 -0
- package/dist/conformance/library/contract.js +63 -0
- package/dist/conformance/library/contract.js.map +1 -0
- package/dist/conformance/library/migrations/0000_library.sql +14 -0
- package/dist/conformance/library/schema.d.ts +174 -0
- package/dist/conformance/library/schema.d.ts.map +1 -0
- package/dist/conformance/library/schema.js +24 -0
- package/dist/conformance/library/schema.js.map +1 -0
- package/dist/conformance/library/server.d.ts +191 -0
- package/dist/conformance/library/server.d.ts.map +1 -0
- package/dist/conformance/library/server.js +52 -0
- package/dist/conformance/library/server.js.map +1 -0
- package/dist/conformance/library/sync.gen.d.ts +519 -0
- package/dist/conformance/library/sync.gen.d.ts.map +1 -0
- package/dist/conformance/library/sync.gen.js +42 -0
- package/dist/conformance/library/sync.gen.js.map +1 -0
- package/dist/conformance/locale/catalog.d.ts +93 -0
- package/dist/conformance/locale/catalog.d.ts.map +1 -0
- package/dist/conformance/locale/catalog.js +104 -0
- package/dist/conformance/locale/catalog.js.map +1 -0
- package/dist/conformance/notebook/app.d.ts +1039 -0
- package/dist/conformance/notebook/app.d.ts.map +1 -0
- package/dist/conformance/notebook/app.js +88 -0
- package/dist/conformance/notebook/app.js.map +1 -0
- package/dist/conformance/notebook/evals/pages.evals.json +94 -0
- package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/dist/conformance/notebook/module.d.ts +717 -0
- package/dist/conformance/notebook/module.d.ts.map +1 -0
- package/dist/conformance/notebook/module.js +188 -0
- package/dist/conformance/notebook/module.js.map +1 -0
- package/dist/conformance/pad/app.d.ts +9 -0
- package/dist/conformance/pad/app.d.ts.map +1 -0
- package/dist/conformance/pad/app.js +13 -0
- package/dist/conformance/pad/app.js.map +1 -0
- package/dist/conformance/pad/contract.d.ts +281 -0
- package/dist/conformance/pad/contract.d.ts.map +1 -0
- package/dist/conformance/pad/contract.js +66 -0
- package/dist/conformance/pad/contract.js.map +1 -0
- package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/dist/conformance/pad/schema.d.ts +127 -0
- package/dist/conformance/pad/schema.d.ts.map +1 -0
- package/dist/conformance/pad/schema.js +17 -0
- package/dist/conformance/pad/schema.js.map +1 -0
- package/dist/conformance/pad/server.d.ts +149 -0
- package/dist/conformance/pad/server.d.ts.map +1 -0
- package/dist/conformance/pad/server.js +81 -0
- package/dist/conformance/pad/server.js.map +1 -0
- package/dist/conformance/purchases/app.d.ts +480 -0
- package/dist/conformance/purchases/app.d.ts.map +1 -0
- package/dist/conformance/purchases/app.js +32 -0
- package/dist/conformance/purchases/app.js.map +1 -0
- package/dist/conformance/purchases/contract.d.ts +720 -0
- package/dist/conformance/purchases/contract.d.ts.map +1 -0
- package/dist/conformance/purchases/contract.js +148 -0
- package/dist/conformance/purchases/contract.js.map +1 -0
- package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/dist/conformance/purchases/server.d.ts +250 -0
- package/dist/conformance/purchases/server.d.ts.map +1 -0
- package/dist/conformance/purchases/server.js +85 -0
- package/dist/conformance/purchases/server.js.map +1 -0
- package/dist/conformance/studio/app.d.ts +996 -0
- package/dist/conformance/studio/app.d.ts.map +1 -0
- package/dist/conformance/studio/app.js +251 -0
- package/dist/conformance/studio/app.js.map +1 -0
- package/dist/conformance/studio/contract.d.ts +1318 -0
- package/dist/conformance/studio/contract.d.ts.map +1 -0
- package/dist/conformance/studio/contract.js +280 -0
- package/dist/conformance/studio/contract.js.map +1 -0
- package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/dist/conformance/workshop/app.d.ts +8 -0
- package/dist/conformance/workshop/app.d.ts.map +1 -0
- package/dist/conformance/workshop/app.js +13 -0
- package/dist/conformance/workshop/app.js.map +1 -0
- package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/dist/conformance/workshop/module.d.ts +407 -0
- package/dist/conformance/workshop/module.d.ts.map +1 -0
- package/dist/conformance/workshop/module.js +71 -0
- package/dist/conformance/workshop/module.js.map +1 -0
- package/dist/fakes/AcmeFake.d.ts +46 -0
- package/dist/fakes/AcmeFake.d.ts.map +1 -0
- package/dist/fakes/AcmeFake.js +131 -0
- package/dist/fakes/AcmeFake.js.map +1 -0
- package/dist/fakes/ApnsFake.d.ts +79 -0
- package/dist/fakes/ApnsFake.d.ts.map +1 -0
- package/dist/fakes/ApnsFake.js +220 -0
- package/dist/fakes/ApnsFake.js.map +1 -0
- package/dist/fakes/FcmFake.d.ts +46 -0
- package/dist/fakes/FcmFake.d.ts.map +1 -0
- package/dist/fakes/FcmFake.js +185 -0
- package/dist/fakes/FcmFake.js.map +1 -0
- package/dist/fakes/GoogleFake.d.ts +221 -0
- package/dist/fakes/GoogleFake.d.ts.map +1 -0
- package/dist/fakes/GoogleFake.js +1035 -0
- package/dist/fakes/GoogleFake.js.map +1 -0
- package/dist/fakes/HttpApiFake.d.ts +22 -0
- package/dist/fakes/HttpApiFake.d.ts.map +1 -0
- package/dist/fakes/HttpApiFake.js +74 -0
- package/dist/fakes/HttpApiFake.js.map +1 -0
- package/dist/fakes/McpFake.d.ts +80 -0
- package/dist/fakes/McpFake.d.ts.map +1 -0
- package/dist/fakes/McpFake.js +312 -0
- package/dist/fakes/McpFake.js.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.js +850 -0
- package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
- package/dist/fakes/S3Fake.d.ts +29 -0
- package/dist/fakes/S3Fake.d.ts.map +1 -0
- package/dist/fakes/S3Fake.js +347 -0
- package/dist/fakes/S3Fake.js.map +1 -0
- package/dist/fakes/Server.d.ts +137 -0
- package/dist/fakes/Server.d.ts.map +1 -0
- package/dist/fakes/Server.js +357 -0
- package/dist/fakes/Server.js.map +1 -0
- package/dist/fakes/SignInProviderFake.d.ts +21 -0
- package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
- package/dist/fakes/SignInProviderFake.js +56 -0
- package/dist/fakes/SignInProviderFake.js.map +1 -0
- package/dist/fakes/SlackFake.d.ts +136 -0
- package/dist/fakes/SlackFake.d.ts.map +1 -0
- package/dist/fakes/SlackFake.js +787 -0
- package/dist/fakes/SlackFake.js.map +1 -0
- package/dist/fakes/Store.d.ts +40 -0
- package/dist/fakes/Store.d.ts.map +1 -0
- package/dist/fakes/Store.js +82 -0
- package/dist/fakes/Store.js.map +1 -0
- package/dist/fakes/TelemetryFakes.d.ts +77 -0
- package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
- package/dist/fakes/TelemetryFakes.js +121 -0
- package/dist/fakes/TelemetryFakes.js.map +1 -0
- package/dist/fakes/TestCa.d.ts +11 -0
- package/dist/fakes/TestCa.d.ts.map +1 -0
- package/dist/fakes/TestCa.js +115 -0
- package/dist/fakes/TestCa.js.map +1 -0
- package/dist/fakes/WorkOsFake.d.ts +40 -0
- package/dist/fakes/WorkOsFake.d.ts.map +1 -0
- package/dist/fakes/WorkOsFake.js +103 -0
- package/dist/fakes/WorkOsFake.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/make/reference.d.ts +520 -0
- package/dist/make/reference.d.ts.map +1 -0
- package/dist/make/reference.js +182 -0
- package/dist/make/reference.js.map +1 -0
- package/dist/make/sources.d.ts +48 -0
- package/dist/make/sources.d.ts.map +1 -0
- package/dist/make/sources.js +806 -0
- package/dist/make/sources.js.map +1 -0
- package/package.json +77 -3
- package/src/Admin.ts +82 -0
- package/src/Agent.ts +289 -0
- package/src/AgentSurface.ts +51 -0
- package/src/Embedder.ts +69 -0
- package/src/EvalMain.ts +81 -0
- package/src/Evals.ts +490 -0
- package/src/Kernel.ts +228 -0
- package/src/Launch.ts +428 -0
- package/src/Locks.ts +123 -0
- package/src/Routes.ts +65 -0
- package/src/ScriptedChatModel.ts +189 -0
- package/src/SmtpSink.ts +205 -0
- package/src/System.ts +1075 -0
- package/src/TcpProxy.ts +102 -0
- package/src/auth/TrustedProxyAuth.ts +173 -0
- package/src/conformance/ActionConsent.ts +437 -0
- package/src/conformance/ActionRegistry.ts +174 -0
- package/src/conformance/Actor.ts +216 -0
- package/src/conformance/AgentReference.ts +171 -0
- package/src/conformance/AgentResources.ts +548 -0
- package/src/conformance/AgentRuntime.ts +388 -0
- package/src/conformance/AgentSubject.ts +103 -0
- package/src/conformance/Approvals.ts +363 -0
- package/src/conformance/Audit.ts +257 -0
- package/src/conformance/CalendarProvider.ts +156 -0
- package/src/conformance/CapabilityKit.ts +564 -0
- package/src/conformance/ClientSDK.ts +233 -0
- package/src/conformance/CollabDocument.ts +1203 -0
- package/src/conformance/CollabReference.ts +152 -0
- package/src/conformance/CollabSubject.ts +64 -0
- package/src/conformance/Command.ts +75 -0
- package/src/conformance/Connections.ts +357 -0
- package/src/conformance/ConnectionsReference.ts +172 -0
- package/src/conformance/ConnectorReference.ts +280 -0
- package/src/conformance/ContextAccounting.ts +169 -0
- package/src/conformance/Daemon.ts +936 -0
- package/src/conformance/DaemonReference.ts +189 -0
- package/src/conformance/DbTx.ts +253 -0
- package/src/conformance/DecisionTokens.ts +652 -0
- package/src/conformance/Delegation.ts +177 -0
- package/src/conformance/DeskReference.ts +73 -0
- package/src/conformance/DeviceControl.ts +700 -0
- package/src/conformance/Directory.ts +315 -0
- package/src/conformance/DirectoryProvider.ts +72 -0
- package/src/conformance/DocumentSource.ts +62 -0
- package/src/conformance/EndpointReference.ts +117 -0
- package/src/conformance/Files.ts +685 -0
- package/src/conformance/FilesReference.ts +154 -0
- package/src/conformance/FilesSubject.ts +50 -0
- package/src/conformance/Flags.ts +215 -0
- package/src/conformance/Host.ts +197 -0
- package/src/conformance/HttpApi.ts +169 -0
- package/src/conformance/InboxReference.ts +401 -0
- package/src/conformance/InboxSubject.ts +101 -0
- package/src/conformance/Ingestion.ts +425 -0
- package/src/conformance/Ingress.ts +498 -0
- package/src/conformance/Invocation.ts +780 -0
- package/src/conformance/IsolationMatrix.ts +215 -0
- package/src/conformance/LiveConnection.ts +197 -0
- package/src/conformance/LocalClient.ts +707 -0
- package/src/conformance/Locale.ts +141 -0
- package/src/conformance/MachineIdentity.ts +828 -0
- package/src/conformance/MailProvider.ts +217 -0
- package/src/conformance/Memory.ts +223 -0
- package/src/conformance/Messaging.ts +185 -0
- package/src/conformance/Metering.ts +293 -0
- package/src/conformance/ModelProvider.ts +139 -0
- package/src/conformance/ModuleManifest.ts +630 -0
- package/src/conformance/NotebookAgent.ts +41 -0
- package/src/conformance/NotificationChannel.ts +122 -0
- package/src/conformance/Notifications.ts +316 -0
- package/src/conformance/OAuthClient.ts +240 -0
- package/src/conformance/Outbox.ts +342 -0
- package/src/conformance/PlatformReference.ts +73 -0
- package/src/conformance/PlatformSubject.ts +50 -0
- package/src/conformance/Privacy.ts +577 -0
- package/src/conformance/Progress.ts +244 -0
- package/src/conformance/Push.ts +820 -0
- package/src/conformance/PushReference.ts +101 -0
- package/src/conformance/QuerySurface.ts +408 -0
- package/src/conformance/Readiness.ts +157 -0
- package/src/conformance/Reference.ts +326 -0
- package/src/conformance/Release.ts +690 -0
- package/src/conformance/ReleaseReference.ts +179 -0
- package/src/conformance/ResultRendering.ts +149 -0
- package/src/conformance/Sandbox.ts +313 -0
- package/src/conformance/SandboxReference.ts +52 -0
- package/src/conformance/Scheduler.ts +764 -0
- package/src/conformance/ScreenContext.ts +402 -0
- package/src/conformance/Search.ts +419 -0
- package/src/conformance/Secrets.ts +277 -0
- package/src/conformance/SecretsReference.ts +131 -0
- package/src/conformance/ServicesReference.ts +330 -0
- package/src/conformance/ServicesSubject.ts +105 -0
- package/src/conformance/Settings.ts +204 -0
- package/src/conformance/Sharing.ts +486 -0
- package/src/conformance/ShellSubject.ts +47 -0
- package/src/conformance/SignOutRace.ts +77 -0
- package/src/conformance/Slot.ts +84 -0
- package/src/conformance/Space.ts +432 -0
- package/src/conformance/StorageAdapter.ts +253 -0
- package/src/conformance/StorageBackend.ts +327 -0
- package/src/conformance/Subject.ts +208 -0
- package/src/conformance/Sync.ts +215 -0
- package/src/conformance/Telemetry.ts +287 -0
- package/src/conformance/ThemeTokens.ts +163 -0
- package/src/conformance/ToolSource.ts +632 -0
- package/src/conformance/Versioning.ts +199 -0
- package/src/conformance/View.ts +143 -0
- package/src/conformance/WorkItems.ts +186 -0
- package/src/conformance/Workflow.ts +304 -0
- package/src/conformance/acme/chatlog.ts +115 -0
- package/src/conformance/acme/connector.ts +151 -0
- package/src/conformance/acme/migrations/0000_messages.sql +8 -0
- package/src/conformance/archive/app.ts +33 -0
- package/src/conformance/archive/contract.ts +191 -0
- package/src/conformance/archive/memo.sync.gen.ts +25 -0
- package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/src/conformance/archive/schema.ts +25 -0
- package/src/conformance/archive/server.ts +146 -0
- package/src/conformance/archive/sync.gen.ts +32 -0
- package/src/conformance/atlas/app.ts +16 -0
- package/src/conformance/atlas/contract.ts +118 -0
- package/src/conformance/crm/app.ts +107 -0
- package/src/conformance/crm/contract.ts +163 -0
- package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/src/conformance/crm/schema.ts +28 -0
- package/src/conformance/crm/sync.gen.ts +27 -0
- package/src/conformance/desk/contract.ts +61 -0
- package/src/conformance/desk/migrations/0000_notes.sql +7 -0
- package/src/conformance/desk/server.ts +131 -0
- package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/src/conformance/drafts/module.ts +211 -0
- package/src/conformance/fixture/app.ts +37 -0
- package/src/conformance/fixture/docs/bad-sync.ts +34 -0
- package/src/conformance/fixture/docs/contract.ts +297 -0
- package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/src/conformance/fixture/docs/policy.cedar +110 -0
- package/src/conformance/fixture/docs/schema.ts +41 -0
- package/src/conformance/fixture/docs/server.ts +292 -0
- package/src/conformance/fixture/docs/sync.gen.ts +54 -0
- package/src/conformance/fixture/docs/sync.ts +24 -0
- package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/src/conformance/fixture/peer/module.ts +51 -0
- package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/module.ts +119 -0
- package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/src/conformance/kit-hash.ts +18 -0
- package/src/conformance/ledger/contract.ts +92 -0
- package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/src/conformance/ledger/server.ts +174 -0
- package/src/conformance/library/app.ts +38 -0
- package/src/conformance/library/contract.ts +66 -0
- package/src/conformance/library/migrations/0000_library.sql +14 -0
- package/src/conformance/library/schema.ts +27 -0
- package/src/conformance/library/server.ts +65 -0
- package/src/conformance/library/sync.gen.ts +47 -0
- package/src/conformance/locale/catalog.ts +111 -0
- package/src/conformance/notebook/app.ts +115 -0
- package/src/conformance/notebook/evals/pages.evals.json +94 -0
- package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/src/conformance/notebook/module.ts +215 -0
- package/src/conformance/notebook/skills/meeting-notes.md +4 -0
- package/src/conformance/pad/app.ts +21 -0
- package/src/conformance/pad/contract.ts +69 -0
- package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/src/conformance/pad/schema.ts +18 -0
- package/src/conformance/pad/server.ts +102 -0
- package/src/conformance/purchases/app.ts +34 -0
- package/src/conformance/purchases/contract.ts +161 -0
- package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/src/conformance/purchases/server.ts +95 -0
- package/src/conformance/replica-search.mjs +22 -0
- package/src/conformance/studio/app.ts +298 -0
- package/src/conformance/studio/contract.ts +319 -0
- package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/src/conformance/workshop/app.ts +14 -0
- package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/src/conformance/workshop/module.ts +79 -0
- package/src/fakes/AcmeFake.ts +182 -0
- package/src/fakes/ApnsFake.ts +245 -0
- package/src/fakes/FcmFake.ts +231 -0
- package/src/fakes/GoogleFake.ts +1346 -0
- package/src/fakes/HttpApiFake.ts +116 -0
- package/src/fakes/McpFake.ts +355 -0
- package/src/fakes/MicrosoftGraphFake.ts +1191 -0
- package/src/fakes/S3Fake.ts +376 -0
- package/src/fakes/Server.ts +445 -0
- package/src/fakes/SignInProviderFake.ts +70 -0
- package/src/fakes/SlackFake.ts +893 -0
- package/src/fakes/Store.ts +96 -0
- package/src/fakes/TelemetryFakes.ts +197 -0
- package/src/fakes/TestCa.ts +166 -0
- package/src/fakes/WorkOsFake.ts +136 -0
- package/src/index.ts +9 -0
- package/src/make/reference.ts +259 -0
- package/src/make/sources.ts +836 -0
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the MachineIdentity contract (docs/contracts/machine-identity.md).
|
|
3
|
+
*
|
|
4
|
+
* Everything here is plain HTTP against a running kernel serving the desk fixture (`./desk/server.ts`), as an
|
|
5
|
+
* outside client or agent would use it, plus a real MCP client (`@modelcontextprotocol/sdk`) that completes
|
|
6
|
+
* dynamic registration, PKCE authorisation and the token exchange on its own. The harness supplies users,
|
|
7
|
+
* membership removal, a way to expire credentials, and probes of the desk and the audit log. Each check
|
|
8
|
+
* throws on failure; the kernel runs them in `packages/testing/test/machine-identity.test.ts`.
|
|
9
|
+
*/
|
|
10
|
+
import { Client as McpClient } from "@modelcontextprotocol/sdk/client/index.js"
|
|
11
|
+
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js"
|
|
12
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
|
|
13
|
+
import assert from "node:assert/strict"
|
|
14
|
+
import { describe, it } from "vitest"
|
|
15
|
+
import {
|
|
16
|
+
authorizeInBrowser,
|
|
17
|
+
browser,
|
|
18
|
+
callAction,
|
|
19
|
+
callMcpTool,
|
|
20
|
+
field,
|
|
21
|
+
McpOAuthProvider,
|
|
22
|
+
oauthClient,
|
|
23
|
+
pkcePair,
|
|
24
|
+
REDIRECT,
|
|
25
|
+
signInThroughPage,
|
|
26
|
+
type TokenSet,
|
|
27
|
+
} from "./OAuthClient.ts"
|
|
28
|
+
|
|
29
|
+
export interface HarnessUser {
|
|
30
|
+
readonly id: string
|
|
31
|
+
readonly email: string
|
|
32
|
+
/** A Better Auth session token (management needs a signed-in person). */
|
|
33
|
+
readonly session: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface MachineIdentityHarness {
|
|
37
|
+
/** The kernel's base URL: the OAuth issuer; MCP at `/mcp`, actions at `/api/actions/<action>`. */
|
|
38
|
+
readonly url: string
|
|
39
|
+
/** Every user's password. */
|
|
40
|
+
readonly password: string
|
|
41
|
+
/**
|
|
42
|
+
* A password user `<name>@example.com` (created if missing), a member of `org` (created if missing) with
|
|
43
|
+
* `roles` (default `member`), signed in. `admin` grants eloxiv.machine.manage; `stamper` grants desk.stamp.
|
|
44
|
+
*/
|
|
45
|
+
readonly member: (name: string, org: string, roles?: ReadonlyArray<string>) => Promise<HarnessUser>
|
|
46
|
+
readonly removeMember: (userId: string, orgId: string) => Promise<void>
|
|
47
|
+
/** Make every outstanding credential of this kind expired (stands in for waiting out its lifetime). */
|
|
48
|
+
readonly expire: (kind: "codes" | "api-tokens") => Promise<void>
|
|
49
|
+
/** Desk notes with this body: who wrote them. */
|
|
50
|
+
readonly notes: (body: string) => Promise<ReadonlyArray<{ readonly ownerId: string; readonly kind: string }>>
|
|
51
|
+
/** Audit records of an action, oldest first. */
|
|
52
|
+
readonly audits: (action: string) => Promise<
|
|
53
|
+
ReadonlyArray<{
|
|
54
|
+
readonly surface: string
|
|
55
|
+
readonly outcome: string
|
|
56
|
+
readonly actor: string | null
|
|
57
|
+
readonly errorTag: string | null
|
|
58
|
+
}>
|
|
59
|
+
>
|
|
60
|
+
/** Client registrations allowed per address and window (the kit registers past it once, last). */
|
|
61
|
+
readonly registrationLimit: number
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
|
|
65
|
+
const DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code"
|
|
66
|
+
|
|
67
|
+
const manage = async (h: MachineIdentityHarness, session: string, operation: string, input: unknown) => {
|
|
68
|
+
const response = await fetch(`${h.url}/kernel/machine-identity/${operation}`, {
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: { authorization: `Bearer ${session}`, "content-type": "application/json" },
|
|
71
|
+
body: JSON.stringify(input),
|
|
72
|
+
})
|
|
73
|
+
return { status: response.status, body: (await response.json()) as Record<string, any> }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const resources = (h: MachineIdentityHarness) => ({ mcp: `${h.url}/mcp`, api: `${h.url}/api` })
|
|
77
|
+
|
|
78
|
+
/** Register a public client and run the authorisation code flow through the pages as `user` in `org`. */
|
|
79
|
+
const authorise = async (
|
|
80
|
+
h: MachineIdentityHarness,
|
|
81
|
+
user: HarnessUser,
|
|
82
|
+
org: string,
|
|
83
|
+
options: { readonly resource?: string; readonly scope?: string } = {},
|
|
84
|
+
) => {
|
|
85
|
+
const oauth = oauthClient(h.url)
|
|
86
|
+
const client = await oauth.registerPublic()
|
|
87
|
+
const { verifier, challenge } = pkcePair()
|
|
88
|
+
const state = unique("state")
|
|
89
|
+
const outcome = await authorizeInBrowser(
|
|
90
|
+
browser(h.url),
|
|
91
|
+
oauth.authorizationUrl({
|
|
92
|
+
response_type: "code",
|
|
93
|
+
client_id: client.client_id,
|
|
94
|
+
redirect_uri: REDIRECT,
|
|
95
|
+
code_challenge: challenge,
|
|
96
|
+
code_challenge_method: "S256",
|
|
97
|
+
resource: options.resource ?? resources(h).api,
|
|
98
|
+
scope: options.scope,
|
|
99
|
+
state,
|
|
100
|
+
}),
|
|
101
|
+
{ email: user.email, password: h.password },
|
|
102
|
+
org,
|
|
103
|
+
)
|
|
104
|
+
assert.ok("redirect" in outcome, `authorisation did not redirect: ${JSON.stringify(outcome)}`)
|
|
105
|
+
assert.equal(outcome.redirect.searchParams.get("state"), state)
|
|
106
|
+
assert.equal(outcome.redirect.searchParams.get("iss"), h.url)
|
|
107
|
+
const code = outcome.redirect.searchParams.get("code")
|
|
108
|
+
assert.ok(code, `no code in ${outcome.redirect.toString()}`)
|
|
109
|
+
return { oauth, client, code, verifier }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const exchange = async (
|
|
113
|
+
h: MachineIdentityHarness,
|
|
114
|
+
user: HarnessUser,
|
|
115
|
+
org: string,
|
|
116
|
+
options?: { resource?: string; scope?: string },
|
|
117
|
+
) => {
|
|
118
|
+
const flow = await authorise(h, user, org, options)
|
|
119
|
+
const answer = await flow.oauth.token({
|
|
120
|
+
grant_type: "authorization_code",
|
|
121
|
+
code: flow.code,
|
|
122
|
+
code_verifier: flow.verifier,
|
|
123
|
+
redirect_uri: REDIRECT,
|
|
124
|
+
client_id: flow.client.client_id,
|
|
125
|
+
})
|
|
126
|
+
assert.ok(answer.ok, `token exchange failed: ${JSON.stringify(answer)}`)
|
|
127
|
+
return { ...flow, tokens: answer.tokens }
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const writes = async (h: MachineIdentityHarness, token: string, body: string, headers?: Record<string, string>) =>
|
|
131
|
+
callAction(h.url, token, "desk.write", { kind: "kit", body }, headers)
|
|
132
|
+
|
|
133
|
+
const refused = (call: { readonly status: number; readonly body: Record<string, any> }, tag: string) => {
|
|
134
|
+
assert.equal(call.body["_tag"], tag, JSON.stringify(call.body))
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Each check's time limit: several run the full OAuth or delivery round trip. */
|
|
138
|
+
const TIMEOUT = 60_000
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Register the kit's tests (Vitest), against the harness `harness` returns once the caller's `beforeAll` has built it.
|
|
142
|
+
*/
|
|
143
|
+
export const machineIdentityConformance = (harness: () => MachineIdentityHarness) =>
|
|
144
|
+
describe("MachineIdentity contract", () => {
|
|
145
|
+
it(
|
|
146
|
+
"publishes authorisation server and protected resource metadata, and challenges unauthenticated MCP requests",
|
|
147
|
+
async () => {
|
|
148
|
+
const h = harness()
|
|
149
|
+
const metadata = (await (await fetch(`${h.url}/.well-known/oauth-authorization-server`)).json()) as Record<
|
|
150
|
+
string,
|
|
151
|
+
any
|
|
152
|
+
>
|
|
153
|
+
assert.equal(metadata["issuer"], h.url)
|
|
154
|
+
assert.deepEqual(metadata["code_challenge_methods_supported"], ["S256"])
|
|
155
|
+
for (const grant of ["authorization_code", "refresh_token", "urn:ietf:params:oauth:grant-type:device_code"]) {
|
|
156
|
+
assert.ok(metadata["grant_types_supported"].includes(grant), grant)
|
|
157
|
+
}
|
|
158
|
+
for (const endpoint of ["registration_endpoint", "revocation_endpoint", "device_authorization_endpoint"]) {
|
|
159
|
+
assert.ok(String(metadata[endpoint]).startsWith(h.url), endpoint)
|
|
160
|
+
}
|
|
161
|
+
const challenge = await callMcpTool(h.url, "", "desk_write", { kind: "x", body: "x" })
|
|
162
|
+
assert.equal(challenge.status, 401)
|
|
163
|
+
const resourceMetadataUrl = /resource_metadata="([^"]+)"/u.exec(challenge.challenge ?? "")?.[1]
|
|
164
|
+
assert.ok(resourceMetadataUrl, `no resource_metadata in ${challenge.challenge}`)
|
|
165
|
+
const prm = (await (await fetch(resourceMetadataUrl)).json()) as Record<string, any>
|
|
166
|
+
assert.equal(prm["resource"], `${h.url}/mcp`)
|
|
167
|
+
assert.deepEqual(prm["authorization_servers"], [h.url])
|
|
168
|
+
},
|
|
169
|
+
TIMEOUT,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
it(
|
|
173
|
+
"a real MCP client registers, authorises with PKCE, exchanges the code, then lists and calls tools",
|
|
174
|
+
async () => {
|
|
175
|
+
const h = harness()
|
|
176
|
+
const agent = await h.member(unique("agent-owner"), "acme")
|
|
177
|
+
const provider = new McpOAuthProvider()
|
|
178
|
+
const first = new McpClient({ name: "conformance-agent", version: "1.0.0" })
|
|
179
|
+
await assert.rejects(
|
|
180
|
+
first.connect(new StreamableHTTPClientTransport(new URL(`${h.url}/mcp`), { authProvider: provider })),
|
|
181
|
+
(error) => error instanceof UnauthorizedError,
|
|
182
|
+
)
|
|
183
|
+
assert.ok(provider.authorization, "the client was not sent to the authorisation endpoint")
|
|
184
|
+
assert.equal(provider.authorization.searchParams.get("code_challenge_method"), "S256")
|
|
185
|
+
assert.equal(provider.authorization.searchParams.get("resource"), `${h.url}/mcp`)
|
|
186
|
+
const outcome = await authorizeInBrowser(
|
|
187
|
+
browser(h.url),
|
|
188
|
+
provider.authorization.toString(),
|
|
189
|
+
{ email: agent.email, password: h.password },
|
|
190
|
+
"acme",
|
|
191
|
+
)
|
|
192
|
+
assert.ok("redirect" in outcome, JSON.stringify(outcome))
|
|
193
|
+
const transport = new StreamableHTTPClientTransport(new URL(`${h.url}/mcp`), { authProvider: provider })
|
|
194
|
+
await transport.finishAuth(outcome.redirect.searchParams.get("code")!)
|
|
195
|
+
const mcp = new McpClient({ name: "conformance-agent", version: "1.0.0" })
|
|
196
|
+
await mcp.connect(new StreamableHTTPClientTransport(new URL(`${h.url}/mcp`), { authProvider: provider }))
|
|
197
|
+
try {
|
|
198
|
+
const tools = await mcp.listTools()
|
|
199
|
+
assert.ok(
|
|
200
|
+
tools.tools.some((tool) => tool.name === "desk_write"),
|
|
201
|
+
JSON.stringify(tools.tools.map((t) => t.name)),
|
|
202
|
+
)
|
|
203
|
+
const body = unique("via-mcp")
|
|
204
|
+
const result = await mcp.callTool({ name: "desk_write", arguments: { kind: "agent", body } })
|
|
205
|
+
assert.notEqual(result.isError, true, JSON.stringify(result))
|
|
206
|
+
assert.equal((result.structuredContent as { kind?: string }).kind, "output")
|
|
207
|
+
assert.deepEqual(await h.notes(body), [{ ownerId: agent.id, kind: "agent" }])
|
|
208
|
+
const audit = (await h.audits("desk.write")).filter((a) => a.actor === agent.id)
|
|
209
|
+
assert.deepEqual(
|
|
210
|
+
audit.map((a) => [a.surface, a.outcome]),
|
|
211
|
+
[["mcp", "succeeded"]],
|
|
212
|
+
)
|
|
213
|
+
} finally {
|
|
214
|
+
await mcp.close()
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
TIMEOUT,
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
it(
|
|
221
|
+
"refuses a wrong PKCE verifier, and the code is spent",
|
|
222
|
+
async () => {
|
|
223
|
+
const h = harness()
|
|
224
|
+
const user = await h.member(unique("pkce"), "acme")
|
|
225
|
+
const flow = await authorise(h, user, "acme")
|
|
226
|
+
const wrong = await flow.oauth.token({
|
|
227
|
+
grant_type: "authorization_code",
|
|
228
|
+
code: flow.code,
|
|
229
|
+
code_verifier: pkcePair().verifier,
|
|
230
|
+
redirect_uri: REDIRECT,
|
|
231
|
+
client_id: flow.client.client_id,
|
|
232
|
+
})
|
|
233
|
+
assert.deepEqual(wrong.ok ? "issued" : wrong.error, "invalid_grant")
|
|
234
|
+
const right = await flow.oauth.token({
|
|
235
|
+
grant_type: "authorization_code",
|
|
236
|
+
code: flow.code,
|
|
237
|
+
code_verifier: flow.verifier,
|
|
238
|
+
redirect_uri: REDIRECT,
|
|
239
|
+
client_id: flow.client.client_id,
|
|
240
|
+
})
|
|
241
|
+
assert.equal(right.ok ? "issued" : right.error, "invalid_grant")
|
|
242
|
+
},
|
|
243
|
+
TIMEOUT,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
it(
|
|
247
|
+
"refuses plain PKCE, a missing challenge and a missing resource",
|
|
248
|
+
async () => {
|
|
249
|
+
const h = harness()
|
|
250
|
+
const oauth = oauthClient(h.url)
|
|
251
|
+
const client = await oauth.registerPublic()
|
|
252
|
+
const base = {
|
|
253
|
+
response_type: "code",
|
|
254
|
+
client_id: client.client_id,
|
|
255
|
+
redirect_uri: REDIRECT,
|
|
256
|
+
resource: `${h.url}/api`,
|
|
257
|
+
}
|
|
258
|
+
for (const [params, error] of [
|
|
259
|
+
[{ ...base, code_challenge: pkcePair().challenge, code_challenge_method: "plain" }, "invalid_request"],
|
|
260
|
+
[{ ...base }, "invalid_request"],
|
|
261
|
+
[
|
|
262
|
+
{ ...base, resource: undefined, code_challenge: pkcePair().challenge, code_challenge_method: "S256" },
|
|
263
|
+
"invalid_target",
|
|
264
|
+
],
|
|
265
|
+
] as const) {
|
|
266
|
+
const response = await fetch(oauth.authorizationUrl(params), { redirect: "manual" })
|
|
267
|
+
assert.equal(response.status, 303)
|
|
268
|
+
assert.equal(new URL(response.headers.get("location")!).searchParams.get("error"), error)
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
TIMEOUT,
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
it(
|
|
275
|
+
"refuses an unregistered redirect URI without redirecting, and a mismatched one at the token endpoint",
|
|
276
|
+
async () => {
|
|
277
|
+
const h = harness()
|
|
278
|
+
const oauth = oauthClient(h.url)
|
|
279
|
+
const client = await oauth.registerPublic()
|
|
280
|
+
const { challenge } = pkcePair()
|
|
281
|
+
const response = await fetch(
|
|
282
|
+
oauth.authorizationUrl({
|
|
283
|
+
response_type: "code",
|
|
284
|
+
client_id: client.client_id,
|
|
285
|
+
redirect_uri: "https://attacker.example/callback",
|
|
286
|
+
code_challenge: challenge,
|
|
287
|
+
code_challenge_method: "S256",
|
|
288
|
+
resource: `${h.url}/api`,
|
|
289
|
+
}),
|
|
290
|
+
{ redirect: "manual" },
|
|
291
|
+
)
|
|
292
|
+
assert.equal(response.status, 400)
|
|
293
|
+
assert.equal(response.headers.get("location"), null)
|
|
294
|
+
|
|
295
|
+
const user = await h.member(unique("redirect"), "acme")
|
|
296
|
+
const flow = await authorise(h, user, "acme")
|
|
297
|
+
const answer = await flow.oauth.token({
|
|
298
|
+
grant_type: "authorization_code",
|
|
299
|
+
code: flow.code,
|
|
300
|
+
code_verifier: flow.verifier,
|
|
301
|
+
redirect_uri: "http://127.0.0.1:7/other",
|
|
302
|
+
client_id: flow.client.client_id,
|
|
303
|
+
})
|
|
304
|
+
assert.equal(answer.ok ? "issued" : answer.error, "invalid_grant")
|
|
305
|
+
},
|
|
306
|
+
TIMEOUT,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
it(
|
|
310
|
+
"exchanges a PKCE code without redirect_uri at the token endpoint (OAuth 2.1)",
|
|
311
|
+
async () => {
|
|
312
|
+
const h = harness()
|
|
313
|
+
const user = await h.member(unique("oauth21"), "acme")
|
|
314
|
+
const flow = await authorise(h, user, "acme")
|
|
315
|
+
const answer = await flow.oauth.token({
|
|
316
|
+
grant_type: "authorization_code",
|
|
317
|
+
code: flow.code,
|
|
318
|
+
code_verifier: flow.verifier,
|
|
319
|
+
client_id: flow.client.client_id,
|
|
320
|
+
})
|
|
321
|
+
assert.ok(answer.ok, JSON.stringify(answer))
|
|
322
|
+
assert.equal((await writes(h, answer.tokens.access_token, unique("oauth21"))).status, 200)
|
|
323
|
+
},
|
|
324
|
+
TIMEOUT,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
it(
|
|
328
|
+
"refuses a repeated parameter with invalid_request at every endpoint (RFC 6749 section 3.1)",
|
|
329
|
+
async () => {
|
|
330
|
+
const h = harness()
|
|
331
|
+
const oauth = oauthClient(h.url)
|
|
332
|
+
const client = await oauth.registerPublic(["authorization_code", "refresh_token", DEVICE_GRANT])
|
|
333
|
+
const { challenge } = pkcePair()
|
|
334
|
+
const authorization = oauth.authorizationUrl({
|
|
335
|
+
response_type: "code",
|
|
336
|
+
client_id: client.client_id,
|
|
337
|
+
redirect_uri: REDIRECT,
|
|
338
|
+
code_challenge: challenge,
|
|
339
|
+
code_challenge_method: "S256",
|
|
340
|
+
resource: `${h.url}/api`,
|
|
341
|
+
state: "s1",
|
|
342
|
+
})
|
|
343
|
+
// A repeated client or redirect URI: which client is asking is unknown, so nothing is redirected.
|
|
344
|
+
for (const extra of [`&client_id=${encodeURIComponent(client.client_id)}`, "&client_id=another-client"]) {
|
|
345
|
+
const response = await fetch(`${authorization}${extra}`, { redirect: "manual" })
|
|
346
|
+
assert.equal(response.status, 400, extra)
|
|
347
|
+
assert.equal(response.headers.get("location"), null, extra)
|
|
348
|
+
}
|
|
349
|
+
const twice = await fetch(`${authorization}&redirect_uri=${encodeURIComponent(REDIRECT)}`, {
|
|
350
|
+
redirect: "manual",
|
|
351
|
+
})
|
|
352
|
+
assert.equal(twice.status, 400)
|
|
353
|
+
assert.equal(twice.headers.get("location"), null)
|
|
354
|
+
// Any other repeated parameter is an invalid request, redirected to the client.
|
|
355
|
+
for (const extra of ["&state=s2", "&scope=actions&scope=actions", "&code_challenge_method=S256"]) {
|
|
356
|
+
const response = await fetch(`${authorization}${extra}`, { redirect: "manual" })
|
|
357
|
+
assert.equal(response.status, 303, extra)
|
|
358
|
+
const location = new URL(response.headers.get("location")!)
|
|
359
|
+
assert.equal(`${location.origin}${location.pathname}`, REDIRECT, extra)
|
|
360
|
+
assert.equal(location.searchParams.get("error"), "invalid_request", extra)
|
|
361
|
+
}
|
|
362
|
+
// Form bodies: the token, device authorisation and revocation endpoints.
|
|
363
|
+
const repeated = async (path: string, body: string) => {
|
|
364
|
+
const response = await fetch(`${h.url}${path}`, {
|
|
365
|
+
method: "POST",
|
|
366
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
367
|
+
body,
|
|
368
|
+
})
|
|
369
|
+
return { status: response.status, error: ((await response.json()) as { error?: string }).error }
|
|
370
|
+
}
|
|
371
|
+
const id = encodeURIComponent(client.client_id)
|
|
372
|
+
for (const [path, body] of [
|
|
373
|
+
["/oauth/token", `grant_type=refresh_token&refresh_token=elxr_a&refresh_token=elxr_b&client_id=${id}`],
|
|
374
|
+
[
|
|
375
|
+
"/oauth/token",
|
|
376
|
+
`grant_type=refresh_token&grant_type=authorization_code&refresh_token=elxr_a&client_id=${id}`,
|
|
377
|
+
],
|
|
378
|
+
["/oauth/revoke", `token=elxa_a&token=elxa_b&client_id=${id}`],
|
|
379
|
+
] as const) {
|
|
380
|
+
assert.deepEqual(await repeated(path, body), { status: 400, error: "invalid_request" }, `${path} ${body}`)
|
|
381
|
+
}
|
|
382
|
+
// A repeated resource asks for several resources at once (RFC 8707): a grant is bound to one, so it is
|
|
383
|
+
// refused as invalid_target, at the authorisation, device and token endpoints alike.
|
|
384
|
+
const both = `resource=${encodeURIComponent(`${h.url}/api`)}&resource=${encodeURIComponent(`${h.url}/mcp`)}`
|
|
385
|
+
const twoResources = await fetch(`${authorization.replace(/&resource=[^&]*/u, "")}&${both}`, {
|
|
386
|
+
redirect: "manual",
|
|
387
|
+
})
|
|
388
|
+
assert.equal(twoResources.status, 303)
|
|
389
|
+
assert.equal(new URL(twoResources.headers.get("location")!).searchParams.get("error"), "invalid_target")
|
|
390
|
+
for (const [path, body] of [
|
|
391
|
+
["/oauth/device_authorization", `client_id=${id}&${both}`],
|
|
392
|
+
["/oauth/token", `grant_type=refresh_token&refresh_token=elxr_a&client_id=${id}&${both}`],
|
|
393
|
+
] as const) {
|
|
394
|
+
assert.deepEqual(await repeated(path, body), { status: 400, error: "invalid_target" }, `${path} ${body}`)
|
|
395
|
+
}
|
|
396
|
+
// JSON bodies too: a member named twice is refused, not silently resolved to one of them.
|
|
397
|
+
const json = await fetch(`${h.url}/oauth/token`, {
|
|
398
|
+
method: "POST",
|
|
399
|
+
headers: { "content-type": "application/json" },
|
|
400
|
+
body: `{"grant_type":"refresh_token","refresh_token":"elxr_a","refresh_token":"elxr_b","client_id":"${client.client_id}"}`,
|
|
401
|
+
})
|
|
402
|
+
assert.equal(json.status, 400)
|
|
403
|
+
assert.equal(((await json.json()) as { error?: string }).error, "invalid_request")
|
|
404
|
+
const registration = await fetch(`${h.url}/oauth/register`, {
|
|
405
|
+
method: "POST",
|
|
406
|
+
headers: { "content-type": "application/json" },
|
|
407
|
+
body: `{"redirect_uris":["${REDIRECT}"],"token_endpoint_auth_method":"none","token_endpoint_auth_method":"client_secret_basic"}`,
|
|
408
|
+
})
|
|
409
|
+
assert.equal(registration.status, 400)
|
|
410
|
+
assert.equal(((await registration.json()) as { error?: string }).error, "invalid_client_metadata")
|
|
411
|
+
},
|
|
412
|
+
TIMEOUT,
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
it(
|
|
416
|
+
"answers malformed client credentials as invalid_client, never as a server error",
|
|
417
|
+
async () => {
|
|
418
|
+
const h = harness()
|
|
419
|
+
for (const credentials of ["%zz:secret", "client:%E0%A4%A", "no-colon"]) {
|
|
420
|
+
const response = await fetch(`${h.url}/oauth/token`, {
|
|
421
|
+
method: "POST",
|
|
422
|
+
headers: {
|
|
423
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
424
|
+
authorization: `Basic ${Buffer.from(credentials).toString("base64")}`,
|
|
425
|
+
},
|
|
426
|
+
body: "grant_type=refresh_token&refresh_token=elxr_a",
|
|
427
|
+
})
|
|
428
|
+
assert.equal(response.status, 401, credentials)
|
|
429
|
+
assert.equal(((await response.json()) as { error?: string }).error, "invalid_client", credentials)
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
TIMEOUT,
|
|
433
|
+
)
|
|
434
|
+
|
|
435
|
+
it(
|
|
436
|
+
"refuses an expired code",
|
|
437
|
+
async () => {
|
|
438
|
+
const h = harness()
|
|
439
|
+
const user = await h.member(unique("expired"), "acme")
|
|
440
|
+
const flow = await authorise(h, user, "acme")
|
|
441
|
+
await h.expire("codes")
|
|
442
|
+
const answer = await flow.oauth.token({
|
|
443
|
+
grant_type: "authorization_code",
|
|
444
|
+
code: flow.code,
|
|
445
|
+
code_verifier: flow.verifier,
|
|
446
|
+
redirect_uri: REDIRECT,
|
|
447
|
+
client_id: flow.client.client_id,
|
|
448
|
+
})
|
|
449
|
+
assert.equal(answer.ok ? "issued" : answer.error, "invalid_grant")
|
|
450
|
+
},
|
|
451
|
+
TIMEOUT,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
it(
|
|
455
|
+
"refuses a reused code and revokes what its first exchange issued",
|
|
456
|
+
async () => {
|
|
457
|
+
const h = harness()
|
|
458
|
+
const user = await h.member(unique("reuse"), "acme")
|
|
459
|
+
const flow = await exchange(h, user, "acme")
|
|
460
|
+
assert.equal((await writes(h, flow.tokens.access_token, unique("before-reuse"))).status, 200)
|
|
461
|
+
const again = await flow.oauth.token({
|
|
462
|
+
grant_type: "authorization_code",
|
|
463
|
+
code: flow.code,
|
|
464
|
+
code_verifier: flow.verifier,
|
|
465
|
+
redirect_uri: REDIRECT,
|
|
466
|
+
client_id: flow.client.client_id,
|
|
467
|
+
})
|
|
468
|
+
assert.equal(again.ok ? "issued" : again.error, "invalid_grant")
|
|
469
|
+
refused(await writes(h, flow.tokens.access_token, unique("after-reuse")), "Unauthenticated")
|
|
470
|
+
const refreshed = await flow.oauth.token({
|
|
471
|
+
grant_type: "refresh_token",
|
|
472
|
+
refresh_token: flow.tokens.refresh_token,
|
|
473
|
+
client_id: flow.client.client_id,
|
|
474
|
+
})
|
|
475
|
+
assert.equal(refreshed.ok ? "issued" : refreshed.error, "invalid_grant")
|
|
476
|
+
},
|
|
477
|
+
TIMEOUT,
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
it(
|
|
481
|
+
"rotates refresh tokens, and a reused refresh token revokes the whole grant",
|
|
482
|
+
async () => {
|
|
483
|
+
const h = harness()
|
|
484
|
+
const user = await h.member(unique("rotate"), "acme")
|
|
485
|
+
const flow = await exchange(h, user, "acme")
|
|
486
|
+
const rotated = await flow.oauth.token({
|
|
487
|
+
grant_type: "refresh_token",
|
|
488
|
+
refresh_token: flow.tokens.refresh_token,
|
|
489
|
+
client_id: flow.client.client_id,
|
|
490
|
+
})
|
|
491
|
+
assert.ok(rotated.ok, JSON.stringify(rotated))
|
|
492
|
+
const next: TokenSet = rotated.tokens
|
|
493
|
+
assert.notEqual(next.refresh_token, flow.tokens.refresh_token)
|
|
494
|
+
assert.equal((await writes(h, next.access_token, unique("rotated"))).status, 200)
|
|
495
|
+
// The first refresh token again: reuse. Every token of the grant stops working, including the newest.
|
|
496
|
+
const reused = await flow.oauth.token({
|
|
497
|
+
grant_type: "refresh_token",
|
|
498
|
+
refresh_token: flow.tokens.refresh_token,
|
|
499
|
+
client_id: flow.client.client_id,
|
|
500
|
+
})
|
|
501
|
+
assert.equal(reused.ok ? "issued" : reused.error, "invalid_grant")
|
|
502
|
+
refused(await writes(h, next.access_token, unique("after-family")), "Unauthenticated")
|
|
503
|
+
refused(await writes(h, flow.tokens.access_token, unique("after-family")), "Unauthenticated")
|
|
504
|
+
const newest = await flow.oauth.token({
|
|
505
|
+
grant_type: "refresh_token",
|
|
506
|
+
refresh_token: next.refresh_token,
|
|
507
|
+
client_id: flow.client.client_id,
|
|
508
|
+
})
|
|
509
|
+
assert.equal(newest.ok ? "issued" : newest.error, "invalid_grant")
|
|
510
|
+
},
|
|
511
|
+
TIMEOUT,
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
it(
|
|
515
|
+
"refuses a revoked access token on the next call, and revoking a refresh token ends the grant",
|
|
516
|
+
async () => {
|
|
517
|
+
const h = harness()
|
|
518
|
+
const user = await h.member(unique("revoke"), "acme")
|
|
519
|
+
const flow = await exchange(h, user, "acme")
|
|
520
|
+
assert.equal((await writes(h, flow.tokens.access_token, unique("pre-revoke"))).status, 200)
|
|
521
|
+
const revoked = await flow.oauth.revoke({ token: flow.tokens.access_token, client_id: flow.client.client_id })
|
|
522
|
+
assert.equal(revoked.status, 200)
|
|
523
|
+
refused(await writes(h, flow.tokens.access_token, unique("post-revoke")), "Unauthenticated")
|
|
524
|
+
// The refresh token still works until it is revoked itself; then the grant is over.
|
|
525
|
+
const fresh = await flow.oauth.token({
|
|
526
|
+
grant_type: "refresh_token",
|
|
527
|
+
refresh_token: flow.tokens.refresh_token,
|
|
528
|
+
client_id: flow.client.client_id,
|
|
529
|
+
})
|
|
530
|
+
assert.ok(fresh.ok)
|
|
531
|
+
assert.equal(
|
|
532
|
+
(await flow.oauth.revoke({ token: fresh.tokens.refresh_token, client_id: flow.client.client_id })).status,
|
|
533
|
+
200,
|
|
534
|
+
)
|
|
535
|
+
refused(await writes(h, fresh.tokens.access_token, unique("post-grant")), "Unauthenticated")
|
|
536
|
+
// Another client cannot revoke someone else's token (answered 200, nothing happens).
|
|
537
|
+
const other = await h.member(unique("revoke-other"), "acme")
|
|
538
|
+
const theirs = await exchange(h, other, "acme")
|
|
539
|
+
const stranger = await oauthClient(h.url).registerPublic()
|
|
540
|
+
assert.equal(
|
|
541
|
+
(await flow.oauth.revoke({ token: theirs.tokens.access_token, client_id: stranger.client_id })).status,
|
|
542
|
+
200,
|
|
543
|
+
)
|
|
544
|
+
assert.equal((await writes(h, theirs.tokens.access_token, unique("still-theirs"))).status, 200)
|
|
545
|
+
},
|
|
546
|
+
TIMEOUT,
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
it(
|
|
550
|
+
"refuses a token's next call once its user is no longer a member, for OAuth and API tokens alike",
|
|
551
|
+
async () => {
|
|
552
|
+
const h = harness()
|
|
553
|
+
const user = await h.member(unique("leaver"), "acme")
|
|
554
|
+
const flow = await exchange(h, user, "acme")
|
|
555
|
+
const api = await manage(h, user.session, "createToken", { name: "leaver token" })
|
|
556
|
+
assert.equal(api.status, 200, JSON.stringify(api.body))
|
|
557
|
+
assert.equal((await writes(h, flow.tokens.access_token, unique("member"))).status, 200)
|
|
558
|
+
assert.equal((await writes(h, api.body["token"], unique("member"))).status, 200)
|
|
559
|
+
await h.removeMember(user.id, "acme")
|
|
560
|
+
refused(await writes(h, flow.tokens.access_token, unique("gone")), "Forbidden")
|
|
561
|
+
refused(await writes(h, api.body["token"], unique("gone")), "Forbidden")
|
|
562
|
+
const refreshed = await flow.oauth.token({
|
|
563
|
+
grant_type: "refresh_token",
|
|
564
|
+
refresh_token: flow.tokens.refresh_token,
|
|
565
|
+
client_id: flow.client.client_id,
|
|
566
|
+
})
|
|
567
|
+
assert.equal(refreshed.ok ? "issued" : refreshed.error, "invalid_grant")
|
|
568
|
+
},
|
|
569
|
+
TIMEOUT,
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
it(
|
|
573
|
+
"a token scoped to one action cannot call another (API token and OAuth scope)",
|
|
574
|
+
async () => {
|
|
575
|
+
const h = harness()
|
|
576
|
+
const user = await h.member(unique("scoped"), "acme", ["member", "stamper"])
|
|
577
|
+
const api = await manage(h, user.session, "createToken", { name: "write only", actions: ["desk.write"] })
|
|
578
|
+
assert.equal(api.status, 200, JSON.stringify(api.body))
|
|
579
|
+
assert.equal((await writes(h, api.body["token"], unique("scoped-write"))).status, 200)
|
|
580
|
+
const stamped = await callAction(h.url, api.body["token"], "desk.stamp", {
|
|
581
|
+
kind: "kit",
|
|
582
|
+
body: unique("scoped-stamp"),
|
|
583
|
+
})
|
|
584
|
+
refused(stamped, "Forbidden")
|
|
585
|
+
// The same user, unscoped, may stamp: the scope narrowed it, the policy did not.
|
|
586
|
+
assert.equal(
|
|
587
|
+
(await callAction(h.url, user.session, "desk.stamp", { kind: "kit", body: unique("session-stamp") })).status,
|
|
588
|
+
200,
|
|
589
|
+
)
|
|
590
|
+
// A permission scope: desk.stamp's actions only.
|
|
591
|
+
const byPermission = await manage(h, user.session, "createToken", {
|
|
592
|
+
name: "stamp only",
|
|
593
|
+
permissions: ["desk.stamp"],
|
|
594
|
+
})
|
|
595
|
+
assert.equal(
|
|
596
|
+
(await callAction(h.url, byPermission.body["token"], "desk.stamp", { kind: "kit", body: unique("perm") }))
|
|
597
|
+
.status,
|
|
598
|
+
200,
|
|
599
|
+
)
|
|
600
|
+
refused(await writes(h, byPermission.body["token"], unique("perm-write")), "Forbidden")
|
|
601
|
+
const oauth = await exchange(h, user, "acme", { scope: "action:desk.write" })
|
|
602
|
+
assert.equal(oauth.tokens.scope, "action:desk.write")
|
|
603
|
+
assert.equal((await writes(h, oauth.tokens.access_token, unique("oauth-scoped"))).status, 200)
|
|
604
|
+
refused(
|
|
605
|
+
await callAction(h.url, oauth.tokens.access_token, "desk.stamp", {
|
|
606
|
+
kind: "kit",
|
|
607
|
+
body: unique("oauth-stamp"),
|
|
608
|
+
}),
|
|
609
|
+
"Forbidden",
|
|
610
|
+
)
|
|
611
|
+
},
|
|
612
|
+
TIMEOUT,
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
it(
|
|
616
|
+
"binds access tokens to their resource (RFC 8707) and to the organisation picked at consent",
|
|
617
|
+
async () => {
|
|
618
|
+
const h = harness()
|
|
619
|
+
const user = await h.member(unique("audience"), "acme")
|
|
620
|
+
await h.member(user.email.split("@")[0]!, "globex")
|
|
621
|
+
const forApi = await exchange(h, user, "acme", { resource: `${h.url}/api` })
|
|
622
|
+
assert.equal(
|
|
623
|
+
(await callMcpTool(h.url, forApi.tokens.access_token, "desk_write", { kind: "x", body: "x" })).status,
|
|
624
|
+
401,
|
|
625
|
+
)
|
|
626
|
+
const forMcp = await exchange(h, user, "acme", { resource: `${h.url}/mcp` })
|
|
627
|
+
refused(await writes(h, forMcp.tokens.access_token, unique("mcp-token-on-api")), "Unauthenticated")
|
|
628
|
+
refused(
|
|
629
|
+
await writes(h, forApi.tokens.access_token, unique("other-org"), { "x-eloxiv-org": "globex" }),
|
|
630
|
+
"Forbidden",
|
|
631
|
+
)
|
|
632
|
+
const body = unique("acme-only")
|
|
633
|
+
assert.equal((await writes(h, forApi.tokens.access_token, body)).status, 200)
|
|
634
|
+
assert.deepEqual(await h.notes(body), [{ ownerId: user.id, kind: "kit" }])
|
|
635
|
+
},
|
|
636
|
+
TIMEOUT,
|
|
637
|
+
)
|
|
638
|
+
|
|
639
|
+
it(
|
|
640
|
+
"the device flow: pending, slow down, approval through the page, tokens; a denial ends it",
|
|
641
|
+
async () => {
|
|
642
|
+
const h = harness()
|
|
643
|
+
const user = await h.member(unique("device"), "acme")
|
|
644
|
+
const oauth = oauthClient(h.url)
|
|
645
|
+
const client = await oauth.registerPublic(["urn:ietf:params:oauth:grant-type:device_code", "refresh_token"])
|
|
646
|
+
const started = await oauth.deviceAuthorization({ client_id: client.client_id, resource: `${h.url}/api` })
|
|
647
|
+
assert.equal(started.status, 200, JSON.stringify(started.body))
|
|
648
|
+
const poll = () =>
|
|
649
|
+
oauth.token({
|
|
650
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
651
|
+
device_code: started.body["device_code"],
|
|
652
|
+
client_id: client.client_id,
|
|
653
|
+
})
|
|
654
|
+
const pending = await poll()
|
|
655
|
+
assert.equal(pending.ok ? "issued" : pending.error, "authorization_pending")
|
|
656
|
+
const tooFast = await poll()
|
|
657
|
+
assert.equal(tooFast.ok ? "issued" : tooFast.error, "slow_down")
|
|
658
|
+
const b = browser(h.url)
|
|
659
|
+
let response = await b.request(started.body["verification_uri_complete"])
|
|
660
|
+
let page = await response.text()
|
|
661
|
+
const back = await signInThroughPage(b, page, user.email, h.password)
|
|
662
|
+
response = await b.request(back)
|
|
663
|
+
page = await response.text()
|
|
664
|
+
assert.ok(page.includes(started.body["user_code"]), page)
|
|
665
|
+
const answer = await b.post("/oauth/device", {
|
|
666
|
+
user_code: field(page, "user_code")!,
|
|
667
|
+
csrf: field(page, "csrf")!,
|
|
668
|
+
org: "acme",
|
|
669
|
+
decision: "approve",
|
|
670
|
+
})
|
|
671
|
+
assert.equal(answer.status, 200, await answer.text())
|
|
672
|
+
await new Promise((resolve) => setTimeout(resolve, (started.body["interval"] + 5) * 1000 + 100))
|
|
673
|
+
const issued = await poll()
|
|
674
|
+
assert.ok(issued.ok, JSON.stringify(issued))
|
|
675
|
+
assert.equal((await writes(h, issued.tokens.access_token, unique("device"))).status, 200)
|
|
676
|
+
const twice = await poll()
|
|
677
|
+
assert.equal(twice.ok ? "issued" : twice.error, "invalid_grant")
|
|
678
|
+
|
|
679
|
+
const denied = await oauth.deviceAuthorization({ client_id: client.client_id, resource: `${h.url}/api` })
|
|
680
|
+
const c = browser(h.url)
|
|
681
|
+
const first = await c.request(denied.body["verification_uri_complete"])
|
|
682
|
+
const signed = await signInThroughPage(c, await first.text(), user.email, h.password)
|
|
683
|
+
const confirm = await (await c.request(signed)).text()
|
|
684
|
+
await c.post("/oauth/device", {
|
|
685
|
+
user_code: field(confirm, "user_code")!,
|
|
686
|
+
csrf: field(confirm, "csrf")!,
|
|
687
|
+
org: "acme",
|
|
688
|
+
decision: "deny",
|
|
689
|
+
})
|
|
690
|
+
const refusedDevice = await oauth.token({
|
|
691
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
692
|
+
device_code: denied.body["device_code"],
|
|
693
|
+
client_id: client.client_id,
|
|
694
|
+
})
|
|
695
|
+
assert.equal(refusedDevice.ok ? "issued" : refusedDevice.error, "access_denied")
|
|
696
|
+
},
|
|
697
|
+
TIMEOUT,
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
it(
|
|
701
|
+
"service principals: created, disabled and deleted by organisation admins only, audited, acting through the invocation path",
|
|
702
|
+
async () => {
|
|
703
|
+
const h = harness()
|
|
704
|
+
const admin = await h.member(unique("admin"), "acme", ["admin", "stamper"])
|
|
705
|
+
const member = await h.member(unique("plain"), "acme")
|
|
706
|
+
const denied = await manage(h, member.session, "createServicePrincipal", { name: unique("nope") })
|
|
707
|
+
assert.equal(denied.body["_tag"], "Forbidden")
|
|
708
|
+
// Escalation: a principal may not get permissions its creator lacks.
|
|
709
|
+
const manager = await h.member(unique("manager"), "acme", ["machine-manager"])
|
|
710
|
+
const escalate = await manage(h, manager.session, "createServicePrincipal", {
|
|
711
|
+
name: unique("esc"),
|
|
712
|
+
roles: ["admin"],
|
|
713
|
+
})
|
|
714
|
+
assert.equal(escalate.body["_tag"], "Forbidden", JSON.stringify(escalate.body))
|
|
715
|
+
|
|
716
|
+
const name = unique("bot")
|
|
717
|
+
const created = await manage(h, admin.session, "createServicePrincipal", { name, roles: ["member", "stamper"] })
|
|
718
|
+
assert.equal(created.status, 200, JSON.stringify(created.body))
|
|
719
|
+
const principalId: string = created.body["id"]
|
|
720
|
+
const token = await manage(h, admin.session, "createToken", { name: "bot token", principalId })
|
|
721
|
+
assert.equal(token.status, 200, JSON.stringify(token.body))
|
|
722
|
+
const body = unique("by-bot")
|
|
723
|
+
assert.equal((await callAction(h.url, token.body["token"], "desk.stamp", { kind: "bot", body })).status, 200)
|
|
724
|
+
assert.deepEqual(await h.notes(body), [{ ownerId: principalId, kind: "bot" }])
|
|
725
|
+
assert.ok((await h.audits("desk.stamp")).some((a) => a.actor === principalId && a.outcome === "succeeded"))
|
|
726
|
+
|
|
727
|
+
// Management needs a person: the principal's own token cannot mint tokens.
|
|
728
|
+
const selfMint = await manage(h, token.body["token"], "createToken", { name: "minted" })
|
|
729
|
+
assert.equal(selfMint.status, 401)
|
|
730
|
+
|
|
731
|
+
assert.equal((await manage(h, admin.session, "disableServicePrincipal", { id: principalId })).status, 200)
|
|
732
|
+
refused(
|
|
733
|
+
await callAction(h.url, token.body["token"], "desk.write", { kind: "bot", body: unique("disabled") }),
|
|
734
|
+
"Forbidden",
|
|
735
|
+
)
|
|
736
|
+
assert.equal((await manage(h, admin.session, "enableServicePrincipal", { id: principalId })).status, 200)
|
|
737
|
+
assert.equal(
|
|
738
|
+
(await callAction(h.url, token.body["token"], "desk.write", { kind: "bot", body: unique("enabled") })).status,
|
|
739
|
+
200,
|
|
740
|
+
)
|
|
741
|
+
assert.equal(
|
|
742
|
+
(await manage(h, member.session, "deleteServicePrincipal", { id: principalId })).body["_tag"],
|
|
743
|
+
"Forbidden",
|
|
744
|
+
)
|
|
745
|
+
assert.equal((await manage(h, admin.session, "deleteServicePrincipal", { id: principalId })).status, 200)
|
|
746
|
+
refused(
|
|
747
|
+
await callAction(h.url, token.body["token"], "desk.write", { kind: "bot", body: unique("deleted") }),
|
|
748
|
+
"Unauthenticated",
|
|
749
|
+
)
|
|
750
|
+
const listed = await manage(h, admin.session, "listServicePrincipals", {})
|
|
751
|
+
assert.ok(!(listed.body as unknown as Array<{ id: string }>).some((p) => p.id === principalId))
|
|
752
|
+
|
|
753
|
+
const audit = await h.audits("eloxiv.machine.createServicePrincipal")
|
|
754
|
+
assert.ok(audit.some((a) => a.actor === admin.id && a.outcome === "succeeded"))
|
|
755
|
+
assert.ok(audit.some((a) => a.actor === member.id && a.outcome === "denied" && a.errorTag === "Forbidden"))
|
|
756
|
+
for (const op of ["disableServicePrincipal", "enableServicePrincipal", "deleteServicePrincipal"]) {
|
|
757
|
+
assert.ok(
|
|
758
|
+
(await h.audits(`eloxiv.machine.${op}`)).some((a) => a.actor === admin.id && a.outcome === "succeeded"),
|
|
759
|
+
op,
|
|
760
|
+
)
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
TIMEOUT,
|
|
764
|
+
)
|
|
765
|
+
|
|
766
|
+
it(
|
|
767
|
+
"API tokens: shown once, listed by prefix only, last use tracked, revocable and expiring",
|
|
768
|
+
async () => {
|
|
769
|
+
const h = harness()
|
|
770
|
+
const user = await h.member(unique("tokens"), "acme")
|
|
771
|
+
const created = await manage(h, user.session, "createToken", { name: "laptop", expiresInSeconds: 3600 })
|
|
772
|
+
const token: string = created.body["token"]
|
|
773
|
+
assert.match(token, /^elxk_[A-Za-z0-9_-]{43}$/u)
|
|
774
|
+
const before = (await manage(h, user.session, "listTokens", {})).body as unknown as Array<Record<string, any>>
|
|
775
|
+
const entry = before.find((t) => t["id"] === created.body["id"])!
|
|
776
|
+
assert.equal(entry["lastUsedAt"], null)
|
|
777
|
+
assert.ok(token.startsWith(entry["prefix"]) && entry["prefix"].length < 16)
|
|
778
|
+
assert.ok(!JSON.stringify(before).includes(token))
|
|
779
|
+
assert.equal((await writes(h, token, unique("used"))).status, 200)
|
|
780
|
+
const after = (await manage(h, user.session, "listTokens", {})).body as unknown as Array<Record<string, any>>
|
|
781
|
+
assert.notEqual(after.find((t) => t["id"] === created.body["id"])!["lastUsedAt"], null)
|
|
782
|
+
|
|
783
|
+
// Another member cannot revoke it; its owner can, and the next call is refused.
|
|
784
|
+
const other = await h.member(unique("other"), "acme")
|
|
785
|
+
assert.equal(
|
|
786
|
+
(await manage(h, other.session, "revokeToken", { id: created.body["id"] })).body["_tag"],
|
|
787
|
+
"Forbidden",
|
|
788
|
+
)
|
|
789
|
+
assert.equal((await manage(h, user.session, "revokeToken", { id: created.body["id"] })).status, 200)
|
|
790
|
+
refused(await writes(h, token, unique("revoked")), "Unauthenticated")
|
|
791
|
+
|
|
792
|
+
const expiring = await manage(h, user.session, "createToken", { name: "short" })
|
|
793
|
+
assert.equal((await writes(h, expiring.body["token"], unique("fresh"))).status, 200)
|
|
794
|
+
await h.expire("api-tokens")
|
|
795
|
+
refused(await writes(h, expiring.body["token"], unique("expired")), "Unauthenticated")
|
|
796
|
+
// An API token acts only in its own organisation.
|
|
797
|
+
const scopedOrg = await manage(h, user.session, "createToken", { name: "acme" })
|
|
798
|
+
refused(await writes(h, scopedOrg.body["token"], unique("x-org"), { "x-eloxiv-org": "elsewhere" }), "Forbidden")
|
|
799
|
+
},
|
|
800
|
+
TIMEOUT,
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
it(
|
|
804
|
+
"limits dynamic client registration and refuses unsafe redirect URIs",
|
|
805
|
+
async () => {
|
|
806
|
+
const h = harness()
|
|
807
|
+
const oauth = oauthClient(h.url)
|
|
808
|
+
for (const uri of ["http://example.com/cb", "javascript:alert(1)", "https://ok.example/cb#frag", "notauri"]) {
|
|
809
|
+
const { status, body } = await oauth.register({ redirect_uris: [uri], token_endpoint_auth_method: "none" })
|
|
810
|
+
assert.equal(status, 400, uri)
|
|
811
|
+
assert.equal(body.error, "invalid_redirect_uri", uri)
|
|
812
|
+
}
|
|
813
|
+
const confidential = await oauth.register({ redirect_uris: ["https://ok.example/cb"] })
|
|
814
|
+
assert.equal(confidential.status, 201)
|
|
815
|
+
assert.ok(confidential.body.client_secret)
|
|
816
|
+
let limited = false
|
|
817
|
+
for (let i = 0; i <= h.registrationLimit && !limited; i++) {
|
|
818
|
+
const { status } = await oauth.register({
|
|
819
|
+
redirect_uris: ["https://ok.example/cb"],
|
|
820
|
+
token_endpoint_auth_method: "none",
|
|
821
|
+
})
|
|
822
|
+
limited = status === 429
|
|
823
|
+
}
|
|
824
|
+
assert.ok(limited, "registration was never limited")
|
|
825
|
+
},
|
|
826
|
+
TIMEOUT,
|
|
827
|
+
)
|
|
828
|
+
})
|