@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,231 @@
|
|
|
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
|
+
/** The kernel action that runs a query (`eloxiv_query` as an MCP and agent tool). */
|
|
10
|
+
export declare const QUERY_ACTION = "eloxiv.query";
|
|
11
|
+
/** The kernel action that describes the query surface: its views and their columns (the agent's `\d`). */
|
|
12
|
+
export declare const QUERY_VIEWS_ACTION = "eloxiv.queryViews";
|
|
13
|
+
/** The most rows one query returns; a caller asks for fewer with `limit`. */
|
|
14
|
+
export declare const QUERY_MAX_ROWS = 1000;
|
|
15
|
+
/** The longest query text accepted, in characters. */
|
|
16
|
+
export declare const QUERY_MAX_LENGTH = 20000;
|
|
17
|
+
export declare const QueryRequest: Schema.Struct<{
|
|
18
|
+
/**
|
|
19
|
+
* One read-only `SELECT` (CTEs, joins and subqueries allowed) over the query surface's views, named
|
|
20
|
+
* unqualified as `<module>_<view>` (see `QueryViews`).
|
|
21
|
+
*/
|
|
22
|
+
readonly sql: Schema.String;
|
|
23
|
+
/** At most this many rows (default and maximum 1000); `truncated` says whether more matched. */
|
|
24
|
+
readonly limit: Schema.optionalKey<Schema.Number>;
|
|
25
|
+
}>;
|
|
26
|
+
export type QueryRequest = typeof QueryRequest.Type;
|
|
27
|
+
export declare const QueryColumn: Schema.Struct<{
|
|
28
|
+
readonly name: Schema.String;
|
|
29
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
30
|
+
readonly type: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
export type QueryColumn = typeof QueryColumn.Type;
|
|
33
|
+
/**
|
|
34
|
+
* A query's answer. Each row is a JSON object keyed by column name, its values as Postgres's `to_json`
|
|
35
|
+
* renders them (numbers, including `bigint` and `numeric`, as JSON numbers; timestamps as ISO 8601 text).
|
|
36
|
+
*/
|
|
37
|
+
export declare const QueryResult: Schema.Struct<{
|
|
38
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
39
|
+
readonly name: Schema.String;
|
|
40
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
41
|
+
readonly type: Schema.String;
|
|
42
|
+
}>>;
|
|
43
|
+
readonly rows: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
44
|
+
readonly rowCount: Schema.Number;
|
|
45
|
+
/** More rows matched than were returned. */
|
|
46
|
+
readonly truncated: Schema.Boolean;
|
|
47
|
+
/** The published views (`<module>.<view>`) the query read. */
|
|
48
|
+
readonly views: Schema.$Array<Schema.String>;
|
|
49
|
+
}>;
|
|
50
|
+
export type QueryResult = typeof QueryResult.Type;
|
|
51
|
+
export declare const QueryViewColumn: Schema.Struct<{
|
|
52
|
+
readonly name: Schema.String;
|
|
53
|
+
readonly type: Schema.String;
|
|
54
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
55
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
56
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
57
|
+
}>;
|
|
58
|
+
export type QueryViewColumn = typeof QueryViewColumn.Type;
|
|
59
|
+
export declare const QueryViewDescription: Schema.Struct<{
|
|
60
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
61
|
+
readonly name: Schema.String;
|
|
62
|
+
/** The published view's id: `<module>.<view>`. */
|
|
63
|
+
readonly id: Schema.String;
|
|
64
|
+
readonly module: Schema.String;
|
|
65
|
+
readonly description: Schema.String;
|
|
66
|
+
/** The entity whose read policy filters each row. */
|
|
67
|
+
readonly entity: Schema.String;
|
|
68
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
69
|
+
readonly name: Schema.String;
|
|
70
|
+
readonly type: Schema.String;
|
|
71
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
72
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
73
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
74
|
+
}>>;
|
|
75
|
+
}>;
|
|
76
|
+
export type QueryViewDescription = typeof QueryViewDescription.Type;
|
|
77
|
+
export declare const QueryViews: Schema.Struct<{
|
|
78
|
+
readonly views: Schema.$Array<Schema.Struct<{
|
|
79
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
80
|
+
readonly name: Schema.String;
|
|
81
|
+
/** The published view's id: `<module>.<view>`. */
|
|
82
|
+
readonly id: Schema.String;
|
|
83
|
+
readonly module: Schema.String;
|
|
84
|
+
readonly description: Schema.String;
|
|
85
|
+
/** The entity whose read policy filters each row. */
|
|
86
|
+
readonly entity: Schema.String;
|
|
87
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
88
|
+
readonly name: Schema.String;
|
|
89
|
+
readonly type: Schema.String;
|
|
90
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
91
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
92
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
93
|
+
}>>;
|
|
94
|
+
}>>;
|
|
95
|
+
}>;
|
|
96
|
+
export type QueryViews = typeof QueryViews.Type;
|
|
97
|
+
/** What the audit record of a query holds beside the invocation's own fields (`detail`). */
|
|
98
|
+
export declare const QueryAuditDetail: Schema.Struct<{
|
|
99
|
+
/** sha256 of the query text, hex. */
|
|
100
|
+
readonly queryHash: Schema.String;
|
|
101
|
+
readonly views: Schema.$Array<Schema.String>;
|
|
102
|
+
readonly rowCount: Schema.Number;
|
|
103
|
+
readonly truncated: Schema.Boolean;
|
|
104
|
+
/** Why the query was refused, when it was. */
|
|
105
|
+
readonly refused: Schema.optionalKey<Schema.String>;
|
|
106
|
+
}>;
|
|
107
|
+
export type QueryAuditDetail = typeof QueryAuditDetail.Type;
|
|
108
|
+
export declare const QuerySurfaceError: Schema.Union<readonly [typeof Unauthenticated, typeof Forbidden, typeof InvalidInput, typeof ActionFailed]>;
|
|
109
|
+
export declare const QuerySurfaceContract: import("../Service.ts").ServiceContract<"QuerySurface", {
|
|
110
|
+
readonly query: import("../Service.ts").OperationContract<Schema.Struct<{
|
|
111
|
+
/**
|
|
112
|
+
* One read-only `SELECT` (CTEs, joins and subqueries allowed) over the query surface's views, named
|
|
113
|
+
* unqualified as `<module>_<view>` (see `QueryViews`).
|
|
114
|
+
*/
|
|
115
|
+
readonly sql: Schema.String;
|
|
116
|
+
/** At most this many rows (default and maximum 1000); `truncated` says whether more matched. */
|
|
117
|
+
readonly limit: Schema.optionalKey<Schema.Number>;
|
|
118
|
+
}>, Schema.Struct<{
|
|
119
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
120
|
+
readonly name: Schema.String;
|
|
121
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
122
|
+
readonly type: Schema.String;
|
|
123
|
+
}>>;
|
|
124
|
+
readonly rows: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
125
|
+
readonly rowCount: Schema.Number;
|
|
126
|
+
/** More rows matched than were returned. */
|
|
127
|
+
readonly truncated: Schema.Boolean;
|
|
128
|
+
/** The published views (`<module>.<view>`) the query read. */
|
|
129
|
+
readonly views: Schema.$Array<Schema.String>;
|
|
130
|
+
}>, Schema.Union<readonly [typeof Unauthenticated, typeof Forbidden, typeof InvalidInput, typeof ActionFailed]>>;
|
|
131
|
+
readonly describe: import("../Service.ts").OperationContract<Schema.Struct<{}>, Schema.Struct<{
|
|
132
|
+
readonly views: Schema.$Array<Schema.Struct<{
|
|
133
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
134
|
+
readonly name: Schema.String;
|
|
135
|
+
/** The published view's id: `<module>.<view>`. */
|
|
136
|
+
readonly id: Schema.String;
|
|
137
|
+
readonly module: Schema.String;
|
|
138
|
+
readonly description: Schema.String;
|
|
139
|
+
/** The entity whose read policy filters each row. */
|
|
140
|
+
readonly entity: Schema.String;
|
|
141
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
142
|
+
readonly name: Schema.String;
|
|
143
|
+
readonly type: Schema.String;
|
|
144
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
145
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
146
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
147
|
+
}>>;
|
|
148
|
+
}>>;
|
|
149
|
+
}>, Schema.Union<readonly [typeof Unauthenticated, typeof Forbidden]>>;
|
|
150
|
+
}, {
|
|
151
|
+
readonly QueryRequest: Schema.Struct<{
|
|
152
|
+
/**
|
|
153
|
+
* One read-only `SELECT` (CTEs, joins and subqueries allowed) over the query surface's views, named
|
|
154
|
+
* unqualified as `<module>_<view>` (see `QueryViews`).
|
|
155
|
+
*/
|
|
156
|
+
readonly sql: Schema.String;
|
|
157
|
+
/** At most this many rows (default and maximum 1000); `truncated` says whether more matched. */
|
|
158
|
+
readonly limit: Schema.optionalKey<Schema.Number>;
|
|
159
|
+
}>;
|
|
160
|
+
readonly QueryResult: Schema.Struct<{
|
|
161
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
162
|
+
readonly name: Schema.String;
|
|
163
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
164
|
+
readonly type: Schema.String;
|
|
165
|
+
}>>;
|
|
166
|
+
readonly rows: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
167
|
+
readonly rowCount: Schema.Number;
|
|
168
|
+
/** More rows matched than were returned. */
|
|
169
|
+
readonly truncated: Schema.Boolean;
|
|
170
|
+
/** The published views (`<module>.<view>`) the query read. */
|
|
171
|
+
readonly views: Schema.$Array<Schema.String>;
|
|
172
|
+
}>;
|
|
173
|
+
readonly QueryColumn: Schema.Struct<{
|
|
174
|
+
readonly name: Schema.String;
|
|
175
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
176
|
+
readonly type: Schema.String;
|
|
177
|
+
}>;
|
|
178
|
+
readonly QueryViews: Schema.Struct<{
|
|
179
|
+
readonly views: Schema.$Array<Schema.Struct<{
|
|
180
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
181
|
+
readonly name: Schema.String;
|
|
182
|
+
/** The published view's id: `<module>.<view>`. */
|
|
183
|
+
readonly id: Schema.String;
|
|
184
|
+
readonly module: Schema.String;
|
|
185
|
+
readonly description: Schema.String;
|
|
186
|
+
/** The entity whose read policy filters each row. */
|
|
187
|
+
readonly entity: Schema.String;
|
|
188
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
189
|
+
readonly name: Schema.String;
|
|
190
|
+
readonly type: Schema.String;
|
|
191
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
192
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
193
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
194
|
+
}>>;
|
|
195
|
+
}>>;
|
|
196
|
+
}>;
|
|
197
|
+
readonly QueryViewDescription: Schema.Struct<{
|
|
198
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
199
|
+
readonly name: Schema.String;
|
|
200
|
+
/** The published view's id: `<module>.<view>`. */
|
|
201
|
+
readonly id: Schema.String;
|
|
202
|
+
readonly module: Schema.String;
|
|
203
|
+
readonly description: Schema.String;
|
|
204
|
+
/** The entity whose read policy filters each row. */
|
|
205
|
+
readonly entity: Schema.String;
|
|
206
|
+
readonly columns: Schema.$Array<Schema.Struct<{
|
|
207
|
+
readonly name: Schema.String;
|
|
208
|
+
readonly type: Schema.String;
|
|
209
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
210
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
211
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
212
|
+
}>>;
|
|
213
|
+
}>;
|
|
214
|
+
readonly QueryViewColumn: Schema.Struct<{
|
|
215
|
+
readonly name: Schema.String;
|
|
216
|
+
readonly type: Schema.String;
|
|
217
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
218
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
219
|
+
readonly schema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
220
|
+
}>;
|
|
221
|
+
readonly QueryAuditDetail: Schema.Struct<{
|
|
222
|
+
/** sha256 of the query text, hex. */
|
|
223
|
+
readonly queryHash: Schema.String;
|
|
224
|
+
readonly views: Schema.$Array<Schema.String>;
|
|
225
|
+
readonly rowCount: Schema.Number;
|
|
226
|
+
readonly truncated: Schema.Boolean;
|
|
227
|
+
/** Why the query was refused, when it was. */
|
|
228
|
+
readonly refused: Schema.optionalKey<Schema.String>;
|
|
229
|
+
}>;
|
|
230
|
+
}>;
|
|
231
|
+
//# sourceMappingURL=QuerySurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuerySurface.d.ts","sourceRoot":"","sources":["../../src/contracts/QuerySurface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAIrF,qFAAqF;AACrF,eAAO,MAAM,YAAY,iBAAiB,CAAA;AAC1C,0GAA0G;AAC1G,eAAO,MAAM,kBAAkB,sBAA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B;;;WAGG;;QAEH,gGAAgG;;;;;YAShG,wGAAwG;;;;;QAaxG,4CAA4C;;QAE5C,8DAA8D;;;;;YAe9D,qDAAqD;;YAErD,kDAAkD;;;;YAIlD,qDAAqD;;;;;;gBAZrD,8DAA8D;;;;;;;QAtC9D;;;WAGG;;QAEH,gGAAgG;;;;;;YAShG,wGAAwG;;;;;QAaxG,4CAA4C;;QAE5C,8DAA8D;;;;;QAf9D,wGAAwG;;;;;YA8BxG,qDAAqD;;YAErD,kDAAkD;;;;YAIlD,qDAAqD;;;;;;gBAZrD,8DAA8D;;;;;;QAM9D,qDAAqD;;QAErD,kDAAkD;;;;QAIlD,qDAAqD;;;;;;YAZrD,8DAA8D;;;;;;;;QAA9D,8DAA8D;;;;QAuB9D,qCAAqC;;;;;QAKrC,8CAA8C;;;EA8C9C,CAAA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
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.js";
|
|
9
|
+
import { JsonSchemaObject } from "../Projection.js";
|
|
10
|
+
import { defineOperation, defineServiceContract } from "../Service.js";
|
|
11
|
+
/** The kernel action that runs a query (`eloxiv_query` as an MCP and agent tool). */
|
|
12
|
+
export const QUERY_ACTION = "eloxiv.query";
|
|
13
|
+
/** The kernel action that describes the query surface: its views and their columns (the agent's `\d`). */
|
|
14
|
+
export const QUERY_VIEWS_ACTION = "eloxiv.queryViews";
|
|
15
|
+
/** The most rows one query returns; a caller asks for fewer with `limit`. */
|
|
16
|
+
export const QUERY_MAX_ROWS = 1000;
|
|
17
|
+
/** The longest query text accepted, in characters. */
|
|
18
|
+
export const QUERY_MAX_LENGTH = 20_000;
|
|
19
|
+
export const QueryRequest = Schema.Struct({
|
|
20
|
+
/**
|
|
21
|
+
* One read-only `SELECT` (CTEs, joins and subqueries allowed) over the query surface's views, named
|
|
22
|
+
* unqualified as `<module>_<view>` (see `QueryViews`).
|
|
23
|
+
*/
|
|
24
|
+
sql: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(QUERY_MAX_LENGTH)),
|
|
25
|
+
/** At most this many rows (default and maximum 1000); `truncated` says whether more matched. */
|
|
26
|
+
limit: Schema.optionalKey(Schema.Number.check(Schema.isInt(), Schema.isBetween({ minimum: 1, maximum: QUERY_MAX_ROWS }))),
|
|
27
|
+
});
|
|
28
|
+
export const QueryColumn = Schema.Struct({
|
|
29
|
+
name: Schema.String,
|
|
30
|
+
/** The Postgres type, as `format_type` names it (`text`, `bigint`, `timestamp with time zone`, ...). */
|
|
31
|
+
type: Schema.String,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* A query's answer. Each row is a JSON object keyed by column name, its values as Postgres's `to_json`
|
|
35
|
+
* renders them (numbers, including `bigint` and `numeric`, as JSON numbers; timestamps as ISO 8601 text).
|
|
36
|
+
*/
|
|
37
|
+
export const QueryResult = Schema.Struct({
|
|
38
|
+
columns: Schema.Array(QueryColumn),
|
|
39
|
+
rows: Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
|
|
40
|
+
rowCount: Schema.Number,
|
|
41
|
+
/** More rows matched than were returned. */
|
|
42
|
+
truncated: Schema.Boolean,
|
|
43
|
+
/** The published views (`<module>.<view>`) the query read. */
|
|
44
|
+
views: Schema.Array(Schema.String),
|
|
45
|
+
});
|
|
46
|
+
export const QueryViewColumn = Schema.Struct({
|
|
47
|
+
name: Schema.String,
|
|
48
|
+
type: Schema.String,
|
|
49
|
+
description: Schema.NullOr(Schema.String),
|
|
50
|
+
/** The column's JSON Schema, from the view's declared row. */
|
|
51
|
+
schema: JsonSchemaObject,
|
|
52
|
+
});
|
|
53
|
+
export const QueryViewDescription = Schema.Struct({
|
|
54
|
+
/** The relation a query names: `<module>_<view>`. */
|
|
55
|
+
name: Schema.String,
|
|
56
|
+
/** The published view's id: `<module>.<view>`. */
|
|
57
|
+
id: Schema.String,
|
|
58
|
+
module: Schema.String,
|
|
59
|
+
description: Schema.String,
|
|
60
|
+
/** The entity whose read policy filters each row. */
|
|
61
|
+
entity: Schema.String,
|
|
62
|
+
columns: Schema.Array(QueryViewColumn),
|
|
63
|
+
});
|
|
64
|
+
export const QueryViews = Schema.Struct({ views: Schema.Array(QueryViewDescription) });
|
|
65
|
+
/** What the audit record of a query holds beside the invocation's own fields (`detail`). */
|
|
66
|
+
export const QueryAuditDetail = Schema.Struct({
|
|
67
|
+
/** sha256 of the query text, hex. */
|
|
68
|
+
queryHash: Schema.String,
|
|
69
|
+
views: Schema.Array(Schema.String),
|
|
70
|
+
rowCount: Schema.Number,
|
|
71
|
+
truncated: Schema.Boolean,
|
|
72
|
+
/** Why the query was refused, when it was. */
|
|
73
|
+
refused: Schema.optionalKey(Schema.String),
|
|
74
|
+
});
|
|
75
|
+
export const QuerySurfaceError = Schema.Union([Unauthenticated, Forbidden, InvalidInput, ActionFailed]);
|
|
76
|
+
export const QuerySurfaceContract = defineServiceContract({
|
|
77
|
+
name: "QuerySurface",
|
|
78
|
+
kind: "kernel",
|
|
79
|
+
version: "1.0.0",
|
|
80
|
+
description: "Read-only SQL over the published query views of installed modules (decision 6). A query is parsed and " +
|
|
81
|
+
"verified as one SELECT that reads only the query surface's views and calls only allowlisted side-effect-free " +
|
|
82
|
+
"built-ins, then runs in a read-only transaction with a statement timeout and a row limit, as a dedicated read " +
|
|
83
|
+
"role that can read only those views, each row filtered by its entity's read policy for the caller. Calls are " +
|
|
84
|
+
"the kernel actions eloxiv.query and eloxiv.queryViews on the one invocation path, so every surface has them " +
|
|
85
|
+
"and every call is audited with the query's hash, the views it read and its row count.",
|
|
86
|
+
operations: {
|
|
87
|
+
query: defineOperation({
|
|
88
|
+
description: "Run one read-only SELECT over the query surface for the caller: its columns with their types, its rows, " +
|
|
89
|
+
"whether it was truncated and which views it read. Refused (InvalidInput) unless it is one SELECT over " +
|
|
90
|
+
"published views calling only allowlisted built-ins; a failure while it runs (a timeout, say) is ActionFailed.",
|
|
91
|
+
input: QueryRequest,
|
|
92
|
+
output: QueryResult,
|
|
93
|
+
errors: QuerySurfaceError,
|
|
94
|
+
}),
|
|
95
|
+
describe: defineOperation({
|
|
96
|
+
description: "The query surface's views: each one's relation name, id, module, description, filtering entity and " +
|
|
97
|
+
"columns with their types and descriptions.",
|
|
98
|
+
input: Schema.Struct({}),
|
|
99
|
+
output: QueryViews,
|
|
100
|
+
errors: Schema.Union([Unauthenticated, Forbidden]),
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
103
|
+
types: {
|
|
104
|
+
QueryRequest,
|
|
105
|
+
QueryResult,
|
|
106
|
+
QueryColumn,
|
|
107
|
+
QueryViews,
|
|
108
|
+
QueryViewDescription,
|
|
109
|
+
QueryViewColumn,
|
|
110
|
+
QueryAuditDetail,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=QuerySurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuerySurface.js","sourceRoot":"","sources":["../../src/contracts/QuerySurface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEtE,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAA;AAC1C,0GAA0G;AAC1G,MAAM,CA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AAEvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;IACxD,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,OAAO;IAChB,WAAW,EACT,wGAAwG;QACxG,+GAA+G;QAC/G,gHAAgH;QAChH,+GAA+G;QAC/G,8GAA8G;QAC9G,uFAAuF;IACzF,UAAU,EAAE;QACV,KAAK,EAAE,eAAe,CAAC;YACrB,WAAW,EACT,0GAA0G;gBAC1G,wGAAwG;gBACxG,+GAA+G;YACjH,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,iBAAiB;SAC1B,CAAC;QACF,QAAQ,EAAE,eAAe,CAAC;YACxB,WAAW,EACT,qGAAqG;gBACrG,4CAA4C;YAC9C,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,MAAM,EAAE,UAAU;YAClB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;SACnD,CAAC;KACH;IACD,KAAK,EAAE;QACL,YAAY;QACZ,WAAW;QACX,WAAW;QACX,UAAU;QACV,oBAAoB;QACpB,eAAe;QACf,gBAAgB;KACjB;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
export declare const HEALTH_PATH = "/health";
|
|
9
|
+
export declare const READY_PATH = "/ready";
|
|
10
|
+
/**
|
|
11
|
+
* One check's verdict: `ok`; `degraded` (serving, but an operator should look); `not-ready` (do not send it
|
|
12
|
+
* traffic); `skipped` (this process does not run what the check covers, by configuration).
|
|
13
|
+
*/
|
|
14
|
+
export declare const CheckStatus: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
15
|
+
export type CheckStatus = typeof CheckStatus.Type;
|
|
16
|
+
export declare const ReadinessCheck: Schema.Struct<{
|
|
17
|
+
/**
|
|
18
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
19
|
+
* `connectors`.
|
|
20
|
+
*/
|
|
21
|
+
readonly name: Schema.String;
|
|
22
|
+
readonly status: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
23
|
+
/** Why, in words an operator can act on. */
|
|
24
|
+
readonly detail: Schema.String;
|
|
25
|
+
}>;
|
|
26
|
+
export type ReadinessCheck = typeof ReadinessCheck.Type;
|
|
27
|
+
/** `ready` when every check is ok or skipped; `degraded` when one is degraded; `not-ready` when one is not ready. */
|
|
28
|
+
export declare const ReadinessReport: Schema.Struct<{
|
|
29
|
+
readonly status: Schema.Literals<readonly ["ready", "degraded", "not-ready"]>;
|
|
30
|
+
readonly checks: Schema.$Array<Schema.Struct<{
|
|
31
|
+
/**
|
|
32
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
33
|
+
* `connectors`.
|
|
34
|
+
*/
|
|
35
|
+
readonly name: Schema.String;
|
|
36
|
+
readonly status: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
37
|
+
/** Why, in words an operator can act on. */
|
|
38
|
+
readonly detail: Schema.String;
|
|
39
|
+
}>>;
|
|
40
|
+
}>;
|
|
41
|
+
export type ReadinessReport = typeof ReadinessReport.Type;
|
|
42
|
+
export declare const Liveness: Schema.Struct<{
|
|
43
|
+
readonly status: Schema.Literal<"ok">;
|
|
44
|
+
readonly version: Schema.String;
|
|
45
|
+
}>;
|
|
46
|
+
export type Liveness = typeof Liveness.Type;
|
|
47
|
+
export declare const ReadinessContract: import("../Service.ts").ServiceContract<"Readiness", {
|
|
48
|
+
readonly live: {
|
|
49
|
+
readonly description: "Liveness: answers while the process serves requests; checks nothing else.";
|
|
50
|
+
readonly input: Schema.Struct<{}>;
|
|
51
|
+
readonly output: Schema.Struct<{
|
|
52
|
+
readonly status: Schema.Literal<"ok">;
|
|
53
|
+
readonly version: Schema.String;
|
|
54
|
+
}>;
|
|
55
|
+
readonly errors: Schema.Never;
|
|
56
|
+
};
|
|
57
|
+
readonly check: {
|
|
58
|
+
readonly description: "Run every readiness check now and report each verdict with its reason.";
|
|
59
|
+
readonly input: Schema.Struct<{}>;
|
|
60
|
+
readonly output: Schema.Struct<{
|
|
61
|
+
readonly status: Schema.Literals<readonly ["ready", "degraded", "not-ready"]>;
|
|
62
|
+
readonly checks: Schema.$Array<Schema.Struct<{
|
|
63
|
+
/**
|
|
64
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
65
|
+
* `connectors`.
|
|
66
|
+
*/
|
|
67
|
+
readonly name: Schema.String;
|
|
68
|
+
readonly status: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
69
|
+
/** Why, in words an operator can act on. */
|
|
70
|
+
readonly detail: Schema.String;
|
|
71
|
+
}>>;
|
|
72
|
+
}>;
|
|
73
|
+
readonly errors: Schema.Never;
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
readonly ReadinessCheck: Schema.Struct<{
|
|
77
|
+
/**
|
|
78
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
79
|
+
* `connectors`.
|
|
80
|
+
*/
|
|
81
|
+
readonly name: Schema.String;
|
|
82
|
+
readonly status: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
83
|
+
/** Why, in words an operator can act on. */
|
|
84
|
+
readonly detail: Schema.String;
|
|
85
|
+
}>;
|
|
86
|
+
readonly ReadinessReport: Schema.Struct<{
|
|
87
|
+
readonly status: Schema.Literals<readonly ["ready", "degraded", "not-ready"]>;
|
|
88
|
+
readonly checks: Schema.$Array<Schema.Struct<{
|
|
89
|
+
/**
|
|
90
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
91
|
+
* `connectors`.
|
|
92
|
+
*/
|
|
93
|
+
readonly name: Schema.String;
|
|
94
|
+
readonly status: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
95
|
+
/** Why, in words an operator can act on. */
|
|
96
|
+
readonly detail: Schema.String;
|
|
97
|
+
}>>;
|
|
98
|
+
}>;
|
|
99
|
+
readonly Liveness: Schema.Struct<{
|
|
100
|
+
readonly status: Schema.Literal<"ok">;
|
|
101
|
+
readonly version: Schema.String;
|
|
102
|
+
}>;
|
|
103
|
+
readonly CheckStatus: Schema.Literals<readonly ["ok", "degraded", "not-ready", "skipped"]>;
|
|
104
|
+
}>;
|
|
105
|
+
//# sourceMappingURL=Readiness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Readiness.d.ts","sourceRoot":"","sources":["../../src/contracts/Readiness.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAG/B,eAAO,MAAM,WAAW,YAAY,CAAA;AACpC,eAAO,MAAM,UAAU,WAAW,CAAA;AAElC;;;GAGG;AACH,eAAO,MAAM,WAAW,sEAA8D,CAAA;AACtF,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,eAAO,MAAM,cAAc;IACzB;;;OAGG;;;IAGH,4CAA4C;;EAE5C,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,qHAAqH;AACrH,eAAO,MAAM,eAAe;;;QAZ1B;;;WAGG;;;QAGH,4CAA4C;;;EAS5C,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,eAAO,MAAM,QAAQ;;;EAA0E,CAAA;AAC/F,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;gBArB5B;;;mBAGG;;;gBAGH,4CAA4C;;;;;;;;QAN5C;;;WAGG;;;QAGH,4CAA4C;;;;;;YAN5C;;;eAGG;;;YAGH,4CAA4C;;;;;;;;;EAwC5C,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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.js";
|
|
9
|
+
export const HEALTH_PATH = "/health";
|
|
10
|
+
export const READY_PATH = "/ready";
|
|
11
|
+
/**
|
|
12
|
+
* One check's verdict: `ok`; `degraded` (serving, but an operator should look); `not-ready` (do not send it
|
|
13
|
+
* traffic); `skipped` (this process does not run what the check covers, by configuration).
|
|
14
|
+
*/
|
|
15
|
+
export const CheckStatus = Schema.Literals(["ok", "degraded", "not-ready", "skipped"]);
|
|
16
|
+
export const ReadinessCheck = Schema.Struct({
|
|
17
|
+
/**
|
|
18
|
+
* `database`, `migrations`, `cluster-runner`, `outbox-dispatcher`, `dead-letters`, `storage`, `model-provider` or
|
|
19
|
+
* `connectors`.
|
|
20
|
+
*/
|
|
21
|
+
name: Schema.String,
|
|
22
|
+
status: CheckStatus,
|
|
23
|
+
/** Why, in words an operator can act on. */
|
|
24
|
+
detail: Schema.String,
|
|
25
|
+
});
|
|
26
|
+
/** `ready` when every check is ok or skipped; `degraded` when one is degraded; `not-ready` when one is not ready. */
|
|
27
|
+
export const ReadinessReport = Schema.Struct({
|
|
28
|
+
status: Schema.Literals(["ready", "degraded", "not-ready"]),
|
|
29
|
+
checks: Schema.Array(ReadinessCheck),
|
|
30
|
+
});
|
|
31
|
+
export const Liveness = Schema.Struct({ status: Schema.Literal("ok"), version: Schema.String });
|
|
32
|
+
export const ReadinessContract = defineServiceContract({
|
|
33
|
+
name: "Readiness",
|
|
34
|
+
kind: "kernel",
|
|
35
|
+
version: "1.2.0",
|
|
36
|
+
description: "Liveness (GET /health: the process answers) and readiness (GET /ready: 200 when ready or degraded, 503 " +
|
|
37
|
+
"when not ready), with a verdict and reason per check: the database answers, the database is migrated for " +
|
|
38
|
+
"this build, this process's cluster runner is registered, its outbox dispatcher is running, and open dead " +
|
|
39
|
+
"letters are within the threshold (more is a degradation), the storage backend answers, the agent's default " +
|
|
40
|
+
"model is installed, and every connector has its settings (the last two a degradation when not).",
|
|
41
|
+
operations: {
|
|
42
|
+
live: {
|
|
43
|
+
description: "Liveness: answers while the process serves requests; checks nothing else.",
|
|
44
|
+
input: Schema.Struct({}),
|
|
45
|
+
output: Liveness,
|
|
46
|
+
errors: Schema.Never,
|
|
47
|
+
},
|
|
48
|
+
check: {
|
|
49
|
+
description: "Run every readiness check now and report each verdict with its reason.",
|
|
50
|
+
input: Schema.Struct({}),
|
|
51
|
+
output: ReadinessReport,
|
|
52
|
+
errors: Schema.Never,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
types: { ReadinessCheck, ReadinessReport, Liveness, CheckStatus },
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=Readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Readiness.js","sourceRoot":"","sources":["../../src/contracts/Readiness.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,C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