@eloxiv/contracts 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Agent.d.ts +792 -0
- package/dist/Agent.d.ts.map +1 -0
- package/dist/Agent.js +610 -0
- package/dist/Agent.js.map +1 -0
- package/dist/Analytics.d.ts +46 -0
- package/dist/Analytics.d.ts.map +1 -0
- package/dist/Analytics.js +89 -0
- package/dist/Analytics.js.map +1 -0
- package/dist/Approval.d.ts +70 -0
- package/dist/Approval.d.ts.map +1 -0
- package/dist/Approval.js +127 -0
- package/dist/Approval.js.map +1 -0
- package/dist/Catalog.d.ts +238 -0
- package/dist/Catalog.d.ts.map +1 -0
- package/dist/Catalog.js +169 -0
- package/dist/Catalog.js.map +1 -0
- package/dist/Checklist.d.ts +99 -0
- package/dist/Checklist.d.ts.map +1 -0
- package/dist/Checklist.js +105 -0
- package/dist/Checklist.js.map +1 -0
- package/dist/Data.d.ts +107 -0
- package/dist/Data.d.ts.map +1 -0
- package/dist/Data.js +93 -0
- package/dist/Data.js.map +1 -0
- package/dist/Devices.d.ts +857 -0
- package/dist/Devices.d.ts.map +1 -0
- package/dist/Devices.js +590 -0
- package/dist/Devices.js.map +1 -0
- package/dist/Durable.d.ts +406 -0
- package/dist/Durable.d.ts.map +1 -0
- package/dist/Durable.js +203 -0
- package/dist/Durable.js.map +1 -0
- package/dist/Errors.d.ts +95 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +72 -0
- package/dist/Errors.js.map +1 -0
- package/dist/JsonSchema.d.ts +355 -0
- package/dist/JsonSchema.d.ts.map +1 -0
- package/dist/JsonSchema.js +151 -0
- package/dist/JsonSchema.js.map +1 -0
- package/dist/Manifest.d.ts +353 -0
- package/dist/Manifest.d.ts.map +1 -0
- package/dist/Manifest.js +894 -0
- package/dist/Manifest.js.map +1 -0
- package/dist/Module.d.ts +447 -0
- package/dist/Module.d.ts.map +1 -0
- package/dist/Module.js +221 -0
- package/dist/Module.js.map +1 -0
- package/dist/Optimistic.d.ts +192 -0
- package/dist/Optimistic.d.ts.map +1 -0
- package/dist/Optimistic.js +319 -0
- package/dist/Optimistic.js.map +1 -0
- package/dist/Projection.d.ts +163 -0
- package/dist/Projection.d.ts.map +1 -0
- package/dist/Projection.js +158 -0
- package/dist/Projection.js.map +1 -0
- package/dist/Proposals.d.ts +103 -0
- package/dist/Proposals.d.ts.map +1 -0
- package/dist/Proposals.js +72 -0
- package/dist/Proposals.js.map +1 -0
- package/dist/Receipt.d.ts +243 -0
- package/dist/Receipt.d.ts.map +1 -0
- package/dist/Receipt.js +108 -0
- package/dist/Receipt.js.map +1 -0
- package/dist/Records.d.ts +297 -0
- package/dist/Records.d.ts.map +1 -0
- package/dist/Records.js +171 -0
- package/dist/Records.js.map +1 -0
- package/dist/Render.d.ts +207 -0
- package/dist/Render.d.ts.map +1 -0
- package/dist/Render.js +502 -0
- package/dist/Render.js.map +1 -0
- package/dist/Rpc.d.ts +115 -0
- package/dist/Rpc.d.ts.map +1 -0
- package/dist/Rpc.js +68 -0
- package/dist/Rpc.js.map +1 -0
- package/dist/SearchLanguages.d.ts +4 -0
- package/dist/SearchLanguages.d.ts.map +1 -0
- package/dist/SearchLanguages.js +33 -0
- package/dist/SearchLanguages.js.map +1 -0
- package/dist/Service.d.ts +59 -0
- package/dist/Service.d.ts.map +1 -0
- package/dist/Service.js +38 -0
- package/dist/Service.js.map +1 -0
- package/dist/Versions.d.ts +9 -0
- package/dist/Versions.d.ts.map +1 -0
- package/dist/Versions.js +78 -0
- package/dist/Versions.js.map +1 -0
- package/dist/contracts/ActionConsent.d.ts +189 -0
- package/dist/contracts/ActionConsent.d.ts.map +1 -0
- package/dist/contracts/ActionConsent.js +129 -0
- package/dist/contracts/ActionConsent.js.map +1 -0
- package/dist/contracts/ActionRegistry.d.ts +149 -0
- package/dist/contracts/ActionRegistry.d.ts.map +1 -0
- package/dist/contracts/ActionRegistry.js +37 -0
- package/dist/contracts/ActionRegistry.js.map +1 -0
- package/dist/contracts/Actor.d.ts +129 -0
- package/dist/contracts/Actor.d.ts.map +1 -0
- package/dist/contracts/Actor.js +47 -0
- package/dist/contracts/Actor.js.map +1 -0
- package/dist/contracts/AgentResources.d.ts +248 -0
- package/dist/contracts/AgentResources.d.ts.map +1 -0
- package/dist/contracts/AgentResources.js +158 -0
- package/dist/contracts/AgentResources.js.map +1 -0
- package/dist/contracts/AgentRuntime.d.ts +453 -0
- package/dist/contracts/AgentRuntime.d.ts.map +1 -0
- package/dist/contracts/AgentRuntime.js +117 -0
- package/dist/contracts/AgentRuntime.js.map +1 -0
- package/dist/contracts/Approvals.d.ts +303 -0
- package/dist/contracts/Approvals.d.ts.map +1 -0
- package/dist/contracts/Approvals.js +117 -0
- package/dist/contracts/Approvals.js.map +1 -0
- package/dist/contracts/Audit.d.ts +510 -0
- package/dist/contracts/Audit.d.ts.map +1 -0
- package/dist/contracts/Audit.js +139 -0
- package/dist/contracts/Audit.js.map +1 -0
- package/dist/contracts/CalendarProvider.d.ts +572 -0
- package/dist/contracts/CalendarProvider.d.ts.map +1 -0
- package/dist/contracts/CalendarProvider.js +203 -0
- package/dist/contracts/CalendarProvider.js.map +1 -0
- package/dist/contracts/Capability.d.ts +197 -0
- package/dist/contracts/Capability.d.ts.map +1 -0
- package/dist/contracts/Capability.js +189 -0
- package/dist/contracts/Capability.js.map +1 -0
- package/dist/contracts/ClientSDK.d.ts +250 -0
- package/dist/contracts/ClientSDK.d.ts.map +1 -0
- package/dist/contracts/ClientSDK.js +184 -0
- package/dist/contracts/ClientSDK.js.map +1 -0
- package/dist/contracts/CollabDocument.d.ts +781 -0
- package/dist/contracts/CollabDocument.d.ts.map +1 -0
- package/dist/contracts/CollabDocument.js +364 -0
- package/dist/contracts/CollabDocument.js.map +1 -0
- package/dist/contracts/Command.d.ts +183 -0
- package/dist/contracts/Command.d.ts.map +1 -0
- package/dist/contracts/Command.js +66 -0
- package/dist/contracts/Command.js.map +1 -0
- package/dist/contracts/Connections.d.ts +612 -0
- package/dist/contracts/Connections.d.ts.map +1 -0
- package/dist/contracts/Connections.js +323 -0
- package/dist/contracts/Connections.js.map +1 -0
- package/dist/contracts/ContextAccounting.d.ts +79 -0
- package/dist/contracts/ContextAccounting.d.ts.map +1 -0
- package/dist/contracts/ContextAccounting.js +32 -0
- package/dist/contracts/ContextAccounting.js.map +1 -0
- package/dist/contracts/Daemon.d.ts +486 -0
- package/dist/contracts/Daemon.d.ts.map +1 -0
- package/dist/contracts/Daemon.js +192 -0
- package/dist/contracts/Daemon.js.map +1 -0
- package/dist/contracts/DbTx.d.ts +149 -0
- package/dist/contracts/DbTx.d.ts.map +1 -0
- package/dist/contracts/DbTx.js +94 -0
- package/dist/contracts/DbTx.js.map +1 -0
- package/dist/contracts/Delegation.d.ts +121 -0
- package/dist/contracts/Delegation.d.ts.map +1 -0
- package/dist/contracts/Delegation.js +76 -0
- package/dist/contracts/Delegation.js.map +1 -0
- package/dist/contracts/DeviceControl.d.ts +293 -0
- package/dist/contracts/DeviceControl.d.ts.map +1 -0
- package/dist/contracts/DeviceControl.js +107 -0
- package/dist/contracts/DeviceControl.js.map +1 -0
- package/dist/contracts/Directory.d.ts +492 -0
- package/dist/contracts/Directory.d.ts.map +1 -0
- package/dist/contracts/Directory.js +225 -0
- package/dist/contracts/Directory.js.map +1 -0
- package/dist/contracts/DirectoryProvider.d.ts +214 -0
- package/dist/contracts/DirectoryProvider.d.ts.map +1 -0
- package/dist/contracts/DirectoryProvider.js +73 -0
- package/dist/contracts/DirectoryProvider.js.map +1 -0
- package/dist/contracts/DocumentSource.d.ts +190 -0
- package/dist/contracts/DocumentSource.d.ts.map +1 -0
- package/dist/contracts/DocumentSource.js +64 -0
- package/dist/contracts/DocumentSource.js.map +1 -0
- package/dist/contracts/Files.d.ts +762 -0
- package/dist/contracts/Files.d.ts.map +1 -0
- package/dist/contracts/Files.js +339 -0
- package/dist/contracts/Files.js.map +1 -0
- package/dist/contracts/Flags.d.ts +265 -0
- package/dist/contracts/Flags.d.ts.map +1 -0
- package/dist/contracts/Flags.js +197 -0
- package/dist/contracts/Flags.js.map +1 -0
- package/dist/contracts/Host.d.ts +320 -0
- package/dist/contracts/Host.d.ts.map +1 -0
- package/dist/contracts/Host.js +224 -0
- package/dist/contracts/Host.js.map +1 -0
- package/dist/contracts/HttpApi.d.ts +102 -0
- package/dist/contracts/HttpApi.d.ts.map +1 -0
- package/dist/contracts/HttpApi.js +89 -0
- package/dist/contracts/HttpApi.js.map +1 -0
- package/dist/contracts/Ingestion.d.ts +522 -0
- package/dist/contracts/Ingestion.d.ts.map +1 -0
- package/dist/contracts/Ingestion.js +275 -0
- package/dist/contracts/Ingestion.js.map +1 -0
- package/dist/contracts/Ingress.d.ts +132 -0
- package/dist/contracts/Ingress.d.ts.map +1 -0
- package/dist/contracts/Ingress.js +102 -0
- package/dist/contracts/Ingress.js.map +1 -0
- package/dist/contracts/Invocation.d.ts +361 -0
- package/dist/contracts/Invocation.d.ts.map +1 -0
- package/dist/contracts/Invocation.js +104 -0
- package/dist/contracts/Invocation.js.map +1 -0
- package/dist/contracts/LocalClient.d.ts +878 -0
- package/dist/contracts/LocalClient.d.ts.map +1 -0
- package/dist/contracts/LocalClient.js +423 -0
- package/dist/contracts/LocalClient.js.map +1 -0
- package/dist/contracts/Locale.d.ts +162 -0
- package/dist/contracts/Locale.d.ts.map +1 -0
- package/dist/contracts/Locale.js +123 -0
- package/dist/contracts/Locale.js.map +1 -0
- package/dist/contracts/MachineIdentity.d.ts +434 -0
- package/dist/contracts/MachineIdentity.d.ts.map +1 -0
- package/dist/contracts/MachineIdentity.js +223 -0
- package/dist/contracts/MachineIdentity.js.map +1 -0
- package/dist/contracts/MailProvider.d.ts +791 -0
- package/dist/contracts/MailProvider.d.ts.map +1 -0
- package/dist/contracts/MailProvider.js +237 -0
- package/dist/contracts/MailProvider.js.map +1 -0
- package/dist/contracts/Memory.d.ts +62 -0
- package/dist/contracts/Memory.d.ts.map +1 -0
- package/dist/contracts/Memory.js +43 -0
- package/dist/contracts/Memory.js.map +1 -0
- package/dist/contracts/Messaging.d.ts +154 -0
- package/dist/contracts/Messaging.d.ts.map +1 -0
- package/dist/contracts/Messaging.js +97 -0
- package/dist/contracts/Messaging.js.map +1 -0
- package/dist/contracts/Metering.d.ts +334 -0
- package/dist/contracts/Metering.d.ts.map +1 -0
- package/dist/contracts/Metering.js +202 -0
- package/dist/contracts/Metering.js.map +1 -0
- package/dist/contracts/ModelProvider.d.ts +142 -0
- package/dist/contracts/ModelProvider.d.ts.map +1 -0
- package/dist/contracts/ModelProvider.js +72 -0
- package/dist/contracts/ModelProvider.js.map +1 -0
- package/dist/contracts/ModuleManifest.d.ts +2519 -0
- package/dist/contracts/ModuleManifest.d.ts.map +1 -0
- package/dist/contracts/ModuleManifest.js +272 -0
- package/dist/contracts/ModuleManifest.js.map +1 -0
- package/dist/contracts/NotificationChannel.d.ts +378 -0
- package/dist/contracts/NotificationChannel.d.ts.map +1 -0
- package/dist/contracts/NotificationChannel.js +136 -0
- package/dist/contracts/NotificationChannel.js.map +1 -0
- package/dist/contracts/Notifications.d.ts +417 -0
- package/dist/contracts/Notifications.d.ts.map +1 -0
- package/dist/contracts/Notifications.js +267 -0
- package/dist/contracts/Notifications.js.map +1 -0
- package/dist/contracts/Outbox.d.ts +469 -0
- package/dist/contracts/Outbox.d.ts.map +1 -0
- package/dist/contracts/Outbox.js +215 -0
- package/dist/contracts/Outbox.js.map +1 -0
- package/dist/contracts/Privacy.d.ts +1029 -0
- package/dist/contracts/Privacy.d.ts.map +1 -0
- package/dist/contracts/Privacy.js +437 -0
- package/dist/contracts/Privacy.js.map +1 -0
- package/dist/contracts/Progress.d.ts +305 -0
- package/dist/contracts/Progress.d.ts.map +1 -0
- package/dist/contracts/Progress.js +174 -0
- package/dist/contracts/Progress.js.map +1 -0
- package/dist/contracts/QuerySurface.d.ts +231 -0
- package/dist/contracts/QuerySurface.d.ts.map +1 -0
- package/dist/contracts/QuerySurface.js +113 -0
- package/dist/contracts/QuerySurface.js.map +1 -0
- package/dist/contracts/Readiness.d.ts +105 -0
- package/dist/contracts/Readiness.d.ts.map +1 -0
- package/dist/contracts/Readiness.js +57 -0
- package/dist/contracts/Readiness.js.map +1 -0
- package/dist/contracts/Release.d.ts +295 -0
- package/dist/contracts/Release.d.ts.map +1 -0
- package/dist/contracts/Release.js +175 -0
- package/dist/contracts/Release.js.map +1 -0
- package/dist/contracts/ResultRendering.d.ts +533 -0
- package/dist/contracts/ResultRendering.d.ts.map +1 -0
- package/dist/contracts/ResultRendering.js +59 -0
- package/dist/contracts/ResultRendering.js.map +1 -0
- package/dist/contracts/Sandbox.d.ts +1164 -0
- package/dist/contracts/Sandbox.d.ts.map +1 -0
- package/dist/contracts/Sandbox.js +550 -0
- package/dist/contracts/Sandbox.js.map +1 -0
- package/dist/contracts/Scheduler.d.ts +814 -0
- package/dist/contracts/Scheduler.d.ts.map +1 -0
- package/dist/contracts/Scheduler.js +202 -0
- package/dist/contracts/Scheduler.js.map +1 -0
- package/dist/contracts/ScreenContext.d.ts +514 -0
- package/dist/contracts/ScreenContext.d.ts.map +1 -0
- package/dist/contracts/ScreenContext.js +272 -0
- package/dist/contracts/ScreenContext.js.map +1 -0
- package/dist/contracts/Search.d.ts +308 -0
- package/dist/contracts/Search.d.ts.map +1 -0
- package/dist/contracts/Search.js +107 -0
- package/dist/contracts/Search.js.map +1 -0
- package/dist/contracts/Secrets.d.ts +483 -0
- package/dist/contracts/Secrets.d.ts.map +1 -0
- package/dist/contracts/Secrets.js +136 -0
- package/dist/contracts/Secrets.js.map +1 -0
- package/dist/contracts/Settings.d.ts +221 -0
- package/dist/contracts/Settings.d.ts.map +1 -0
- package/dist/contracts/Settings.js +163 -0
- package/dist/contracts/Settings.js.map +1 -0
- package/dist/contracts/Sharing.d.ts +319 -0
- package/dist/contracts/Sharing.d.ts.map +1 -0
- package/dist/contracts/Sharing.js +172 -0
- package/dist/contracts/Sharing.js.map +1 -0
- package/dist/contracts/Slot.d.ts +162 -0
- package/dist/contracts/Slot.d.ts.map +1 -0
- package/dist/contracts/Slot.js +56 -0
- package/dist/contracts/Slot.js.map +1 -0
- package/dist/contracts/Space.d.ts +256 -0
- package/dist/contracts/Space.d.ts.map +1 -0
- package/dist/contracts/Space.js +133 -0
- package/dist/contracts/Space.js.map +1 -0
- package/dist/contracts/StorageAdapter.d.ts +124 -0
- package/dist/contracts/StorageAdapter.d.ts.map +1 -0
- package/dist/contracts/StorageAdapter.js +96 -0
- package/dist/contracts/StorageAdapter.js.map +1 -0
- package/dist/contracts/StorageBackend.d.ts +310 -0
- package/dist/contracts/StorageBackend.d.ts.map +1 -0
- package/dist/contracts/StorageBackend.js +196 -0
- package/dist/contracts/StorageBackend.js.map +1 -0
- package/dist/contracts/Sync.d.ts +286 -0
- package/dist/contracts/Sync.d.ts.map +1 -0
- package/dist/contracts/Sync.js +157 -0
- package/dist/contracts/Sync.js.map +1 -0
- package/dist/contracts/Telemetry.d.ts +183 -0
- package/dist/contracts/Telemetry.d.ts.map +1 -0
- package/dist/contracts/Telemetry.js +153 -0
- package/dist/contracts/Telemetry.js.map +1 -0
- package/dist/contracts/ThemeTokens.d.ts +212 -0
- package/dist/contracts/ThemeTokens.d.ts.map +1 -0
- package/dist/contracts/ThemeTokens.js +111 -0
- package/dist/contracts/ThemeTokens.js.map +1 -0
- package/dist/contracts/ToolSource.d.ts +135 -0
- package/dist/contracts/ToolSource.d.ts.map +1 -0
- package/dist/contracts/ToolSource.js +81 -0
- package/dist/contracts/ToolSource.js.map +1 -0
- package/dist/contracts/Versioning.d.ts +363 -0
- package/dist/contracts/Versioning.d.ts.map +1 -0
- package/dist/contracts/Versioning.js +201 -0
- package/dist/contracts/Versioning.js.map +1 -0
- package/dist/contracts/View.d.ts +232 -0
- package/dist/contracts/View.d.ts.map +1 -0
- package/dist/contracts/View.js +102 -0
- package/dist/contracts/View.js.map +1 -0
- package/dist/contracts/WorkItems.d.ts +242 -0
- package/dist/contracts/WorkItems.d.ts.map +1 -0
- package/dist/contracts/WorkItems.js +126 -0
- package/dist/contracts/WorkItems.js.map +1 -0
- package/dist/contracts/Workflow.d.ts +191 -0
- package/dist/contracts/Workflow.d.ts.map +1 -0
- package/dist/contracts/Workflow.js +63 -0
- package/dist/contracts/Workflow.js.map +1 -0
- package/dist/contracts/index.d.ts +75 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +196 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/devices/module.d.ts +3777 -0
- package/dist/devices/module.d.ts.map +1 -0
- package/dist/devices/module.js +179 -0
- package/dist/devices/module.js.map +1 -0
- package/dist/drizzle/Entity.d.ts +148 -0
- package/dist/drizzle/Entity.d.ts.map +1 -0
- package/dist/drizzle/Entity.js +396 -0
- package/dist/drizzle/Entity.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
- package/schema/Actor.json +46 -0
- package/schema/AuditRecord.json +403 -0
- package/schema/DaemonHealth.json +29 -0
- package/schema/InvocationError.json +257 -0
- package/schema/InvocationReceipt.json +253 -0
- package/schema/Lockfile.json +129 -0
- package/schema/OutboxEvent.json +36 -0
- package/schema/PairingConfirm.json +33 -0
- package/schema/PairingResult.json +18 -0
- package/schema/PairingStart.json +18 -0
- package/schema/ProvenanceEntry.json +110 -0
- package/schema/ReplayEnvelope.json +269 -0
- package/schema/Surface.json +17 -0
- package/schema/codegen/LocalClient.json +1295 -0
- package/schema/codegen/Sandbox.json +320 -0
- package/schema/contracts/ActionConsent.json +1930 -0
- package/schema/contracts/ActionRegistry.json +722 -0
- package/schema/contracts/Actor.json +451 -0
- package/schema/contracts/AgentResources.json +1400 -0
- package/schema/contracts/AgentRuntime.json +4017 -0
- package/schema/contracts/Approvals.json +2916 -0
- package/schema/contracts/Audit.json +3268 -0
- package/schema/contracts/CalendarProvider.json +5557 -0
- package/schema/contracts/ClientSDK.json +1400 -0
- package/schema/contracts/CollabDocument.json +4012 -0
- package/schema/contracts/Command.json +616 -0
- package/schema/contracts/Connections.json +6687 -0
- package/schema/contracts/ContextAccounting.json +685 -0
- package/schema/contracts/Daemon.json +4555 -0
- package/schema/contracts/DbTx.json +321 -0
- package/schema/contracts/Delegation.json +949 -0
- package/schema/contracts/DeviceControl.json +2626 -0
- package/schema/contracts/Directory.json +5168 -0
- package/schema/contracts/DirectoryProvider.json +2090 -0
- package/schema/contracts/DocumentSource.json +2044 -0
- package/schema/contracts/Files.json +4122 -0
- package/schema/contracts/Flags.json +1202 -0
- package/schema/contracts/Host.json +1769 -0
- package/schema/contracts/HttpApi.json +1615 -0
- package/schema/contracts/Ingestion.json +3211 -0
- package/schema/contracts/Ingress.json +819 -0
- package/schema/contracts/Invocation.json +2044 -0
- package/schema/contracts/LocalClient.json +6642 -0
- package/schema/contracts/Locale.json +654 -0
- package/schema/contracts/MachineIdentity.json +2303 -0
- package/schema/contracts/MailProvider.json +6663 -0
- package/schema/contracts/Memory.json +579 -0
- package/schema/contracts/Messaging.json +1764 -0
- package/schema/contracts/Metering.json +3060 -0
- package/schema/contracts/ModelProvider.json +1127 -0
- package/schema/contracts/ModuleManifest.json +9449 -0
- package/schema/contracts/NotificationChannel.json +986 -0
- package/schema/contracts/Notifications.json +4280 -0
- package/schema/contracts/Outbox.json +1451 -0
- package/schema/contracts/Privacy.json +4354 -0
- package/schema/contracts/Progress.json +1524 -0
- package/schema/contracts/QuerySurface.json +661 -0
- package/schema/contracts/Readiness.json +209 -0
- package/schema/contracts/Release.json +805 -0
- package/schema/contracts/ResultRendering.json +2859 -0
- package/schema/contracts/Sandbox.json +2286 -0
- package/schema/contracts/Scheduler.json +6138 -0
- package/schema/contracts/ScreenContext.json +1238 -0
- package/schema/contracts/Search.json +1058 -0
- package/schema/contracts/Secrets.json +2444 -0
- package/schema/contracts/Settings.json +654 -0
- package/schema/contracts/Sharing.json +2854 -0
- package/schema/contracts/Slot.json +537 -0
- package/schema/contracts/Space.json +892 -0
- package/schema/contracts/StorageAdapter.json +623 -0
- package/schema/contracts/StorageBackend.json +2421 -0
- package/schema/contracts/Sync.json +894 -0
- package/schema/contracts/Telemetry.json +696 -0
- package/schema/contracts/ThemeTokens.json +547 -0
- package/schema/contracts/ToolSource.json +1333 -0
- package/schema/contracts/Versioning.json +1481 -0
- package/schema/contracts/View.json +750 -0
- package/schema/contracts/WorkItems.json +1731 -0
- package/schema/contracts/Workflow.json +1242 -0
- package/src/Agent.ts +758 -0
- package/src/Analytics.ts +110 -0
- package/src/Approval.ts +131 -0
- package/src/Catalog.ts +192 -0
- package/src/Checklist.ts +162 -0
- package/src/Data.ts +109 -0
- package/src/Devices.ts +721 -0
- package/src/Durable.ts +240 -0
- package/src/Errors.ts +111 -0
- package/src/JsonSchema.ts +166 -0
- package/src/Manifest.ts +1147 -0
- package/src/Module.ts +640 -0
- package/src/Optimistic.ts +332 -0
- package/src/Projection.ts +207 -0
- package/src/Proposals.ts +89 -0
- package/src/Receipt.ts +125 -0
- package/src/Records.ts +197 -0
- package/src/Render.ts +515 -0
- package/src/Rpc.ts +113 -0
- package/src/SearchLanguages.ts +33 -0
- package/src/Service.ts +102 -0
- package/src/Versions.ts +69 -0
- package/src/contracts/ActionConsent.ts +150 -0
- package/src/contracts/ActionRegistry.ts +39 -0
- package/src/contracts/Actor.ts +53 -0
- package/src/contracts/AgentResources.ts +167 -0
- package/src/contracts/AgentRuntime.ts +154 -0
- package/src/contracts/Approvals.ts +133 -0
- package/src/contracts/Audit.ts +160 -0
- package/src/contracts/CalendarProvider.ts +241 -0
- package/src/contracts/Capability.ts +246 -0
- package/src/contracts/ClientSDK.ts +199 -0
- package/src/contracts/CollabDocument.ts +420 -0
- package/src/contracts/Command.ts +74 -0
- package/src/contracts/Connections.ts +360 -0
- package/src/contracts/ContextAccounting.ts +35 -0
- package/src/contracts/Daemon.ts +247 -0
- package/src/contracts/DbTx.ts +110 -0
- package/src/contracts/Delegation.ts +91 -0
- package/src/contracts/DeviceControl.ts +143 -0
- package/src/contracts/Directory.ts +384 -0
- package/src/contracts/DirectoryProvider.ts +82 -0
- package/src/contracts/DocumentSource.ts +71 -0
- package/src/contracts/Files.ts +395 -0
- package/src/contracts/Flags.ts +241 -0
- package/src/contracts/Host.ts +245 -0
- package/src/contracts/HttpApi.ts +100 -0
- package/src/contracts/Ingestion.ts +315 -0
- package/src/contracts/Ingress.ts +132 -0
- package/src/contracts/Invocation.ts +122 -0
- package/src/contracts/LocalClient.ts +614 -0
- package/src/contracts/Locale.ts +133 -0
- package/src/contracts/MachineIdentity.ts +305 -0
- package/src/contracts/MailProvider.ts +272 -0
- package/src/contracts/Memory.ts +47 -0
- package/src/contracts/Messaging.ts +108 -0
- package/src/contracts/Metering.ts +231 -0
- package/src/contracts/ModelProvider.ts +87 -0
- package/src/contracts/ModuleManifest.ts +310 -0
- package/src/contracts/NotificationChannel.ts +158 -0
- package/src/contracts/Notifications.ts +309 -0
- package/src/contracts/Outbox.ts +246 -0
- package/src/contracts/Privacy.ts +502 -0
- package/src/contracts/Progress.ts +196 -0
- package/src/contracts/QuerySurface.ts +134 -0
- package/src/contracts/Readiness.ts +67 -0
- package/src/contracts/Release.ts +199 -0
- package/src/contracts/ResultRendering.ts +65 -0
- package/src/contracts/Sandbox.ts +648 -0
- package/src/contracts/Scheduler.ts +237 -0
- package/src/contracts/ScreenContext.ts +316 -0
- package/src/contracts/Search.ts +126 -0
- package/src/contracts/Secrets.ts +162 -0
- package/src/contracts/Settings.ts +207 -0
- package/src/contracts/Sharing.ts +205 -0
- package/src/contracts/Slot.ts +61 -0
- package/src/contracts/Space.ts +157 -0
- package/src/contracts/StorageAdapter.ts +104 -0
- package/src/contracts/StorageBackend.ts +220 -0
- package/src/contracts/Sync.ts +180 -0
- package/src/contracts/Telemetry.ts +177 -0
- package/src/contracts/ThemeTokens.ts +136 -0
- package/src/contracts/ToolSource.ts +94 -0
- package/src/contracts/Versioning.ts +237 -0
- package/src/contracts/View.ts +116 -0
- package/src/contracts/WorkItems.ts +144 -0
- package/src/contracts/Workflow.ts +67 -0
- package/src/contracts/index.ts +205 -0
- package/src/devices/module.ts +201 -0
- package/src/drizzle/Entity.ts +524 -0
- package/src/index.ts +19 -0
|
@@ -0,0 +1,1164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox: running untrusted code (MAKE modules' handlers, subscribers and views) with no ambient authority, under
|
|
3
|
+
* memory, stack, time, step and output limits. The only things such code can do are the host functions the
|
|
4
|
+
* caller grants it, each of which the caller checks against the code's capability profile.
|
|
5
|
+
*
|
|
6
|
+
* Also the MAKE module source (the language-neutral manifest of a module made by a person or the agent, with its
|
|
7
|
+
* capability profile, migrations, code and optional view) and the view runtime's message protocol: a MAKE view
|
|
8
|
+
* renders only in a sandboxed iframe, and talks to its shell host only through these messages.
|
|
9
|
+
*
|
|
10
|
+
* Documented in docs/contracts/sandbox.md; conformance kit `@eloxiv/testing/conformance/Sandbox`.
|
|
11
|
+
*/
|
|
12
|
+
import { Schema } from "effect";
|
|
13
|
+
import { Forbidden, InvalidInput, Unauthenticated } from "../Errors.ts";
|
|
14
|
+
/**
|
|
15
|
+
* What one run may use. Each is a ceiling the run is stopped at, never a target. `steps` counts the
|
|
16
|
+
* interpreter's interrupt checks (QuickJS polls its interrupt handler every few thousand bytecode operations), so
|
|
17
|
+
* it bounds computation independently of wall time; `timeMs` bounds the whole run, host calls included.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SandboxLimits: Schema.Struct<{
|
|
20
|
+
/** Wall-clock time for the whole run, host calls included (ms). */
|
|
21
|
+
readonly timeMs: Schema.Int;
|
|
22
|
+
/** The interpreter's heap (bytes). */
|
|
23
|
+
readonly memoryBytes: Schema.Int;
|
|
24
|
+
/** The interpreter's stack (bytes). */
|
|
25
|
+
readonly stackBytes: Schema.Int;
|
|
26
|
+
/** Interrupt checks (about one per few thousand bytecode operations). */
|
|
27
|
+
readonly steps: Schema.Int;
|
|
28
|
+
/** Host function calls. */
|
|
29
|
+
readonly hostCalls: Schema.Int;
|
|
30
|
+
/** The JSON of the result, and of each host call's arguments (bytes). */
|
|
31
|
+
readonly outputBytes: Schema.Int;
|
|
32
|
+
}>;
|
|
33
|
+
export type SandboxLimits = typeof SandboxLimits.Type;
|
|
34
|
+
/** The defaults, and the ceilings no capability profile may raise a limit above. */
|
|
35
|
+
export declare const SANDBOX_DEFAULT_LIMITS: SandboxLimits;
|
|
36
|
+
export declare const SANDBOX_MAX_LIMITS: SandboxLimits;
|
|
37
|
+
/** What a run used. */
|
|
38
|
+
export declare const SandboxUsage: Schema.Struct<{
|
|
39
|
+
readonly wallMs: Schema.Number;
|
|
40
|
+
readonly steps: Schema.Int;
|
|
41
|
+
readonly hostCalls: Schema.Int;
|
|
42
|
+
}>;
|
|
43
|
+
export type SandboxUsage = typeof SandboxUsage.Type;
|
|
44
|
+
export declare const SandboxRun: Schema.Struct<{
|
|
45
|
+
/** An ES module. It can import nothing; its exports are what the run may call. */
|
|
46
|
+
readonly code: Schema.String;
|
|
47
|
+
/** The function to call: an export, or a dotted path into one (`actions.add`). */
|
|
48
|
+
readonly entry: Schema.String;
|
|
49
|
+
/** Its arguments, as JSON. Host functions are reached through the global `eloxiv` object, never an argument. */
|
|
50
|
+
readonly args: Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
51
|
+
/** The host functions the code may call (`eloxiv.<name>(...)`); the caller implements and checks each. */
|
|
52
|
+
readonly capabilities: Schema.$Array<Schema.String>;
|
|
53
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
54
|
+
/** Wall-clock time for the whole run, host calls included (ms). */
|
|
55
|
+
readonly timeMs: Schema.Int;
|
|
56
|
+
/** The interpreter's heap (bytes). */
|
|
57
|
+
readonly memoryBytes: Schema.Int;
|
|
58
|
+
/** The interpreter's stack (bytes). */
|
|
59
|
+
readonly stackBytes: Schema.Int;
|
|
60
|
+
/** Interrupt checks (about one per few thousand bytecode operations). */
|
|
61
|
+
readonly steps: Schema.Int;
|
|
62
|
+
/** Host function calls. */
|
|
63
|
+
readonly hostCalls: Schema.Int;
|
|
64
|
+
/** The JSON of the result, and of each host call's arguments (bytes). */
|
|
65
|
+
readonly outputBytes: Schema.Int;
|
|
66
|
+
}>>;
|
|
67
|
+
}>;
|
|
68
|
+
export type SandboxRun = typeof SandboxRun.Type;
|
|
69
|
+
export declare const SandboxResult: Schema.Struct<{
|
|
70
|
+
/** What the entry returned (or resolved to), as JSON; `null` for `undefined`. */
|
|
71
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
72
|
+
readonly usage: Schema.Struct<{
|
|
73
|
+
readonly wallMs: Schema.Number;
|
|
74
|
+
readonly steps: Schema.Int;
|
|
75
|
+
readonly hostCalls: Schema.Int;
|
|
76
|
+
}>;
|
|
77
|
+
}>;
|
|
78
|
+
export type SandboxResult = typeof SandboxResult.Type;
|
|
79
|
+
declare const SandboxLimitExceeded_base: Schema.Class<SandboxLimitExceeded, Schema.TaggedStruct<"SandboxLimitExceeded", {
|
|
80
|
+
readonly limit: Schema.Literals<readonly ["time", "memory", "stack", "steps", "hostCalls", "output"]>;
|
|
81
|
+
readonly message: Schema.String;
|
|
82
|
+
}>, import("effect/Cause").YieldableError>;
|
|
83
|
+
/** The run was stopped at a limit; nothing it was doing continued. */
|
|
84
|
+
export declare class SandboxLimitExceeded extends SandboxLimitExceeded_base {
|
|
85
|
+
}
|
|
86
|
+
declare const SandboxCodeFailed_base: Schema.Class<SandboxCodeFailed, Schema.TaggedStruct<"SandboxCodeFailed", {
|
|
87
|
+
readonly message: Schema.String;
|
|
88
|
+
}>, import("effect/Cause").YieldableError>;
|
|
89
|
+
/** The code did not compile, threw, rejected, has no such entry, or never settled. */
|
|
90
|
+
export declare class SandboxCodeFailed extends SandboxCodeFailed_base {
|
|
91
|
+
}
|
|
92
|
+
declare const SandboxCapabilityRefused_base: Schema.Class<SandboxCapabilityRefused, Schema.TaggedStruct<"SandboxCapabilityRefused", {
|
|
93
|
+
readonly capability: Schema.String;
|
|
94
|
+
readonly message: Schema.String;
|
|
95
|
+
}>, import("effect/Cause").YieldableError>;
|
|
96
|
+
/**
|
|
97
|
+
* The code asked for something its capability profile does not grant (a host function it was not given, a table,
|
|
98
|
+
* an event, an action or a setting outside its profile, or a statement the SQL host refuses). The run fails even
|
|
99
|
+
* if the code caught the refusal: nothing outside the profile ever runs, and the attempt is reported.
|
|
100
|
+
*/
|
|
101
|
+
export declare class SandboxCapabilityRefused extends SandboxCapabilityRefused_base {
|
|
102
|
+
}
|
|
103
|
+
declare const SandboxBusy_base: Schema.Class<SandboxBusy, Schema.TaggedStruct<"SandboxBusy", {
|
|
104
|
+
readonly message: Schema.String;
|
|
105
|
+
}>, import("effect/Cause").YieldableError>;
|
|
106
|
+
/**
|
|
107
|
+
* Every interpreter was busy for as long as the run could wait (or, for a run that may not wait, at once): nothing
|
|
108
|
+
* ran. Try again later.
|
|
109
|
+
*/
|
|
110
|
+
export declare class SandboxBusy extends SandboxBusy_base {
|
|
111
|
+
}
|
|
112
|
+
export declare const SandboxError: Schema.Union<readonly [typeof SandboxLimitExceeded, typeof SandboxCodeFailed, typeof SandboxCapabilityRefused, typeof SandboxBusy]>;
|
|
113
|
+
export type SandboxError = typeof SandboxError.Type;
|
|
114
|
+
export declare const SandboxCheck: Schema.Struct<{
|
|
115
|
+
readonly code: Schema.String;
|
|
116
|
+
}>;
|
|
117
|
+
export declare const SandboxCheckResult: Schema.Struct<{
|
|
118
|
+
/** The module's exports: its own names and, for exported objects, their function members (`actions.add`). */
|
|
119
|
+
readonly exports: Schema.$Array<Schema.String>;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Everything a MAKE module's code may do, declared in its manifest. The kernel refuses at install a module whose
|
|
123
|
+
* code, migrations or manifest reach beyond it, and at run time every host call outside it.
|
|
124
|
+
*/
|
|
125
|
+
export declare const CapabilityProfile: Schema.Struct<{
|
|
126
|
+
readonly sql: Schema.Struct<{
|
|
127
|
+
/** The module's own entities its statements may read. */
|
|
128
|
+
readonly read: Schema.$Array<Schema.String>;
|
|
129
|
+
/** The module's own entities its statements may insert, update or delete (each also readable). */
|
|
130
|
+
readonly write: Schema.$Array<Schema.String>;
|
|
131
|
+
}>;
|
|
132
|
+
/** The module's own event types its code may emit (none when left out, as for `call`, `settings` and `view`). */
|
|
133
|
+
readonly emit: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
134
|
+
/** Actions of other modules its code may call through the invocation path, as the caller. */
|
|
135
|
+
readonly call: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
136
|
+
/** Settings its code may read (keyed reads, for the caller). */
|
|
137
|
+
readonly settings: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
138
|
+
/** The module's own actions its view may ask the shell to call. */
|
|
139
|
+
readonly view: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
140
|
+
/**
|
|
141
|
+
* Other modules' events its subscribers may handle (app or MAKE modules of its organisation, never a kernel
|
|
142
|
+
* module's): each is delivered with its payload, so the approver sees what the module will read. Its own events
|
|
143
|
+
* need no listing.
|
|
144
|
+
*/
|
|
145
|
+
readonly subscribe: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
146
|
+
/** Limits below the kernel's ceilings (`SANDBOX_MAX_LIMITS`); unset ones take the defaults. */
|
|
147
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
148
|
+
readonly timeMs: Schema.optionalKey<Schema.Int>;
|
|
149
|
+
readonly memoryBytes: Schema.optionalKey<Schema.Int>;
|
|
150
|
+
readonly steps: Schema.optionalKey<Schema.Int>;
|
|
151
|
+
}>>;
|
|
152
|
+
}>;
|
|
153
|
+
export type CapabilityProfile = typeof CapabilityProfile.Type;
|
|
154
|
+
/** One entity of a MAKE manifest, in the JSON manifest form (`moduleToJson`). */
|
|
155
|
+
export declare const MakeEntity: Schema.Struct<{
|
|
156
|
+
readonly cedarType: Schema.String;
|
|
157
|
+
/** `<module schema>.<table>`: the module's schema is its name. */
|
|
158
|
+
readonly table: Schema.String;
|
|
159
|
+
readonly primaryKey: Schema.String;
|
|
160
|
+
/** Field (camelCase) to column. */
|
|
161
|
+
readonly columns: Schema.$Record<Schema.String, Schema.String>;
|
|
162
|
+
readonly policyAttributes: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
163
|
+
/** The row's JSON Schema (an object with a property per field). */
|
|
164
|
+
readonly row: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
165
|
+
/**
|
|
166
|
+
* Each field's column declaration, as the JSON manifest form publishes an entity's (`storage`): its Postgres
|
|
167
|
+
* type as the migrations declare it, whether it admits NULL, and its transport type. Optional: a field left out
|
|
168
|
+
* is `text`, `boolean`, `bigint` (an integer), `double precision` (a number) or `jsonb` (an object or array) by
|
|
169
|
+
* its row schema's type, nullable unless the row requires it. Setup holds the database to it, as it holds a
|
|
170
|
+
* built-in module to its Drizzle tables. A MAKE entity is never synced.
|
|
171
|
+
*/
|
|
172
|
+
readonly storage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
173
|
+
readonly column: Schema.String;
|
|
174
|
+
readonly type: Schema.NullOr<Schema.Literals<readonly ["string", "number", "boolean", "json"]>>;
|
|
175
|
+
readonly nullable: Schema.Boolean;
|
|
176
|
+
readonly sqlType: Schema.String;
|
|
177
|
+
readonly enum: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
178
|
+
}>>>;
|
|
179
|
+
}>;
|
|
180
|
+
export type MakeEntity = typeof MakeEntity.Type;
|
|
181
|
+
/** One action of a MAKE manifest, in the JSON manifest form. */
|
|
182
|
+
export declare const MakeAction: Schema.Struct<{
|
|
183
|
+
/**
|
|
184
|
+
* What people see the action called (ModuleManifest 1.6.0): one line, at most 80 characters (checked at draft);
|
|
185
|
+
* omitted: its readable name. The module's own, untrusted words: never what a person decides a held call on.
|
|
186
|
+
*/
|
|
187
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
188
|
+
readonly description: Schema.String;
|
|
189
|
+
readonly writes: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
190
|
+
readonly target: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
|
|
191
|
+
readonly entity: Schema.String;
|
|
192
|
+
readonly field: Schema.String;
|
|
193
|
+
}>>>;
|
|
194
|
+
readonly actsOn: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
195
|
+
readonly organisationWide: Schema.optionalKey<Schema.Boolean>;
|
|
196
|
+
readonly bestEffort: Schema.optionalKey<Schema.Boolean>;
|
|
197
|
+
readonly hints: Schema.optionalKey<Schema.Struct<{
|
|
198
|
+
readonly readOnly: Schema.optionalKey<Schema.Boolean>;
|
|
199
|
+
readonly destructive: Schema.optionalKey<Schema.Boolean>;
|
|
200
|
+
readonly idempotent: Schema.optionalKey<Schema.Boolean>;
|
|
201
|
+
}>>;
|
|
202
|
+
readonly consent: Schema.optionalKey<Schema.Boolean>;
|
|
203
|
+
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
204
|
+
readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
205
|
+
}>;
|
|
206
|
+
export type MakeAction = typeof MakeAction.Type;
|
|
207
|
+
/** The module manifest of a MAKE module: the same JSON form built-in modules publish, plus nothing else. */
|
|
208
|
+
/**
|
|
209
|
+
* A MAKE entity's entry in `dataSubjects`: a built-in module's (`{ fields, erase, export? }` or `{ none }`), with
|
|
210
|
+
* `notPersonal`: the fields that could hold an identifier (strings, JSON) but do not name a person. With the
|
|
211
|
+
* privacy module installed, every such field of a MAKE entity is classified, in `fields` or in `notPersonal`.
|
|
212
|
+
*/
|
|
213
|
+
export declare const MakeDataSubject: Schema.Union<readonly [Schema.Struct<{
|
|
214
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
215
|
+
readonly erase: Schema.Union<readonly [Schema.Struct<{
|
|
216
|
+
readonly kind: Schema.Literal<"delete">;
|
|
217
|
+
}>, Schema.Struct<{
|
|
218
|
+
readonly kind: Schema.Literal<"anonymise">;
|
|
219
|
+
readonly set: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>>;
|
|
220
|
+
}>, Schema.Struct<{
|
|
221
|
+
readonly kind: Schema.Literal<"retain">;
|
|
222
|
+
readonly reason: Schema.String;
|
|
223
|
+
}>]>;
|
|
224
|
+
readonly export: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
225
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
226
|
+
}>, Schema.Literal<false>]>>;
|
|
227
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
228
|
+
}>, Schema.Struct<{
|
|
229
|
+
readonly none: Schema.String;
|
|
230
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
231
|
+
}>]>;
|
|
232
|
+
export type MakeDataSubject = typeof MakeDataSubject.Type;
|
|
233
|
+
export declare const MakeManifest: Schema.Struct<{
|
|
234
|
+
/** `mk_<name>`: the module, its schema and its roles. Unique in the app. */
|
|
235
|
+
readonly name: Schema.String;
|
|
236
|
+
/** Semantic version; each installed version is greater than the one before. */
|
|
237
|
+
readonly version: Schema.String;
|
|
238
|
+
readonly cedarNamespace: Schema.String;
|
|
239
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
240
|
+
readonly entities: Schema.$Record<Schema.String, Schema.Struct<{
|
|
241
|
+
readonly cedarType: Schema.String;
|
|
242
|
+
/** `<module schema>.<table>`: the module's schema is its name. */
|
|
243
|
+
readonly table: Schema.String;
|
|
244
|
+
readonly primaryKey: Schema.String;
|
|
245
|
+
/** Field (camelCase) to column. */
|
|
246
|
+
readonly columns: Schema.$Record<Schema.String, Schema.String>;
|
|
247
|
+
readonly policyAttributes: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
248
|
+
/** The row's JSON Schema (an object with a property per field). */
|
|
249
|
+
readonly row: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
250
|
+
/**
|
|
251
|
+
* Each field's column declaration, as the JSON manifest form publishes an entity's (`storage`): its Postgres
|
|
252
|
+
* type as the migrations declare it, whether it admits NULL, and its transport type. Optional: a field left out
|
|
253
|
+
* is `text`, `boolean`, `bigint` (an integer), `double precision` (a number) or `jsonb` (an object or array) by
|
|
254
|
+
* its row schema's type, nullable unless the row requires it. Setup holds the database to it, as it holds a
|
|
255
|
+
* built-in module to its Drizzle tables. A MAKE entity is never synced.
|
|
256
|
+
*/
|
|
257
|
+
readonly storage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
258
|
+
readonly column: Schema.String;
|
|
259
|
+
readonly type: Schema.NullOr<Schema.Literals<readonly ["string", "number", "boolean", "json"]>>;
|
|
260
|
+
readonly nullable: Schema.Boolean;
|
|
261
|
+
readonly sqlType: Schema.String;
|
|
262
|
+
readonly enum: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
263
|
+
}>>>;
|
|
264
|
+
}>>;
|
|
265
|
+
/** By action name (`<module>.<action>`). */
|
|
266
|
+
readonly actions: Schema.$Record<Schema.String, Schema.Struct<{
|
|
267
|
+
/**
|
|
268
|
+
* What people see the action called (ModuleManifest 1.6.0): one line, at most 80 characters (checked at draft);
|
|
269
|
+
* omitted: its readable name. The module's own, untrusted words: never what a person decides a held call on.
|
|
270
|
+
*/
|
|
271
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
272
|
+
readonly description: Schema.String;
|
|
273
|
+
readonly writes: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
274
|
+
readonly target: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
|
|
275
|
+
readonly entity: Schema.String;
|
|
276
|
+
readonly field: Schema.String;
|
|
277
|
+
}>>>;
|
|
278
|
+
readonly actsOn: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
279
|
+
readonly organisationWide: Schema.optionalKey<Schema.Boolean>;
|
|
280
|
+
readonly bestEffort: Schema.optionalKey<Schema.Boolean>;
|
|
281
|
+
readonly hints: Schema.optionalKey<Schema.Struct<{
|
|
282
|
+
readonly readOnly: Schema.optionalKey<Schema.Boolean>;
|
|
283
|
+
readonly destructive: Schema.optionalKey<Schema.Boolean>;
|
|
284
|
+
readonly idempotent: Schema.optionalKey<Schema.Boolean>;
|
|
285
|
+
}>>;
|
|
286
|
+
readonly consent: Schema.optionalKey<Schema.Boolean>;
|
|
287
|
+
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
288
|
+
readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
289
|
+
}>>;
|
|
290
|
+
/** By event type (`<module>.<event>`); none when left out. */
|
|
291
|
+
readonly events: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
292
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
293
|
+
}>>, never>;
|
|
294
|
+
/**
|
|
295
|
+
* Which entities hold records about a person, by entity name, and what an erasure does to them (the Privacy
|
|
296
|
+
* contract), in the JSON manifest form: `{ fields, erase: { kind: "delete" } | { kind: "anonymise", set } |
|
|
297
|
+
* { kind: "retain", reason }, export? }`, or `{ none: reason }` for an entity about nobody. Checked as a built-in
|
|
298
|
+
* module's (and a field named for a person is in `fields` or `notPersonal`); with the privacy module installed
|
|
299
|
+
* every entity must be declared, and data-subject requests export and erase these records as the module's
|
|
300
|
+
* runtime role.
|
|
301
|
+
*/
|
|
302
|
+
readonly dataSubjects: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
303
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
304
|
+
readonly erase: Schema.Union<readonly [Schema.Struct<{
|
|
305
|
+
readonly kind: Schema.Literal<"delete">;
|
|
306
|
+
}>, Schema.Struct<{
|
|
307
|
+
readonly kind: Schema.Literal<"anonymise">;
|
|
308
|
+
readonly set: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>>;
|
|
309
|
+
}>, Schema.Struct<{
|
|
310
|
+
readonly kind: Schema.Literal<"retain">;
|
|
311
|
+
readonly reason: Schema.String;
|
|
312
|
+
}>]>;
|
|
313
|
+
readonly export: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
314
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
315
|
+
}>, Schema.Literal<false>]>>;
|
|
316
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
317
|
+
}>, Schema.Struct<{
|
|
318
|
+
readonly none: Schema.String;
|
|
319
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
320
|
+
}>]>>>;
|
|
321
|
+
}>;
|
|
322
|
+
export type MakeManifest = typeof MakeManifest.Type;
|
|
323
|
+
/** One migration: SQL statements separated by `--> statement-breakpoint`, run in order, recorded by name. */
|
|
324
|
+
export declare const MakeMigration: Schema.Struct<{
|
|
325
|
+
readonly name: Schema.String;
|
|
326
|
+
readonly sql: Schema.String;
|
|
327
|
+
}>;
|
|
328
|
+
export type MakeMigration = typeof MakeMigration.Type;
|
|
329
|
+
/**
|
|
330
|
+
* A subscriber: the module's code reacting to an event, through the outbox, exactly once per event (its writes and
|
|
331
|
+
* the record of its delivery commit together), retried under the default delivery policy, in the sandbox under the
|
|
332
|
+
* module's limits. It handles one of the module's own events, or another module's its profile lists in
|
|
333
|
+
* `capabilities.subscribe`, of its own organisation only. It acts as the system in the event's organisation (row-level
|
|
334
|
+
* security's subscriber branch), with `eloxiv.sql` only (its profile's tables): it emits nothing, calls nothing and
|
|
335
|
+
* reads no setting, so it starts no further work of its own.
|
|
336
|
+
*/
|
|
337
|
+
export declare const MakeSubscriber: Schema.Struct<{
|
|
338
|
+
/** Unique in the app: `<module>.<id>`. */
|
|
339
|
+
readonly id: Schema.String;
|
|
340
|
+
/** The event type it handles (any installed module's). */
|
|
341
|
+
readonly event: Schema.String;
|
|
342
|
+
/**
|
|
343
|
+
* The export that handles it (`subscribers.onGreeted`): called with the event's payload and
|
|
344
|
+
* `{ eventId, event, module, orgId, invocationId, attempt, origin: "system" }` (`attempt` counts its earlier failed
|
|
345
|
+
* attempts at this event).
|
|
346
|
+
*/
|
|
347
|
+
readonly entry: Schema.String;
|
|
348
|
+
}>;
|
|
349
|
+
export type MakeSubscriber = typeof MakeSubscriber.Type;
|
|
350
|
+
/** A slot of the app's (declared by an installed module, accepting views) the view is shown in, in order. */
|
|
351
|
+
export declare const MakeSlotContribution: Schema.Struct<{
|
|
352
|
+
readonly slot: Schema.String;
|
|
353
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
354
|
+
}>;
|
|
355
|
+
export type MakeSlotContribution = typeof MakeSlotContribution.Type;
|
|
356
|
+
/**
|
|
357
|
+
* A MAKE module's view: code, never markup. `code` is an ES module that runs in the sandbox (no DOM, no network, no
|
|
358
|
+
* host functions) and exports `render(state)`, which returns the view tree (`MakeViewNode`) the shell draws, and
|
|
359
|
+
* optionally `init()` and `update(state, message)` (`MakeViewMessage`), which return `{ state?, calls? }`: the view's
|
|
360
|
+
* next state, and the calls (`MakeViewCall`) of its module's own actions it asks the shell to make (only those
|
|
361
|
+
* `capabilities.view` lists are made). The shell draws the tree from a fixed set of elements in a frame where nothing
|
|
362
|
+
* runs and nothing loads (`MAKE_VIEW_SANDBOX`, `MAKE_VIEW_CSP`).
|
|
363
|
+
*/
|
|
364
|
+
export declare const MakeCodeView: Schema.Struct<{
|
|
365
|
+
readonly title: Schema.String;
|
|
366
|
+
/** The view's ES module (`export function render(state) { ... }`, with `init` and `update`). */
|
|
367
|
+
readonly code: Schema.String;
|
|
368
|
+
/**
|
|
369
|
+
* The app's view slots the view is contributed to (`slots` an installed module declares with `accepts: "view"`),
|
|
370
|
+
* each once: the shell shows it there for the organisation that installed it.
|
|
371
|
+
*/
|
|
372
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
373
|
+
readonly slot: Schema.String;
|
|
374
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
375
|
+
}>>>;
|
|
376
|
+
}>;
|
|
377
|
+
export type MakeCodeView = typeof MakeCodeView.Type;
|
|
378
|
+
/**
|
|
379
|
+
* A view written before views were code (an HTML document with inline script). Kept so the modules installed with
|
|
380
|
+
* one still load; it is no longer accepted in a draft, and it no longer renders (`make.view` answers no view for it).
|
|
381
|
+
*/
|
|
382
|
+
export declare const MakeHtmlView: Schema.Struct<{
|
|
383
|
+
readonly title: Schema.String;
|
|
384
|
+
readonly html: Schema.String;
|
|
385
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
386
|
+
readonly slot: Schema.String;
|
|
387
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
388
|
+
}>>>;
|
|
389
|
+
}>;
|
|
390
|
+
export type MakeHtmlView = typeof MakeHtmlView.Type;
|
|
391
|
+
export declare const MakeView: Schema.Union<readonly [Schema.Struct<{
|
|
392
|
+
readonly title: Schema.String;
|
|
393
|
+
/** The view's ES module (`export function render(state) { ... }`, with `init` and `update`). */
|
|
394
|
+
readonly code: Schema.String;
|
|
395
|
+
/**
|
|
396
|
+
* The app's view slots the view is contributed to (`slots` an installed module declares with `accepts: "view"`),
|
|
397
|
+
* each once: the shell shows it there for the organisation that installed it.
|
|
398
|
+
*/
|
|
399
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
400
|
+
readonly slot: Schema.String;
|
|
401
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
402
|
+
}>>>;
|
|
403
|
+
}>, Schema.Struct<{
|
|
404
|
+
readonly title: Schema.String;
|
|
405
|
+
readonly html: Schema.String;
|
|
406
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
407
|
+
readonly slot: Schema.String;
|
|
408
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
409
|
+
}>>>;
|
|
410
|
+
}>]>;
|
|
411
|
+
export type MakeView = typeof MakeView.Type;
|
|
412
|
+
/** Whether a view is code (the only kind that renders). */
|
|
413
|
+
export declare const isCodeView: (view: MakeView) => view is MakeCodeView;
|
|
414
|
+
/** Everything a draft holds: what the agent (or a person) writes, and what preview, approval and install act on. */
|
|
415
|
+
export declare const MakeModuleSource: Schema.Struct<{
|
|
416
|
+
readonly manifest: Schema.Struct<{
|
|
417
|
+
/** `mk_<name>`: the module, its schema and its roles. Unique in the app. */
|
|
418
|
+
readonly name: Schema.String;
|
|
419
|
+
/** Semantic version; each installed version is greater than the one before. */
|
|
420
|
+
readonly version: Schema.String;
|
|
421
|
+
readonly cedarNamespace: Schema.String;
|
|
422
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
423
|
+
readonly entities: Schema.$Record<Schema.String, Schema.Struct<{
|
|
424
|
+
readonly cedarType: Schema.String;
|
|
425
|
+
/** `<module schema>.<table>`: the module's schema is its name. */
|
|
426
|
+
readonly table: Schema.String;
|
|
427
|
+
readonly primaryKey: Schema.String;
|
|
428
|
+
/** Field (camelCase) to column. */
|
|
429
|
+
readonly columns: Schema.$Record<Schema.String, Schema.String>;
|
|
430
|
+
readonly policyAttributes: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
431
|
+
/** The row's JSON Schema (an object with a property per field). */
|
|
432
|
+
readonly row: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
433
|
+
/**
|
|
434
|
+
* Each field's column declaration, as the JSON manifest form publishes an entity's (`storage`): its Postgres
|
|
435
|
+
* type as the migrations declare it, whether it admits NULL, and its transport type. Optional: a field left out
|
|
436
|
+
* is `text`, `boolean`, `bigint` (an integer), `double precision` (a number) or `jsonb` (an object or array) by
|
|
437
|
+
* its row schema's type, nullable unless the row requires it. Setup holds the database to it, as it holds a
|
|
438
|
+
* built-in module to its Drizzle tables. A MAKE entity is never synced.
|
|
439
|
+
*/
|
|
440
|
+
readonly storage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
441
|
+
readonly column: Schema.String;
|
|
442
|
+
readonly type: Schema.NullOr<Schema.Literals<readonly ["string", "number", "boolean", "json"]>>;
|
|
443
|
+
readonly nullable: Schema.Boolean;
|
|
444
|
+
readonly sqlType: Schema.String;
|
|
445
|
+
readonly enum: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
446
|
+
}>>>;
|
|
447
|
+
}>>;
|
|
448
|
+
/** By action name (`<module>.<action>`). */
|
|
449
|
+
readonly actions: Schema.$Record<Schema.String, Schema.Struct<{
|
|
450
|
+
/**
|
|
451
|
+
* What people see the action called (ModuleManifest 1.6.0): one line, at most 80 characters (checked at draft);
|
|
452
|
+
* omitted: its readable name. The module's own, untrusted words: never what a person decides a held call on.
|
|
453
|
+
*/
|
|
454
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
455
|
+
readonly description: Schema.String;
|
|
456
|
+
readonly writes: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
457
|
+
readonly target: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
|
|
458
|
+
readonly entity: Schema.String;
|
|
459
|
+
readonly field: Schema.String;
|
|
460
|
+
}>>>;
|
|
461
|
+
readonly actsOn: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
462
|
+
readonly organisationWide: Schema.optionalKey<Schema.Boolean>;
|
|
463
|
+
readonly bestEffort: Schema.optionalKey<Schema.Boolean>;
|
|
464
|
+
readonly hints: Schema.optionalKey<Schema.Struct<{
|
|
465
|
+
readonly readOnly: Schema.optionalKey<Schema.Boolean>;
|
|
466
|
+
readonly destructive: Schema.optionalKey<Schema.Boolean>;
|
|
467
|
+
readonly idempotent: Schema.optionalKey<Schema.Boolean>;
|
|
468
|
+
}>>;
|
|
469
|
+
readonly consent: Schema.optionalKey<Schema.Boolean>;
|
|
470
|
+
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
471
|
+
readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
472
|
+
}>>;
|
|
473
|
+
/** By event type (`<module>.<event>`); none when left out. */
|
|
474
|
+
readonly events: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
475
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
476
|
+
}>>, never>;
|
|
477
|
+
/**
|
|
478
|
+
* Which entities hold records about a person, by entity name, and what an erasure does to them (the Privacy
|
|
479
|
+
* contract), in the JSON manifest form: `{ fields, erase: { kind: "delete" } | { kind: "anonymise", set } |
|
|
480
|
+
* { kind: "retain", reason }, export? }`, or `{ none: reason }` for an entity about nobody. Checked as a built-in
|
|
481
|
+
* module's (and a field named for a person is in `fields` or `notPersonal`); with the privacy module installed
|
|
482
|
+
* every entity must be declared, and data-subject requests export and erase these records as the module's
|
|
483
|
+
* runtime role.
|
|
484
|
+
*/
|
|
485
|
+
readonly dataSubjects: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
486
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
487
|
+
readonly erase: Schema.Union<readonly [Schema.Struct<{
|
|
488
|
+
readonly kind: Schema.Literal<"delete">;
|
|
489
|
+
}>, Schema.Struct<{
|
|
490
|
+
readonly kind: Schema.Literal<"anonymise">;
|
|
491
|
+
readonly set: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>>;
|
|
492
|
+
}>, Schema.Struct<{
|
|
493
|
+
readonly kind: Schema.Literal<"retain">;
|
|
494
|
+
readonly reason: Schema.String;
|
|
495
|
+
}>]>;
|
|
496
|
+
readonly export: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
497
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
498
|
+
}>, Schema.Literal<false>]>>;
|
|
499
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
500
|
+
}>, Schema.Struct<{
|
|
501
|
+
readonly none: Schema.String;
|
|
502
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
503
|
+
}>]>>>;
|
|
504
|
+
}>;
|
|
505
|
+
/** The module's Cedar policy (its own namespace only). */
|
|
506
|
+
readonly policy: Schema.String;
|
|
507
|
+
readonly capabilities: Schema.Struct<{
|
|
508
|
+
readonly sql: Schema.Struct<{
|
|
509
|
+
/** The module's own entities its statements may read. */
|
|
510
|
+
readonly read: Schema.$Array<Schema.String>;
|
|
511
|
+
/** The module's own entities its statements may insert, update or delete (each also readable). */
|
|
512
|
+
readonly write: Schema.$Array<Schema.String>;
|
|
513
|
+
}>;
|
|
514
|
+
/** The module's own event types its code may emit (none when left out, as for `call`, `settings` and `view`). */
|
|
515
|
+
readonly emit: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
516
|
+
/** Actions of other modules its code may call through the invocation path, as the caller. */
|
|
517
|
+
readonly call: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
518
|
+
/** Settings its code may read (keyed reads, for the caller). */
|
|
519
|
+
readonly settings: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
520
|
+
/** The module's own actions its view may ask the shell to call. */
|
|
521
|
+
readonly view: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
522
|
+
/**
|
|
523
|
+
* Other modules' events its subscribers may handle (app or MAKE modules of its organisation, never a kernel
|
|
524
|
+
* module's): each is delivered with its payload, so the approver sees what the module will read. Its own events
|
|
525
|
+
* need no listing.
|
|
526
|
+
*/
|
|
527
|
+
readonly subscribe: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
528
|
+
/** Limits below the kernel's ceilings (`SANDBOX_MAX_LIMITS`); unset ones take the defaults. */
|
|
529
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
530
|
+
readonly timeMs: Schema.optionalKey<Schema.Int>;
|
|
531
|
+
readonly memoryBytes: Schema.optionalKey<Schema.Int>;
|
|
532
|
+
readonly steps: Schema.optionalKey<Schema.Int>;
|
|
533
|
+
}>>;
|
|
534
|
+
}>;
|
|
535
|
+
/**
|
|
536
|
+
* The module's migrations, in order. Versions are additive: a version's list starts with the previous
|
|
537
|
+
* version's migrations, unchanged, and its own may only create tables and indexes and add columns that are
|
|
538
|
+
* nullable or have a default (so the previous version's code keeps working over the new schema).
|
|
539
|
+
*/
|
|
540
|
+
readonly migrations: Schema.$Array<Schema.Struct<{
|
|
541
|
+
readonly name: Schema.String;
|
|
542
|
+
readonly sql: Schema.String;
|
|
543
|
+
}>>;
|
|
544
|
+
/** The ES module with the handlers (`export const actions = { async add(input, eloxiv) {...} }`). */
|
|
545
|
+
readonly code: Schema.String;
|
|
546
|
+
readonly subscribers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
547
|
+
/** Unique in the app: `<module>.<id>`. */
|
|
548
|
+
readonly id: Schema.String;
|
|
549
|
+
/** The event type it handles (any installed module's). */
|
|
550
|
+
readonly event: Schema.String;
|
|
551
|
+
/**
|
|
552
|
+
* The export that handles it (`subscribers.onGreeted`): called with the event's payload and
|
|
553
|
+
* `{ eventId, event, module, orgId, invocationId, attempt, origin: "system" }` (`attempt` counts its earlier failed
|
|
554
|
+
* attempts at this event).
|
|
555
|
+
*/
|
|
556
|
+
readonly entry: Schema.String;
|
|
557
|
+
}>>>;
|
|
558
|
+
readonly view: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
559
|
+
readonly title: Schema.String;
|
|
560
|
+
/** The view's ES module (`export function render(state) { ... }`, with `init` and `update`). */
|
|
561
|
+
readonly code: Schema.String;
|
|
562
|
+
/**
|
|
563
|
+
* The app's view slots the view is contributed to (`slots` an installed module declares with `accepts: "view"`),
|
|
564
|
+
* each once: the shell shows it there for the organisation that installed it.
|
|
565
|
+
*/
|
|
566
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
567
|
+
readonly slot: Schema.String;
|
|
568
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
569
|
+
}>>>;
|
|
570
|
+
}>, Schema.Struct<{
|
|
571
|
+
readonly title: Schema.String;
|
|
572
|
+
readonly html: Schema.String;
|
|
573
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
574
|
+
readonly slot: Schema.String;
|
|
575
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
576
|
+
}>>>;
|
|
577
|
+
}>]>>;
|
|
578
|
+
/** Preview data: rows per entity (encoded, by field), inserted into the preview schema before its calls run. */
|
|
579
|
+
readonly sample: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>>;
|
|
580
|
+
}>;
|
|
581
|
+
export type MakeModuleSource = typeof MakeModuleSource.Type;
|
|
582
|
+
export declare const MAKE_MODULE_PREFIX = "mk_";
|
|
583
|
+
/** Where an installed MAKE module's actions are served over HTTP: `POST /make/actions/<module>.<action>`. */
|
|
584
|
+
export declare const MAKE_ACTIONS_PATH = "/make/actions";
|
|
585
|
+
/**
|
|
586
|
+
* The elements a view tree may use. The shell draws each as plain DOM in the view's frame: `button` and `link` as
|
|
587
|
+
* links to a fragment of the frame's own document that the host routes to the view's `update` (never a URL of the
|
|
588
|
+
* view's), `form` as a group of fields (nothing is ever submitted), `input`, `textarea` and `select` as fields whose
|
|
589
|
+
* values the host reads when something is activated. Anything else is not drawn.
|
|
590
|
+
*/
|
|
591
|
+
export declare const MAKE_VIEW_TAGS: readonly ["div", "span", "p", "h1", "h2", "h3", "h4", "ul", "ol", "li", "strong", "em", "small", "code", "pre", "br", "hr", "table", "thead", "tbody", "tr", "th", "td", "section", "header", "footer", "label", "form", "button", "link", "input", "textarea", "select", "option"];
|
|
592
|
+
export type MakeViewTag = (typeof MAKE_VIEW_TAGS)[number];
|
|
593
|
+
/** The properties an element may have; none names a URL. `style` is held to a small set of CSS properties. */
|
|
594
|
+
export declare const MAKE_VIEW_PROPS: readonly ["class", "title", "style", "placeholder", "value", "checked", "selected", "disabled", "name", "type", "min", "max", "step", "rows", "colspan", "rowspan", "ariaLabel"];
|
|
595
|
+
/** The input types a view may use (never `file`, `image`, `submit` or `reset`). */
|
|
596
|
+
export declare const MAKE_VIEW_INPUT_TYPES: readonly ["text", "number", "email", "date", "time", "datetime-local", "search", "tel", "checkbox", "radio", "range", "color", "hidden"];
|
|
597
|
+
/** The most nodes, and the deepest nesting, a view tree may have. */
|
|
598
|
+
export declare const MAKE_VIEW_MAX_NODES = 5000;
|
|
599
|
+
export declare const MAKE_VIEW_MAX_DEPTH = 64;
|
|
600
|
+
/**
|
|
601
|
+
* One node of a view tree: text (a string or a number), nothing (`null`, `false`: for conditional rendering), or
|
|
602
|
+
* an element: `{ tag, props?, children?, on?, data? }`. `on` names the view's event: activating a `button` or
|
|
603
|
+
* `link`, or changing a field, sends `update` `{ type: "event", name: on, data, value?, fields }`.
|
|
604
|
+
*/
|
|
605
|
+
export interface MakeViewElement {
|
|
606
|
+
readonly tag: MakeViewTag;
|
|
607
|
+
readonly props?: {
|
|
608
|
+
readonly [key: string]: string | number | boolean;
|
|
609
|
+
};
|
|
610
|
+
readonly children?: ReadonlyArray<MakeViewNode>;
|
|
611
|
+
readonly on?: string;
|
|
612
|
+
readonly data?: Schema.Json;
|
|
613
|
+
}
|
|
614
|
+
export type MakeViewNode = string | number | boolean | null | MakeViewElement;
|
|
615
|
+
/** A prop's value. Named (`identifier`) so a native generator gives the tree's types their own names. */
|
|
616
|
+
export declare const MakeViewPropValue: Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>;
|
|
617
|
+
/** Any of `MAKE_VIEW_PROPS`; decoded with excess properties refused (`MAKE_VIEW_DECODE`), so no other is accepted. */
|
|
618
|
+
export declare const MakeViewProps: Schema.Struct<{
|
|
619
|
+
readonly ariaLabel: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
620
|
+
readonly checked: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
621
|
+
readonly class: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
622
|
+
readonly colspan: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
623
|
+
readonly disabled: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
624
|
+
readonly max: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
625
|
+
readonly min: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
626
|
+
readonly name: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
627
|
+
readonly placeholder: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
628
|
+
readonly rows: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
629
|
+
readonly rowspan: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
630
|
+
readonly selected: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
631
|
+
readonly step: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
632
|
+
readonly style: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
633
|
+
readonly title: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
634
|
+
readonly type: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
635
|
+
readonly value: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
636
|
+
}>;
|
|
637
|
+
/** An element of a view tree: `{ tag, props?, children?, on?, data? }`. */
|
|
638
|
+
export declare const MakeViewElement: Schema.Codec<MakeViewElement>;
|
|
639
|
+
export declare const MakeViewNode: Schema.Codec<MakeViewNode>;
|
|
640
|
+
/** What a view tree holds: its node count and depth (held to `MAKE_VIEW_MAX_NODES` and `MAKE_VIEW_MAX_DEPTH`). */
|
|
641
|
+
export declare const viewTreeSize: (node: MakeViewNode) => {
|
|
642
|
+
readonly nodes: number;
|
|
643
|
+
readonly depth: number;
|
|
644
|
+
};
|
|
645
|
+
/** A call a view asks the shell to make: one of its module's own actions its capability profile lists. */
|
|
646
|
+
export declare const MakeViewCall: Schema.Struct<{
|
|
647
|
+
/** The view's own name for the call: its result comes back to `update` with it. */
|
|
648
|
+
readonly id: Schema.String;
|
|
649
|
+
readonly action: Schema.String;
|
|
650
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
651
|
+
/**
|
|
652
|
+
* The call's idempotency key (1 to 128 characters of `MAKE_VIEW_KEY`), the same on every retry of one request, so a
|
|
653
|
+
* retry after a lost answer is answered with the first call's result. The host namespaces it by its mount of the
|
|
654
|
+
* view. A call without one gets a key of the host's, new for each call.
|
|
655
|
+
*/
|
|
656
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
657
|
+
}>;
|
|
658
|
+
export type MakeViewCall = typeof MakeViewCall.Type;
|
|
659
|
+
/** What a view's `update` is told: an event of its tree, or a call's result (the action's envelope) or error. */
|
|
660
|
+
export declare const MakeViewMessage: Schema.Union<readonly [Schema.Struct<{
|
|
661
|
+
readonly type: Schema.Literal<"event">;
|
|
662
|
+
/** The element's `on`. */
|
|
663
|
+
readonly name: Schema.String;
|
|
664
|
+
/** The element's `data`. */
|
|
665
|
+
readonly data: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
666
|
+
/** A changed field's value (a string, or a boolean for a checkbox). */
|
|
667
|
+
readonly value: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Boolean]>>;
|
|
668
|
+
/** The values of the fields (by `name`) of the element's form, or of the whole view outside one. */
|
|
669
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Boolean]>>;
|
|
670
|
+
}>, Schema.Struct<{
|
|
671
|
+
readonly type: Schema.Literal<"result">;
|
|
672
|
+
readonly id: Schema.String;
|
|
673
|
+
readonly ok: Schema.Literal<true>;
|
|
674
|
+
readonly result: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
675
|
+
}>, Schema.Struct<{
|
|
676
|
+
readonly type: Schema.Literal<"result">;
|
|
677
|
+
readonly id: Schema.String;
|
|
678
|
+
readonly ok: Schema.Literal<false>;
|
|
679
|
+
readonly error: Schema.Struct<{
|
|
680
|
+
readonly _tag: Schema.String;
|
|
681
|
+
readonly message: Schema.String;
|
|
682
|
+
}>;
|
|
683
|
+
}>]>;
|
|
684
|
+
export type MakeViewMessage = typeof MakeViewMessage.Type;
|
|
685
|
+
/** How a view's answer is decoded: a property or key the contract does not name is refused, never dropped. */
|
|
686
|
+
export declare const MAKE_VIEW_DECODE: {
|
|
687
|
+
readonly onExcessProperty: "error";
|
|
688
|
+
};
|
|
689
|
+
/** One step of a view (`make.renderView`): its next state, the calls it asks for, and the tree to draw. */
|
|
690
|
+
export declare const MakeViewStep: Schema.Struct<{
|
|
691
|
+
readonly state: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
692
|
+
readonly calls: Schema.$Array<Schema.Struct<{
|
|
693
|
+
/** The view's own name for the call: its result comes back to `update` with it. */
|
|
694
|
+
readonly id: Schema.String;
|
|
695
|
+
readonly action: Schema.String;
|
|
696
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
697
|
+
/**
|
|
698
|
+
* The call's idempotency key (1 to 128 characters of `MAKE_VIEW_KEY`), the same on every retry of one request, so a
|
|
699
|
+
* retry after a lost answer is answered with the first call's result. The host namespaces it by its mount of the
|
|
700
|
+
* view. A call without one gets a key of the host's, new for each call.
|
|
701
|
+
*/
|
|
702
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
703
|
+
}>>;
|
|
704
|
+
readonly tree: Schema.Codec<MakeViewNode, MakeViewNode, never, never>;
|
|
705
|
+
}>;
|
|
706
|
+
export type MakeViewStep = typeof MakeViewStep.Type;
|
|
707
|
+
/**
|
|
708
|
+
* The Content Security Policy of the frame a view is drawn in (as a `<meta>` of its document and as the iframe's
|
|
709
|
+
* `csp` attribute): nothing runs and nothing loads. No script, no image, media, font, frame or object, no
|
|
710
|
+
* connection, no form submission, no base URL; inline style only (the shell's own sheet and `style` properties).
|
|
711
|
+
*/
|
|
712
|
+
export declare const MAKE_VIEW_CSP: string;
|
|
713
|
+
/**
|
|
714
|
+
* The frame's sandbox flags: no scripts, no forms, no popups, no navigation of the shell. `allow-same-origin` lets
|
|
715
|
+
* the host (never the frame, where no script runs) draw the tree into the frame's document and read its fields.
|
|
716
|
+
*/
|
|
717
|
+
export declare const MAKE_VIEW_SANDBOX = "allow-same-origin";
|
|
718
|
+
/** What a view's idempotency key may be: 1 to 128 URL-safe characters. */
|
|
719
|
+
export declare const MAKE_VIEW_KEY: RegExp;
|
|
720
|
+
/**
|
|
721
|
+
* The custom properties a view's `style` may name (`var(--primary)`): the app's theme (the ThemeTokens contract's
|
|
722
|
+
* colours, radius, spacing and fonts), which the shell sets on the frame's root; no other variable.
|
|
723
|
+
*/
|
|
724
|
+
export declare const MAKE_VIEW_THEME_VARIABLES: ReadonlyArray<string>;
|
|
725
|
+
export declare const SandboxContract: import("../Service.ts").ServiceContract<"Sandbox", {
|
|
726
|
+
readonly run: {
|
|
727
|
+
description: string;
|
|
728
|
+
input: Schema.Struct<{
|
|
729
|
+
/** An ES module. It can import nothing; its exports are what the run may call. */
|
|
730
|
+
readonly code: Schema.String;
|
|
731
|
+
/** The function to call: an export, or a dotted path into one (`actions.add`). */
|
|
732
|
+
readonly entry: Schema.String;
|
|
733
|
+
/** Its arguments, as JSON. Host functions are reached through the global `eloxiv` object, never an argument. */
|
|
734
|
+
readonly args: Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
735
|
+
/** The host functions the code may call (`eloxiv.<name>(...)`); the caller implements and checks each. */
|
|
736
|
+
readonly capabilities: Schema.$Array<Schema.String>;
|
|
737
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
738
|
+
/** Wall-clock time for the whole run, host calls included (ms). */
|
|
739
|
+
readonly timeMs: Schema.Int;
|
|
740
|
+
/** The interpreter's heap (bytes). */
|
|
741
|
+
readonly memoryBytes: Schema.Int;
|
|
742
|
+
/** The interpreter's stack (bytes). */
|
|
743
|
+
readonly stackBytes: Schema.Int;
|
|
744
|
+
/** Interrupt checks (about one per few thousand bytecode operations). */
|
|
745
|
+
readonly steps: Schema.Int;
|
|
746
|
+
/** Host function calls. */
|
|
747
|
+
readonly hostCalls: Schema.Int;
|
|
748
|
+
/** The JSON of the result, and of each host call's arguments (bytes). */
|
|
749
|
+
readonly outputBytes: Schema.Int;
|
|
750
|
+
}>>;
|
|
751
|
+
}>;
|
|
752
|
+
output: Schema.Struct<{
|
|
753
|
+
/** What the entry returned (or resolved to), as JSON; `null` for `undefined`. */
|
|
754
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
755
|
+
readonly usage: Schema.Struct<{
|
|
756
|
+
readonly wallMs: Schema.Number;
|
|
757
|
+
readonly steps: Schema.Int;
|
|
758
|
+
readonly hostCalls: Schema.Int;
|
|
759
|
+
}>;
|
|
760
|
+
}>;
|
|
761
|
+
errors: Schema.Union<readonly [typeof SandboxLimitExceeded, typeof SandboxCodeFailed, typeof SandboxCapabilityRefused, typeof SandboxBusy]>;
|
|
762
|
+
};
|
|
763
|
+
readonly check: {
|
|
764
|
+
readonly description: "Compile and evaluate an ES module (granting nothing) and list its exports, or report why it fails.";
|
|
765
|
+
readonly input: Schema.Struct<{
|
|
766
|
+
readonly code: Schema.String;
|
|
767
|
+
}>;
|
|
768
|
+
readonly output: Schema.Struct<{
|
|
769
|
+
/** The module's exports: its own names and, for exported objects, their function members (`actions.add`). */
|
|
770
|
+
readonly exports: Schema.$Array<Schema.String>;
|
|
771
|
+
}>;
|
|
772
|
+
readonly errors: Schema.Union<readonly [typeof SandboxLimitExceeded, typeof SandboxCodeFailed, typeof SandboxCapabilityRefused, typeof SandboxBusy]>;
|
|
773
|
+
};
|
|
774
|
+
readonly runProgram: {
|
|
775
|
+
description: string;
|
|
776
|
+
input: Schema.Struct<{
|
|
777
|
+
readonly code: Schema.String;
|
|
778
|
+
readonly entry: Schema.optionalKey<Schema.String>;
|
|
779
|
+
readonly input: Schema.optionalKey<Schema.Unknown>;
|
|
780
|
+
readonly actions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
781
|
+
readonly connections: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
782
|
+
readonly background: Schema.optionalKey<Schema.Boolean>;
|
|
783
|
+
}>;
|
|
784
|
+
output: Schema.Struct<{
|
|
785
|
+
readonly runId: Schema.String;
|
|
786
|
+
readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "lost"]>;
|
|
787
|
+
readonly value: Schema.Unknown;
|
|
788
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
789
|
+
readonly usage: Schema.NullOr<Schema.Struct<{
|
|
790
|
+
readonly wallMs: Schema.Number;
|
|
791
|
+
readonly steps: Schema.Number;
|
|
792
|
+
readonly hostCalls: Schema.Number;
|
|
793
|
+
}>>;
|
|
794
|
+
readonly startedAt: Schema.String;
|
|
795
|
+
readonly finishedAt: Schema.NullOr<Schema.String>;
|
|
796
|
+
}>;
|
|
797
|
+
errors: Schema.Union<readonly [typeof Unauthenticated, typeof Forbidden, typeof InvalidInput]>;
|
|
798
|
+
};
|
|
799
|
+
readonly programStatus: {
|
|
800
|
+
readonly description: "data.status: how one of the caller's read programs stands (running, succeeded, failed, lost).";
|
|
801
|
+
readonly input: Schema.Struct<{
|
|
802
|
+
readonly runId: Schema.String;
|
|
803
|
+
}>;
|
|
804
|
+
readonly output: Schema.Struct<{
|
|
805
|
+
readonly runId: Schema.String;
|
|
806
|
+
readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "lost"]>;
|
|
807
|
+
readonly value: Schema.Unknown;
|
|
808
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
809
|
+
readonly usage: Schema.NullOr<Schema.Struct<{
|
|
810
|
+
readonly wallMs: Schema.Number;
|
|
811
|
+
readonly steps: Schema.Number;
|
|
812
|
+
readonly hostCalls: Schema.Number;
|
|
813
|
+
}>>;
|
|
814
|
+
readonly startedAt: Schema.String;
|
|
815
|
+
readonly finishedAt: Schema.NullOr<Schema.String>;
|
|
816
|
+
}>;
|
|
817
|
+
readonly errors: Schema.Union<readonly [typeof Unauthenticated, typeof InvalidInput]>;
|
|
818
|
+
};
|
|
819
|
+
}, {
|
|
820
|
+
readonly SandboxLimits: Schema.Struct<{
|
|
821
|
+
/** Wall-clock time for the whole run, host calls included (ms). */
|
|
822
|
+
readonly timeMs: Schema.Int;
|
|
823
|
+
/** The interpreter's heap (bytes). */
|
|
824
|
+
readonly memoryBytes: Schema.Int;
|
|
825
|
+
/** The interpreter's stack (bytes). */
|
|
826
|
+
readonly stackBytes: Schema.Int;
|
|
827
|
+
/** Interrupt checks (about one per few thousand bytecode operations). */
|
|
828
|
+
readonly steps: Schema.Int;
|
|
829
|
+
/** Host function calls. */
|
|
830
|
+
readonly hostCalls: Schema.Int;
|
|
831
|
+
/** The JSON of the result, and of each host call's arguments (bytes). */
|
|
832
|
+
readonly outputBytes: Schema.Int;
|
|
833
|
+
}>;
|
|
834
|
+
readonly SandboxUsage: Schema.Struct<{
|
|
835
|
+
readonly wallMs: Schema.Number;
|
|
836
|
+
readonly steps: Schema.Int;
|
|
837
|
+
readonly hostCalls: Schema.Int;
|
|
838
|
+
}>;
|
|
839
|
+
readonly CapabilityProfile: Schema.Struct<{
|
|
840
|
+
readonly sql: Schema.Struct<{
|
|
841
|
+
/** The module's own entities its statements may read. */
|
|
842
|
+
readonly read: Schema.$Array<Schema.String>;
|
|
843
|
+
/** The module's own entities its statements may insert, update or delete (each also readable). */
|
|
844
|
+
readonly write: Schema.$Array<Schema.String>;
|
|
845
|
+
}>;
|
|
846
|
+
/** The module's own event types its code may emit (none when left out, as for `call`, `settings` and `view`). */
|
|
847
|
+
readonly emit: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
848
|
+
/** Actions of other modules its code may call through the invocation path, as the caller. */
|
|
849
|
+
readonly call: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
850
|
+
/** Settings its code may read (keyed reads, for the caller). */
|
|
851
|
+
readonly settings: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
852
|
+
/** The module's own actions its view may ask the shell to call. */
|
|
853
|
+
readonly view: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
854
|
+
/**
|
|
855
|
+
* Other modules' events its subscribers may handle (app or MAKE modules of its organisation, never a kernel
|
|
856
|
+
* module's): each is delivered with its payload, so the approver sees what the module will read. Its own events
|
|
857
|
+
* need no listing.
|
|
858
|
+
*/
|
|
859
|
+
readonly subscribe: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
860
|
+
/** Limits below the kernel's ceilings (`SANDBOX_MAX_LIMITS`); unset ones take the defaults. */
|
|
861
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
862
|
+
readonly timeMs: Schema.optionalKey<Schema.Int>;
|
|
863
|
+
readonly memoryBytes: Schema.optionalKey<Schema.Int>;
|
|
864
|
+
readonly steps: Schema.optionalKey<Schema.Int>;
|
|
865
|
+
}>>;
|
|
866
|
+
}>;
|
|
867
|
+
readonly MakeManifest: Schema.Struct<{
|
|
868
|
+
/** `mk_<name>`: the module, its schema and its roles. Unique in the app. */
|
|
869
|
+
readonly name: Schema.String;
|
|
870
|
+
/** Semantic version; each installed version is greater than the one before. */
|
|
871
|
+
readonly version: Schema.String;
|
|
872
|
+
readonly cedarNamespace: Schema.String;
|
|
873
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
874
|
+
readonly entities: Schema.$Record<Schema.String, Schema.Struct<{
|
|
875
|
+
readonly cedarType: Schema.String;
|
|
876
|
+
/** `<module schema>.<table>`: the module's schema is its name. */
|
|
877
|
+
readonly table: Schema.String;
|
|
878
|
+
readonly primaryKey: Schema.String;
|
|
879
|
+
/** Field (camelCase) to column. */
|
|
880
|
+
readonly columns: Schema.$Record<Schema.String, Schema.String>;
|
|
881
|
+
readonly policyAttributes: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
882
|
+
/** The row's JSON Schema (an object with a property per field). */
|
|
883
|
+
readonly row: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
884
|
+
/**
|
|
885
|
+
* Each field's column declaration, as the JSON manifest form publishes an entity's (`storage`): its Postgres
|
|
886
|
+
* type as the migrations declare it, whether it admits NULL, and its transport type. Optional: a field left out
|
|
887
|
+
* is `text`, `boolean`, `bigint` (an integer), `double precision` (a number) or `jsonb` (an object or array) by
|
|
888
|
+
* its row schema's type, nullable unless the row requires it. Setup holds the database to it, as it holds a
|
|
889
|
+
* built-in module to its Drizzle tables. A MAKE entity is never synced.
|
|
890
|
+
*/
|
|
891
|
+
readonly storage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
892
|
+
readonly column: Schema.String;
|
|
893
|
+
readonly type: Schema.NullOr<Schema.Literals<readonly ["string", "number", "boolean", "json"]>>;
|
|
894
|
+
readonly nullable: Schema.Boolean;
|
|
895
|
+
readonly sqlType: Schema.String;
|
|
896
|
+
readonly enum: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
897
|
+
}>>>;
|
|
898
|
+
}>>;
|
|
899
|
+
/** By action name (`<module>.<action>`). */
|
|
900
|
+
readonly actions: Schema.$Record<Schema.String, Schema.Struct<{
|
|
901
|
+
/**
|
|
902
|
+
* What people see the action called (ModuleManifest 1.6.0): one line, at most 80 characters (checked at draft);
|
|
903
|
+
* omitted: its readable name. The module's own, untrusted words: never what a person decides a held call on.
|
|
904
|
+
*/
|
|
905
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
906
|
+
readonly description: Schema.String;
|
|
907
|
+
readonly writes: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
908
|
+
readonly target: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
|
|
909
|
+
readonly entity: Schema.String;
|
|
910
|
+
readonly field: Schema.String;
|
|
911
|
+
}>>>;
|
|
912
|
+
readonly actsOn: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
913
|
+
readonly organisationWide: Schema.optionalKey<Schema.Boolean>;
|
|
914
|
+
readonly bestEffort: Schema.optionalKey<Schema.Boolean>;
|
|
915
|
+
readonly hints: Schema.optionalKey<Schema.Struct<{
|
|
916
|
+
readonly readOnly: Schema.optionalKey<Schema.Boolean>;
|
|
917
|
+
readonly destructive: Schema.optionalKey<Schema.Boolean>;
|
|
918
|
+
readonly idempotent: Schema.optionalKey<Schema.Boolean>;
|
|
919
|
+
}>>;
|
|
920
|
+
readonly consent: Schema.optionalKey<Schema.Boolean>;
|
|
921
|
+
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
922
|
+
readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
923
|
+
}>>;
|
|
924
|
+
/** By event type (`<module>.<event>`); none when left out. */
|
|
925
|
+
readonly events: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
926
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
927
|
+
}>>, never>;
|
|
928
|
+
/**
|
|
929
|
+
* Which entities hold records about a person, by entity name, and what an erasure does to them (the Privacy
|
|
930
|
+
* contract), in the JSON manifest form: `{ fields, erase: { kind: "delete" } | { kind: "anonymise", set } |
|
|
931
|
+
* { kind: "retain", reason }, export? }`, or `{ none: reason }` for an entity about nobody. Checked as a built-in
|
|
932
|
+
* module's (and a field named for a person is in `fields` or `notPersonal`); with the privacy module installed
|
|
933
|
+
* every entity must be declared, and data-subject requests export and erase these records as the module's
|
|
934
|
+
* runtime role.
|
|
935
|
+
*/
|
|
936
|
+
readonly dataSubjects: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
937
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
938
|
+
readonly erase: Schema.Union<readonly [Schema.Struct<{
|
|
939
|
+
readonly kind: Schema.Literal<"delete">;
|
|
940
|
+
}>, Schema.Struct<{
|
|
941
|
+
readonly kind: Schema.Literal<"anonymise">;
|
|
942
|
+
readonly set: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>>;
|
|
943
|
+
}>, Schema.Struct<{
|
|
944
|
+
readonly kind: Schema.Literal<"retain">;
|
|
945
|
+
readonly reason: Schema.String;
|
|
946
|
+
}>]>;
|
|
947
|
+
readonly export: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
948
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
949
|
+
}>, Schema.Literal<false>]>>;
|
|
950
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
951
|
+
}>, Schema.Struct<{
|
|
952
|
+
readonly none: Schema.String;
|
|
953
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
954
|
+
}>]>>>;
|
|
955
|
+
}>;
|
|
956
|
+
readonly MakeModuleSource: Schema.Struct<{
|
|
957
|
+
readonly manifest: Schema.Struct<{
|
|
958
|
+
/** `mk_<name>`: the module, its schema and its roles. Unique in the app. */
|
|
959
|
+
readonly name: Schema.String;
|
|
960
|
+
/** Semantic version; each installed version is greater than the one before. */
|
|
961
|
+
readonly version: Schema.String;
|
|
962
|
+
readonly cedarNamespace: Schema.String;
|
|
963
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
964
|
+
readonly entities: Schema.$Record<Schema.String, Schema.Struct<{
|
|
965
|
+
readonly cedarType: Schema.String;
|
|
966
|
+
/** `<module schema>.<table>`: the module's schema is its name. */
|
|
967
|
+
readonly table: Schema.String;
|
|
968
|
+
readonly primaryKey: Schema.String;
|
|
969
|
+
/** Field (camelCase) to column. */
|
|
970
|
+
readonly columns: Schema.$Record<Schema.String, Schema.String>;
|
|
971
|
+
readonly policyAttributes: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
972
|
+
/** The row's JSON Schema (an object with a property per field). */
|
|
973
|
+
readonly row: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
974
|
+
/**
|
|
975
|
+
* Each field's column declaration, as the JSON manifest form publishes an entity's (`storage`): its Postgres
|
|
976
|
+
* type as the migrations declare it, whether it admits NULL, and its transport type. Optional: a field left out
|
|
977
|
+
* is `text`, `boolean`, `bigint` (an integer), `double precision` (a number) or `jsonb` (an object or array) by
|
|
978
|
+
* its row schema's type, nullable unless the row requires it. Setup holds the database to it, as it holds a
|
|
979
|
+
* built-in module to its Drizzle tables. A MAKE entity is never synced.
|
|
980
|
+
*/
|
|
981
|
+
readonly storage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
982
|
+
readonly column: Schema.String;
|
|
983
|
+
readonly type: Schema.NullOr<Schema.Literals<readonly ["string", "number", "boolean", "json"]>>;
|
|
984
|
+
readonly nullable: Schema.Boolean;
|
|
985
|
+
readonly sqlType: Schema.String;
|
|
986
|
+
readonly enum: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
987
|
+
}>>>;
|
|
988
|
+
}>>;
|
|
989
|
+
/** By action name (`<module>.<action>`). */
|
|
990
|
+
readonly actions: Schema.$Record<Schema.String, Schema.Struct<{
|
|
991
|
+
/**
|
|
992
|
+
* What people see the action called (ModuleManifest 1.6.0): one line, at most 80 characters (checked at draft);
|
|
993
|
+
* omitted: its readable name. The module's own, untrusted words: never what a person decides a held call on.
|
|
994
|
+
*/
|
|
995
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
996
|
+
readonly description: Schema.String;
|
|
997
|
+
readonly writes: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
998
|
+
readonly target: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
|
|
999
|
+
readonly entity: Schema.String;
|
|
1000
|
+
readonly field: Schema.String;
|
|
1001
|
+
}>>>;
|
|
1002
|
+
readonly actsOn: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1003
|
+
readonly organisationWide: Schema.optionalKey<Schema.Boolean>;
|
|
1004
|
+
readonly bestEffort: Schema.optionalKey<Schema.Boolean>;
|
|
1005
|
+
readonly hints: Schema.optionalKey<Schema.Struct<{
|
|
1006
|
+
readonly readOnly: Schema.optionalKey<Schema.Boolean>;
|
|
1007
|
+
readonly destructive: Schema.optionalKey<Schema.Boolean>;
|
|
1008
|
+
readonly idempotent: Schema.optionalKey<Schema.Boolean>;
|
|
1009
|
+
}>>;
|
|
1010
|
+
readonly consent: Schema.optionalKey<Schema.Boolean>;
|
|
1011
|
+
readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1012
|
+
readonly output: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1013
|
+
}>>;
|
|
1014
|
+
/** By event type (`<module>.<event>`); none when left out. */
|
|
1015
|
+
readonly events: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1016
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1017
|
+
}>>, never>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Which entities hold records about a person, by entity name, and what an erasure does to them (the Privacy
|
|
1020
|
+
* contract), in the JSON manifest form: `{ fields, erase: { kind: "delete" } | { kind: "anonymise", set } |
|
|
1021
|
+
* { kind: "retain", reason }, export? }`, or `{ none: reason }` for an entity about nobody. Checked as a built-in
|
|
1022
|
+
* module's (and a field named for a person is in `fields` or `notPersonal`); with the privacy module installed
|
|
1023
|
+
* every entity must be declared, and data-subject requests export and erase these records as the module's
|
|
1024
|
+
* runtime role.
|
|
1025
|
+
*/
|
|
1026
|
+
readonly dataSubjects: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
1027
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
1028
|
+
readonly erase: Schema.Union<readonly [Schema.Struct<{
|
|
1029
|
+
readonly kind: Schema.Literal<"delete">;
|
|
1030
|
+
}>, Schema.Struct<{
|
|
1031
|
+
readonly kind: Schema.Literal<"anonymise">;
|
|
1032
|
+
readonly set: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.Null]>>;
|
|
1033
|
+
}>, Schema.Struct<{
|
|
1034
|
+
readonly kind: Schema.Literal<"retain">;
|
|
1035
|
+
readonly reason: Schema.String;
|
|
1036
|
+
}>]>;
|
|
1037
|
+
readonly export: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1038
|
+
readonly fields: Schema.$Array<Schema.String>;
|
|
1039
|
+
}>, Schema.Literal<false>]>>;
|
|
1040
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1041
|
+
}>, Schema.Struct<{
|
|
1042
|
+
readonly none: Schema.String;
|
|
1043
|
+
readonly notPersonal: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1044
|
+
}>]>>>;
|
|
1045
|
+
}>;
|
|
1046
|
+
/** The module's Cedar policy (its own namespace only). */
|
|
1047
|
+
readonly policy: Schema.String;
|
|
1048
|
+
readonly capabilities: Schema.Struct<{
|
|
1049
|
+
readonly sql: Schema.Struct<{
|
|
1050
|
+
/** The module's own entities its statements may read. */
|
|
1051
|
+
readonly read: Schema.$Array<Schema.String>;
|
|
1052
|
+
/** The module's own entities its statements may insert, update or delete (each also readable). */
|
|
1053
|
+
readonly write: Schema.$Array<Schema.String>;
|
|
1054
|
+
}>;
|
|
1055
|
+
/** The module's own event types its code may emit (none when left out, as for `call`, `settings` and `view`). */
|
|
1056
|
+
readonly emit: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1057
|
+
/** Actions of other modules its code may call through the invocation path, as the caller. */
|
|
1058
|
+
readonly call: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1059
|
+
/** Settings its code may read (keyed reads, for the caller). */
|
|
1060
|
+
readonly settings: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1061
|
+
/** The module's own actions its view may ask the shell to call. */
|
|
1062
|
+
readonly view: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Other modules' events its subscribers may handle (app or MAKE modules of its organisation, never a kernel
|
|
1065
|
+
* module's): each is delivered with its payload, so the approver sees what the module will read. Its own events
|
|
1066
|
+
* need no listing.
|
|
1067
|
+
*/
|
|
1068
|
+
readonly subscribe: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1069
|
+
/** Limits below the kernel's ceilings (`SANDBOX_MAX_LIMITS`); unset ones take the defaults. */
|
|
1070
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
1071
|
+
readonly timeMs: Schema.optionalKey<Schema.Int>;
|
|
1072
|
+
readonly memoryBytes: Schema.optionalKey<Schema.Int>;
|
|
1073
|
+
readonly steps: Schema.optionalKey<Schema.Int>;
|
|
1074
|
+
}>>;
|
|
1075
|
+
}>;
|
|
1076
|
+
/**
|
|
1077
|
+
* The module's migrations, in order. Versions are additive: a version's list starts with the previous
|
|
1078
|
+
* version's migrations, unchanged, and its own may only create tables and indexes and add columns that are
|
|
1079
|
+
* nullable or have a default (so the previous version's code keeps working over the new schema).
|
|
1080
|
+
*/
|
|
1081
|
+
readonly migrations: Schema.$Array<Schema.Struct<{
|
|
1082
|
+
readonly name: Schema.String;
|
|
1083
|
+
readonly sql: Schema.String;
|
|
1084
|
+
}>>;
|
|
1085
|
+
/** The ES module with the handlers (`export const actions = { async add(input, eloxiv) {...} }`). */
|
|
1086
|
+
readonly code: Schema.String;
|
|
1087
|
+
readonly subscribers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1088
|
+
/** Unique in the app: `<module>.<id>`. */
|
|
1089
|
+
readonly id: Schema.String;
|
|
1090
|
+
/** The event type it handles (any installed module's). */
|
|
1091
|
+
readonly event: Schema.String;
|
|
1092
|
+
/**
|
|
1093
|
+
* The export that handles it (`subscribers.onGreeted`): called with the event's payload and
|
|
1094
|
+
* `{ eventId, event, module, orgId, invocationId, attempt, origin: "system" }` (`attempt` counts its earlier failed
|
|
1095
|
+
* attempts at this event).
|
|
1096
|
+
*/
|
|
1097
|
+
readonly entry: Schema.String;
|
|
1098
|
+
}>>>;
|
|
1099
|
+
readonly view: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
1100
|
+
readonly title: Schema.String;
|
|
1101
|
+
/** The view's ES module (`export function render(state) { ... }`, with `init` and `update`). */
|
|
1102
|
+
readonly code: Schema.String;
|
|
1103
|
+
/**
|
|
1104
|
+
* The app's view slots the view is contributed to (`slots` an installed module declares with `accepts: "view"`),
|
|
1105
|
+
* each once: the shell shows it there for the organisation that installed it.
|
|
1106
|
+
*/
|
|
1107
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1108
|
+
readonly slot: Schema.String;
|
|
1109
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
1110
|
+
}>>>;
|
|
1111
|
+
}>, Schema.Struct<{
|
|
1112
|
+
readonly title: Schema.String;
|
|
1113
|
+
readonly html: Schema.String;
|
|
1114
|
+
readonly slots: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1115
|
+
readonly slot: Schema.String;
|
|
1116
|
+
readonly order: Schema.optionalKey<Schema.Number>;
|
|
1117
|
+
}>>>;
|
|
1118
|
+
}>]>>;
|
|
1119
|
+
/** Preview data: rows per entity (encoded, by field), inserted into the preview schema before its calls run. */
|
|
1120
|
+
readonly sample: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>>;
|
|
1121
|
+
}>;
|
|
1122
|
+
readonly MakeViewStep: Schema.Struct<{
|
|
1123
|
+
readonly state: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1124
|
+
readonly calls: Schema.$Array<Schema.Struct<{
|
|
1125
|
+
/** The view's own name for the call: its result comes back to `update` with it. */
|
|
1126
|
+
readonly id: Schema.String;
|
|
1127
|
+
readonly action: Schema.String;
|
|
1128
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1129
|
+
/**
|
|
1130
|
+
* The call's idempotency key (1 to 128 characters of `MAKE_VIEW_KEY`), the same on every retry of one request, so a
|
|
1131
|
+
* retry after a lost answer is answered with the first call's result. The host namespaces it by its mount of the
|
|
1132
|
+
* view. A call without one gets a key of the host's, new for each call.
|
|
1133
|
+
*/
|
|
1134
|
+
readonly key: Schema.optionalKey<Schema.String>;
|
|
1135
|
+
}>>;
|
|
1136
|
+
readonly tree: Schema.Codec<MakeViewNode, MakeViewNode, never, never>;
|
|
1137
|
+
}>;
|
|
1138
|
+
readonly MakeViewMessage: Schema.Union<readonly [Schema.Struct<{
|
|
1139
|
+
readonly type: Schema.Literal<"event">;
|
|
1140
|
+
/** The element's `on`. */
|
|
1141
|
+
readonly name: Schema.String;
|
|
1142
|
+
/** The element's `data`. */
|
|
1143
|
+
readonly data: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
1144
|
+
/** A changed field's value (a string, or a boolean for a checkbox). */
|
|
1145
|
+
readonly value: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Boolean]>>;
|
|
1146
|
+
/** The values of the fields (by `name`) of the element's form, or of the whole view outside one. */
|
|
1147
|
+
readonly fields: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Boolean]>>;
|
|
1148
|
+
}>, Schema.Struct<{
|
|
1149
|
+
readonly type: Schema.Literal<"result">;
|
|
1150
|
+
readonly id: Schema.String;
|
|
1151
|
+
readonly ok: Schema.Literal<true>;
|
|
1152
|
+
readonly result: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
1153
|
+
}>, Schema.Struct<{
|
|
1154
|
+
readonly type: Schema.Literal<"result">;
|
|
1155
|
+
readonly id: Schema.String;
|
|
1156
|
+
readonly ok: Schema.Literal<false>;
|
|
1157
|
+
readonly error: Schema.Struct<{
|
|
1158
|
+
readonly _tag: Schema.String;
|
|
1159
|
+
readonly message: Schema.String;
|
|
1160
|
+
}>;
|
|
1161
|
+
}>]>;
|
|
1162
|
+
}>;
|
|
1163
|
+
export {};
|
|
1164
|
+
//# sourceMappingURL=Sandbox.d.ts.map
|