@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,849 +1,20 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { ToolDetailRenderers, ComposerFile, ChatUiMessage } from '../web-react/index.js';
|
|
4
|
-
import '@tangle-network/ui/types';
|
|
5
|
-
import '../contract-OxG_jVMx.js';
|
|
6
|
-
import '@tangle-network/agent-interface';
|
|
7
|
-
import '../plans/index.js';
|
|
8
|
-
import '../parts-BqIHMdyu.js';
|
|
9
|
-
import '../types-CCeYywdS.js';
|
|
10
|
-
import '../wire-DOZ-O6hD.js';
|
|
11
|
-
import '../agent-session-controls-CmlXwp_H.js';
|
|
12
|
-
import '../harness/index.js';
|
|
13
|
-
import '../catalog/index.js';
|
|
14
|
-
import '../agent-activity-C8ZG0F0M.js';
|
|
15
|
-
import '../flow-types-CJxEmaRy.js';
|
|
16
|
-
import '../queue-VTBA5ONX.js';
|
|
17
|
-
import '../web-react/terminal.js';
|
|
18
|
-
import '../billing-BuNlaKlE.js';
|
|
19
|
-
import '../billing/index.js';
|
|
20
|
-
import '../session-shell/index.js';
|
|
21
|
-
import '../web-react/async/index.js';
|
|
22
|
-
import '../attachment-validation-BfJDBU1g.js';
|
|
23
|
-
import '../stream-normalizer-DKRxyVlZ.js';
|
|
24
|
-
|
|
25
1
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
/** Describe the structure of data representing a thread event with optional model information */
|
|
47
|
-
interface ThreadEventData {
|
|
48
|
-
threadId: string;
|
|
49
|
-
turnId: string;
|
|
50
|
-
/** The model slug this turn ran against, when the server reports it. */
|
|
51
|
-
model?: string | null;
|
|
52
|
-
}
|
|
53
|
-
/** Define data structure representing a delta event with associated text content */
|
|
54
|
-
interface DeltaEventData {
|
|
55
|
-
text: string;
|
|
56
|
-
}
|
|
57
|
-
/** A chunk of the model's reasoning/thinking, streamed BEFORE the answer for
|
|
58
|
-
* reasoning models. Surfaced as a dim "thinking" block so a long reasoning gap
|
|
59
|
-
* doesn't read as a frozen panel. Absent for non-reasoning models. */
|
|
60
|
-
interface ReasoningEventData {
|
|
61
|
-
text: string;
|
|
62
|
-
}
|
|
63
|
-
/** Emitted when a read-only tool STARTS running, before its result. Lets the
|
|
64
|
-
* panel show live "running <tool>…" progress instead of a silent gap. */
|
|
65
|
-
interface ToolCallEventData {
|
|
66
|
-
callId: string;
|
|
67
|
-
name: string;
|
|
68
|
-
/** The parsed arguments the agent invoked the tool with. Lets a renderer show
|
|
69
|
-
* exactly what was called. Omitted by servers predating the field. */
|
|
70
|
-
args?: Record<string, unknown>;
|
|
71
|
-
}
|
|
72
|
-
/** Describe event data emitted after a tool execution completes with success or error details */
|
|
73
|
-
interface ToolResultEventData {
|
|
74
|
-
callId: string;
|
|
75
|
-
name: string;
|
|
76
|
-
ok: boolean;
|
|
77
|
-
output?: unknown;
|
|
78
|
-
error?: {
|
|
79
|
-
code: string;
|
|
80
|
-
message: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/** What kind of connection a requirement names — drives the card's label and
|
|
84
|
-
* connect target. "integration" is an OAuth/api-key connection on the
|
|
85
|
-
* integrations page; "github_app" is the GitHub App installed on the repo (the
|
|
86
|
-
* event source for a GitHub trigger), connected via the App install flow. */
|
|
87
|
-
type ConnectionRequirementKind = "integration" | "github_app";
|
|
88
|
-
/** Names one requirement in the same list, by its (provider, kind) identity. */
|
|
89
|
-
interface ConnectionRequirementRef {
|
|
90
|
-
provider: string;
|
|
91
|
-
kind: ConnectionRequirementKind;
|
|
92
|
-
}
|
|
93
|
-
/** A connection a proposed workflow references, and whether the user has it
|
|
94
|
-
* connected right now. Surfaced on an authoring proposal so the card can show
|
|
95
|
-
* what must be connected — and WHERE — before the workflow can be created. */
|
|
96
|
-
interface ConnectionRequirement {
|
|
97
|
-
provider: string;
|
|
98
|
-
connected: boolean;
|
|
99
|
-
/** What must be connected. Absent on proposals predating the field — treated
|
|
100
|
-
* as "integration" by the card. */
|
|
101
|
-
kind?: ConnectionRequirementKind;
|
|
102
|
-
/** Where the user connects this requirement, supplied by the server (the
|
|
103
|
-
* GitHub App install URL is deploy config the client can't derive). Null when
|
|
104
|
-
* there's no link to offer (e.g. a github_app requirement on a deploy with no
|
|
105
|
-
* app slug); the card then shows the requirement without a connect link. */
|
|
106
|
-
connectUrl?: string | null;
|
|
107
|
-
/**
|
|
108
|
-
* Another requirement in the SAME list that must be satisfied before this one
|
|
109
|
-
* can be, supplied by the server. A GitHub App installation is claimed
|
|
110
|
-
* through the user's own GitHub OAuth token, so the install is refused while
|
|
111
|
-
* that connection is missing — the card withholds a connect that could only
|
|
112
|
-
* end that way, and names the step that comes first instead.
|
|
113
|
-
*
|
|
114
|
-
* The server lists a prerequisite BEFORE the requirement naming it. Absent on
|
|
115
|
-
* proposals predating the field, and on a requirement nothing blocks.
|
|
116
|
-
*/
|
|
117
|
-
prerequisite?: ConnectionRequirementRef | null;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Outcome of a host-driven, in-place connect for a single proposal requirement
|
|
121
|
-
* (see {@link AssistantDockProps.onConnectRequirement}). The host owns the whole
|
|
122
|
-
* connect experience — an OAuth popup, an api-key entry modal, an app install,
|
|
123
|
-
* and any error surfacing — and the assistant stays agnostic to how it happens:
|
|
124
|
-
* the host reports back only whether the requirement is now satisfied, which the
|
|
125
|
-
* card uses to flip that requirement to connected without a reload. `connected:
|
|
126
|
-
* false` (a failed or cancelled connect) leaves the card unchanged so the user
|
|
127
|
-
* can retry.
|
|
128
|
-
*/
|
|
129
|
-
interface ConnectRequirementResult {
|
|
130
|
-
connected: boolean;
|
|
131
|
-
}
|
|
132
|
-
/** Describe the data structure for events proposing tool usage with optional integration requirements */
|
|
133
|
-
interface ToolProposalEventData {
|
|
134
|
-
/** Null only if the server has no proposal store wired (tools then unusable). */
|
|
135
|
-
proposalId: string | null;
|
|
136
|
-
callId: string;
|
|
137
|
-
name: string;
|
|
138
|
-
args: unknown;
|
|
139
|
-
/** Present on a workflow-authoring proposal: the integrations it references
|
|
140
|
-
* and their current connection status. Omitted for non-authoring tools. */
|
|
141
|
-
requirements?: ConnectionRequirement[];
|
|
142
|
-
}
|
|
143
|
-
/** Describe usage event data including tokens, cost, balance, duration, and replay status */
|
|
144
|
-
interface UsageEventData {
|
|
145
|
-
promptTokens: number | null;
|
|
146
|
-
completionTokens: number | null;
|
|
147
|
-
costUsd: number | null;
|
|
148
|
-
balanceUsd: number | null;
|
|
149
|
-
/** Wall-clock duration of the turn in milliseconds, when the server measures
|
|
150
|
-
* it. Drives the renderer's tokens/sec figure. Omitted by older servers. */
|
|
151
|
-
durationMs?: number | null;
|
|
152
|
-
/** True when a completed turn was replayed from storage (no charge). */
|
|
153
|
-
replayed?: boolean;
|
|
154
|
-
}
|
|
155
|
-
/** Describe the data emitted when a process turn completes including status and optional flags */
|
|
156
|
-
interface DoneEventData {
|
|
157
|
-
turnId: string;
|
|
158
|
-
status: string;
|
|
159
|
-
/** True when a mutating tool was proposed and is awaiting confirmation. */
|
|
160
|
-
proposed?: boolean;
|
|
161
|
-
/** True when the agentic loop hit its tool-round cap. */
|
|
162
|
-
capped?: boolean;
|
|
163
|
-
}
|
|
164
|
-
/** Describe error event data including code and message fields */
|
|
165
|
-
interface ErrorEventData {
|
|
166
|
-
code: string;
|
|
167
|
-
message: string;
|
|
168
|
-
}
|
|
169
|
-
/** Discriminated union the stream reader hands to the reducer. */
|
|
170
|
-
type AssistantStreamEvent = {
|
|
171
|
-
type: "thread";
|
|
172
|
-
data: ThreadEventData;
|
|
173
|
-
} | {
|
|
174
|
-
type: "delta";
|
|
175
|
-
data: DeltaEventData;
|
|
176
|
-
} | {
|
|
177
|
-
type: "reasoning";
|
|
178
|
-
data: ReasoningEventData;
|
|
179
|
-
} | {
|
|
180
|
-
type: "tool_call";
|
|
181
|
-
data: ToolCallEventData;
|
|
182
|
-
} | {
|
|
183
|
-
type: "tool_result";
|
|
184
|
-
data: ToolResultEventData;
|
|
185
|
-
} | {
|
|
186
|
-
type: "tool_proposal";
|
|
187
|
-
data: ToolProposalEventData;
|
|
188
|
-
} | {
|
|
189
|
-
type: "usage";
|
|
190
|
-
data: UsageEventData;
|
|
191
|
-
} | {
|
|
192
|
-
type: "done";
|
|
193
|
-
data: DoneEventData;
|
|
194
|
-
} | {
|
|
195
|
-
type: "error";
|
|
196
|
-
data: ErrorEventData;
|
|
197
|
-
};
|
|
198
|
-
/** A `tool` message is the inline activity chip for a read-only tool the agent
|
|
199
|
-
* ran during a turn (e.g. "Validating workflow… ✓"). */
|
|
200
|
-
type ChatRole = "user" | "assistant" | "status" | "tool";
|
|
201
|
-
/** Live status of a tool-activity chip. */
|
|
202
|
-
type ToolActivityStatus = "running" | "ok" | "failed";
|
|
203
|
-
/** The outcome of a finished read-only tool, retained on the chip so a renderer
|
|
204
|
-
* can show the result body (not just the name + status). Mirrors the
|
|
205
|
-
* `tool_result` event: a success carries the tool's `result`; a failure carries
|
|
206
|
-
* the error. Absent while the tool is still running. */
|
|
207
|
-
type ToolOutcome = {
|
|
208
|
-
ok: true;
|
|
209
|
-
result?: unknown;
|
|
210
|
-
} | {
|
|
211
|
-
ok: false;
|
|
212
|
-
error?: {
|
|
213
|
-
code: string;
|
|
214
|
-
message: string;
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* The result of a CONFIRMED mutating tool, retained on the resolving `status`
|
|
219
|
-
* message so a host can render it prominently (e.g. a one-time API-key reveal).
|
|
220
|
-
*
|
|
221
|
-
* SECURITY: `output` may carry a one-time secret (e.g. a freshly minted API
|
|
222
|
-
* key). It lives ONLY in the in-memory transcript for the session — the message
|
|
223
|
-
* transcript is deliberately never cached (see `persistence.ts`) and is never
|
|
224
|
-
* sent back to the model (a turn request carries only the new user text, see
|
|
225
|
-
* {@link ChatRequest}). So the secret is shown once and is gone on reload,
|
|
226
|
-
* matching how a dedicated create-key page reveals a key exactly once. A host
|
|
227
|
-
* renderer must uphold the same contract: reveal-on-demand, never persist it.
|
|
228
|
-
*/
|
|
229
|
-
interface ConfirmedResult {
|
|
230
|
-
/** The confirmed tool's name (e.g. "create_api_key"). */
|
|
231
|
-
name: string;
|
|
232
|
-
/** The tool's raw output. May contain a one-time secret — see the type doc. */
|
|
233
|
-
output: unknown;
|
|
234
|
-
/** The arguments the action was confirmed with, for a renderer that needs them
|
|
235
|
-
* (e.g. the key's name). */
|
|
236
|
-
args?: unknown;
|
|
237
|
-
}
|
|
238
|
-
/** Define the structure and properties of a chat message including optional tool activity details */
|
|
239
|
-
interface ChatMessage {
|
|
240
|
-
id: string;
|
|
241
|
-
role: ChatRole;
|
|
242
|
-
text: string;
|
|
243
|
-
/** Present only on `tool` messages — the activity's tool name, the arguments it
|
|
244
|
-
* was called with, its state, and (once finished) its outcome. */
|
|
245
|
-
tool?: {
|
|
246
|
-
name: string;
|
|
247
|
-
status: ToolActivityStatus;
|
|
248
|
-
args?: Record<string, unknown>;
|
|
249
|
-
outcome?: ToolOutcome;
|
|
250
|
-
};
|
|
251
|
-
/** Present only on a `status` message that resolved a confirmed mutating tool
|
|
252
|
-
* which returned a renderable result — carries that result so the transcript
|
|
253
|
-
* can render a host-supplied card (e.g. a one-time key reveal) next to the
|
|
254
|
-
* status line. See {@link ConfirmedResult} for the one-time-secret contract. */
|
|
255
|
-
result?: ConfirmedResult;
|
|
256
|
-
}
|
|
257
|
-
/** A mutating action the assistant proposed, awaiting the user's confirmation. */
|
|
258
|
-
interface PendingProposal {
|
|
259
|
-
proposalId: string | null;
|
|
260
|
-
callId: string;
|
|
261
|
-
name: string;
|
|
262
|
-
args: unknown;
|
|
263
|
-
/** Integration requirements for a workflow-authoring proposal (each provider
|
|
264
|
-
* + whether it's connected); omitted for non-authoring proposals. */
|
|
265
|
-
requirements?: ConnectionRequirement[];
|
|
266
|
-
/** Inline error shown ON the card after a RETRYABLE confirm failure (an
|
|
267
|
-
* unconnected integration): the card stays so the user can connect and
|
|
268
|
-
* confirm again. Null/absent when the card has not failed a retry. */
|
|
269
|
-
retryError?: string | null;
|
|
270
|
-
}
|
|
271
|
-
/** Describe usage cost, balance, token counts, duration, and replay status for a settled turn */
|
|
272
|
-
interface UsageInfo {
|
|
273
|
-
costUsd: number | null;
|
|
274
|
-
balanceUsd: number | null;
|
|
275
|
-
/** Token counts + wall-clock duration for the settled turn, when the server
|
|
276
|
-
* reports them — drive per-message tokens/sec + cost in a renderer. Optional
|
|
277
|
-
* so a consumer constructing this on the prior `{ costUsd, balanceUsd,
|
|
278
|
-
* replayed }` shape stays valid; a renderer treats a missing value as null. */
|
|
279
|
-
promptTokens?: number | null;
|
|
280
|
-
completionTokens?: number | null;
|
|
281
|
-
durationMs?: number | null;
|
|
282
|
-
replayed: boolean;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* The transcript slice handed to a host-supplied `renderTranscript` (see
|
|
286
|
-
* {@link AssistantPanelProps}). It lets a host swap ONLY the conversation
|
|
287
|
-
* rendering — to use its own message renderer — while the panel keeps owning the
|
|
288
|
-
* dock chrome, composer, model picker, history, transport, and proposal
|
|
289
|
-
* orchestration. The bound `renderProposal` returns the panel's own proposal
|
|
290
|
-
* card so the host can place it (e.g. inline after the proposing turn) without
|
|
291
|
-
* re-implementing the confirm/cancel flow.
|
|
292
|
-
*/
|
|
293
|
-
interface AssistantTranscriptView {
|
|
294
|
-
messages: ChatMessage[];
|
|
295
|
-
/** The current turn's reasoning/thinking text, if any (streamed before the
|
|
296
|
-
* answer for reasoning models). */
|
|
297
|
-
reasoning: string | null;
|
|
298
|
-
/** Id of the assistant message currently accumulating deltas, if any. */
|
|
299
|
-
streamingId: string | null;
|
|
300
|
-
/** Model slug the current/most-recent turn ran against, or null. */
|
|
301
|
-
model: string | null;
|
|
302
|
-
/** True while a turn is streaming. */
|
|
303
|
-
isStreaming: boolean;
|
|
304
|
-
/** True while the agent is working but has produced no visible output yet
|
|
305
|
-
* (drives a "thinking" affordance). */
|
|
306
|
-
isThinking: boolean;
|
|
307
|
-
pendingProposals: PendingProposal[];
|
|
308
|
-
/** Cost/tokens/duration for the most recently settled turn, or null before any
|
|
309
|
-
* turn settles. Optional so a host predating the field stays a valid consumer;
|
|
310
|
-
* a renderer treats a missing value the same as null. */
|
|
311
|
-
usage?: UsageInfo | null;
|
|
312
|
-
/** The panel's bound proposal card for a pending proposal — render it where the
|
|
313
|
-
* confirm/cancel UI should appear. */
|
|
314
|
-
renderProposal: (proposal: PendingProposal) => ReactNode;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Configurable network client for the assistant panel: the chat SSE stream, the
|
|
319
|
-
* model/thread/history reads, and the proposal-confirmation call.
|
|
320
|
-
*
|
|
321
|
-
* The transport is injected via {@link AssistantClientConfig} so the same UI can
|
|
322
|
-
* run in different hosts: a same-origin app authenticates with the session
|
|
323
|
-
* cookie (`credentials: "include"`) and an `X-Requested-With` marker, while a
|
|
324
|
-
* cross-origin host points `baseUrl` at the API and supplies a bearer token via
|
|
325
|
-
* `headers`. The request shapes and the defensive wire parsing are identical
|
|
326
|
-
* across hosts — only the base URL and the auth headers vary.
|
|
327
|
-
*/
|
|
328
|
-
|
|
329
|
-
/** Host-supplied transport configuration for {@link createAssistantClient}. */
|
|
330
|
-
interface AssistantClientConfig {
|
|
331
|
-
/**
|
|
332
|
-
* Base URL the five assistant endpoints hang off, with no trailing slash —
|
|
333
|
-
* e.g. `"/api/v1/assistant"` for a same-origin SSR edge, or
|
|
334
|
-
* `"https://id.tangle.tools/api/v1/assistant"` cross-origin. Each method
|
|
335
|
-
* appends its own path (`/chat`, `/models`, `/threads`, …).
|
|
336
|
-
*/
|
|
337
|
-
baseUrl: string;
|
|
338
|
-
/**
|
|
339
|
-
* `fetch` credentials mode. Defaults to `"include"` so a same-origin cookie
|
|
340
|
-
* session authenticates; a token-based cross-origin host may pass `"omit"`
|
|
341
|
-
* and carry the credential in {@link AssistantClientConfig.headers}.
|
|
342
|
-
*/
|
|
343
|
-
credentials?: RequestCredentials;
|
|
344
|
-
/**
|
|
345
|
-
* Headers applied to every request — the auth token and/or the CSRF marker.
|
|
346
|
-
* Called per request so a rotating token is read fresh, never captured once.
|
|
347
|
-
*/
|
|
348
|
-
headers?: () => Record<string, string>;
|
|
349
|
-
}
|
|
350
|
-
/** Define options for an assistant model including identifier, label, pricing, and context tokens */
|
|
351
|
-
interface AssistantModelOption {
|
|
352
|
-
slug: string;
|
|
353
|
-
label: string;
|
|
354
|
-
/** USD per million prompt tokens, when the catalog carries pricing. */
|
|
355
|
-
promptUsdPerMillion?: number;
|
|
356
|
-
/** Context window in tokens, when known. */
|
|
357
|
-
contextTokens?: number;
|
|
358
|
-
}
|
|
359
|
-
/** Define the structure for assistant model options including a default model slug and available models */
|
|
360
|
-
interface AssistantModels {
|
|
361
|
-
/** The slug the server uses when a turn selects no model. */
|
|
362
|
-
default: string | null;
|
|
363
|
-
models: AssistantModelOption[];
|
|
364
|
-
}
|
|
365
|
-
/** One past conversation in the history switcher. */
|
|
366
|
-
interface AssistantThreadSummary {
|
|
367
|
-
id: string;
|
|
368
|
-
/** Truncated first user message; may be null for an untitled thread. */
|
|
369
|
-
title: string | null;
|
|
370
|
-
createdAt: string;
|
|
371
|
-
updatedAt: string;
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Outcome of a model-list fetch. `ok` drives caching: the caller caches on `ok`
|
|
375
|
-
* and retries on `!ok`. An EMPTY list is reported as `!ok` — the server always
|
|
376
|
-
* offers at least the default model when the router is reachable, so an empty
|
|
377
|
-
* menu means the catalog couldn't be loaded and should be retried, not cached
|
|
378
|
-
* for the whole session.
|
|
379
|
-
*/
|
|
380
|
-
interface AssistantModelsResult {
|
|
381
|
-
ok: boolean;
|
|
382
|
-
data: AssistantModels;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Outcome of a thread-history restore. The three cases drive different recovery:
|
|
386
|
-
* `ok` rehydrates the transcript; `gone` (the thread 404s — deleted or from a
|
|
387
|
-
* reset DB) tells the caller to drop the dead thread id so the next turn starts
|
|
388
|
-
* fresh; `error` (transient/network/aborted) keeps the thread id and simply
|
|
389
|
-
* doesn't restore, so a later attempt or send still targets the live thread.
|
|
390
|
-
*/
|
|
391
|
-
type ThreadHistoryResult = {
|
|
392
|
-
status: "ok";
|
|
393
|
-
messages: ChatMessage[];
|
|
394
|
-
proposals: PendingProposal[];
|
|
395
|
-
} | {
|
|
396
|
-
status: "gone";
|
|
397
|
-
} | {
|
|
398
|
-
status: "error";
|
|
399
|
-
};
|
|
400
|
-
/** Represent the outcome of a confirmation process with success or failure details */
|
|
401
|
-
type ConfirmResult = {
|
|
402
|
-
ok: true;
|
|
403
|
-
output: unknown;
|
|
404
|
-
retryable?: boolean;
|
|
405
|
-
} | {
|
|
406
|
-
ok: false;
|
|
407
|
-
error: string;
|
|
408
|
-
};
|
|
409
|
-
/** Represent invalid client input errors with a specific code INVALID_REQUEST */
|
|
410
|
-
declare class AssistantClientInputError extends Error {
|
|
411
|
-
readonly code = "INVALID_REQUEST";
|
|
412
|
-
}
|
|
413
|
-
/** The assistant network surface, bound to one host's transport config. */
|
|
414
|
-
interface AssistantClient {
|
|
415
|
-
fetchModels(signal?: AbortSignal): Promise<AssistantModelsResult>;
|
|
416
|
-
fetchThreads(signal?: AbortSignal): Promise<AssistantThreadSummary[] | null>;
|
|
417
|
-
fetchThreadHistory(threadId: string, signal?: AbortSignal): Promise<ThreadHistoryResult>;
|
|
418
|
-
streamChat(req: ChatRequest, onEvent: (event: AssistantStreamEvent) => void, signal: AbortSignal): Promise<void>;
|
|
419
|
-
confirmProposal(proposalId: string): Promise<ConfirmResult>;
|
|
420
|
-
/** Delete a thread and its server-side turns/proposals. Resolves `{ ok }`; a
|
|
421
|
-
* 404 (already gone) is treated as success so a double-delete is harmless.
|
|
422
|
-
* Optional so a host with no delete endpoint stays a valid client — the panel
|
|
423
|
-
* hides the delete affordance when it's absent (see `useAssistantThreads`). */
|
|
424
|
-
deleteThread?(threadId: string): Promise<{
|
|
425
|
-
ok: boolean;
|
|
426
|
-
}>;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* Build an assistant client bound to one host's transport. The returned methods
|
|
430
|
-
* carry no module state, so a host may create one client per config (or share a
|
|
431
|
-
* single same-origin client for the whole app).
|
|
432
|
-
*/
|
|
433
|
-
declare function createAssistantClient(config: AssistantClientConfig): AssistantClient;
|
|
434
|
-
|
|
435
|
-
declare function AssistantClientProvider({ client, children, }: {
|
|
436
|
-
client: AssistantClient;
|
|
437
|
-
children: ReactNode;
|
|
438
|
-
}): react.JSX.Element;
|
|
439
|
-
/**
|
|
440
|
-
* The assistant client for the current host. Throws when no provider is mounted
|
|
441
|
-
* rather than silently falling back to a default transport — a missing provider
|
|
442
|
-
* is a wiring bug, and a hidden default would mask it (and could target the
|
|
443
|
-
* wrong origin).
|
|
444
|
-
*/
|
|
445
|
-
declare function useAssistantClient(): AssistantClient;
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Pure state machine driving the assistant panel. Every UI transition — a user
|
|
449
|
-
* message, each streamed SSE event, a stream failure, a confirmed/cancelled
|
|
450
|
-
* proposal, a manual stop — is modeled as an action here, so the panel's
|
|
451
|
-
* behavior can be verified without a DOM or a live stream.
|
|
452
|
-
*/
|
|
453
|
-
|
|
454
|
-
type ChatStatus = "idle" | "streaming" | "awaiting_confirm";
|
|
455
|
-
interface AssistantState {
|
|
456
|
-
/** The signed-in user this conversation belongs to. Carried in state so it
|
|
457
|
-
* moves atomically with the data it labels — persistence keys off it, and a
|
|
458
|
-
* render whose owner doesn't match the current user is masked (see
|
|
459
|
-
* `selectVisibleState`), preventing a one-frame cross-account leak. */
|
|
460
|
-
ownerId: string | null;
|
|
461
|
-
/** Persisted across reloads to continue the same server-side thread. */
|
|
462
|
-
threadId: string | null;
|
|
463
|
-
messages: ChatMessage[];
|
|
464
|
-
status: ChatStatus;
|
|
465
|
-
/** Id of the assistant message currently accumulating deltas, if any. Set to
|
|
466
|
-
* null mid-turn when a tool runs, so the next text delta opens a fresh
|
|
467
|
-
* assistant bubble — keeping each reasoning segment visually distinct. */
|
|
468
|
-
streamingId: string | null;
|
|
469
|
-
/** Base id for the current turn's assistant bubbles (the `send` assistant id).
|
|
470
|
-
* Post-tool segments derive a unique id from it; null between turns. */
|
|
471
|
-
streamBaseId: string | null;
|
|
472
|
-
/** How many assistant bubbles the current turn has opened (0 = just the first).
|
|
473
|
-
* Drives the per-segment bubble id so segments never collide across turns. */
|
|
474
|
-
segmentSeq: number;
|
|
475
|
-
pendingProposals: PendingProposal[];
|
|
476
|
-
/** Cost/balance from the most recently settled turn. */
|
|
477
|
-
usage: UsageInfo | null;
|
|
478
|
-
/** Model slug the current/most-recent turn ran against (from the thread
|
|
479
|
-
* event), or null before any turn this session. */
|
|
480
|
-
model: string | null;
|
|
481
|
-
/** The current turn's accumulated reasoning/thinking text (reasoning models
|
|
482
|
-
* stream this before the answer). Shown dim while the answer is still pending;
|
|
483
|
-
* reset at the start of each turn. Null when the model emits no reasoning. */
|
|
484
|
-
reasoning: string | null;
|
|
485
|
-
error: {
|
|
486
|
-
code: string;
|
|
487
|
-
message: string;
|
|
488
|
-
} | null;
|
|
489
|
-
/** True when the most-recent turn stopped at the per-turn step limit before the
|
|
490
|
-
* model finished (a partial reply). Drives the one-click "Continue" affordance;
|
|
491
|
-
* cleared when the next turn starts. */
|
|
492
|
-
capped: boolean;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* React binding for the assistant panel: owns the reducer, drives the chat SSE
|
|
497
|
-
* stream and the proposal-confirmation call, and persists the thread across
|
|
498
|
-
* reloads. All rendering decisions live in the pure reducer + presentation
|
|
499
|
-
* helpers; this hook is the glue between them and the network.
|
|
500
|
-
*/
|
|
501
|
-
|
|
502
|
-
/** Define options for configuring how the assistant sends messages */
|
|
503
|
-
interface AssistantSendOptions {
|
|
504
|
-
deliveryMode?: AssistantDeliveryMode;
|
|
505
|
-
}
|
|
506
|
-
/** Host integration callbacks for {@link useAssistantChat}. */
|
|
507
|
-
interface UseAssistantChatOptions {
|
|
508
|
-
/**
|
|
509
|
-
* Called after a workflow-mutating tool (`create_workflow`, `author_workflow`,
|
|
510
|
-
* …) is confirmed successfully — the host re-fetches its workflow list so the
|
|
511
|
-
* result appears without a manual reload. Replaces the in-app cross-module
|
|
512
|
-
* signal the platform used.
|
|
513
|
-
*/
|
|
514
|
-
onWorkflowMutation?: () => void;
|
|
515
|
-
/**
|
|
516
|
-
* Called when the user activates a proposal requirement's connect affordance.
|
|
517
|
-
* The host runs whatever connect flow it owns — an OAuth popup, an api-key
|
|
518
|
-
* modal, an app install — and resolves whether the requirement is now
|
|
519
|
-
* satisfied; the card then flips that requirement to connected. Host-agnostic:
|
|
520
|
-
* the assistant never learns how the connection is made, so any host (platform,
|
|
521
|
-
* sandbox, intelligence, …) can supply its own. When omitted, the card falls
|
|
522
|
-
* back to navigating the requirement's connect target (see
|
|
523
|
-
* {@link ProposalCardProps.navigate}).
|
|
524
|
-
*/
|
|
525
|
-
onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
|
|
526
|
-
}
|
|
527
|
-
/** Define the structure and behavior of an assistant chat session with state, model selection, and message handling */
|
|
528
|
-
interface AssistantChat {
|
|
529
|
-
state: AssistantState;
|
|
530
|
-
/** Proposal ids whose confirmation is currently in flight (for disabling). */
|
|
531
|
-
confirmingIds: ReadonlySet<string>;
|
|
532
|
-
/** The user's selected model slug, or null to use the server default. */
|
|
533
|
-
selectedModel: string | null;
|
|
534
|
-
/** Choose the model for subsequent turns (persisted per user). */
|
|
535
|
-
setModel: (model: string | null) => void;
|
|
536
|
-
send: (message: string, options?: AssistantSendOptions) => void;
|
|
537
|
-
stop: () => void;
|
|
538
|
-
confirm: (proposal: PendingProposal) => Promise<void>;
|
|
539
|
-
cancel: (proposal: PendingProposal) => void;
|
|
540
|
-
/** True when the host supplied an in-place connect handler
|
|
541
|
-
* ({@link UseAssistantChatOptions.onConnectRequirement}); the proposal card
|
|
542
|
-
* uses this to offer in-place connect instead of navigating away. */
|
|
543
|
-
canConnectRequirement: boolean;
|
|
544
|
-
/** Run the host's in-place connect for one of a proposal's requirements and,
|
|
545
|
-
* on success, flip that requirement to connected on the card. Resolves (a
|
|
546
|
-
* no-op) when no host handler is set or the connect didn't complete. */
|
|
547
|
-
connectRequirement: (proposal: PendingProposal, requirement: ConnectionRequirement) => Promise<void>;
|
|
548
|
-
reset: () => void;
|
|
549
|
-
/** Open an existing thread from history, loading its transcript. */
|
|
550
|
-
switchThread: (threadId: string) => void;
|
|
551
|
-
/** True while a switched-to thread's transcript is loading — the composer is
|
|
552
|
-
* held closed until it resolves so a turn can't run against hidden context. */
|
|
553
|
-
restoring: boolean;
|
|
554
|
-
}
|
|
555
|
-
/** Manage assistant chat state and interactions for a given user ID with optional configurations */
|
|
556
|
-
declare function useAssistantChat(userId: string | null, options?: UseAssistantChatOptions): AssistantChat;
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* The assistant's selectable models for the composer's picker. The list is
|
|
560
|
-
* deployment config (not per-user), so it is fetched once per transport and
|
|
561
|
-
* shared across panel mounts via a cache keyed by the `AssistantClient`.
|
|
562
|
-
*
|
|
563
|
-
* The cache has no TTL: it lives for the page session and is revalidated by a
|
|
564
|
-
* page refresh — acceptable for deployment-config data that changes only on a
|
|
565
|
-
* redeploy. An empty/failed fetch is NOT cached, so it retries on the next mount.
|
|
566
|
-
*
|
|
567
|
-
* Keyed by client so a host that swaps the transport (a tenant/origin/account
|
|
568
|
-
* change) never serves the previous client's catalog or skips the fetch for the
|
|
569
|
-
* new one. A WeakMap lets a discarded client's bucket be collected with it.
|
|
570
|
-
*
|
|
571
|
-
* Client-only by design (a `createRoot` SPA, no React SSR), so the cache lives
|
|
572
|
-
* in one browser tab and is never shared across server requests. Under Strict
|
|
573
|
-
* Mode's double-mount the two effect runs share the one in-flight fetch; the
|
|
574
|
-
* first run's `active = false` makes its callback a no-op, the second commits —
|
|
575
|
-
* dedup holds, no torn state.
|
|
576
|
-
*/
|
|
577
|
-
|
|
578
|
-
/** Resolve and return the current assistant models from the per-client cache with immediate client swap updates */
|
|
579
|
-
declare function useAssistantModels(): AssistantModels;
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* The user's recent assistant chat threads for the history switcher. Unlike the
|
|
583
|
-
* model list (deployment config, fetched once), the thread list changes as the
|
|
584
|
-
* user chats, so it is fetched ON DEMAND — call `refresh()` to (re)load it; the
|
|
585
|
-
* panel does so when the history view opens and after a turn settles a new
|
|
586
|
-
* thread into being. It does NOT fetch on mount, so `threads` stays empty and
|
|
587
|
-
* `loaded` false until the first `refresh()`.
|
|
588
|
-
*
|
|
589
|
-
* Self-protective across account AND transport swaps. The list is tagged with the
|
|
590
|
-
* (user, client) it belongs to and is masked to empty on the SAME commit if that
|
|
591
|
-
* no longer matches the current props — so a swap never shows the prior scope's
|
|
592
|
-
* threads for even one frame. In flight, a late result is dropped if either the
|
|
593
|
-
* user or the client changed, and the request is aborted on the swap.
|
|
594
|
-
*
|
|
595
|
-
* A FAILED load is reported, not swallowed. `fetchThreads` answers a non-ok
|
|
596
|
-
* response, an unusable body or a thrown request with `null`; that used to end
|
|
597
|
-
* as `loaded: true` over an empty list, which renders identically to a user who
|
|
598
|
-
* has never chatted. `error` carries the reason so the history view can offer
|
|
599
|
-
* the retry instead — the `web-react/async` rule (a failed fetch cannot render
|
|
600
|
-
* as empty data) applied to this hook's own transport.
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
|
-
/** Manage and interact with a list of assistant threads including loading, refreshing, and removing threads */
|
|
604
|
-
interface AssistantThreads {
|
|
605
|
-
threads: AssistantThreadSummary[];
|
|
606
|
-
loading: boolean;
|
|
607
|
-
/** True once a fetch has settled at least once (drives empty-vs-loading copy). */
|
|
608
|
-
loaded: boolean;
|
|
609
|
-
/** Why the last load failed, or null. Non-null means the list on hand is stale
|
|
610
|
-
* or empty because the request FAILED — never because there is nothing to
|
|
611
|
-
* show. Cleared by the next successful load. */
|
|
612
|
-
error: string | null;
|
|
613
|
-
/** Load (or reload) the thread list. Must be called to populate `threads` —
|
|
614
|
-
* the hook never fetches on mount (the panel calls this when history opens). */
|
|
615
|
-
refresh: () => void;
|
|
616
|
-
/** Delete a thread. Optimistically drops it from the list (within the current
|
|
617
|
-
* owner scope); on failure the list is reloaded to restore the true state. A
|
|
618
|
-
* no-op resolving `{ ok: false }` when the client has no `deleteThread`. */
|
|
619
|
-
remove: (threadId: string) => Promise<{
|
|
620
|
-
ok: boolean;
|
|
621
|
-
}>;
|
|
622
|
-
/** Whether the configured client supports deletion — drives whether a host
|
|
623
|
-
* shows the delete affordance. */
|
|
624
|
-
canRemove: boolean;
|
|
625
|
-
}
|
|
626
|
-
/** Resolve and manage assistant threads state for a given user including pending deletions and refresh logic */
|
|
627
|
-
declare function useAssistantThreads(userId: string | null): AssistantThreads;
|
|
628
|
-
|
|
629
|
-
interface AssistantPanelProps {
|
|
630
|
-
chat: AssistantChat;
|
|
631
|
-
userId: string | null;
|
|
632
|
-
onClose: () => void;
|
|
633
|
-
/** Host navigation for error CTAs and connect targets. */
|
|
634
|
-
navigate?: (path: string) => void;
|
|
635
|
-
/** The user's credit balance, for the header tile + low-balance nudge. */
|
|
636
|
-
balanceUsd?: number | null;
|
|
637
|
-
/** Format a USD amount; defaults to Intl currency formatting. */
|
|
638
|
-
formatMoney?: (usd: number | null) => string;
|
|
639
|
-
/** Render workflow YAML as a node graph in a proposal card (the `./workflows`
|
|
640
|
-
* WorkflowGraph). When absent, proposals show YAML as text. */
|
|
641
|
-
renderGraph?: (yaml: string) => ReactNode;
|
|
642
|
-
/** Render the brand icon for a proposal requirement's integration provider.
|
|
643
|
-
* When absent, the card falls back to its built-in provider mark. */
|
|
644
|
-
renderProviderIcon?: (provider: string) => ReactNode;
|
|
645
|
-
/** Markdown renderer for assistant message content. When absent, content
|
|
646
|
-
* renders as plain pre-wrapped text. */
|
|
647
|
-
renderMarkdown?: (content: string) => ReactNode;
|
|
648
|
-
/** Per-tool custom detail renderers for expanded tool cards in the transcript. */
|
|
649
|
-
toolRenderers?: ToolDetailRenderers;
|
|
650
|
-
/** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
|
|
651
|
-
* API-key reveal for `create_api_key`), shown inline after the action's status
|
|
652
|
-
* line. Ignored when a host swaps the whole transcript via `renderTranscript`. */
|
|
653
|
-
renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
|
|
654
|
-
/** Swap ONLY the conversation rendering for a host-supplied renderer (e.g. a
|
|
655
|
-
* different chat-message component), while the panel keeps owning the header,
|
|
656
|
-
* composer, model picker, history, transport, and proposal orchestration.
|
|
657
|
-
* Receives the transcript slice plus a bound proposal card to place. When
|
|
658
|
-
* absent, the built-in transcript (web-react `ChatMessages`) renders the
|
|
659
|
-
* conversation. */
|
|
660
|
-
renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
|
|
661
|
-
/** One-shot composer prefill from the host's launcher (e.g. a page's "Create
|
|
662
|
-
* with assistant" button passing `openAssistant(seed)`). The panel adopts it
|
|
663
|
-
* as the composer draft and calls `onComposerSeedApplied` once, so the host
|
|
664
|
-
* clears its seed state (consume-once). */
|
|
665
|
-
composerSeed?: string | null;
|
|
666
|
-
onComposerSeedApplied?: () => void;
|
|
667
|
-
/** Opt-in attachment surface for the composer, mirroring `ChatComposer`'s
|
|
668
|
-
* attachment props: pass `onAttach` to show the attach button and accept
|
|
669
|
-
* drag-and-drop, and drive the staged-file chips with `pendingFiles` /
|
|
670
|
-
* `onRemoveFile` (web-react's `useComposerAttachments` owns that lifecycle).
|
|
671
|
-
* Omitted, the composer stays text-only. The assistant wire carries text
|
|
672
|
-
* only, so a host that stages files owns getting their content to the model
|
|
673
|
-
* (e.g. inlined on the next `chat.send`); `onComposerSend` is the signal to
|
|
674
|
-
* consume and clear the staged set. */
|
|
675
|
-
composerAttachments?: {
|
|
676
|
-
onAttach: (files: FileList) => void;
|
|
677
|
-
onAttachFolder?: (files: FileList) => void;
|
|
678
|
-
pendingFiles?: ComposerFile[];
|
|
679
|
-
onRemoveFile?: (id: string) => void;
|
|
680
|
-
accept?: string;
|
|
681
|
-
};
|
|
682
|
-
/** Fired when the composer sends (alongside `chat.send`) — the host's signal
|
|
683
|
-
* to consume and clear its staged attachments. */
|
|
684
|
-
onComposerSend?: (message: string) => void;
|
|
685
|
-
}
|
|
686
|
-
declare function AssistantPanel({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerSeed, onComposerSeedApplied, composerAttachments, onComposerSend, }: AssistantPanelProps): react.JSX.Element;
|
|
687
|
-
|
|
688
|
-
interface AssistantDockProps {
|
|
689
|
-
/** The signed-in user this conversation belongs to (null when signed out). */
|
|
690
|
-
userId: string | null;
|
|
691
|
-
/** Host navigation for error CTAs and connect targets. */
|
|
692
|
-
navigate?: (path: string) => void;
|
|
693
|
-
balanceUsd?: number | null;
|
|
694
|
-
formatMoney?: (usd: number | null) => string;
|
|
695
|
-
/** Render workflow YAML as a node graph in a proposal card. */
|
|
696
|
-
renderGraph?: (yaml: string) => ReactNode;
|
|
697
|
-
/** Render the brand icon for a proposal requirement's integration provider.
|
|
698
|
-
* The host owns the provider→icon mapping (its integrations catalog); when
|
|
699
|
-
* absent, the card falls back to its built-in provider mark. */
|
|
700
|
-
renderProviderIcon?: (provider: string) => ReactNode;
|
|
701
|
-
/** Called after a workflow-mutating tool is confirmed (host re-fetches its list). */
|
|
702
|
-
onWorkflowMutation?: () => void;
|
|
703
|
-
/** In-place connect handler for a proposal's integration requirements. The host
|
|
704
|
-
* runs its own connect flow (OAuth popup, api-key modal, app install) and
|
|
705
|
-
* resolves whether the requirement is now satisfied; the proposal card then
|
|
706
|
-
* flips it to connected. Host-agnostic — when omitted, the card falls back to
|
|
707
|
-
* navigating the requirement's connect target via `navigate`. */
|
|
708
|
-
onConnectRequirement?: (requirement: ConnectionRequirement) => Promise<ConnectRequirementResult>;
|
|
709
|
-
/** Markdown renderer for assistant message content (plain text when absent). */
|
|
710
|
-
renderMarkdown?: (content: string) => ReactNode;
|
|
711
|
-
/** Per-tool custom detail renderers for expanded tool cards in the transcript. */
|
|
712
|
-
toolRenderers?: ToolDetailRenderers;
|
|
713
|
-
/** Render a prominent card for a CONFIRMED tool's result (e.g. a one-time
|
|
714
|
-
* API-key reveal for `create_api_key`), shown inline after the action's status
|
|
715
|
-
* line. The result's `output` may carry a one-time secret — see
|
|
716
|
-
* {@link ConfirmedResult} for the never-persist/never-to-model contract. */
|
|
717
|
-
renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
|
|
718
|
-
/** Swap the conversation rendering for a host-supplied renderer (see
|
|
719
|
-
* {@link AssistantPanelProps.renderTranscript}); the dock chrome, composer,
|
|
720
|
-
* transport, and proposal flow stay owned by the panel. */
|
|
721
|
-
renderTranscript?: (view: AssistantTranscriptView) => ReactNode;
|
|
722
|
-
/** Opt-in attachment surface for the dock's composer — forwarded to
|
|
723
|
-
* {@link AssistantPanelProps.composerAttachments}. */
|
|
724
|
-
composerAttachments?: AssistantPanelProps["composerAttachments"];
|
|
725
|
-
/** Forwarded to {@link AssistantPanelProps.onComposerSend}. */
|
|
726
|
-
onComposerSend?: AssistantPanelProps["onComposerSend"];
|
|
727
|
-
}
|
|
728
|
-
declare function AssistantDock({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement, renderMarkdown, toolRenderers, renderConfirmedResult, renderTranscript, composerAttachments, onComposerSend, }: AssistantDockProps): react.JSX.Element;
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* True while a turn is streaming but the model hasn't emitted its first answer
|
|
732
|
-
* token yet — drives the "thinking" affordance so a reasoning gap reads as
|
|
733
|
-
* working, not a frozen panel.
|
|
734
|
-
*/
|
|
735
|
-
declare function assistantIsThinking(state: AssistantState): boolean;
|
|
736
|
-
/** A run of chat messages between two status lines, rendered through one
|
|
737
|
-
* `ChatMessages`. */
|
|
738
|
-
interface MessageRun {
|
|
739
|
-
kind: "run";
|
|
740
|
-
messages: ChatUiMessage[];
|
|
741
|
-
}
|
|
742
|
-
/** A settled action's one-line note ("Created workflow …", "Action cancelled."),
|
|
743
|
-
* rendered as a quiet centered line — not routed into `ChatMessages`, where a
|
|
744
|
-
* `system` row would paint as a full assistant-labeled turn. */
|
|
745
|
-
interface StatusLine {
|
|
746
|
-
kind: "status";
|
|
747
|
-
/** The status message's own id — keys the row and any confirmed result. */
|
|
748
|
-
id: string;
|
|
749
|
-
text: string;
|
|
750
|
-
}
|
|
751
|
-
type TranscriptBlock = MessageRun | StatusLine;
|
|
752
|
-
interface AdaptedTranscript {
|
|
753
|
-
/** Transcript-order blocks: message runs broken by status lines. */
|
|
754
|
-
blocks: TranscriptBlock[];
|
|
755
|
-
/** Every adapted chat message across all runs, flattened (status rows
|
|
756
|
-
* excluded — they are the blocks' status lines). */
|
|
757
|
-
messages: ChatUiMessage[];
|
|
758
|
-
/** The assistant message under which pending proposals should render, or null
|
|
759
|
-
* when there are none. */
|
|
760
|
-
proposalHostId: string | null;
|
|
761
|
-
/** The current/most-recent turn's assistant message — where the turn cost line
|
|
762
|
-
* renders (it carries the turn's metrics), or null when there is none. */
|
|
763
|
-
metricsHostId: string | null;
|
|
764
|
-
/** Confirmed-tool results to render under their status line, keyed by that
|
|
765
|
-
* line's id — carried from a `status` message's retained `result` so a host
|
|
766
|
-
* card (e.g. a one-time API-key reveal) renders inline right after the action. */
|
|
767
|
-
confirmedResults: Map<string, ConfirmedResult>;
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Fold the transcript view into transcript-order blocks: message runs (web-react
|
|
771
|
-
* `ChatUiMessage[]`) broken by quiet status lines. Within a run, each user
|
|
772
|
-
* message is 1:1; the assistant/`tool` messages between two user turns collapse
|
|
773
|
-
* into one assistant message whose ordered `segments` carry the turn's text runs
|
|
774
|
-
* and tool chips IN EMISSION ORDER (with each finished tool's outcome as the chip
|
|
775
|
-
* `result`). The joined text is also kept on `content` — web-react reads it as the
|
|
776
|
-
* "answer has started" signal that gates the reasoning box. The live turn's
|
|
777
|
-
* reasoning preview and model label hang on the last assistant message, and
|
|
778
|
-
* `proposalHostId` names the message the pending proposals render under. A
|
|
779
|
-
* `status` message ends the current run and becomes a {@link StatusLine} block.
|
|
780
|
-
*/
|
|
781
|
-
declare function adaptTranscript(view: AssistantTranscriptView): AdaptedTranscript;
|
|
782
|
-
interface AssistantTranscriptProps {
|
|
783
|
-
view: AssistantTranscriptView;
|
|
784
|
-
/** Markdown renderer for assistant content; defaults to plain pre-wrapped text. */
|
|
785
|
-
renderMarkdown?: (content: string) => ReactNode;
|
|
786
|
-
/** Per-tool custom detail renderers for expanded tool cards. */
|
|
787
|
-
toolRenderers?: ToolDetailRenderers;
|
|
788
|
-
/** Render a prominent card for a CONFIRMED tool's result, inline after its
|
|
789
|
-
* status line (e.g. a one-time API-key reveal for `create_api_key`). Return
|
|
790
|
-
* null to fall back to just the status line. Unlike `toolRenderers` (collapsed
|
|
791
|
-
* detail for a read-only tool chip), this is shown expanded, so a one-time
|
|
792
|
-
* secret is visible without a click. See {@link ConfirmedResult}. */
|
|
793
|
-
renderConfirmedResult?: (result: ConfirmedResult) => ReactNode;
|
|
794
|
-
/** Zero-state shown for a fresh, non-streaming thread. */
|
|
795
|
-
emptyState?: ReactNode;
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* Render the assistant conversation: message runs through web-react's
|
|
799
|
-
* `ChatMessages` (quiet chrome — the label/meta row becomes a hover-revealed
|
|
800
|
-
* lane, which keeps the narrow dock panel uncluttered), status lines through
|
|
801
|
-
* {@link StatusRow}. Pending proposals render via the panel's bound
|
|
802
|
-
* `view.renderProposal`, placed inline after the proposing turn through
|
|
803
|
-
* `renderExtras`; the settled turn cost renders once under its assistant bubble.
|
|
804
|
-
*/
|
|
805
|
-
declare function AssistantTranscript({ view, renderMarkdown, toolRenderers, renderConfirmedResult, emptyState, }: AssistantTranscriptProps): react.JSX.Element;
|
|
806
|
-
|
|
807
|
-
interface ProposalCardProps {
|
|
808
|
-
proposal: PendingProposal;
|
|
809
|
-
/** True while this proposal's confirmation is in flight (disables the buttons). */
|
|
810
|
-
confirming: boolean;
|
|
811
|
-
onConfirm: () => void;
|
|
812
|
-
onCancel: () => void;
|
|
813
|
-
/** Host navigation for connect targets / the integrations page. */
|
|
814
|
-
navigate?: (path: string) => void;
|
|
815
|
-
/** In-place connect handler for a requirement. When provided, a requirement's
|
|
816
|
-
* connect affordance calls this (showing a busy state) instead of navigating
|
|
817
|
-
* to `connectUrl`/the integrations page — the host runs its own connect flow
|
|
818
|
-
* and the card flips the requirement to connected on success. Host-agnostic;
|
|
819
|
-
* wired by the panel from {@link UseAssistantChatOptions.onConnectRequirement}. */
|
|
820
|
-
onConnect?: (requirement: ConnectionRequirement) => void | Promise<void>;
|
|
821
|
-
/** Render the workflow YAML as a node graph (the `./workflows` WorkflowGraph).
|
|
822
|
-
* When absent, the YAML is shown as text. */
|
|
823
|
-
renderGraph?: (yaml: string) => ReactNode;
|
|
824
|
-
/** Render the brand icon for an integration requirement's provider. The host
|
|
825
|
-
* owns the provider→icon mapping (its integrations catalog); when absent, or
|
|
826
|
-
* when it returns a nullish node for a provider it doesn't recognize, the row
|
|
827
|
-
* falls back to the shared sandbox-ui {@link ProviderIcon} mark (the same
|
|
828
|
-
* brand resolution the integrations catalog uses). */
|
|
829
|
-
renderProviderIcon?: (provider: string) => ReactNode;
|
|
830
|
-
}
|
|
831
|
-
declare function ProposalCard({ proposal, confirming, onConfirm, onCancel, navigate, onConnect, renderGraph, renderProviderIcon, }: ProposalCardProps): react.JSX.Element;
|
|
832
|
-
|
|
833
|
-
interface AssistantLauncher {
|
|
834
|
-
/** Whether the assistant drawer is open. */
|
|
835
|
-
open: boolean;
|
|
836
|
-
/** A one-shot starter prompt to prefill the composer with, or null. */
|
|
837
|
-
seed: string | null;
|
|
838
|
-
/** Open the drawer; optionally prefill the composer with `seed`. */
|
|
839
|
-
openAssistant: (seed?: string) => void;
|
|
840
|
-
closeAssistant: () => void;
|
|
841
|
-
/** Clear the pending seed once the composer has applied it (consume-once). */
|
|
842
|
-
clearSeed: () => void;
|
|
843
|
-
}
|
|
844
|
-
declare function AssistantLauncherProvider({ children, }: {
|
|
845
|
-
children: ReactNode;
|
|
846
|
-
}): react.JSX.Element;
|
|
847
|
-
declare function useAssistantLauncher(): AssistantLauncher;
|
|
848
|
-
|
|
849
|
-
export { type AssistantChat, type AssistantClient, type AssistantClientConfig, AssistantClientInputError, AssistantClientProvider, type AssistantDeliveryMode, AssistantDock, type AssistantDockProps, type AssistantLauncher, AssistantLauncherProvider, type AssistantModelOption, type AssistantModels, type AssistantModelsResult, AssistantPanel, type AssistantPanelProps, type AssistantSendOptions, type AssistantStreamEvent, type AssistantThreadSummary, type AssistantThreads, AssistantTranscript, type AssistantTranscriptProps, type AssistantTranscriptView, type ChatMessage, type ChatRequest, type ChatRole, type ConfirmResult, type ConfirmedResult, type ConnectRequirementResult, type ConnectionRequirement, type ConnectionRequirementKind, type ConnectionRequirementRef, type DeltaEventData, type DoneEventData, type ErrorEventData, type PendingProposal, ProposalCard, type ProposalCardProps, type ReasoningEventData, type ThreadEventData, type ThreadHistoryResult, type ToolActivityStatus, type ToolCallEventData, type ToolOutcome, type ToolProposalEventData, type ToolResultEventData, type UsageEventData, type UsageInfo, type UseAssistantChatOptions, adaptTranscript, assistantIsThinking, createAssistantClient, useAssistantChat, useAssistantClient, useAssistantLauncher, useAssistantModels, useAssistantThreads };
|
|
2
|
+
* `@tangle-network/agent-app/assistant` — the in-app assistant/copilot surface,
|
|
3
|
+
* portable across hosts. A host supplies a transport via {@link createAssistantClient}
|
|
4
|
+
* and {@link AssistantClientProvider}; the dock, panel, hooks, and proposal card
|
|
5
|
+
* consume it and render on web-react's chat components (`ChatComposer`,
|
|
6
|
+
* `ChatMessages`, `ModelPicker`). The markdown renderer, per-tool detail
|
|
7
|
+
* renderers, and workflow-graph renderer are injected so this subpath carries no
|
|
8
|
+
* product-specific dependency.
|
|
9
|
+
*/
|
|
10
|
+
export * from "./types";
|
|
11
|
+
export * from "./client";
|
|
12
|
+
export * from "./client-context";
|
|
13
|
+
export { useAssistantChat, type AssistantChat, type AssistantSendOptions, type UseAssistantChatOptions, } from "./useAssistantChat";
|
|
14
|
+
export { useAssistantModels } from "./useAssistantModels";
|
|
15
|
+
export { useAssistantThreads, type AssistantThreads } from "./useAssistantThreads";
|
|
16
|
+
export { AssistantDock, type AssistantDockProps } from "./AssistantDock";
|
|
17
|
+
export { AssistantPanel, type AssistantPanelProps } from "./AssistantPanel";
|
|
18
|
+
export { AssistantTranscript, type AssistantTranscriptProps, adaptTranscript, assistantIsThinking, } from "./transcript";
|
|
19
|
+
export { ProposalCard, type ProposalCardProps } from "./ProposalCard";
|
|
20
|
+
export { AssistantLauncherProvider, useAssistantLauncher, type AssistantLauncher, } from "./launcher";
|