@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,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connections: one OAuth grant per (organisation, owner, provider account), with merged scopes, custody in
|
|
3
|
+
* Secrets, refresh, and the 401-versus-403 rule. See docs/contracts/connections.md.
|
|
4
|
+
*/
|
|
5
|
+
import { Schema } from "effect";
|
|
6
|
+
import { Forbidden, InvalidInput, Unauthenticated } from "../Errors.js";
|
|
7
|
+
import { defineOperation, defineServiceContract } from "../Service.js";
|
|
8
|
+
import { CapabilityError, CapabilityName } from "./Capability.js";
|
|
9
|
+
import { ApiOperation, ApiResponse } from "./HttpApi.js";
|
|
10
|
+
import { RemoteTool, ResourceContent, ToolResult } from "./ToolSource.js";
|
|
11
|
+
export const ConnectionStatus = Schema.Literals(["active", "needs-reauth", "disconnected"]);
|
|
12
|
+
export const Connection = Schema.Struct({
|
|
13
|
+
id: Schema.String,
|
|
14
|
+
orgId: Schema.String,
|
|
15
|
+
ownerId: Schema.String,
|
|
16
|
+
/** The connector's name, e.g. `microsoft-graph`, `google`. */
|
|
17
|
+
provider: Schema.String,
|
|
18
|
+
/** The provider's stable id for the account (Entra object id, Google `sub`). */
|
|
19
|
+
accountId: Schema.String,
|
|
20
|
+
/** A human label for the account (its email address). */
|
|
21
|
+
accountLabel: Schema.String,
|
|
22
|
+
/** The provider scopes granted, merged across every consent on this Connection. */
|
|
23
|
+
scopes: Schema.Array(Schema.String),
|
|
24
|
+
status: ConnectionStatus,
|
|
25
|
+
/** Why it is not active (for example the provider's `invalid_grant`). */
|
|
26
|
+
statusReason: Schema.NullOr(Schema.String),
|
|
27
|
+
/**
|
|
28
|
+
* Owned by the organisation rather than by `ownerId` (who added it): used by the members, groups and modules it is
|
|
29
|
+
* granted to (`connections.grant`), never by anyone else.
|
|
30
|
+
*/
|
|
31
|
+
shared: Schema.Boolean,
|
|
32
|
+
/** An endpoint Connection's endpoint (a remote MCP server, an HTTP API's base URL); null for a provider's. */
|
|
33
|
+
endpoint: Schema.NullOr(Schema.String),
|
|
34
|
+
/** How it authenticates: the connector's OAuth grant or a discovered one (`oauth`), a secret (`secret`), nothing. */
|
|
35
|
+
auth: Schema.Literals(["oauth", "secret", "none"]),
|
|
36
|
+
/** For a ToolSource Connection: the only tools listed and callable (null: every tool the server offers). */
|
|
37
|
+
tools: Schema.NullOr(Schema.Array(Schema.String)),
|
|
38
|
+
createdAt: Schema.String,
|
|
39
|
+
updatedAt: Schema.String,
|
|
40
|
+
});
|
|
41
|
+
/** What starting (or upgrading) a grant returns: where to send the person's browser. */
|
|
42
|
+
export const ConsentStart = Schema.Struct({
|
|
43
|
+
flowId: Schema.String,
|
|
44
|
+
/** `<kernel>/connections/authorize?flow=<id>`: opened in a browser signed in as the same person. */
|
|
45
|
+
authorizeUrl: Schema.String,
|
|
46
|
+
/** The provider scopes the consent asks for (merged with the Connection's when upgrading). */
|
|
47
|
+
scopes: Schema.Array(Schema.String),
|
|
48
|
+
expiresAt: Schema.String,
|
|
49
|
+
});
|
|
50
|
+
const Request = {
|
|
51
|
+
/** Abstract capabilities to grant (each maps to the connector's scopes for its operations). */
|
|
52
|
+
capabilities: Schema.optionalKey(Schema.Array(CapabilityName)),
|
|
53
|
+
/** Provider scopes to grant beyond the capabilities'. */
|
|
54
|
+
scopes: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
55
|
+
/** Where the browser goes after the callback: a path on the app, or a trusted origin. */
|
|
56
|
+
returnTo: Schema.optionalKey(Schema.String),
|
|
57
|
+
/** Connect it for the organisation (with eloxiv.connections.manage): shared, used by those it is granted to. */
|
|
58
|
+
shared: Schema.optionalKey(Schema.Boolean),
|
|
59
|
+
};
|
|
60
|
+
export const ConnectionsError = Schema.Union([Unauthenticated, Forbidden, InvalidInput]);
|
|
61
|
+
/** How an endpoint Connection authenticates to its endpoint. A secret is named, never given: the kernel holds it. */
|
|
62
|
+
export const EndpointAuth = Schema.Union([
|
|
63
|
+
Schema.Struct({ kind: Schema.Literal("none") }),
|
|
64
|
+
Schema.Struct({
|
|
65
|
+
kind: Schema.Literal("secret"),
|
|
66
|
+
/** A secret of the caller (`user`) or of the organisation (`org`, with eloxiv.secrets.manage), put beforehand. */
|
|
67
|
+
scope: Schema.Literals(["user", "org"]),
|
|
68
|
+
name: Schema.String,
|
|
69
|
+
/** The request header it is sent in (default `authorization`). */
|
|
70
|
+
header: Schema.optionalKey(Schema.String),
|
|
71
|
+
/** What precedes it in the header (default `Bearer ` in `authorization`, nothing in any other header). */
|
|
72
|
+
prefix: Schema.optionalKey(Schema.String),
|
|
73
|
+
}),
|
|
74
|
+
Schema.Struct({
|
|
75
|
+
kind: Schema.Literal("oauth"),
|
|
76
|
+
/** Scopes to ask for (default: what the endpoint's metadata says it supports). */
|
|
77
|
+
scopes: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
78
|
+
/** A client the authorization server issued you (default: registered dynamically). */
|
|
79
|
+
clientId: Schema.optionalKey(Schema.String),
|
|
80
|
+
/** That client's secret, as a secret of the caller or the organisation (as for `secret`). */
|
|
81
|
+
clientSecret: Schema.optionalKey(Schema.Struct({ scope: Schema.Literals(["user", "org"]), name: Schema.String })),
|
|
82
|
+
}),
|
|
83
|
+
]);
|
|
84
|
+
/** Who a shared Connection is granted to: every member, one member, a group, or a module (for its handlers). */
|
|
85
|
+
export const ConnectionGrantee = Schema.Union([
|
|
86
|
+
Schema.Struct({ kind: Schema.Literal("org") }),
|
|
87
|
+
Schema.Struct({ kind: Schema.Literal("user"), id: Schema.String }),
|
|
88
|
+
Schema.Struct({ kind: Schema.Literal("group"), id: Schema.String }),
|
|
89
|
+
Schema.Struct({ kind: Schema.Literal("module"), id: Schema.String }),
|
|
90
|
+
]);
|
|
91
|
+
export const ConnectionGrant = Schema.Struct({
|
|
92
|
+
connectionId: Schema.String,
|
|
93
|
+
grantee: ConnectionGrantee,
|
|
94
|
+
grantedBy: Schema.String,
|
|
95
|
+
createdAt: Schema.String,
|
|
96
|
+
});
|
|
97
|
+
const ById = Schema.Struct({ connectionId: Schema.String });
|
|
98
|
+
/**
|
|
99
|
+
* An MCP App session (the MCP Apps extension, headless): one person's open view of a ToolSource tool's `ui://`
|
|
100
|
+
* resource, whose tool calls go through the kernel. `tools` are the tools the view may call: the Connection's exposed
|
|
101
|
+
* tools the server lets an app call (visibility `app`), never another person's and never past `closeApp` or
|
|
102
|
+
* `expiresAt`.
|
|
103
|
+
*/
|
|
104
|
+
export const McpAppSession = Schema.Struct({
|
|
105
|
+
id: Schema.String,
|
|
106
|
+
connectionId: Schema.String,
|
|
107
|
+
/** The tool whose `ui://` resource the session shows. */
|
|
108
|
+
tool: Schema.String,
|
|
109
|
+
resourceUri: Schema.String,
|
|
110
|
+
tools: Schema.Array(Schema.String),
|
|
111
|
+
openedAt: Schema.String,
|
|
112
|
+
expiresAt: Schema.String,
|
|
113
|
+
});
|
|
114
|
+
const BySession = Schema.Struct({ sessionId: Schema.String.check(Schema.isMaxLength(100)) });
|
|
115
|
+
/** An HTTP request a connector makes over a Connection. */
|
|
116
|
+
export const ProviderRequest = Schema.Struct({
|
|
117
|
+
method: Schema.String,
|
|
118
|
+
url: Schema.String,
|
|
119
|
+
headers: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
120
|
+
body: Schema.optionalKey(Schema.String),
|
|
121
|
+
/** The provider scopes the operation needs (for the missing-scope report on a 403). */
|
|
122
|
+
scopes: Schema.Array(Schema.String),
|
|
123
|
+
});
|
|
124
|
+
export const ConnectionsContract = defineServiceContract({
|
|
125
|
+
name: "Connections",
|
|
126
|
+
kind: "kernel",
|
|
127
|
+
version: "1.4.0",
|
|
128
|
+
description: "Kernel Connections: one OAuth grant per (organisation, owner, provider account). Requesting more scopes upgrades the same Connection by incremental consent and merges its scopes; a connector may leave a capability's sensitive scopes to incremental consent alone. A capability may offer bounded raw requests to its provider's API over the Connection, sent through the outbound destination policy. Tokens live in Secrets. The kernel refreshes proactively before expiry, single-flight across callers and processes (a database lock), safely for providers that rotate refresh tokens. A 401 refreshes once and retries; if that fails the Connection needs reauthorisation and its owner is notified. A 403 never refreshes and reports the missing scopes with an offer of incremental consent. A Connection is usable only while its owner is a member of its organisation, checked on every use. The OAuth client flow (authorization code with PKCE S256, state bound to the person's session) runs through kernel routes. The lifecycle operations are actions of the kernel's `connections` module, so they are on every surface, authorised and audited. Custody does not depend on any external service; an adapter seam (ExternalCustody) allows one.",
|
|
129
|
+
operations: {
|
|
130
|
+
connect: defineOperation({
|
|
131
|
+
description: "Action `connections.connect`: start consent for a provider. Returns the kernel's authorize URL; the callback creates the Connection, or upgrades the caller's existing Connection for the same account (one Connection, merged scopes).",
|
|
132
|
+
input: Schema.Struct({ provider: Schema.String, ...Request }),
|
|
133
|
+
output: ConsentStart,
|
|
134
|
+
errors: ConnectionsError,
|
|
135
|
+
}),
|
|
136
|
+
reconnect: defineOperation({
|
|
137
|
+
description: "Action `connections.reconnect`: consent again for one of the caller's Connections, adding scopes (incremental consent) or recovering one that needs reauthorisation. The callback must return the same provider account.",
|
|
138
|
+
input: Schema.Struct({ connectionId: Schema.String, ...Request }),
|
|
139
|
+
output: ConsentStart,
|
|
140
|
+
errors: ConnectionsError,
|
|
141
|
+
}),
|
|
142
|
+
disconnect: defineOperation({
|
|
143
|
+
description: "Action `connections.disconnect`: end one of the caller's Connections (an administrator with eloxiv.connections.manage may end any in the organisation). Its tokens are deleted from Secrets at once; it is never used again.",
|
|
144
|
+
input: Schema.Struct({ connectionId: Schema.String }),
|
|
145
|
+
output: Schema.Struct({ connectionId: Schema.String }),
|
|
146
|
+
errors: ConnectionsError,
|
|
147
|
+
}),
|
|
148
|
+
list: defineOperation({
|
|
149
|
+
description: "Action `connections.list`: the caller's Connections in the organisation they act in (all of the organisation's with eloxiv.connections.manage). Never tokens.",
|
|
150
|
+
input: Schema.Struct({}),
|
|
151
|
+
output: Schema.Struct({ connections: Schema.Array(Connection) }),
|
|
152
|
+
errors: ConnectionsError,
|
|
153
|
+
}),
|
|
154
|
+
add: defineOperation({
|
|
155
|
+
description: "Action `connections.add`: add (or update) a Connection of an endpoint connector (`mcp`, `http-openapi`) to an endpoint the caller names. The endpoint must be https to a public address (or a host the deployment allows); the kernel checks it on every request. With `auth.kind: oauth` the endpoint's authorization server is discovered and a client registered, and `consent` is the consent to open; otherwise the Connection is active at once. Adding the same endpoint again updates it.",
|
|
156
|
+
input: Schema.Struct({
|
|
157
|
+
provider: Schema.String,
|
|
158
|
+
endpoint: Schema.String,
|
|
159
|
+
label: Schema.optionalKey(Schema.String),
|
|
160
|
+
auth: EndpointAuth,
|
|
161
|
+
/** The connector's per-Connection options (an OpenAPI document's path, POSTs that only read). */
|
|
162
|
+
options: Schema.optionalKey(Schema.Unknown),
|
|
163
|
+
/** For a ToolSource Connection: the only tools to expose. */
|
|
164
|
+
tools: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
165
|
+
shared: Schema.optionalKey(Schema.Boolean),
|
|
166
|
+
returnTo: Schema.optionalKey(Schema.String),
|
|
167
|
+
}),
|
|
168
|
+
output: Schema.Struct({ connection: Connection, consent: Schema.NullOr(ConsentStart) }),
|
|
169
|
+
errors: ConnectionsError,
|
|
170
|
+
}),
|
|
171
|
+
grant: defineOperation({
|
|
172
|
+
description: "Action `connections.grant` (eloxiv.connections.manage): grant a shared Connection to every member, a member, a group or a module. A member uses it through the kernel's actions only with a grant to them (or a group of theirs, or everyone); a module's handlers use it only with a grant to the module as well.",
|
|
173
|
+
input: Schema.Struct({ connectionId: Schema.String, grantee: ConnectionGrantee }),
|
|
174
|
+
output: ConnectionGrant,
|
|
175
|
+
errors: ConnectionsError,
|
|
176
|
+
}),
|
|
177
|
+
revoke: defineOperation({
|
|
178
|
+
description: "Action `connections.revoke` (eloxiv.connections.manage): end one grant of a shared Connection.",
|
|
179
|
+
input: Schema.Struct({ connectionId: Schema.String, grantee: ConnectionGrantee }),
|
|
180
|
+
output: ById,
|
|
181
|
+
errors: ConnectionsError,
|
|
182
|
+
}),
|
|
183
|
+
grants: defineOperation({
|
|
184
|
+
description: "Action `connections.grants` (eloxiv.connections.manage): a shared Connection's grants.",
|
|
185
|
+
input: ById,
|
|
186
|
+
output: Schema.Struct({ grants: Schema.Array(ConnectionGrant) }),
|
|
187
|
+
errors: ConnectionsError,
|
|
188
|
+
}),
|
|
189
|
+
tools: defineOperation({
|
|
190
|
+
description: "Action `connections.tools`: the tools a ToolSource Connection the caller may use exposes (every page, at most 1000 tools; only those its `tools` allow).",
|
|
191
|
+
input: ById,
|
|
192
|
+
output: Schema.Struct({ tools: Schema.Array(RemoteTool) }),
|
|
193
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
194
|
+
}),
|
|
195
|
+
callTool: defineOperation({
|
|
196
|
+
description: "Action `connections.callTool`: call one of a ToolSource Connection's tools. An agent's call needs the person's consent; a tool outside the Connection's `tools` is refused before anything is sent.",
|
|
197
|
+
input: Schema.Struct({
|
|
198
|
+
connectionId: Schema.String,
|
|
199
|
+
name: Schema.String,
|
|
200
|
+
arguments: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)),
|
|
201
|
+
}),
|
|
202
|
+
output: ToolResult,
|
|
203
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
204
|
+
}),
|
|
205
|
+
openApp: defineOperation({
|
|
206
|
+
description: "Action `connections.openApp`: open an MCP App session for one of a ToolSource Connection's tools that declares a `ui://` resource (and that the Connection exposes): the resource as the server sent it (the client renders it, in its own sandbox), the tools the view may call, and the session the view's calls name.",
|
|
207
|
+
input: Schema.Struct({ connectionId: Schema.String, tool: Schema.String }),
|
|
208
|
+
output: Schema.Struct({
|
|
209
|
+
session: McpAppSession,
|
|
210
|
+
resource: ResourceContent,
|
|
211
|
+
tools: Schema.Array(RemoteTool),
|
|
212
|
+
}),
|
|
213
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
214
|
+
}),
|
|
215
|
+
appCall: defineOperation({
|
|
216
|
+
description: "Action `connections.appCall`: a tool call from an open MCP App session of the caller's, through the same path as `connections.callTool` (the Connection's grant and exposed tools checked on each call; an agent's call needs the person's consent). Refused, sending nothing, for a tool the session may not call, a session that is closed, expired or someone else's, and a Connection the caller may no longer use.",
|
|
217
|
+
input: Schema.Struct({
|
|
218
|
+
sessionId: Schema.String.check(Schema.isMaxLength(100)),
|
|
219
|
+
name: Schema.String,
|
|
220
|
+
arguments: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)),
|
|
221
|
+
}),
|
|
222
|
+
output: ToolResult,
|
|
223
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
224
|
+
}),
|
|
225
|
+
closeApp: defineOperation({
|
|
226
|
+
description: "Action `connections.closeApp`: close one of the caller's MCP App sessions; its calls are refused from then on.",
|
|
227
|
+
input: BySession,
|
|
228
|
+
output: BySession,
|
|
229
|
+
errors: ConnectionsError,
|
|
230
|
+
}),
|
|
231
|
+
apiCatalog: defineOperation({
|
|
232
|
+
description: "Action `connections.apiCatalog`: the operations of an HttpApi Connection's OpenAPI document.",
|
|
233
|
+
input: ById,
|
|
234
|
+
output: Schema.Struct({
|
|
235
|
+
title: Schema.NullOr(Schema.String),
|
|
236
|
+
operations: Schema.Array(ApiOperation),
|
|
237
|
+
truncated: Schema.Boolean,
|
|
238
|
+
}),
|
|
239
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
240
|
+
}),
|
|
241
|
+
apiDescribe: defineOperation({
|
|
242
|
+
description: "Action `connections.apiDescribe`: one operation of an HttpApi Connection's OpenAPI document.",
|
|
243
|
+
input: Schema.Struct({ connectionId: Schema.String, operationId: Schema.String }),
|
|
244
|
+
output: Schema.Struct({
|
|
245
|
+
operation: ApiOperation,
|
|
246
|
+
description: Schema.NullOr(Schema.String),
|
|
247
|
+
parameters: Schema.Array(Schema.Unknown),
|
|
248
|
+
requestBody: Schema.NullOr(Schema.Unknown),
|
|
249
|
+
}),
|
|
250
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
251
|
+
}),
|
|
252
|
+
apiRead: defineOperation({
|
|
253
|
+
description: "Action `connections.apiRead`: a request that only reads over an HttpApi Connection (GET, HEAD, or a POST its options name as reading), bounded, with optional pagination.",
|
|
254
|
+
input: Schema.Struct({
|
|
255
|
+
connectionId: Schema.String,
|
|
256
|
+
method: Schema.Literals(["GET", "HEAD", "POST"]),
|
|
257
|
+
path: Schema.String,
|
|
258
|
+
query: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
259
|
+
headers: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
260
|
+
json: Schema.optionalKey(Schema.Unknown),
|
|
261
|
+
maxPages: Schema.optionalKey(Schema.Int),
|
|
262
|
+
}),
|
|
263
|
+
output: Schema.Struct({ pages: Schema.Array(ApiResponse) }),
|
|
264
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
265
|
+
}),
|
|
266
|
+
apiWrite: defineOperation({
|
|
267
|
+
description: "Action `connections.apiWrite`: a request that may change something over an HttpApi Connection. An agent's call needs the person's consent for each call.",
|
|
268
|
+
input: Schema.Struct({
|
|
269
|
+
connectionId: Schema.String,
|
|
270
|
+
method: Schema.Literals(["POST", "PUT", "PATCH", "DELETE"]),
|
|
271
|
+
path: Schema.String,
|
|
272
|
+
query: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
273
|
+
headers: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)),
|
|
274
|
+
json: Schema.optionalKey(Schema.Unknown),
|
|
275
|
+
}),
|
|
276
|
+
output: ApiResponse,
|
|
277
|
+
errors: Schema.Union([ConnectionsError, CapabilityError]),
|
|
278
|
+
}),
|
|
279
|
+
authorize: defineOperation({
|
|
280
|
+
description: "GET /connections/authorize?flow=<id>, in the person's signed-in browser: binds a fresh state and PKCE verifier (S256) to their session and redirects to the provider's authorization endpoint.",
|
|
281
|
+
input: Schema.Struct({ flow: Schema.String }),
|
|
282
|
+
output: Schema.Struct({ location: Schema.String }),
|
|
283
|
+
errors: ConnectionsError,
|
|
284
|
+
}),
|
|
285
|
+
callback: defineOperation({
|
|
286
|
+
description: "GET /connections/callback?code=&state= (the registered redirect URI): the state must be unused, unexpired and bound to the same session; the code is exchanged with the verifier; the account is identified; the Connection is created or upgraded in one transaction and its tokens stored in Secrets. Redirects to `returnTo` with `connection=<id>`.",
|
|
287
|
+
input: Schema.Struct({
|
|
288
|
+
code: Schema.optionalKey(Schema.String),
|
|
289
|
+
state: Schema.String,
|
|
290
|
+
error: Schema.optionalKey(Schema.String),
|
|
291
|
+
}),
|
|
292
|
+
output: Schema.Struct({ connectionId: Schema.String }),
|
|
293
|
+
errors: ConnectionsError,
|
|
294
|
+
}),
|
|
295
|
+
request: defineOperation({
|
|
296
|
+
description: "In process, for connectors: an HTTP request over a Connection. The kernel checks the owner's membership and the Connection's status, applies its backpressure (Metering), attaches a fresh access token (refreshing proactively), and maps the provider's answer: a 401 refreshes once and retries, a 403 reports missing scopes, 429 and 503 honour Retry-After.",
|
|
297
|
+
input: Schema.Struct({ connectionId: Schema.String, request: ProviderRequest }),
|
|
298
|
+
output: Schema.Struct({
|
|
299
|
+
status: Schema.Int,
|
|
300
|
+
headers: Schema.Record(Schema.String, Schema.String),
|
|
301
|
+
body: Schema.String,
|
|
302
|
+
}),
|
|
303
|
+
errors: CapabilityError,
|
|
304
|
+
}),
|
|
305
|
+
refresh: defineOperation({
|
|
306
|
+
description: "In process: refresh a Connection's access token now (single-flight across processes). Used by `request`; exposed for tests and operators.",
|
|
307
|
+
input: Schema.Struct({ connectionId: Schema.String }),
|
|
308
|
+
output: Schema.Struct({ refreshed: Schema.Boolean, expiresAt: Schema.NullOr(Schema.String) }),
|
|
309
|
+
errors: CapabilityError,
|
|
310
|
+
}),
|
|
311
|
+
},
|
|
312
|
+
types: {
|
|
313
|
+
Connection,
|
|
314
|
+
ConnectionStatus,
|
|
315
|
+
ConsentStart,
|
|
316
|
+
ProviderRequest,
|
|
317
|
+
EndpointAuth,
|
|
318
|
+
ConnectionGrantee,
|
|
319
|
+
ConnectionGrant,
|
|
320
|
+
McpAppSession,
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
//# sourceMappingURL=Connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connections.js","sourceRoot":"","sources":["../../src/contracts/Connections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEzE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAA;AAG3F,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,MAAM,CAAC,MAAM;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC,MAAM;IACvB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC,MAAM;IACxB,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC,MAAM;IAC3B,mFAAmF;IACnF,MAAM,E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M,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACpD,IAAI,EAAE,MAAM,CAAC,MAAM;aACpB,CAAC;YACF,MAAM,EAAE,eAAe;SACxB,CAAC;QACF,OAAO,EAAE,eAAe,CAAC;YACvB,WAAW,EACT,2IAA2I;YAC7I,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;YACrD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7F,MAAM,EAAE,eAAe;SACxB,CAAC;KACH;IACD,KAAK,EAAE;QACL,UAAU;QACV,gBAAgB;QAChB,YAAY;QACZ,eAAe;QACf,YAAY;QACZ,iBAAiB;QACjB,eAAe;QACf,aAAa;KACd;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContextAccounting: an inventory of everything a model call is sent (instructions, skills, memory, messages,
|
|
3
|
+
* tool results and tool definitions) with token counts per item, budgets per category, eviction and pinning.
|
|
4
|
+
* The inventory (the "context x-ray") adds up to exactly what the model is sent. See
|
|
5
|
+
* docs/contracts/context-accounting.md.
|
|
6
|
+
*/
|
|
7
|
+
import { Schema } from "effect";
|
|
8
|
+
import { UnknownRun } from "../Agent.ts";
|
|
9
|
+
import { Forbidden, Unauthenticated } from "../Errors.ts";
|
|
10
|
+
export declare const ContextAccountingContract: import("../Service.ts").ServiceContract<"ContextAccounting", {
|
|
11
|
+
readonly inventory: import("../Service.ts").OperationContract<Schema.Struct<{
|
|
12
|
+
readonly runId: Schema.String;
|
|
13
|
+
readonly step: Schema.optionalKey<Schema.Number>;
|
|
14
|
+
}>, Schema.Struct<{
|
|
15
|
+
readonly runId: Schema.String;
|
|
16
|
+
readonly step: Schema.Number;
|
|
17
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
18
|
+
readonly ref: Schema.String;
|
|
19
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
20
|
+
readonly tokens: Schema.Number;
|
|
21
|
+
readonly pinned: Schema.Boolean;
|
|
22
|
+
readonly source: Schema.Unknown;
|
|
23
|
+
}>>;
|
|
24
|
+
readonly totals: Schema.$Record<Schema.String, Schema.Number>;
|
|
25
|
+
readonly budgets: Schema.$Record<Schema.String, Schema.Number>;
|
|
26
|
+
readonly total: Schema.Number;
|
|
27
|
+
readonly evicted: Schema.$Array<Schema.Struct<{
|
|
28
|
+
readonly ref: Schema.String;
|
|
29
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
30
|
+
readonly tokens: Schema.Number;
|
|
31
|
+
readonly reason: Schema.Literals<readonly ["budget", "directive"]>;
|
|
32
|
+
}>>;
|
|
33
|
+
}>, Schema.Union<readonly [typeof Unauthenticated, typeof UnknownRun]>>;
|
|
34
|
+
readonly direct: import("../Service.ts").OperationContract<Schema.Struct<{
|
|
35
|
+
readonly conversationId: Schema.String;
|
|
36
|
+
readonly ref: Schema.String;
|
|
37
|
+
readonly directive: Schema.Literals<readonly ["pin", "evict", "restore"]>;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
readonly ref: Schema.String;
|
|
40
|
+
readonly directive: Schema.Literals<readonly ["pin", "evict", "restore"]>;
|
|
41
|
+
}>, Schema.Union<readonly [typeof Unauthenticated, typeof Forbidden]>>;
|
|
42
|
+
}, {
|
|
43
|
+
readonly ContextCategory: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
44
|
+
readonly ContextItem: Schema.Struct<{
|
|
45
|
+
readonly ref: Schema.String;
|
|
46
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
47
|
+
readonly tokens: Schema.Number;
|
|
48
|
+
readonly pinned: Schema.Boolean;
|
|
49
|
+
readonly source: Schema.Unknown;
|
|
50
|
+
}>;
|
|
51
|
+
readonly EvictedItem: Schema.Struct<{
|
|
52
|
+
readonly ref: Schema.String;
|
|
53
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
54
|
+
readonly tokens: Schema.Number;
|
|
55
|
+
readonly reason: Schema.Literals<readonly ["budget", "directive"]>;
|
|
56
|
+
}>;
|
|
57
|
+
readonly ContextInventory: Schema.Struct<{
|
|
58
|
+
readonly runId: Schema.String;
|
|
59
|
+
readonly step: Schema.Number;
|
|
60
|
+
readonly items: Schema.$Array<Schema.Struct<{
|
|
61
|
+
readonly ref: Schema.String;
|
|
62
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
63
|
+
readonly tokens: Schema.Number;
|
|
64
|
+
readonly pinned: Schema.Boolean;
|
|
65
|
+
readonly source: Schema.Unknown;
|
|
66
|
+
}>>;
|
|
67
|
+
readonly totals: Schema.$Record<Schema.String, Schema.Number>;
|
|
68
|
+
readonly budgets: Schema.$Record<Schema.String, Schema.Number>;
|
|
69
|
+
readonly total: Schema.Number;
|
|
70
|
+
readonly evicted: Schema.$Array<Schema.Struct<{
|
|
71
|
+
readonly ref: Schema.String;
|
|
72
|
+
readonly category: Schema.Literals<readonly ["instructions", "skills", "memory", "messages", "tool-results", "tools"]>;
|
|
73
|
+
readonly tokens: Schema.Number;
|
|
74
|
+
readonly reason: Schema.Literals<readonly ["budget", "directive"]>;
|
|
75
|
+
}>>;
|
|
76
|
+
}>;
|
|
77
|
+
readonly ContextDirective: Schema.Literals<readonly ["pin", "evict", "restore"]>;
|
|
78
|
+
}>;
|
|
79
|
+
//# sourceMappingURL=ContextAccounting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextAccounting.d.ts","sourceRoot":"","sources":["../../src/contracts/ContextAccounting.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAiF,UAAU,EAAE,MAAM,aAAa,CAAA;AACvH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGzD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBpC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContextAccounting: an inventory of everything a model call is sent (instructions, skills, memory, messages,
|
|
3
|
+
* tool results and tool definitions) with token counts per item, budgets per category, eviction and pinning.
|
|
4
|
+
* The inventory (the "context x-ray") adds up to exactly what the model is sent. See
|
|
5
|
+
* docs/contracts/context-accounting.md.
|
|
6
|
+
*/
|
|
7
|
+
import { Schema } from "effect";
|
|
8
|
+
import { ContextCategory, ContextDirective, ContextInventory, ContextItem, EvictedItem, UnknownRun } from "../Agent.js";
|
|
9
|
+
import { Forbidden, Unauthenticated } from "../Errors.js";
|
|
10
|
+
import { defineOperation, defineServiceContract } from "../Service.js";
|
|
11
|
+
export const ContextAccountingContract = defineServiceContract({
|
|
12
|
+
name: "ContextAccounting",
|
|
13
|
+
kind: "kernel",
|
|
14
|
+
version: "1.0.0",
|
|
15
|
+
description: "The context x-ray: per model call, every item sent with its category, token count, pin state and source, totals against per-category budgets, and the items left out (over budget or evicted). Pinned items are kept whatever the budget; evicted items are left out until restored.",
|
|
16
|
+
operations: {
|
|
17
|
+
inventory: defineOperation({
|
|
18
|
+
description: "The inventory of one model call of a run (the latest when `step` is omitted), for the run's owner. Its `total` is the sum of its items' tokens, and equals what was sent.",
|
|
19
|
+
input: Schema.Struct({ runId: Schema.String, step: Schema.optionalKey(Schema.Number) }),
|
|
20
|
+
output: ContextInventory,
|
|
21
|
+
errors: Schema.Union([Unauthenticated, UnknownRun]),
|
|
22
|
+
}),
|
|
23
|
+
direct: defineOperation({
|
|
24
|
+
description: "Pin, evict or restore one item (`ref`) of a conversation's context (action `agent.directContext`): it applies from the next model call.",
|
|
25
|
+
input: Schema.Struct({ conversationId: Schema.String, ref: Schema.String, directive: ContextDirective }),
|
|
26
|
+
output: Schema.Struct({ ref: Schema.String, directive: ContextDirective }),
|
|
27
|
+
errors: Schema.Union([Unauthenticated, Forbidden]),
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
types: { ContextCategory, ContextItem, EvictedItem, ContextInventory, ContextDirective },
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=ContextAccounting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextAccounting.js","sourceRoot":"","sources":["../../src/contracts/ContextAccounting.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACvH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;IAC7D,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,OAAO;IAChB,WAAW,EACT,sRAAsR;IACxR,UAAU,EAAE;QACV,SAAS,EAAE,eAAe,CAAC;YACzB,WAAW,EACT,2KAA2K;YAC7K,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,E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