@tangle-network/agent-app 0.45.53 → 0.45.55
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/README.md +1 -1
- package/dist/alerting/index.d.ts +5 -175
- package/dist/alerting/slack.d.ts +176 -0
- package/dist/app-auth/index.d.ts +14 -17
- package/dist/assets/index.d.ts +2 -504
- package/dist/assets/schema.d.ts +264 -0
- package/dist/assets/types.d.ts +237 -0
- package/dist/assistant/AssistantDock.d.ts +56 -0
- package/dist/assistant/AssistantHistory.d.ts +41 -0
- package/dist/assistant/AssistantPanel.d.ts +84 -0
- package/dist/assistant/ProposalCard.d.ts +41 -0
- package/dist/assistant/ResizeHandle.d.ts +19 -0
- package/dist/assistant/client-context.d.ts +20 -0
- package/dist/assistant/client.d.ts +117 -0
- package/dist/assistant/index.d.ts +19 -848
- package/dist/assistant/launcher.d.ts +23 -0
- package/dist/assistant/persistence.d.ts +26 -0
- package/dist/assistant/presentation.d.ts +99 -0
- package/dist/assistant/provider-label.d.ts +7 -0
- package/dist/assistant/reducer.d.ts +130 -0
- package/dist/assistant/sse.d.ts +24 -0
- package/dist/assistant/time-ago.d.ts +6 -0
- package/dist/assistant/transcript.d.ts +97 -0
- package/dist/assistant/types.d.ts +291 -0
- package/dist/assistant/use-stick-to-bottom.d.ts +28 -0
- package/dist/assistant/useAssistantChat.d.ts +63 -0
- package/dist/assistant/useAssistantModels.d.ts +22 -0
- package/dist/assistant/useAssistantThreads.d.ts +47 -0
- package/dist/assistant/usePanelPrefs.d.ts +55 -0
- package/dist/billing/index.d.ts +19 -21
- package/dist/brand/index.d.ts +16 -10
- package/dist/brand-extraction/extract.d.ts +34 -0
- package/dist/brand-extraction/index.d.ts +12 -214
- package/dist/brand-extraction/map.d.ts +58 -0
- package/dist/brand-extraction/types.d.ts +119 -0
- package/dist/catalog/index.d.ts +11 -101
- package/dist/chat-react/composer-mode-controls.d.ts +14 -0
- package/dist/chat-react/entry-composer.d.ts +92 -0
- package/dist/chat-react/index.d.ts +22 -118
- package/dist/chat-react/types.d.ts +11 -0
- package/dist/chat-routes/attachment-store.d.ts +84 -0
- package/dist/chat-routes/attachment-upload.d.ts +84 -0
- package/dist/chat-routes/attachment-validation.d.ts +95 -0
- package/dist/chat-routes/binary-sniff.d.ts +45 -0
- package/dist/chat-routes/completed-sandbox-turn.d.ts +25 -0
- package/dist/chat-routes/detached-turn.d.ts +197 -0
- package/dist/chat-routes/dispatch-parts.d.ts +101 -0
- package/dist/chat-routes/draft-persistence.d.ts +189 -0
- package/dist/chat-routes/durable-projection.d.ts +18 -0
- package/dist/chat-routes/file-index.d.ts +115 -0
- package/dist/chat-routes/index.d.ts +25 -1840
- package/dist/chat-routes/model-failover-stream.d.ts +206 -0
- package/dist/chat-routes/promote-file-part.d.ts +84 -0
- package/dist/chat-routes/resolve-attachments.d.ts +72 -0
- package/dist/chat-routes/sandbox-producer.d.ts +146 -0
- package/dist/chat-routes/sandbox-turn-usage.d.ts +4 -0
- package/dist/{stale-turn-lock-DucQzvXu.d.ts → chat-routes/stale-turn-lock.d.ts} +7 -9
- package/dist/chat-routes/turn-routes.d.ts +540 -0
- package/dist/chat-routes/upload.d.ts +84 -0
- package/dist/{wire-DOZ-O6hD.d.ts → chat-routes/wire.d.ts} +41 -44
- package/dist/chat-store/core.d.ts +19 -0
- package/dist/chat-store/index.d.ts +22 -322
- package/dist/{parts-BqIHMdyu.d.ts → chat-store/parts.d.ts} +49 -47
- package/dist/chat-store/schema.d.ts +157 -0
- package/dist/chat-store/store.d.ts +177 -0
- package/dist/config/index.d.ts +13 -18
- package/dist/crypto/index.d.ts +10 -12
- package/dist/crypto/web-token.d.ts +22 -0
- package/dist/design-canvas/apply.d.ts +70 -0
- package/dist/design-canvas/drizzle-store.d.ts +29 -0
- package/dist/design-canvas/drizzle.d.ts +7 -575
- package/dist/{export-presets-mgVulRaV.d.ts → design-canvas/export-presets.d.ts} +18 -22
- package/dist/design-canvas/index.d.ts +22 -268
- package/dist/design-canvas/mcp-entry.d.ts +15 -0
- package/dist/design-canvas/mcp-handler.d.ts +34 -0
- package/dist/design-canvas/mcp-tools.d.ts +30 -0
- package/dist/{model-DnfO_PdJ.d.ts → design-canvas/model.d.ts} +33 -35
- package/dist/{operations-ByJ6yXOW.d.ts → design-canvas/operations.d.ts} +21 -25
- package/dist/design-canvas/schema.d.ts +558 -0
- package/dist/{store-CqfDtnPQ.d.ts → design-canvas/store.d.ts} +8 -12
- package/dist/design-canvas/templates.d.ts +72 -0
- package/dist/design-canvas/validate.d.ts +32 -0
- package/dist/design-canvas-react/components/BleedTrimOverlay.d.ts +22 -0
- package/dist/design-canvas-react/components/BrandKnot.d.ts +11 -0
- package/dist/design-canvas-react/components/CanvasEmptyState.d.ts +32 -0
- package/dist/design-canvas-react/components/CanvasInsertPanel.d.ts +53 -0
- package/dist/{lazy-DrkVyDpe.d.ts → design-canvas-react/components/DesignCanvas.d.ts} +27 -20
- package/dist/design-canvas-react/components/DesignCanvasEditor.d.ts +23 -0
- package/dist/design-canvas-react/components/ElementNode.d.ts +51 -0
- package/dist/design-canvas-react/components/ExportControl.d.ts +21 -0
- package/dist/design-canvas-react/components/GridLayer.d.ts +47 -0
- package/dist/design-canvas-react/components/InlineTextEditor.d.ts +25 -0
- package/dist/design-canvas-react/components/LayersPanel.d.ts +20 -0
- package/dist/design-canvas-react/components/PagesStrip.d.ts +34 -0
- package/dist/design-canvas-react/components/Rulers.d.ts +31 -0
- package/dist/design-canvas-react/components/SelectionLayer.d.ts +51 -0
- package/dist/design-canvas-react/components/SnapGuidesOverlay.d.ts +25 -0
- package/dist/design-canvas-react/components/Toolbar.d.ts +64 -0
- package/dist/design-canvas-react/components/Workspace.d.ts +92 -0
- package/dist/design-canvas-react/components/ZoomControls.d.ts +14 -0
- package/dist/design-canvas-react/components/glyphs.d.ts +46 -0
- package/dist/design-canvas-react/components/icon-button.d.ts +22 -0
- package/dist/design-canvas-react/components/index.d.ts +27 -0
- package/dist/design-canvas-react/components/layer-tree.d.ts +34 -0
- package/dist/design-canvas-react/components/ruler-math.d.ts +78 -0
- package/dist/design-canvas-react/components/transform-math.d.ts +168 -0
- package/dist/{command-stack-TNPWJCzW.d.ts → design-canvas-react/contracts.d.ts} +16 -63
- package/dist/design-canvas-react/engine/command-stack.d.ts +43 -0
- package/dist/design-canvas-react/engine/commands.d.ts +154 -0
- package/dist/design-canvas-react/engine/selection.d.ts +48 -0
- package/dist/design-canvas-react/engine/snap.d.ts +24 -0
- package/dist/design-canvas-react/engine/zoom-pan.d.ts +18 -0
- package/dist/design-canvas-react/engine.d.ts +21 -399
- package/dist/design-canvas-react/export-math.d.ts +104 -0
- package/dist/design-canvas-react/export.d.ts +89 -0
- package/dist/design-canvas-react/index.d.ts +16 -586
- package/dist/design-canvas-react/insert-builders.d.ts +61 -0
- package/dist/design-canvas-react/lazy.d.ts +21 -6
- package/dist/documents/docx.d.ts +50 -0
- package/dist/documents/extract.d.ts +87 -0
- package/dist/documents/index.d.ts +26 -232
- package/dist/documents/media-type.d.ts +33 -0
- package/dist/documents/pdf-inspector.d.ts +5 -9
- package/dist/{types-DrBidf3O.d.ts → documents/types.d.ts} +13 -15
- package/dist/documents/zip.d.ts +56 -0
- package/dist/eval/calibration.d.ts +106 -0
- package/dist/eval/index.d.ts +8 -116
- package/dist/eval-campaign/index.d.ts +11 -12
- package/dist/{trust-gate-Dcm5xSva.d.ts → eval-campaign/trust-gate.d.ts} +5 -9
- package/dist/forms/blank.d.ts +48 -0
- package/dist/forms/fill.d.ts +105 -0
- package/dist/forms/index.d.ts +58 -332
- package/dist/forms/registry.d.ts +115 -0
- package/dist/forms/verify.d.ts +58 -0
- package/dist/harness/index.d.ts +21 -19
- package/dist/intakes/api.d.ts +5 -11
- package/dist/{completion-CvcNUz07.d.ts → intakes/completion.d.ts} +7 -11
- package/dist/intakes/context-sufficiency.d.ts +113 -0
- package/dist/intakes/drizzle/schema.d.ts +338 -0
- package/dist/intakes/drizzle/store.d.ts +75 -0
- package/dist/intakes/drizzle.d.ts +12 -391
- package/dist/intakes/index.d.ts +23 -113
- package/dist/{model-C8U0HZxL.d.ts → intakes/model.d.ts} +15 -17
- package/dist/intakes-react/components/BrandMark.d.ts +10 -0
- package/dist/intakes-react/components/IntakeInterview.d.ts +15 -0
- package/dist/intakes-react/components/index.d.ts +1 -0
- package/dist/intakes-react/contracts.d.ts +42 -0
- package/dist/intakes-react/index.d.ts +12 -47
- package/dist/intakes-react/lazy.d.ts +9 -8
- package/dist/integrations/index.d.ts +10 -12
- package/dist/{contract-OxG_jVMx.d.ts → interactions/contract.d.ts} +40 -42
- package/dist/interactions/index.d.ts +16 -256
- package/dist/interactions/route.d.ts +151 -0
- package/dist/interactions/sidecar.d.ts +100 -0
- package/dist/knowledge/index.d.ts +7 -11
- package/dist/knowledge-loop/index.d.ts +13 -20
- package/dist/legibility/checks/empty-state.d.ts +59 -0
- package/dist/legibility/checks/reachability.d.ts +103 -0
- package/dist/legibility/checks/silent-failure.d.ts +57 -0
- package/dist/legibility/checks/success.d.ts +38 -0
- package/dist/legibility/checks/vocabulary.d.ts +65 -0
- package/dist/legibility/cli-args.d.ts +30 -0
- package/dist/legibility/cli.d.ts +25 -0
- package/dist/legibility/index.d.ts +10 -530
- package/dist/legibility/report.d.ts +22 -0
- package/dist/legibility/scan.d.ts +29 -0
- package/dist/legibility/source.d.ts +132 -0
- package/dist/legibility/suppress.d.ts +36 -0
- package/dist/legibility/types.d.ts +168 -0
- package/dist/legibility/walk-sources.d.ts +21 -0
- package/dist/{agent-activity-C8ZG0F0M.d.ts → missions/agent-activity.d.ts} +3 -5
- package/dist/missions/engine.d.ts +251 -0
- package/dist/missions/events.d.ts +195 -0
- package/dist/missions/index.d.ts +12 -765
- package/dist/missions/plan-parse.d.ts +50 -0
- package/dist/missions/service.d.ts +265 -0
- package/dist/{failover-D-3UXXTb.d.ts → model-resolution/failover.d.ts} +10 -12
- package/dist/model-resolution/index.d.ts +15 -18
- package/dist/object-store/index.d.ts +15 -17
- package/dist/openui/action.d.ts +54 -0
- package/dist/openui/authoring.d.ts +25 -0
- package/dist/openui/index.d.ts +24 -206
- package/dist/openui/route.d.ts +124 -0
- package/dist/openui/segments.d.ts +71 -0
- package/dist/openui/values.d.ts +82 -0
- package/dist/openui-react/index.d.ts +9 -13
- package/dist/peer-floors/check.d.ts +9 -190
- package/dist/peer-floors/cli.d.ts +2 -3
- package/dist/peer-floors/dependency-source.d.ts +178 -0
- package/dist/plans/index.d.ts +13 -14
- package/dist/{billing-BuNlaKlE.d.ts → platform/billing.d.ts} +28 -32
- package/dist/platform/guards.d.ts +79 -0
- package/dist/platform/hub.d.ts +107 -0
- package/dist/platform/index.d.ts +7 -112
- package/dist/{sso-Cm00S61u.d.ts → platform/sso.d.ts} +15 -97
- package/dist/preflight/cli.d.ts +3 -6
- package/dist/preflight/index.d.ts +16 -18
- package/dist/preset-cloudflare/headers.d.ts +12 -0
- package/dist/preset-cloudflare/index.d.ts +22 -74
- package/dist/preset-cloudflare/workflow-instance.d.ts +35 -0
- package/dist/profile/budget.d.ts +72 -0
- package/dist/profile/fingerprint.d.ts +65 -0
- package/dist/profile/index.d.ts +27 -19
- package/dist/prompt/index.d.ts +3 -5
- package/dist/record/drizzle/schema.d.ts +488 -0
- package/dist/record/drizzle/store.d.ts +224 -0
- package/dist/record/drizzle.d.ts +10 -679
- package/dist/record/fold.d.ts +99 -0
- package/dist/record/index.d.ts +13 -13
- package/dist/{fold-DACU7gtf.d.ts → record/model.d.ts} +22 -124
- package/dist/record/ulid.d.ts +12 -0
- package/dist/redact/index.d.ts +14 -16
- package/dist/run/index.d.ts +11 -16
- package/dist/runtime/agent.d.ts +23 -0
- package/dist/runtime/certified-delivery.d.ts +57 -0
- package/dist/runtime/index.d.ts +17 -367
- package/dist/runtime/loop.d.ts +58 -0
- package/dist/runtime/model-catalog.d.ts +103 -0
- package/dist/{model-CdCDfBA9.d.ts → runtime/model.d.ts} +25 -27
- package/dist/runtime/openai-stream.d.ts +126 -0
- package/dist/runtime/surface-profile.d.ts +115 -0
- package/dist/sandbox/binary-read.d.ts +63 -0
- package/dist/sandbox/diagnostics.d.ts +69 -0
- package/dist/sandbox/index.d.ts +103 -1085
- package/dist/sandbox/model.d.ts +179 -0
- package/dist/sandbox/outcome.d.ts +10 -0
- package/dist/sandbox/prewarm-claim-d1.d.ts +80 -0
- package/dist/sandbox/prewarm.d.ts +193 -0
- package/dist/sandbox/recovery.d.ts +216 -0
- package/dist/sandbox/terminal-connection.d.ts +145 -0
- package/dist/sandbox/workspace-sandbox-manager.d.ts +44 -0
- package/dist/sequences/apply.d.ts +54 -0
- package/dist/sequences/captions.d.ts +91 -0
- package/dist/sequences/drizzle-store.d.ts +36 -0
- package/dist/sequences/drizzle.d.ts +7 -1252
- package/dist/sequences/exports.d.ts +138 -0
- package/dist/sequences/index.d.ts +19 -340
- package/dist/sequences/mcp-entry.d.ts +15 -0
- package/dist/sequences/mcp-handler.d.ts +39 -0
- package/dist/sequences/mcp-tools.d.ts +47 -0
- package/dist/{store-B7LLlk9p.d.ts → sequences/model.d.ts} +26 -110
- package/dist/sequences/operations.d.ts +126 -0
- package/dist/sequences/schema.d.ts +1231 -0
- package/dist/sequences/store.d.ts +81 -0
- package/dist/sequences/validate.d.ts +98 -0
- package/dist/sequences-react/components/BrandMark.d.ts +10 -0
- package/dist/sequences-react/components/PreviewCanvas.d.ts +26 -0
- package/dist/sequences-react/components/SnapIndicatorLine.d.ts +11 -0
- package/dist/sequences-react/components/TimelineClipChip.d.ts +80 -0
- package/dist/sequences-react/components/TimelineEditor.d.ts +44 -0
- package/dist/sequences-react/components/TimelineEmptyState.d.ts +21 -0
- package/dist/sequences-react/components/TimelineGhostLanes.d.ts +14 -0
- package/dist/sequences-react/components/TimelinePlayhead.d.ts +11 -0
- package/dist/sequences-react/components/TimelineRuler.d.ts +16 -0
- package/dist/sequences-react/components/TimelineSmallScreenGate.d.ts +12 -0
- package/dist/sequences-react/components/TimelineTrackRow.d.ts +51 -0
- package/dist/sequences-react/components/ZoomControl.d.ts +15 -0
- package/dist/sequences-react/components/composite-command.d.ts +8 -0
- package/dist/sequences-react/components/glyphs.d.ts +26 -0
- package/dist/sequences-react/components/index.d.ts +31 -0
- package/dist/sequences-react/components/interaction-math.d.ts +103 -0
- package/dist/sequences-react/contracts.d.ts +187 -0
- package/dist/sequences-react/engine/command-stack.d.ts +18 -0
- package/dist/sequences-react/engine/commands.d.ts +146 -0
- package/dist/sequences-react/engine/playback.d.ts +18 -0
- package/dist/sequences-react/engine/snap.d.ts +29 -0
- package/dist/sequences-react/engine/zoom.d.ts +29 -0
- package/dist/sequences-react/index.d.ts +20 -880
- package/dist/sequences-react/lazy.d.ts +8 -0
- package/dist/sequences-react/media/frame-provider.d.ts +70 -0
- package/dist/sequences-react/media/transcription.d.ts +33 -0
- package/dist/sequences-react/media/waveform.d.ts +34 -0
- package/dist/session-shell/index.d.ts +31 -204
- package/dist/session-shell/nav-guard.d.ts +170 -0
- package/dist/session-shell/path.d.ts +19 -0
- package/dist/signoff/cli.d.ts +4 -7
- package/dist/signoff/config.d.ts +12 -0
- package/dist/signoff/exec.d.ts +44 -0
- package/dist/signoff/index.d.ts +56 -14
- package/dist/signoff/invoked-as-script.d.ts +25 -0
- package/dist/signoff/node-version.d.ts +50 -0
- package/dist/signoff/proof-attach.d.ts +88 -0
- package/dist/signoff/proof-cli.d.ts +1 -0
- package/dist/signoff/proof-fixture.d.ts +13 -0
- package/dist/signoff/proof-from-report.d.ts +22 -0
- package/dist/signoff/proof-git.d.ts +57 -0
- package/dist/signoff/proof-record.d.ts +202 -0
- package/dist/signoff/proof-verify.d.ts +103 -0
- package/dist/signoff/proof.d.ts +35 -310
- package/dist/signoff/report.d.ts +7 -0
- package/dist/{run-D80hoLKh.d.ts → signoff/run.d.ts} +3 -6
- package/dist/signoff/schedule.d.ts +55 -0
- package/dist/signoff/seeds.d.ts +50 -0
- package/dist/signoff/store.d.ts +22 -0
- package/dist/{types-Bd6uW9vQ.d.ts → signoff/types.d.ts} +15 -17
- package/dist/signoff/workflow-pin.d.ts +56 -0
- package/dist/signoff/workspace.d.ts +40 -0
- package/dist/skills/index.d.ts +28 -32
- package/dist/skills-placement/index.d.ts +7 -11
- package/dist/spend/budget.d.ts +123 -0
- package/dist/spend/ceiling.d.ts +51 -0
- package/dist/spend/cli-args.d.ts +20 -0
- package/dist/spend/cli.d.ts +1 -0
- package/dist/spend/fixtures/incident-parked-time.d.ts +55 -0
- package/dist/spend/index.d.ts +38 -1144
- package/dist/spend/liveness.d.ts +131 -0
- package/dist/spend/ownership.d.ts +87 -0
- package/dist/spend/reconcile.d.ts +109 -0
- package/dist/spend/reference.d.ts +42 -0
- package/dist/spend/report.d.ts +12 -0
- package/dist/spend/store.d.ts +123 -0
- package/dist/spend/types.d.ts +466 -0
- package/dist/store/index.d.ts +10 -12
- package/dist/stories/app-shell/fixtures.d.ts +43 -0
- package/dist/stories/app-shell/shell.d.ts +81 -0
- package/dist/stories/assistant/fixtures.d.ts +73 -0
- package/dist/stories/chat/fixtures.d.ts +70 -0
- package/dist/stories/chat/markdown.d.ts +11 -0
- package/dist/stories/chat/run-drill-in.d.ts +19 -0
- package/dist/stories/chat-controls/fixtures.d.ts +116 -0
- package/dist/stories/design-canvas/fixtures.d.ts +57 -0
- package/dist/stories/fixtures/canvas.d.ts +10 -0
- package/dist/stories/fixtures/catalog.d.ts +7 -0
- package/dist/stories/fixtures/chat.d.ts +39 -0
- package/dist/stories/fixtures/index.d.ts +4 -0
- package/dist/stories/fixtures/sequences.d.ts +17 -0
- package/dist/stories/panels/fixtures.d.ts +63 -0
- package/dist/stories/sequences/fixtures.d.ts +30 -0
- package/dist/stories/studio/fixtures.d.ts +22 -0
- package/dist/stream/index.d.ts +10 -56
- package/dist/{stream-normalizer-DKRxyVlZ.d.ts → stream/stream-normalizer.d.ts} +23 -26
- package/dist/{turn-buffer-COMQUwO2.d.ts → stream/turn-buffer.d.ts} +21 -23
- package/dist/stream/turn-identity.d.ts +49 -0
- package/dist/studio/generation.d.ts +179 -0
- package/dist/studio/index.d.ts +12 -181
- package/dist/studio-react/avatar-composer.d.ts +8 -0
- package/dist/studio-react/composer-hero.d.ts +12 -0
- package/dist/studio-react/composer-shell.d.ts +18 -0
- package/dist/studio-react/generation-card.d.ts +9 -0
- package/dist/studio-react/generation-detail-modal.d.ts +11 -0
- package/dist/studio-react/generation-detail.d.ts +6 -0
- package/dist/studio-react/generation-grid.d.ts +15 -0
- package/dist/studio-react/image-composer.d.ts +8 -0
- package/dist/studio-react/index.d.ts +32 -245
- package/dist/studio-react/library-drawer.d.ts +12 -0
- package/dist/studio-react/library-panel.d.ts +15 -0
- package/dist/studio-react/publish-package-composer.d.ts +18 -0
- package/dist/studio-react/result-canvas.d.ts +6 -0
- package/dist/studio-react/speech-composer.d.ts +4 -0
- package/dist/studio-react/studio-header.d.ts +5 -0
- package/dist/studio-react/studio-sheet.d.ts +12 -0
- package/dist/studio-react/studio-workspace.d.ts +23 -0
- package/dist/studio-react/transcription-composer.d.ts +12 -0
- package/dist/studio-react/type-config.d.ts +11 -0
- package/dist/studio-react/use-studio-generations.d.ts +20 -0
- package/dist/studio-react/video-composer.d.ts +10 -0
- package/dist/tangle/index.d.ts +7 -9
- package/dist/teams/drizzle/access.d.ts +82 -0
- package/dist/{invitations-schema-_fI7HkJP.d.ts → teams/drizzle/invitations-schema.d.ts} +39 -27
- package/dist/teams/drizzle/personal-organization.d.ts +41 -0
- package/dist/{access-490O6aOU.d.ts → teams/drizzle/schema.d.ts} +57 -122
- package/dist/teams/drizzle.d.ts +12 -44
- package/dist/teams/index.d.ts +20 -44
- package/dist/teams/invitations-api.d.ts +17 -21
- package/dist/{invitations-DoYMvXea.d.ts → teams/invitations.d.ts} +14 -18
- package/dist/teams/invite.d.ts +42 -0
- package/dist/teams/members-api.d.ts +12 -16
- package/dist/teams/resend.d.ts +3 -13
- package/dist/{roles-B4nU3jDi.d.ts → teams/roles.d.ts} +18 -20
- package/dist/teams-react/components/BrandMark.d.ts +10 -0
- package/dist/teams-react/components/InvitationsPanel.d.ts +13 -0
- package/dist/teams-react/components/InviteAcceptPage.d.ts +10 -0
- package/dist/teams-react/components/MembersPanel.d.ts +14 -0
- package/dist/teams-react/components/RoleSelect.d.ts +17 -0
- package/dist/teams-react/components/index.d.ts +3 -0
- package/dist/teams-react/contracts.d.ts +134 -0
- package/dist/teams-react/index.d.ts +12 -143
- package/dist/teams-react/lazy.d.ts +11 -11
- package/dist/test-setup.d.ts +1 -0
- package/dist/theme/index.d.ts +6 -104
- package/dist/theme/tailwind-preset.d.ts +1 -2
- package/dist/theme/theme.d.ts +106 -0
- package/dist/theme-contract/cli.d.ts +21 -0
- package/dist/theme-contract/index.d.ts +4 -6
- package/dist/{auth-BYtiazA4.d.ts → tools/auth.d.ts} +8 -11
- package/dist/tools/capability.d.ts +54 -0
- package/dist/tools/dispatch.d.ts +37 -0
- package/dist/tools/errors.d.ts +8 -0
- package/dist/tools/gating.d.ts +62 -0
- package/dist/tools/http.d.ts +27 -0
- package/dist/tools/index.d.ts +12 -217
- package/dist/{mcp-rpc-DYwPlYbZ.d.ts → tools/mcp-rpc.d.ts} +7 -9
- package/dist/{mcp-xxoZZfor.d.ts → tools/mcp.d.ts} +14 -16
- package/dist/tools/openai.d.ts +28 -0
- package/dist/tools/registry.d.ts +39 -0
- package/dist/tools/runtime.d.ts +22 -0
- package/dist/{types-B25Mib1r.d.ts → tools/types.d.ts} +15 -83
- package/dist/{flow-types-CJxEmaRy.d.ts → trace/flow-types.d.ts} +2 -4
- package/dist/trace/index.d.ts +11 -148
- package/dist/trace/mission-flow.d.ts +82 -0
- package/dist/trace/mission-trace.d.ts +52 -0
- package/dist/turn-health/classify.d.ts +207 -0
- package/dist/turn-health/index.d.ts +29 -637
- package/dist/turn-health/lifecycle.d.ts +75 -0
- package/dist/turn-health/sink.d.ts +122 -0
- package/dist/turn-health/sweep.d.ts +245 -0
- package/dist/turn-stream/adapters.d.ts +257 -0
- package/dist/turn-stream/core.d.ts +293 -0
- package/dist/turn-stream/do.d.ts +144 -0
- package/dist/turn-stream/index.d.ts +62 -738
- package/dist/turn-stream/memory.d.ts +41 -0
- package/dist/vault/ConfirmDialog.d.ts +22 -0
- package/dist/vault/VaultPane.d.ts +15 -0
- package/dist/{VaultPane-BDP6SB_K.d.ts → vault/contracts.d.ts} +15 -22
- package/dist/vault/index.d.ts +15 -22
- package/dist/vault/lazy.d.ts +9 -7
- package/dist/vault/server.d.ts +8 -10
- package/dist/web/free-route-limit.d.ts +187 -0
- package/dist/web/index.d.ts +15 -207
- package/dist/{rate-limit-BOVmJRXZ.d.ts → web/rate-limit.d.ts} +3 -5
- package/dist/web-react/agent-session-controls.d.ts +105 -0
- package/dist/web-react/async/async-view.d.ts +69 -0
- package/dist/web-react/async/index.d.ts +13 -305
- package/dist/web-react/async/state.d.ts +107 -0
- package/dist/web-react/async/use-async-resource.d.ts +41 -0
- package/dist/web-react/async/use-confirmed-mutation.d.ts +90 -0
- package/dist/web-react/brand-mark.d.ts +11 -0
- package/dist/web-react/chat-attachments.d.ts +21 -0
- package/dist/web-react/chat-composer.d.ts +174 -0
- package/dist/web-react/chat-interactions.d.ts +1 -0
- package/dist/web-react/chat-mentions.d.ts +48 -0
- package/dist/web-react/chat-stream.d.ts +106 -0
- package/dist/web-react/class-names.d.ts +10 -0
- package/dist/web-react/controls.d.ts +265 -0
- package/dist/web-react/durable-chat-cards.d.ts +40 -0
- package/dist/web-react/durable-interaction-submit.d.ts +22 -0
- package/dist/web-react/durable-plan-card.d.ts +13 -0
- package/dist/web-react/durable-plan-flow.d.ts +77 -0
- package/dist/web-react/harness-glyphs.d.ts +28 -0
- package/dist/web-react/index.d.ts +80 -2347
- package/dist/web-react/inert.d.ts +39 -0
- package/dist/web-react/insight-card.d.ts +203 -0
- package/dist/web-react/interaction-card-support.d.ts +115 -0
- package/dist/web-react/interaction-plan-card.d.ts +39 -0
- package/dist/web-react/interaction-question-card.d.ts +100 -0
- package/dist/web-react/message-attachments.d.ts +56 -0
- package/dist/web-react/mission-activity.d.ts +96 -0
- package/dist/web-react/motion.d.ts +43 -0
- package/dist/web-react/provenance-model.d.ts +195 -0
- package/dist/web-react/provenance.d.ts +82 -0
- package/dist/web-react/provider-logo.d.ts +14 -0
- package/dist/web-react/record-grid-model.d.ts +257 -0
- package/dist/web-react/record-grid.d.ts +108 -0
- package/dist/web-react/sandbox-terminal.d.ts +90 -0
- package/dist/web-react/seat-paywall.d.ts +47 -0
- package/dist/web-react/session-history.d.ts +196 -0
- package/dist/web-react/smooth-text.d.ts +29 -0
- package/dist/web-react/sparkline.d.ts +150 -0
- package/dist/web-react/terminal.d.ts +1 -92
- package/dist/web-react/use-chat-interactions.d.ts +78 -0
- package/dist/web-react/use-composer-attachments.d.ts +111 -0
- package/dist/web-react/use-file-mentions.d.ts +94 -0
- package/dist/web-react/work-product.d.ts +105 -0
- package/dist/work-product/claim-support.d.ts +288 -0
- package/dist/work-product/index.d.ts +16 -849
- package/dist/work-product/provenance.d.ts +61 -0
- package/dist/{queue-VTBA5ONX.d.ts → work-product/queue.d.ts} +10 -12
- package/dist/work-product/quote.d.ts +139 -0
- package/dist/work-product/route.d.ts +88 -0
- package/dist/work-product/service.d.ts +123 -0
- package/dist/work-product/tools.d.ts +144 -0
- package/dist/{types-CCeYywdS.d.ts → work-product/types.d.ts} +29 -31
- package/dist/work-product-react/index.d.ts +19 -8
- package/dist/workspace-react/index.d.ts +8 -11
- package/package.json +5 -4
- package/dist/agent-session-controls-CmlXwp_H.d.ts +0 -384
- package/dist/apply-6wlMOLf8.d.ts +0 -280
- package/dist/attachment-validation-BfJDBU1g.d.ts +0 -261
- package/dist/budget-BOucfcb_.d.ts +0 -142
- package/dist/values-C7RidJuI.d.ts +0 -156
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsing for the agent-authored `:::mission` block — the bridge from a chat
|
|
3
|
+
* prompt contract to the engine's MissionStep[] shape. The block format:
|
|
4
|
+
*
|
|
5
|
+
* :::mission
|
|
6
|
+
* title: <mission title>
|
|
7
|
+
* <id>: <kind> | <intent>
|
|
8
|
+
* :::
|
|
9
|
+
*
|
|
10
|
+
* The allowed kind vocabulary is a PARAMETER — products pass their own list to
|
|
11
|
+
* match their prompt directive; {@link DEFAULT_MISSION_STEP_KINDS} is the
|
|
12
|
+
* default. Kinds label intent for gating and UX; they never select a different
|
|
13
|
+
* execution path.
|
|
14
|
+
*/
|
|
15
|
+
import type { MissionStep } from './service';
|
|
16
|
+
/** Default step-kind vocabulary. `best-effort` matches the engine's default
|
|
17
|
+
* non-fatal kind (a failure does not abort the mission); the rest are
|
|
18
|
+
* fatal-on-failure agent sub-tasks. */
|
|
19
|
+
export declare const DEFAULT_MISSION_STEP_KINDS: readonly string[];
|
|
20
|
+
/** Define the structure representing a parsed mission step with id, kind, and intent fields */
|
|
21
|
+
export interface ParsedMissionStep {
|
|
22
|
+
id: string;
|
|
23
|
+
kind: string;
|
|
24
|
+
intent: string;
|
|
25
|
+
}
|
|
26
|
+
/** Describe a mission with a title and an ordered list of parsed steps */
|
|
27
|
+
export interface ParsedMission {
|
|
28
|
+
title: string;
|
|
29
|
+
steps: ParsedMissionStep[];
|
|
30
|
+
}
|
|
31
|
+
/** Define options to specify allowed lowercase step kinds for parsing mission blocks */
|
|
32
|
+
export interface ParseMissionBlocksOptions {
|
|
33
|
+
/** Allowed step kinds (lowercase). Default {@link DEFAULT_MISSION_STEP_KINDS}. */
|
|
34
|
+
kinds?: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse every well-formed `:::mission` block. A block without a title or
|
|
38
|
+
* without at least one valid step yields nothing (it is malformed — never
|
|
39
|
+
* guess a plan from loose prose). Unknown kinds and malformed step lines are
|
|
40
|
+
* dropped; an empty result lets the caller skip the block rather than start an
|
|
41
|
+
* empty mission.
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseMissionBlocks(fullContent: string, options?: ParseMissionBlocksOptions): ParsedMission[];
|
|
44
|
+
/**
|
|
45
|
+
* Materialize parsed steps into the engine's MissionStep[] shape. Rejects a
|
|
46
|
+
* duplicate step id (fail loud — the owner keys its durable step cache by
|
|
47
|
+
* step id and `createMission` rejects duplicates anyway; catching it here
|
|
48
|
+
* gives a clearer diagnostic). Every step starts `pending` with zero attempts.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildAgentMissionPlan(steps: ParsedMissionStep[]): MissionStep[];
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable mission state — the guarded status machine for a multi-step agent run.
|
|
3
|
+
*
|
|
4
|
+
* A mission is a persisted plan (ordered steps), a cursor (count of completed
|
|
5
|
+
* steps), a cost ledger + budget, and a status machine. This module owns the
|
|
6
|
+
* legal transitions and the guarded mutation surface; it does NOT execute steps
|
|
7
|
+
* (the engine in `./engine` does) and it does NOT own persistence — products
|
|
8
|
+
* implement {@link MissionStorePort} over their own tables. Every state change
|
|
9
|
+
* appends a {@link MissionAuditEvent} so the run timeline is a single durable
|
|
10
|
+
* audit trail.
|
|
11
|
+
*
|
|
12
|
+
* Concurrency contract: a mission MUST be driven by a single serialized owner
|
|
13
|
+
* (a Durable Object, a Cloudflare Workflow, a queue consumer — one per
|
|
14
|
+
* mission). The service is the typed guard layer, not a serializer: every
|
|
15
|
+
* mutation re-reads the record and asks the store for a compare-and-set write
|
|
16
|
+
* guarded on the values it read. When the guard misses, the row changed under
|
|
17
|
+
* us and the caller gets `{ succeeded: false, conflict: true }` — never a
|
|
18
|
+
* silent clobber, never a stale overwrite.
|
|
19
|
+
*/
|
|
20
|
+
export type MissionStatus = 'scheduled' | 'running' | 'paused' | 'waiting_approval' | 'blocked' | 'succeeded' | 'failed' | 'aborted' | 'cancelled';
|
|
21
|
+
/** Define possible statuses for a mission step during its execution lifecycle */
|
|
22
|
+
export type MissionStepStatus = 'pending' | 'running' | 'waiting_approval' | 'done' | 'failed';
|
|
23
|
+
/** Define the structure and state details of a mission step within a workflow system */
|
|
24
|
+
export interface MissionStep {
|
|
25
|
+
id: string;
|
|
26
|
+
/** What the step should accomplish — an intent, never an implementation. */
|
|
27
|
+
intent: string;
|
|
28
|
+
/** Product-defined kind label. Labels intent for gating/UX; it never selects
|
|
29
|
+
* a different execution path. */
|
|
30
|
+
kind: string;
|
|
31
|
+
status: MissionStepStatus;
|
|
32
|
+
/** Count of genuine `* -> running` edges (retries inflate this; idempotent
|
|
33
|
+
* re-asserts do not). */
|
|
34
|
+
attempts: number;
|
|
35
|
+
/** One-line live status surfaced on the step row ("7/15 refs"). */
|
|
36
|
+
sublabel?: string;
|
|
37
|
+
/** Small pointer at the produced artifact (vault path, asset id) — never the
|
|
38
|
+
* full payload. */
|
|
39
|
+
resultRef?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Define the structure for tracking mission token usage, cost, duration, and LLM call counts */
|
|
42
|
+
export interface MissionCostLedger {
|
|
43
|
+
tokensIn: number;
|
|
44
|
+
tokensOut: number;
|
|
45
|
+
costUsd: number;
|
|
46
|
+
wallMs: number;
|
|
47
|
+
llmCalls: number;
|
|
48
|
+
}
|
|
49
|
+
/** The durable mission row, shape-normalized. Timestamps are epoch ms. */
|
|
50
|
+
export interface MissionRecord {
|
|
51
|
+
id: string;
|
|
52
|
+
workspaceId: string;
|
|
53
|
+
status: MissionStatus;
|
|
54
|
+
/** Product-defined origin label ('chat', 'manual', 'cron', …). */
|
|
55
|
+
trigger: string;
|
|
56
|
+
summary: string | null;
|
|
57
|
+
plan: MissionStep[];
|
|
58
|
+
/** Count of durably-completed steps; the next step to run is `plan[cursor]`. */
|
|
59
|
+
cursor: number;
|
|
60
|
+
cost: MissionCostLedger | null;
|
|
61
|
+
budgetUsd: number | null;
|
|
62
|
+
spentUsd: number;
|
|
63
|
+
pauseReason: string | null;
|
|
64
|
+
/** The single owning engine's instance id, write-once (see `setEngineRef`). */
|
|
65
|
+
engineRef: string | null;
|
|
66
|
+
scheduledAt: number | null;
|
|
67
|
+
startedAt: number;
|
|
68
|
+
completedAt: number | null;
|
|
69
|
+
metadata: Record<string, unknown> | null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Discriminated outcome for guarded operations. Callers MUST inspect
|
|
73
|
+
* `succeeded` before reading `value` — illegal transitions and missing rows
|
|
74
|
+
* surface here, never as a throw-and-swallow or a silent no-op. `conflict`
|
|
75
|
+
* distinguishes a lost guarded race (retryable — re-read and re-apply) from a
|
|
76
|
+
* logic rejection (illegal edge, missing step — deterministic, never retried).
|
|
77
|
+
*/
|
|
78
|
+
export type MissionOutcome<T> = {
|
|
79
|
+
succeeded: true;
|
|
80
|
+
value: T;
|
|
81
|
+
} | {
|
|
82
|
+
succeeded: false;
|
|
83
|
+
error: string;
|
|
84
|
+
conflict: boolean;
|
|
85
|
+
};
|
|
86
|
+
/** Fields a guarded write compares against the values the caller read. A SQL
|
|
87
|
+
* implementation compares JSON columns as serialized text
|
|
88
|
+
* (`coalesce(col, 'null') = JSON.stringify(expected)`), matching how the
|
|
89
|
+
* in-memory store compares. An absent field is unguarded. */
|
|
90
|
+
export interface MissionUpdateGuard {
|
|
91
|
+
status?: MissionStatus;
|
|
92
|
+
cursor?: number;
|
|
93
|
+
plan?: MissionStep[];
|
|
94
|
+
cost?: MissionCostLedger | null;
|
|
95
|
+
metadata?: Record<string, unknown> | null;
|
|
96
|
+
/** Guard that no engine has bound yet (the write-once bind). */
|
|
97
|
+
engineRefIsNull?: true;
|
|
98
|
+
}
|
|
99
|
+
/** Fields a guarded write sets when the guard holds. `null` values are real
|
|
100
|
+
* writes (clear the column), not skips. */
|
|
101
|
+
export interface MissionUpdatePatch {
|
|
102
|
+
status?: MissionStatus;
|
|
103
|
+
pauseReason?: string | null;
|
|
104
|
+
summary?: string;
|
|
105
|
+
completedAt?: number | null;
|
|
106
|
+
plan?: MissionStep[];
|
|
107
|
+
cursor?: number;
|
|
108
|
+
cost?: MissionCostLedger;
|
|
109
|
+
spentUsd?: number;
|
|
110
|
+
metadata?: Record<string, unknown>;
|
|
111
|
+
engineRef?: string;
|
|
112
|
+
}
|
|
113
|
+
/** One audit-trail row. Appended after every committed state change, so an
|
|
114
|
+
* event always denotes a real transition (no phantom rows on rejected or
|
|
115
|
+
* no-op calls). */
|
|
116
|
+
export interface MissionAuditEvent {
|
|
117
|
+
missionId: string;
|
|
118
|
+
workspaceId: string;
|
|
119
|
+
level: 'info' | 'warn' | 'error';
|
|
120
|
+
/** Machine-readable transition name ('mission.created', 'mission.step.done',
|
|
121
|
+
* 'mission.cursor', 'mission.cost', 'mission.paused', …). */
|
|
122
|
+
step: string;
|
|
123
|
+
message: string;
|
|
124
|
+
metadata: Record<string, unknown>;
|
|
125
|
+
at: number;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Persistence seam — the product implements this over its own tables. The
|
|
129
|
+
* invariant the implementation MUST keep: `update` applies `patch` ONLY when
|
|
130
|
+
* every guard field still equals the stored value, and returns `null` when the
|
|
131
|
+
* guard misses. That null is how a concurrent write surfaces as a typed
|
|
132
|
+
* failure instead of a clobber.
|
|
133
|
+
*/
|
|
134
|
+
export interface MissionStorePort {
|
|
135
|
+
load(id: string): Promise<MissionRecord | null>;
|
|
136
|
+
/** `extras` are the opaque product-column values from
|
|
137
|
+
* `CreateMissionInput.extras` — write them in the SAME statement as the
|
|
138
|
+
* record (single-write creation) or ignore them if the table has no extra
|
|
139
|
+
* columns. */
|
|
140
|
+
insert(record: MissionRecord, extras?: Record<string, unknown>): Promise<MissionRecord>;
|
|
141
|
+
update(id: string, guard: MissionUpdateGuard, patch: MissionUpdatePatch): Promise<MissionRecord | null>;
|
|
142
|
+
appendEvent(event: MissionAuditEvent): Promise<void>;
|
|
143
|
+
}
|
|
144
|
+
/** Statuses a mission can never leave — the run is done. */
|
|
145
|
+
export declare function isMissionTerminal(status: MissionStatus): boolean;
|
|
146
|
+
/** The cooperative kill switch: a stop request rides metadata so it survives
|
|
147
|
+
* any status and is honored by the engine before the next side effect. */
|
|
148
|
+
export declare function isMissionStopRequested(mission: MissionRecord): boolean;
|
|
149
|
+
/** Define input parameters for creating a mission including optional deterministic id and unique plan steps */
|
|
150
|
+
export interface CreateMissionInput {
|
|
151
|
+
/** Explicit row id. Omit to use the service's id generator. Pass a
|
|
152
|
+
* DETERMINISTIC id (derived from the originating turn) when the caller may
|
|
153
|
+
* re-create the same mission under at-least-once delivery — the duplicate
|
|
154
|
+
* insert then trips the store's uniqueness instead of spawning a second run. */
|
|
155
|
+
id?: string;
|
|
156
|
+
workspaceId: string;
|
|
157
|
+
/** Becomes the mission summary. */
|
|
158
|
+
title: string;
|
|
159
|
+
/** Plan step ids MUST be unique: the owning workflow keys its durable step
|
|
160
|
+
* cache by step id, so a collision would silently replay the wrong result.
|
|
161
|
+
* A duplicate is rejected here (fail loud). */
|
|
162
|
+
plan: MissionStep[];
|
|
163
|
+
budgetUsd?: number | null;
|
|
164
|
+
/** Epoch ms. Present → the mission starts `scheduled` instead of `running`. */
|
|
165
|
+
scheduledAt?: number | null;
|
|
166
|
+
trigger: string;
|
|
167
|
+
/** Caller-defined context stamped onto the record (thread ids, source turn,
|
|
168
|
+
* model). Read back via `mission.metadata`; the engine only reads
|
|
169
|
+
* `stopRequested` from it. */
|
|
170
|
+
metadata?: Record<string, unknown> | null;
|
|
171
|
+
/**
|
|
172
|
+
* Opaque product-column values handed VERBATIM to `MissionStorePort.insert`
|
|
173
|
+
* (e.g. a `workflowId` FK on the product's mission table), so creation is a
|
|
174
|
+
* single write — no post-insert stamp. The service never reads, validates,
|
|
175
|
+
* or persists them itself; they exist only on the insert call.
|
|
176
|
+
*/
|
|
177
|
+
extras?: Record<string, unknown>;
|
|
178
|
+
}
|
|
179
|
+
/** Define a patch to update the status and optional metadata of a step in a process */
|
|
180
|
+
export interface SetStepStatusPatch {
|
|
181
|
+
sublabel?: string;
|
|
182
|
+
resultRef?: string;
|
|
183
|
+
error?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Spend committed ATOMICALLY with the step transition. Folding the cost into
|
|
186
|
+
* the SAME guarded write makes step completion the per-step idempotency key:
|
|
187
|
+
* a same-status replay (the step is already `done`) short-circuits as a no-op
|
|
188
|
+
* BEFORE the write, so the charge lands exactly once even when an engine
|
|
189
|
+
* RESUME re-dispatches a step whose cost previously committed. `deltaUsd` is
|
|
190
|
+
* the marginal spend; `ledgerDelta` carries the token/wall/llm breakdown.
|
|
191
|
+
*/
|
|
192
|
+
cost?: {
|
|
193
|
+
deltaUsd: number;
|
|
194
|
+
ledgerDelta?: Partial<MissionCostLedger>;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/** Define input parameters to complete a mission with status and optional summary */
|
|
198
|
+
export interface CompleteMissionInput {
|
|
199
|
+
ok: boolean;
|
|
200
|
+
summary?: string;
|
|
201
|
+
}
|
|
202
|
+
/** Define methods to create, retrieve, and update missions with controlled engine binding and metadata merging */
|
|
203
|
+
export interface MissionService {
|
|
204
|
+
createMission(input: CreateMissionInput): Promise<MissionRecord>;
|
|
205
|
+
getMission(id: string): Promise<MissionRecord | null>;
|
|
206
|
+
/** Bind the executing engine's instance id, write-once from the single
|
|
207
|
+
* owner: re-asserting the same ref is a no-op; binding a DIFFERENT ref over
|
|
208
|
+
* an existing one is rejected so a second owner can never steal the run. */
|
|
209
|
+
setEngineRef(id: string, engineRef: string): Promise<MissionOutcome<MissionRecord>>;
|
|
210
|
+
/** Shallow-merge keys into metadata. Guarded on the metadata read, so racing
|
|
211
|
+
* merges surface as conflicts instead of silently dropping keys. */
|
|
212
|
+
mergeMetadata(id: string, patch: Record<string, unknown>): Promise<MissionOutcome<MissionRecord>>;
|
|
213
|
+
/** Mutate one plan step's status (+ optional sublabel/resultRef) and append a
|
|
214
|
+
* transition event. Rejects unknown steps and illegal step edges. Does NOT
|
|
215
|
+
* move the cursor — call `advanceCursor` for that. */
|
|
216
|
+
setStepStatus(id: string, stepId: string, status: MissionStepStatus, patch?: SetStepStatusPatch): Promise<MissionOutcome<MissionRecord>>;
|
|
217
|
+
/** Move the done-count cursor forward by one. Rejects advancing past the end
|
|
218
|
+
* of the plan so the caller learns the mission has no further work. */
|
|
219
|
+
advanceCursor(id: string): Promise<MissionOutcome<MissionRecord>>;
|
|
220
|
+
/** Increment spentUsd and merge a partial ledger into the cumulative ledger.
|
|
221
|
+
* `deltaUsd` is the marginal spend; `ledgerDelta` carries the token/wall/
|
|
222
|
+
* llm-call breakdown for the same unit of work. */
|
|
223
|
+
addCost(id: string, deltaUsd: number, ledgerDelta?: Partial<MissionCostLedger>): Promise<MissionOutcome<MissionRecord>>;
|
|
224
|
+
pause(id: string, reason: string): Promise<MissionOutcome<MissionRecord>>;
|
|
225
|
+
resume(id: string): Promise<MissionOutcome<MissionRecord>>;
|
|
226
|
+
abort(id: string): Promise<MissionOutcome<MissionRecord>>;
|
|
227
|
+
/** Flip one step and the whole mission to waiting_approval together. The
|
|
228
|
+
* mission transition is validated FIRST so an illegal source is rejected
|
|
229
|
+
* without mutating the step — no half-applied state. */
|
|
230
|
+
markWaitingApproval(id: string, stepId: string): Promise<MissionOutcome<MissionRecord>>;
|
|
231
|
+
complete(id: string, input: CompleteMissionInput): Promise<MissionOutcome<MissionRecord>>;
|
|
232
|
+
}
|
|
233
|
+
/** Define options for configuring mission service behavior including storage, time, and ID generation */
|
|
234
|
+
export interface MissionServiceOptions {
|
|
235
|
+
store: MissionStorePort;
|
|
236
|
+
/** Injectable clock (epoch ms). Default `Date.now`. */
|
|
237
|
+
now?: () => number;
|
|
238
|
+
/**
|
|
239
|
+
* Row-id generator when `CreateMissionInput.id` is omitted. Default
|
|
240
|
+
* `crypto.randomUUID()` — a 36-char dashed UUID. Inject your own when your
|
|
241
|
+
* mission table already has an id shape (e.g. 32-hex matching D1 row
|
|
242
|
+
* defaults): the service stamps the generated id verbatim onto the inserted
|
|
243
|
+
* record, so a mismatch with the rest of your schema surfaces only at the
|
|
244
|
+
* product layer. Keep id shape parity here, not in the store.
|
|
245
|
+
*/
|
|
246
|
+
generateId?: () => string;
|
|
247
|
+
}
|
|
248
|
+
/** Create a mission service that manages mission records and audit events with customizable options */
|
|
249
|
+
export declare function createMissionService(options: MissionServiceOptions): MissionService;
|
|
250
|
+
/** Define an in-memory mission store that tracks events and allows direct record writes */
|
|
251
|
+
export interface InMemoryMissionStore extends MissionStorePort {
|
|
252
|
+
/** The full audit trail, append order. */
|
|
253
|
+
events(): MissionAuditEvent[];
|
|
254
|
+
/** Unguarded direct write — simulates a concurrent owner or a crash-shaped
|
|
255
|
+
* state in tests. Production writers go through the guarded `update`. */
|
|
256
|
+
put(record: MissionRecord): void;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* In-memory {@link MissionStorePort} — the portable backend for tests and
|
|
260
|
+
* sandbox/eval shells. Guard comparison uses JSON serialization of the read
|
|
261
|
+
* value, the same contract a SQL implementation honors by comparing stored
|
|
262
|
+
* JSON text. Records are deep-copied on every boundary so callers can never
|
|
263
|
+
* mutate stored state around the guards.
|
|
264
|
+
*/
|
|
265
|
+
export declare function createInMemoryMissionStore(): InMemoryMissionStore;
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
* on every model (bad request, auth, content filter): retrying those down a
|
|
30
30
|
* chain burns latency and money to reach the same failure.
|
|
31
31
|
*/
|
|
32
|
-
declare const UPSTREAM_UNAVAILABLE_CODES: readonly string[];
|
|
32
|
+
export declare const UPSTREAM_UNAVAILABLE_CODES: readonly string[];
|
|
33
33
|
/** HTTP statuses that indicate an upstream capacity/availability problem. */
|
|
34
|
-
declare const UPSTREAM_UNAVAILABLE_STATUSES: readonly number[];
|
|
34
|
+
export declare const UPSTREAM_UNAVAILABLE_STATUSES: readonly number[];
|
|
35
35
|
/**
|
|
36
36
|
* The HTTP status a message states in prose, or `undefined` when it states
|
|
37
37
|
* none. Deliberately NOT "any three digits in the string" — an unanchored digit
|
|
38
38
|
* scan would read a token count or a duration as a status.
|
|
39
39
|
*/
|
|
40
|
-
declare function readHttpStatusHint(text: string): number | undefined;
|
|
40
|
+
export declare function readHttpStatusHint(text: string): number | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* True when `signal` — a thrown error OR a resolved result payload — indicates
|
|
43
43
|
* the model's upstream is unavailable and another model is worth trying.
|
|
@@ -47,16 +47,16 @@ declare function readHttpStatusHint(text: string): number | undefined;
|
|
|
47
47
|
* explicit failure marker (`success: false`, or an `error`/`errorCode` field) —
|
|
48
48
|
* a successful result is never misread as an outage.
|
|
49
49
|
*/
|
|
50
|
-
declare function isUpstreamUnavailable(signal: unknown): boolean;
|
|
50
|
+
export declare function isUpstreamUnavailable(signal: unknown): boolean;
|
|
51
51
|
/** One model tried, and how it went. */
|
|
52
|
-
interface ModelFailoverAttempt {
|
|
52
|
+
export interface ModelFailoverAttempt {
|
|
53
53
|
model: string;
|
|
54
54
|
ok: boolean;
|
|
55
55
|
/** Why this model was abandoned. Absent when `ok`. */
|
|
56
56
|
reason?: string;
|
|
57
57
|
}
|
|
58
58
|
/** The outcome of a failover run: the value plus the full attempt trail. */
|
|
59
|
-
interface ModelFailoverResult<T> {
|
|
59
|
+
export interface ModelFailoverResult<T> {
|
|
60
60
|
value: T;
|
|
61
61
|
/** The model that actually produced `value`. */
|
|
62
62
|
model: string;
|
|
@@ -65,12 +65,12 @@ interface ModelFailoverResult<T> {
|
|
|
65
65
|
usedFallback: boolean;
|
|
66
66
|
}
|
|
67
67
|
/** Every model in the chain failed; carries the trail for logging. */
|
|
68
|
-
declare class ModelFailoverExhaustedError extends Error {
|
|
68
|
+
export declare class ModelFailoverExhaustedError extends Error {
|
|
69
69
|
readonly attempts: ModelFailoverAttempt[];
|
|
70
70
|
constructor(attempts: ModelFailoverAttempt[]);
|
|
71
71
|
}
|
|
72
72
|
/** Inputs to {@link runWithModelFailover}. */
|
|
73
|
-
interface RunWithModelFailoverInput<T> {
|
|
73
|
+
export interface RunWithModelFailoverInput<T> {
|
|
74
74
|
/** Preferred model first, then fallbacks in descending preference. */
|
|
75
75
|
models: readonly string[];
|
|
76
76
|
/** Executes one turn with the given model. */
|
|
@@ -96,11 +96,9 @@ interface RunWithModelFailoverInput<T> {
|
|
|
96
96
|
*
|
|
97
97
|
* @throws ModelFailoverExhaustedError when every model reports an outage.
|
|
98
98
|
*/
|
|
99
|
-
declare function runWithModelFailover<T>(input: RunWithModelFailoverInput<T>): Promise<ModelFailoverResult<T>>;
|
|
99
|
+
export declare function runWithModelFailover<T>(input: RunWithModelFailoverInput<T>): Promise<ModelFailoverResult<T>>;
|
|
100
100
|
/**
|
|
101
101
|
* Build a failover chain: the preferred model first, then `fallbacks`, with
|
|
102
102
|
* duplicates removed so a model is never retried twice in one turn.
|
|
103
103
|
*/
|
|
104
|
-
declare function buildModelChain(preferred: string, fallbacks: readonly string[]): string[];
|
|
105
|
-
|
|
106
|
-
export { type ModelFailoverAttempt as M, type RunWithModelFailoverInput as R, UPSTREAM_UNAVAILABLE_CODES as U, ModelFailoverExhaustedError as a, type ModelFailoverResult as b, UPSTREAM_UNAVAILABLE_STATUSES as c, buildModelChain as d, runWithModelFailover as e, isUpstreamUnavailable as i, readHttpStatusHint as r };
|
|
104
|
+
export declare function buildModelChain(preferred: string, fallbacks: readonly string[]): string[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { M as ModelFailoverAttempt, a as ModelFailoverExhaustedError, b as ModelFailoverResult, R as RunWithModelFailoverInput, U as UPSTREAM_UNAVAILABLE_CODES, c as UPSTREAM_UNAVAILABLE_STATUSES, d as buildModelChain, i as isUpstreamUnavailable, r as readHttpStatusHint, e as runWithModelFailover } from '../failover-D-3UXXTb.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Canonical chat-model resolution — identical across every agent app.
|
|
5
3
|
*
|
|
@@ -19,35 +17,35 @@ export { M as ModelFailoverAttempt, a as ModelFailoverExhaustedError, b as Model
|
|
|
19
17
|
* (exact, or a bare id resolved to its canonical id when the suffix is unique).
|
|
20
18
|
*/
|
|
21
19
|
/** The router /v1/models entry shape this module reads. Minimal on purpose. */
|
|
22
|
-
interface ModelInfo {
|
|
20
|
+
export interface ModelInfo {
|
|
23
21
|
id: string;
|
|
24
22
|
name?: string;
|
|
25
23
|
_provider?: string;
|
|
26
24
|
provider?: string;
|
|
27
25
|
}
|
|
28
26
|
/** Define possible origins for the chat model configuration values */
|
|
29
|
-
type ChatModelSource = 'request' | 'workspace' | 'env' | 'default';
|
|
27
|
+
export type ChatModelSource = 'request' | 'workspace' | 'env' | 'default';
|
|
30
28
|
/** Resolve a chat model with its identifier and source information */
|
|
31
|
-
interface ResolvedChatModel {
|
|
29
|
+
export interface ResolvedChatModel {
|
|
32
30
|
model: string;
|
|
33
31
|
source: ChatModelSource;
|
|
34
32
|
}
|
|
35
33
|
/** Represent successful chat model validation with a true status and a validated string value */
|
|
36
|
-
interface ChatModelValidationSuccess {
|
|
34
|
+
export interface ChatModelValidationSuccess {
|
|
37
35
|
succeeded: true;
|
|
38
36
|
value: string;
|
|
39
37
|
}
|
|
40
38
|
/** Describe a failed chat model validation result with an error message */
|
|
41
|
-
interface ChatModelValidationFailure {
|
|
39
|
+
export interface ChatModelValidationFailure {
|
|
42
40
|
succeeded: false;
|
|
43
41
|
error: string;
|
|
44
42
|
}
|
|
45
43
|
/** Resolve the outcome of validating a chat model as either success or failure */
|
|
46
|
-
type ChatModelValidationResult = ChatModelValidationSuccess | ChatModelValidationFailure;
|
|
44
|
+
export type ChatModelValidationResult = ChatModelValidationSuccess | ChatModelValidationFailure;
|
|
47
45
|
/** The catalog-fetch boundary: maps a router base URL to the raw model list. */
|
|
48
|
-
type LoadModels = (routerBaseUrl: string) => Promise<ModelInfo[]>;
|
|
46
|
+
export type LoadModels = (routerBaseUrl: string) => Promise<ModelInfo[]>;
|
|
49
47
|
/** Resolve the effective chat model input by prioritizing request, workspace, environment, and default models */
|
|
50
|
-
interface ResolveChatModelInput {
|
|
48
|
+
export interface ResolveChatModelInput {
|
|
51
49
|
/** Per-request override (highest precedence). */
|
|
52
50
|
requestModel?: string;
|
|
53
51
|
/** Persisted workspace-pinned model. */
|
|
@@ -60,9 +58,9 @@ interface ResolveChatModelInput {
|
|
|
60
58
|
}
|
|
61
59
|
/** Resolve the chat-turn model by the one canonical precedence. Blank values are
|
|
62
60
|
* treated as absent. */
|
|
63
|
-
declare function resolveChatModel(input: ResolveChatModelInput): ResolvedChatModel;
|
|
61
|
+
export declare function resolveChatModel(input: ResolveChatModelInput): ResolvedChatModel;
|
|
64
62
|
/** Define input parameters for validating chat model IDs with optional allowlist and catalog access details */
|
|
65
|
-
interface ValidateChatModelIdInput {
|
|
63
|
+
export interface ValidateChatModelIdInput {
|
|
66
64
|
/** Ids accepted without a catalog round-trip (defaults + operator-trusted). */
|
|
67
65
|
allowlist?: Iterable<string>;
|
|
68
66
|
/** The operator-set env model value — always admitted (operator-trusted). */
|
|
@@ -79,12 +77,11 @@ interface ValidateChatModelIdInput {
|
|
|
79
77
|
* the suffix is unique across the catalog — an ambiguous suffix is rejected
|
|
80
78
|
* rather than silently assigned a provider.
|
|
81
79
|
*/
|
|
82
|
-
declare function validateChatModelId(modelId: unknown, input: ValidateChatModelIdInput): Promise<ChatModelValidationResult>;
|
|
80
|
+
export declare function validateChatModelId(modelId: unknown, input: ValidateChatModelIdInput): Promise<ChatModelValidationResult>;
|
|
83
81
|
/** Resolve and return a trimmed string model ID or undefined for invalid or empty input */
|
|
84
|
-
declare function cleanModelId(value: unknown): string | undefined;
|
|
82
|
+
export declare function cleanModelId(value: unknown): string | undefined;
|
|
85
83
|
/** Validate if a model ID string conforms to length and character format requirements */
|
|
86
|
-
declare function isWellFormedModelId(modelId: string): boolean;
|
|
84
|
+
export declare function isWellFormedModelId(modelId: string): boolean;
|
|
87
85
|
/** Resolve unique catalog IDs associated with a given model including its canonical form if applicable */
|
|
88
|
-
declare function catalogIdsForModel(model: ModelInfo): string[];
|
|
89
|
-
|
|
90
|
-
export { type ChatModelSource, type ChatModelValidationFailure, type ChatModelValidationResult, type ChatModelValidationSuccess, type LoadModels, type ModelInfo, type ResolveChatModelInput, type ResolvedChatModel, type ValidateChatModelIdInput, catalogIdsForModel, cleanModelId, isWellFormedModelId, resolveChatModel, validateChatModelId };
|
|
86
|
+
export declare function catalogIdsForModel(model: ModelInfo): string[];
|
|
87
|
+
export { isUpstreamUnavailable, readHttpStatusHint, runWithModelFailover, buildModelChain, ModelFailoverExhaustedError, UPSTREAM_UNAVAILABLE_CODES, UPSTREAM_UNAVAILABLE_STATUSES, type ModelFailoverAttempt, type ModelFailoverResult, type RunWithModelFailoverInput, } from './failover';
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
/** Options for a single {@link ObjectStore.put}. Both fields are optional; a
|
|
34
34
|
* store that needs a fixed content length (e.g. R2 with a `ReadableStream`
|
|
35
35
|
* body) uses `contentLength` when present. */
|
|
36
|
-
interface PutObjectOptions {
|
|
36
|
+
export interface PutObjectOptions {
|
|
37
37
|
/** MIME type recorded with the object (returned by `get`/`head`). Advisory:
|
|
38
38
|
* the proxied download route always serves `application/octet-stream`. */
|
|
39
39
|
contentType?: string;
|
|
@@ -44,7 +44,7 @@ interface PutObjectOptions {
|
|
|
44
44
|
/** A retrieved object. `stream()` is the ONLY way to read the bytes — there is
|
|
45
45
|
* deliberately no `text()`/`arrayBuffer()`, so a large object never buffers
|
|
46
46
|
* into the isolate heap. */
|
|
47
|
-
interface ObjectBody {
|
|
47
|
+
export interface ObjectBody {
|
|
48
48
|
/** The object's bytes as a `ReadableStream` (backed by R2's `.body`). */
|
|
49
49
|
stream(): ReadableStream;
|
|
50
50
|
/** Size in bytes. */
|
|
@@ -57,7 +57,7 @@ interface ObjectBody {
|
|
|
57
57
|
* throw for a missing key (a miss is a normal control-flow outcome, not an
|
|
58
58
|
* error); `delete` is idempotent.
|
|
59
59
|
*/
|
|
60
|
-
interface ObjectStore {
|
|
60
|
+
export interface ObjectStore {
|
|
61
61
|
put(key: string, body: ReadableStream | Uint8Array, opts?: PutObjectOptions): Promise<void>;
|
|
62
62
|
/** `null` on a miss — never throws for a missing key. */
|
|
63
63
|
get(key: string): Promise<ObjectBody | null>;
|
|
@@ -69,7 +69,7 @@ interface ObjectStore {
|
|
|
69
69
|
delete(key: string): Promise<void>;
|
|
70
70
|
}
|
|
71
71
|
/** Head/metadata shape of a stored object (structural match of R2's `R2Object`). */
|
|
72
|
-
interface R2LikeObjectHead {
|
|
72
|
+
export interface R2LikeObjectHead {
|
|
73
73
|
size: number;
|
|
74
74
|
httpMetadata?: {
|
|
75
75
|
contentType?: string;
|
|
@@ -77,7 +77,7 @@ interface R2LikeObjectHead {
|
|
|
77
77
|
}
|
|
78
78
|
/** Body shape of a retrieved object (structural match of R2's `R2ObjectBody`).
|
|
79
79
|
* `body` is the streamed content — the impl reads this, never `.text()`. */
|
|
80
|
-
interface R2LikeObjectBody extends R2LikeObjectHead {
|
|
80
|
+
export interface R2LikeObjectBody extends R2LikeObjectHead {
|
|
81
81
|
body: ReadableStream;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -86,7 +86,7 @@ interface R2LikeObjectBody extends R2LikeObjectHead {
|
|
|
86
86
|
* without this package ever importing `@cloudflare/workers-types` (which would
|
|
87
87
|
* otherwise leak into the public `.d.ts`).
|
|
88
88
|
*/
|
|
89
|
-
interface R2LikeBucket {
|
|
89
|
+
export interface R2LikeBucket {
|
|
90
90
|
put(key: string, value: ReadableStream | Uint8Array | ArrayBuffer, options?: {
|
|
91
91
|
httpMetadata?: {
|
|
92
92
|
contentType?: string;
|
|
@@ -102,7 +102,7 @@ interface R2LikeBucket {
|
|
|
102
102
|
* `.text()`/`.arrayBuffer()`, so a large file flows through the worker rather
|
|
103
103
|
* than buffering into the isolate.
|
|
104
104
|
*/
|
|
105
|
-
declare function createR2ObjectStore({ bucket }: {
|
|
105
|
+
export declare function createR2ObjectStore({ bucket }: {
|
|
106
106
|
bucket: R2LikeBucket;
|
|
107
107
|
}): ObjectStore;
|
|
108
108
|
/**
|
|
@@ -115,10 +115,10 @@ declare function createR2ObjectStore({ bucket }: {
|
|
|
115
115
|
* attacker-controlled id can never widen the key beyond its own operator+
|
|
116
116
|
* customer prefix.
|
|
117
117
|
*/
|
|
118
|
-
declare function assertSafeKeySegment(s: string): string;
|
|
118
|
+
export declare function assertSafeKeySegment(s: string): string;
|
|
119
119
|
/** Inputs to {@link objectKey}. `customerId` is optional — an unattributed
|
|
120
120
|
* upload lands under the reserved `_unattributed` customer segment. */
|
|
121
|
-
interface ObjectKeyParts {
|
|
121
|
+
export interface ObjectKeyParts {
|
|
122
122
|
operatorId: string;
|
|
123
123
|
/** Optional — omitted/undefined groups the upload under `_unattributed`. */
|
|
124
124
|
customerId?: string;
|
|
@@ -134,9 +134,9 @@ interface ObjectKeyParts {
|
|
|
134
134
|
* privilege wall — a caller cannot later swap them without breaking the
|
|
135
135
|
* signature.
|
|
136
136
|
*/
|
|
137
|
-
declare function objectKey({ operatorId, customerId, uploadId, filename }: ObjectKeyParts): string;
|
|
137
|
+
export declare function objectKey({ operatorId, customerId, uploadId, filename }: ObjectKeyParts): string;
|
|
138
138
|
/** Arguments to {@link signObjectUrl}. */
|
|
139
|
-
interface SignObjectUrlArgs {
|
|
139
|
+
export interface SignObjectUrlArgs {
|
|
140
140
|
/** The exact object key to authorize (from {@link objectKey}). */
|
|
141
141
|
key: string;
|
|
142
142
|
/** Absolute expiry in epoch MILLISECONDS (e.g. `Date.now() + 5 * 60_000` for a
|
|
@@ -159,10 +159,10 @@ interface SignObjectUrlArgs {
|
|
|
159
159
|
* keep it SHORT — ~5 minutes is the recommended default for a privilege-walled
|
|
160
160
|
* document.
|
|
161
161
|
*/
|
|
162
|
-
declare function signObjectUrl({ key, exp, secret }: SignObjectUrlArgs): Promise<string>;
|
|
162
|
+
export declare function signObjectUrl({ key, exp, secret }: SignObjectUrlArgs): Promise<string>;
|
|
163
163
|
/** Result of {@link verifyObjectUrl}: the canonical key on success, nothing
|
|
164
164
|
* distinguishing on failure (so a rejection leaks no detail). */
|
|
165
|
-
type VerifyObjectUrlResult = {
|
|
165
|
+
export type VerifyObjectUrlResult = {
|
|
166
166
|
ok: true;
|
|
167
167
|
key: string;
|
|
168
168
|
} | {
|
|
@@ -180,7 +180,7 @@ type VerifyObjectUrlResult = {
|
|
|
180
180
|
* near-correct signature is not distinguishable by timing. Async because the
|
|
181
181
|
* HMAC primitive is WebCrypto.
|
|
182
182
|
*/
|
|
183
|
-
declare function verifyObjectUrl(request: Request, { secret }: {
|
|
183
|
+
export declare function verifyObjectUrl(request: Request, { secret }: {
|
|
184
184
|
secret: string;
|
|
185
185
|
}): Promise<VerifyObjectUrlResult>;
|
|
186
186
|
/**
|
|
@@ -196,9 +196,7 @@ declare function verifyObjectUrl(request: Request, { secret }: {
|
|
|
196
196
|
* `Content-Type: application/octet-stream`, and `X-Content-Type-Options:
|
|
197
197
|
* nosniff`, so the worker never serves active/inline content.
|
|
198
198
|
*/
|
|
199
|
-
declare function createProxiedArtifactRoute({ store, secret, }: {
|
|
199
|
+
export declare function createProxiedArtifactRoute({ store, secret, }: {
|
|
200
200
|
store: ObjectStore;
|
|
201
201
|
secret: string;
|
|
202
202
|
}): (request: Request) => Promise<Response>;
|
|
203
|
-
|
|
204
|
-
export { type ObjectBody, type ObjectKeyParts, type ObjectStore, type PutObjectOptions, type R2LikeBucket, type R2LikeObjectBody, type R2LikeObjectHead, type SignObjectUrlArgs, type VerifyObjectUrlResult, assertSafeKeySegment, createProxiedArtifactRoute, createR2ObjectStore, objectKey, signObjectUrl, verifyObjectUrl };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What travels when a user presses a button on a page the agent authored.
|
|
3
|
+
*
|
|
4
|
+
* The submission is a plain REST body, not a chat turn. That is the entire
|
|
5
|
+
* point of this module: pressing "Recalculate" on an agent-authored form must
|
|
6
|
+
* cost the same as pressing a button on a hand-built screen — one product route
|
|
7
|
+
* call, no model tokens, no sandbox wake-up. The wire shape here is therefore
|
|
8
|
+
* deliberately small and self-contained: an action id, the form it belongs to,
|
|
9
|
+
* that form's current values, and enough addressing for the product to find the
|
|
10
|
+
* page. Nothing in it references a session, a turn, or a run.
|
|
11
|
+
*/
|
|
12
|
+
import { type OpenUIFormValues } from './values';
|
|
13
|
+
/** What the browser POSTs when an action fires. */
|
|
14
|
+
export interface OpenUIActionSubmission {
|
|
15
|
+
/** The action's stable id, as authored on the page. */
|
|
16
|
+
actionId: string;
|
|
17
|
+
/** The form whose values are attached, when the action sits in one. */
|
|
18
|
+
formId?: string;
|
|
19
|
+
/** Current values of that form, keyed by field id. Empty for a bare action. */
|
|
20
|
+
values: OpenUIFormValues;
|
|
21
|
+
/** The node the action was rendered on, when the page carries several. */
|
|
22
|
+
nodeId?: string;
|
|
23
|
+
/** Vault path of the persisted `render_ui` artifact this page came from. */
|
|
24
|
+
artifactPath?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Parsed submission, or the reason the body was refused. */
|
|
27
|
+
export type OpenUIActionBodyValidation = {
|
|
28
|
+
ok: true;
|
|
29
|
+
submission: OpenUIActionSubmission;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
code: OpenUIActionBodyErrorCode;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
/** Why a submission body was refused before any handler ran. */
|
|
36
|
+
export type OpenUIActionBodyErrorCode = 'OPENUI_ACTION_ID_MISSING' | 'OPENUI_ACTION_ID_INVALID' | 'OPENUI_FORM_ID_INVALID' | 'OPENUI_NODE_ID_INVALID' | 'OPENUI_ARTIFACT_PATH_INVALID' | 'OPENUI_VALUES_INVALID' | 'OPENUI_FIELD_ID_INVALID' | 'OPENUI_FIELD_VALUE_INVALID';
|
|
37
|
+
/** Ids the host accepts on the wire: identifier-safe, same rule as field ids. */
|
|
38
|
+
export declare function isSafeOpenUIActionId(id: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Validate a raw JSON body into a submission. Every rejection names a code so
|
|
41
|
+
* the browser can tell "the page sent something malformed" from "the product
|
|
42
|
+
* refused the action".
|
|
43
|
+
*/
|
|
44
|
+
export declare function validateOpenUIActionBody(body: Record<string, unknown>): OpenUIActionBodyValidation;
|
|
45
|
+
/**
|
|
46
|
+
* One plain line recording what the user did, for the product to carry into the
|
|
47
|
+
* NEXT turn's context.
|
|
48
|
+
*
|
|
49
|
+
* The action itself spends no model tokens; without a record of it the agent
|
|
50
|
+
* would later reason about a page the user has already changed. Appending this
|
|
51
|
+
* to the thread (as a note, a system line, or a stored part) is how the agent
|
|
52
|
+
* catches up on the next turn the user actually pays for.
|
|
53
|
+
*/
|
|
54
|
+
export declare function describeOpenUIAction(submission: OpenUIActionSubmission): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the model is told about writing an interactive page.
|
|
3
|
+
*
|
|
4
|
+
* An agent will not emit a node vocabulary nobody described to it, so the
|
|
5
|
+
* vocabulary and the prompt text that teaches it have to ship together. This
|
|
6
|
+
* module is that text plus the machine-readable field/action shape it
|
|
7
|
+
* describes, so five products do not each write their own (subtly different)
|
|
8
|
+
* version into a system prompt.
|
|
9
|
+
*
|
|
10
|
+
* OPT-IN, DELIBERATELY. The input nodes render only where the host's renderer
|
|
11
|
+
* knows them and the host passes an action handler. Advertise this guide only
|
|
12
|
+
* once both are true for your product — otherwise the agent writes forms the
|
|
13
|
+
* page will drop.
|
|
14
|
+
*/
|
|
15
|
+
import type { OpenUIFieldKind } from './values';
|
|
16
|
+
/** The input kinds this guide teaches, in the order it lists them. */
|
|
17
|
+
export declare const OPENUI_INPUT_KINDS: readonly OpenUIFieldKind[];
|
|
18
|
+
/**
|
|
19
|
+
* The interactive vocabulary, written for a model.
|
|
20
|
+
*
|
|
21
|
+
* Appended to `render_ui`'s description by
|
|
22
|
+
* `buildAppToolOpenAITools(taxonomy, { interactiveUi: true })`, and usable
|
|
23
|
+
* directly in a system prompt for the inline ```` ```openui ```` path.
|
|
24
|
+
*/
|
|
25
|
+
export declare const OPENUI_INTERACTIVE_AUTHORING_GUIDE: string;
|