@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,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress: records of long-running work (workflows, ingestion, agent runs, imports, exports) that their owner
|
|
3
|
+
* follows and can cancel. Documented in docs/contracts/progress.md; conformance kit
|
|
4
|
+
* `@eloxiv/testing/conformance/Progress`.
|
|
5
|
+
*
|
|
6
|
+
* A task belongs to the person whose work it is (the acting user of the handler or workflow that started it), in
|
|
7
|
+
* the organisation it was started in, and syncs to that person's replica only. Work reports through
|
|
8
|
+
* `ctx.progress` (handlers: applied when the call commits; workflows: committed at once, journalled per step):
|
|
9
|
+
* a step name, a percentage or a done/total count, and a message. Cancellation is cooperative: the owner asks
|
|
10
|
+
* (`progress.cancel`), a workflow sees it at its next report or checkpoint (`{ cancelled: true }`), the task ends
|
|
11
|
+
* `cancelled` and the work returns. A finished task never changes again.
|
|
12
|
+
*/
|
|
13
|
+
import { Schema } from "effect"
|
|
14
|
+
import { Forbidden, InvalidInput, Unauthenticated } from "../Errors.ts"
|
|
15
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
16
|
+
|
|
17
|
+
/** What kind of work a task tracks: what a client shows beside it. */
|
|
18
|
+
export const PROGRESS_KINDS = ["workflow", "ingestion", "agent-run", "import", "export", "erasure", "action"] as const
|
|
19
|
+
export const ProgressKind = Schema.Literals(PROGRESS_KINDS)
|
|
20
|
+
export type ProgressKind = typeof ProgressKind.Type
|
|
21
|
+
|
|
22
|
+
export const PROGRESS_STATUSES = ["running", "succeeded", "failed", "cancelled"] as const
|
|
23
|
+
export const ProgressStatus = Schema.Literals(PROGRESS_STATUSES)
|
|
24
|
+
export type ProgressStatus = typeof ProgressStatus.Type
|
|
25
|
+
|
|
26
|
+
/** The longest title, step or message the kernel keeps (longer text is cut). */
|
|
27
|
+
export const PROGRESS_TEXT_MAX = 500
|
|
28
|
+
|
|
29
|
+
/** One task, as the owner's replica holds it (table `eloxiv_progress.task`). */
|
|
30
|
+
export const ProgressTask = Schema.Struct({
|
|
31
|
+
id: Schema.String,
|
|
32
|
+
orgId: Schema.String,
|
|
33
|
+
ownerId: Schema.String,
|
|
34
|
+
kind: ProgressKind,
|
|
35
|
+
/** The module (or `eloxiv` for the kernel's own work) that started it. */
|
|
36
|
+
source: Schema.String,
|
|
37
|
+
title: Schema.String,
|
|
38
|
+
step: Schema.NullOr(Schema.String),
|
|
39
|
+
message: Schema.NullOr(Schema.String),
|
|
40
|
+
/** 0 to 100, or `null` while the work cannot tell (indeterminate). */
|
|
41
|
+
percent: Schema.NullOr(Schema.Number),
|
|
42
|
+
/** Units done and in all, when the work counts (`percent` is then derived from them). */
|
|
43
|
+
done: Schema.NullOr(Schema.Number),
|
|
44
|
+
total: Schema.NullOr(Schema.Number),
|
|
45
|
+
status: ProgressStatus,
|
|
46
|
+
/** The owner asked to cancel; the work stops at its next report. */
|
|
47
|
+
cancelRequested: Schema.Boolean,
|
|
48
|
+
/** Why it failed (a short, redacted message), when it did. */
|
|
49
|
+
error: Schema.NullOr(Schema.String),
|
|
50
|
+
/** The workflow execution it reports for, when a workflow started it. */
|
|
51
|
+
executionId: Schema.NullOr(Schema.String),
|
|
52
|
+
startedAt: Schema.Number,
|
|
53
|
+
updatedAt: Schema.Number,
|
|
54
|
+
finishedAt: Schema.NullOr(Schema.Number),
|
|
55
|
+
})
|
|
56
|
+
export type ProgressTask = typeof ProgressTask.Type
|
|
57
|
+
|
|
58
|
+
const Text = Schema.String.check(Schema.isMaxLength(PROGRESS_TEXT_MAX))
|
|
59
|
+
const Count = Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))
|
|
60
|
+
|
|
61
|
+
/** What work gives when it starts a task (`ctx.progress.start`). */
|
|
62
|
+
export const ProgressStart = Schema.Struct({
|
|
63
|
+
title: Text.check(Schema.isNonEmpty()),
|
|
64
|
+
kind: Schema.optionalKey(ProgressKind),
|
|
65
|
+
step: Schema.optionalKey(Text),
|
|
66
|
+
total: Schema.optionalKey(Count),
|
|
67
|
+
/**
|
|
68
|
+
* Tell the owner when the task ends: a notification (category `progress`, in-app and by their preferences)
|
|
69
|
+
* when it succeeds or fails, once; never for a cancellation, which the owner asked for.
|
|
70
|
+
*/
|
|
71
|
+
notify: Schema.optionalKey(Schema.Boolean),
|
|
72
|
+
})
|
|
73
|
+
export type ProgressStart = typeof ProgressStart.Type
|
|
74
|
+
|
|
75
|
+
/** A report (`ctx.progress.update`): any of a step, a percentage, a count and a message. */
|
|
76
|
+
export const ProgressUpdate = Schema.Struct({
|
|
77
|
+
step: Schema.optionalKey(Text),
|
|
78
|
+
message: Schema.optionalKey(Text),
|
|
79
|
+
percent: Schema.optionalKey(Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 100 }))),
|
|
80
|
+
done: Schema.optionalKey(Count),
|
|
81
|
+
total: Schema.optionalKey(Count),
|
|
82
|
+
})
|
|
83
|
+
export type ProgressUpdate = typeof ProgressUpdate.Type
|
|
84
|
+
|
|
85
|
+
/** How a task ends (`ctx.progress.complete` / `fail`). */
|
|
86
|
+
export const ProgressFinish = Schema.Struct({ message: Schema.optionalKey(Text) })
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* What a report tells the work (`ctx.progress.update` and `checkpoint` in a workflow): `cancelled` once the owner
|
|
90
|
+
* asked to stop (the task is then `cancelled`, and the work should return), `finished` once the task is no longer
|
|
91
|
+
* running (a report on it changed nothing).
|
|
92
|
+
*/
|
|
93
|
+
export const ProgressReport = Schema.Struct({ cancelled: Schema.Boolean, finished: Schema.Boolean })
|
|
94
|
+
export type ProgressReport = typeof ProgressReport.Type
|
|
95
|
+
|
|
96
|
+
export const ProgressList = Schema.Struct({
|
|
97
|
+
/** Only running tasks (default: every task of yours, newest first). */
|
|
98
|
+
active: Schema.optionalKey(Schema.Boolean),
|
|
99
|
+
limit: Schema.optionalKey(Schema.Number.check(Schema.isBetween({ minimum: 1, maximum: 200 }))),
|
|
100
|
+
})
|
|
101
|
+
export const ProgressTasks = Schema.Struct({ tasks: Schema.Array(ProgressTask) })
|
|
102
|
+
export const ProgressRef = Schema.Struct({ id: Schema.String })
|
|
103
|
+
export const ProgressCancelled = Schema.Struct({ id: Schema.String, cancelRequested: Schema.Boolean })
|
|
104
|
+
|
|
105
|
+
/** The kernel actions (module `progress`). */
|
|
106
|
+
export const PROGRESS_ACTIONS = {
|
|
107
|
+
list: "progress.list",
|
|
108
|
+
get: "progress.get",
|
|
109
|
+
cancel: "progress.cancel",
|
|
110
|
+
remove: "progress.remove",
|
|
111
|
+
} as const
|
|
112
|
+
|
|
113
|
+
const Errors = Schema.Union([Unauthenticated, Forbidden, InvalidInput])
|
|
114
|
+
|
|
115
|
+
export const ProgressContract = defineServiceContract({
|
|
116
|
+
name: "Progress",
|
|
117
|
+
kind: "kernel",
|
|
118
|
+
version: "1.0.0",
|
|
119
|
+
description:
|
|
120
|
+
"Progress records for long-running work (workflows, ingestion, agent runs, imports, exports): a title, a " +
|
|
121
|
+
"step, a percentage or count, a message and a status, owned by the person whose work it is and synced to " +
|
|
122
|
+
"their replica only. Work reports through ctx.progress in handlers and workflows; the owner cancels, and a workflow " +
|
|
123
|
+
"learns it at its next report or checkpoint and stops. Finished tasks never change.",
|
|
124
|
+
operations: {
|
|
125
|
+
start: defineOperation({
|
|
126
|
+
description:
|
|
127
|
+
"In process (ctx.progress.start): start a task owned by the acting person. In a workflow the task is keyed " +
|
|
128
|
+
"by the execution and the name, so a resumed execution continues the same task.",
|
|
129
|
+
input: ProgressStart,
|
|
130
|
+
output: ProgressRef,
|
|
131
|
+
errors: InvalidInput,
|
|
132
|
+
}),
|
|
133
|
+
update: defineOperation({
|
|
134
|
+
description:
|
|
135
|
+
"In process (ctx.progress.update): report a step, a percentage, a count or a message. In a workflow it " +
|
|
136
|
+
"answers whether the owner cancelled (the task then ends cancelled and nothing more is recorded) and " +
|
|
137
|
+
"whether the task had finished already (the report changed nothing).",
|
|
138
|
+
input: Schema.Struct({ id: Schema.String, update: ProgressUpdate }),
|
|
139
|
+
output: ProgressReport,
|
|
140
|
+
errors: InvalidInput,
|
|
141
|
+
}),
|
|
142
|
+
checkpoint: defineOperation({
|
|
143
|
+
description:
|
|
144
|
+
"In process (ctx.progress.checkpoint, workflows): whether the owner cancelled (the task then ends cancelled).",
|
|
145
|
+
input: ProgressRef,
|
|
146
|
+
output: ProgressReport,
|
|
147
|
+
errors: Schema.Never,
|
|
148
|
+
}),
|
|
149
|
+
complete: defineOperation({
|
|
150
|
+
description: "In process: the task succeeded (100 percent). A cancelled or finished task stays as it is.",
|
|
151
|
+
input: Schema.Struct({ id: Schema.String, finish: ProgressFinish }),
|
|
152
|
+
output: Schema.Void,
|
|
153
|
+
errors: Schema.Never,
|
|
154
|
+
}),
|
|
155
|
+
fail: defineOperation({
|
|
156
|
+
description: "In process: the task failed, with a message (redacted and cut to the limit).",
|
|
157
|
+
input: Schema.Struct({ id: Schema.String, finish: ProgressFinish }),
|
|
158
|
+
output: Schema.Void,
|
|
159
|
+
errors: Schema.Never,
|
|
160
|
+
}),
|
|
161
|
+
list: defineOperation({
|
|
162
|
+
description: "progress.list: your own tasks in the organisation you act in, newest first.",
|
|
163
|
+
input: ProgressList,
|
|
164
|
+
output: ProgressTasks,
|
|
165
|
+
errors: Errors,
|
|
166
|
+
}),
|
|
167
|
+
get: defineOperation({
|
|
168
|
+
description: "progress.get: one of your tasks.",
|
|
169
|
+
input: ProgressRef,
|
|
170
|
+
output: ProgressTask,
|
|
171
|
+
errors: Errors,
|
|
172
|
+
}),
|
|
173
|
+
cancel: defineOperation({
|
|
174
|
+
description:
|
|
175
|
+
"progress.cancel: ask the work behind one of your running tasks to stop. Audited. Cancelling a finished " +
|
|
176
|
+
"task changes nothing.",
|
|
177
|
+
input: ProgressRef,
|
|
178
|
+
output: ProgressCancelled,
|
|
179
|
+
errors: Errors,
|
|
180
|
+
}),
|
|
181
|
+
remove: defineOperation({
|
|
182
|
+
description: "progress.remove: delete one of your finished tasks (a running one is refused).",
|
|
183
|
+
input: ProgressRef,
|
|
184
|
+
output: ProgressRef,
|
|
185
|
+
errors: Errors,
|
|
186
|
+
}),
|
|
187
|
+
},
|
|
188
|
+
types: { ProgressTask, ProgressKind, ProgressStatus, ProgressStart, ProgressUpdate, ProgressReport },
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
/** The percentage a report gives: its own, or derived from done and total. */
|
|
192
|
+
export const progressPercent = (done: number | null, total: number | null, percent: number | null): number | null => {
|
|
193
|
+
if (percent !== null) return Math.round(percent * 100) / 100
|
|
194
|
+
if (done === null || total === null || total <= 0) return null
|
|
195
|
+
return Math.round(Math.min(100, (done / total) * 100) * 100) / 100
|
|
196
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuerySurface (decision 6): the agent's, and any authorised client's, read-only SQL over the published
|
|
3
|
+
* query views of installed modules, each row filtered by its entity's read policy for the caller. Every
|
|
4
|
+
* write goes through actions. Documented in docs/contracts/query-surface.md; conformance kit
|
|
5
|
+
* `@eloxiv/testing/conformance/QuerySurface`.
|
|
6
|
+
*/
|
|
7
|
+
import { Schema } from "effect"
|
|
8
|
+
import { ActionFailed, Forbidden, InvalidInput, Unauthenticated } from "../Errors.ts"
|
|
9
|
+
import { JsonSchemaObject } from "../Projection.ts"
|
|
10
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
11
|
+
|
|
12
|
+
/** The kernel action that runs a query (`eloxiv_query` as an MCP and agent tool). */
|
|
13
|
+
export const QUERY_ACTION = "eloxiv.query"
|
|
14
|
+
/** The kernel action that describes the query surface: its views and their columns (the agent's `\d`). */
|
|
15
|
+
export const QUERY_VIEWS_ACTION = "eloxiv.queryViews"
|
|
16
|
+
/** The most rows one query returns; a caller asks for fewer with `limit`. */
|
|
17
|
+
export const QUERY_MAX_ROWS = 1000
|
|
18
|
+
/** The longest query text accepted, in characters. */
|
|
19
|
+
export const QUERY_MAX_LENGTH = 20_000
|
|
20
|
+
|
|
21
|
+
export const QueryRequest = Schema.Struct({
|
|
22
|
+
/**
|
|
23
|
+
* One read-only `SELECT` (CTEs, joins and subqueries allowed) over the query surface's views, named
|
|
24
|
+
* unqualified as `<module>_<view>` (see `QueryViews`).
|
|
25
|
+
*/
|
|
26
|
+
sql: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(QUERY_MAX_LENGTH)),
|
|
27
|
+
/** At most this many rows (default and maximum 1000); `truncated` says whether more matched. */
|
|
28
|
+
limit: Schema.optionalKey(
|
|
29
|
+
Schema.Number.check(Schema.isInt(), Schema.isBetween({ minimum: 1, maximum: QUERY_MAX_ROWS })),
|
|
30
|
+
),
|
|
31
|
+
})
|
|
32
|
+
export type QueryRequest = typeof QueryRequest.Type
|
|
33
|
+
|
|
34
|
+
export const QueryColumn = Schema.Struct({
|
|
35
|
+
name: Schema.String,
|
|
36
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
37
|
+
type: Schema.String,
|
|
38
|
+
})
|
|
39
|
+
export type QueryColumn = typeof QueryColumn.Type
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A query's answer. Each row is a JSON object keyed by column name, its values as Postgres's `to_json`
|
|
43
|
+
* renders them (numbers, including `bigint` and `numeric`, as JSON numbers; timestamps as ISO 8601 text).
|
|
44
|
+
*/
|
|
45
|
+
export const QueryResult = Schema.Struct({
|
|
46
|
+
columns: Schema.Array(QueryColumn),
|
|
47
|
+
rows: Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
|
|
48
|
+
rowCount: Schema.Number,
|
|
49
|
+
/** More rows matched than were returned. */
|
|
50
|
+
truncated: Schema.Boolean,
|
|
51
|
+
/** The published views (`<module>.<view>`) the query read. */
|
|
52
|
+
views: Schema.Array(Schema.String),
|
|
53
|
+
})
|
|
54
|
+
export type QueryResult = typeof QueryResult.Type
|
|
55
|
+
|
|
56
|
+
export const QueryViewColumn = Schema.Struct({
|
|
57
|
+
name: Schema.String,
|
|
58
|
+
type: Schema.String,
|
|
59
|
+
description: Schema.NullOr(Schema.String),
|
|
60
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
61
|
+
schema: JsonSchemaObject,
|
|
62
|
+
})
|
|
63
|
+
export type QueryViewColumn = typeof QueryViewColumn.Type
|
|
64
|
+
|
|
65
|
+
export const QueryViewDescription = Schema.Struct({
|
|
66
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
67
|
+
name: Schema.String,
|
|
68
|
+
/** The published view's id: `<module>.<view>`. */
|
|
69
|
+
id: Schema.String,
|
|
70
|
+
module: Schema.String,
|
|
71
|
+
description: Schema.String,
|
|
72
|
+
/** The entity whose read policy filters each row. */
|
|
73
|
+
entity: Schema.String,
|
|
74
|
+
columns: Schema.Array(QueryViewColumn),
|
|
75
|
+
})
|
|
76
|
+
export type QueryViewDescription = typeof QueryViewDescription.Type
|
|
77
|
+
|
|
78
|
+
export const QueryViews = Schema.Struct({ views: Schema.Array(QueryViewDescription) })
|
|
79
|
+
export type QueryViews = typeof QueryViews.Type
|
|
80
|
+
|
|
81
|
+
/** What the audit record of a query holds beside the invocation's own fields (`detail`). */
|
|
82
|
+
export const QueryAuditDetail = Schema.Struct({
|
|
83
|
+
/** sha256 of the query text, hex. */
|
|
84
|
+
queryHash: Schema.String,
|
|
85
|
+
views: Schema.Array(Schema.String),
|
|
86
|
+
rowCount: Schema.Number,
|
|
87
|
+
truncated: Schema.Boolean,
|
|
88
|
+
/** Why the query was refused, when it was. */
|
|
89
|
+
refused: Schema.optionalKey(Schema.String),
|
|
90
|
+
})
|
|
91
|
+
export type QueryAuditDetail = typeof QueryAuditDetail.Type
|
|
92
|
+
|
|
93
|
+
export const QuerySurfaceError = Schema.Union([Unauthenticated, Forbidden, InvalidInput, ActionFailed])
|
|
94
|
+
|
|
95
|
+
export const QuerySurfaceContract = defineServiceContract({
|
|
96
|
+
name: "QuerySurface",
|
|
97
|
+
kind: "kernel",
|
|
98
|
+
version: "1.0.0",
|
|
99
|
+
description:
|
|
100
|
+
"Read-only SQL over the published query views of installed modules (decision 6). A query is parsed and " +
|
|
101
|
+
"verified as one SELECT that reads only the query surface's views and calls only allowlisted side-effect-free " +
|
|
102
|
+
"built-ins, then runs in a read-only transaction with a statement timeout and a row limit, as a dedicated read " +
|
|
103
|
+
"role that can read only those views, each row filtered by its entity's read policy for the caller. Calls are " +
|
|
104
|
+
"the kernel actions eloxiv.query and eloxiv.queryViews on the one invocation path, so every surface has them " +
|
|
105
|
+
"and every call is audited with the query's hash, the views it read and its row count.",
|
|
106
|
+
operations: {
|
|
107
|
+
query: defineOperation({
|
|
108
|
+
description:
|
|
109
|
+
"Run one read-only SELECT over the query surface for the caller: its columns with their types, its rows, " +
|
|
110
|
+
"whether it was truncated and which views it read. Refused (InvalidInput) unless it is one SELECT over " +
|
|
111
|
+
"published views calling only allowlisted built-ins; a failure while it runs (a timeout, say) is ActionFailed.",
|
|
112
|
+
input: QueryRequest,
|
|
113
|
+
output: QueryResult,
|
|
114
|
+
errors: QuerySurfaceError,
|
|
115
|
+
}),
|
|
116
|
+
describe: defineOperation({
|
|
117
|
+
description:
|
|
118
|
+
"The query surface's views: each one's relation name, id, module, description, filtering entity and " +
|
|
119
|
+
"columns with their types and descriptions.",
|
|
120
|
+
input: Schema.Struct({}),
|
|
121
|
+
output: QueryViews,
|
|
122
|
+
errors: Schema.Union([Unauthenticated, Forbidden]),
|
|
123
|
+
}),
|
|
124
|
+
},
|
|
125
|
+
types: {
|
|
126
|
+
QueryRequest,
|
|
127
|
+
QueryResult,
|
|
128
|
+
QueryColumn,
|
|
129
|
+
QueryViews,
|
|
130
|
+
QueryViewDescription,
|
|
131
|
+
QueryViewColumn,
|
|
132
|
+
QueryAuditDetail,
|
|
133
|
+
},
|
|
134
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Readiness: liveness (`GET /health`) and readiness (`GET /ready`), with the
|
|
3
|
+
* reasons a kernel is not ready or is degraded. Documented in
|
|
4
|
+
* docs/contracts/readiness.md; conformance kit
|
|
5
|
+
* `@eloxiv/testing/conformance/Readiness`.
|
|
6
|
+
*/
|
|
7
|
+
import { Schema } from "effect"
|
|
8
|
+
import { defineServiceContract } from "../Service.ts"
|
|
9
|
+
|
|
10
|
+
export const HEALTH_PATH = "/health"
|
|
11
|
+
export const READY_PATH = "/ready"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* One check's verdict: `ok`; `degraded` (serving, but an operator should look); `not-ready` (do not send it
|
|
15
|
+
* traffic); `skipped` (this process does not run what the check covers, by configuration).
|
|
16
|
+
*/
|
|
17
|
+
export const CheckStatus = Schema.Literals(["ok", "degraded", "not-ready", "skipped"])
|
|
18
|
+
export type CheckStatus = typeof CheckStatus.Type
|
|
19
|
+
|
|
20
|
+
export const ReadinessCheck = Schema.Struct({
|
|
21
|
+
/**
|
|
22
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
23
|
+
* `connectors`.
|
|
24
|
+
*/
|
|
25
|
+
name: Schema.String,
|
|
26
|
+
status: CheckStatus,
|
|
27
|
+
/** Why, in words an operator can act on. */
|
|
28
|
+
detail: Schema.String,
|
|
29
|
+
})
|
|
30
|
+
export type ReadinessCheck = typeof ReadinessCheck.Type
|
|
31
|
+
|
|
32
|
+
/** `ready` when every check is ok or skipped; `degraded` when one is degraded; `not-ready` when one is not ready. */
|
|
33
|
+
export const ReadinessReport = Schema.Struct({
|
|
34
|
+
status: Schema.Literals(["ready", "degraded", "not-ready"]),
|
|
35
|
+
checks: Schema.Array(ReadinessCheck),
|
|
36
|
+
})
|
|
37
|
+
export type ReadinessReport = typeof ReadinessReport.Type
|
|
38
|
+
|
|
39
|
+
export const Liveness = Schema.Struct({ status: Schema.Literal("ok"), version: Schema.String })
|
|
40
|
+
export type Liveness = typeof Liveness.Type
|
|
41
|
+
|
|
42
|
+
export const ReadinessContract = defineServiceContract({
|
|
43
|
+
name: "Readiness",
|
|
44
|
+
kind: "kernel",
|
|
45
|
+
version: "1.2.0",
|
|
46
|
+
description:
|
|
47
|
+
"Liveness (GET /health: the process answers) and readiness (GET /ready: 200 when ready or degraded, 503 " +
|
|
48
|
+
"when not ready), with a verdict and reason per check: the database answers, the database is migrated for " +
|
|
49
|
+
"this build, this process's cluster runner is registered, its outbox dispatcher is running, and open dead " +
|
|
50
|
+
"letters are within the threshold (more is a degradation), the storage backend answers, the agent's default " +
|
|
51
|
+
"model is installed, and every connector has its settings (the last two a degradation when not).",
|
|
52
|
+
operations: {
|
|
53
|
+
live: {
|
|
54
|
+
description: "Liveness: answers while the process serves requests; checks nothing else.",
|
|
55
|
+
input: Schema.Struct({}),
|
|
56
|
+
output: Liveness,
|
|
57
|
+
errors: Schema.Never,
|
|
58
|
+
},
|
|
59
|
+
check: {
|
|
60
|
+
description: "Run every readiness check now and report each verdict with its reason.",
|
|
61
|
+
input: Schema.Struct({}),
|
|
62
|
+
output: ReadinessReport,
|
|
63
|
+
errors: Schema.Never,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
types: { ReadinessCheck, ReadinessReport, Liveness, CheckStatus },
|
|
67
|
+
})
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release: how one deployment's kernel is released and migrated. Migration
|
|
3
|
+
* ownership under a lease, one transaction for migrations and hardening,
|
|
4
|
+
* schema snapshots, client/server version skew and deployment topology.
|
|
5
|
+
* Documented in docs/contracts/release.md; conformance kit
|
|
6
|
+
* `@eloxiv/testing/conformance/Release`.
|
|
7
|
+
*/
|
|
8
|
+
import { Schema } from "effect"
|
|
9
|
+
import { defineServiceContract } from "../Service.ts"
|
|
10
|
+
|
|
11
|
+
/** The header a client sends its version in. Writes from clients older than the minimum are refused. */
|
|
12
|
+
export const CLIENT_VERSION_HEADER = "x-eloxiv-client-version"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* MCP clients built on Eloxiv (its SDK and the apps built on it) name themselves in the MCP `initialize`
|
|
16
|
+
* request's `clientInfo.name` with this prefix (`eloxiv:<app or package>`, for example `eloxiv:hello-app`), and
|
|
17
|
+
* put their version in `clientInfo.version`. For such a session the kernel takes `clientInfo.version` as the
|
|
18
|
+
* client version when a request does not send `x-eloxiv-client-version` (the header wins when both are sent).
|
|
19
|
+
* Any other MCP client's `clientInfo.version` is its own product version, not an Eloxiv client version, and is
|
|
20
|
+
* ignored: such a client is gated only if it sends the header.
|
|
21
|
+
*/
|
|
22
|
+
export const MCP_CLIENT_NAME_PREFIX = "eloxiv:"
|
|
23
|
+
|
|
24
|
+
/** The Eloxiv client version an MCP session's `clientInfo` declares, under the convention above. */
|
|
25
|
+
export const mcpClientVersion = (
|
|
26
|
+
clientInfo: { readonly name?: string | undefined; readonly version?: string | undefined } | undefined,
|
|
27
|
+
): string | undefined =>
|
|
28
|
+
clientInfo?.name?.startsWith(MCP_CLIENT_NAME_PREFIX) === true && typeof clientInfo.version === "string"
|
|
29
|
+
? clientInfo.version
|
|
30
|
+
: undefined
|
|
31
|
+
|
|
32
|
+
/** Where the kernel advertises its release (`ReleaseInfo`), unauthenticated. */
|
|
33
|
+
export const RELEASE_PATH = "/release"
|
|
34
|
+
|
|
35
|
+
/** Another setup holds the migration lease, and did not release it in time (or is stuck holding it). */
|
|
36
|
+
export class ReleaseLeaseHeld extends Schema.TaggedError<ReleaseLeaseHeld>()("ReleaseLeaseHeld", {
|
|
37
|
+
message: Schema.String,
|
|
38
|
+
/** Who holds it, as recorded with the lease (null if the holder has not recorded itself yet). */
|
|
39
|
+
owner: Schema.NullOr(Schema.String),
|
|
40
|
+
acquiredAt: Schema.NullOr(Schema.String),
|
|
41
|
+
/** When the holder's lease runs out unless it renews it; a lock held past it means a stuck holder. */
|
|
42
|
+
expiresAt: Schema.NullOr(Schema.String),
|
|
43
|
+
}) {}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A migration, or the hardening after it, failed: nothing of the setup's transaction was applied. `migration`
|
|
47
|
+
* is null when the hardening (or a published view) refused what the migrations left.
|
|
48
|
+
*/
|
|
49
|
+
export class MigrationFailed extends Schema.TaggedError<MigrationFailed>()("MigrationFailed", {
|
|
50
|
+
message: Schema.String,
|
|
51
|
+
module: Schema.String,
|
|
52
|
+
migration: Schema.NullOr(Schema.String),
|
|
53
|
+
}) {}
|
|
54
|
+
|
|
55
|
+
/** A module's schema as setup recorded it after migrating and hardening. */
|
|
56
|
+
export const SchemaSnapshotRecord = Schema.Struct({
|
|
57
|
+
/** The module name (`eloxiv` for the kernel's own schemas). */
|
|
58
|
+
module: Schema.String,
|
|
59
|
+
/** sha256 of the canonical snapshot. */
|
|
60
|
+
fingerprint: Schema.String,
|
|
61
|
+
/** The migrations applied when it was recorded, in order. */
|
|
62
|
+
migrations: Schema.Array(Schema.String),
|
|
63
|
+
recordedAt: Schema.String,
|
|
64
|
+
})
|
|
65
|
+
export type SchemaSnapshotRecord = typeof SchemaSnapshotRecord.Type
|
|
66
|
+
|
|
67
|
+
/** What one setup did. */
|
|
68
|
+
export const SetupReport = Schema.Struct({
|
|
69
|
+
/** The lease owner this setup ran as. */
|
|
70
|
+
owner: Schema.String,
|
|
71
|
+
/** Migrations applied, by module, in order (`eloxiv` for the kernel's). Empty when nothing was pending. */
|
|
72
|
+
applied: Schema.Record(Schema.String, Schema.Array(Schema.String)),
|
|
73
|
+
/** Declared non-transactional migrations among them, run outside the setup's transaction. */
|
|
74
|
+
outsideTransaction: Schema.Array(Schema.String),
|
|
75
|
+
/** The snapshot fingerprint recorded for each module. */
|
|
76
|
+
snapshots: Schema.Record(Schema.String, Schema.String),
|
|
77
|
+
/**
|
|
78
|
+
* Modules whose security state (row-level security, policies, privileges, triggers) had been changed outside
|
|
79
|
+
* setup since their last hardening, and that this setup hardened again.
|
|
80
|
+
*/
|
|
81
|
+
repaired: Schema.Array(Schema.String),
|
|
82
|
+
})
|
|
83
|
+
export type SetupReport = typeof SetupReport.Type
|
|
84
|
+
|
|
85
|
+
/** Whether the database is current for this build. */
|
|
86
|
+
export const ReleaseStatus = Schema.Struct({
|
|
87
|
+
/** Migrations this build ships that the database has not applied, as `<module>/<migration>`. */
|
|
88
|
+
pending: Schema.Array(Schema.String),
|
|
89
|
+
/** Modules whose live schema no longer matches the snapshot setup recorded (changed outside setup). */
|
|
90
|
+
drifted: Schema.Array(Schema.String),
|
|
91
|
+
/** Modules this build installs that setup never recorded a snapshot for. */
|
|
92
|
+
unrecorded: Schema.Array(Schema.String),
|
|
93
|
+
/**
|
|
94
|
+
* Modules whose security state (row-level security, policies, privileges, triggers) no longer matches what
|
|
95
|
+
* their last hardening left (security drift). The next setup repairs it, or refuses if it cannot. `eloxiv`: the
|
|
96
|
+
* kernel's own schemas changed outside setup (or no state is recorded); `zero-cache`: its DDL triggers were left
|
|
97
|
+
* disabled while no setup runs.
|
|
98
|
+
*/
|
|
99
|
+
insecure: Schema.Array(Schema.String),
|
|
100
|
+
})
|
|
101
|
+
export type ReleaseStatus = typeof ReleaseStatus.Type
|
|
102
|
+
|
|
103
|
+
/** What the kernel advertises at `GET /release`. */
|
|
104
|
+
export const ReleaseInfo = Schema.Struct({
|
|
105
|
+
kernelVersion: Schema.String,
|
|
106
|
+
/** The app's build version (null if the app does not declare one). */
|
|
107
|
+
appVersion: Schema.NullOr(Schema.String),
|
|
108
|
+
/** The oldest client version writes are accepted from (null: no minimum). */
|
|
109
|
+
minClientVersion: Schema.NullOr(Schema.String),
|
|
110
|
+
/** Each installed module's contract version and its recorded schema fingerprint. */
|
|
111
|
+
modules: Schema.Array(
|
|
112
|
+
Schema.Struct({ name: Schema.String, version: Schema.String, schema: Schema.NullOr(Schema.String) }),
|
|
113
|
+
),
|
|
114
|
+
})
|
|
115
|
+
export type ReleaseInfo = typeof ReleaseInfo.Type
|
|
116
|
+
|
|
117
|
+
/** The current holder of the migration lease. */
|
|
118
|
+
export const ReleaseLease = Schema.Struct({
|
|
119
|
+
owner: Schema.String,
|
|
120
|
+
acquiredAt: Schema.String,
|
|
121
|
+
expiresAt: Schema.String,
|
|
122
|
+
})
|
|
123
|
+
export type ReleaseLease = typeof ReleaseLease.Type
|
|
124
|
+
|
|
125
|
+
/** One setup, as recorded once it finished. */
|
|
126
|
+
export const ReleaseRecord = Schema.Struct({
|
|
127
|
+
owner: Schema.String,
|
|
128
|
+
startedAt: Schema.String,
|
|
129
|
+
finishedAt: Schema.String,
|
|
130
|
+
outcome: Schema.Literals(["succeeded", "failed"]),
|
|
131
|
+
error: Schema.NullOr(Schema.String),
|
|
132
|
+
applied: Schema.Record(Schema.String, Schema.Array(Schema.String)),
|
|
133
|
+
})
|
|
134
|
+
export type ReleaseRecord = typeof ReleaseRecord.Type
|
|
135
|
+
|
|
136
|
+
export const ReleaseContract = defineServiceContract({
|
|
137
|
+
name: "Release",
|
|
138
|
+
kind: "kernel",
|
|
139
|
+
version: "1.1.0",
|
|
140
|
+
description:
|
|
141
|
+
"How a deployment's kernel is released and migrated. Setup takes a lease, so one process migrates at a " +
|
|
142
|
+
"time (others wait, then fail clearly), applies kernel and module migrations together with the hardening " +
|
|
143
|
+
"after them in one transaction (a failure leaves the previous state intact), records each module's " +
|
|
144
|
+
"schema snapshot, and keeps a history. Migrations that cannot run in a transaction must be declared and " +
|
|
145
|
+
"run outside it. The kernel advertises its release and refuses writes from clients older than the minimum " +
|
|
146
|
+
"client version (ClientOutdated), while their reads keep working.",
|
|
147
|
+
operations: {
|
|
148
|
+
setup: {
|
|
149
|
+
description:
|
|
150
|
+
"Bootstrap, take the migration lease (waiting up to the configured time), migrate and harden in one " +
|
|
151
|
+
"transaction, record snapshots, release the lease. Idempotent: with nothing pending it changes nothing " +
|
|
152
|
+
"but the snapshots' timestamps and the history.",
|
|
153
|
+
input: Schema.Struct({ owner: Schema.optionalKey(Schema.String), waitMs: Schema.optionalKey(Schema.Number) }),
|
|
154
|
+
output: SetupReport,
|
|
155
|
+
errors: Schema.Union([ReleaseLeaseHeld, MigrationFailed]),
|
|
156
|
+
},
|
|
157
|
+
status: {
|
|
158
|
+
description:
|
|
159
|
+
"Whether the database is current for this build: pending migrations, drift, unrecorded modules, security drift.",
|
|
160
|
+
input: Schema.Struct({}),
|
|
161
|
+
output: ReleaseStatus,
|
|
162
|
+
errors: Schema.Never,
|
|
163
|
+
},
|
|
164
|
+
snapshots: {
|
|
165
|
+
description: "The schema snapshots setup recorded, one per module.",
|
|
166
|
+
input: Schema.Struct({}),
|
|
167
|
+
output: Schema.Array(SchemaSnapshotRecord),
|
|
168
|
+
errors: Schema.Never,
|
|
169
|
+
},
|
|
170
|
+
info: {
|
|
171
|
+
description: "What the kernel advertises at GET /release: versions and the minimum client version.",
|
|
172
|
+
input: Schema.Struct({}),
|
|
173
|
+
output: ReleaseInfo,
|
|
174
|
+
errors: Schema.Never,
|
|
175
|
+
},
|
|
176
|
+
lease: {
|
|
177
|
+
description: "The migration lease's current holder, or null.",
|
|
178
|
+
input: Schema.Struct({}),
|
|
179
|
+
output: Schema.NullOr(ReleaseLease),
|
|
180
|
+
errors: Schema.Never,
|
|
181
|
+
},
|
|
182
|
+
history: {
|
|
183
|
+
description: "Finished setups, oldest first.",
|
|
184
|
+
input: Schema.Struct({}),
|
|
185
|
+
output: Schema.Array(ReleaseRecord),
|
|
186
|
+
errors: Schema.Never,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
types: {
|
|
190
|
+
SchemaSnapshotRecord,
|
|
191
|
+
SetupReport,
|
|
192
|
+
ReleaseStatus,
|
|
193
|
+
ReleaseInfo,
|
|
194
|
+
ReleaseLease,
|
|
195
|
+
ReleaseRecord,
|
|
196
|
+
ReleaseLeaseHeld,
|
|
197
|
+
MigrationFailed,
|
|
198
|
+
},
|
|
199
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ResultRendering: how action results and query-view rows are shown to people and to agents, without any UI in
|
|
3
|
+
* the kernel. Documented in docs/contracts/result-rendering.md; conformance kit
|
|
4
|
+
* `@eloxiv/testing/conformance/ResultRendering`.
|
|
5
|
+
*
|
|
6
|
+
* A module declares a renderer per output schema (`render` on an action, or on a published query view): a
|
|
7
|
+
* table, a card, a list or markdown, naming fields of the output. The kernel checks every declaration against
|
|
8
|
+
* the schema at startup (an unknown field, or a table over something that is not a list of records, refuses the
|
|
9
|
+
* app), publishes it in the manifest, and turns an output into a headless `ResultView` (`renderResult`): plain
|
|
10
|
+
* data a shell or chat UI draws with its own components, and that an agent reads as compact text
|
|
11
|
+
* (`compactResult`, bounded in characters and rows). The same pure functions run in the kernel, the client SDK
|
|
12
|
+
* and any UI, so every surface shows one result the same way.
|
|
13
|
+
*
|
|
14
|
+
* Renderers only select and label what the output already holds: a view never carries a value the output did
|
|
15
|
+
* not, so rendering can neither widen what a caller sees nor fail a call (a value of an unexpected shape is
|
|
16
|
+
* shown as JSON text).
|
|
17
|
+
*/
|
|
18
|
+
import { Schema } from "effect"
|
|
19
|
+
import { InvalidInput } from "../Errors.ts"
|
|
20
|
+
import { RenderDeclaration, RenderField, RenderFormat, ResultView } from "../Render.ts"
|
|
21
|
+
import { defineOperation, defineServiceContract } from "../Service.ts"
|
|
22
|
+
|
|
23
|
+
export * from "../Render.ts"
|
|
24
|
+
|
|
25
|
+
const Json = Schema.Unknown
|
|
26
|
+
|
|
27
|
+
export const RenderTarget = Schema.Struct({
|
|
28
|
+
/** An action name (`crm.find`) or a published query view (`crm.deals`). */
|
|
29
|
+
name: Schema.String,
|
|
30
|
+
})
|
|
31
|
+
export const RenderedResult = Schema.Struct({ view: ResultView, compact: Schema.String })
|
|
32
|
+
|
|
33
|
+
export const ResultRenderingContract = defineServiceContract({
|
|
34
|
+
name: "ResultRendering",
|
|
35
|
+
kind: "kernel",
|
|
36
|
+
version: "1.1.0",
|
|
37
|
+
description:
|
|
38
|
+
"Renderers declared per output schema (table, card, list, markdown) on actions and published query views, " +
|
|
39
|
+
"checked against the schema at startup and published in the manifest; a headless ResultView a shell or " +
|
|
40
|
+
"chat UI draws with its own components; and compact, bounded text for agents. UI-free: the kernel ships no " +
|
|
41
|
+
"component, and a view carries only what the output already held.",
|
|
42
|
+
operations: {
|
|
43
|
+
describe: defineOperation({
|
|
44
|
+
description: "The renderer declared for an action's output or a query view's rows (null when none is).",
|
|
45
|
+
input: RenderTarget,
|
|
46
|
+
output: Schema.NullOr(RenderDeclaration),
|
|
47
|
+
errors: InvalidInput,
|
|
48
|
+
}),
|
|
49
|
+
render: defineOperation({
|
|
50
|
+
description:
|
|
51
|
+
"renderResult: an encoded output as a headless view under its declared renderer (JSON when none fits).",
|
|
52
|
+
input: Schema.Struct({ name: Schema.String, output: Json }),
|
|
53
|
+
output: ResultView,
|
|
54
|
+
errors: InvalidInput,
|
|
55
|
+
}),
|
|
56
|
+
compact: defineOperation({
|
|
57
|
+
description:
|
|
58
|
+
"compactResult: a view as compact text for an agent, within a character and row budget, saying what it left out.",
|
|
59
|
+
input: Schema.Struct({ view: ResultView, maxChars: Schema.optionalKey(Schema.Number) }),
|
|
60
|
+
output: Schema.String,
|
|
61
|
+
errors: Schema.Never,
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
types: { RenderDeclaration, RenderField, RenderFormat, ResultView, RenderedResult },
|
|
65
|
+
})
|