@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
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type ChatInteractionStatus } from '../interactions/contract';
|
|
3
2
|
/** Represent a JSON-compatible object with string keys and values of any type */
|
|
4
|
-
type JsonRecord = Record<string, unknown>;
|
|
3
|
+
export type JsonRecord = Record<string, unknown>;
|
|
5
4
|
/** Define an event object carrying a type and optional JSON data payload */
|
|
6
|
-
interface StreamEvent {
|
|
5
|
+
export interface StreamEvent {
|
|
7
6
|
type: string;
|
|
8
7
|
data?: JsonRecord;
|
|
9
8
|
}
|
|
10
9
|
/** Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined */
|
|
11
|
-
declare function asRecord(value: unknown): JsonRecord | undefined;
|
|
10
|
+
export declare function asRecord(value: unknown): JsonRecord | undefined;
|
|
12
11
|
/** Resolve a non-empty string from a value or return undefined */
|
|
13
|
-
declare function asString(value: unknown): string | undefined;
|
|
12
|
+
export declare function asString(value: unknown): string | undefined;
|
|
14
13
|
/** Resolve a unique tool identifier from various possible properties or generate a fallback ID */
|
|
15
|
-
declare function resolveToolId(part: JsonRecord): string;
|
|
14
|
+
export declare function resolveToolId(part: JsonRecord): string;
|
|
16
15
|
/** Resolve the tool name from a JSON record using tool, name, or a default value */
|
|
17
|
-
declare function resolveToolName(part: JsonRecord): string;
|
|
16
|
+
export declare function resolveToolName(part: JsonRecord): string;
|
|
18
17
|
/** Resolve time properties from various keys into a normalized record with numeric start and end fields */
|
|
19
|
-
declare function normalizeTime(value: unknown): JsonRecord | undefined;
|
|
18
|
+
export declare function normalizeTime(value: unknown): JsonRecord | undefined;
|
|
20
19
|
/** Normalize tool-related events into a standardized message.part.updated format */
|
|
21
|
-
declare function normalizeToolEvent(event: StreamEvent): StreamEvent;
|
|
20
|
+
export declare function normalizeToolEvent(event: StreamEvent): StreamEvent;
|
|
22
21
|
/** Normalize a persisted part object by standardizing its structure and fields */
|
|
23
|
-
declare function normalizePersistedPart(rawPart: JsonRecord): JsonRecord | null;
|
|
22
|
+
export declare function normalizePersistedPart(rawPart: JsonRecord): JsonRecord | null;
|
|
24
23
|
/** Stream/transcript part key for a promoted (path-bearing) attachment,
|
|
25
24
|
* keyed on its storage path — re-emitting the same path folds into the same
|
|
26
25
|
* segment instead of duplicating it. */
|
|
27
|
-
declare function attachmentPartKey(path: string): string;
|
|
26
|
+
export declare function attachmentPartKey(path: string): string;
|
|
28
27
|
/** Resolve a unique key string for a part based on its type and identifying properties */
|
|
29
|
-
declare function getPartKey(part: JsonRecord): string;
|
|
28
|
+
export declare function getPartKey(part: JsonRecord): string;
|
|
30
29
|
/** Merge incoming JSON with existing persisted data, applying delta for text types when provided */
|
|
31
|
-
declare function mergePersistedPart(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string): JsonRecord;
|
|
30
|
+
export declare function mergePersistedPart(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string): JsonRecord;
|
|
32
31
|
/** Resolve errors when a tool fails to report a terminal result before the assistant turn ends */
|
|
33
|
-
declare const MISSING_TOOL_TERMINAL_ERROR = "Tool did not report a terminal result before the assistant turn completed.";
|
|
32
|
+
export declare const MISSING_TOOL_TERMINAL_ERROR = "Tool did not report a terminal result before the assistant turn completed.";
|
|
34
33
|
/** Provide the reason identifier for a missing tool in the terminal environment */
|
|
35
|
-
declare const MISSING_TOOL_TERMINAL_REASON = "missing-tool-terminal";
|
|
34
|
+
export declare const MISSING_TOOL_TERMINAL_REASON = "missing-tool-terminal";
|
|
36
35
|
/** Closes a tool part left `running` when a stream ended abnormally: settles
|
|
37
36
|
* it as a terminal `error` and stamps `state.metadata.terminalized` so the
|
|
38
37
|
* synthetic settlement is distinguishable from a real tool failure. Parts
|
|
39
38
|
* that already settled (and non-tool parts) pass through untouched. */
|
|
40
|
-
declare function terminalizeDanglingToolPart(part: JsonRecord): JsonRecord;
|
|
39
|
+
export declare function terminalizeDanglingToolPart(part: JsonRecord): JsonRecord;
|
|
41
40
|
/** Resolve dangling tool parts into terminal forms within the given JSON records array */
|
|
42
|
-
declare function terminalizeDanglingToolParts(parts: JsonRecord[]): JsonRecord[];
|
|
41
|
+
export declare function terminalizeDanglingToolParts(parts: JsonRecord[]): JsonRecord[];
|
|
43
42
|
/** Settles still-pending interaction parts at persist time. The broker
|
|
44
43
|
* guarantees a resolved question either answered (run unblocked, no cancel
|
|
45
44
|
* event) or cancelled/timed out (cancel event already updated the part), so
|
|
46
45
|
* the success path finalizes remaining pendings as `answered` and the
|
|
47
46
|
* failure/terminalize paths as `expired`. */
|
|
48
|
-
declare function finalizePendingInteractionParts(parts: JsonRecord[], outcome: Extract<ChatInteractionStatus, 'answered' | 'expired'>): JsonRecord[];
|
|
47
|
+
export declare function finalizePendingInteractionParts(parts: JsonRecord[], outcome: Extract<ChatInteractionStatus, 'answered' | 'expired'>): JsonRecord[];
|
|
49
48
|
/** Collapses text-part artifacts of unstable upstream segment identity: the
|
|
50
49
|
* same text arriving under two keys (id-less delta stream, then an
|
|
51
50
|
* id-bearing snapshot) folds into two segments, and interleaved empty
|
|
52
51
|
* segments survive as blank parts. Consecutive identical text parts merge
|
|
53
52
|
* into one; empty text parts drop when any non-empty text part exists. */
|
|
54
|
-
declare function collapseRedundantTextParts(parts: JsonRecord[]): JsonRecord[];
|
|
53
|
+
export declare function collapseRedundantTextParts(parts: JsonRecord[]): JsonRecord[];
|
|
55
54
|
/** Resolve and clean up assistant parts by terminalizing and collapsing redundant segments */
|
|
56
|
-
declare function finalizeAssistantParts(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
55
|
+
export declare function finalizeAssistantParts(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
57
56
|
/** The MID-STREAM twin of {@link finalizeAssistantParts}: the same assembled,
|
|
58
57
|
* collapsed projection MINUS the dangling-tool terminalizer.
|
|
59
58
|
*
|
|
@@ -70,12 +69,10 @@ declare function finalizeAssistantParts(partOrder: string[], partMap: Map<string
|
|
|
70
69
|
* Pending `interaction` parts are likewise left `pending` here (the caller
|
|
71
70
|
* skips {@link finalizePendingInteractionParts}) — an ask is genuinely
|
|
72
71
|
* unanswered until the turn settles. */
|
|
73
|
-
declare function draftAssistantParts(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
72
|
+
export declare function draftAssistantParts(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
74
73
|
/** Finalizes, then folds each synthetic tool settlement back into `partMap`
|
|
75
74
|
* and returns just those updates — the shape a streaming loop needs to emit
|
|
76
75
|
* closing `message.part.updated` frames for tools the stream never settled. */
|
|
77
|
-
declare function terminalizeDanglingAssistantToolUpdates(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
76
|
+
export declare function terminalizeDanglingAssistantToolUpdates(partOrder: string[], partMap: Map<string, JsonRecord>, finalText: string): JsonRecord[];
|
|
78
77
|
/** Encode a StreamEvent object into a Uint8Array using the provided TextEncoder */
|
|
79
|
-
declare function encodeEvent(encoder: TextEncoder, event: StreamEvent): Uint8Array;
|
|
80
|
-
|
|
81
|
-
export { type JsonRecord as J, MISSING_TOOL_TERMINAL_ERROR as M, type StreamEvent as S, attachmentPartKey as a, MISSING_TOOL_TERMINAL_REASON as b, asRecord as c, asString as d, collapseRedundantTextParts as e, draftAssistantParts as f, encodeEvent as g, finalizeAssistantParts as h, finalizePendingInteractionParts as i, getPartKey as j, normalizeTime as k, normalizeToolEvent as l, mergePersistedPart as m, normalizePersistedPart as n, resolveToolName as o, terminalizeDanglingToolPart as p, terminalizeDanglingToolParts as q, resolveToolId as r, terminalizeDanglingAssistantToolUpdates as t };
|
|
78
|
+
export declare function encodeEvent(encoder: TextEncoder, event: StreamEvent): Uint8Array;
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
* a flush window before they are persisted — replay yields slightly chunkier
|
|
16
16
|
* deltas with identical concatenation.
|
|
17
17
|
*/
|
|
18
|
-
type TurnStatus = 'running' | 'complete' | 'error';
|
|
18
|
+
export type TurnStatus = 'running' | 'complete' | 'error';
|
|
19
19
|
/** A running row is a renewable lease, not permanent truth. If the process
|
|
20
20
|
* driving a turn dies before writing a terminal status, reconnect discovery
|
|
21
21
|
* must eventually stop returning that abandoned row. */
|
|
22
|
-
declare const DEFAULT_RUNNING_TURN_LEASE_MS: number;
|
|
22
|
+
export declare const DEFAULT_RUNNING_TURN_LEASE_MS: number;
|
|
23
23
|
/** Keep a healthy turn's lease comfortably ahead of expiry without turning
|
|
24
24
|
* per-token streaming into status-write traffic. */
|
|
25
|
-
declare const DEFAULT_RUNNING_TURN_RENEW_INTERVAL_MS = 30000;
|
|
25
|
+
export declare const DEFAULT_RUNNING_TURN_RENEW_INTERVAL_MS = 30000;
|
|
26
26
|
/** Represent a buffered turn event with a sequence number and serialized event data */
|
|
27
|
-
interface BufferedTurnEvent {
|
|
27
|
+
export interface BufferedTurnEvent {
|
|
28
28
|
seq: number;
|
|
29
29
|
/** The serialized event line (JSON string, no trailing newline). */
|
|
30
30
|
event: string;
|
|
31
31
|
}
|
|
32
32
|
/** Manage and query turn events and their lifecycle statuses within a scoped event store */
|
|
33
|
-
interface TurnEventStore {
|
|
33
|
+
export interface TurnEventStore {
|
|
34
34
|
append(turnId: string, events: BufferedTurnEvent[]): Promise<void>;
|
|
35
35
|
read(turnId: string, fromSeq: number): Promise<BufferedTurnEvent[]>;
|
|
36
36
|
/** Record turn lifecycle. `scopeId` (a thread/session id) is optional and lets
|
|
@@ -47,14 +47,14 @@ interface TurnEventStore {
|
|
|
47
47
|
/** Configure running-turn lease evaluation. The clock is injectable so store
|
|
48
48
|
* contract tests do not sleep. Keep the default in production unless a
|
|
49
49
|
* deployment also tunes the buffer's renewal interval. */
|
|
50
|
-
interface TurnEventStoreOptions {
|
|
50
|
+
export interface TurnEventStoreOptions {
|
|
51
51
|
runningTurnLeaseMs?: number;
|
|
52
52
|
now?: () => number;
|
|
53
53
|
}
|
|
54
54
|
/** Merge consecutive text/reasoning deltas of the same type into one event.
|
|
55
55
|
* Concatenation-preserving: replaying the coalesced stream produces the same
|
|
56
56
|
* accumulated text as the original. */
|
|
57
|
-
declare function coalesceDeltas(events: unknown[]): unknown[];
|
|
57
|
+
export declare function coalesceDeltas(events: unknown[]): unknown[];
|
|
58
58
|
/**
|
|
59
59
|
* Coalesce consecutive `message.part.updated` deltas for the SAME part into one
|
|
60
60
|
* event. agent-runtime products stream `ChatStreamEvent` NDJSON
|
|
@@ -69,9 +69,9 @@ declare function coalesceDeltas(events: unknown[]): unknown[];
|
|
|
69
69
|
* appends `delta` and one that reads the cumulative `part` both reconstruct the
|
|
70
70
|
* identical final text.
|
|
71
71
|
*/
|
|
72
|
-
declare function coalesceChatStreamEvents(events: unknown[]): unknown[];
|
|
72
|
+
export declare function coalesceChatStreamEvents(events: unknown[]): unknown[];
|
|
73
73
|
/** Define options for buffering and flushing turn events with optional live client delivery and event coalescing */
|
|
74
|
-
interface BufferedTurnOptions {
|
|
74
|
+
export interface BufferedTurnOptions {
|
|
75
75
|
store: TurnEventStore;
|
|
76
76
|
turnId: string;
|
|
77
77
|
/** Deliver one serialized line to the live client. Throwing here (client
|
|
@@ -94,7 +94,7 @@ interface BufferedTurnOptions {
|
|
|
94
94
|
runningTurnRenewIntervalMs?: number;
|
|
95
95
|
}
|
|
96
96
|
/** A push-driven buffer for a turn whose producer the caller does NOT own. */
|
|
97
|
-
interface BufferedTurnTap {
|
|
97
|
+
export interface BufferedTurnTap {
|
|
98
98
|
/** Buffer one event: persist (coalesced, on the flush window) + best-effort
|
|
99
99
|
* live-deliver. Wire to a push source's per-event hook (e.g. agent-runtime
|
|
100
100
|
* `handleChatTurn`'s `hooks.onEvent`). Marks the turn 'running' on first call. */
|
|
@@ -114,9 +114,9 @@ interface BufferedTurnTap {
|
|
|
114
114
|
* + the finished body). Durability stays here in the shell; the engine needs
|
|
115
115
|
* no `TurnEventStore` seam.
|
|
116
116
|
*/
|
|
117
|
-
declare function createBufferedTurnTap(opts: BufferedTurnOptions): BufferedTurnTap;
|
|
117
|
+
export declare function createBufferedTurnTap(opts: BufferedTurnOptions): BufferedTurnTap;
|
|
118
118
|
/** Define options to pump data from an asynchronous iterable source with buffered turn control */
|
|
119
|
-
interface PumpBufferedTurnOptions extends BufferedTurnOptions {
|
|
119
|
+
export interface PumpBufferedTurnOptions extends BufferedTurnOptions {
|
|
120
120
|
source: AsyncIterable<unknown>;
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
@@ -127,9 +127,9 @@ interface PumpBufferedTurnOptions extends BufferedTurnOptions {
|
|
|
127
127
|
* client-write failure; a source error marks the turn 'error' (after flushing
|
|
128
128
|
* what was produced) and rethrows.
|
|
129
129
|
*/
|
|
130
|
-
declare function pumpBufferedTurn(opts: PumpBufferedTurnOptions): Promise<void>;
|
|
130
|
+
export declare function pumpBufferedTurn(opts: PumpBufferedTurnOptions): Promise<void>;
|
|
131
131
|
/** Define options for replaying turn events with control over sequence, polling, and timeout */
|
|
132
|
-
interface ReplayTurnEventsOptions {
|
|
132
|
+
export interface ReplayTurnEventsOptions {
|
|
133
133
|
store: TurnEventStore;
|
|
134
134
|
turnId: string;
|
|
135
135
|
/** Replay strictly after this sequence number (0 = from the beginning). */
|
|
@@ -145,7 +145,7 @@ interface ReplayTurnEventsOptions {
|
|
|
145
145
|
* final `{seq: -1, event: '{"type":"turn_status",...}'}` marker so clients
|
|
146
146
|
* know why the replay ended.
|
|
147
147
|
*/
|
|
148
|
-
declare function replayTurnEvents(opts: ReplayTurnEventsOptions): AsyncGenerator<BufferedTurnEvent>;
|
|
148
|
+
export declare function replayTurnEvents(opts: ReplayTurnEventsOptions): AsyncGenerator<BufferedTurnEvent>;
|
|
149
149
|
/**
|
|
150
150
|
* Serialize a replayed row for the wire, stamping the buffer ordinal ONTO the
|
|
151
151
|
* line so a reconnecting client can continue from `?fromSeq=<lastSeq>`.
|
|
@@ -166,9 +166,9 @@ declare function replayTurnEvents(opts: ReplayTurnEventsOptions): AsyncGenerator
|
|
|
166
166
|
* verbatim. A stamping bug must degrade to today's behaviour, never break a
|
|
167
167
|
* replay.
|
|
168
168
|
*/
|
|
169
|
-
declare function stampReplaySeq(row: BufferedTurnEvent): string;
|
|
169
|
+
export declare function stampReplaySeq(row: BufferedTurnEvent): string;
|
|
170
170
|
/** Minimal structural D1 contract (Cloudflare `D1Database` satisfies it). */
|
|
171
|
-
interface D1LikeForTurns {
|
|
171
|
+
export interface D1LikeForTurns {
|
|
172
172
|
prepare(sql: string): {
|
|
173
173
|
bind(...values: unknown[]): {
|
|
174
174
|
run(): Promise<unknown>;
|
|
@@ -180,14 +180,12 @@ interface D1LikeForTurns {
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
/** Schema for the D1 store — append to the product's migrations. */
|
|
183
|
-
declare const TURN_EVENTS_MIGRATION_SQL = "\nCREATE TABLE IF NOT EXISTS turn_events (\n turnId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n event TEXT NOT NULL,\n PRIMARY KEY (turnId, seq)\n);\nCREATE TABLE IF NOT EXISTS turn_status (\n turnId TEXT PRIMARY KEY,\n status TEXT NOT NULL,\n scopeId TEXT,\n updatedAt TEXT NOT NULL\n);\nCREATE INDEX IF NOT EXISTS idx_turn_status_scope ON turn_status (scopeId, status);\n";
|
|
183
|
+
export declare const TURN_EVENTS_MIGRATION_SQL = "\nCREATE TABLE IF NOT EXISTS turn_events (\n turnId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n event TEXT NOT NULL,\n PRIMARY KEY (turnId, seq)\n);\nCREATE TABLE IF NOT EXISTS turn_status (\n turnId TEXT PRIMARY KEY,\n status TEXT NOT NULL,\n scopeId TEXT,\n updatedAt TEXT NOT NULL\n);\nCREATE INDEX IF NOT EXISTS idx_turn_status_scope ON turn_status (scopeId, status);\n";
|
|
184
184
|
/** For deployments whose `turn_status` table predates `scopeId`/`listRunning` —
|
|
185
185
|
* run once to add the column (the CREATE above already includes it for new
|
|
186
186
|
* deployments). SQLite ignores a duplicate-add error if already applied. */
|
|
187
|
-
declare const TURN_STATUS_SCOPE_MIGRATION_SQL = "ALTER TABLE turn_status ADD COLUMN scopeId TEXT;";
|
|
187
|
+
export declare const TURN_STATUS_SCOPE_MIGRATION_SQL = "ALTER TABLE turn_status ADD COLUMN scopeId TEXT;";
|
|
188
188
|
/** Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface */
|
|
189
|
-
declare function createD1TurnEventStore(db: D1LikeForTurns, options?: TurnEventStoreOptions): TurnEventStore;
|
|
189
|
+
export declare function createD1TurnEventStore(db: D1LikeForTurns, options?: TurnEventStoreOptions): TurnEventStore;
|
|
190
190
|
/** In-memory store for tests and keyless local dev. */
|
|
191
|
-
declare function createMemoryTurnEventStore(options?: TurnEventStoreOptions): TurnEventStore;
|
|
192
|
-
|
|
193
|
-
export { type BufferedTurnEvent as B, type D1LikeForTurns as D, type PumpBufferedTurnOptions as P, type ReplayTurnEventsOptions as R, type TurnEventStore as T, type BufferedTurnOptions as a, type BufferedTurnTap as b, DEFAULT_RUNNING_TURN_LEASE_MS as c, DEFAULT_RUNNING_TURN_RENEW_INTERVAL_MS as d, TURN_EVENTS_MIGRATION_SQL as e, TURN_STATUS_SCOPE_MIGRATION_SQL as f, type TurnEventStoreOptions as g, type TurnStatus as h, coalesceChatStreamEvents as i, coalesceDeltas as j, createBufferedTurnTap as k, createD1TurnEventStore as l, createMemoryTurnEventStore as m, pumpBufferedTurn as p, replayTurnEvents as r, stampReplaySeq as s };
|
|
191
|
+
export declare function createMemoryTurnEventStore(options?: TurnEventStoreOptions): TurnEventStore;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { JsonRecord } from './stream-normalizer';
|
|
2
|
+
/** Define the structure of a chat message stored for a specific conversation turn */
|
|
3
|
+
export interface PersistedChatMessageForTurn {
|
|
4
|
+
id: string;
|
|
5
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
6
|
+
content: string;
|
|
7
|
+
parts: Array<Record<string, unknown>> | null;
|
|
8
|
+
}
|
|
9
|
+
/** Represent a chat turn with resolved user message insertion and prior message context */
|
|
10
|
+
export interface ResolvedChatTurn {
|
|
11
|
+
turnIndex: number;
|
|
12
|
+
shouldInsertUserMessage: boolean;
|
|
13
|
+
priorMessages: PersistedChatMessageForTurn[];
|
|
14
|
+
userParts: JsonRecord[];
|
|
15
|
+
/** The id of the user row this turn REUSES (retry dedup), when one was
|
|
16
|
+
* found. Absent on the insert path, where no row exists yet.
|
|
17
|
+
*
|
|
18
|
+
* The reused row is deliberately EXCLUDED from `priorMessages` (it is this
|
|
19
|
+
* turn's own user message, not prior context), so this field is the only
|
|
20
|
+
* way a caller can name it. */
|
|
21
|
+
reusedUserMessageId?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Normalize and validate a client turn ID string ensuring it meets format and length requirements */
|
|
24
|
+
export declare function normalizeClientTurnId(value: unknown): string | undefined;
|
|
25
|
+
/** Build an array of text parts with optional turn ID for user input */
|
|
26
|
+
export declare function buildUserTextParts(text: string, turnId: string | undefined): JsonRecord[];
|
|
27
|
+
/** Resolve whether a message contains any part with the specified turn ID */
|
|
28
|
+
export declare function messageHasTurnId(message: PersistedChatMessageForTurn, turnId: string): boolean;
|
|
29
|
+
/** Resolve a chat turn by determining message reuse and constructing user message parts */
|
|
30
|
+
export declare function resolveChatTurn(input: {
|
|
31
|
+
existingMessages: PersistedChatMessageForTurn[];
|
|
32
|
+
userContent: string;
|
|
33
|
+
turnId?: string;
|
|
34
|
+
/** True when the thread has a turn still RUNNING in the turn-event buffer
|
|
35
|
+
* (`turnStore.listRunning(threadId)`).
|
|
36
|
+
*
|
|
37
|
+
* Without incremental persistence the trailing row of a thread mid-turn is
|
|
38
|
+
* always the user row, so the content fallback below could assume it. With
|
|
39
|
+
* incremental persistence the assistant row lands seconds into the turn, so
|
|
40
|
+
* a retry of that same turn finds an ASSISTANT row trailing and would
|
|
41
|
+
* insert a duplicate user row.
|
|
42
|
+
*
|
|
43
|
+
* This flag is the discriminator that keeps both cases right, and it needs
|
|
44
|
+
* no new state: an assistant row trailing a turn that is still running is
|
|
45
|
+
* that turn's in-flight draft (walk past it — this is a retry), whereas an
|
|
46
|
+
* assistant row trailing a SETTLED turn is a completed answer (stop — the
|
|
47
|
+
* user genuinely repeated a message and deserves a new turn). */
|
|
48
|
+
hasRunningTurn?: boolean;
|
|
49
|
+
}): ResolvedChatTurn;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/** Define the structure for a studio integration connection with status and provider identifiers */
|
|
2
|
+
export interface StudioIntegrationConnection {
|
|
3
|
+
status: string;
|
|
4
|
+
providerId: string;
|
|
5
|
+
connectorId?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Define generation categories for media including image, video, speech, avatar, and transcription */
|
|
8
|
+
export type GenerationType = 'image' | 'video' | 'speech' | 'avatar' | 'transcription';
|
|
9
|
+
/** Define possible states representing the progress of a generation process */
|
|
10
|
+
export type GenerationStatus = 'pending' | 'running' | 'succeeded' | 'failed';
|
|
11
|
+
/** Define possible status values for a media model's availability and accessibility */
|
|
12
|
+
export type MediaModelStatus = 'available' | 'limited' | 'unavailable';
|
|
13
|
+
/** Define the structure for a generation entity including its metadata and creation details */
|
|
14
|
+
export interface Generation {
|
|
15
|
+
id: string;
|
|
16
|
+
type: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
result: string | null;
|
|
19
|
+
model: string | null;
|
|
20
|
+
cost: number | null;
|
|
21
|
+
createdAt: Date | null;
|
|
22
|
+
metadata: Record<string, unknown> | null;
|
|
23
|
+
}
|
|
24
|
+
/** Describe media model option properties including id, name, type, status, and optional provider and reason */
|
|
25
|
+
export interface MediaModelOption {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
provider?: string;
|
|
29
|
+
type: GenerationType;
|
|
30
|
+
status: MediaModelStatus;
|
|
31
|
+
reason?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Represent media model catalog with default values, model options, and optional error message */
|
|
34
|
+
export interface MediaModelCatalogResponse {
|
|
35
|
+
defaults: Record<GenerationType, string>;
|
|
36
|
+
models: Record<GenerationType, MediaModelOption[]>;
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Define the structure for configuring package publishing details and evaluation criteria */
|
|
40
|
+
export interface PublishPackage {
|
|
41
|
+
caption: string;
|
|
42
|
+
description: string;
|
|
43
|
+
mentions: string[];
|
|
44
|
+
destinations: string[];
|
|
45
|
+
cadence: string;
|
|
46
|
+
workflowDraft: boolean;
|
|
47
|
+
evalContract: {
|
|
48
|
+
artifactType: string;
|
|
49
|
+
deterministicChecks: string[];
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Define a destination for publishing content with identifiers, label, provider IDs, and fields */
|
|
53
|
+
export interface PublishDestination {
|
|
54
|
+
id: string;
|
|
55
|
+
label: string;
|
|
56
|
+
providerIds: string[];
|
|
57
|
+
fields: string;
|
|
58
|
+
}
|
|
59
|
+
/** Provide an array of supported generation types for media and content processing */
|
|
60
|
+
export declare const GENERATION_TYPES: readonly GenerationType[];
|
|
61
|
+
/** Resolve whether a string value matches a valid GenerationType */
|
|
62
|
+
export declare function isGenerationType(value: string): value is GenerationType;
|
|
63
|
+
/** List available social media platforms with their publishing fields and provider identifiers */
|
|
64
|
+
export declare const DESTINATIONS: PublishDestination[];
|
|
65
|
+
/** Provide an array of predefined cadence options for scheduling or approval processes */
|
|
66
|
+
export declare const CADENCES: string[];
|
|
67
|
+
/** Provide the valid image quality values for generation requests */
|
|
68
|
+
export declare const IMAGE_QUALITIES: readonly ["low", "medium", "high", "auto"];
|
|
69
|
+
/** Provide a placeholder hint listing the accepted image size values */
|
|
70
|
+
export declare const IMAGE_SIZE_HINT = "1024x1024, 1536x1024, 1024x1536, or auto";
|
|
71
|
+
/** Provide a validation pattern for the free-form image size field (WxH or auto) */
|
|
72
|
+
export declare const IMAGE_SIZE_PATTERN: string;
|
|
73
|
+
/** Provide the valid video duration values (seconds) for generation requests */
|
|
74
|
+
export declare const VIDEO_DURATIONS: readonly ["4", "6", "8", "10", "12"];
|
|
75
|
+
/** Provide the valid video resolution values for generation requests */
|
|
76
|
+
export declare const VIDEO_RESOLUTIONS: readonly ["720p", "1080p"];
|
|
77
|
+
/** Provide the valid video aspect ratio values for generation requests */
|
|
78
|
+
export declare const VIDEO_ASPECT_RATIOS: readonly ["16:9", "9:16", "1:1"];
|
|
79
|
+
/** Define the minimum number of images required for processing or validation */
|
|
80
|
+
export declare const MIN_IMAGE_COUNT = 1;
|
|
81
|
+
/** Define the maximum number of images allowed for upload or display */
|
|
82
|
+
export declare const MAX_IMAGE_COUNT = 4;
|
|
83
|
+
/** Resolve a human-readable relative time string from a given date or return an empty string if null */
|
|
84
|
+
export declare function relativeTime(date: Date | null): string;
|
|
85
|
+
/** Resolve the output directory path based on the specified generation type */
|
|
86
|
+
export declare function outputPathFor(type: GenerationType): string;
|
|
87
|
+
/** Resolve the vault path string from a Generation object or return null if unavailable */
|
|
88
|
+
export declare function generationVaultPath(generation: Generation): string | null;
|
|
89
|
+
/** Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs */
|
|
90
|
+
export declare function buildPublishPackage({ caption, postDescription, mentions, cadence, destinations, }: {
|
|
91
|
+
caption: string;
|
|
92
|
+
postDescription: string;
|
|
93
|
+
mentions: string;
|
|
94
|
+
cadence: string;
|
|
95
|
+
destinations: string[];
|
|
96
|
+
}): PublishPackage | null;
|
|
97
|
+
/** Determine if a value conforms to the PublishPackage structure with optional metadata fields */
|
|
98
|
+
export declare function isPublishPackage(value: unknown): value is {
|
|
99
|
+
caption?: string;
|
|
100
|
+
description?: string;
|
|
101
|
+
mentions?: string[];
|
|
102
|
+
destinations?: string[];
|
|
103
|
+
cadence?: string;
|
|
104
|
+
};
|
|
105
|
+
/** Determine if a destination has any active connections in the given list of studio integration connections */
|
|
106
|
+
export declare function isDestinationConnected(destination: PublishDestination, connections: StudioIntegrationConnection[]): boolean;
|
|
107
|
+
/** Resolve selected models by applying defaults for missing or unavailable entries in the catalog */
|
|
108
|
+
export declare function selectedModelsWithDefaults(current: Partial<Record<GenerationType, string>>, catalog: MediaModelCatalogResponse): Partial<Record<GenerationType, string>>;
|
|
109
|
+
/** Resolve the preferred model ID for a given generation type from the media model catalog */
|
|
110
|
+
export declare function preferredModelId(type: GenerationType, catalog: MediaModelCatalogResponse | null): string | undefined;
|
|
111
|
+
/** Resolve the appropriate status message for a media model based on loading state and availability */
|
|
112
|
+
export declare function modelMessage(model: MediaModelOption | undefined, loading: boolean, count: number): string | null;
|
|
113
|
+
/** Define fields required to configure and request various types of media generation */
|
|
114
|
+
export interface GenerationRequestFields {
|
|
115
|
+
workspaceId: string;
|
|
116
|
+
clientRequestId: string;
|
|
117
|
+
type: GenerationType;
|
|
118
|
+
model: string;
|
|
119
|
+
prompt: string;
|
|
120
|
+
negativePrompt: string;
|
|
121
|
+
outputPath: string;
|
|
122
|
+
publishPackage: PublishPackage | null;
|
|
123
|
+
image: {
|
|
124
|
+
size: string;
|
|
125
|
+
quality: string;
|
|
126
|
+
count: number;
|
|
127
|
+
};
|
|
128
|
+
video: {
|
|
129
|
+
duration: string;
|
|
130
|
+
resolution: string;
|
|
131
|
+
aspectRatio: string;
|
|
132
|
+
referenceImageUrl: string;
|
|
133
|
+
};
|
|
134
|
+
speech: {
|
|
135
|
+
voice: string;
|
|
136
|
+
};
|
|
137
|
+
avatar: {
|
|
138
|
+
audioUrl: string;
|
|
139
|
+
imageUrl: string;
|
|
140
|
+
avatarId: string;
|
|
141
|
+
};
|
|
142
|
+
transcription: {
|
|
143
|
+
audioUrl: string;
|
|
144
|
+
language: string;
|
|
145
|
+
responseFormat: string;
|
|
146
|
+
temperature: string;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Build the request body object for a generation operation from provided fields */
|
|
150
|
+
export declare function buildGenerationRequestBody(fields: GenerationRequestFields): Record<string, unknown>;
|
|
151
|
+
/** Resolve the current status of a generation based on its metadata and result fields */
|
|
152
|
+
export declare function generationStatus(generation: Generation): GenerationStatus;
|
|
153
|
+
/** Resolve and return the first user-safe error message from generation metadata or null if none exist */
|
|
154
|
+
export declare function generationError(generation: Generation): string | null;
|
|
155
|
+
/** Resolve a unique merge key from a generation using batch slot or client request ID */
|
|
156
|
+
export declare function generationMergeKey(generation: Generation): string | null;
|
|
157
|
+
/** Merge a new generation into the current list by replacing or prepending it based on matching keys */
|
|
158
|
+
export declare function mergeLiveGeneration(current: Generation[], generation: Generation): Generation[];
|
|
159
|
+
/** Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs */
|
|
160
|
+
export declare function mergeLoaderAndLive(loader: Generation[], live: Generation[]): Generation[];
|
|
161
|
+
/** Determine if a generation ID indicates a local generation */
|
|
162
|
+
export declare function isLocalGeneration(generation: Generation): boolean;
|
|
163
|
+
/** Resolve and return the latest batch of generations grouped and sorted by client request ID and output index */
|
|
164
|
+
export declare function latestBatchOf(generations: Generation[]): Generation[];
|
|
165
|
+
/** Resolve a user-safe generation message by filtering sensitive or error-related content */
|
|
166
|
+
export declare function userSafeGenerationMessage(message?: string): string;
|
|
167
|
+
/** Generate content optimistically based on input parameters and optional model and output details */
|
|
168
|
+
export declare function optimisticGeneration({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: {
|
|
169
|
+
type: GenerationType;
|
|
170
|
+
prompt: string;
|
|
171
|
+
model?: string;
|
|
172
|
+
clientRequestId: string;
|
|
173
|
+
outputIndex?: number;
|
|
174
|
+
outputCount?: number;
|
|
175
|
+
}): Generation;
|
|
176
|
+
/** Mark a generation as failed with updated status and error information */
|
|
177
|
+
export declare function failedOptimisticGeneration(generation: Generation): Generation;
|
|
178
|
+
/** Normalize a value to a finite integer within the allowed image count range */
|
|
179
|
+
export declare function normalizeImageCount(value: unknown): number;
|
package/dist/studio/index.d.ts
CHANGED
|
@@ -1,181 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** Define the structure for a generation entity including its metadata and creation details */
|
|
14
|
-
interface Generation {
|
|
15
|
-
id: string;
|
|
16
|
-
type: string;
|
|
17
|
-
prompt: string;
|
|
18
|
-
result: string | null;
|
|
19
|
-
model: string | null;
|
|
20
|
-
cost: number | null;
|
|
21
|
-
createdAt: Date | null;
|
|
22
|
-
metadata: Record<string, unknown> | null;
|
|
23
|
-
}
|
|
24
|
-
/** Describe media model option properties including id, name, type, status, and optional provider and reason */
|
|
25
|
-
interface MediaModelOption {
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
provider?: string;
|
|
29
|
-
type: GenerationType;
|
|
30
|
-
status: MediaModelStatus;
|
|
31
|
-
reason?: string;
|
|
32
|
-
}
|
|
33
|
-
/** Represent media model catalog with default values, model options, and optional error message */
|
|
34
|
-
interface MediaModelCatalogResponse {
|
|
35
|
-
defaults: Record<GenerationType, string>;
|
|
36
|
-
models: Record<GenerationType, MediaModelOption[]>;
|
|
37
|
-
error?: string;
|
|
38
|
-
}
|
|
39
|
-
/** Define the structure for configuring package publishing details and evaluation criteria */
|
|
40
|
-
interface PublishPackage {
|
|
41
|
-
caption: string;
|
|
42
|
-
description: string;
|
|
43
|
-
mentions: string[];
|
|
44
|
-
destinations: string[];
|
|
45
|
-
cadence: string;
|
|
46
|
-
workflowDraft: boolean;
|
|
47
|
-
evalContract: {
|
|
48
|
-
artifactType: string;
|
|
49
|
-
deterministicChecks: string[];
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/** Define a destination for publishing content with identifiers, label, provider IDs, and fields */
|
|
53
|
-
interface PublishDestination {
|
|
54
|
-
id: string;
|
|
55
|
-
label: string;
|
|
56
|
-
providerIds: string[];
|
|
57
|
-
fields: string;
|
|
58
|
-
}
|
|
59
|
-
/** Provide an array of supported generation types for media and content processing */
|
|
60
|
-
declare const GENERATION_TYPES: readonly GenerationType[];
|
|
61
|
-
/** Resolve whether a string value matches a valid GenerationType */
|
|
62
|
-
declare function isGenerationType(value: string): value is GenerationType;
|
|
63
|
-
/** List available social media platforms with their publishing fields and provider identifiers */
|
|
64
|
-
declare const DESTINATIONS: PublishDestination[];
|
|
65
|
-
/** Provide an array of predefined cadence options for scheduling or approval processes */
|
|
66
|
-
declare const CADENCES: string[];
|
|
67
|
-
/** Provide the valid image quality values for generation requests */
|
|
68
|
-
declare const IMAGE_QUALITIES: readonly ["low", "medium", "high", "auto"];
|
|
69
|
-
/** Provide a placeholder hint listing the accepted image size values */
|
|
70
|
-
declare const IMAGE_SIZE_HINT = "1024x1024, 1536x1024, 1024x1536, or auto";
|
|
71
|
-
/** Provide a validation pattern for the free-form image size field (WxH or auto) */
|
|
72
|
-
declare const IMAGE_SIZE_PATTERN: string;
|
|
73
|
-
/** Provide the valid video duration values (seconds) for generation requests */
|
|
74
|
-
declare const VIDEO_DURATIONS: readonly ["4", "6", "8", "10", "12"];
|
|
75
|
-
/** Provide the valid video resolution values for generation requests */
|
|
76
|
-
declare const VIDEO_RESOLUTIONS: readonly ["720p", "1080p"];
|
|
77
|
-
/** Provide the valid video aspect ratio values for generation requests */
|
|
78
|
-
declare const VIDEO_ASPECT_RATIOS: readonly ["16:9", "9:16", "1:1"];
|
|
79
|
-
/** Define the minimum number of images required for processing or validation */
|
|
80
|
-
declare const MIN_IMAGE_COUNT = 1;
|
|
81
|
-
/** Define the maximum number of images allowed for upload or display */
|
|
82
|
-
declare const MAX_IMAGE_COUNT = 4;
|
|
83
|
-
/** Resolve a human-readable relative time string from a given date or return an empty string if null */
|
|
84
|
-
declare function relativeTime(date: Date | null): string;
|
|
85
|
-
/** Resolve the output directory path based on the specified generation type */
|
|
86
|
-
declare function outputPathFor(type: GenerationType): string;
|
|
87
|
-
/** Resolve the vault path string from a Generation object or return null if unavailable */
|
|
88
|
-
declare function generationVaultPath(generation: Generation): string | null;
|
|
89
|
-
/** Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs */
|
|
90
|
-
declare function buildPublishPackage({ caption, postDescription, mentions, cadence, destinations, }: {
|
|
91
|
-
caption: string;
|
|
92
|
-
postDescription: string;
|
|
93
|
-
mentions: string;
|
|
94
|
-
cadence: string;
|
|
95
|
-
destinations: string[];
|
|
96
|
-
}): PublishPackage | null;
|
|
97
|
-
/** Determine if a value conforms to the PublishPackage structure with optional metadata fields */
|
|
98
|
-
declare function isPublishPackage(value: unknown): value is {
|
|
99
|
-
caption?: string;
|
|
100
|
-
description?: string;
|
|
101
|
-
mentions?: string[];
|
|
102
|
-
destinations?: string[];
|
|
103
|
-
cadence?: string;
|
|
104
|
-
};
|
|
105
|
-
/** Determine if a destination has any active connections in the given list of studio integration connections */
|
|
106
|
-
declare function isDestinationConnected(destination: PublishDestination, connections: StudioIntegrationConnection[]): boolean;
|
|
107
|
-
/** Resolve selected models by applying defaults for missing or unavailable entries in the catalog */
|
|
108
|
-
declare function selectedModelsWithDefaults(current: Partial<Record<GenerationType, string>>, catalog: MediaModelCatalogResponse): Partial<Record<GenerationType, string>>;
|
|
109
|
-
/** Resolve the preferred model ID for a given generation type from the media model catalog */
|
|
110
|
-
declare function preferredModelId(type: GenerationType, catalog: MediaModelCatalogResponse | null): string | undefined;
|
|
111
|
-
/** Resolve the appropriate status message for a media model based on loading state and availability */
|
|
112
|
-
declare function modelMessage(model: MediaModelOption | undefined, loading: boolean, count: number): string | null;
|
|
113
|
-
/** Define fields required to configure and request various types of media generation */
|
|
114
|
-
interface GenerationRequestFields {
|
|
115
|
-
workspaceId: string;
|
|
116
|
-
clientRequestId: string;
|
|
117
|
-
type: GenerationType;
|
|
118
|
-
model: string;
|
|
119
|
-
prompt: string;
|
|
120
|
-
negativePrompt: string;
|
|
121
|
-
outputPath: string;
|
|
122
|
-
publishPackage: PublishPackage | null;
|
|
123
|
-
image: {
|
|
124
|
-
size: string;
|
|
125
|
-
quality: string;
|
|
126
|
-
count: number;
|
|
127
|
-
};
|
|
128
|
-
video: {
|
|
129
|
-
duration: string;
|
|
130
|
-
resolution: string;
|
|
131
|
-
aspectRatio: string;
|
|
132
|
-
referenceImageUrl: string;
|
|
133
|
-
};
|
|
134
|
-
speech: {
|
|
135
|
-
voice: string;
|
|
136
|
-
};
|
|
137
|
-
avatar: {
|
|
138
|
-
audioUrl: string;
|
|
139
|
-
imageUrl: string;
|
|
140
|
-
avatarId: string;
|
|
141
|
-
};
|
|
142
|
-
transcription: {
|
|
143
|
-
audioUrl: string;
|
|
144
|
-
language: string;
|
|
145
|
-
responseFormat: string;
|
|
146
|
-
temperature: string;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
/** Build the request body object for a generation operation from provided fields */
|
|
150
|
-
declare function buildGenerationRequestBody(fields: GenerationRequestFields): Record<string, unknown>;
|
|
151
|
-
/** Resolve the current status of a generation based on its metadata and result fields */
|
|
152
|
-
declare function generationStatus(generation: Generation): GenerationStatus;
|
|
153
|
-
/** Resolve and return the first user-safe error message from generation metadata or null if none exist */
|
|
154
|
-
declare function generationError(generation: Generation): string | null;
|
|
155
|
-
/** Resolve a unique merge key from a generation using batch slot or client request ID */
|
|
156
|
-
declare function generationMergeKey(generation: Generation): string | null;
|
|
157
|
-
/** Merge a new generation into the current list by replacing or prepending it based on matching keys */
|
|
158
|
-
declare function mergeLiveGeneration(current: Generation[], generation: Generation): Generation[];
|
|
159
|
-
/** Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs */
|
|
160
|
-
declare function mergeLoaderAndLive(loader: Generation[], live: Generation[]): Generation[];
|
|
161
|
-
/** Determine if a generation ID indicates a local generation */
|
|
162
|
-
declare function isLocalGeneration(generation: Generation): boolean;
|
|
163
|
-
/** Resolve and return the latest batch of generations grouped and sorted by client request ID and output index */
|
|
164
|
-
declare function latestBatchOf(generations: Generation[]): Generation[];
|
|
165
|
-
/** Resolve a user-safe generation message by filtering sensitive or error-related content */
|
|
166
|
-
declare function userSafeGenerationMessage(message?: string): string;
|
|
167
|
-
/** Generate content optimistically based on input parameters and optional model and output details */
|
|
168
|
-
declare function optimisticGeneration({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: {
|
|
169
|
-
type: GenerationType;
|
|
170
|
-
prompt: string;
|
|
171
|
-
model?: string;
|
|
172
|
-
clientRequestId: string;
|
|
173
|
-
outputIndex?: number;
|
|
174
|
-
outputCount?: number;
|
|
175
|
-
}): Generation;
|
|
176
|
-
/** Mark a generation as failed with updated status and error information */
|
|
177
|
-
declare function failedOptimisticGeneration(generation: Generation): Generation;
|
|
178
|
-
/** Normalize a value to a finite integer within the allowed image count range */
|
|
179
|
-
declare function normalizeImageCount(value: unknown): number;
|
|
180
|
-
|
|
181
|
-
export { CADENCES, DESTINATIONS, GENERATION_TYPES, type Generation, type GenerationRequestFields, type GenerationStatus, type GenerationType, IMAGE_QUALITIES, IMAGE_SIZE_HINT, IMAGE_SIZE_PATTERN, MAX_IMAGE_COUNT, MIN_IMAGE_COUNT, type MediaModelCatalogResponse, type MediaModelOption, type MediaModelStatus, type PublishDestination, type PublishPackage, type StudioIntegrationConnection, VIDEO_ASPECT_RATIOS, VIDEO_DURATIONS, VIDEO_RESOLUTIONS, buildGenerationRequestBody, buildPublishPackage, failedOptimisticGeneration, generationError, generationMergeKey, generationStatus, generationVaultPath, isDestinationConnected, isGenerationType, isLocalGeneration, isPublishPackage, latestBatchOf, mergeLiveGeneration, mergeLoaderAndLive, modelMessage, normalizeImageCount, optimisticGeneration, outputPathFor, preferredModelId, relativeTime, selectedModelsWithDefaults, userSafeGenerationMessage };
|
|
1
|
+
/**
|
|
2
|
+
* Studio module: the generation model and the pure helpers a media-generation
|
|
3
|
+
* surface needs — the `Generation` row shape and its lifecycle status/error
|
|
4
|
+
* derivation, the optimistic + live-merge logic that backs polling, the media
|
|
5
|
+
* model catalog types + selection helpers, the request-body builder, and the
|
|
6
|
+
* publish-package model.
|
|
7
|
+
*
|
|
8
|
+
* Logic only — no React, no DOM, no design-system import. Safe in server
|
|
9
|
+
* bundles. The React surface (composer, result canvas, library drawer, the
|
|
10
|
+
* `StudioWorkspace` shell) lives in `@tangle-network/agent-app/studio-react`.
|
|
11
|
+
*/
|
|
12
|
+
export * from './generation';
|