@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,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent conformance fixture: a notebook of pages, private to their owner, written only through actions so
|
|
3
|
+
* every effect of an agent's tool call is a row (and an audit record) a test can count.
|
|
4
|
+
*
|
|
5
|
+
* - `notebook.write` creates a page; `notebook.tag` tags one (a target).
|
|
6
|
+
* - `notebook.tear` deletes one: destructive, so an agent's call needs the person's consent.
|
|
7
|
+
* - `notebook.seal` needs the `notebook.seal` permission, which members do not hold by default.
|
|
8
|
+
* - `notebook.count` counts the caller's pages (read-only); `notebook.retag` tags every page whose title starts
|
|
9
|
+
* with a prefix (an untargeted write), and returns its own receipt (`_receipt`) when no page matched.
|
|
10
|
+
* - The published query view `notebook.pages` lists the pages the caller may read.
|
|
11
|
+
* - A skill, `notebook.pages`, with eval cases.
|
|
12
|
+
*/
|
|
13
|
+
import { defineAction, defineModuleContract, WriteReceipt } from "@eloxiv/contracts"
|
|
14
|
+
import { defineEntity } from "@eloxiv/contracts/drizzle"
|
|
15
|
+
import { defineModule } from "@eloxiv/kernel"
|
|
16
|
+
import { boolean, pgSchema, text, timestamp } from "drizzle-orm/pg-core"
|
|
17
|
+
import { Effect, Schema } from "effect"
|
|
18
|
+
|
|
19
|
+
/** The module's table (Drizzle): the only declaration of its fields. Its migration creates it. */
|
|
20
|
+
export const pageTable = pgSchema("notebook").table("page", {
|
|
21
|
+
id: text("id").primaryKey(),
|
|
22
|
+
orgId: text("org_id").notNull(),
|
|
23
|
+
ownerId: text("owner_id").notNull(),
|
|
24
|
+
title: text("title").notNull(),
|
|
25
|
+
body: text("body").notNull().default(""),
|
|
26
|
+
tag: text("tag"),
|
|
27
|
+
sealed: boolean("sealed").notNull().default(false),
|
|
28
|
+
createdAt: timestamp("created_at", { withTimezone: true, mode: "string" }).notNull().defaultNow(),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export const page = defineEntity(pageTable, {
|
|
32
|
+
name: "page",
|
|
33
|
+
cedarType: "Notebook::Page",
|
|
34
|
+
policyAttributes: {
|
|
35
|
+
owner: { column: pageTable.ownerId, entity: "Eloxiv::User" },
|
|
36
|
+
org: { column: pageTable.orgId, entity: "Eloxiv::Org" },
|
|
37
|
+
},
|
|
38
|
+
// The agent app syncs the kernel's agent and inbox tables; the agent reads pages through actions.
|
|
39
|
+
sync: false,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const write = defineAction({
|
|
43
|
+
name: "notebook.write",
|
|
44
|
+
description: "Write a new page in your notebook.",
|
|
45
|
+
input: Schema.Struct({ title: Schema.String.check(Schema.isNonEmpty()), body: Schema.optionalKey(Schema.String) }),
|
|
46
|
+
output: Schema.Struct({ id: Schema.String, title: Schema.String }),
|
|
47
|
+
writes: "page",
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export const tag = defineAction({
|
|
51
|
+
name: "notebook.tag",
|
|
52
|
+
description: "Tag one of your pages.",
|
|
53
|
+
input: Schema.Struct({ id: Schema.String, tag: Schema.String }),
|
|
54
|
+
output: Schema.Struct({ id: Schema.String, tag: Schema.String }),
|
|
55
|
+
writes: "page",
|
|
56
|
+
target: { entity: "page", field: "id" },
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export const tear = defineAction({
|
|
60
|
+
name: "notebook.tear",
|
|
61
|
+
description: "Tear a page out of your notebook (it is gone for good).",
|
|
62
|
+
input: Schema.Struct({ id: Schema.String }),
|
|
63
|
+
output: Schema.Struct({ id: Schema.String }),
|
|
64
|
+
writes: "page",
|
|
65
|
+
target: { entity: "page", field: "id" },
|
|
66
|
+
hints: { destructive: true },
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
export const seal = defineAction({
|
|
70
|
+
name: "notebook.seal",
|
|
71
|
+
description: "Seal a page so it can no longer change (needs the notebook.seal permission).",
|
|
72
|
+
input: Schema.Struct({ id: Schema.String }),
|
|
73
|
+
output: Schema.Struct({ id: Schema.String }),
|
|
74
|
+
writes: "page",
|
|
75
|
+
target: { entity: "page", field: "id" },
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
export const count = defineAction({
|
|
79
|
+
name: "notebook.count",
|
|
80
|
+
description: "Count the pages in your notebook (read-only).",
|
|
81
|
+
input: Schema.Struct({}),
|
|
82
|
+
output: Schema.Struct({ count: Schema.Number }),
|
|
83
|
+
hints: { readOnly: true, idempotent: true },
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
export const retag = defineAction({
|
|
87
|
+
name: "notebook.retag",
|
|
88
|
+
description: "Tag every one of your pages whose title starts with a prefix.",
|
|
89
|
+
input: Schema.Struct({ prefix: Schema.String.check(Schema.isNonEmpty()), tag: Schema.String }),
|
|
90
|
+
output: Schema.Struct({ count: Schema.Number, _receipt: Schema.optionalKey(WriteReceipt) }),
|
|
91
|
+
actsOn: ["page"],
|
|
92
|
+
// No target: the kernel confines it to the organisation, and the handler to the caller's own pages.
|
|
93
|
+
organisationWide: true,
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
export const notebook = defineModuleContract({
|
|
97
|
+
name: "notebook",
|
|
98
|
+
version: "1.0.0",
|
|
99
|
+
cedarNamespace: "Notebook",
|
|
100
|
+
entities: { page },
|
|
101
|
+
actions: { write, tag, tear, seal, count, retag },
|
|
102
|
+
events: {},
|
|
103
|
+
flags: {
|
|
104
|
+
"notebook.lab": { description: "Try the notebook's experimental pages.", default: false, lab: true },
|
|
105
|
+
"notebook.beta": { description: "The notebook's beta pages, on unless switched off.", default: true, lab: true },
|
|
106
|
+
},
|
|
107
|
+
permissions: {
|
|
108
|
+
"notebook.seal": { description: "Seal pages.", actions: ["notebook.seal"] },
|
|
109
|
+
},
|
|
110
|
+
skills: {
|
|
111
|
+
"notebook.pages": {
|
|
112
|
+
description: "How to keep notes in the notebook: write pages, tag them, and read them back with the query view.",
|
|
113
|
+
content: {
|
|
114
|
+
text: "# Notebook\n\nWrite a page with `notebook_write` (a title, and a body if there is more to say). Tag a page with `notebook_tag` using the id the write returned. Read pages back with the query tool on the `notebook.pages` view. Tearing a page out (`notebook_tear`) cannot be undone: it needs the person's consent.",
|
|
115
|
+
},
|
|
116
|
+
evals: { path: "evals/pages.evals.json" },
|
|
117
|
+
},
|
|
118
|
+
// A lab skill: given to a person's agent only once the notebook lab is on for them.
|
|
119
|
+
"notebook.preview": {
|
|
120
|
+
description: "How to use the notebook's experimental pages (a lab).",
|
|
121
|
+
content: { text: "# Notebook preview\n\nExperimental pages: LAB-ONLY-MARKER." },
|
|
122
|
+
requires: { flag: "notebook.lab" },
|
|
123
|
+
},
|
|
124
|
+
// A lab skill whose flag is on by default: given wherever the Flags module is installed, never where it is not.
|
|
125
|
+
"notebook.beta-pages": {
|
|
126
|
+
description: "How to use the notebook's beta pages (a lab, on by default).",
|
|
127
|
+
content: { text: "# Notebook beta\n\nBeta pages: BETA-ONLY-MARKER." },
|
|
128
|
+
requires: { flag: "notebook.beta" },
|
|
129
|
+
},
|
|
130
|
+
// For coding agents building the app, never for the app's own agent.
|
|
131
|
+
"notebook.internals": {
|
|
132
|
+
description: "How the notebook module is built: its tables and migrations.",
|
|
133
|
+
content: { text: "# Notebook internals\n\nThe notebook's pages live in notebook.page; DEVELOPMENT-ONLY-MARKER." },
|
|
134
|
+
audience: "development",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
queryViews: {
|
|
138
|
+
"notebook.pages": {
|
|
139
|
+
description: "Your pages: id, title, body, tag and whether it is sealed.",
|
|
140
|
+
entity: "page",
|
|
141
|
+
sql: "SELECT p.id, p.org_id, p.owner_id, p.title, p.body, p.tag, p.sealed FROM notebook.page p",
|
|
142
|
+
row: Schema.Struct({
|
|
143
|
+
id: Schema.String,
|
|
144
|
+
org_id: Schema.String,
|
|
145
|
+
owner_id: Schema.String,
|
|
146
|
+
title: Schema.String,
|
|
147
|
+
body: Schema.String,
|
|
148
|
+
tag: Schema.NullOr(Schema.String),
|
|
149
|
+
sealed: Schema.Boolean,
|
|
150
|
+
}),
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
export const NOTEBOOK_POLICY = `
|
|
156
|
+
@id("notebook.write")
|
|
157
|
+
permit (principal, action in [Notebook::Action::"write", Notebook::Action::"tag", Notebook::Action::"tear"], resource is Notebook::Page)
|
|
158
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
159
|
+
|
|
160
|
+
@id("notebook.seal")
|
|
161
|
+
permit (principal, action == Notebook::Action::"seal", resource is Notebook::Page)
|
|
162
|
+
when { resource.owner == principal && resource.org == principal.org && principal.permissions.contains("notebook.seal") };
|
|
163
|
+
|
|
164
|
+
@id("notebook.untargeted")
|
|
165
|
+
permit (principal, action in [Notebook::Action::"count", Notebook::Action::"retag"], resource);
|
|
166
|
+
|
|
167
|
+
@id("notebook.read")
|
|
168
|
+
permit (principal, action == Notebook::Action::"read", resource is Notebook::Page)
|
|
169
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
170
|
+
`
|
|
171
|
+
|
|
172
|
+
export const notebookModule = defineModule(notebook, {
|
|
173
|
+
policy: NOTEBOOK_POLICY,
|
|
174
|
+
migrationsDir: new URL("./migrations/", import.meta.url),
|
|
175
|
+
handlers: {
|
|
176
|
+
write: (input, ctx) =>
|
|
177
|
+
Effect.gen(function* () {
|
|
178
|
+
const id = crypto.randomUUID()
|
|
179
|
+
yield* ctx.sql`INSERT INTO notebook.page (id, org_id, owner_id, title, body)
|
|
180
|
+
VALUES (${id}, ${ctx.actor.orgId}, ${ctx.actor.userId}, ${input.title}, ${input.body ?? ""})`.pipe(
|
|
181
|
+
Effect.orDie,
|
|
182
|
+
)
|
|
183
|
+
return { id, title: input.title }
|
|
184
|
+
}),
|
|
185
|
+
tag: (input, ctx) =>
|
|
186
|
+
ctx.sql`UPDATE notebook.page SET tag = ${input.tag} WHERE id = ${input.id}`.pipe(
|
|
187
|
+
Effect.orDie,
|
|
188
|
+
Effect.as({ id: input.id, tag: input.tag }),
|
|
189
|
+
),
|
|
190
|
+
tear: (input, ctx) =>
|
|
191
|
+
ctx.sql`DELETE FROM notebook.page WHERE id = ${input.id}`.pipe(Effect.orDie, Effect.as({ id: input.id })),
|
|
192
|
+
seal: (input, ctx) =>
|
|
193
|
+
ctx.sql`UPDATE notebook.page SET sealed = true WHERE id = ${input.id}`.pipe(
|
|
194
|
+
Effect.orDie,
|
|
195
|
+
Effect.as({ id: input.id }),
|
|
196
|
+
),
|
|
197
|
+
count: (_input, ctx) =>
|
|
198
|
+
ctx.sql<{ n: number }>`SELECT count(*)::int AS n FROM notebook.page`.pipe(
|
|
199
|
+
Effect.orDie,
|
|
200
|
+
Effect.map(([row]) => ({ count: row?.n ?? 0 })),
|
|
201
|
+
),
|
|
202
|
+
retag: (input, ctx) =>
|
|
203
|
+
Effect.gen(function* () {
|
|
204
|
+
const rows = yield* ctx.sql<{ id: string }>`UPDATE notebook.page SET tag = ${input.tag}
|
|
205
|
+
WHERE owner_id = ${ctx.actor.userId} AND starts_with(title, ${input.prefix}) RETURNING id`.pipe(Effect.orDie)
|
|
206
|
+
// Nothing matched: the action says so itself; otherwise the kernel's receipt (an untargeted write) stands.
|
|
207
|
+
return rows.length > 0
|
|
208
|
+
? { count: rows.length }
|
|
209
|
+
: {
|
|
210
|
+
count: 0,
|
|
211
|
+
_receipt: { changed: false, verified: false, summary: `No page title starts with ${input.prefix}` },
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
},
|
|
215
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CollabDocument conformance app: the `pad` fixture with the kernel's `collab` module, the inbox and sharing
|
|
3
|
+
* modules (per-record grants), and the privacy and progress modules (data-subject export and erasure).
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
collabModule,
|
|
7
|
+
inboxModules,
|
|
8
|
+
privacyModule,
|
|
9
|
+
progressModule,
|
|
10
|
+
sharingModule,
|
|
11
|
+
type KernelApp,
|
|
12
|
+
} from "@eloxiv/kernel"
|
|
13
|
+
import { padModule } from "./server.ts"
|
|
14
|
+
|
|
15
|
+
export { page, pad, PAD_LIMITS } from "./contract.ts"
|
|
16
|
+
export { padModule } from "./server.ts"
|
|
17
|
+
|
|
18
|
+
export const padApp: KernelApp = {
|
|
19
|
+
name: "collab-conformance",
|
|
20
|
+
modules: [padModule, ...inboxModules, sharingModule, collabModule, privacyModule, progressModule],
|
|
21
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CollabDocument conformance fixture (`pad`): pages with an owner, a visibility (`private` or `org`) and
|
|
3
|
+
* per-record `read` and `edit` sharing grants, each with a collaborative document (small limits, so the kit can
|
|
4
|
+
* reach them). Members read a page when it is theirs, organisation-visible or shared with them; its owner and
|
|
5
|
+
* editors may change its document (`collaborate`); its owner shares and deletes it. Erasing a person deletes their
|
|
6
|
+
* pages (and so their documents).
|
|
7
|
+
*/
|
|
8
|
+
import { defineAction, defineModuleContract } from "@eloxiv/contracts"
|
|
9
|
+
import { defineEntity } from "@eloxiv/contracts/drizzle"
|
|
10
|
+
import { Schema } from "effect"
|
|
11
|
+
import * as tables from "./schema.ts"
|
|
12
|
+
|
|
13
|
+
/** The fixture's limits: a document of at most 64 KiB, updates of at most 8 KiB, 120 a minute per person. */
|
|
14
|
+
export const PAD_LIMITS = { maxBytes: 64 * 1024, maxUpdateBytes: 8 * 1024, updatesPerMinute: 120 } as const
|
|
15
|
+
|
|
16
|
+
export const page = defineEntity(tables.page, {
|
|
17
|
+
name: "page",
|
|
18
|
+
cedarType: "Pad::Page",
|
|
19
|
+
policyAttributes: {
|
|
20
|
+
owner: { column: tables.page.ownerId, entity: "Eloxiv::User" },
|
|
21
|
+
org: { column: tables.page.orgId, entity: "Eloxiv::Org" },
|
|
22
|
+
visibility: { column: tables.page.visibility },
|
|
23
|
+
readers: { sharing: "read" },
|
|
24
|
+
editors: { sharing: "edit" },
|
|
25
|
+
},
|
|
26
|
+
sync: false,
|
|
27
|
+
collab: { ...PAD_LIMITS, text: "body" },
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const Id = Schema.Struct({ id: Schema.String })
|
|
31
|
+
|
|
32
|
+
export const pad = defineModuleContract({
|
|
33
|
+
name: "pad",
|
|
34
|
+
version: "0.0.0",
|
|
35
|
+
cedarNamespace: "Pad",
|
|
36
|
+
entities: { page },
|
|
37
|
+
events: {},
|
|
38
|
+
actions: {
|
|
39
|
+
create: defineAction({
|
|
40
|
+
name: "pad.create",
|
|
41
|
+
description: "Create a page",
|
|
42
|
+
input: Schema.Struct({
|
|
43
|
+
id: Schema.String,
|
|
44
|
+
title: Schema.String,
|
|
45
|
+
visibility: Schema.optionalKey(Schema.Literals(["private", "org"])),
|
|
46
|
+
}),
|
|
47
|
+
output: Id,
|
|
48
|
+
writes: "page",
|
|
49
|
+
}),
|
|
50
|
+
setVisibility: defineAction({
|
|
51
|
+
name: "pad.setVisibility",
|
|
52
|
+
description: "Make a page private or organisation-visible",
|
|
53
|
+
input: Schema.Struct({ id: Schema.String, visibility: Schema.Literals(["private", "org"]) }),
|
|
54
|
+
output: Id,
|
|
55
|
+
writes: "page",
|
|
56
|
+
target: { entity: "page", field: "id" },
|
|
57
|
+
}),
|
|
58
|
+
remove: defineAction({
|
|
59
|
+
name: "pad.remove",
|
|
60
|
+
description: "Delete a page",
|
|
61
|
+
input: Id,
|
|
62
|
+
output: Id,
|
|
63
|
+
target: { entity: "page", field: "id" },
|
|
64
|
+
hints: { destructive: true },
|
|
65
|
+
consent: false,
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
dataSubjects: { page: { fields: ["ownerId"], erase: { kind: "delete" } } },
|
|
69
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The pad fixture's table (Drizzle): the only declaration of its fields (decision 9). Its migration creates it. */
|
|
2
|
+
import { bigint, pgSchema, text } from "drizzle-orm/pg-core"
|
|
3
|
+
|
|
4
|
+
const pad = pgSchema("pad")
|
|
5
|
+
|
|
6
|
+
export const page = pad.table("page", {
|
|
7
|
+
id: text("id").primaryKey(),
|
|
8
|
+
orgId: text("org_id").notNull(),
|
|
9
|
+
ownerId: text("owner_id").notNull(),
|
|
10
|
+
visibility: text("visibility", { enum: ["private", "org"] }).notNull(),
|
|
11
|
+
title: text("title").notNull(),
|
|
12
|
+
/**
|
|
13
|
+
* The live copy of the page's document text (its `body`), and the sequence number it was copied at: written only
|
|
14
|
+
* by the module's subscriber to `collab.changed`, never by its actions.
|
|
15
|
+
*/
|
|
16
|
+
bodyText: text("body_text").notNull().default(""),
|
|
17
|
+
bodySeq: bigint("body_seq", { mode: "number" }).notNull().default(0),
|
|
18
|
+
})
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** The pad fixture's server half: its policy, and handlers that check nothing themselves. */
|
|
2
|
+
import { collabChanged, defineModule, subscribe } from "@eloxiv/kernel"
|
|
3
|
+
import { Effect } from "effect"
|
|
4
|
+
import { pad } from "./contract.ts"
|
|
5
|
+
|
|
6
|
+
export const PAD_POLICY = `
|
|
7
|
+
@id("pad.create")
|
|
8
|
+
permit (principal, action == Pad::Action::"create", resource is Pad::Page)
|
|
9
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
10
|
+
|
|
11
|
+
@id("pad.setVisibility")
|
|
12
|
+
permit (principal, action == Pad::Action::"setVisibility", resource is Pad::Page)
|
|
13
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
14
|
+
|
|
15
|
+
@id("pad.remove")
|
|
16
|
+
permit (principal, action == Pad::Action::"remove", resource is Pad::Page)
|
|
17
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
18
|
+
|
|
19
|
+
@id("pad.read")
|
|
20
|
+
permit (principal, action == Pad::Action::"read", resource is Pad::Page)
|
|
21
|
+
when {
|
|
22
|
+
resource.org == principal.org &&
|
|
23
|
+
(resource.owner == principal || resource.visibility == "org" ||
|
|
24
|
+
resource.readers.contains(principal) || resource.editors.contains(principal))
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// The collaborative document: its owner and the people it is shared with for editing change it.
|
|
28
|
+
@id("pad.collaborate")
|
|
29
|
+
permit (principal, action == Pad::Action::"collaborate", resource is Pad::Page)
|
|
30
|
+
when { resource.org == principal.org && (resource.owner == principal || resource.editors.contains(principal)) };
|
|
31
|
+
|
|
32
|
+
@id("pad.share")
|
|
33
|
+
permit (principal, action == Pad::Action::"share", resource is Pad::Page)
|
|
34
|
+
when { resource.owner == principal && resource.org == principal.org };
|
|
35
|
+
`
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The page's live copy: on every committed change to its document, read the text (`ctx.collab.text`, its own
|
|
39
|
+
* entity only) and write it with the sequence number it holds, keeping the newest. A document text holding
|
|
40
|
+
* `[probe-foreign]` makes the subscriber try another module's entity instead, and copy the answer it got (the kit
|
|
41
|
+
* checks the refusal); one holding `[probe-role]` makes it read the text while its own statements run alongside, and
|
|
42
|
+
* copy every role those statements ran as (the kit checks the read never changes the subscriber's role); one holding
|
|
43
|
+
* `[probe-moved:<id>]` makes it read another page's text and copy what it got (the kit checks a page that moved to
|
|
44
|
+
* another organisation gives nothing).
|
|
45
|
+
*/
|
|
46
|
+
const liveCopy = subscribe("pad.liveCopy", collabChanged, (event, ctx) =>
|
|
47
|
+
Effect.gen(function* () {
|
|
48
|
+
if (event.entity !== "Pad::Page") return
|
|
49
|
+
const copy = yield* ctx.collab.text({ entity: event.entity, id: event.id })
|
|
50
|
+
if (copy === null) return
|
|
51
|
+
let text = copy.text
|
|
52
|
+
if (text.includes("[probe-role]")) {
|
|
53
|
+
const roles = yield* Effect.all(
|
|
54
|
+
[
|
|
55
|
+
...Array.from({ length: 8 }, () =>
|
|
56
|
+
ctx.sql<{ role: string }>`SELECT current_user AS role`.pipe(Effect.map(([r]) => r!.role)),
|
|
57
|
+
),
|
|
58
|
+
ctx.collab.text({ entity: event.entity, id: event.id }).pipe(Effect.as("read")),
|
|
59
|
+
...Array.from({ length: 8 }, () =>
|
|
60
|
+
ctx.sql<{ role: string }>`SELECT current_user AS role`.pipe(Effect.map(([r]) => r!.role)),
|
|
61
|
+
),
|
|
62
|
+
],
|
|
63
|
+
{ concurrency: "unbounded" },
|
|
64
|
+
)
|
|
65
|
+
text = [...new Set(roles.filter((r) => r !== "read"))].sort().join(",")
|
|
66
|
+
}
|
|
67
|
+
const moved = /\[probe-moved:([^\]]+)\]/u.exec(text)
|
|
68
|
+
if (moved !== null) {
|
|
69
|
+
const other = yield* ctx.collab.text({ entity: event.entity, id: moved[1]! })
|
|
70
|
+
text = other === null ? "moved: nothing" : `moved: ${other.text}`
|
|
71
|
+
}
|
|
72
|
+
if (text.includes("[probe-foreign]")) {
|
|
73
|
+
text = yield* ctx.collab.text({ entity: "Sharing::Request", id: event.id }).pipe(
|
|
74
|
+
Effect.as("foreign read allowed"),
|
|
75
|
+
Effect.catchTag("Forbidden", () => Effect.succeed("foreign read refused")),
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
yield* ctx.sql`UPDATE pad.page SET body_text = ${text}, body_seq = ${copy.seq}
|
|
79
|
+
WHERE id = ${event.id} AND body_seq < ${copy.seq}`
|
|
80
|
+
}),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
export const padModule = defineModule(pad, {
|
|
84
|
+
policy: PAD_POLICY,
|
|
85
|
+
subscriptions: [liveCopy],
|
|
86
|
+
migrationsDir: new URL("./migrations/pad/", import.meta.url),
|
|
87
|
+
handlers: {
|
|
88
|
+
create: (input, ctx) =>
|
|
89
|
+
ctx.sql`INSERT INTO pad.page (id, org_id, owner_id, visibility, title)
|
|
90
|
+
VALUES (${input.id}, ${ctx.actor.orgId}, ${ctx.actor.userId}, ${input.visibility ?? "private"}, ${input.title})`.pipe(
|
|
91
|
+
Effect.orDie,
|
|
92
|
+
Effect.as({ id: input.id }),
|
|
93
|
+
),
|
|
94
|
+
setVisibility: (input, ctx) =>
|
|
95
|
+
ctx.sql`UPDATE pad.page SET visibility = ${input.visibility} WHERE id = ${input.id}`.pipe(
|
|
96
|
+
Effect.orDie,
|
|
97
|
+
Effect.as({ id: input.id }),
|
|
98
|
+
),
|
|
99
|
+
remove: (input, ctx) =>
|
|
100
|
+
ctx.sql`DELETE FROM pad.page WHERE id = ${input.id}`.pipe(Effect.orDie, Effect.as({ id: input.id })),
|
|
101
|
+
},
|
|
102
|
+
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inbox conformance app: the purchases fixture with the kernel's inbox modules (work items,
|
|
3
|
+
* notifications, approvals, consent) and the inbox sync tables, which the Approvals, ActionConsent,
|
|
4
|
+
* WorkItems and Notifications kits run against.
|
|
5
|
+
*/
|
|
6
|
+
import { createSchema, defineQueries } from "@eloxiv/client"
|
|
7
|
+
import { inboxQueries, inboxRelationships, inboxTables, shareGrant } from "@eloxiv/client/sync"
|
|
8
|
+
import { inboxModules, type KernelApp } from "@eloxiv/kernel"
|
|
9
|
+
import { purchasesModule } from "./server.ts"
|
|
10
|
+
|
|
11
|
+
export { APPROVE, purchases } from "./contract.ts"
|
|
12
|
+
export { purchasesModule } from "./server.ts"
|
|
13
|
+
|
|
14
|
+
export const inboxSchema = createSchema({
|
|
15
|
+
tables: [shareGrant, ...inboxTables],
|
|
16
|
+
relationships: [...inboxRelationships],
|
|
17
|
+
})
|
|
18
|
+
export const inboxSyncQueries = defineQueries(inboxQueries)
|
|
19
|
+
|
|
20
|
+
export const inboxApp: KernelApp = {
|
|
21
|
+
name: "inbox-conformance",
|
|
22
|
+
modules: [purchasesModule, ...inboxModules],
|
|
23
|
+
sync: { schema: inboxSchema, queries: inboxSyncQueries },
|
|
24
|
+
emailTemplates: [
|
|
25
|
+
{
|
|
26
|
+
id: "purchases.receipt",
|
|
27
|
+
description: "A receipt for an order.",
|
|
28
|
+
subject: "Receipt for {{item}}",
|
|
29
|
+
text: "You ordered {{item}} for {{amount}}.",
|
|
30
|
+
html: "<p>You ordered <b>{{item}}</b> for {{amount}}.</p>",
|
|
31
|
+
variables: ["item", "amount"],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inbox conformance fixture: purchase orders that need business approval above a threshold, money
|
|
3
|
+
* transfers an agent may make only with the person's consent, and reviews fed into the unified inbox.
|
|
4
|
+
*
|
|
5
|
+
* Approval rules (checked in order, the first that matches applies):
|
|
6
|
+
* - `purchases.huge`: an order of 100,000 or more needs two approvers holding `purchases.approve`;
|
|
7
|
+
* - `purchases.expiring`: an order from vendor "slowco" expires 2 s after it is requested;
|
|
8
|
+
* - `purchases.self`: an order from vendor "selfco" may be approved by its requester;
|
|
9
|
+
* - `purchases.large`: any other order above 1,000 needs one approver holding `purchases.approve`.
|
|
10
|
+
*/
|
|
11
|
+
import { defineAction, defineEvent, defineModuleContract } from "@eloxiv/contracts"
|
|
12
|
+
import { defineEntity } from "@eloxiv/contracts/drizzle"
|
|
13
|
+
import { doublePrecision, pgSchema, text } from "drizzle-orm/pg-core"
|
|
14
|
+
import { Schema } from "effect"
|
|
15
|
+
|
|
16
|
+
export const APPROVE = "purchases.approve"
|
|
17
|
+
|
|
18
|
+
const purchasesSchema = pgSchema("purchases")
|
|
19
|
+
|
|
20
|
+
/** The module's tables (Drizzle): the only declaration of their fields. Its migrations create them. */
|
|
21
|
+
export const orderTable = purchasesSchema.table("purchase_order", {
|
|
22
|
+
id: text("id").primaryKey(),
|
|
23
|
+
orgId: text("org_id").notNull(),
|
|
24
|
+
ownerId: text("owner_id").notNull(),
|
|
25
|
+
item: text("item").notNull(),
|
|
26
|
+
amount: doublePrecision("amount").notNull(),
|
|
27
|
+
vendor: text("vendor").notNull(),
|
|
28
|
+
status: text("status").notNull().default("placed"),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export const transferTable = purchasesSchema.table("transfer", {
|
|
32
|
+
id: text("id").primaryKey(),
|
|
33
|
+
orgId: text("org_id").notNull(),
|
|
34
|
+
ownerId: text("owner_id").notNull(),
|
|
35
|
+
amount: doublePrecision("amount").notNull(),
|
|
36
|
+
payee: text("payee").notNull(),
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
export const order = defineEntity(orderTable, {
|
|
40
|
+
name: "order",
|
|
41
|
+
cedarType: "Purchases::Order",
|
|
42
|
+
policyAttributes: {
|
|
43
|
+
org: { column: orderTable.orgId, entity: "Eloxiv::Org" },
|
|
44
|
+
owner: { column: orderTable.ownerId, entity: "Eloxiv::User" },
|
|
45
|
+
},
|
|
46
|
+
// The inbox app syncs the kernel's inbox tables, not the purchases themselves.
|
|
47
|
+
sync: false,
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export const transfer = defineEntity(transferTable, {
|
|
51
|
+
name: "transfer",
|
|
52
|
+
cedarType: "Purchases::Transfer",
|
|
53
|
+
policyAttributes: {
|
|
54
|
+
org: { column: transferTable.orgId, entity: "Eloxiv::Org" },
|
|
55
|
+
owner: { column: transferTable.ownerId, entity: "Eloxiv::User" },
|
|
56
|
+
},
|
|
57
|
+
sync: false,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export const placeOrder = defineAction({
|
|
61
|
+
name: "purchases.order",
|
|
62
|
+
title: "Place a purchase order",
|
|
63
|
+
description: "Place a purchase order as yourself; large orders need approval.",
|
|
64
|
+
input: Schema.Struct({
|
|
65
|
+
item: Schema.String,
|
|
66
|
+
amount: Schema.Number,
|
|
67
|
+
vendor: Schema.optionalKey(Schema.String),
|
|
68
|
+
/** Ask this group to review the order (a work item for the group). */
|
|
69
|
+
reviewGroup: Schema.optionalKey(Schema.String),
|
|
70
|
+
/** Ask this member to review the order (a work item for them). */
|
|
71
|
+
reviewer: Schema.optionalKey(Schema.String),
|
|
72
|
+
}),
|
|
73
|
+
output: Schema.Struct({ id: Schema.String, amount: Schema.Number }),
|
|
74
|
+
writes: "order",
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
/** Moves money: an agent needs the person's consent for every call (destructive, so `consent` by default). */
|
|
78
|
+
export const wire = defineAction({
|
|
79
|
+
name: "purchases.wire",
|
|
80
|
+
title: "Wire money",
|
|
81
|
+
description: "Wire money to a payee.",
|
|
82
|
+
input: Schema.Struct({ amount: Schema.Number, payee: Schema.String }),
|
|
83
|
+
output: Schema.Struct({ id: Schema.String }),
|
|
84
|
+
writes: "transfer",
|
|
85
|
+
hints: { destructive: true },
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
/** Marks one of your orders reviewed, closing its review items. */
|
|
89
|
+
export const markReviewed = defineAction({
|
|
90
|
+
name: "purchases.markReviewed",
|
|
91
|
+
description: "Mark one of your orders reviewed.",
|
|
92
|
+
input: Schema.Struct({ id: Schema.String }),
|
|
93
|
+
output: Schema.Struct({ id: Schema.String }),
|
|
94
|
+
writes: "order",
|
|
95
|
+
target: { entity: "order", field: "id" },
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
export const ordered = defineEvent(
|
|
99
|
+
"purchases.ordered",
|
|
100
|
+
Schema.Struct({ id: Schema.String, ownerId: Schema.String, amount: Schema.Number }),
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
export const purchases = defineModuleContract({
|
|
104
|
+
name: "purchases",
|
|
105
|
+
version: "1.0.0",
|
|
106
|
+
cedarNamespace: "Purchases",
|
|
107
|
+
entities: { order, transfer },
|
|
108
|
+
actions: { placeOrder, wire, markReviewed },
|
|
109
|
+
events: { ordered },
|
|
110
|
+
permissions: {
|
|
111
|
+
[APPROVE]: { description: "Approve purchase orders above the threshold.", actions: ["purchases.order"] },
|
|
112
|
+
},
|
|
113
|
+
views: {
|
|
114
|
+
"purchases.order": { title: "Purchase order", route: "/purchases/order", shows: { entity: "order" } },
|
|
115
|
+
},
|
|
116
|
+
workItemSources: {
|
|
117
|
+
"purchases.reviews": {
|
|
118
|
+
description: "An order someone asked a member or a group to review.",
|
|
119
|
+
entity: "order",
|
|
120
|
+
title: "item",
|
|
121
|
+
state: { field: "status", values: { placed: "open", reviewing: "waiting", reviewed: "done" } },
|
|
122
|
+
assignee: null,
|
|
123
|
+
link: { view: "purchases.order" },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
approvalRules: {
|
|
127
|
+
"purchases.huge": {
|
|
128
|
+
description: "Orders of 100,000 or more need two approvers",
|
|
129
|
+
action: "purchases.order",
|
|
130
|
+
when: [{ field: "amount", op: "gte", value: 100_000 }],
|
|
131
|
+
approvers: { permission: APPROVE },
|
|
132
|
+
quorum: 2,
|
|
133
|
+
},
|
|
134
|
+
"purchases.expiring": {
|
|
135
|
+
description: "Orders from slowco expire quickly",
|
|
136
|
+
action: "purchases.order",
|
|
137
|
+
when: [
|
|
138
|
+
{ field: "vendor", op: "eq", value: "slowco" },
|
|
139
|
+
{ field: "amount", op: "gt", value: 1_000 },
|
|
140
|
+
],
|
|
141
|
+
approvers: { permission: APPROVE },
|
|
142
|
+
expiresAfterMs: 2_000,
|
|
143
|
+
},
|
|
144
|
+
"purchases.self": {
|
|
145
|
+
description: "Orders from selfco may be approved by whoever placed them",
|
|
146
|
+
action: "purchases.order",
|
|
147
|
+
when: [
|
|
148
|
+
{ field: "vendor", op: "eq", value: "selfco" },
|
|
149
|
+
{ field: "amount", op: "gt", value: 1_000 },
|
|
150
|
+
],
|
|
151
|
+
approvers: { permission: APPROVE },
|
|
152
|
+
allowSelfApproval: true,
|
|
153
|
+
},
|
|
154
|
+
"purchases.large": {
|
|
155
|
+
description: "Orders above 1,000 need an approver",
|
|
156
|
+
action: "purchases.order",
|
|
157
|
+
when: [{ field: "amount", op: "gt", value: 1_000 }],
|
|
158
|
+
approvers: { permission: APPROVE },
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
CREATE TABLE "purchases"."purchase_order" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"org_id" text NOT NULL,
|
|
4
|
+
"owner_id" text NOT NULL,
|
|
5
|
+
"item" text NOT NULL,
|
|
6
|
+
"amount" double precision NOT NULL,
|
|
7
|
+
"vendor" text NOT NULL,
|
|
8
|
+
"status" text DEFAULT 'placed' NOT NULL
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE TABLE "purchases"."transfer" (
|
|
12
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
13
|
+
"org_id" text NOT NULL,
|
|
14
|
+
"owner_id" text NOT NULL,
|
|
15
|
+
"amount" double precision NOT NULL,
|
|
16
|
+
"payee" text NOT NULL
|
|
17
|
+
);
|