@eloxiv/testing 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Admin.d.ts +20 -0
- package/dist/Admin.d.ts.map +1 -0
- package/dist/Admin.js +61 -0
- package/dist/Admin.js.map +1 -0
- package/dist/Agent.d.ts +97 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +210 -0
- package/dist/Agent.js.map +1 -0
- package/dist/AgentSurface.d.ts +20 -0
- package/dist/AgentSurface.d.ts.map +1 -0
- package/dist/AgentSurface.js +36 -0
- package/dist/AgentSurface.js.map +1 -0
- package/dist/Embedder.d.ts +21 -0
- package/dist/Embedder.d.ts.map +1 -0
- package/dist/Embedder.js +54 -0
- package/dist/Embedder.js.map +1 -0
- package/dist/EvalMain.d.ts +2 -0
- package/dist/EvalMain.d.ts.map +1 -0
- package/dist/EvalMain.js +80 -0
- package/dist/EvalMain.js.map +1 -0
- package/dist/Evals.d.ts +95 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +389 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Kernel.d.ts +88 -0
- package/dist/Kernel.d.ts.map +1 -0
- package/dist/Kernel.js +108 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Launch.d.ts +86 -0
- package/dist/Launch.d.ts.map +1 -0
- package/dist/Launch.js +370 -0
- package/dist/Launch.js.map +1 -0
- package/dist/Locks.d.ts +39 -0
- package/dist/Locks.d.ts.map +1 -0
- package/dist/Locks.js +94 -0
- package/dist/Locks.js.map +1 -0
- package/dist/Routes.d.ts +19 -0
- package/dist/Routes.d.ts.map +1 -0
- package/dist/Routes.js +38 -0
- package/dist/Routes.js.map +1 -0
- package/dist/ScriptedChatModel.d.ts +51 -0
- package/dist/ScriptedChatModel.d.ts.map +1 -0
- package/dist/ScriptedChatModel.js +135 -0
- package/dist/ScriptedChatModel.js.map +1 -0
- package/dist/SmtpSink.d.ts +36 -0
- package/dist/SmtpSink.d.ts.map +1 -0
- package/dist/SmtpSink.js +185 -0
- package/dist/SmtpSink.js.map +1 -0
- package/dist/System.d.ts +271 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +905 -0
- package/dist/System.js.map +1 -0
- package/dist/TcpProxy.d.ts +17 -0
- package/dist/TcpProxy.d.ts.map +1 -0
- package/dist/TcpProxy.js +100 -0
- package/dist/TcpProxy.js.map +1 -0
- package/dist/auth/TrustedProxyAuth.d.ts +28 -0
- package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
- package/dist/auth/TrustedProxyAuth.js +128 -0
- package/dist/auth/TrustedProxyAuth.js.map +1 -0
- package/dist/conformance/ActionConsent.d.ts +3 -0
- package/dist/conformance/ActionConsent.d.ts.map +1 -0
- package/dist/conformance/ActionConsent.js +347 -0
- package/dist/conformance/ActionConsent.js.map +1 -0
- package/dist/conformance/ActionRegistry.d.ts +64 -0
- package/dist/conformance/ActionRegistry.d.ts.map +1 -0
- package/dist/conformance/ActionRegistry.js +136 -0
- package/dist/conformance/ActionRegistry.js.map +1 -0
- package/dist/conformance/Actor.d.ts +43 -0
- package/dist/conformance/Actor.d.ts.map +1 -0
- package/dist/conformance/Actor.js +171 -0
- package/dist/conformance/Actor.js.map +1 -0
- package/dist/conformance/AgentReference.d.ts +30 -0
- package/dist/conformance/AgentReference.d.ts.map +1 -0
- package/dist/conformance/AgentReference.js +137 -0
- package/dist/conformance/AgentReference.js.map +1 -0
- package/dist/conformance/AgentResources.d.ts +3 -0
- package/dist/conformance/AgentResources.d.ts.map +1 -0
- package/dist/conformance/AgentResources.js +454 -0
- package/dist/conformance/AgentResources.js.map +1 -0
- package/dist/conformance/AgentRuntime.d.ts +3 -0
- package/dist/conformance/AgentRuntime.d.ts.map +1 -0
- package/dist/conformance/AgentRuntime.js +302 -0
- package/dist/conformance/AgentRuntime.js.map +1 -0
- package/dist/conformance/AgentSubject.d.ts +87 -0
- package/dist/conformance/AgentSubject.d.ts.map +1 -0
- package/dist/conformance/AgentSubject.js +18 -0
- package/dist/conformance/AgentSubject.js.map +1 -0
- package/dist/conformance/Approvals.d.ts +3 -0
- package/dist/conformance/Approvals.d.ts.map +1 -0
- package/dist/conformance/Approvals.js +258 -0
- package/dist/conformance/Approvals.js.map +1 -0
- package/dist/conformance/Audit.d.ts +3 -0
- package/dist/conformance/Audit.d.ts.map +1 -0
- package/dist/conformance/Audit.js +221 -0
- package/dist/conformance/Audit.js.map +1 -0
- package/dist/conformance/CalendarProvider.d.ts +4 -0
- package/dist/conformance/CalendarProvider.d.ts.map +1 -0
- package/dist/conformance/CalendarProvider.js +108 -0
- package/dist/conformance/CalendarProvider.js.map +1 -0
- package/dist/conformance/CapabilityKit.d.ts +191 -0
- package/dist/conformance/CapabilityKit.d.ts.map +1 -0
- package/dist/conformance/CapabilityKit.js +375 -0
- package/dist/conformance/CapabilityKit.js.map +1 -0
- package/dist/conformance/ClientSDK.d.ts +78 -0
- package/dist/conformance/ClientSDK.d.ts.map +1 -0
- package/dist/conformance/ClientSDK.js +163 -0
- package/dist/conformance/ClientSDK.js.map +1 -0
- package/dist/conformance/CollabDocument.d.ts +3 -0
- package/dist/conformance/CollabDocument.d.ts.map +1 -0
- package/dist/conformance/CollabDocument.js +934 -0
- package/dist/conformance/CollabDocument.js.map +1 -0
- package/dist/conformance/CollabReference.d.ts +8 -0
- package/dist/conformance/CollabReference.d.ts.map +1 -0
- package/dist/conformance/CollabReference.js +138 -0
- package/dist/conformance/CollabReference.js.map +1 -0
- package/dist/conformance/CollabSubject.d.ts +68 -0
- package/dist/conformance/CollabSubject.d.ts.map +1 -0
- package/dist/conformance/CollabSubject.js +2 -0
- package/dist/conformance/CollabSubject.js.map +1 -0
- package/dist/conformance/Command.d.ts +3 -0
- package/dist/conformance/Command.d.ts.map +1 -0
- package/dist/conformance/Command.js +73 -0
- package/dist/conformance/Command.js.map +1 -0
- package/dist/conformance/Connections.d.ts +4 -0
- package/dist/conformance/Connections.d.ts.map +1 -0
- package/dist/conformance/Connections.js +308 -0
- package/dist/conformance/Connections.js.map +1 -0
- package/dist/conformance/ConnectionsReference.d.ts +56 -0
- package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
- package/dist/conformance/ConnectionsReference.js +74 -0
- package/dist/conformance/ConnectionsReference.js.map +1 -0
- package/dist/conformance/ConnectorReference.d.ts +86 -0
- package/dist/conformance/ConnectorReference.d.ts.map +1 -0
- package/dist/conformance/ConnectorReference.js +185 -0
- package/dist/conformance/ConnectorReference.js.map +1 -0
- package/dist/conformance/ContextAccounting.d.ts +8 -0
- package/dist/conformance/ContextAccounting.d.ts.map +1 -0
- package/dist/conformance/ContextAccounting.js +125 -0
- package/dist/conformance/ContextAccounting.js.map +1 -0
- package/dist/conformance/Daemon.d.ts +150 -0
- package/dist/conformance/Daemon.d.ts.map +1 -0
- package/dist/conformance/Daemon.js +718 -0
- package/dist/conformance/Daemon.js.map +1 -0
- package/dist/conformance/DaemonReference.d.ts +15 -0
- package/dist/conformance/DaemonReference.d.ts.map +1 -0
- package/dist/conformance/DaemonReference.js +163 -0
- package/dist/conformance/DaemonReference.js.map +1 -0
- package/dist/conformance/DbTx.d.ts +17 -0
- package/dist/conformance/DbTx.d.ts.map +1 -0
- package/dist/conformance/DbTx.js +184 -0
- package/dist/conformance/DbTx.js.map +1 -0
- package/dist/conformance/DecisionTokens.d.ts +3 -0
- package/dist/conformance/DecisionTokens.d.ts.map +1 -0
- package/dist/conformance/DecisionTokens.js +551 -0
- package/dist/conformance/DecisionTokens.js.map +1 -0
- package/dist/conformance/Delegation.d.ts +3 -0
- package/dist/conformance/Delegation.d.ts.map +1 -0
- package/dist/conformance/Delegation.js +149 -0
- package/dist/conformance/Delegation.js.map +1 -0
- package/dist/conformance/DeskReference.d.ts +21 -0
- package/dist/conformance/DeskReference.d.ts.map +1 -0
- package/dist/conformance/DeskReference.js +47 -0
- package/dist/conformance/DeskReference.js.map +1 -0
- package/dist/conformance/DeviceControl.d.ts +3 -0
- package/dist/conformance/DeviceControl.d.ts.map +1 -0
- package/dist/conformance/DeviceControl.js +579 -0
- package/dist/conformance/DeviceControl.js.map +1 -0
- package/dist/conformance/Directory.d.ts +36 -0
- package/dist/conformance/Directory.d.ts.map +1 -0
- package/dist/conformance/Directory.js +253 -0
- package/dist/conformance/Directory.js.map +1 -0
- package/dist/conformance/DirectoryProvider.d.ts +4 -0
- package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
- package/dist/conformance/DirectoryProvider.js +58 -0
- package/dist/conformance/DirectoryProvider.js.map +1 -0
- package/dist/conformance/DocumentSource.d.ts +4 -0
- package/dist/conformance/DocumentSource.d.ts.map +1 -0
- package/dist/conformance/DocumentSource.js +43 -0
- package/dist/conformance/DocumentSource.js.map +1 -0
- package/dist/conformance/EndpointReference.d.ts +40 -0
- package/dist/conformance/EndpointReference.d.ts.map +1 -0
- package/dist/conformance/EndpointReference.js +67 -0
- package/dist/conformance/EndpointReference.js.map +1 -0
- package/dist/conformance/Files.d.ts +40 -0
- package/dist/conformance/Files.d.ts.map +1 -0
- package/dist/conformance/Files.js +592 -0
- package/dist/conformance/Files.js.map +1 -0
- package/dist/conformance/FilesReference.d.ts +31 -0
- package/dist/conformance/FilesReference.d.ts.map +1 -0
- package/dist/conformance/FilesReference.js +116 -0
- package/dist/conformance/FilesReference.js.map +1 -0
- package/dist/conformance/FilesSubject.d.ts +46 -0
- package/dist/conformance/FilesSubject.d.ts.map +1 -0
- package/dist/conformance/FilesSubject.js +3 -0
- package/dist/conformance/FilesSubject.js.map +1 -0
- package/dist/conformance/Flags.d.ts +3 -0
- package/dist/conformance/Flags.d.ts.map +1 -0
- package/dist/conformance/Flags.js +183 -0
- package/dist/conformance/Flags.js.map +1 -0
- package/dist/conformance/Host.d.ts +64 -0
- package/dist/conformance/Host.d.ts.map +1 -0
- package/dist/conformance/Host.js +152 -0
- package/dist/conformance/Host.js.map +1 -0
- package/dist/conformance/HttpApi.d.ts +5 -0
- package/dist/conformance/HttpApi.d.ts.map +1 -0
- package/dist/conformance/HttpApi.js +131 -0
- package/dist/conformance/HttpApi.js.map +1 -0
- package/dist/conformance/InboxReference.d.ts +28 -0
- package/dist/conformance/InboxReference.d.ts.map +1 -0
- package/dist/conformance/InboxReference.js +331 -0
- package/dist/conformance/InboxReference.js.map +1 -0
- package/dist/conformance/InboxSubject.d.ts +92 -0
- package/dist/conformance/InboxSubject.d.ts.map +1 -0
- package/dist/conformance/InboxSubject.js +16 -0
- package/dist/conformance/InboxSubject.js.map +1 -0
- package/dist/conformance/Ingestion.d.ts +10 -0
- package/dist/conformance/Ingestion.d.ts.map +1 -0
- package/dist/conformance/Ingestion.js +335 -0
- package/dist/conformance/Ingestion.js.map +1 -0
- package/dist/conformance/Ingress.d.ts +62 -0
- package/dist/conformance/Ingress.d.ts.map +1 -0
- package/dist/conformance/Ingress.js +346 -0
- package/dist/conformance/Ingress.js.map +1 -0
- package/dist/conformance/Invocation.d.ts +3 -0
- package/dist/conformance/Invocation.d.ts.map +1 -0
- package/dist/conformance/Invocation.js +665 -0
- package/dist/conformance/Invocation.js.map +1 -0
- package/dist/conformance/IsolationMatrix.d.ts +60 -0
- package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
- package/dist/conformance/IsolationMatrix.js +196 -0
- package/dist/conformance/IsolationMatrix.js.map +1 -0
- package/dist/conformance/LiveConnection.d.ts +72 -0
- package/dist/conformance/LiveConnection.d.ts.map +1 -0
- package/dist/conformance/LiveConnection.js +125 -0
- package/dist/conformance/LiveConnection.js.map +1 -0
- package/dist/conformance/LocalClient.d.ts +62 -0
- package/dist/conformance/LocalClient.d.ts.map +1 -0
- package/dist/conformance/LocalClient.js +526 -0
- package/dist/conformance/LocalClient.js.map +1 -0
- package/dist/conformance/Locale.d.ts +28 -0
- package/dist/conformance/Locale.d.ts.map +1 -0
- package/dist/conformance/Locale.js +115 -0
- package/dist/conformance/Locale.js.map +1 -0
- package/dist/conformance/MachineIdentity.d.ts +39 -0
- package/dist/conformance/MachineIdentity.d.ts.map +1 -0
- package/dist/conformance/MachineIdentity.js +595 -0
- package/dist/conformance/MachineIdentity.js.map +1 -0
- package/dist/conformance/MailProvider.d.ts +4 -0
- package/dist/conformance/MailProvider.d.ts.map +1 -0
- package/dist/conformance/MailProvider.js +167 -0
- package/dist/conformance/MailProvider.js.map +1 -0
- package/dist/conformance/Memory.d.ts +10 -0
- package/dist/conformance/Memory.d.ts.map +1 -0
- package/dist/conformance/Memory.js +179 -0
- package/dist/conformance/Memory.js.map +1 -0
- package/dist/conformance/Messaging.d.ts +49 -0
- package/dist/conformance/Messaging.d.ts.map +1 -0
- package/dist/conformance/Messaging.js +117 -0
- package/dist/conformance/Messaging.js.map +1 -0
- package/dist/conformance/Metering.d.ts +26 -0
- package/dist/conformance/Metering.d.ts.map +1 -0
- package/dist/conformance/Metering.js +236 -0
- package/dist/conformance/Metering.js.map +1 -0
- package/dist/conformance/ModelProvider.d.ts +32 -0
- package/dist/conformance/ModelProvider.d.ts.map +1 -0
- package/dist/conformance/ModelProvider.js +100 -0
- package/dist/conformance/ModelProvider.js.map +1 -0
- package/dist/conformance/ModuleManifest.d.ts +9 -0
- package/dist/conformance/ModuleManifest.d.ts.map +1 -0
- package/dist/conformance/ModuleManifest.js +542 -0
- package/dist/conformance/ModuleManifest.js.map +1 -0
- package/dist/conformance/NotebookAgent.d.ts +32 -0
- package/dist/conformance/NotebookAgent.d.ts.map +1 -0
- package/dist/conformance/NotebookAgent.js +31 -0
- package/dist/conformance/NotebookAgent.js.map +1 -0
- package/dist/conformance/NotificationChannel.d.ts +40 -0
- package/dist/conformance/NotificationChannel.d.ts.map +1 -0
- package/dist/conformance/NotificationChannel.js +78 -0
- package/dist/conformance/NotificationChannel.js.map +1 -0
- package/dist/conformance/Notifications.d.ts +3 -0
- package/dist/conformance/Notifications.d.ts.map +1 -0
- package/dist/conformance/Notifications.js +240 -0
- package/dist/conformance/Notifications.js.map +1 -0
- package/dist/conformance/OAuthClient.d.ts +123 -0
- package/dist/conformance/OAuthClient.d.ts.map +1 -0
- package/dist/conformance/OAuthClient.js +204 -0
- package/dist/conformance/OAuthClient.js.map +1 -0
- package/dist/conformance/Outbox.d.ts +3 -0
- package/dist/conformance/Outbox.d.ts.map +1 -0
- package/dist/conformance/Outbox.js +266 -0
- package/dist/conformance/Outbox.js.map +1 -0
- package/dist/conformance/PlatformReference.d.ts +5 -0
- package/dist/conformance/PlatformReference.d.ts.map +1 -0
- package/dist/conformance/PlatformReference.js +66 -0
- package/dist/conformance/PlatformReference.js.map +1 -0
- package/dist/conformance/PlatformSubject.d.ts +45 -0
- package/dist/conformance/PlatformSubject.d.ts.map +1 -0
- package/dist/conformance/PlatformSubject.js +3 -0
- package/dist/conformance/PlatformSubject.js.map +1 -0
- package/dist/conformance/Privacy.d.ts +3 -0
- package/dist/conformance/Privacy.d.ts.map +1 -0
- package/dist/conformance/Privacy.js +437 -0
- package/dist/conformance/Privacy.js.map +1 -0
- package/dist/conformance/Progress.d.ts +3 -0
- package/dist/conformance/Progress.d.ts.map +1 -0
- package/dist/conformance/Progress.js +153 -0
- package/dist/conformance/Progress.js.map +1 -0
- package/dist/conformance/Push.d.ts +38 -0
- package/dist/conformance/Push.d.ts.map +1 -0
- package/dist/conformance/Push.js +649 -0
- package/dist/conformance/Push.js.map +1 -0
- package/dist/conformance/PushReference.d.ts +3 -0
- package/dist/conformance/PushReference.d.ts.map +1 -0
- package/dist/conformance/PushReference.js +97 -0
- package/dist/conformance/PushReference.js.map +1 -0
- package/dist/conformance/QuerySurface.d.ts +9 -0
- package/dist/conformance/QuerySurface.d.ts.map +1 -0
- package/dist/conformance/QuerySurface.js +349 -0
- package/dist/conformance/QuerySurface.js.map +1 -0
- package/dist/conformance/Readiness.d.ts +23 -0
- package/dist/conformance/Readiness.d.ts.map +1 -0
- package/dist/conformance/Readiness.js +110 -0
- package/dist/conformance/Readiness.js.map +1 -0
- package/dist/conformance/Reference.d.ts +17 -0
- package/dist/conformance/Reference.d.ts.map +1 -0
- package/dist/conformance/Reference.js +246 -0
- package/dist/conformance/Reference.js.map +1 -0
- package/dist/conformance/Release.d.ts +73 -0
- package/dist/conformance/Release.d.ts.map +1 -0
- package/dist/conformance/Release.js +556 -0
- package/dist/conformance/Release.js.map +1 -0
- package/dist/conformance/ReleaseReference.d.ts +5 -0
- package/dist/conformance/ReleaseReference.d.ts.map +1 -0
- package/dist/conformance/ReleaseReference.js +124 -0
- package/dist/conformance/ReleaseReference.js.map +1 -0
- package/dist/conformance/ResultRendering.d.ts +3 -0
- package/dist/conformance/ResultRendering.d.ts.map +1 -0
- package/dist/conformance/ResultRendering.js +120 -0
- package/dist/conformance/ResultRendering.js.map +1 -0
- package/dist/conformance/Sandbox.d.ts +58 -0
- package/dist/conformance/Sandbox.d.ts.map +1 -0
- package/dist/conformance/Sandbox.js +213 -0
- package/dist/conformance/Sandbox.js.map +1 -0
- package/dist/conformance/SandboxReference.d.ts +3 -0
- package/dist/conformance/SandboxReference.d.ts.map +1 -0
- package/dist/conformance/SandboxReference.js +44 -0
- package/dist/conformance/SandboxReference.js.map +1 -0
- package/dist/conformance/Scheduler.d.ts +106 -0
- package/dist/conformance/Scheduler.d.ts.map +1 -0
- package/dist/conformance/Scheduler.js +576 -0
- package/dist/conformance/Scheduler.js.map +1 -0
- package/dist/conformance/ScreenContext.d.ts +84 -0
- package/dist/conformance/ScreenContext.d.ts.map +1 -0
- package/dist/conformance/ScreenContext.js +290 -0
- package/dist/conformance/ScreenContext.js.map +1 -0
- package/dist/conformance/Search.d.ts +3 -0
- package/dist/conformance/Search.d.ts.map +1 -0
- package/dist/conformance/Search.js +333 -0
- package/dist/conformance/Search.js.map +1 -0
- package/dist/conformance/Secrets.d.ts +8 -0
- package/dist/conformance/Secrets.d.ts.map +1 -0
- package/dist/conformance/Secrets.js +231 -0
- package/dist/conformance/Secrets.js.map +1 -0
- package/dist/conformance/SecretsReference.d.ts +44 -0
- package/dist/conformance/SecretsReference.d.ts.map +1 -0
- package/dist/conformance/SecretsReference.js +73 -0
- package/dist/conformance/SecretsReference.js.map +1 -0
- package/dist/conformance/ServicesReference.d.ts +8 -0
- package/dist/conformance/ServicesReference.d.ts.map +1 -0
- package/dist/conformance/ServicesReference.js +273 -0
- package/dist/conformance/ServicesReference.js.map +1 -0
- package/dist/conformance/ServicesSubject.d.ts +104 -0
- package/dist/conformance/ServicesSubject.d.ts.map +1 -0
- package/dist/conformance/ServicesSubject.js +2 -0
- package/dist/conformance/ServicesSubject.js.map +1 -0
- package/dist/conformance/Settings.d.ts +3 -0
- package/dist/conformance/Settings.d.ts.map +1 -0
- package/dist/conformance/Settings.js +177 -0
- package/dist/conformance/Settings.js.map +1 -0
- package/dist/conformance/Sharing.d.ts +3 -0
- package/dist/conformance/Sharing.d.ts.map +1 -0
- package/dist/conformance/Sharing.js +368 -0
- package/dist/conformance/Sharing.js.map +1 -0
- package/dist/conformance/ShellSubject.d.ts +29 -0
- package/dist/conformance/ShellSubject.d.ts.map +1 -0
- package/dist/conformance/ShellSubject.js +13 -0
- package/dist/conformance/ShellSubject.js.map +1 -0
- package/dist/conformance/SignOutRace.d.ts +23 -0
- package/dist/conformance/SignOutRace.d.ts.map +1 -0
- package/dist/conformance/SignOutRace.js +49 -0
- package/dist/conformance/SignOutRace.js.map +1 -0
- package/dist/conformance/Slot.d.ts +3 -0
- package/dist/conformance/Slot.d.ts.map +1 -0
- package/dist/conformance/Slot.js +79 -0
- package/dist/conformance/Slot.js.map +1 -0
- package/dist/conformance/Space.d.ts +63 -0
- package/dist/conformance/Space.d.ts.map +1 -0
- package/dist/conformance/Space.js +294 -0
- package/dist/conformance/Space.js.map +1 -0
- package/dist/conformance/StorageAdapter.d.ts +76 -0
- package/dist/conformance/StorageAdapter.d.ts.map +1 -0
- package/dist/conformance/StorageAdapter.js +181 -0
- package/dist/conformance/StorageAdapter.js.map +1 -0
- package/dist/conformance/StorageBackend.d.ts +23 -0
- package/dist/conformance/StorageBackend.d.ts.map +1 -0
- package/dist/conformance/StorageBackend.js +274 -0
- package/dist/conformance/StorageBackend.js.map +1 -0
- package/dist/conformance/Subject.d.ts +198 -0
- package/dist/conformance/Subject.d.ts.map +1 -0
- package/dist/conformance/Subject.js +26 -0
- package/dist/conformance/Subject.js.map +1 -0
- package/dist/conformance/Sync.d.ts +3 -0
- package/dist/conformance/Sync.d.ts.map +1 -0
- package/dist/conformance/Sync.js +190 -0
- package/dist/conformance/Sync.js.map +1 -0
- package/dist/conformance/Telemetry.d.ts +3 -0
- package/dist/conformance/Telemetry.d.ts.map +1 -0
- package/dist/conformance/Telemetry.js +218 -0
- package/dist/conformance/Telemetry.js.map +1 -0
- package/dist/conformance/ThemeTokens.d.ts +22 -0
- package/dist/conformance/ThemeTokens.d.ts.map +1 -0
- package/dist/conformance/ThemeTokens.js +121 -0
- package/dist/conformance/ThemeTokens.js.map +1 -0
- package/dist/conformance/ToolSource.d.ts +5 -0
- package/dist/conformance/ToolSource.d.ts.map +1 -0
- package/dist/conformance/ToolSource.js +520 -0
- package/dist/conformance/ToolSource.js.map +1 -0
- package/dist/conformance/Versioning.d.ts +3 -0
- package/dist/conformance/Versioning.d.ts.map +1 -0
- package/dist/conformance/Versioning.js +160 -0
- package/dist/conformance/Versioning.js.map +1 -0
- package/dist/conformance/View.d.ts +3 -0
- package/dist/conformance/View.d.ts.map +1 -0
- package/dist/conformance/View.js +121 -0
- package/dist/conformance/View.js.map +1 -0
- package/dist/conformance/WorkItems.d.ts +3 -0
- package/dist/conformance/WorkItems.d.ts.map +1 -0
- package/dist/conformance/WorkItems.js +152 -0
- package/dist/conformance/WorkItems.js.map +1 -0
- package/dist/conformance/Workflow.d.ts +63 -0
- package/dist/conformance/Workflow.d.ts.map +1 -0
- package/dist/conformance/Workflow.js +235 -0
- package/dist/conformance/Workflow.js.map +1 -0
- package/dist/conformance/acme/chatlog.d.ts +591 -0
- package/dist/conformance/acme/chatlog.d.ts.map +1 -0
- package/dist/conformance/acme/chatlog.js +101 -0
- package/dist/conformance/acme/chatlog.js.map +1 -0
- package/dist/conformance/acme/connector.d.ts +12 -0
- package/dist/conformance/acme/connector.d.ts.map +1 -0
- package/dist/conformance/acme/connector.js +123 -0
- package/dist/conformance/acme/connector.js.map +1 -0
- package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
- package/dist/conformance/archive/app.d.ts +728 -0
- package/dist/conformance/archive/app.d.ts.map +1 -0
- package/dist/conformance/archive/app.js +30 -0
- package/dist/conformance/archive/app.js.map +1 -0
- package/dist/conformance/archive/contract.d.ts +467 -0
- package/dist/conformance/archive/contract.d.ts.map +1 -0
- package/dist/conformance/archive/contract.js +187 -0
- package/dist/conformance/archive/contract.js.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
- package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/memo.sync.gen.js +23 -0
- package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
- package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/dist/conformance/archive/schema.d.ts +185 -0
- package/dist/conformance/archive/schema.d.ts.map +1 -0
- package/dist/conformance/archive/schema.js +22 -0
- package/dist/conformance/archive/schema.js.map +1 -0
- package/dist/conformance/archive/server.d.ts +273 -0
- package/dist/conformance/archive/server.d.ts.map +1 -0
- package/dist/conformance/archive/server.js +127 -0
- package/dist/conformance/archive/server.js.map +1 -0
- package/dist/conformance/archive/sync.gen.d.ts +319 -0
- package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
- package/dist/conformance/archive/sync.gen.js +29 -0
- package/dist/conformance/archive/sync.gen.js.map +1 -0
- package/dist/conformance/atlas/app.d.ts +3 -0
- package/dist/conformance/atlas/app.d.ts.map +1 -0
- package/dist/conformance/atlas/app.js +15 -0
- package/dist/conformance/atlas/app.js.map +1 -0
- package/dist/conformance/atlas/contract.d.ts +489 -0
- package/dist/conformance/atlas/contract.d.ts.map +1 -0
- package/dist/conformance/atlas/contract.js +114 -0
- package/dist/conformance/atlas/contract.js.map +1 -0
- package/dist/conformance/crm/app.d.ts +304 -0
- package/dist/conformance/crm/app.d.ts.map +1 -0
- package/dist/conformance/crm/app.js +95 -0
- package/dist/conformance/crm/app.js.map +1 -0
- package/dist/conformance/crm/contract.d.ts +586 -0
- package/dist/conformance/crm/contract.d.ts.map +1 -0
- package/dist/conformance/crm/contract.js +153 -0
- package/dist/conformance/crm/contract.js.map +1 -0
- package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/dist/conformance/crm/schema.d.ts +261 -0
- package/dist/conformance/crm/schema.d.ts.map +1 -0
- package/dist/conformance/crm/schema.js +25 -0
- package/dist/conformance/crm/schema.js.map +1 -0
- package/dist/conformance/crm/sync.gen.d.ts +188 -0
- package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
- package/dist/conformance/crm/sync.gen.js +25 -0
- package/dist/conformance/crm/sync.gen.js.map +1 -0
- package/dist/conformance/desk/contract.d.ts +306 -0
- package/dist/conformance/desk/contract.d.ts.map +1 -0
- package/dist/conformance/desk/contract.js +56 -0
- package/dist/conformance/desk/contract.js.map +1 -0
- package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
- package/dist/conformance/desk/server.d.ts +231 -0
- package/dist/conformance/desk/server.d.ts.map +1 -0
- package/dist/conformance/desk/server.js +123 -0
- package/dist/conformance/desk/server.js.map +1 -0
- package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/dist/conformance/drafts/module.d.ts +571 -0
- package/dist/conformance/drafts/module.d.ts.map +1 -0
- package/dist/conformance/drafts/module.js +190 -0
- package/dist/conformance/drafts/module.js.map +1 -0
- package/dist/conformance/fixture/app.d.ts +24 -0
- package/dist/conformance/fixture/app.d.ts.map +1 -0
- package/dist/conformance/fixture/app.js +26 -0
- package/dist/conformance/fixture/app.js.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
- package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/bad-sync.js +22 -0
- package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
- package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
- package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/contract.js +277 -0
- package/dist/conformance/fixture/docs/contract.js.map +1 -0
- package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/dist/conformance/fixture/docs/policy.cedar +110 -0
- package/dist/conformance/fixture/docs/schema.d.ts +308 -0
- package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/schema.js +36 -0
- package/dist/conformance/fixture/docs/schema.js.map +1 -0
- package/dist/conformance/fixture/docs/server.d.ts +552 -0
- package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/server.js +192 -0
- package/dist/conformance/fixture/docs/server.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.d.ts +402 -0
- package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
- package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
- package/dist/conformance/fixture/docs/sync.gen.js +48 -0
- package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
- package/dist/conformance/fixture/docs/sync.js +23 -0
- package/dist/conformance/fixture/docs/sync.js.map +1 -0
- package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/dist/conformance/fixture/peer/module.d.ts +306 -0
- package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
- package/dist/conformance/fixture/peer/module.js +44 -0
- package/dist/conformance/fixture/peer/module.js.map +1 -0
- package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/module.d.ts +1878 -0
- package/dist/conformance/fixture/release/module.d.ts.map +1 -0
- package/dist/conformance/fixture/release/module.js +102 -0
- package/dist/conformance/fixture/release/module.js.map +1 -0
- package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/dist/conformance/kit-hash.d.ts +8 -0
- package/dist/conformance/kit-hash.d.ts.map +1 -0
- package/dist/conformance/kit-hash.js +20 -0
- package/dist/conformance/kit-hash.js.map +1 -0
- package/dist/conformance/ledger/contract.d.ts +380 -0
- package/dist/conformance/ledger/contract.d.ts.map +1 -0
- package/dist/conformance/ledger/contract.js +81 -0
- package/dist/conformance/ledger/contract.js.map +1 -0
- package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/dist/conformance/ledger/server.d.ts +312 -0
- package/dist/conformance/ledger/server.d.ts.map +1 -0
- package/dist/conformance/ledger/server.js +152 -0
- package/dist/conformance/ledger/server.js.map +1 -0
- package/dist/conformance/library/app.d.ts +616 -0
- package/dist/conformance/library/app.d.ts.map +1 -0
- package/dist/conformance/library/app.js +35 -0
- package/dist/conformance/library/app.js.map +1 -0
- package/dist/conformance/library/contract.d.ts +377 -0
- package/dist/conformance/library/contract.d.ts.map +1 -0
- package/dist/conformance/library/contract.js +63 -0
- package/dist/conformance/library/contract.js.map +1 -0
- package/dist/conformance/library/migrations/0000_library.sql +14 -0
- package/dist/conformance/library/schema.d.ts +174 -0
- package/dist/conformance/library/schema.d.ts.map +1 -0
- package/dist/conformance/library/schema.js +24 -0
- package/dist/conformance/library/schema.js.map +1 -0
- package/dist/conformance/library/server.d.ts +191 -0
- package/dist/conformance/library/server.d.ts.map +1 -0
- package/dist/conformance/library/server.js +52 -0
- package/dist/conformance/library/server.js.map +1 -0
- package/dist/conformance/library/sync.gen.d.ts +519 -0
- package/dist/conformance/library/sync.gen.d.ts.map +1 -0
- package/dist/conformance/library/sync.gen.js +42 -0
- package/dist/conformance/library/sync.gen.js.map +1 -0
- package/dist/conformance/locale/catalog.d.ts +93 -0
- package/dist/conformance/locale/catalog.d.ts.map +1 -0
- package/dist/conformance/locale/catalog.js +104 -0
- package/dist/conformance/locale/catalog.js.map +1 -0
- package/dist/conformance/notebook/app.d.ts +1039 -0
- package/dist/conformance/notebook/app.d.ts.map +1 -0
- package/dist/conformance/notebook/app.js +88 -0
- package/dist/conformance/notebook/app.js.map +1 -0
- package/dist/conformance/notebook/evals/pages.evals.json +94 -0
- package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/dist/conformance/notebook/module.d.ts +717 -0
- package/dist/conformance/notebook/module.d.ts.map +1 -0
- package/dist/conformance/notebook/module.js +188 -0
- package/dist/conformance/notebook/module.js.map +1 -0
- package/dist/conformance/pad/app.d.ts +9 -0
- package/dist/conformance/pad/app.d.ts.map +1 -0
- package/dist/conformance/pad/app.js +13 -0
- package/dist/conformance/pad/app.js.map +1 -0
- package/dist/conformance/pad/contract.d.ts +281 -0
- package/dist/conformance/pad/contract.d.ts.map +1 -0
- package/dist/conformance/pad/contract.js +66 -0
- package/dist/conformance/pad/contract.js.map +1 -0
- package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/dist/conformance/pad/schema.d.ts +127 -0
- package/dist/conformance/pad/schema.d.ts.map +1 -0
- package/dist/conformance/pad/schema.js +17 -0
- package/dist/conformance/pad/schema.js.map +1 -0
- package/dist/conformance/pad/server.d.ts +149 -0
- package/dist/conformance/pad/server.d.ts.map +1 -0
- package/dist/conformance/pad/server.js +81 -0
- package/dist/conformance/pad/server.js.map +1 -0
- package/dist/conformance/purchases/app.d.ts +480 -0
- package/dist/conformance/purchases/app.d.ts.map +1 -0
- package/dist/conformance/purchases/app.js +32 -0
- package/dist/conformance/purchases/app.js.map +1 -0
- package/dist/conformance/purchases/contract.d.ts +720 -0
- package/dist/conformance/purchases/contract.d.ts.map +1 -0
- package/dist/conformance/purchases/contract.js +148 -0
- package/dist/conformance/purchases/contract.js.map +1 -0
- package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/dist/conformance/purchases/server.d.ts +250 -0
- package/dist/conformance/purchases/server.d.ts.map +1 -0
- package/dist/conformance/purchases/server.js +85 -0
- package/dist/conformance/purchases/server.js.map +1 -0
- package/dist/conformance/studio/app.d.ts +996 -0
- package/dist/conformance/studio/app.d.ts.map +1 -0
- package/dist/conformance/studio/app.js +251 -0
- package/dist/conformance/studio/app.js.map +1 -0
- package/dist/conformance/studio/contract.d.ts +1318 -0
- package/dist/conformance/studio/contract.d.ts.map +1 -0
- package/dist/conformance/studio/contract.js +280 -0
- package/dist/conformance/studio/contract.js.map +1 -0
- package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/dist/conformance/workshop/app.d.ts +8 -0
- package/dist/conformance/workshop/app.d.ts.map +1 -0
- package/dist/conformance/workshop/app.js +13 -0
- package/dist/conformance/workshop/app.js.map +1 -0
- package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/dist/conformance/workshop/module.d.ts +407 -0
- package/dist/conformance/workshop/module.d.ts.map +1 -0
- package/dist/conformance/workshop/module.js +71 -0
- package/dist/conformance/workshop/module.js.map +1 -0
- package/dist/fakes/AcmeFake.d.ts +46 -0
- package/dist/fakes/AcmeFake.d.ts.map +1 -0
- package/dist/fakes/AcmeFake.js +131 -0
- package/dist/fakes/AcmeFake.js.map +1 -0
- package/dist/fakes/ApnsFake.d.ts +79 -0
- package/dist/fakes/ApnsFake.d.ts.map +1 -0
- package/dist/fakes/ApnsFake.js +220 -0
- package/dist/fakes/ApnsFake.js.map +1 -0
- package/dist/fakes/FcmFake.d.ts +46 -0
- package/dist/fakes/FcmFake.d.ts.map +1 -0
- package/dist/fakes/FcmFake.js +185 -0
- package/dist/fakes/FcmFake.js.map +1 -0
- package/dist/fakes/GoogleFake.d.ts +221 -0
- package/dist/fakes/GoogleFake.d.ts.map +1 -0
- package/dist/fakes/GoogleFake.js +1035 -0
- package/dist/fakes/GoogleFake.js.map +1 -0
- package/dist/fakes/HttpApiFake.d.ts +22 -0
- package/dist/fakes/HttpApiFake.d.ts.map +1 -0
- package/dist/fakes/HttpApiFake.js +74 -0
- package/dist/fakes/HttpApiFake.js.map +1 -0
- package/dist/fakes/McpFake.d.ts +80 -0
- package/dist/fakes/McpFake.d.ts.map +1 -0
- package/dist/fakes/McpFake.js +312 -0
- package/dist/fakes/McpFake.js.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
- package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
- package/dist/fakes/MicrosoftGraphFake.js +850 -0
- package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
- package/dist/fakes/S3Fake.d.ts +29 -0
- package/dist/fakes/S3Fake.d.ts.map +1 -0
- package/dist/fakes/S3Fake.js +347 -0
- package/dist/fakes/S3Fake.js.map +1 -0
- package/dist/fakes/Server.d.ts +137 -0
- package/dist/fakes/Server.d.ts.map +1 -0
- package/dist/fakes/Server.js +357 -0
- package/dist/fakes/Server.js.map +1 -0
- package/dist/fakes/SignInProviderFake.d.ts +21 -0
- package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
- package/dist/fakes/SignInProviderFake.js +56 -0
- package/dist/fakes/SignInProviderFake.js.map +1 -0
- package/dist/fakes/SlackFake.d.ts +136 -0
- package/dist/fakes/SlackFake.d.ts.map +1 -0
- package/dist/fakes/SlackFake.js +787 -0
- package/dist/fakes/SlackFake.js.map +1 -0
- package/dist/fakes/Store.d.ts +40 -0
- package/dist/fakes/Store.d.ts.map +1 -0
- package/dist/fakes/Store.js +82 -0
- package/dist/fakes/Store.js.map +1 -0
- package/dist/fakes/TelemetryFakes.d.ts +77 -0
- package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
- package/dist/fakes/TelemetryFakes.js +121 -0
- package/dist/fakes/TelemetryFakes.js.map +1 -0
- package/dist/fakes/TestCa.d.ts +11 -0
- package/dist/fakes/TestCa.d.ts.map +1 -0
- package/dist/fakes/TestCa.js +115 -0
- package/dist/fakes/TestCa.js.map +1 -0
- package/dist/fakes/WorkOsFake.d.ts +40 -0
- package/dist/fakes/WorkOsFake.d.ts.map +1 -0
- package/dist/fakes/WorkOsFake.js +103 -0
- package/dist/fakes/WorkOsFake.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/make/reference.d.ts +520 -0
- package/dist/make/reference.d.ts.map +1 -0
- package/dist/make/reference.js +182 -0
- package/dist/make/reference.js.map +1 -0
- package/dist/make/sources.d.ts +48 -0
- package/dist/make/sources.d.ts.map +1 -0
- package/dist/make/sources.js +806 -0
- package/dist/make/sources.js.map +1 -0
- package/package.json +77 -3
- package/src/Admin.ts +82 -0
- package/src/Agent.ts +289 -0
- package/src/AgentSurface.ts +51 -0
- package/src/Embedder.ts +69 -0
- package/src/EvalMain.ts +81 -0
- package/src/Evals.ts +490 -0
- package/src/Kernel.ts +228 -0
- package/src/Launch.ts +428 -0
- package/src/Locks.ts +123 -0
- package/src/Routes.ts +65 -0
- package/src/ScriptedChatModel.ts +189 -0
- package/src/SmtpSink.ts +205 -0
- package/src/System.ts +1072 -0
- package/src/TcpProxy.ts +102 -0
- package/src/auth/TrustedProxyAuth.ts +173 -0
- package/src/conformance/ActionConsent.ts +437 -0
- package/src/conformance/ActionRegistry.ts +174 -0
- package/src/conformance/Actor.ts +216 -0
- package/src/conformance/AgentReference.ts +171 -0
- package/src/conformance/AgentResources.ts +548 -0
- package/src/conformance/AgentRuntime.ts +388 -0
- package/src/conformance/AgentSubject.ts +103 -0
- package/src/conformance/Approvals.ts +363 -0
- package/src/conformance/Audit.ts +257 -0
- package/src/conformance/CalendarProvider.ts +156 -0
- package/src/conformance/CapabilityKit.ts +564 -0
- package/src/conformance/ClientSDK.ts +233 -0
- package/src/conformance/CollabDocument.ts +1203 -0
- package/src/conformance/CollabReference.ts +152 -0
- package/src/conformance/CollabSubject.ts +64 -0
- package/src/conformance/Command.ts +75 -0
- package/src/conformance/Connections.ts +357 -0
- package/src/conformance/ConnectionsReference.ts +172 -0
- package/src/conformance/ConnectorReference.ts +280 -0
- package/src/conformance/ContextAccounting.ts +169 -0
- package/src/conformance/Daemon.ts +936 -0
- package/src/conformance/DaemonReference.ts +189 -0
- package/src/conformance/DbTx.ts +253 -0
- package/src/conformance/DecisionTokens.ts +652 -0
- package/src/conformance/Delegation.ts +177 -0
- package/src/conformance/DeskReference.ts +73 -0
- package/src/conformance/DeviceControl.ts +700 -0
- package/src/conformance/Directory.ts +315 -0
- package/src/conformance/DirectoryProvider.ts +72 -0
- package/src/conformance/DocumentSource.ts +62 -0
- package/src/conformance/EndpointReference.ts +117 -0
- package/src/conformance/Files.ts +685 -0
- package/src/conformance/FilesReference.ts +154 -0
- package/src/conformance/FilesSubject.ts +50 -0
- package/src/conformance/Flags.ts +215 -0
- package/src/conformance/Host.ts +197 -0
- package/src/conformance/HttpApi.ts +169 -0
- package/src/conformance/InboxReference.ts +401 -0
- package/src/conformance/InboxSubject.ts +101 -0
- package/src/conformance/Ingestion.ts +425 -0
- package/src/conformance/Ingress.ts +498 -0
- package/src/conformance/Invocation.ts +780 -0
- package/src/conformance/IsolationMatrix.ts +215 -0
- package/src/conformance/LiveConnection.ts +197 -0
- package/src/conformance/LocalClient.ts +651 -0
- package/src/conformance/Locale.ts +141 -0
- package/src/conformance/MachineIdentity.ts +828 -0
- package/src/conformance/MailProvider.ts +217 -0
- package/src/conformance/Memory.ts +223 -0
- package/src/conformance/Messaging.ts +185 -0
- package/src/conformance/Metering.ts +293 -0
- package/src/conformance/ModelProvider.ts +139 -0
- package/src/conformance/ModuleManifest.ts +630 -0
- package/src/conformance/NotebookAgent.ts +41 -0
- package/src/conformance/NotificationChannel.ts +122 -0
- package/src/conformance/Notifications.ts +316 -0
- package/src/conformance/OAuthClient.ts +240 -0
- package/src/conformance/Outbox.ts +342 -0
- package/src/conformance/PlatformReference.ts +73 -0
- package/src/conformance/PlatformSubject.ts +50 -0
- package/src/conformance/Privacy.ts +577 -0
- package/src/conformance/Progress.ts +244 -0
- package/src/conformance/Push.ts +820 -0
- package/src/conformance/PushReference.ts +101 -0
- package/src/conformance/QuerySurface.ts +408 -0
- package/src/conformance/Readiness.ts +157 -0
- package/src/conformance/Reference.ts +326 -0
- package/src/conformance/Release.ts +690 -0
- package/src/conformance/ReleaseReference.ts +179 -0
- package/src/conformance/ResultRendering.ts +149 -0
- package/src/conformance/Sandbox.ts +313 -0
- package/src/conformance/SandboxReference.ts +52 -0
- package/src/conformance/Scheduler.ts +764 -0
- package/src/conformance/ScreenContext.ts +402 -0
- package/src/conformance/Search.ts +419 -0
- package/src/conformance/Secrets.ts +277 -0
- package/src/conformance/SecretsReference.ts +131 -0
- package/src/conformance/ServicesReference.ts +330 -0
- package/src/conformance/ServicesSubject.ts +105 -0
- package/src/conformance/Settings.ts +204 -0
- package/src/conformance/Sharing.ts +486 -0
- package/src/conformance/ShellSubject.ts +47 -0
- package/src/conformance/SignOutRace.ts +77 -0
- package/src/conformance/Slot.ts +84 -0
- package/src/conformance/Space.ts +432 -0
- package/src/conformance/StorageAdapter.ts +253 -0
- package/src/conformance/StorageBackend.ts +327 -0
- package/src/conformance/Subject.ts +208 -0
- package/src/conformance/Sync.ts +215 -0
- package/src/conformance/Telemetry.ts +287 -0
- package/src/conformance/ThemeTokens.ts +163 -0
- package/src/conformance/ToolSource.ts +632 -0
- package/src/conformance/Versioning.ts +199 -0
- package/src/conformance/View.ts +143 -0
- package/src/conformance/WorkItems.ts +186 -0
- package/src/conformance/Workflow.ts +304 -0
- package/src/conformance/acme/chatlog.ts +115 -0
- package/src/conformance/acme/connector.ts +151 -0
- package/src/conformance/acme/migrations/0000_messages.sql +8 -0
- package/src/conformance/archive/app.ts +33 -0
- package/src/conformance/archive/contract.ts +191 -0
- package/src/conformance/archive/memo.sync.gen.ts +25 -0
- package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
- package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
- package/src/conformance/archive/schema.ts +25 -0
- package/src/conformance/archive/server.ts +146 -0
- package/src/conformance/archive/sync.gen.ts +32 -0
- package/src/conformance/atlas/app.ts +16 -0
- package/src/conformance/atlas/contract.ts +118 -0
- package/src/conformance/crm/app.ts +107 -0
- package/src/conformance/crm/contract.ts +163 -0
- package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
- package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
- package/src/conformance/crm/schema.ts +28 -0
- package/src/conformance/crm/sync.gen.ts +27 -0
- package/src/conformance/desk/contract.ts +61 -0
- package/src/conformance/desk/migrations/0000_notes.sql +7 -0
- package/src/conformance/desk/server.ts +131 -0
- package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
- package/src/conformance/drafts/module.ts +211 -0
- package/src/conformance/fixture/app.ts +37 -0
- package/src/conformance/fixture/docs/bad-sync.ts +34 -0
- package/src/conformance/fixture/docs/contract.ts +297 -0
- package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
- package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
- package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
- package/src/conformance/fixture/docs/policy.cedar +110 -0
- package/src/conformance/fixture/docs/schema.ts +41 -0
- package/src/conformance/fixture/docs/server.ts +292 -0
- package/src/conformance/fixture/docs/sync.gen.ts +54 -0
- package/src/conformance/fixture/docs/sync.ts +24 -0
- package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
- package/src/conformance/fixture/peer/module.ts +51 -0
- package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
- package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
- package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
- package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
- package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
- package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
- package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
- package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
- package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
- package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/module.ts +119 -0
- package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
- package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
- package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
- package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
- package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
- package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
- package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
- package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
- package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
- package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
- package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
- package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
- package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
- package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
- package/src/conformance/kit-hash.ts +18 -0
- package/src/conformance/ledger/contract.ts +92 -0
- package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
- package/src/conformance/ledger/server.ts +174 -0
- package/src/conformance/library/app.ts +38 -0
- package/src/conformance/library/contract.ts +66 -0
- package/src/conformance/library/migrations/0000_library.sql +14 -0
- package/src/conformance/library/schema.ts +27 -0
- package/src/conformance/library/server.ts +65 -0
- package/src/conformance/library/sync.gen.ts +47 -0
- package/src/conformance/locale/catalog.ts +111 -0
- package/src/conformance/notebook/app.ts +115 -0
- package/src/conformance/notebook/evals/pages.evals.json +94 -0
- package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
- package/src/conformance/notebook/module.ts +215 -0
- package/src/conformance/notebook/skills/meeting-notes.md +4 -0
- package/src/conformance/pad/app.ts +21 -0
- package/src/conformance/pad/contract.ts +69 -0
- package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
- package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
- package/src/conformance/pad/schema.ts +18 -0
- package/src/conformance/pad/server.ts +102 -0
- package/src/conformance/purchases/app.ts +34 -0
- package/src/conformance/purchases/contract.ts +161 -0
- package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
- package/src/conformance/purchases/server.ts +95 -0
- package/src/conformance/replica-search.mjs +22 -0
- package/src/conformance/studio/app.ts +298 -0
- package/src/conformance/studio/contract.ts +319 -0
- package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
- package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
- package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
- package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
- package/src/conformance/workshop/app.ts +14 -0
- package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
- package/src/conformance/workshop/module.ts +79 -0
- package/src/fakes/AcmeFake.ts +182 -0
- package/src/fakes/ApnsFake.ts +245 -0
- package/src/fakes/FcmFake.ts +231 -0
- package/src/fakes/GoogleFake.ts +1346 -0
- package/src/fakes/HttpApiFake.ts +116 -0
- package/src/fakes/McpFake.ts +355 -0
- package/src/fakes/MicrosoftGraphFake.ts +1191 -0
- package/src/fakes/S3Fake.ts +376 -0
- package/src/fakes/Server.ts +445 -0
- package/src/fakes/SignInProviderFake.ts +70 -0
- package/src/fakes/SlackFake.ts +893 -0
- package/src/fakes/Store.ts +96 -0
- package/src/fakes/TelemetryFakes.ts +197 -0
- package/src/fakes/TestCa.ts +166 -0
- package/src/fakes/WorkOsFake.ts +136 -0
- package/src/index.ts +9 -0
- package/src/make/reference.ts +259 -0
- package/src/make/sources.ts +836 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MailProvider conformance kit (docs/contracts/mail-provider.md). `mailProviderConformance(harness)`
|
|
3
|
+
* registers, for a connector over a Connection: the operations it claims (folders, list, get, send, draft,
|
|
4
|
+
* mark read, delete, the addresses it sends as), delta sync of the inbox (exact changes including deletes, resume after a crash,
|
|
5
|
+
* InvalidCursor), the 401 and 403 rules, refresh, rate limiting, and merged scopes with Calendar.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from "vitest"
|
|
8
|
+
import {
|
|
9
|
+
callValid,
|
|
10
|
+
connectionChecks,
|
|
11
|
+
deltaChecks,
|
|
12
|
+
failed,
|
|
13
|
+
ok,
|
|
14
|
+
withWritesRefusedAfter,
|
|
15
|
+
type CallResult,
|
|
16
|
+
type ProviderHarness,
|
|
17
|
+
} from "./CapabilityKit.ts"
|
|
18
|
+
|
|
19
|
+
export type { ProviderHarness } from "./CapabilityKit.ts"
|
|
20
|
+
|
|
21
|
+
const waitFor = async <A>(check: () => Promise<A | undefined>, what: string, timeoutMs = 10_000): Promise<A> => {
|
|
22
|
+
const deadline = Date.now() + timeoutMs
|
|
23
|
+
for (;;) {
|
|
24
|
+
const found = await check()
|
|
25
|
+
if (found !== undefined) return found
|
|
26
|
+
if (Date.now() > deadline) throw new Error(`Timed out waiting for ${what}`)
|
|
27
|
+
await new Promise((r) => setTimeout(r, 250))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const mailProviderConformance = (harness: () => ProviderHarness) =>
|
|
32
|
+
describe(`MailProvider conformance`, () => {
|
|
33
|
+
const inbox = async (connection: string) => {
|
|
34
|
+
const folders = ok(await callValid(harness(), connection, "mail", "listFolders", {})).folders as ReadonlyArray<{
|
|
35
|
+
id: string
|
|
36
|
+
kind: string
|
|
37
|
+
}>
|
|
38
|
+
return folders
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
it("lists folders, including the inbox, the sent items and the trash", async () => {
|
|
42
|
+
const h = harness()
|
|
43
|
+
const connection = await h.connect(["mail"])
|
|
44
|
+
const kinds = (await inbox(connection)).map((f) => f.kind)
|
|
45
|
+
for (const kind of ["inbox", "sent", "trash"]) expect(kinds).toContain(kind)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("lists the addresses the account sends as, its own the default, and refuses to send as any other", async () => {
|
|
49
|
+
const h = harness()
|
|
50
|
+
const connection = await h.connect(["mail"])
|
|
51
|
+
const aliases = ok(await callValid(h, connection, "mail", "listAliases", {})).aliases as ReadonlyArray<{
|
|
52
|
+
address: string
|
|
53
|
+
isDefault: boolean
|
|
54
|
+
}>
|
|
55
|
+
const own = aliases.find((a) => a.address.toLowerCase() === h.selfAddress.toLowerCase())
|
|
56
|
+
expect(own?.isDefault).toBe(true)
|
|
57
|
+
const subject = `not an alias ${crypto.randomUUID()}`
|
|
58
|
+
const refused = await h.call(connection, "mail", "sendMessage", {
|
|
59
|
+
to: [{ name: null, address: h.selfAddress }],
|
|
60
|
+
subject,
|
|
61
|
+
body: { contentType: "text", content: "never sent" },
|
|
62
|
+
from: { name: null, address: `someone-else-${crypto.randomUUID().slice(0, 8)}@example.com` },
|
|
63
|
+
})
|
|
64
|
+
expect(refused.ok ? "sent" : refused.error._tag).toMatch(/^(InvalidInput|Forbidden)$/u)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it("sends a message, finds it in the inbox, reads it, marks it read, saves a draft, and deletes it", async () => {
|
|
68
|
+
const h = harness()
|
|
69
|
+
const connection = await h.connect(["mail"])
|
|
70
|
+
const flags = await h.flags(connection, "mail")
|
|
71
|
+
const subject = `conformance ${crypto.randomUUID()}`
|
|
72
|
+
ok(
|
|
73
|
+
await callValid(h, connection, "mail", "sendMessage", {
|
|
74
|
+
to: [{ name: null, address: h.selfAddress }],
|
|
75
|
+
subject,
|
|
76
|
+
body: { contentType: "text", content: "Hello from the MailProvider kit" },
|
|
77
|
+
}),
|
|
78
|
+
)
|
|
79
|
+
const listed = await waitFor(async () => {
|
|
80
|
+
const page = ok(await callValid(h, connection, "mail", "listMessages", { pageSize: 50 }))
|
|
81
|
+
return (page.messages as ReadonlyArray<{ id: string; subject: string; isRead: boolean }>).find(
|
|
82
|
+
(m) => m.subject === subject,
|
|
83
|
+
)
|
|
84
|
+
}, "the sent message in the inbox")
|
|
85
|
+
expect(listed.isRead).toBe(false)
|
|
86
|
+
const message = ok(await callValid(h, connection, "mail", "getMessage", { id: listed.id }))
|
|
87
|
+
expect(message.subject).toBe(subject)
|
|
88
|
+
expect(message.body?.content).toContain("Hello from the MailProvider kit")
|
|
89
|
+
|
|
90
|
+
const read = ok(await callValid(h, connection, "mail", "updateMessage", { id: listed.id, isRead: true }))
|
|
91
|
+
expect(read.isRead).toBe(true)
|
|
92
|
+
// The provider's version of the message, when it gives one, moves when the message changes.
|
|
93
|
+
const reread = ok(await callValid(h, connection, "mail", "getMessage", { id: listed.id }))
|
|
94
|
+
expect(reread.version === undefined || reread.version === null || reread.version !== message.version).toBe(true)
|
|
95
|
+
|
|
96
|
+
const draft =
|
|
97
|
+
flags["drafts"] === true
|
|
98
|
+
? ok(
|
|
99
|
+
await callValid(h, connection, "mail", "createDraft", {
|
|
100
|
+
to: [{ name: null, address: h.selfAddress }],
|
|
101
|
+
subject: `${subject} (draft)`,
|
|
102
|
+
body: { contentType: "text", content: "draft" },
|
|
103
|
+
}),
|
|
104
|
+
)
|
|
105
|
+
: { isDraft: true }
|
|
106
|
+
expect(draft.isDraft).toBe(true)
|
|
107
|
+
|
|
108
|
+
ok(await callValid(h, connection, "mail", "deleteMessage", { id: listed.id }))
|
|
109
|
+
const after = ok(await callValid(h, connection, "mail", "listMessages", { pageSize: 50 }))
|
|
110
|
+
expect((after.messages as ReadonlyArray<{ id: string }>).map((m) => m.id)).not.toContain(listed.id)
|
|
111
|
+
const trash = (await inbox(connection)).find((f) => f.kind === "trash")!
|
|
112
|
+
const gone = await h.call(connection, "mail", "getMessage", { id: listed.id })
|
|
113
|
+
// Deleted mail moves to the trash (or is gone).
|
|
114
|
+
expect(
|
|
115
|
+
gone.ok ? (gone.value.folderIds as ReadonlyArray<string>).includes(trash.id) : gone.error._tag === "NotFound",
|
|
116
|
+
).toBe(true)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it("archives a message: it leaves the inbox and stays readable, not deleted", async () => {
|
|
120
|
+
const h = harness()
|
|
121
|
+
const connection = await h.connect(["mail"])
|
|
122
|
+
const seeds = h.seeds.mail
|
|
123
|
+
if (seeds === undefined || seeds.readOnly === true) throw new Error("The harness has no writable mail seeds")
|
|
124
|
+
const id = await seeds.create(`archive ${crypto.randomUUID()}`)
|
|
125
|
+
const folders = await inbox(connection)
|
|
126
|
+
const inboxId = folders.find((f) => f.kind === "inbox")!.id
|
|
127
|
+
const trashId = folders.find((f) => f.kind === "trash")!.id
|
|
128
|
+
const archived = ok(await callValid(h, connection, "mail", "updateMessage", { id, archive: true }))
|
|
129
|
+
expect(archived.folderIds).not.toContain(inboxId)
|
|
130
|
+
expect(archived.folderIds).not.toContain(trashId)
|
|
131
|
+
const read = ok(await callValid(h, connection, "mail", "getMessage", { id }))
|
|
132
|
+
expect(read.folderIds).not.toContain(inboxId)
|
|
133
|
+
const listed = ok(await callValid(h, connection, "mail", "listMessages", { pageSize: 50 }))
|
|
134
|
+
expect((listed.messages as ReadonlyArray<{ id: string }>).map((m) => m.id)).not.toContain(id)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it("finds a sent message by the client id it was sent with (bounded by when it was sent, or not), and not one never sent", async () => {
|
|
138
|
+
const h = harness()
|
|
139
|
+
const connection = await h.connect(["mail"])
|
|
140
|
+
const clientId = `kit-${crypto.randomUUID()}`
|
|
141
|
+
// As the kernel's reconciliation asks: no further back than before the send was made.
|
|
142
|
+
const sentAfter = new Date().toISOString()
|
|
143
|
+
ok(
|
|
144
|
+
await callValid(h, connection, "mail", "sendMessage", {
|
|
145
|
+
to: [{ name: null, address: h.selfAddress }],
|
|
146
|
+
subject: `findSent ${clientId}`,
|
|
147
|
+
body: { contentType: "text", content: "reconcile me" },
|
|
148
|
+
clientId,
|
|
149
|
+
}),
|
|
150
|
+
)
|
|
151
|
+
const found = await waitFor(async () => {
|
|
152
|
+
const answer = ok(await callValid(h, connection, "mail", "findSent", { clientId, sentAfter }))
|
|
153
|
+
return answer.found === true ? answer : undefined
|
|
154
|
+
}, "the sent message by its client id")
|
|
155
|
+
expect(found.id).not.toBeNull()
|
|
156
|
+
// Without the bound too (the newest sent message: a short look on any account).
|
|
157
|
+
expect(ok(await callValid(h, connection, "mail", "findSent", { clientId }))).toEqual(found)
|
|
158
|
+
const absent = ok(
|
|
159
|
+
await callValid(h, connection, "mail", "findSent", { clientId: `kit-${crypto.randomUUID()}`, sentAfter }),
|
|
160
|
+
)
|
|
161
|
+
expect(absent).toEqual({ found: false, id: null })
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it("never hides a write: refused after it writes, a draft, a change, a send or a delete answers or is Unavailable, never a refusal", async (context) => {
|
|
165
|
+
const h = harness()
|
|
166
|
+
if (h.controls?.throttleAfterWrite === undefined) {
|
|
167
|
+
context.skip()
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
const connection = await h.connect(["mail"])
|
|
171
|
+
const flags = await h.flags(connection, "mail")
|
|
172
|
+
const subject = `after write ${crypto.randomUUID()}`
|
|
173
|
+
const draft = {
|
|
174
|
+
to: [{ name: null, address: h.selfAddress }],
|
|
175
|
+
subject,
|
|
176
|
+
body: { contentType: "text", content: "x" },
|
|
177
|
+
}
|
|
178
|
+
const results: Array<CallResult | undefined> = []
|
|
179
|
+
if (flags["drafts"] === true) {
|
|
180
|
+
results.push(
|
|
181
|
+
await withWritesRefusedAfter(h, connection, () => callValid(h, connection, "mail", "createDraft", draft)),
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
results.push(
|
|
185
|
+
await withWritesRefusedAfter(h, connection, () => callValid(h, connection, "mail", "sendMessage", draft)),
|
|
186
|
+
)
|
|
187
|
+
const listed = await waitFor(async () => {
|
|
188
|
+
const page = ok(await callValid(h, connection, "mail", "listMessages", { pageSize: 50 }))
|
|
189
|
+
return (page.messages as ReadonlyArray<{ id: string; subject: string }>).find((m) => m.subject === subject)
|
|
190
|
+
}, "the sent message in the inbox")
|
|
191
|
+
results.push(
|
|
192
|
+
await withWritesRefusedAfter(h, connection, () =>
|
|
193
|
+
callValid(h, connection, "mail", "updateMessage", { id: listed.id, isRead: true, archive: true }),
|
|
194
|
+
),
|
|
195
|
+
await withWritesRefusedAfter(h, connection, () =>
|
|
196
|
+
callValid(h, connection, "mail", "deleteMessage", { id: listed.id }),
|
|
197
|
+
),
|
|
198
|
+
)
|
|
199
|
+
// Each answered or Unavailable (checked as it ran); a draft answered is a draft.
|
|
200
|
+
expect(results.map((r) => (r === undefined ? "?" : r.ok ? "answered" : r.error._tag))).not.toContain("?")
|
|
201
|
+
const madeDraft = flags["drafts"] === true ? results[0] : undefined
|
|
202
|
+
expect(madeDraft?.ok === true ? madeDraft.value.isDraft : true).toBe(true)
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
it("reports NotFound for a message that does not exist", async () => {
|
|
206
|
+
const h = harness()
|
|
207
|
+
const connection = await h.connect(["mail"])
|
|
208
|
+
expect(failed(await h.call(connection, "mail", "getMessage", { id: "does-not-exist" }))._tag).toBe("NotFound")
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
deltaChecks(harness, { capability: "mail" })
|
|
212
|
+
connectionChecks(harness, {
|
|
213
|
+
capability: "mail",
|
|
214
|
+
probe: { operation: "listMessages", input: { pageSize: 1 } },
|
|
215
|
+
other: "calendar",
|
|
216
|
+
})
|
|
217
|
+
})
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conformance kit for the Memory contract (docs/contracts/memory.md) on the agent conformance app.
|
|
3
|
+
*
|
|
4
|
+
* Memory entries are written and removed through actions (agent-originated when the agent calls them, so
|
|
5
|
+
* policy and audit apply), scoped to a person or the organisation, and given to the agent in every
|
|
6
|
+
* conversation; another person never sees them. Compaction keeps a long conversation within its budget while
|
|
7
|
+
* the facts it summarises stay in what the model is sent, with provenance (the covered messages are kept).
|
|
8
|
+
*
|
|
9
|
+
* The subject must run with a small conversation budget: `budgets.messages` 900 tokens and
|
|
10
|
+
* `keepRecentMessages` 2 (see `packages/testing/test/agent-memory.test.ts`).
|
|
11
|
+
*
|
|
12
|
+
* Usage, in a Vitest file: `memoryConformance(() => startMyKernel())`.
|
|
13
|
+
*/
|
|
14
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest"
|
|
15
|
+
import { byUserMessage } from "../Agent.ts"
|
|
16
|
+
import { unique, type AgentPerson, type AgentSubject, type StartAgentSubject } from "./AgentSubject.ts"
|
|
17
|
+
|
|
18
|
+
export const MEMORY_SUBJECT_SETTINGS = { budgets: { messages: 900 }, keepRecentMessages: 2, reflectAbove: 300 } as const
|
|
19
|
+
|
|
20
|
+
export const memoryConformance = (start: StartAgentSubject) =>
|
|
21
|
+
describe("Memory contract", () => {
|
|
22
|
+
let s: AgentSubject
|
|
23
|
+
let ada: AgentPerson
|
|
24
|
+
let ben: AgentPerson
|
|
25
|
+
let root: AgentPerson
|
|
26
|
+
|
|
27
|
+
beforeAll(async () => {
|
|
28
|
+
s = await start()
|
|
29
|
+
ada = await s.person("ada")
|
|
30
|
+
ben = await s.person("ben")
|
|
31
|
+
root = await s.person("root", { roles: ["admin"] })
|
|
32
|
+
}, 120_000)
|
|
33
|
+
afterAll(() => s?.dispose())
|
|
34
|
+
|
|
35
|
+
const memoryOf = async (person: AgentPerson) =>
|
|
36
|
+
(await s.get(person, "/agent/memory")).result as ReadonlyArray<{
|
|
37
|
+
id: string
|
|
38
|
+
scope: string
|
|
39
|
+
key: string
|
|
40
|
+
content: string
|
|
41
|
+
userId: string | null
|
|
42
|
+
}>
|
|
43
|
+
|
|
44
|
+
it("lets the agent remember for the person through a tool, audited as the agent's, and recalls it in later conversations", async () => {
|
|
45
|
+
const fact = unique("prefers-tea")
|
|
46
|
+
s.script(
|
|
47
|
+
byUserMessage({
|
|
48
|
+
"Remember I prefer tea": [
|
|
49
|
+
{ toolCalls: [{ tool: "agent_remember", input: { scope: "user", key: "drink", content: fact } }] },
|
|
50
|
+
{ text: "Noted." },
|
|
51
|
+
],
|
|
52
|
+
}),
|
|
53
|
+
)
|
|
54
|
+
const sent = await s.send(ada, "Remember I prefer tea")
|
|
55
|
+
await s.waitRun(ada, sent.runId)
|
|
56
|
+
const mine = await memoryOf(ada)
|
|
57
|
+
expect(mine.find((m) => m.key === "drink")).toMatchObject({ scope: "user", content: fact, userId: ada.id })
|
|
58
|
+
const audit = (await s.audit({})).filter((r) => r.action === "agent.remember")
|
|
59
|
+
expect(audit.map((r) => [r.surface, r.actorUserId, r.outcome])).toContainEqual(["agent", ada.id, "succeeded"])
|
|
60
|
+
|
|
61
|
+
// A new conversation is given the entry.
|
|
62
|
+
s.script(byUserMessage({}, { text: "ok" }))
|
|
63
|
+
const later = await s.send(ada, "What do I drink?")
|
|
64
|
+
await s.waitRun(ada, later.runId)
|
|
65
|
+
expect(
|
|
66
|
+
s
|
|
67
|
+
.calls()
|
|
68
|
+
.at(-1)!
|
|
69
|
+
.seen.system.some((text) => text.includes(fact)),
|
|
70
|
+
).toBe(true)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it("scopes memory per person: another person's agent is never given it, and cannot change or remove it", async () => {
|
|
74
|
+
const secret = unique("ada-secret")
|
|
75
|
+
await s.invoke(ada, "agent.remember", { scope: "user", key: "secret", content: secret })
|
|
76
|
+
const entry = (await memoryOf(ada)).find((m) => m.key === "secret")!
|
|
77
|
+
expect((await memoryOf(ben)).some((m) => m.content === secret)).toBe(false)
|
|
78
|
+
|
|
79
|
+
s.script(
|
|
80
|
+
byUserMessage({
|
|
81
|
+
"Forget Ada's secret": [
|
|
82
|
+
{ toolCalls: [{ tool: "agent_forget", input: { id: entry.id } }] },
|
|
83
|
+
{ text: "tried" },
|
|
84
|
+
],
|
|
85
|
+
}),
|
|
86
|
+
)
|
|
87
|
+
const sent = await s.send(ben, "Forget Ada's secret")
|
|
88
|
+
await s.waitRun(ben, sent.runId)
|
|
89
|
+
expect(
|
|
90
|
+
s
|
|
91
|
+
.calls()
|
|
92
|
+
.every(
|
|
93
|
+
(call) => call.seen.lastUser !== "Forget Ada's secret" || !call.seen.system.some((t) => t.includes(secret)),
|
|
94
|
+
),
|
|
95
|
+
).toBe(true)
|
|
96
|
+
const result = (await s.follow(ben, sent.runId)).find((e) => e.type === "tool-result")!
|
|
97
|
+
expect((result.data as { error: string }).error).toBe("Forbidden")
|
|
98
|
+
expect((await memoryOf(ada)).some((m) => m.id === entry.id)).toBe(true)
|
|
99
|
+
// Ben writing the same key writes his own entry, never Ada's.
|
|
100
|
+
await s.invoke(ben, "agent.remember", { scope: "user", key: "secret", content: "ben's" })
|
|
101
|
+
expect((await memoryOf(ada)).find((m) => m.key === "secret")?.content).toBe(secret)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
it("keeps organisation memory for members who manage the agent, and gives it to every member", async () => {
|
|
105
|
+
const policy = unique("expenses-policy")
|
|
106
|
+
expect((await s.invoke(ada, "agent.remember", { scope: "org", key: "policy", content: policy })).ok).toBe(false)
|
|
107
|
+
expect((await s.invoke(root, "agent.remember", { scope: "org", key: "policy", content: policy })).ok).toBe(true)
|
|
108
|
+
expect((await memoryOf(ada)).some((m) => m.scope === "org" && m.content === policy)).toBe(true)
|
|
109
|
+
expect((await memoryOf(ben)).some((m) => m.scope === "org" && m.content === policy)).toBe(true)
|
|
110
|
+
const entry = (await memoryOf(ben)).find((m) => m.content === policy)!
|
|
111
|
+
expect((await s.invoke(ben, "agent.forget", { id: entry.id })).ok).toBe(false)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it("compacts a long conversation into a summary that keeps the run within budget and the facts in context, with provenance", async () => {
|
|
115
|
+
const code = String(1000 + Math.floor(Math.random() * 9000))
|
|
116
|
+
const filler =
|
|
117
|
+
"This is a long message about the weather and nothing in particular, repeated to fill the context. ".repeat(4)
|
|
118
|
+
s.script((prompt) => {
|
|
119
|
+
if (prompt.compaction) return { text: "" }
|
|
120
|
+
if (prompt.lastUser === "What is the launch code?") {
|
|
121
|
+
const all = prompt.prompt
|
|
122
|
+
.map((m) => (typeof m.content === "string" ? m.content : JSON.stringify(m.content)))
|
|
123
|
+
.join("\n")
|
|
124
|
+
const found = /launch code is (\d{4})/u.exec(all)
|
|
125
|
+
return { text: found === null ? "I do not know." : `The launch code is ${found[1]}.` }
|
|
126
|
+
}
|
|
127
|
+
return { text: `Understood. ${filler}` }
|
|
128
|
+
})
|
|
129
|
+
const first = await s.send(ada, `Please keep this: the launch code is ${code}.`)
|
|
130
|
+
await s.waitRun(ada, first.runId)
|
|
131
|
+
const conversationId = first.conversationId
|
|
132
|
+
for (let i = 0; i < 6; i++) {
|
|
133
|
+
const next = await s.send(ada, `Message ${i}. ${filler}`, conversationId)
|
|
134
|
+
await s.waitRun(ada, next.runId)
|
|
135
|
+
}
|
|
136
|
+
const ask = await s.send(ada, "What is the launch code?", conversationId)
|
|
137
|
+
const run = await s.waitRun(ada, ask.runId)
|
|
138
|
+
expect(run.result).toBe(`The launch code is ${code}.`)
|
|
139
|
+
|
|
140
|
+
// Every model call of the conversation stayed within its budget (with the recent messages' margin).
|
|
141
|
+
const calls = s.calls().filter((c) => !c.seen.compaction && c.options.prompt.some((m) => m.role === "user"))
|
|
142
|
+
const inventory = await s.inventory(ada, ask.runId)
|
|
143
|
+
const conversationTokens = (inventory.totals["messages"] ?? 0) + (inventory.totals["tool-results"] ?? 0)
|
|
144
|
+
expect(conversationTokens).toBeLessThanOrEqual(inventory.budgets["messages"]!)
|
|
145
|
+
expect(calls.length).toBeGreaterThan(0)
|
|
146
|
+
// Folds replaced the old messages: they are kept, each marked as covered by a fold that lists it.
|
|
147
|
+
const folds = await s.sql<{ id: string; covered_by: string | null; content: { covers: string[] } }>(
|
|
148
|
+
`SELECT id, covered_by, content FROM eloxiv_agent.message WHERE conversation_id = $1 AND role = 'summary'`,
|
|
149
|
+
[conversationId],
|
|
150
|
+
)
|
|
151
|
+
const current = folds.filter((f) => f.covered_by === null)
|
|
152
|
+
expect(current.length).toBeGreaterThan(0)
|
|
153
|
+
const covered = await s.sql<{ id: string; covered_by: string | null }>(
|
|
154
|
+
`SELECT id, covered_by FROM eloxiv_agent.message WHERE conversation_id = $1 AND covered_by IS NOT NULL AND role <> 'summary'`,
|
|
155
|
+
[conversationId],
|
|
156
|
+
)
|
|
157
|
+
expect(covered.length).toBeGreaterThan(0)
|
|
158
|
+
for (const message of covered) {
|
|
159
|
+
expect(folds.find((f) => f.id === message.covered_by)?.content.covers).toContain(message.id)
|
|
160
|
+
}
|
|
161
|
+
for (const fold of current) expect(inventory.items.some((item) => item.ref === `message:${fold.id}`)).toBe(true)
|
|
162
|
+
// Some run of the conversation announced the compaction on its event stream.
|
|
163
|
+
const types = await s.sql<{ type: string }>(
|
|
164
|
+
`SELECT e.type FROM eloxiv_agent.run_event e JOIN eloxiv_agent.run r ON r.id = e.run_id WHERE r.conversation_id = $1`,
|
|
165
|
+
[conversationId],
|
|
166
|
+
)
|
|
167
|
+
expect(types.map((e) => e.type)).toContain("compacted")
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it("folds a long conversation in three tiers: recent messages raw, dated observations, and a reflection over them, each keeping what it covers", async () => {
|
|
171
|
+
const word = `kestrel-${String(1000 + Math.floor(Math.random() * 9000))}`
|
|
172
|
+
const filler = "A long remark about the garden and the weather, repeated to fill the context. ".repeat(4)
|
|
173
|
+
s.script((prompt) => {
|
|
174
|
+
if (prompt.compaction) return { text: "" }
|
|
175
|
+
if (prompt.lastUser === "Which bird did I name first?") {
|
|
176
|
+
const all = JSON.stringify(prompt.prompt)
|
|
177
|
+
const found = /the bird is (kestrel-\d{4})/u.exec(all)
|
|
178
|
+
return { text: found === null ? "I do not know." : `You named ${found[1]}.` }
|
|
179
|
+
}
|
|
180
|
+
return { text: `Noted. ${filler}` }
|
|
181
|
+
})
|
|
182
|
+
const first = await s.send(ada, `Remember that the bird is ${word}.`)
|
|
183
|
+
await s.waitRun(ada, first.runId)
|
|
184
|
+
const conversationId = first.conversationId
|
|
185
|
+
for (let i = 0; i < 10; i++)
|
|
186
|
+
await s.waitRun(ada, (await s.send(ada, `Turn ${i}. ${filler}`, conversationId)).runId)
|
|
187
|
+
const ask = await s.send(ada, "Which bird did I name first?", conversationId)
|
|
188
|
+
expect((await s.waitRun(ada, ask.runId)).result).toBe(`You named ${word}.`)
|
|
189
|
+
|
|
190
|
+
const folds = await s.sql<{
|
|
191
|
+
id: string
|
|
192
|
+
covered_by: string | null
|
|
193
|
+
content: { tier: string; covers: string[]; from: string | null; to: string | null }
|
|
194
|
+
}>(`SELECT id, covered_by, content FROM eloxiv_agent.message WHERE conversation_id = $1 AND role = 'summary'`, [
|
|
195
|
+
conversationId,
|
|
196
|
+
])
|
|
197
|
+
const observations = folds.filter((f) => f.content.tier === "observation")
|
|
198
|
+
const reflections = folds.filter((f) => f.content.tier === "reflection")
|
|
199
|
+
// Observations: dated, each covering raw messages; a reflection covering observations.
|
|
200
|
+
expect(observations.length).toBeGreaterThan(1)
|
|
201
|
+
for (const o of observations)
|
|
202
|
+
expect(o.content.from !== null && o.content.to !== null && o.content.from <= o.content.to).toBe(true)
|
|
203
|
+
expect(reflections.length).toBeGreaterThan(0)
|
|
204
|
+
const reflection = reflections.find((r) => r.covered_by === null)!
|
|
205
|
+
const reflected = observations.filter((o) => o.covered_by === reflection.id)
|
|
206
|
+
expect(reflected.length).toBeGreaterThan(0)
|
|
207
|
+
expect(reflection.content.covers).toEqual(expect.arrayContaining(reflected.map((o) => o.id)))
|
|
208
|
+
// Provenance down to the raw messages: each covered message is listed by the observation that covers it.
|
|
209
|
+
const raw = await s.sql<{ id: string; covered_by: string | null }>(
|
|
210
|
+
`SELECT id, covered_by FROM eloxiv_agent.message WHERE conversation_id = $1 AND role <> 'summary' ORDER BY seq`,
|
|
211
|
+
[conversationId],
|
|
212
|
+
)
|
|
213
|
+
for (const message of raw.filter((m) => m.covered_by !== null)) {
|
|
214
|
+
expect(observations.find((o) => o.id === message.covered_by)?.content.covers).toContain(message.id)
|
|
215
|
+
}
|
|
216
|
+
// The recent messages stay raw, verbatim, and the model was given the reflection, the observations after it and
|
|
217
|
+
// those recent messages.
|
|
218
|
+
const last = s.calls().findLast((c) => c.seen.lastUser === "Which bird did I name first?")!
|
|
219
|
+
expect(raw.slice(-2).every((m) => m.covered_by === null)).toBe(true)
|
|
220
|
+
expect(last.seen.system.some((t) => t.startsWith("Reflection on the earlier conversation"))).toBe(true)
|
|
221
|
+
expect(JSON.stringify(last.seen.prompt)).toContain("Which bird did I name first?")
|
|
222
|
+
})
|
|
223
|
+
})
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Messaging conformance kit (docs/contracts/messaging.md). `messagingConformance(subject)` registers, for a
|
|
3
|
+
* channel connector over a Connection: channels, posting a message and replying in its thread, reading a
|
|
4
|
+
* thread back, parsing the platform's deliveries (messages, and null for anything else), and receiving a
|
|
5
|
+
* message through Ingress as the sender's linked actor, with an unlinked sender never acting.
|
|
6
|
+
*
|
|
7
|
+
* The Eloxiv kernel runs it against the reference `acme` connector over the acme protocol fake (the contract and
|
|
8
|
+
* the kernel's receive path), and against the `slack` registry connector over the Slack protocol fake and, when
|
|
9
|
+
* configured, a real Slack workspace (registry/test/connector-slack.test.ts, connector-slack-live.test.ts).
|
|
10
|
+
*/
|
|
11
|
+
import { describe, expect, it } from "vitest"
|
|
12
|
+
import { failed, ok, type CallResult } from "./CapabilityKit.ts"
|
|
13
|
+
import type { ConnectorUser } from "./ConnectorReference.ts"
|
|
14
|
+
|
|
15
|
+
export interface MessagingEvent {
|
|
16
|
+
readonly user: string
|
|
17
|
+
readonly channel: string
|
|
18
|
+
readonly text: string
|
|
19
|
+
readonly thread?: string | null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface MessagingSubject {
|
|
23
|
+
/** The kernel's base URL. */
|
|
24
|
+
readonly url: string
|
|
25
|
+
readonly owner: ConnectorUser
|
|
26
|
+
/** The platform Ingress links identities for (`createLinkCode`'s `platform`). */
|
|
27
|
+
readonly platform: string
|
|
28
|
+
/** A Connection of the owner to the platform (through the consent flow, or imported for a live run). */
|
|
29
|
+
readonly connect: () => Promise<string>
|
|
30
|
+
/** One capability operation over a Connection, as `user`. */
|
|
31
|
+
readonly call: (
|
|
32
|
+
connectionId: string,
|
|
33
|
+
user: ConnectorUser,
|
|
34
|
+
capability: "messaging",
|
|
35
|
+
operation: string,
|
|
36
|
+
input: unknown,
|
|
37
|
+
) => Promise<CallResult>
|
|
38
|
+
/** The channel the kit posts in and receives from (one the app is in). */
|
|
39
|
+
readonly channel: string
|
|
40
|
+
/** A channel id that does not exist on the platform. */
|
|
41
|
+
readonly unknownChannel: string
|
|
42
|
+
/** A delivery body from the platform for a message event, as it would send it (for parsing only). */
|
|
43
|
+
readonly event: (event: MessagingEvent) => { readonly body: string }
|
|
44
|
+
/** The platform's identity of a platform user id (what Ingress links). */
|
|
45
|
+
readonly externalId: (user: string) => string
|
|
46
|
+
/** Platform users: one who links their identity, and one who never does. */
|
|
47
|
+
readonly users: { readonly linked: string; readonly unlinked: string }
|
|
48
|
+
/**
|
|
49
|
+
* A platform user's message reaching the kernel's Ingress source, as the platform delivers it (a signed POST,
|
|
50
|
+
* or the user posting on the real platform). Resolves once the platform's delivery has been answered.
|
|
51
|
+
*/
|
|
52
|
+
readonly deliver: (event: MessagingEvent) => Promise<void>
|
|
53
|
+
/** Whether `externalId` is linked to an actor. */
|
|
54
|
+
readonly isLinked: (externalId: string) => Promise<boolean>
|
|
55
|
+
/** The messages the receiving module recorded, with the actor that recorded each. */
|
|
56
|
+
readonly received: () => Promise<
|
|
57
|
+
ReadonlyArray<{ readonly ownerId: string; readonly text: string; readonly thread: string | null }>
|
|
58
|
+
>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const waitFor = async <A>(check: () => Promise<A | undefined>, what: string, timeoutMs = 30_000): Promise<A> => {
|
|
62
|
+
const deadline = Date.now() + timeoutMs
|
|
63
|
+
for (;;) {
|
|
64
|
+
const found = await check()
|
|
65
|
+
if (found !== undefined) return found
|
|
66
|
+
if (Date.now() > deadline) throw new Error(`Timed out waiting for ${what}`)
|
|
67
|
+
await new Promise((r) => setTimeout(r, 200))
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const tag = () => crypto.randomUUID().slice(0, 8)
|
|
72
|
+
|
|
73
|
+
export const messagingConformance = (subject: () => MessagingSubject) =>
|
|
74
|
+
describe("Messaging conformance", () => {
|
|
75
|
+
it("lists channels, posts a message, replies in its thread and reads the thread back", async () => {
|
|
76
|
+
const s = subject()
|
|
77
|
+
const id = await s.connect()
|
|
78
|
+
const channels = ok(await s.call(id, s.owner, "messaging", "listChannels", {})).channels as ReadonlyArray<{
|
|
79
|
+
id: string
|
|
80
|
+
isMember: boolean
|
|
81
|
+
}>
|
|
82
|
+
expect(channels.find((c) => c.id === s.channel)?.isMember).toBe(true)
|
|
83
|
+
const run = tag()
|
|
84
|
+
const root = ok(
|
|
85
|
+
await s.call(id, s.owner, "messaging", "sendMessage", { channelId: s.channel, text: `kit ${run}: root` }),
|
|
86
|
+
)
|
|
87
|
+
expect(root.threadId).toBeNull()
|
|
88
|
+
const reply = ok(
|
|
89
|
+
await s.call(id, s.owner, "messaging", "sendMessage", {
|
|
90
|
+
channelId: s.channel,
|
|
91
|
+
threadId: root.id,
|
|
92
|
+
text: `kit ${run}: reply`,
|
|
93
|
+
}),
|
|
94
|
+
)
|
|
95
|
+
expect(reply.threadId).toBe(root.id)
|
|
96
|
+
const thread = ok(
|
|
97
|
+
await s.call(id, s.owner, "messaging", "listMessages", { channelId: s.channel, threadId: root.id }),
|
|
98
|
+
)
|
|
99
|
+
expect((thread.messages as ReadonlyArray<{ text: string }>).map((m) => m.text)).toEqual([
|
|
100
|
+
`kit ${run}: root`,
|
|
101
|
+
`kit ${run}: reply`,
|
|
102
|
+
])
|
|
103
|
+
const recent = ok(await s.call(id, s.owner, "messaging", "listMessages", { channelId: s.channel, pageSize: 20 }))
|
|
104
|
+
const texts = (recent.messages as ReadonlyArray<{ text: string }>).map((m) => m.text)
|
|
105
|
+
expect(texts).toContain(`kit ${run}: root`)
|
|
106
|
+
expect(texts, "a channel's messages leave thread replies in their thread").not.toContain(`kit ${run}: reply`)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it("reports NotFound for a channel that does not exist", async () => {
|
|
110
|
+
const s = subject()
|
|
111
|
+
const id = await s.connect()
|
|
112
|
+
expect(
|
|
113
|
+
failed(await s.call(id, s.owner, "messaging", "sendMessage", { channelId: s.unknownChannel, text: "x" }))._tag,
|
|
114
|
+
).toBe("NotFound")
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it("parses a delivery into a message naming its sender's platform identity, and anything else into null", async () => {
|
|
118
|
+
const s = subject()
|
|
119
|
+
const id = await s.connect()
|
|
120
|
+
const delivery = s.event({ user: "U42", channel: "C1", text: "hello", thread: "1700000000.000100" })
|
|
121
|
+
const parsed = ok(
|
|
122
|
+
await s.call(id, s.owner, "messaging", "receive", {
|
|
123
|
+
source: "kit",
|
|
124
|
+
deliveryId: "d1",
|
|
125
|
+
body: delivery.body,
|
|
126
|
+
headers: {},
|
|
127
|
+
}),
|
|
128
|
+
)
|
|
129
|
+
expect(parsed.message).toMatchObject({ channelId: "C1", threadId: "1700000000.000100", text: "hello" })
|
|
130
|
+
expect(parsed.message.sender.externalId).toBe(s.externalId("U42"))
|
|
131
|
+
const other = ok(
|
|
132
|
+
await s.call(id, s.owner, "messaging", "receive", {
|
|
133
|
+
source: "kit",
|
|
134
|
+
deliveryId: "d2",
|
|
135
|
+
body: JSON.stringify({ type: "url_verification", challenge: "x" }),
|
|
136
|
+
headers: {},
|
|
137
|
+
}),
|
|
138
|
+
)
|
|
139
|
+
expect(other.message).toBeNull()
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it("receives a message through Ingress as the sender's linked actor; an unlinked sender never acts", async () => {
|
|
143
|
+
const s = subject()
|
|
144
|
+
const id = await s.connect()
|
|
145
|
+
const run = tag()
|
|
146
|
+
// The person links their platform identity: a one-time code, sent from the platform.
|
|
147
|
+
const linkResponse = await fetch(`${s.url}/kernel/ingress/createLinkCode`, {
|
|
148
|
+
method: "POST",
|
|
149
|
+
headers: {
|
|
150
|
+
authorization: `Bearer ${s.owner.session}`,
|
|
151
|
+
"x-eloxiv-org": s.owner.org,
|
|
152
|
+
"content-type": "application/json",
|
|
153
|
+
},
|
|
154
|
+
body: JSON.stringify({ platform: s.platform }),
|
|
155
|
+
})
|
|
156
|
+
expect(linkResponse.status).toBe(200)
|
|
157
|
+
const { code } = (await linkResponse.json()) as { code: string }
|
|
158
|
+
await s.deliver({ user: s.users.linked, channel: s.channel, text: `link ${code}` })
|
|
159
|
+
const linked = s.externalId(s.users.linked)
|
|
160
|
+
await waitFor(async () => ((await s.isLinked(linked)) ? true : undefined), "the link")
|
|
161
|
+
// A thread to reply in, started by the app.
|
|
162
|
+
const root = ok(
|
|
163
|
+
await s.call(id, s.owner, "messaging", "sendMessage", { channelId: s.channel, text: `kit ${run}: thread` }),
|
|
164
|
+
)
|
|
165
|
+
await s.deliver({ user: s.users.unlinked, channel: s.channel, text: `kit ${run}: from a stranger` })
|
|
166
|
+
await s.deliver({
|
|
167
|
+
user: s.users.linked,
|
|
168
|
+
channel: s.channel,
|
|
169
|
+
text: `kit ${run}: from the linked person`,
|
|
170
|
+
thread: root.id,
|
|
171
|
+
})
|
|
172
|
+
const recorded = await waitFor(async () => {
|
|
173
|
+
const rows = await s.received()
|
|
174
|
+
return rows.some((r) => r.text === `kit ${run}: from the linked person`) ? rows : undefined
|
|
175
|
+
}, "the linked person's message")
|
|
176
|
+
expect(recorded.find((r) => r.text === `kit ${run}: from the linked person`)).toEqual({
|
|
177
|
+
ownerId: s.owner.id,
|
|
178
|
+
text: `kit ${run}: from the linked person`,
|
|
179
|
+
thread: root.id,
|
|
180
|
+
})
|
|
181
|
+
expect(recorded.some((r) => r.text === `kit ${run}: from a stranger`)).toBe(false)
|
|
182
|
+
// Neither the link code nor the app's own post was recorded as anyone's message.
|
|
183
|
+
expect(recorded.some((r) => r.text.startsWith("link ") || r.text === `kit ${run}: thread`)).toBe(false)
|
|
184
|
+
})
|
|
185
|
+
})
|