@eloxiv/contracts 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/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 +888 -0
- package/dist/contracts/LocalClient.d.ts.map +1 -0
- package/dist/contracts/LocalClient.js +429 -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 +1298 -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 +6657 -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 +620 -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,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelProvider (a capability contract): language models behind one provider-neutral interface, over the
|
|
3
|
+
* Vercel AI SDK. Text and structured generation, tool calls, streaming and token usage. Providers are
|
|
4
|
+
* configured per deployment and per organisation; credentials stay behind the provider's credential source
|
|
5
|
+
* (the Secrets contract will supply them). Real providers are registry connectors; the kernel knows none.
|
|
6
|
+
* See docs/contracts/model-provider.md.
|
|
7
|
+
*/
|
|
8
|
+
import { Schema } from "effect"
|
|
9
|
+
import {
|
|
10
|
+
CompletionMessage,
|
|
11
|
+
ModelChoice,
|
|
12
|
+
ModelPricing,
|
|
13
|
+
ModelUnavailable,
|
|
14
|
+
ModelUsage,
|
|
15
|
+
ToolCall,
|
|
16
|
+
ToolDefinition,
|
|
17
|
+
} from "../Agent.ts"
|
|
18
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
19
|
+
|
|
20
|
+
const GenerateInput = Schema.Struct({
|
|
21
|
+
model: ModelChoice,
|
|
22
|
+
messages: Schema.Array(CompletionMessage),
|
|
23
|
+
tools: Schema.optionalKey(Schema.Array(ToolDefinition)),
|
|
24
|
+
maxOutputTokens: Schema.optionalKey(Schema.Number),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const Generated = Schema.Struct({
|
|
28
|
+
text: Schema.String,
|
|
29
|
+
toolCalls: Schema.Array(ToolCall),
|
|
30
|
+
finishReason: Schema.String,
|
|
31
|
+
usage: ModelUsage,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export const ModelProviderContract = defineServiceContract({
|
|
35
|
+
name: "ModelProvider",
|
|
36
|
+
kind: "capability",
|
|
37
|
+
version: "1.2.0",
|
|
38
|
+
description:
|
|
39
|
+
"Language models behind a provider-neutral interface over the Vercel AI SDK: text and structured generation, tool calls, streamed text, embeddings and token usage, with providers configured per deployment and organisation and credentials resolved behind the provider.",
|
|
40
|
+
operations: {
|
|
41
|
+
models: defineOperation({
|
|
42
|
+
description: "The models a provider offers, with their pricing (for cost budgets).",
|
|
43
|
+
input: Schema.Struct({ provider: Schema.String }),
|
|
44
|
+
output: Schema.Array(Schema.Struct({ id: Schema.String, pricing: ModelPricing })),
|
|
45
|
+
errors: ModelUnavailable,
|
|
46
|
+
}),
|
|
47
|
+
generateText: defineOperation({
|
|
48
|
+
description:
|
|
49
|
+
"One model call: text and the tool calls the model asked for (tools are never executed by the provider), with the tokens used.",
|
|
50
|
+
input: GenerateInput,
|
|
51
|
+
output: Generated,
|
|
52
|
+
errors: ModelUnavailable,
|
|
53
|
+
}),
|
|
54
|
+
generateObject: defineOperation({
|
|
55
|
+
description: "Structured generation: an object matching the JSON Schema given, with the tokens used.",
|
|
56
|
+
input: Schema.Struct({
|
|
57
|
+
model: ModelChoice,
|
|
58
|
+
messages: Schema.Array(CompletionMessage),
|
|
59
|
+
schema: Schema.Unknown,
|
|
60
|
+
}),
|
|
61
|
+
output: Schema.Struct({ object: Schema.Unknown, usage: ModelUsage }),
|
|
62
|
+
errors: ModelUnavailable,
|
|
63
|
+
}),
|
|
64
|
+
streamText: defineOperation({
|
|
65
|
+
description:
|
|
66
|
+
"The same call as generateText, streamed: text deltas as they arrive, then the complete result (text, tool calls, usage).",
|
|
67
|
+
input: GenerateInput,
|
|
68
|
+
output: Schema.Struct({ deltas: Schema.Array(Schema.String), result: Generated }),
|
|
69
|
+
errors: ModelUnavailable,
|
|
70
|
+
}),
|
|
71
|
+
embed: defineOperation({
|
|
72
|
+
description:
|
|
73
|
+
"Embeddings of texts by a provider's embedding model (for hybrid search), one vector per text in order, with the tokens the provider counted; a provider without an embedding model is unavailable.",
|
|
74
|
+
input: Schema.Struct({ orgId: Schema.String, model: ModelChoice, values: Schema.Array(Schema.String) }),
|
|
75
|
+
output: Schema.Struct({ embeddings: Schema.Array(Schema.Array(Schema.Number)), tokens: Schema.Number }),
|
|
76
|
+
errors: ModelUnavailable,
|
|
77
|
+
}),
|
|
78
|
+
resolve: defineOperation({
|
|
79
|
+
description:
|
|
80
|
+
"Which provider and model serve an organisation: its own choice (set by an administrator) or the deployment's default.",
|
|
81
|
+
input: Schema.Struct({ orgId: Schema.String }),
|
|
82
|
+
output: ModelChoice,
|
|
83
|
+
errors: ModelUnavailable,
|
|
84
|
+
}),
|
|
85
|
+
},
|
|
86
|
+
types: { ModelChoice, ModelPricing, ModelUsage, CompletionMessage, ToolDefinition, ToolCall, ModelUnavailable },
|
|
87
|
+
})
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModuleManifest: the declarative schema of a module (decisions.md "Kernel
|
|
3
|
+
* contracts"), in the JSON form `moduleToJson` emits, and what an
|
|
4
|
+
* implementation must do with it: emit it, and refuse to load an app whose
|
|
5
|
+
* manifests do not check out (`manifestProblems`).
|
|
6
|
+
*/
|
|
7
|
+
import { Schema } from "effect"
|
|
8
|
+
import { ApprovalComparison, ApproverSpec } from "../Approval.ts"
|
|
9
|
+
import { SettingScope, WorkItemState } from "../Manifest.ts"
|
|
10
|
+
import { OptimisticEffect } from "../Optimistic.ts"
|
|
11
|
+
import { JsonSchemaObject } from "../Projection.ts"
|
|
12
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
13
|
+
import { RenderDeclaration } from "../Render.ts"
|
|
14
|
+
|
|
15
|
+
const Text = Schema.String
|
|
16
|
+
|
|
17
|
+
export const PolicyAttributeDocument = Schema.Union([
|
|
18
|
+
Schema.Struct({ kind: Schema.Literal("column"), field: Text, type: Schema.Literals(["String", "Long", "Boolean"]) }),
|
|
19
|
+
Schema.Struct({ kind: Schema.Literal("column"), field: Text, type: Schema.Literal("Entity"), entityType: Text }),
|
|
20
|
+
Schema.Struct({ kind: Schema.Literal("sharing"), permission: Text }),
|
|
21
|
+
])
|
|
22
|
+
|
|
23
|
+
export const EntityDocument = Schema.Struct({
|
|
24
|
+
cedarType: Text,
|
|
25
|
+
/** `<schema>.<table>`, in the module's own schema. */
|
|
26
|
+
table: Text,
|
|
27
|
+
primaryKey: Text,
|
|
28
|
+
columns: Schema.Record(Text, Text),
|
|
29
|
+
policyAttributes: Schema.Record(Text, PolicyAttributeDocument),
|
|
30
|
+
row: JsonSchemaObject,
|
|
31
|
+
/** The entity keeps a record history (Versioning). */
|
|
32
|
+
history: Schema.optionalKey(Schema.Boolean),
|
|
33
|
+
/** Each record has a collaborative document (CollabDocument), with these limits. */
|
|
34
|
+
collab: Schema.optionalKey(
|
|
35
|
+
Schema.Struct({
|
|
36
|
+
maxBytes: Schema.optionalKey(Schema.Number),
|
|
37
|
+
maxUpdateBytes: Schema.optionalKey(Schema.Number),
|
|
38
|
+
updatesPerMinute: Schema.optionalKey(Schema.Number),
|
|
39
|
+
text: Schema.optionalKey(Text),
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
/** Per field: its column, sync transport type (`null`: not synced exactly), nullability, enum values, Postgres type. */
|
|
43
|
+
storage: Schema.Record(
|
|
44
|
+
Text,
|
|
45
|
+
Schema.Struct({
|
|
46
|
+
column: Text,
|
|
47
|
+
type: Schema.NullOr(Schema.Literals(["string", "number", "boolean", "json"])),
|
|
48
|
+
nullable: Schema.Boolean,
|
|
49
|
+
enum: Schema.optionalKey(Schema.Array(Text)),
|
|
50
|
+
sqlType: Text,
|
|
51
|
+
/** The range setup holds a synced column of this type to (a CHECK constraint). */
|
|
52
|
+
guard: Schema.optionalKey(
|
|
53
|
+
Schema.Literals([
|
|
54
|
+
"safe-integer",
|
|
55
|
+
"finite-double",
|
|
56
|
+
"instant",
|
|
57
|
+
"instant-ms",
|
|
58
|
+
"date",
|
|
59
|
+
"json-doubles",
|
|
60
|
+
"plain-array",
|
|
61
|
+
]),
|
|
62
|
+
),
|
|
63
|
+
generated: Schema.optionalKey(Schema.Literal(true)),
|
|
64
|
+
}),
|
|
65
|
+
),
|
|
66
|
+
/** `false`: not synced; else the Zero table's name and the fields it carries. */
|
|
67
|
+
sync: Schema.Union([Schema.Literal(false), Schema.Struct({ name: Text, fields: Schema.Array(Text) })]),
|
|
68
|
+
/** Unique keys besides the primary key, as field names. */
|
|
69
|
+
uniqueKeys: Schema.Array(Schema.Array(Text)),
|
|
70
|
+
/** The Drizzle relations the entity names (`related()`, `whereExists()`). */
|
|
71
|
+
relationships: Schema.Array(
|
|
72
|
+
Schema.Union([
|
|
73
|
+
Schema.Struct({
|
|
74
|
+
name: Text,
|
|
75
|
+
cardinality: Schema.Literal("one"),
|
|
76
|
+
table: Text,
|
|
77
|
+
fields: Schema.Array(Text),
|
|
78
|
+
references: Schema.Array(Text),
|
|
79
|
+
relationName: Schema.optionalKey(Text),
|
|
80
|
+
}),
|
|
81
|
+
Schema.Struct({
|
|
82
|
+
name: Text,
|
|
83
|
+
cardinality: Schema.Literal("many"),
|
|
84
|
+
table: Text,
|
|
85
|
+
relationName: Schema.optionalKey(Text),
|
|
86
|
+
}),
|
|
87
|
+
]),
|
|
88
|
+
),
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
export const ActionDocument = Schema.Struct({
|
|
92
|
+
/** What people see the action called (1.6.0); a manifest from before it has none, read as its readable name. */
|
|
93
|
+
title: Schema.optionalKey(Text),
|
|
94
|
+
description: Text,
|
|
95
|
+
cedarAction: Text,
|
|
96
|
+
writes: Schema.NullOr(Text),
|
|
97
|
+
target: Schema.NullOr(Schema.Struct({ entity: Text, field: Text })),
|
|
98
|
+
/** Further entities the action acts on; its policy reaches only the tables of writes, target and these. */
|
|
99
|
+
actsOn: Schema.optionalKey(Schema.Array(Text)),
|
|
100
|
+
/** The action may act on any record of its entities in the acting organisation, and only there. */
|
|
101
|
+
organisationWide: Schema.optionalKey(Schema.Boolean),
|
|
102
|
+
bestEffort: Schema.Boolean,
|
|
103
|
+
hints: Schema.Struct({ readOnly: Schema.Boolean, destructive: Schema.Boolean, idempotent: Schema.Boolean }),
|
|
104
|
+
/** An agent acting for a person needs the person's consent for each call (ActionConsent). */
|
|
105
|
+
consent: Schema.Boolean,
|
|
106
|
+
/** With consent: a remembered permission never covers a call; each needs its own approval. */
|
|
107
|
+
consentEachCall: Schema.optionalKey(Schema.Boolean),
|
|
108
|
+
/** Capability operations the handler may call through its Connections, by capability (Connections). */
|
|
109
|
+
connections: Schema.optionalKey(Schema.Record(Text, Schema.Array(Text))),
|
|
110
|
+
/** The change a client's replica predicts before the server answers (an insert, update or delete), or null. */
|
|
111
|
+
optimistic: Schema.optionalKey(Schema.NullOr(OptimisticEffect)),
|
|
112
|
+
input: JsonSchemaObject,
|
|
113
|
+
output: JsonSchemaObject,
|
|
114
|
+
result: JsonSchemaObject,
|
|
115
|
+
/** How the output is shown to people and agents (ResultRendering). */
|
|
116
|
+
render: Schema.optionalKey(RenderDeclaration),
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
export const EventDocument = Schema.Struct({ payload: JsonSchemaObject })
|
|
120
|
+
|
|
121
|
+
export const PermissionDocument = Schema.Struct({ description: Text, actions: Schema.Array(Text) })
|
|
122
|
+
|
|
123
|
+
export const ToolGroupDocument = Schema.Struct({ description: Text, actions: Schema.Array(Text) })
|
|
124
|
+
|
|
125
|
+
export const SettingDocument = Schema.Struct({
|
|
126
|
+
description: Text,
|
|
127
|
+
scope: SettingScope,
|
|
128
|
+
schema: JsonSchemaObject,
|
|
129
|
+
default: Schema.Unknown,
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
/** A feature flag (Flags): its default when no targeting decides it. */
|
|
133
|
+
export const FlagDocument = Schema.Struct({ description: Text, default: Schema.Boolean })
|
|
134
|
+
|
|
135
|
+
export const SkillDocument = Schema.Struct({
|
|
136
|
+
description: Text,
|
|
137
|
+
content: Schema.Union([Schema.Struct({ path: Text }), Schema.Struct({ text: Text })]),
|
|
138
|
+
/** The skill's eval cases (a `SkillEvals` JSON file in the module), or null. */
|
|
139
|
+
evals: Schema.NullOr(Schema.Struct({ path: Text })),
|
|
140
|
+
/**
|
|
141
|
+
* Who the skill is for, when the module says: `runtime` (the app's agent), `development` (coding agents and
|
|
142
|
+
* tooling) or `both`. Absent, it is `both`.
|
|
143
|
+
*/
|
|
144
|
+
audience: Schema.optionalKey(Schema.Literals(["runtime", "development", "both"])),
|
|
145
|
+
/** A lab skill: the flag that must be on for the person (absent: always given). */
|
|
146
|
+
requires: Schema.optionalKey(Schema.Struct({ flag: Text })),
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
export const ViewDocument = Schema.Struct({
|
|
150
|
+
title: Text,
|
|
151
|
+
description: Schema.NullOr(Text),
|
|
152
|
+
route: Text,
|
|
153
|
+
shows: Schema.Union([Schema.Struct({ entity: Text }), Schema.Struct({ queryView: Text })]),
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
export const SlotDocument = Schema.Struct({ description: Text, accepts: Schema.Literals(["view", "command"]) })
|
|
157
|
+
|
|
158
|
+
export const ContributionDocument = Schema.Union([
|
|
159
|
+
Schema.Struct({ slot: Text, view: Text, order: Schema.NullOr(Schema.Number) }),
|
|
160
|
+
Schema.Struct({ slot: Text, command: Text, order: Schema.NullOr(Schema.Number) }),
|
|
161
|
+
])
|
|
162
|
+
|
|
163
|
+
export const CommandDocument = Schema.Struct({
|
|
164
|
+
title: Text,
|
|
165
|
+
description: Schema.NullOr(Text),
|
|
166
|
+
keywords: Schema.Array(Text),
|
|
167
|
+
run: Schema.Union([Schema.Struct({ action: Text }), Schema.Struct({ view: Text })]),
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
export const WorkItemSourceDocument = Schema.Struct({
|
|
171
|
+
description: Text,
|
|
172
|
+
entity: Text,
|
|
173
|
+
title: Text,
|
|
174
|
+
state: Schema.Union([
|
|
175
|
+
Schema.Struct({ field: Text, values: Schema.Record(Text, WorkItemState) }),
|
|
176
|
+
Schema.Struct({ constant: WorkItemState }),
|
|
177
|
+
]),
|
|
178
|
+
assignee: Schema.NullOr(Text),
|
|
179
|
+
link: Schema.Struct({ view: Text }),
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
export const EntityResolverDocument = Schema.Struct({
|
|
183
|
+
title: Text,
|
|
184
|
+
link: Schema.NullOr(Schema.Struct({ view: Text })),
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
export const QueryViewDocument = Schema.Struct({
|
|
188
|
+
description: Text,
|
|
189
|
+
entity: Text,
|
|
190
|
+
sql: Text,
|
|
191
|
+
/** The security-invoker view the kernel creates, `<schema>.qv_<name>`. */
|
|
192
|
+
view: Schema.NullOr(Text),
|
|
193
|
+
row: JsonSchemaObject,
|
|
194
|
+
render: Schema.optionalKey(RenderDeclaration),
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
/** A product analytics event the module sends (Telemetry): its consent category and typed properties. */
|
|
198
|
+
export const AnalyticsEventDocument = Schema.Struct({
|
|
199
|
+
description: Text,
|
|
200
|
+
category: Schema.Literals(["functional", "analytics", "marketing"]),
|
|
201
|
+
properties: Schema.Record(
|
|
202
|
+
Text,
|
|
203
|
+
Schema.Union([
|
|
204
|
+
Schema.Struct({ kind: Schema.Literal("enum"), values: Schema.Array(Text) }),
|
|
205
|
+
Schema.Struct({ kind: Schema.Literals(["number", "boolean", "id"]) }),
|
|
206
|
+
]),
|
|
207
|
+
),
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
/** Records of an entity about a person and what erasure does to them (Privacy). */
|
|
211
|
+
export const DataSubjectDeclarationDocument = Schema.Struct({
|
|
212
|
+
fields: Schema.Array(Text),
|
|
213
|
+
erase: Schema.Union([
|
|
214
|
+
Schema.Struct({ kind: Schema.Literal("delete") }),
|
|
215
|
+
Schema.Struct({
|
|
216
|
+
kind: Schema.Literal("anonymise"),
|
|
217
|
+
set: Schema.Record(Text, Schema.Union([Schema.String, Schema.Number, Schema.Boolean, Schema.Null])),
|
|
218
|
+
}),
|
|
219
|
+
Schema.Struct({ kind: Schema.Literal("retain"), reason: Text }),
|
|
220
|
+
]),
|
|
221
|
+
export: Schema.optionalKey(Schema.Union([Schema.Struct({ fields: Schema.Array(Text) }), Schema.Literal(false)])),
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
/** An entity's entry in `dataSubjects`: the records naming a person, or about nobody, and why (Privacy). */
|
|
225
|
+
export const DataSubjectDocument = Schema.Union([DataSubjectDeclarationDocument, Schema.Struct({ none: Text })])
|
|
226
|
+
|
|
227
|
+
/** A business approval rule (the Approvals contract), with its defaults filled in. */
|
|
228
|
+
export const ApprovalRuleDocument = Schema.Struct({
|
|
229
|
+
description: Text,
|
|
230
|
+
action: Text,
|
|
231
|
+
when: Schema.Array(ApprovalComparison),
|
|
232
|
+
approvers: ApproverSpec,
|
|
233
|
+
quorum: Schema.Int,
|
|
234
|
+
allowSelfApproval: Schema.Boolean,
|
|
235
|
+
expiresAfterMs: Schema.NullOr(Schema.Int),
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
/** A module manifest as JSON. Unknown keys are ignored, so later declarations (jobs) extend it compatibly. */
|
|
239
|
+
export const ModuleManifestDocument = Schema.Struct({
|
|
240
|
+
name: Text,
|
|
241
|
+
version: Text,
|
|
242
|
+
/** The kernel versions the module works with (Versioning). */
|
|
243
|
+
kernel: Schema.optionalKey(Text),
|
|
244
|
+
cedarNamespace: Text,
|
|
245
|
+
actions: Schema.Record(Text, ActionDocument),
|
|
246
|
+
events: Schema.Record(Text, EventDocument),
|
|
247
|
+
entities: Schema.Record(Text, EntityDocument),
|
|
248
|
+
permissions: Schema.Record(Text, PermissionDocument),
|
|
249
|
+
settings: Schema.Record(Text, SettingDocument),
|
|
250
|
+
flags: Schema.optionalKey(Schema.Record(Text, FlagDocument)),
|
|
251
|
+
skills: Schema.Record(Text, SkillDocument),
|
|
252
|
+
views: Schema.Record(Text, ViewDocument),
|
|
253
|
+
slots: Schema.Record(Text, SlotDocument),
|
|
254
|
+
contributions: Schema.Record(Text, ContributionDocument),
|
|
255
|
+
commands: Schema.Record(Text, CommandDocument),
|
|
256
|
+
workItemSources: Schema.Record(Text, WorkItemSourceDocument),
|
|
257
|
+
entityResolvers: Schema.Record(Text, EntityResolverDocument),
|
|
258
|
+
queryViews: Schema.Record(Text, QueryViewDocument),
|
|
259
|
+
approvalRules: Schema.Record(Text, ApprovalRuleDocument),
|
|
260
|
+
/** Agent tool groups an app can disable for agents (`<module>.<name>`); every action is also in its module's group. */
|
|
261
|
+
toolGroups: Schema.optionalKey(Schema.Record(Text, ToolGroupDocument)),
|
|
262
|
+
dataSubjects: Schema.optionalKey(Schema.Record(Text, DataSubjectDocument)),
|
|
263
|
+
analyticsEvents: Schema.optionalKey(Schema.Record(Text, AnalyticsEventDocument)),
|
|
264
|
+
})
|
|
265
|
+
export type ModuleManifestDocument = typeof ModuleManifestDocument.Type
|
|
266
|
+
|
|
267
|
+
/** The app's manifests do not check out; every problem is listed. */
|
|
268
|
+
export const InvalidManifest = Schema.TaggedStruct("InvalidManifest", { problems: Schema.Array(Text) })
|
|
269
|
+
|
|
270
|
+
export const ModuleManifestContract = defineServiceContract({
|
|
271
|
+
name: "ModuleManifest",
|
|
272
|
+
kind: "kernel",
|
|
273
|
+
version: "1.6.0",
|
|
274
|
+
description:
|
|
275
|
+
"The declarative schema of a module: entities, actions (with the optimistic effect each predicts on a replica: an insert, an update, a delete or the module's own custom prediction), events, policy attributes, permission vocabulary, settings, feature flags, skills, views, slots and contributions, commands, work-item sources, entity resolvers, published query views, approval rules and agent tool groups. An implementation emits each module's manifest as JSON and refuses to load an app whose manifests reference anything that does not exist, reuse a global id, or break a rule of a declaration.",
|
|
276
|
+
operations: {
|
|
277
|
+
emit: defineOperation({
|
|
278
|
+
description: "The module's manifest as language-neutral JSON, with JSON Schema for every schema-typed field.",
|
|
279
|
+
input: Schema.Struct({ module: Text }),
|
|
280
|
+
output: ModuleManifestDocument,
|
|
281
|
+
errors: Schema.Never,
|
|
282
|
+
}),
|
|
283
|
+
load: defineOperation({
|
|
284
|
+
description:
|
|
285
|
+
"Check the manifests of every module of an app together and build the registry, or refuse with every problem found. The kernel runs this at startup and does not start a refused app.",
|
|
286
|
+
input: Schema.Struct({ modules: Schema.Array(ModuleManifestDocument) }),
|
|
287
|
+
output: Schema.Struct({ modules: Schema.Array(Text) }),
|
|
288
|
+
errors: InvalidManifest,
|
|
289
|
+
}),
|
|
290
|
+
},
|
|
291
|
+
types: {
|
|
292
|
+
ModuleManifest: ModuleManifestDocument,
|
|
293
|
+
Entity: EntityDocument,
|
|
294
|
+
Action: ActionDocument,
|
|
295
|
+
OptimisticEffect,
|
|
296
|
+
Event: EventDocument,
|
|
297
|
+
Permission: PermissionDocument,
|
|
298
|
+
Setting: SettingDocument,
|
|
299
|
+
Flag: FlagDocument,
|
|
300
|
+
Skill: SkillDocument,
|
|
301
|
+
View: ViewDocument,
|
|
302
|
+
Slot: SlotDocument,
|
|
303
|
+
Contribution: ContributionDocument,
|
|
304
|
+
Command: CommandDocument,
|
|
305
|
+
WorkItemSource: WorkItemSourceDocument,
|
|
306
|
+
EntityResolver: EntityResolverDocument,
|
|
307
|
+
QueryView: QueryViewDocument,
|
|
308
|
+
ApprovalRule: ApprovalRuleDocument,
|
|
309
|
+
},
|
|
310
|
+
})
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NotificationChannel: how a notification reaches a person outside the app. A channel delivers one message
|
|
3
|
+
* to one recipient and reports whether a failure is worth retrying; the Notifications service decides which
|
|
4
|
+
* channels a notification goes to (per-user preferences), records every attempt in the delivery log, and
|
|
5
|
+
* retries through the outbox. Kinds: in-app (the notification record itself), system email (SMTP in the
|
|
6
|
+
* kernel), push (APNs and FCM in the kernel, to the person's registered installations) and chat destinations
|
|
7
|
+
* (contract only: Messaging provides it). See docs/contracts/notification-channel.md.
|
|
8
|
+
*/
|
|
9
|
+
import { Schema } from "effect"
|
|
10
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
11
|
+
import { DeepLink } from "./View.ts"
|
|
12
|
+
|
|
13
|
+
export const ChannelKind = Schema.Literals(["in-app", "email", "push", "chat"])
|
|
14
|
+
export type ChannelKind = typeof ChannelKind.Type
|
|
15
|
+
|
|
16
|
+
/** A rendered system email: one recipient, a subject, text and optional HTML, and the headers a sender adds. */
|
|
17
|
+
export const EmailMessage = Schema.Struct({
|
|
18
|
+
kind: Schema.Literal("email"),
|
|
19
|
+
/** Stable per delivery: a resend after a crash carries the same Message-ID, so receivers can drop duplicates. */
|
|
20
|
+
messageId: Schema.String,
|
|
21
|
+
from: Schema.String,
|
|
22
|
+
to: Schema.String,
|
|
23
|
+
subject: Schema.String,
|
|
24
|
+
text: Schema.String,
|
|
25
|
+
html: Schema.NullOr(Schema.String),
|
|
26
|
+
/** One-click unsubscribe (RFC 8058): the URL a `List-Unsubscribe` header and the body's footer link to. */
|
|
27
|
+
unsubscribeUrl: Schema.NullOr(Schema.String),
|
|
28
|
+
/** Extra headers, e.g. `X-Eloxiv-Category`. */
|
|
29
|
+
headers: Schema.Record(Schema.String, Schema.String),
|
|
30
|
+
})
|
|
31
|
+
export type EmailMessage = typeof EmailMessage.Type
|
|
32
|
+
|
|
33
|
+
/** The verdicts a push notification's decision offers. */
|
|
34
|
+
export const DecisionVerdict = Schema.Literals(["approve", "reject"])
|
|
35
|
+
export type DecisionVerdict = typeof DecisionVerdict.Type
|
|
36
|
+
|
|
37
|
+
/** What a decision decides: a business approval (`approvals.approve|reject`) or an agent's held call (`consent.approve|reject`). */
|
|
38
|
+
export const DecisionKind = Schema.Literals(["approval", "consent"])
|
|
39
|
+
export type DecisionKind = typeof DecisionKind.Type
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The decision a push notification offers (an approval or consent request the recipient can decide from the
|
|
43
|
+
* notification). The token that redeems it is minted by the push channel when it sends, one per installation, and
|
|
44
|
+
* exists only in the provider payload (`eloxiv.decision = { token, verdicts, kind }`).
|
|
45
|
+
*/
|
|
46
|
+
export const PushDecision = Schema.Struct({
|
|
47
|
+
kind: DecisionKind,
|
|
48
|
+
requestId: Schema.String,
|
|
49
|
+
verdicts: Schema.Array(DecisionVerdict),
|
|
50
|
+
/** When its tokens expire (ISO 8601): a day after the notification, or the request's own expiry when sooner. */
|
|
51
|
+
expiresAt: Schema.String,
|
|
52
|
+
})
|
|
53
|
+
export type PushDecision = typeof PushDecision.Type
|
|
54
|
+
|
|
55
|
+
/** A push notification for the person's devices (every live installation they registered). */
|
|
56
|
+
export const PushMessage = Schema.Struct({
|
|
57
|
+
kind: Schema.Literal("push"),
|
|
58
|
+
/** Stable per delivery: a resend after a crash carries the same id (APNs' `apns-id` is derived from it). */
|
|
59
|
+
messageId: Schema.String,
|
|
60
|
+
userId: Schema.String,
|
|
61
|
+
/** The organisation the notification is in. */
|
|
62
|
+
orgId: Schema.optionalKey(Schema.String),
|
|
63
|
+
notificationId: Schema.optionalKey(Schema.String),
|
|
64
|
+
/** The notification's category (`approvals.requested`). */
|
|
65
|
+
category: Schema.optionalKey(Schema.String),
|
|
66
|
+
title: Schema.String,
|
|
67
|
+
/** What the lock screen shows: minimal for sensitive categories (never a consent request's input). */
|
|
68
|
+
body: Schema.String,
|
|
69
|
+
/** A deep link into the app (unused by the kernel's push channel, which sends `link`). */
|
|
70
|
+
url: Schema.NullOr(Schema.String),
|
|
71
|
+
/**
|
|
72
|
+
* The view that shows the notification's record (the View contract's DeepLink, chosen with `recordLink`'s
|
|
73
|
+
* semantics from the notification's EntityReference, in its organisation), or null when no installed view shows it.
|
|
74
|
+
*/
|
|
75
|
+
link: Schema.optionalKey(Schema.NullOr(DeepLink)),
|
|
76
|
+
decision: Schema.optionalKey(PushDecision),
|
|
77
|
+
})
|
|
78
|
+
export type PushMessage = typeof PushMessage.Type
|
|
79
|
+
|
|
80
|
+
/** A message to a chat destination (a Slack channel, a Teams chat; delivered by Messaging; contract only). */
|
|
81
|
+
export const ChatMessage = Schema.Struct({
|
|
82
|
+
kind: Schema.Literal("chat"),
|
|
83
|
+
messageId: Schema.String,
|
|
84
|
+
/** A named destination the organisation configured. */
|
|
85
|
+
destination: Schema.String,
|
|
86
|
+
text: Schema.String,
|
|
87
|
+
url: Schema.NullOr(Schema.String),
|
|
88
|
+
})
|
|
89
|
+
export type ChatMessage = typeof ChatMessage.Type
|
|
90
|
+
|
|
91
|
+
export const ChannelMessage = Schema.Union([EmailMessage, PushMessage, ChatMessage])
|
|
92
|
+
export type ChannelMessage = typeof ChannelMessage.Type
|
|
93
|
+
|
|
94
|
+
export const Delivered = Schema.Struct({
|
|
95
|
+
/** The channel's own id for what it accepted (the SMTP server's queue id, a push ticket). */
|
|
96
|
+
providerId: Schema.NullOr(Schema.String),
|
|
97
|
+
})
|
|
98
|
+
export type Delivered = typeof Delivered.Type
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The channel could not deliver. `retryable` failures (a connection refused, a 4xx SMTP reply, a provider's 429 or
|
|
102
|
+
* 5xx) are retried with backoff; permanent ones (a 5xx SMTP reply, an address the server refuses, a device token the
|
|
103
|
+
* provider no longer knows) are recorded as failed. `retryAfterMs`: the provider's advice (`Retry-After`) on when
|
|
104
|
+
* to try again, counted from when its answer arrived; the retry waits at least that long (at most a day).
|
|
105
|
+
*/
|
|
106
|
+
export class ChannelError extends Schema.TaggedError<ChannelError>()("ChannelError", {
|
|
107
|
+
channel: Schema.String,
|
|
108
|
+
retryable: Schema.Boolean,
|
|
109
|
+
message: Schema.String,
|
|
110
|
+
retryAfterMs: Schema.optionalKey(Schema.Number),
|
|
111
|
+
}) {}
|
|
112
|
+
|
|
113
|
+
/** One row of the delivery log. */
|
|
114
|
+
export const DeliveryRecord = Schema.Struct({
|
|
115
|
+
id: Schema.String,
|
|
116
|
+
orgId: Schema.String,
|
|
117
|
+
notificationId: Schema.String,
|
|
118
|
+
recipientId: Schema.String,
|
|
119
|
+
channel: Schema.String,
|
|
120
|
+
address: Schema.NullOr(Schema.String),
|
|
121
|
+
status: Schema.Literals(["pending", "sent", "failed", "suppressed"]),
|
|
122
|
+
attempts: Schema.Int,
|
|
123
|
+
lastError: Schema.NullOr(Schema.String),
|
|
124
|
+
providerId: Schema.NullOr(Schema.String),
|
|
125
|
+
createdAt: Schema.String,
|
|
126
|
+
sentAt: Schema.NullOr(Schema.String),
|
|
127
|
+
})
|
|
128
|
+
export type DeliveryRecord = typeof DeliveryRecord.Type
|
|
129
|
+
|
|
130
|
+
export const NotificationChannelContract = defineServiceContract({
|
|
131
|
+
name: "NotificationChannel",
|
|
132
|
+
kind: "kernel",
|
|
133
|
+
version: "1.1.0",
|
|
134
|
+
description:
|
|
135
|
+
"A delivery channel for Notifications: deliver one rendered message to one recipient, reporting whether a failure is retryable (and when to retry, as the provider advises). Kinds: in-app (the durable notification record), system email (templates with variables, per-organisation overrides, preview, a delivery log, an unsubscribe link and suppression; SMTP in the kernel), push (APNs and FCM in the kernel, to every live installation the person registered, with per-installation delivery state, the notification's organisation, record link and an optional decision) and chat destinations (Messaging provides it).",
|
|
136
|
+
operations: {
|
|
137
|
+
deliver: defineOperation({
|
|
138
|
+
description:
|
|
139
|
+
"Deliver one message. Succeeds once the channel accepted it (an SMTP server queued it; a push provider accepted it for at least one installation, and none waits for a retry). The same message id may be delivered again after a crash: channels pass it on (Message-ID, apns-id) so the receiving side can drop duplicates, and the push channel never sends again to an installation that already accepted it.",
|
|
140
|
+
input: ChannelMessage,
|
|
141
|
+
output: Delivered,
|
|
142
|
+
errors: ChannelError,
|
|
143
|
+
}),
|
|
144
|
+
},
|
|
145
|
+
types: {
|
|
146
|
+
ChannelKind,
|
|
147
|
+
EmailMessage,
|
|
148
|
+
DecisionVerdict,
|
|
149
|
+
DecisionKind,
|
|
150
|
+
PushDecision,
|
|
151
|
+
PushMessage,
|
|
152
|
+
ChatMessage,
|
|
153
|
+
ChannelMessage,
|
|
154
|
+
Delivered,
|
|
155
|
+
ChannelError,
|
|
156
|
+
DeliveryRecord,
|
|
157
|
+
},
|
|
158
|
+
})
|