@eloxiv/contracts 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/Agent.d.ts +792 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +610 -0
- package/dist/Agent.js.map +1 -0
- package/dist/Analytics.d.ts +46 -0
- package/dist/Analytics.d.ts.map +1 -0
- package/dist/Analytics.js +89 -0
- package/dist/Analytics.js.map +1 -0
- package/dist/Approval.d.ts +70 -0
- package/dist/Approval.d.ts.map +1 -0
- package/dist/Approval.js +127 -0
- package/dist/Approval.js.map +1 -0
- package/dist/Catalog.d.ts +238 -0
- package/dist/Catalog.d.ts.map +1 -0
- package/dist/Catalog.js +169 -0
- package/dist/Catalog.js.map +1 -0
- package/dist/Checklist.d.ts +99 -0
- package/dist/Checklist.d.ts.map +1 -0
- package/dist/Checklist.js +105 -0
- package/dist/Checklist.js.map +1 -0
- package/dist/Data.d.ts +107 -0
- package/dist/Data.d.ts.map +1 -0
- package/dist/Data.js +93 -0
- package/dist/Data.js.map +1 -0
- package/dist/Devices.d.ts +857 -0
- package/dist/Devices.d.ts.map +1 -0
- package/dist/Devices.js +590 -0
- package/dist/Devices.js.map +1 -0
- package/dist/Durable.d.ts +406 -0
- package/dist/Durable.d.ts.map +1 -0
- package/dist/Durable.js +203 -0
- package/dist/Durable.js.map +1 -0
- package/dist/Errors.d.ts +95 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +72 -0
- package/dist/Errors.js.map +1 -0
- package/dist/JsonSchema.d.ts +355 -0
- package/dist/JsonSchema.d.ts.map +1 -0
- package/dist/JsonSchema.js +151 -0
- package/dist/JsonSchema.js.map +1 -0
- package/dist/Manifest.d.ts +353 -0
- package/dist/Manifest.d.ts.map +1 -0
- package/dist/Manifest.js +894 -0
- package/dist/Manifest.js.map +1 -0
- package/dist/Module.d.ts +447 -0
- package/dist/Module.d.ts.map +1 -0
- package/dist/Module.js +221 -0
- package/dist/Module.js.map +1 -0
- package/dist/Optimistic.d.ts +192 -0
- package/dist/Optimistic.d.ts.map +1 -0
- package/dist/Optimistic.js +319 -0
- package/dist/Optimistic.js.map +1 -0
- package/dist/Projection.d.ts +163 -0
- package/dist/Projection.d.ts.map +1 -0
- package/dist/Projection.js +158 -0
- package/dist/Projection.js.map +1 -0
- package/dist/Proposals.d.ts +103 -0
- package/dist/Proposals.d.ts.map +1 -0
- package/dist/Proposals.js +72 -0
- package/dist/Proposals.js.map +1 -0
- package/dist/Receipt.d.ts +243 -0
- package/dist/Receipt.d.ts.map +1 -0
- package/dist/Receipt.js +108 -0
- package/dist/Receipt.js.map +1 -0
- package/dist/Records.d.ts +297 -0
- package/dist/Records.d.ts.map +1 -0
- package/dist/Records.js +171 -0
- package/dist/Records.js.map +1 -0
- package/dist/Render.d.ts +207 -0
- package/dist/Render.d.ts.map +1 -0
- package/dist/Render.js +502 -0
- package/dist/Render.js.map +1 -0
- package/dist/Rpc.d.ts +115 -0
- package/dist/Rpc.d.ts.map +1 -0
- package/dist/Rpc.js +68 -0
- package/dist/Rpc.js.map +1 -0
- package/dist/SearchLanguages.d.ts +4 -0
- package/dist/SearchLanguages.d.ts.map +1 -0
- package/dist/SearchLanguages.js +33 -0
- package/dist/SearchLanguages.js.map +1 -0
- package/dist/Service.d.ts +59 -0
- package/dist/Service.d.ts.map +1 -0
- package/dist/Service.js +38 -0
- package/dist/Service.js.map +1 -0
- package/dist/Versions.d.ts +9 -0
- package/dist/Versions.d.ts.map +1 -0
- package/dist/Versions.js +78 -0
- package/dist/Versions.js.map +1 -0
- package/dist/contracts/ActionConsent.d.ts +189 -0
- package/dist/contracts/ActionConsent.d.ts.map +1 -0
- package/dist/contracts/ActionConsent.js +129 -0
- package/dist/contracts/ActionConsent.js.map +1 -0
- package/dist/contracts/ActionRegistry.d.ts +149 -0
- package/dist/contracts/ActionRegistry.d.ts.map +1 -0
- package/dist/contracts/ActionRegistry.js +37 -0
- package/dist/contracts/ActionRegistry.js.map +1 -0
- package/dist/contracts/Actor.d.ts +129 -0
- package/dist/contracts/Actor.d.ts.map +1 -0
- package/dist/contracts/Actor.js +47 -0
- package/dist/contracts/Actor.js.map +1 -0
- package/dist/contracts/AgentResources.d.ts +248 -0
- package/dist/contracts/AgentResources.d.ts.map +1 -0
- package/dist/contracts/AgentResources.js +158 -0
- package/dist/contracts/AgentResources.js.map +1 -0
- package/dist/contracts/AgentRuntime.d.ts +453 -0
- package/dist/contracts/AgentRuntime.d.ts.map +1 -0
- package/dist/contracts/AgentRuntime.js +117 -0
- package/dist/contracts/AgentRuntime.js.map +1 -0
- package/dist/contracts/Approvals.d.ts +303 -0
- package/dist/contracts/Approvals.d.ts.map +1 -0
- package/dist/contracts/Approvals.js +117 -0
- package/dist/contracts/Approvals.js.map +1 -0
- package/dist/contracts/Audit.d.ts +510 -0
- package/dist/contracts/Audit.d.ts.map +1 -0
- package/dist/contracts/Audit.js +139 -0
- package/dist/contracts/Audit.js.map +1 -0
- package/dist/contracts/CalendarProvider.d.ts +572 -0
- package/dist/contracts/CalendarProvider.d.ts.map +1 -0
- package/dist/contracts/CalendarProvider.js +203 -0
- package/dist/contracts/CalendarProvider.js.map +1 -0
- package/dist/contracts/Capability.d.ts +197 -0
- package/dist/contracts/Capability.d.ts.map +1 -0
- package/dist/contracts/Capability.js +189 -0
- package/dist/contracts/Capability.js.map +1 -0
- package/dist/contracts/ClientSDK.d.ts +250 -0
- package/dist/contracts/ClientSDK.d.ts.map +1 -0
- package/dist/contracts/ClientSDK.js +184 -0
- package/dist/contracts/ClientSDK.js.map +1 -0
- package/dist/contracts/CollabDocument.d.ts +781 -0
- package/dist/contracts/CollabDocument.d.ts.map +1 -0
- package/dist/contracts/CollabDocument.js +364 -0
- package/dist/contracts/CollabDocument.js.map +1 -0
- package/dist/contracts/Command.d.ts +183 -0
- package/dist/contracts/Command.d.ts.map +1 -0
- package/dist/contracts/Command.js +66 -0
- package/dist/contracts/Command.js.map +1 -0
- package/dist/contracts/Connections.d.ts +612 -0
- package/dist/contracts/Connections.d.ts.map +1 -0
- package/dist/contracts/Connections.js +323 -0
- package/dist/contracts/Connections.js.map +1 -0
- package/dist/contracts/ContextAccounting.d.ts +79 -0
- package/dist/contracts/ContextAccounting.d.ts.map +1 -0
- package/dist/contracts/ContextAccounting.js +32 -0
- package/dist/contracts/ContextAccounting.js.map +1 -0
- package/dist/contracts/Daemon.d.ts +486 -0
- package/dist/contracts/Daemon.d.ts.map +1 -0
- package/dist/contracts/Daemon.js +192 -0
- package/dist/contracts/Daemon.js.map +1 -0
- package/dist/contracts/DbTx.d.ts +149 -0
- package/dist/contracts/DbTx.d.ts.map +1 -0
- package/dist/contracts/DbTx.js +94 -0
- package/dist/contracts/DbTx.js.map +1 -0
- package/dist/contracts/Delegation.d.ts +121 -0
- package/dist/contracts/Delegation.d.ts.map +1 -0
- package/dist/contracts/Delegation.js +76 -0
- package/dist/contracts/Delegation.js.map +1 -0
- package/dist/contracts/DeviceControl.d.ts +293 -0
- package/dist/contracts/DeviceControl.d.ts.map +1 -0
- package/dist/contracts/DeviceControl.js +107 -0
- package/dist/contracts/DeviceControl.js.map +1 -0
- package/dist/contracts/Directory.d.ts +492 -0
- package/dist/contracts/Directory.d.ts.map +1 -0
- package/dist/contracts/Directory.js +225 -0
- package/dist/contracts/Directory.js.map +1 -0
- package/dist/contracts/DirectoryProvider.d.ts +214 -0
- package/dist/contracts/DirectoryProvider.d.ts.map +1 -0
- package/dist/contracts/DirectoryProvider.js +73 -0
- package/dist/contracts/DirectoryProvider.js.map +1 -0
- package/dist/contracts/DocumentSource.d.ts +190 -0
- package/dist/contracts/DocumentSource.d.ts.map +1 -0
- package/dist/contracts/DocumentSource.js +64 -0
- package/dist/contracts/DocumentSource.js.map +1 -0
- package/dist/contracts/Files.d.ts +762 -0
- package/dist/contracts/Files.d.ts.map +1 -0
- package/dist/contracts/Files.js +339 -0
- package/dist/contracts/Files.js.map +1 -0
- package/dist/contracts/Flags.d.ts +265 -0
- package/dist/contracts/Flags.d.ts.map +1 -0
- package/dist/contracts/Flags.js +197 -0
- package/dist/contracts/Flags.js.map +1 -0
- package/dist/contracts/Host.d.ts +320 -0
- package/dist/contracts/Host.d.ts.map +1 -0
- package/dist/contracts/Host.js +224 -0
- package/dist/contracts/Host.js.map +1 -0
- package/dist/contracts/HttpApi.d.ts +102 -0
- package/dist/contracts/HttpApi.d.ts.map +1 -0
- package/dist/contracts/HttpApi.js +89 -0
- package/dist/contracts/HttpApi.js.map +1 -0
- package/dist/contracts/Ingestion.d.ts +522 -0
- package/dist/contracts/Ingestion.d.ts.map +1 -0
- package/dist/contracts/Ingestion.js +275 -0
- package/dist/contracts/Ingestion.js.map +1 -0
- package/dist/contracts/Ingress.d.ts +132 -0
- package/dist/contracts/Ingress.d.ts.map +1 -0
- package/dist/contracts/Ingress.js +102 -0
- package/dist/contracts/Ingress.js.map +1 -0
- package/dist/contracts/Invocation.d.ts +361 -0
- package/dist/contracts/Invocation.d.ts.map +1 -0
- package/dist/contracts/Invocation.js +104 -0
- package/dist/contracts/Invocation.js.map +1 -0
- package/dist/contracts/LocalClient.d.ts +878 -0
- package/dist/contracts/LocalClient.d.ts.map +1 -0
- package/dist/contracts/LocalClient.js +423 -0
- package/dist/contracts/LocalClient.js.map +1 -0
- package/dist/contracts/Locale.d.ts +162 -0
- package/dist/contracts/Locale.d.ts.map +1 -0
- package/dist/contracts/Locale.js +123 -0
- package/dist/contracts/Locale.js.map +1 -0
- package/dist/contracts/MachineIdentity.d.ts +434 -0
- package/dist/contracts/MachineIdentity.d.ts.map +1 -0
- package/dist/contracts/MachineIdentity.js +223 -0
- package/dist/contracts/MachineIdentity.js.map +1 -0
- package/dist/contracts/MailProvider.d.ts +791 -0
- package/dist/contracts/MailProvider.d.ts.map +1 -0
- package/dist/contracts/MailProvider.js +237 -0
- package/dist/contracts/MailProvider.js.map +1 -0
- package/dist/contracts/Memory.d.ts +62 -0
- package/dist/contracts/Memory.d.ts.map +1 -0
- package/dist/contracts/Memory.js +43 -0
- package/dist/contracts/Memory.js.map +1 -0
- package/dist/contracts/Messaging.d.ts +154 -0
- package/dist/contracts/Messaging.d.ts.map +1 -0
- package/dist/contracts/Messaging.js +97 -0
- package/dist/contracts/Messaging.js.map +1 -0
- package/dist/contracts/Metering.d.ts +334 -0
- package/dist/contracts/Metering.d.ts.map +1 -0
- package/dist/contracts/Metering.js +202 -0
- package/dist/contracts/Metering.js.map +1 -0
- package/dist/contracts/ModelProvider.d.ts +142 -0
- package/dist/contracts/ModelProvider.d.ts.map +1 -0
- package/dist/contracts/ModelProvider.js +72 -0
- package/dist/contracts/ModelProvider.js.map +1 -0
- package/dist/contracts/ModuleManifest.d.ts +2519 -0
- package/dist/contracts/ModuleManifest.d.ts.map +1 -0
- package/dist/contracts/ModuleManifest.js +272 -0
- package/dist/contracts/ModuleManifest.js.map +1 -0
- package/dist/contracts/NotificationChannel.d.ts +378 -0
- package/dist/contracts/NotificationChannel.d.ts.map +1 -0
- package/dist/contracts/NotificationChannel.js +136 -0
- package/dist/contracts/NotificationChannel.js.map +1 -0
- package/dist/contracts/Notifications.d.ts +417 -0
- package/dist/contracts/Notifications.d.ts.map +1 -0
- package/dist/contracts/Notifications.js +267 -0
- package/dist/contracts/Notifications.js.map +1 -0
- package/dist/contracts/Outbox.d.ts +469 -0
- package/dist/contracts/Outbox.d.ts.map +1 -0
- package/dist/contracts/Outbox.js +215 -0
- package/dist/contracts/Outbox.js.map +1 -0
- package/dist/contracts/Privacy.d.ts +1029 -0
- package/dist/contracts/Privacy.d.ts.map +1 -0
- package/dist/contracts/Privacy.js +437 -0
- package/dist/contracts/Privacy.js.map +1 -0
- package/dist/contracts/Progress.d.ts +305 -0
- package/dist/contracts/Progress.d.ts.map +1 -0
- package/dist/contracts/Progress.js +174 -0
- package/dist/contracts/Progress.js.map +1 -0
- package/dist/contracts/QuerySurface.d.ts +231 -0
- package/dist/contracts/QuerySurface.d.ts.map +1 -0
- package/dist/contracts/QuerySurface.js +113 -0
- package/dist/contracts/QuerySurface.js.map +1 -0
- package/dist/contracts/Readiness.d.ts +105 -0
- package/dist/contracts/Readiness.d.ts.map +1 -0
- package/dist/contracts/Readiness.js +57 -0
- package/dist/contracts/Readiness.js.map +1 -0
- package/dist/contracts/Release.d.ts +295 -0
- package/dist/contracts/Release.d.ts.map +1 -0
- package/dist/contracts/Release.js +175 -0
- package/dist/contracts/Release.js.map +1 -0
- package/dist/contracts/ResultRendering.d.ts +533 -0
- package/dist/contracts/ResultRendering.d.ts.map +1 -0
- package/dist/contracts/ResultRendering.js +59 -0
- package/dist/contracts/ResultRendering.js.map +1 -0
- package/dist/contracts/Sandbox.d.ts +1164 -0
- package/dist/contracts/Sandbox.d.ts.map +1 -0
- package/dist/contracts/Sandbox.js +550 -0
- package/dist/contracts/Sandbox.js.map +1 -0
- package/dist/contracts/Scheduler.d.ts +814 -0
- package/dist/contracts/Scheduler.d.ts.map +1 -0
- package/dist/contracts/Scheduler.js +202 -0
- package/dist/contracts/Scheduler.js.map +1 -0
- package/dist/contracts/ScreenContext.d.ts +514 -0
- package/dist/contracts/ScreenContext.d.ts.map +1 -0
- package/dist/contracts/ScreenContext.js +272 -0
- package/dist/contracts/ScreenContext.js.map +1 -0
- package/dist/contracts/Search.d.ts +308 -0
- package/dist/contracts/Search.d.ts.map +1 -0
- package/dist/contracts/Search.js +107 -0
- package/dist/contracts/Search.js.map +1 -0
- package/dist/contracts/Secrets.d.ts +483 -0
- package/dist/contracts/Secrets.d.ts.map +1 -0
- package/dist/contracts/Secrets.js +136 -0
- package/dist/contracts/Secrets.js.map +1 -0
- package/dist/contracts/Settings.d.ts +221 -0
- package/dist/contracts/Settings.d.ts.map +1 -0
- package/dist/contracts/Settings.js +163 -0
- package/dist/contracts/Settings.js.map +1 -0
- package/dist/contracts/Sharing.d.ts +319 -0
- package/dist/contracts/Sharing.d.ts.map +1 -0
- package/dist/contracts/Sharing.js +172 -0
- package/dist/contracts/Sharing.js.map +1 -0
- package/dist/contracts/Slot.d.ts +162 -0
- package/dist/contracts/Slot.d.ts.map +1 -0
- package/dist/contracts/Slot.js +56 -0
- package/dist/contracts/Slot.js.map +1 -0
- package/dist/contracts/Space.d.ts +256 -0
- package/dist/contracts/Space.d.ts.map +1 -0
- package/dist/contracts/Space.js +133 -0
- package/dist/contracts/Space.js.map +1 -0
- package/dist/contracts/StorageAdapter.d.ts +124 -0
- package/dist/contracts/StorageAdapter.d.ts.map +1 -0
- package/dist/contracts/StorageAdapter.js +96 -0
- package/dist/contracts/StorageAdapter.js.map +1 -0
- package/dist/contracts/StorageBackend.d.ts +310 -0
- package/dist/contracts/StorageBackend.d.ts.map +1 -0
- package/dist/contracts/StorageBackend.js +196 -0
- package/dist/contracts/StorageBackend.js.map +1 -0
- package/dist/contracts/Sync.d.ts +286 -0
- package/dist/contracts/Sync.d.ts.map +1 -0
- package/dist/contracts/Sync.js +157 -0
- package/dist/contracts/Sync.js.map +1 -0
- package/dist/contracts/Telemetry.d.ts +183 -0
- package/dist/contracts/Telemetry.d.ts.map +1 -0
- package/dist/contracts/Telemetry.js +153 -0
- package/dist/contracts/Telemetry.js.map +1 -0
- package/dist/contracts/ThemeTokens.d.ts +212 -0
- package/dist/contracts/ThemeTokens.d.ts.map +1 -0
- package/dist/contracts/ThemeTokens.js +111 -0
- package/dist/contracts/ThemeTokens.js.map +1 -0
- package/dist/contracts/ToolSource.d.ts +135 -0
- package/dist/contracts/ToolSource.d.ts.map +1 -0
- package/dist/contracts/ToolSource.js +81 -0
- package/dist/contracts/ToolSource.js.map +1 -0
- package/dist/contracts/Versioning.d.ts +363 -0
- package/dist/contracts/Versioning.d.ts.map +1 -0
- package/dist/contracts/Versioning.js +201 -0
- package/dist/contracts/Versioning.js.map +1 -0
- package/dist/contracts/View.d.ts +232 -0
- package/dist/contracts/View.d.ts.map +1 -0
- package/dist/contracts/View.js +102 -0
- package/dist/contracts/View.js.map +1 -0
- package/dist/contracts/WorkItems.d.ts +242 -0
- package/dist/contracts/WorkItems.d.ts.map +1 -0
- package/dist/contracts/WorkItems.js +126 -0
- package/dist/contracts/WorkItems.js.map +1 -0
- package/dist/contracts/Workflow.d.ts +191 -0
- package/dist/contracts/Workflow.d.ts.map +1 -0
- package/dist/contracts/Workflow.js +63 -0
- package/dist/contracts/Workflow.js.map +1 -0
- package/dist/contracts/index.d.ts +75 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +196 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/devices/module.d.ts +3777 -0
- package/dist/devices/module.d.ts.map +1 -0
- package/dist/devices/module.js +179 -0
- package/dist/devices/module.js.map +1 -0
- package/dist/drizzle/Entity.d.ts +148 -0
- package/dist/drizzle/Entity.d.ts.map +1 -0
- package/dist/drizzle/Entity.js +396 -0
- package/dist/drizzle/Entity.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
- package/schema/Actor.json +46 -0
- package/schema/AuditRecord.json +403 -0
- package/schema/DaemonHealth.json +29 -0
- package/schema/InvocationError.json +257 -0
- package/schema/InvocationReceipt.json +253 -0
- package/schema/Lockfile.json +129 -0
- package/schema/OutboxEvent.json +36 -0
- package/schema/PairingConfirm.json +33 -0
- package/schema/PairingResult.json +18 -0
- package/schema/PairingStart.json +18 -0
- package/schema/ProvenanceEntry.json +110 -0
- package/schema/ReplayEnvelope.json +269 -0
- package/schema/Surface.json +17 -0
- package/schema/codegen/LocalClient.json +1295 -0
- package/schema/codegen/Sandbox.json +320 -0
- package/schema/contracts/ActionConsent.json +1930 -0
- package/schema/contracts/ActionRegistry.json +722 -0
- package/schema/contracts/Actor.json +451 -0
- package/schema/contracts/AgentResources.json +1400 -0
- package/schema/contracts/AgentRuntime.json +4017 -0
- package/schema/contracts/Approvals.json +2916 -0
- package/schema/contracts/Audit.json +3268 -0
- package/schema/contracts/CalendarProvider.json +5557 -0
- package/schema/contracts/ClientSDK.json +1400 -0
- package/schema/contracts/CollabDocument.json +4012 -0
- package/schema/contracts/Command.json +616 -0
- package/schema/contracts/Connections.json +6687 -0
- package/schema/contracts/ContextAccounting.json +685 -0
- package/schema/contracts/Daemon.json +4555 -0
- package/schema/contracts/DbTx.json +321 -0
- package/schema/contracts/Delegation.json +949 -0
- package/schema/contracts/DeviceControl.json +2626 -0
- package/schema/contracts/Directory.json +5168 -0
- package/schema/contracts/DirectoryProvider.json +2090 -0
- package/schema/contracts/DocumentSource.json +2044 -0
- package/schema/contracts/Files.json +4122 -0
- package/schema/contracts/Flags.json +1202 -0
- package/schema/contracts/Host.json +1769 -0
- package/schema/contracts/HttpApi.json +1615 -0
- package/schema/contracts/Ingestion.json +3211 -0
- package/schema/contracts/Ingress.json +819 -0
- package/schema/contracts/Invocation.json +2044 -0
- package/schema/contracts/LocalClient.json +6642 -0
- package/schema/contracts/Locale.json +654 -0
- package/schema/contracts/MachineIdentity.json +2303 -0
- package/schema/contracts/MailProvider.json +6663 -0
- package/schema/contracts/Memory.json +579 -0
- package/schema/contracts/Messaging.json +1764 -0
- package/schema/contracts/Metering.json +3060 -0
- package/schema/contracts/ModelProvider.json +1127 -0
- package/schema/contracts/ModuleManifest.json +9449 -0
- package/schema/contracts/NotificationChannel.json +986 -0
- package/schema/contracts/Notifications.json +4280 -0
- package/schema/contracts/Outbox.json +1451 -0
- package/schema/contracts/Privacy.json +4354 -0
- package/schema/contracts/Progress.json +1524 -0
- package/schema/contracts/QuerySurface.json +661 -0
- package/schema/contracts/Readiness.json +209 -0
- package/schema/contracts/Release.json +805 -0
- package/schema/contracts/ResultRendering.json +2859 -0
- package/schema/contracts/Sandbox.json +2286 -0
- package/schema/contracts/Scheduler.json +6138 -0
- package/schema/contracts/ScreenContext.json +1238 -0
- package/schema/contracts/Search.json +1058 -0
- package/schema/contracts/Secrets.json +2444 -0
- package/schema/contracts/Settings.json +654 -0
- package/schema/contracts/Sharing.json +2854 -0
- package/schema/contracts/Slot.json +537 -0
- package/schema/contracts/Space.json +892 -0
- package/schema/contracts/StorageAdapter.json +623 -0
- package/schema/contracts/StorageBackend.json +2421 -0
- package/schema/contracts/Sync.json +894 -0
- package/schema/contracts/Telemetry.json +696 -0
- package/schema/contracts/ThemeTokens.json +547 -0
- package/schema/contracts/ToolSource.json +1333 -0
- package/schema/contracts/Versioning.json +1481 -0
- package/schema/contracts/View.json +750 -0
- package/schema/contracts/WorkItems.json +1731 -0
- package/schema/contracts/Workflow.json +1242 -0
- package/src/Agent.ts +758 -0
- package/src/Analytics.ts +110 -0
- package/src/Approval.ts +131 -0
- package/src/Catalog.ts +192 -0
- package/src/Checklist.ts +162 -0
- package/src/Data.ts +109 -0
- package/src/Devices.ts +721 -0
- package/src/Durable.ts +240 -0
- package/src/Errors.ts +111 -0
- package/src/JsonSchema.ts +166 -0
- package/src/Manifest.ts +1147 -0
- package/src/Module.ts +640 -0
- package/src/Optimistic.ts +332 -0
- package/src/Projection.ts +207 -0
- package/src/Proposals.ts +89 -0
- package/src/Receipt.ts +125 -0
- package/src/Records.ts +197 -0
- package/src/Render.ts +515 -0
- package/src/Rpc.ts +113 -0
- package/src/SearchLanguages.ts +33 -0
- package/src/Service.ts +102 -0
- package/src/Versions.ts +69 -0
- package/src/contracts/ActionConsent.ts +150 -0
- package/src/contracts/ActionRegistry.ts +39 -0
- package/src/contracts/Actor.ts +53 -0
- package/src/contracts/AgentResources.ts +167 -0
- package/src/contracts/AgentRuntime.ts +154 -0
- package/src/contracts/Approvals.ts +133 -0
- package/src/contracts/Audit.ts +160 -0
- package/src/contracts/CalendarProvider.ts +241 -0
- package/src/contracts/Capability.ts +246 -0
- package/src/contracts/ClientSDK.ts +199 -0
- package/src/contracts/CollabDocument.ts +420 -0
- package/src/contracts/Command.ts +74 -0
- package/src/contracts/Connections.ts +360 -0
- package/src/contracts/ContextAccounting.ts +35 -0
- package/src/contracts/Daemon.ts +247 -0
- package/src/contracts/DbTx.ts +110 -0
- package/src/contracts/Delegation.ts +91 -0
- package/src/contracts/DeviceControl.ts +143 -0
- package/src/contracts/Directory.ts +384 -0
- package/src/contracts/DirectoryProvider.ts +82 -0
- package/src/contracts/DocumentSource.ts +71 -0
- package/src/contracts/Files.ts +395 -0
- package/src/contracts/Flags.ts +241 -0
- package/src/contracts/Host.ts +245 -0
- package/src/contracts/HttpApi.ts +100 -0
- package/src/contracts/Ingestion.ts +315 -0
- package/src/contracts/Ingress.ts +132 -0
- package/src/contracts/Invocation.ts +122 -0
- package/src/contracts/LocalClient.ts +614 -0
- package/src/contracts/Locale.ts +133 -0
- package/src/contracts/MachineIdentity.ts +305 -0
- package/src/contracts/MailProvider.ts +272 -0
- package/src/contracts/Memory.ts +47 -0
- package/src/contracts/Messaging.ts +108 -0
- package/src/contracts/Metering.ts +231 -0
- package/src/contracts/ModelProvider.ts +87 -0
- package/src/contracts/ModuleManifest.ts +310 -0
- package/src/contracts/NotificationChannel.ts +158 -0
- package/src/contracts/Notifications.ts +309 -0
- package/src/contracts/Outbox.ts +246 -0
- package/src/contracts/Privacy.ts +502 -0
- package/src/contracts/Progress.ts +196 -0
- package/src/contracts/QuerySurface.ts +134 -0
- package/src/contracts/Readiness.ts +67 -0
- package/src/contracts/Release.ts +199 -0
- package/src/contracts/ResultRendering.ts +65 -0
- package/src/contracts/Sandbox.ts +648 -0
- package/src/contracts/Scheduler.ts +237 -0
- package/src/contracts/ScreenContext.ts +316 -0
- package/src/contracts/Search.ts +126 -0
- package/src/contracts/Secrets.ts +162 -0
- package/src/contracts/Settings.ts +207 -0
- package/src/contracts/Sharing.ts +205 -0
- package/src/contracts/Slot.ts +61 -0
- package/src/contracts/Space.ts +157 -0
- package/src/contracts/StorageAdapter.ts +104 -0
- package/src/contracts/StorageBackend.ts +220 -0
- package/src/contracts/Sync.ts +180 -0
- package/src/contracts/Telemetry.ts +177 -0
- package/src/contracts/ThemeTokens.ts +136 -0
- package/src/contracts/ToolSource.ts +94 -0
- package/src/contracts/Versioning.ts +237 -0
- package/src/contracts/View.ts +116 -0
- package/src/contracts/WorkItems.ts +144 -0
- package/src/contracts/Workflow.ts +67 -0
- package/src/contracts/index.ts +205 -0
- package/src/devices/module.ts +201 -0
- package/src/drizzle/Entity.ts +524 -0
- package/src/index.ts +19 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalendarProvider: a person's calendars at a provider (Microsoft Graph, Google Calendar), over a kernel
|
|
3
|
+
* Connection: listing and querying as well as booking-side writes (ledger C-113, C-120). See
|
|
4
|
+
* docs/contracts/calendar-provider.md.
|
|
5
|
+
*/
|
|
6
|
+
import { Schema } from "effect"
|
|
7
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
8
|
+
import {
|
|
9
|
+
CapabilityError,
|
|
10
|
+
DeltaRequest,
|
|
11
|
+
deltaPageOf,
|
|
12
|
+
EmailAddress,
|
|
13
|
+
PageRequest,
|
|
14
|
+
ProviderApiAnswer,
|
|
15
|
+
ProviderApiRead,
|
|
16
|
+
ProviderApiWrite,
|
|
17
|
+
changeOf,
|
|
18
|
+
} from "./Capability.ts"
|
|
19
|
+
|
|
20
|
+
export const Calendar = Schema.Struct({
|
|
21
|
+
id: Schema.String,
|
|
22
|
+
name: Schema.String,
|
|
23
|
+
isPrimary: Schema.Boolean,
|
|
24
|
+
canEdit: Schema.Boolean,
|
|
25
|
+
})
|
|
26
|
+
export type Calendar = typeof Calendar.Type
|
|
27
|
+
|
|
28
|
+
export const Attendee = Schema.Struct({
|
|
29
|
+
...EmailAddress.fields,
|
|
30
|
+
response: Schema.Literals(["none", "accepted", "declined", "tentative"]),
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
export const CalendarEvent = Schema.Struct({
|
|
34
|
+
id: Schema.String,
|
|
35
|
+
calendarId: Schema.String,
|
|
36
|
+
title: Schema.String,
|
|
37
|
+
description: Schema.NullOr(Schema.String),
|
|
38
|
+
location: Schema.NullOr(Schema.String),
|
|
39
|
+
/** ISO 8601 instants in UTC; for an all-day event, dates (`YYYY-MM-DD`), the end exclusive. */
|
|
40
|
+
start: Schema.String,
|
|
41
|
+
end: Schema.String,
|
|
42
|
+
allDay: Schema.Boolean,
|
|
43
|
+
attendees: Schema.Array(Attendee),
|
|
44
|
+
organizer: Schema.NullOr(EmailAddress),
|
|
45
|
+
status: Schema.Literals(["confirmed", "tentative", "cancelled"]),
|
|
46
|
+
/** The recurring series this occurrence belongs to, if any. */
|
|
47
|
+
seriesId: Schema.NullOr(Schema.String),
|
|
48
|
+
/**
|
|
49
|
+
* The account's own part in the event, as the provider records it for the account itself (Graph's
|
|
50
|
+
* `responseStatus`, Google's `self` entries), never matched by address: `organizer`, or its answer to the
|
|
51
|
+
* invitation (`none` until it answers). Null when the provider says the account has no part in it; absent when the
|
|
52
|
+
* connector cannot tell.
|
|
53
|
+
*/
|
|
54
|
+
selfResponse: Schema.optionalKey(
|
|
55
|
+
Schema.NullOr(Schema.Literals(["organizer", "none", "accepted", "declined", "tentative"])),
|
|
56
|
+
),
|
|
57
|
+
})
|
|
58
|
+
export type CalendarEvent = typeof CalendarEvent.Type
|
|
59
|
+
|
|
60
|
+
export const CalendarFlags = Schema.Struct({
|
|
61
|
+
recurrence: Schema.Boolean,
|
|
62
|
+
attendees: Schema.Boolean,
|
|
63
|
+
pushNotifications: Schema.Boolean,
|
|
64
|
+
/**
|
|
65
|
+
* The provider's delta covers a time window around now (Graph's calendarView delta), not every event: events
|
|
66
|
+
* outside it are not reported. Null when delta covers the whole calendar (Google sync tokens).
|
|
67
|
+
*/
|
|
68
|
+
deltaWindow: Schema.NullOr(Schema.Struct({ pastDays: Schema.Int, futureDays: Schema.Int })),
|
|
69
|
+
})
|
|
70
|
+
export type CalendarFlags = typeof CalendarFlags.Type
|
|
71
|
+
|
|
72
|
+
const CalendarId = { calendarId: Schema.optionalKey(Schema.NullOr(Schema.String)) }
|
|
73
|
+
|
|
74
|
+
const EventFields = {
|
|
75
|
+
title: Schema.String,
|
|
76
|
+
description: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
77
|
+
location: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
78
|
+
start: Schema.String,
|
|
79
|
+
end: Schema.String,
|
|
80
|
+
allDay: Schema.optionalKey(Schema.Boolean),
|
|
81
|
+
attendees: Schema.optionalKey(Schema.Array(EmailAddress)),
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** An attendee's answer to an invitation (`respondToEvent`). */
|
|
85
|
+
export const EventResponse = Schema.Literals(["accepted", "declined", "tentative"])
|
|
86
|
+
export type EventResponse = typeof EventResponse.Type
|
|
87
|
+
|
|
88
|
+
/** A stretch of time someone is busy, with no details (`freeBusy`). */
|
|
89
|
+
export const BusyBlock = Schema.Struct({
|
|
90
|
+
/** ISO 8601 instants in UTC. */
|
|
91
|
+
start: Schema.String,
|
|
92
|
+
end: Schema.String,
|
|
93
|
+
/** `tentative` when the provider says so (Graph); Google reports only `busy`. */
|
|
94
|
+
show: Schema.Literals(["busy", "tentative"]),
|
|
95
|
+
})
|
|
96
|
+
export type BusyBlock = typeof BusyBlock.Type
|
|
97
|
+
|
|
98
|
+
/** One address's busy time (`freeBusy`): `known` false when the provider cannot tell for it (no access, unknown). */
|
|
99
|
+
export const Schedule = Schema.Struct({
|
|
100
|
+
address: Schema.String,
|
|
101
|
+
known: Schema.Boolean,
|
|
102
|
+
busy: Schema.Array(BusyBlock),
|
|
103
|
+
})
|
|
104
|
+
export type Schedule = typeof Schedule.Type
|
|
105
|
+
|
|
106
|
+
export const CalendarChange = changeOf(CalendarEvent)
|
|
107
|
+
export const CalendarDeltaPage = deltaPageOf(CalendarEvent)
|
|
108
|
+
|
|
109
|
+
export const CalendarProviderContract = defineServiceContract({
|
|
110
|
+
name: "CalendarProvider",
|
|
111
|
+
kind: "capability",
|
|
112
|
+
version: "1.4.0",
|
|
113
|
+
description:
|
|
114
|
+
"A person's calendars at a provider, over a kernel Connection: calendars, events in a time range, people's busy time by address, event writes, the account's answer to an invitation, cursor-based delta sync of a calendar (by default the primary one), and bounded raw requests to the provider's calendar API for what the rest does not model. Operations need calendar.read or calendar.write and fail only with the standard capability errors.",
|
|
115
|
+
operations: {
|
|
116
|
+
listCalendars: defineOperation({
|
|
117
|
+
description: "The calendars the account can see.",
|
|
118
|
+
input: Schema.Struct({}),
|
|
119
|
+
output: Schema.Struct({ calendars: Schema.Array(Calendar) }),
|
|
120
|
+
errors: CapabilityError,
|
|
121
|
+
scopes: ["calendar.read"],
|
|
122
|
+
}),
|
|
123
|
+
listEvents: defineOperation({
|
|
124
|
+
description:
|
|
125
|
+
"Events overlapping [start, end) in a calendar (default: the primary one), recurring series expanded into occurrences (Graph calendarView; Google singleEvents).",
|
|
126
|
+
input: Schema.Struct({ ...CalendarId, start: Schema.String, end: Schema.String, ...PageRequest }),
|
|
127
|
+
output: Schema.Struct({ events: Schema.Array(CalendarEvent), nextPageToken: Schema.NullOr(Schema.String) }),
|
|
128
|
+
errors: CapabilityError,
|
|
129
|
+
scopes: ["calendar.read"],
|
|
130
|
+
}),
|
|
131
|
+
freeBusy: defineOperation({
|
|
132
|
+
description:
|
|
133
|
+
"When people are busy between `start` and `end`, by address (the account's own included), as the provider shares it with the account: times only, never what the events are (Graph getSchedule; Google freeBusy). An address the provider will not tell about (outside the organisation, no access, unknown) is `known: false` with no busy time, never refused.",
|
|
134
|
+
input: Schema.Struct({
|
|
135
|
+
addresses: Schema.Array(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(320))).check(
|
|
136
|
+
Schema.isMinLength(1),
|
|
137
|
+
Schema.isMaxLength(50),
|
|
138
|
+
),
|
|
139
|
+
start: Schema.String,
|
|
140
|
+
end: Schema.String,
|
|
141
|
+
}),
|
|
142
|
+
output: Schema.Struct({ schedules: Schema.Array(Schedule) }),
|
|
143
|
+
errors: CapabilityError,
|
|
144
|
+
scopes: ["calendar.read"],
|
|
145
|
+
}),
|
|
146
|
+
getEvent: defineOperation({
|
|
147
|
+
description: "One event.",
|
|
148
|
+
input: Schema.Struct({ ...CalendarId, id: Schema.String }),
|
|
149
|
+
output: CalendarEvent,
|
|
150
|
+
errors: CapabilityError,
|
|
151
|
+
scopes: ["calendar.read"],
|
|
152
|
+
}),
|
|
153
|
+
createEvent: defineOperation({
|
|
154
|
+
description: "Create an event.",
|
|
155
|
+
input: Schema.Struct({ ...CalendarId, ...EventFields }),
|
|
156
|
+
output: CalendarEvent,
|
|
157
|
+
errors: CapabilityError,
|
|
158
|
+
scopes: ["calendar.write"],
|
|
159
|
+
// Attendees are invited; creating twice makes two events.
|
|
160
|
+
effect: "external",
|
|
161
|
+
}),
|
|
162
|
+
updateEvent: defineOperation({
|
|
163
|
+
description: "Change an event's fields (only those given).",
|
|
164
|
+
input: Schema.Struct({
|
|
165
|
+
...CalendarId,
|
|
166
|
+
id: Schema.String,
|
|
167
|
+
title: Schema.optionalKey(Schema.String),
|
|
168
|
+
description: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
169
|
+
location: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
170
|
+
start: Schema.optionalKey(Schema.String),
|
|
171
|
+
end: Schema.optionalKey(Schema.String),
|
|
172
|
+
}),
|
|
173
|
+
output: CalendarEvent,
|
|
174
|
+
errors: CapabilityError,
|
|
175
|
+
scopes: ["calendar.write"],
|
|
176
|
+
// Attendees are told: at most once (a run interrupted mid-call is reconciled by reading the event back).
|
|
177
|
+
effect: "external",
|
|
178
|
+
}),
|
|
179
|
+
deleteEvent: defineOperation({
|
|
180
|
+
description: "Delete (cancel) an event.",
|
|
181
|
+
input: Schema.Struct({ ...CalendarId, id: Schema.String }),
|
|
182
|
+
output: Schema.Struct({}),
|
|
183
|
+
errors: CapabilityError,
|
|
184
|
+
scopes: ["calendar.write"],
|
|
185
|
+
// Attendees are told of the cancellation: at most once (reconciled by reading the event back).
|
|
186
|
+
effect: "external",
|
|
187
|
+
}),
|
|
188
|
+
respondToEvent: defineOperation({
|
|
189
|
+
description:
|
|
190
|
+
"Answer an invitation as the account: accept, decline or tentatively accept an event the account is invited to (Graph's accept, decline and tentativelyAccept; Google's attendee responseStatus), telling the organiser. InvalidInput when the account is not an attendee (an organiser does not answer their own event).",
|
|
191
|
+
input: Schema.Struct({
|
|
192
|
+
...CalendarId,
|
|
193
|
+
id: Schema.String,
|
|
194
|
+
response: EventResponse,
|
|
195
|
+
comment: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
196
|
+
}),
|
|
197
|
+
output: Schema.Struct({}),
|
|
198
|
+
errors: CapabilityError,
|
|
199
|
+
scopes: ["calendar.write"],
|
|
200
|
+
// The organiser is told: at most once (reconciled by reading the account's own answer back, `selfResponse`).
|
|
201
|
+
effect: "external",
|
|
202
|
+
}),
|
|
203
|
+
delta: defineOperation({
|
|
204
|
+
description:
|
|
205
|
+
"Changes to a calendar's events since `cursor`: upserts for created and changed events, deletes for deleted or cancelled ones. `cursor: null` is a full sync. InvalidCursor (Google's 410 Gone on a sync token, Graph's expired delta token) means start again from null. Graph's delta covers the window in the flags.",
|
|
206
|
+
input: Schema.Struct({ ...DeltaRequest.fields, ...CalendarId }),
|
|
207
|
+
output: CalendarDeltaPage,
|
|
208
|
+
errors: CapabilityError,
|
|
209
|
+
scopes: ["calendar.read"],
|
|
210
|
+
}),
|
|
211
|
+
apiRead: defineOperation({
|
|
212
|
+
description:
|
|
213
|
+
"A raw GET to the provider's calendar API, for what the other operations do not model: `path` under the connector's calendar API base (Google: `<calendar>/calendar/v3`; Graph: `<graph>/v1.0/me` and only its calendar paths), refused before it is sent otherwise. The answer is bounded (1 MiB; larger is InvalidInput). Provider failures are the standard errors.",
|
|
214
|
+
input: ProviderApiRead,
|
|
215
|
+
output: ProviderApiAnswer,
|
|
216
|
+
errors: CapabilityError,
|
|
217
|
+
scopes: ["calendar.read"],
|
|
218
|
+
}),
|
|
219
|
+
apiWrite: defineOperation({
|
|
220
|
+
description:
|
|
221
|
+
"A raw POST, PUT, PATCH or DELETE to the provider's calendar API, under the same bounds as `apiRead`, with a JSON body of at most 64 KiB. What it does is the provider's: it may invite or tell others.",
|
|
222
|
+
input: ProviderApiWrite,
|
|
223
|
+
output: ProviderApiAnswer,
|
|
224
|
+
errors: CapabilityError,
|
|
225
|
+
scopes: ["calendar.write"],
|
|
226
|
+
// It may invite or tell attendees: at most once, never reconciled (unknown after an uncertain run).
|
|
227
|
+
effect: "external",
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
types: {
|
|
231
|
+
Calendar,
|
|
232
|
+
CalendarEvent,
|
|
233
|
+
CalendarFlags,
|
|
234
|
+
CalendarChange,
|
|
235
|
+
CalendarDeltaPage,
|
|
236
|
+
Attendee,
|
|
237
|
+
EventResponse,
|
|
238
|
+
BusyBlock,
|
|
239
|
+
Schedule,
|
|
240
|
+
},
|
|
241
|
+
})
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every capability contract (MailProvider, CalendarProvider, DirectoryProvider, DocumentSource, Messaging)
|
|
3
|
+
* shares: the standard error set a connector reports, cursor-based delta sync, and how operations name the
|
|
4
|
+
* scopes they need. See docs/contracts/README.md ("Capability contracts").
|
|
5
|
+
*
|
|
6
|
+
* A capability operation runs over a kernel Connection (the Connections contract): the kernel resolves the
|
|
7
|
+
* Connection's grant, refreshes it, applies the connection's backpressure (Metering), and turns the provider's
|
|
8
|
+
* answer into these errors. A connector never handles tokens itself.
|
|
9
|
+
*/
|
|
10
|
+
import { Schema } from "effect"
|
|
11
|
+
import { InvalidInput } from "../Errors.ts"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The provider refused the credential (HTTP 401): the access token is invalid. The kernel has already refreshed
|
|
15
|
+
* the grant once and retried; this error means that failed too, and the Connection now needs reauthorisation
|
|
16
|
+
* (its owner was notified). Calls fail fast with it until the owner reconnects.
|
|
17
|
+
*/
|
|
18
|
+
export class Unauthorized extends Schema.TaggedError<Unauthorized>()(
|
|
19
|
+
"Unauthorized",
|
|
20
|
+
{
|
|
21
|
+
message: Schema.String,
|
|
22
|
+
connectionId: Schema.String,
|
|
23
|
+
/** Always true: the Connection is marked as needing reauthorisation. */
|
|
24
|
+
reauthorize: Schema.Boolean,
|
|
25
|
+
},
|
|
26
|
+
{ httpApiStatus: 401 },
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
/** How to ask for the missing scopes: incremental consent on the same Connection. */
|
|
30
|
+
export const ConsentOffer = Schema.Struct({
|
|
31
|
+
/** The action that starts incremental consent (`connections.reconnect`). */
|
|
32
|
+
action: Schema.String,
|
|
33
|
+
connectionId: Schema.String,
|
|
34
|
+
/** The provider scopes to add. */
|
|
35
|
+
scopes: Schema.Array(Schema.String),
|
|
36
|
+
})
|
|
37
|
+
export type ConsentOffer = typeof ConsentOffer.Type
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The provider refused the operation (HTTP 403): the credential is valid but lacks a permission or a scope. The
|
|
41
|
+
* kernel never refreshes on a 403. `missingScopes` names the provider scopes the operation needs that the grant
|
|
42
|
+
* lacks (empty when the refusal is not about scopes, for example a mailbox the account may not open), and
|
|
43
|
+
* `consent` offers incremental consent for them.
|
|
44
|
+
*/
|
|
45
|
+
export class ProviderForbidden extends Schema.TaggedError<ProviderForbidden>()(
|
|
46
|
+
"Forbidden",
|
|
47
|
+
{
|
|
48
|
+
message: Schema.String,
|
|
49
|
+
connectionId: Schema.String,
|
|
50
|
+
missingScopes: Schema.Array(Schema.String),
|
|
51
|
+
consent: Schema.NullOr(ConsentOffer),
|
|
52
|
+
},
|
|
53
|
+
{ httpApiStatus: 403 },
|
|
54
|
+
) {}
|
|
55
|
+
|
|
56
|
+
/** The item does not exist at the provider (or the account cannot see it). */
|
|
57
|
+
export class NotFound extends Schema.TaggedError<NotFound>()(
|
|
58
|
+
"NotFound",
|
|
59
|
+
{ message: Schema.String, id: Schema.NullOr(Schema.String) },
|
|
60
|
+
{ httpApiStatus: 404 },
|
|
61
|
+
) {}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The provider asked the caller to slow down (429, or 503 with `Retry-After`), or the connection's own quota is
|
|
65
|
+
* spent, and the wait is longer than the caller's budget. `retryAfterMs` and `retryAt` say when to try again; the
|
|
66
|
+
* cooldown is shared by every process using the Connection.
|
|
67
|
+
*/
|
|
68
|
+
export class RateLimited extends Schema.TaggedError<RateLimited>()(
|
|
69
|
+
"RateLimited",
|
|
70
|
+
{
|
|
71
|
+
message: Schema.String,
|
|
72
|
+
retryAfterMs: Schema.Number,
|
|
73
|
+
retryAt: Schema.String,
|
|
74
|
+
/** `retry-after` (the provider said so), `cooldown` (another call did), `quota` (the connection's quota), `max-attempts`. */
|
|
75
|
+
reason: Schema.Literals(["retry-after", "cooldown", "quota", "max-attempts"]),
|
|
76
|
+
},
|
|
77
|
+
{ httpApiStatus: 429 },
|
|
78
|
+
) {}
|
|
79
|
+
|
|
80
|
+
/** The change conflicts with the item's current state (412 precondition, 409). */
|
|
81
|
+
export class Conflict extends Schema.TaggedError<Conflict>()(
|
|
82
|
+
"Conflict",
|
|
83
|
+
{ message: Schema.String },
|
|
84
|
+
{ httpApiStatus: 409 },
|
|
85
|
+
) {}
|
|
86
|
+
|
|
87
|
+
/** The provider is unavailable (5xx, a network failure); `retryAfterMs` when it said when to come back. */
|
|
88
|
+
export class Unavailable extends Schema.TaggedError<Unavailable>()(
|
|
89
|
+
"Unavailable",
|
|
90
|
+
{
|
|
91
|
+
message: Schema.String,
|
|
92
|
+
retryAfterMs: Schema.NullOr(Schema.Number),
|
|
93
|
+
/**
|
|
94
|
+
* `false`: the operation failed before it sent anything that changes the provider (a read it needs first, such as
|
|
95
|
+
* Gmail's check of the send-as addresses before a send), so nothing was done and it is safe to run again. Absent:
|
|
96
|
+
* it may have acted ("a write is never hidden").
|
|
97
|
+
*/
|
|
98
|
+
dispatched: Schema.optionalKey(Schema.Literal(false)),
|
|
99
|
+
},
|
|
100
|
+
{ httpApiStatus: 503 },
|
|
101
|
+
) {}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The delta cursor is no longer valid at the provider (an expired history id, a 410 Gone sync token): start a
|
|
105
|
+
* full resync from `cursor: null`.
|
|
106
|
+
*/
|
|
107
|
+
export class InvalidCursor extends Schema.TaggedError<InvalidCursor>()(
|
|
108
|
+
"InvalidCursor",
|
|
109
|
+
{ message: Schema.String },
|
|
110
|
+
{ httpApiStatus: 410 },
|
|
111
|
+
) {}
|
|
112
|
+
|
|
113
|
+
/** The standard error set every capability operation may fail with (plus `InvalidInput` for a malformed request). */
|
|
114
|
+
export const CapabilityError = Schema.Union([
|
|
115
|
+
Unauthorized,
|
|
116
|
+
ProviderForbidden,
|
|
117
|
+
NotFound,
|
|
118
|
+
RateLimited,
|
|
119
|
+
Conflict,
|
|
120
|
+
Unavailable,
|
|
121
|
+
InvalidCursor,
|
|
122
|
+
InvalidInput,
|
|
123
|
+
])
|
|
124
|
+
export type CapabilityError = typeof CapabilityError.Type
|
|
125
|
+
|
|
126
|
+
/** The tags of the standard capability errors. */
|
|
127
|
+
export const capabilityErrorTags = [
|
|
128
|
+
"Unauthorized",
|
|
129
|
+
"Forbidden",
|
|
130
|
+
"NotFound",
|
|
131
|
+
"RateLimited",
|
|
132
|
+
"Conflict",
|
|
133
|
+
"Unavailable",
|
|
134
|
+
"InvalidCursor",
|
|
135
|
+
"InvalidInput",
|
|
136
|
+
] as const
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A delta request. `cursor: null` starts a full sync: every item in scope is returned as an upsert, and the first
|
|
140
|
+
* page has `reset: true`. Otherwise `cursor` is an opaque value a previous page returned.
|
|
141
|
+
*/
|
|
142
|
+
export const DeltaRequest = Schema.Struct({
|
|
143
|
+
cursor: Schema.NullOr(Schema.String),
|
|
144
|
+
/** A hint: at most this many changes per page (providers may return fewer). */
|
|
145
|
+
pageSize: Schema.optionalKey(Schema.Int),
|
|
146
|
+
})
|
|
147
|
+
export type DeltaRequest = typeof DeltaRequest.Type
|
|
148
|
+
|
|
149
|
+
/** One change: an item created or changed (`upsert`, with the item as it is now), or gone from the scope (`delete`). */
|
|
150
|
+
export const changeOf = <S extends Schema.Top>(item: S) =>
|
|
151
|
+
Schema.Union([
|
|
152
|
+
Schema.Struct({ kind: Schema.Literal("upsert"), id: Schema.String, item }),
|
|
153
|
+
Schema.Struct({ kind: Schema.Literal("delete"), id: Schema.String }),
|
|
154
|
+
])
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* One page of delta. `cursor` is opaque and is where the next page starts; a consumer commits it together with
|
|
158
|
+
* the page's changes, so it resumes from the last committed cursor after a crash with nothing lost and nothing
|
|
159
|
+
* applied twice. `hasMore: false` means the consumer is up to date (the cursor then waits for new changes).
|
|
160
|
+
* `reset: true` (only on the first page of a full sync) means the pages that follow, up to `hasMore: false`, are
|
|
161
|
+
* the complete scope: the consumer replaces what it holds.
|
|
162
|
+
*/
|
|
163
|
+
export const deltaPageOf = <S extends Schema.Top>(item: S) =>
|
|
164
|
+
Schema.Struct({
|
|
165
|
+
changes: Schema.Array(changeOf(item)),
|
|
166
|
+
cursor: Schema.String,
|
|
167
|
+
hasMore: Schema.Boolean,
|
|
168
|
+
reset: Schema.Boolean,
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
/** The pages of a list operation: `pageToken` from the previous page's `nextPageToken`. */
|
|
172
|
+
export const PageRequest = {
|
|
173
|
+
pageToken: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
174
|
+
pageSize: Schema.optionalKey(Schema.Int),
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const EmailAddress = Schema.Struct({ name: Schema.NullOr(Schema.String), address: Schema.String })
|
|
178
|
+
export type EmailAddress = typeof EmailAddress.Type
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* A raw request to the provider's own API over the Connection: the escape hatch for what a capability's operations do
|
|
182
|
+
* not model (CalendarProvider's `apiRead` and `apiWrite`). The connector names the API's base URL and the paths under
|
|
183
|
+
* it a request may reach; the kernel refuses anything else before it is sent, sends it through the outbound
|
|
184
|
+
* destination policy (pinned to the addresses it checked), and bounds the body and the answer
|
|
185
|
+
* (docs/contracts/connections.md, "Raw provider requests").
|
|
186
|
+
*/
|
|
187
|
+
export const PROVIDER_API_MAX_REQUEST_BYTES = 64 * 1024
|
|
188
|
+
export const PROVIDER_API_MAX_RESPONSE_BYTES = 1024 * 1024
|
|
189
|
+
|
|
190
|
+
/** A raw request's path and query (a read: GET). */
|
|
191
|
+
export const ProviderApiRead = Schema.Struct({
|
|
192
|
+
/** Under the API's base URL (`/calendars/primary/events`), no query; `..`, `//` and encoded separators refused. */
|
|
193
|
+
path: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2048)),
|
|
194
|
+
query: Schema.optionalKey(
|
|
195
|
+
Schema.Record(
|
|
196
|
+
Schema.String.check(Schema.isMaxLength(256)),
|
|
197
|
+
Schema.Union([
|
|
198
|
+
Schema.String.check(Schema.isMaxLength(2048)),
|
|
199
|
+
Schema.Array(Schema.String.check(Schema.isMaxLength(2048))).check(Schema.isMaxLength(50)),
|
|
200
|
+
]),
|
|
201
|
+
),
|
|
202
|
+
),
|
|
203
|
+
})
|
|
204
|
+
export type ProviderApiRead = typeof ProviderApiRead.Type
|
|
205
|
+
|
|
206
|
+
/** The methods a raw write may use. HEAD, OPTIONS, TRACE, CONNECT and anything else are refused. */
|
|
207
|
+
export const ProviderApiWriteMethod = Schema.Literals(["POST", "PUT", "PATCH", "DELETE"])
|
|
208
|
+
|
|
209
|
+
/** A raw write: a method, a path and query, and a JSON body (at most PROVIDER_API_MAX_REQUEST_BYTES encoded). */
|
|
210
|
+
export const ProviderApiWrite = Schema.Struct({
|
|
211
|
+
method: ProviderApiWriteMethod,
|
|
212
|
+
...ProviderApiRead.fields,
|
|
213
|
+
body: Schema.optionalKey(Schema.Unknown),
|
|
214
|
+
})
|
|
215
|
+
export type ProviderApiWrite = typeof ProviderApiWrite.Type
|
|
216
|
+
|
|
217
|
+
/** What a raw request answered (a 2xx or 3xx; failures are the standard capability errors). */
|
|
218
|
+
export const ProviderApiAnswer = Schema.Struct({
|
|
219
|
+
status: Schema.Int,
|
|
220
|
+
/** The parsed JSON, else the text, else null. */
|
|
221
|
+
body: Schema.Unknown,
|
|
222
|
+
})
|
|
223
|
+
export type ProviderApiAnswer = typeof ProviderApiAnswer.Type
|
|
224
|
+
|
|
225
|
+
/** The capabilities decisions.md requires now, by the short name connectors and Connections use. */
|
|
226
|
+
export const CapabilityName = Schema.Literals([
|
|
227
|
+
"mail",
|
|
228
|
+
"calendar",
|
|
229
|
+
"directory",
|
|
230
|
+
"documents",
|
|
231
|
+
"messaging",
|
|
232
|
+
"tools",
|
|
233
|
+
"api",
|
|
234
|
+
])
|
|
235
|
+
export type CapabilityName = typeof CapabilityName.Type
|
|
236
|
+
|
|
237
|
+
/** The contract each capability name implements. */
|
|
238
|
+
export const capabilityContracts: Readonly<Record<CapabilityName, string>> = {
|
|
239
|
+
mail: "MailProvider",
|
|
240
|
+
calendar: "CalendarProvider",
|
|
241
|
+
directory: "DirectoryProvider",
|
|
242
|
+
documents: "DocumentSource",
|
|
243
|
+
messaging: "Messaging",
|
|
244
|
+
tools: "ToolSource",
|
|
245
|
+
api: "HttpApi",
|
|
246
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClientSDK (a shell contract): the headless client SDK every app's UI, and every headless app, is built on.
|
|
3
|
+
* It signs a person in, calls the app's actions through a typed client projected from the action registry,
|
|
4
|
+
* keeps a policy-scoped local replica in sync, talks to the person's agent, switches between the person's
|
|
5
|
+
* organisations, and handles version skew with the kernel. It uses only web-standard APIs, so the same SDK
|
|
6
|
+
* runs in browsers, Tauri, Bun, Node and React Native (decision 8).
|
|
7
|
+
*
|
|
8
|
+
* The operations below are the SDK's functions as language-neutral records; the TypeScript SDK is
|
|
9
|
+
* `@eloxiv/client` (`signIn`, `makeClient`, `connectSync`, `makeAgentClient`, ...). Documented in
|
|
10
|
+
* docs/contracts/client-sdk.md; conformance kit `@eloxiv/testing/conformance/ClientSDK`, which runs against a
|
|
11
|
+
* real kernel and sync server.
|
|
12
|
+
*/
|
|
13
|
+
import { Schema } from "effect"
|
|
14
|
+
import { SentMessage } from "../Agent.ts"
|
|
15
|
+
import { ClientOutdated, Forbidden, InvalidInput, Unauthenticated, UnknownAction } from "../Errors.ts"
|
|
16
|
+
import { defineServiceContract } from "../Service.ts"
|
|
17
|
+
import { ReleaseInfo } from "./Release.ts"
|
|
18
|
+
import { ScreenSnapshot } from "./ScreenContext.ts"
|
|
19
|
+
|
|
20
|
+
/** A signed-in session: the bearer token every other call carries, and who it belongs to. */
|
|
21
|
+
export const ClientSession = Schema.Struct({
|
|
22
|
+
token: Schema.String,
|
|
23
|
+
user: Schema.Struct({ id: Schema.String, email: Schema.String, name: Schema.String }),
|
|
24
|
+
})
|
|
25
|
+
export type ClientSession = typeof ClientSession.Type
|
|
26
|
+
|
|
27
|
+
/** One organisation the signed-in person belongs to, with their roles there. */
|
|
28
|
+
export const ClientOrganization = Schema.Struct({
|
|
29
|
+
orgId: Schema.String,
|
|
30
|
+
name: Schema.String,
|
|
31
|
+
roles: Schema.Array(Schema.String),
|
|
32
|
+
})
|
|
33
|
+
export type ClientOrganization = typeof ClientOrganization.Type
|
|
34
|
+
|
|
35
|
+
/** Sign-in refused, or a session the kernel no longer accepts (status 401). */
|
|
36
|
+
export class AuthFailed extends Schema.TaggedError<AuthFailed>()("AuthFailed", {
|
|
37
|
+
message: Schema.String,
|
|
38
|
+
status: Schema.Number,
|
|
39
|
+
}) {}
|
|
40
|
+
|
|
41
|
+
/** What every call is sent with: the session's token, the organisation to act in, and the SDK build's version. */
|
|
42
|
+
export const CallContext = Schema.Struct({
|
|
43
|
+
token: Schema.String,
|
|
44
|
+
orgId: Schema.optionalKey(Schema.String),
|
|
45
|
+
clientVersion: Schema.optionalKey(Schema.String),
|
|
46
|
+
})
|
|
47
|
+
export type CallContext = typeof CallContext.Type
|
|
48
|
+
|
|
49
|
+
export const ClientSDKContract = defineServiceContract({
|
|
50
|
+
name: "ClientSDK",
|
|
51
|
+
kind: "shell",
|
|
52
|
+
version: "1.4.0",
|
|
53
|
+
description:
|
|
54
|
+
"The headless client SDK: sign-in and sign-out (sessions the kernel revokes), the person's organisations and " +
|
|
55
|
+
"switching between them (calls and the replica act in the selected one; a replica per person and " +
|
|
56
|
+
"organisation), typed action calls projected from the action registry (the result envelope; the standard " +
|
|
57
|
+
"errors), a policy-scoped local replica kept in sync, the agent client, and version skew (an outdated build's " +
|
|
58
|
+
"writes are ClientOutdated, its reads keep working). Web-standard APIs only.",
|
|
59
|
+
operations: {
|
|
60
|
+
signIn: {
|
|
61
|
+
description: "Sign in with email and password; the session's bearer token authenticates every other call.",
|
|
62
|
+
input: Schema.Struct({ email: Schema.String, password: Schema.String }),
|
|
63
|
+
output: ClientSession,
|
|
64
|
+
errors: AuthFailed,
|
|
65
|
+
},
|
|
66
|
+
signUp: {
|
|
67
|
+
description: "Create an account and sign in.",
|
|
68
|
+
input: Schema.Struct({ email: Schema.String, password: Schema.String, name: Schema.String }),
|
|
69
|
+
output: ClientSession,
|
|
70
|
+
errors: AuthFailed,
|
|
71
|
+
},
|
|
72
|
+
signOut: {
|
|
73
|
+
description: "Revoke the session on the server: its token stops authenticating everywhere at once.",
|
|
74
|
+
input: Schema.Struct({ token: Schema.String }),
|
|
75
|
+
output: Schema.Struct({}),
|
|
76
|
+
errors: AuthFailed,
|
|
77
|
+
},
|
|
78
|
+
organizations: {
|
|
79
|
+
description: "The organisations the person belongs to, oldest membership first (the default for calls).",
|
|
80
|
+
input: Schema.Struct({ token: Schema.String }),
|
|
81
|
+
output: Schema.Array(ClientOrganization),
|
|
82
|
+
errors: AuthFailed,
|
|
83
|
+
},
|
|
84
|
+
call: {
|
|
85
|
+
description:
|
|
86
|
+
"Call an action by name with its input, in the context's organisation: the result envelope " +
|
|
87
|
+
"(`{ kind: 'output', output }`, or a replay receipt with an idempotency key), or the standard error.",
|
|
88
|
+
input: Schema.Struct({
|
|
89
|
+
context: CallContext,
|
|
90
|
+
action: Schema.String,
|
|
91
|
+
input: Schema.Unknown,
|
|
92
|
+
idempotencyKey: Schema.optionalKey(Schema.String),
|
|
93
|
+
}),
|
|
94
|
+
output: Schema.Unknown,
|
|
95
|
+
errors: Schema.Union([Unauthenticated, Forbidden, InvalidInput, UnknownAction, ClientOutdated]),
|
|
96
|
+
},
|
|
97
|
+
sync: {
|
|
98
|
+
description:
|
|
99
|
+
"Open the local replica for the person in the context's organisation (its own storage per person and " +
|
|
100
|
+
"organisation), and run a named query against it: only rows the person may read in that organisation " +
|
|
101
|
+
"arrive, and they keep arriving as other clients write.",
|
|
102
|
+
input: Schema.Struct({
|
|
103
|
+
context: CallContext,
|
|
104
|
+
query: Schema.String,
|
|
105
|
+
args: Schema.optionalKey(Schema.Array(Schema.Unknown)),
|
|
106
|
+
}),
|
|
107
|
+
output: Schema.Array(Schema.Unknown),
|
|
108
|
+
errors: AuthFailed,
|
|
109
|
+
},
|
|
110
|
+
agentSend: {
|
|
111
|
+
description:
|
|
112
|
+
"Send a message to the person's agent (optionally with a ScreenContext snapshot); returns the run to follow.",
|
|
113
|
+
input: Schema.Struct({
|
|
114
|
+
context: CallContext,
|
|
115
|
+
text: Schema.String,
|
|
116
|
+
conversationId: Schema.optionalKey(Schema.String),
|
|
117
|
+
screen: Schema.optionalKey(ScreenSnapshot),
|
|
118
|
+
}),
|
|
119
|
+
output: SentMessage,
|
|
120
|
+
errors: Schema.Union([Unauthenticated, Forbidden, InvalidInput]),
|
|
121
|
+
},
|
|
122
|
+
account: {
|
|
123
|
+
description:
|
|
124
|
+
"The person's own account (`/auth/*`): password reset (requestPasswordReset, resetPassword), address " +
|
|
125
|
+
"verification (sendVerificationEmail, verifyEmail), a change of address confirmed from the current one " +
|
|
126
|
+
"(changeEmail), changePassword, the profile (getAccount, updateProfile), two-factor enrollment and sign-in " +
|
|
127
|
+
"(enableTwoFactor, confirmTwoFactor, disableTwoFactor, regenerateBackupCodes, verifyTwoFactor after a " +
|
|
128
|
+
"TwoFactorRequired sign-in) and OAuth sign-in (oauthSignInUrl). A route that rotates the session returns the " +
|
|
129
|
+
"token to use.",
|
|
130
|
+
input: Schema.Struct({
|
|
131
|
+
operation: Schema.Literals([
|
|
132
|
+
"requestPasswordReset",
|
|
133
|
+
"resetPassword",
|
|
134
|
+
"sendVerificationEmail",
|
|
135
|
+
"verifyEmail",
|
|
136
|
+
"getAccount",
|
|
137
|
+
"updateProfile",
|
|
138
|
+
"changeEmail",
|
|
139
|
+
"changePassword",
|
|
140
|
+
"enableTwoFactor",
|
|
141
|
+
"confirmTwoFactor",
|
|
142
|
+
"disableTwoFactor",
|
|
143
|
+
"regenerateBackupCodes",
|
|
144
|
+
"verifyTwoFactor",
|
|
145
|
+
"oauthSignInUrl",
|
|
146
|
+
"requestMagicLink",
|
|
147
|
+
"verifyMagicLink",
|
|
148
|
+
"beginDesktopSignIn",
|
|
149
|
+
"approveDesktopSignIn",
|
|
150
|
+
"completeDesktopSignIn",
|
|
151
|
+
"desktopSignIn",
|
|
152
|
+
]),
|
|
153
|
+
token: Schema.optionalKey(Schema.String),
|
|
154
|
+
input: Schema.Unknown,
|
|
155
|
+
}),
|
|
156
|
+
output: Schema.Unknown,
|
|
157
|
+
errors: AuthFailed,
|
|
158
|
+
},
|
|
159
|
+
directory: {
|
|
160
|
+
description:
|
|
161
|
+
"A Directory operation (`POST /kernel/directory/<operation>`), typed from the Directory contract: " +
|
|
162
|
+
"administration in the context's organisation, and the person's own (their organisations, accepting an " +
|
|
163
|
+
"invitation, joining through their address's domain).",
|
|
164
|
+
input: Schema.Struct({ context: CallContext, operation: Schema.String, input: Schema.Unknown }),
|
|
165
|
+
output: Schema.Unknown,
|
|
166
|
+
errors: Schema.Union([Unauthenticated, Forbidden, InvalidInput]),
|
|
167
|
+
},
|
|
168
|
+
avatar: {
|
|
169
|
+
description:
|
|
170
|
+
"People's photos (`/api/me/avatar`, `/api/users/<id>/avatar`): one lookup shared by every view asking at " +
|
|
171
|
+
"once, cached by ETag, a change published to every subscriber; upload (through the app's compressor) and " +
|
|
172
|
+
"removal of the person's own. Only the person and people sharing an organisation with them see it.",
|
|
173
|
+
input: Schema.Struct({
|
|
174
|
+
token: Schema.String,
|
|
175
|
+
operation: Schema.Literals(["get", "upload", "remove"]),
|
|
176
|
+
userId: Schema.optionalKey(Schema.String),
|
|
177
|
+
}),
|
|
178
|
+
output: Schema.Unknown,
|
|
179
|
+
errors: AuthFailed,
|
|
180
|
+
},
|
|
181
|
+
session: {
|
|
182
|
+
description:
|
|
183
|
+
"The shared session controller (sessionController): loading, authenticated, unauthenticated, unavailable or " +
|
|
184
|
+
"signing-out; one verified read of the stored session for every view, a refused session forgotten, an " +
|
|
185
|
+
"unchecked one kept, and a sign-out that stops authenticated reads before it revokes.",
|
|
186
|
+
input: Schema.Struct({}),
|
|
187
|
+
output: Schema.Literals(["loading", "authenticated", "unauthenticated", "unavailable", "signing-out"]),
|
|
188
|
+
errors: Schema.Never,
|
|
189
|
+
},
|
|
190
|
+
release: {
|
|
191
|
+
description:
|
|
192
|
+
"The kernel's release (`GET /release`): its versions and the oldest client version it accepts writes from.",
|
|
193
|
+
input: Schema.Struct({}),
|
|
194
|
+
output: ReleaseInfo,
|
|
195
|
+
errors: Schema.Never,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
types: { ClientSession, ClientOrganization, CallContext, AuthFailed },
|
|
199
|
+
})
|