@blade-hq/agent-kit 1.0.24 → 1.0.27
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/dist/{chunk-7F6UP5LP.js → chunk-34GDDOWY.js} +5 -208
- package/dist/chunk-34GDDOWY.js.map +1 -0
- package/dist/{chunk-2QYV43YP.js → chunk-C2FKVGJU.js} +2 -2
- package/dist/{chunk-TYM7KL2L.js → chunk-JU5SL4HP.js} +2 -2
- package/dist/chunk-M72OL7ZJ.js +23 -0
- package/dist/chunk-M72OL7ZJ.js.map +1 -0
- package/dist/{chunk-IMMRWXI7.js → chunk-SBASG3M2.js} +128 -98
- package/dist/chunk-SBASG3M2.js.map +1 -0
- package/dist/{chunk-BQKF6HJH.js → chunk-TE6G6NVX.js} +6 -6
- package/dist/{chunk-ICV7OTGX.js → chunk-X2NJKKXR.js} +10 -10
- package/dist/client/auth.d.ts +8 -0
- package/dist/client/blade-client.d.ts +80 -0
- package/dist/client/index.d.ts +22 -18769
- package/dist/client/index.js +1 -5
- package/dist/client/resources/api-keys.d.ts +28 -0
- package/dist/client/resources/auth.d.ts +26 -0
- package/dist/client/resources/env-buckets.d.ts +20 -0
- package/dist/client/resources/gis.d.ts +8 -0
- package/dist/client/resources/headless.d.ts +33 -0
- package/dist/client/resources/memories.d.ts +63 -0
- package/dist/client/resources/models.d.ts +23 -0
- package/dist/client/resources/published-apps.d.ts +8 -0
- package/dist/client/resources/registry.d.ts +58 -0
- package/dist/client/resources/runs.d.ts +8 -0
- package/dist/client/resources/scenarios.d.ts +49 -0
- package/dist/client/resources/sessions.d.ts +253 -0
- package/dist/client/resources/skills.d.ts +38 -0
- package/dist/client/resources/solutions.d.ts +31 -0
- package/dist/client/resources/user-preferences.d.ts +26 -0
- package/dist/client/rest.d.ts +19 -0
- package/dist/client/socket.d.ts +9 -0
- package/dist/client/types/index.d.ts +8 -0
- package/dist/client/types/rest.d.ts +15335 -0
- package/dist/client/types/sdk-profile.d.ts +47 -0
- package/dist/client/types/socket-events.d.ts +503 -0
- package/dist/react/api/api-keys.d.ts +6 -0
- package/dist/react/api/auth.d.ts +7 -0
- package/dist/react/api/client.d.ts +8 -0
- package/dist/react/api/env-buckets.d.ts +10 -0
- package/dist/react/api/gis-api.d.ts +4 -0
- package/dist/react/api/memories.d.ts +14 -0
- package/dist/react/api/models.d.ts +11 -0
- package/dist/react/api/partner-skill.d.ts +2 -0
- package/dist/react/api/prod-solution.d.ts +456 -0
- package/dist/react/api/published-apps.d.ts +21 -0
- package/dist/react/api/published-apps.js +14 -0
- package/dist/react/api/published-apps.js.map +1 -0
- package/dist/react/api/registry.d.ts +46 -0
- package/dist/react/api/scenarios.d.ts +9 -0
- package/dist/react/api/scheduled-tasks.d.ts +24 -0
- package/dist/react/api/session-skill.d.ts +2 -0
- package/dist/react/api/sessions.d.ts +109 -0
- package/dist/react/api/sessions.js +93 -0
- package/dist/react/api/sessions.js.map +1 -0
- package/dist/react/api/skills.d.ts +27 -0
- package/dist/react/api/socket.d.ts +5 -0
- package/dist/react/api/solutions.d.ts +11 -0
- package/dist/react/api/user-preferences.d.ts +8 -0
- package/dist/react/asr/VoiceWaveform.d.ts +10 -0
- package/dist/react/asr/use-tiptap-voice-input.d.ts +29 -0
- package/dist/react/asr/use-voice-input.d.ts +17 -0
- package/dist/react/asr/voice-input-support.d.ts +5 -0
- package/dist/react/bootstrap.d.ts +4 -0
- package/dist/react/cards/register.d.ts +1 -2
- package/dist/react/components/ai-elements/file-tree.d.ts +26 -0
- package/dist/react/components/ai-elements/reasoning.d.ts +32 -0
- package/dist/react/components/ai-elements/shimmer.d.ts +11 -0
- package/dist/react/components/card/CardCodeBlock.d.ts +5 -0
- package/dist/react/components/card/CardContext.d.ts +7 -0
- package/dist/react/components/card/CardRenderer.d.ts +7 -0
- package/dist/react/components/card/CardStates.d.ts +8 -0
- package/dist/react/components/card/cards/attraction-card.d.ts +2 -0
- package/dist/react/components/card/cards/cite-card.d.ts +10 -0
- package/dist/react/components/card/cards/comprehensive-analysis-card.d.ts +2 -0
- package/dist/react/components/card/cards/conflict-detection-card.d.ts +4 -0
- package/dist/react/components/card/cards/counter.d.ts +2 -0
- package/dist/react/components/card/cards/damage-effect-card.d.ts +4 -0
- package/dist/react/components/card/cards/destination-card.d.ts +2 -0
- package/dist/react/components/card/cards/diff-card.d.ts +2 -0
- package/dist/react/components/card/cards/execution-order-card.d.ts +2 -0
- package/dist/react/components/card/cards/experience-card-with-options.d.ts +4 -0
- package/dist/react/components/card/cards/flight-card.d.ts +2 -0
- package/dist/react/components/card/cards/hotel-card.d.ts +2 -0
- package/dist/react/components/card/cards/kill-chain-card.d.ts +2 -0
- package/dist/react/components/card/cards/kill-chain-types.d.ts +157 -0
- package/dist/react/components/card/cards/map-card.d.ts +2 -0
- package/dist/react/components/card/cards/order-status-card.d.ts +2 -0
- package/dist/react/components/card/cards/patch-card.d.ts +15 -0
- package/dist/react/components/card/cards/product-recommendation-card.d.ts +2 -0
- package/dist/react/components/card/cards/reflection-optimization-card.d.ts +2 -0
- package/dist/react/components/card/cards/resolution-modifications-card.d.ts +2 -0
- package/dist/react/components/card/cards/resolution-summary-card.d.ts +2 -0
- package/dist/react/components/card/cards/restaurant-card.d.ts +2 -0
- package/dist/react/components/card/cards/shopping-list-card.d.ts +2 -0
- package/dist/react/components/card/cards/simulation-event-card.d.ts +4 -0
- package/dist/react/components/card/cards/survival-effect-card.d.ts +4 -0
- package/dist/react/components/card/cards/travel-itinerary-card.d.ts +2 -0
- package/dist/react/components/card/register.d.ts +1 -0
- package/dist/react/components/chat/AgentLoopBlock.d.ts +8 -0
- package/dist/react/components/chat/AskUserQuestionBlock.d.ts +32 -0
- package/dist/react/components/chat/AssistantTurnBlock.d.ts +28 -0
- package/dist/react/components/chat/AttachmentPreviewDialog.d.ts +26 -0
- package/dist/react/components/chat/BackgroundTasksPill.d.ts +3 -0
- package/dist/react/components/chat/ChatInput.d.ts +94 -0
- package/dist/react/components/chat/ChatView.d.ts +16 -0
- package/dist/react/components/chat/CompactionCard.d.ts +6 -0
- package/dist/react/components/chat/ConnectionBanner.d.ts +1 -0
- package/dist/react/components/chat/FileCompletionMenu.d.ts +13 -0
- package/dist/react/components/chat/FileSizeLimitDialog.d.ts +9 -0
- package/dist/react/components/chat/ImageLightbox.d.ts +11 -0
- package/dist/react/components/chat/MessageActions.d.ts +6 -0
- package/dist/react/components/chat/MessageContextPills.d.ts +6 -0
- package/dist/react/components/chat/MessageFileAttachmentList.d.ts +13 -0
- package/dist/react/components/chat/MessageList.d.ts +13 -0
- package/dist/react/components/chat/ProgressCircle.d.ts +12 -0
- package/dist/react/components/chat/RenderErrorBoundary.d.ts +19 -0
- package/dist/react/components/chat/ResourceIframe.d.ts +5 -0
- package/dist/react/components/chat/Shimmer.d.ts +6 -0
- package/dist/react/components/chat/SkillCompletionMenu.d.ts +9 -0
- package/dist/react/components/chat/SkillStatusBar.d.ts +8 -0
- package/dist/react/components/chat/StickyStatusBar.d.ts +10 -0
- package/dist/react/components/chat/TextAttachmentPills.d.ts +10 -0
- package/dist/react/components/chat/ThinkingToggle.d.ts +7 -0
- package/dist/react/components/chat/ToolCallBlock.d.ts +18 -0
- package/dist/react/components/chat/TurnNavRail.d.ts +11 -0
- package/dist/react/components/chat/UserMessageBubble.d.ts +20 -0
- package/dist/react/components/chat/WhatIfUserBubble.d.ts +13 -0
- package/dist/react/components/chat/customization.d.ts +82 -0
- package/dist/react/components/chat/display-utils.d.ts +35 -0
- package/dist/react/components/chat/extensions/file-mention.d.ts +12 -0
- package/dist/react/components/chat/extensions/skill-mention.d.ts +25 -0
- package/dist/react/components/chat/index.d.ts +16 -115
- package/dist/react/components/chat/index.js +6 -6
- package/dist/react/components/chat/tool-renderers/BashRenderer.d.ts +2 -0
- package/dist/react/components/chat/tool-renderers/FileEditRenderer.d.ts +2 -0
- package/dist/react/components/chat/tool-renderers/FileReadRenderer.d.ts +2 -0
- package/dist/react/components/chat/tool-renderers/SearchRenderer.d.ts +2 -0
- package/dist/react/components/chat/tool-renderers/SubmitResultRenderer.d.ts +2 -0
- package/dist/react/components/chat/tool-renderers/registry.d.ts +9 -0
- package/dist/react/components/chat/tool-renderers/shared.d.ts +26 -0
- package/dist/react/components/chat/whatif-quote-context.d.ts +15 -0
- package/dist/react/components/markdown/ExternalLinkDialog.d.ts +8 -0
- package/dist/react/components/markdown/FileCardComponent.d.ts +10 -0
- package/dist/react/components/markdown/MarkdownContent.d.ts +19 -0
- package/dist/react/components/model/ModelSelector.d.ts +9 -0
- package/dist/react/components/plan/PlanSummaryCard.d.ts +8 -0
- package/dist/react/components/plan/PlanVisualization.d.ts +13 -0
- package/dist/react/components/plan/debug-log.d.ts +21 -0
- package/dist/react/components/plan/extract-plan-messages.d.ts +2 -0
- package/dist/react/components/plan/index.d.ts +6 -110
- package/dist/react/components/plan/index.js +4 -4
- package/dist/react/components/plan/parse-plan-messages.d.ts +10 -0
- package/dist/react/components/plan/parse-plan-tree.d.ts +16 -0
- package/dist/react/components/plan/phases/PlanMindMap.d.ts +8 -0
- package/dist/react/components/plan/phases/PlanStatusIcon.d.ts +5 -0
- package/dist/react/components/plan/phases/PlanTree.d.ts +8 -0
- package/dist/react/components/plan/phases/SkillAnalysis.d.ts +7 -0
- package/dist/react/components/plan/phases/SkillDiscovery.d.ts +10 -0
- package/dist/react/components/plan/types.d.ts +56 -0
- package/dist/react/components/session/SessionDetail.d.ts +8 -0
- package/dist/react/components/session/SessionList.d.ts +9 -0
- package/dist/react/components/session/SessionListItem.d.ts +8 -0
- package/dist/react/components/session/StatusBadge.d.ts +3 -0
- package/dist/react/components/session/index.d.ts +5 -53
- package/dist/react/components/session/index.js +3 -3
- package/dist/react/components/session/session-utils.d.ts +19 -0
- package/dist/react/components/ui/collapsible.d.ts +5 -0
- package/dist/react/components/workspace/FileTree.d.ts +21 -0
- package/dist/react/components/workspace/WorkspaceFilesPanel.d.ts +30 -0
- package/dist/react/components/workspace/file-icon-assets.d.ts +3 -0
- package/dist/react/components/workspace/index.d.ts +2 -59
- package/dist/react/components/workspace/index.js +3 -3
- package/dist/react/context.d.ts +2 -0
- package/dist/react/devtools/bridge-devtools/BridgeDevtoolsFab.d.ts +1 -0
- package/dist/react/devtools/bridge-devtools/index.d.ts +3 -36
- package/dist/react/devtools/bridge-devtools/mount.d.ts +1 -0
- package/dist/react/devtools/bridge-devtools/store.d.ts +15 -0
- package/dist/react/devtools/bridge-devtools/tap.d.ts +5 -0
- package/dist/react/devtools/bridge-devtools/types.d.ts +29 -0
- package/dist/react/hooks/use-background-tasks.d.ts +7 -0
- package/dist/react/hooks/use-card-state.d.ts +1 -0
- package/dist/react/hooks/use-chat.d.ts +13 -0
- package/dist/react/hooks/use-check-skill-file.d.ts +4 -0
- package/dist/react/hooks/use-check-solution-file.d.ts +4 -0
- package/dist/react/hooks/use-context-stats.d.ts +7 -0
- package/dist/react/hooks/use-gis.d.ts +17 -0
- package/dist/react/hooks/use-global-skill-stats.d.ts +6 -0
- package/dist/react/hooks/use-input-history.d.ts +7 -0
- package/dist/react/hooks/use-model-preferences.d.ts +17 -0
- package/dist/react/hooks/use-registry.d.ts +53 -0
- package/dist/react/hooks/use-resolved-model.d.ts +5 -0
- package/dist/react/hooks/use-session.d.ts +10 -0
- package/dist/react/hooks/use-skill-stats.d.ts +7 -0
- package/dist/react/hooks/use-skills.d.ts +6 -0
- package/dist/react/hooks/use-token-pressure.d.ts +6 -0
- package/dist/react/index.d.ts +121 -2111
- package/dist/react/index.js +41 -97
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/analytics.d.ts +7 -0
- package/dist/react/lib/attachment-upload.d.ts +10 -0
- package/dist/react/lib/card-registry.d.ts +35 -0
- package/dist/react/lib/chat.d.ts +48 -0
- package/dist/react/lib/code-highlight.d.ts +9 -0
- package/dist/react/lib/html-element-selection.d.ts +140 -0
- package/dist/react/lib/html-source-locator.d.ts +16 -0
- package/dist/react/lib/open-session-file.d.ts +2 -0
- package/dist/react/lib/parent-bridge.d.ts +22 -0
- package/dist/react/lib/preview-dispatch.d.ts +24 -0
- package/dist/react/lib/resource-bridge.d.ts +11 -0
- package/dist/react/lib/session-file-preview.d.ts +8 -0
- package/dist/react/lib/step-ranges.d.ts +42 -0
- package/dist/react/lib/tool-preview.d.ts +2 -0
- package/dist/react/lib/ui-meta.d.ts +9 -0
- package/dist/react/lib/utils.d.ts +3 -0
- package/dist/react/lib/whatif-prompt.d.ts +45 -0
- package/dist/react/projection/builder.d.ts +59 -0
- package/dist/react/projection/helpers.d.ts +34 -0
- package/dist/react/projection/index.d.ts +2 -0
- package/dist/react/projection/state.d.ts +22 -0
- package/dist/react/provider.d.ts +8 -0
- package/dist/react/routes.d.ts +1 -0
- package/dist/react/schemas/background.d.ts +16 -0
- package/dist/react/schemas/event.d.ts +51 -0
- package/dist/react/schemas/gis.d.ts +50 -0
- package/dist/{AskUserQuestionBlock---kOTouk.d.ts → react/schemas/message.d.ts} +15 -48
- package/dist/react/schemas/partner-skill.d.ts +46 -0
- package/dist/{projection-BWYEFYNn.d.ts → react/schemas/projection.d.ts} +12 -10
- package/dist/react/schemas/published-apps.d.ts +38 -0
- package/dist/react/schemas/scheduled-task.d.ts +32 -0
- package/dist/react/schemas/session.d.ts +121 -0
- package/dist/react/schemas/skill.d.ts +50 -0
- package/dist/react/schemas/studio/agent.d.ts +12 -0
- package/dist/react/schemas/studio/database.d.ts +39 -0
- package/dist/react/schemas/studio/env.d.ts +7 -0
- package/dist/react/schemas/studio/knowledge.d.ts +18 -0
- package/dist/react/schemas/studio/resource-base.d.ts +7 -0
- package/dist/react/schemas/studio/scene.d.ts +12 -0
- package/dist/react/schemas/studio/tool.d.ts +25 -0
- package/dist/react/schemas/task.d.ts +12 -0
- package/dist/react/sockets/event-bridge.d.ts +115 -0
- package/dist/react/sockets/socket-state.d.ts +4 -0
- package/dist/react/stores/answer-callback-store.d.ts +9 -0
- package/dist/react/stores/auth-store.d.ts +38 -0
- package/dist/react/stores/background-store.d.ts +13 -0
- package/dist/react/stores/card-state-store.d.ts +10 -0
- package/dist/react/stores/chat-store.d.ts +34 -0
- package/dist/react/stores/client-aware.d.ts +7 -0
- package/dist/react/stores/connection-store.d.ts +14 -0
- package/dist/react/stores/gis-store.d.ts +19 -0
- package/dist/react/stores/index.d.ts +14 -0
- package/dist/react/stores/runtime-features-store.d.ts +21 -0
- package/dist/react/stores/runtime-store.d.ts +18 -0
- package/dist/react/stores/session-store.d.ts +44 -0
- package/dist/react/stores/task-store.d.ts +9 -0
- package/dist/react/stores/ui-bridge-store.d.ts +32 -0
- package/dist/react/stores/ui-store.d.ts +69 -0
- package/dist/react/types/index.d.ts +7 -0
- package/dist/react/types/solution.d.ts +101 -0
- package/package.json +41 -12
- package/dist/SkillStatusBar-DluiBsVj.d.ts +0 -340
- package/dist/blade-client-CseN7OW9.d.ts +0 -1867
- package/dist/chunk-7F6UP5LP.js.map +0 -1
- package/dist/chunk-IMMRWXI7.js.map +0 -1
- package/dist/react/api/vibe-coding.d.ts +0 -55
- package/dist/react/api/vibe-coding.js +0 -47
- package/dist/react/api/vibe-coding.js.map +0 -1
- package/dist/session-CT8Y2KHr.d.ts +0 -227
- package/dist/sessions-DI9DVun7.d.ts +0 -177
- /package/dist/{chunk-2QYV43YP.js.map → chunk-C2FKVGJU.js.map} +0 -0
- /package/dist/{chunk-TYM7KL2L.js.map → chunk-JU5SL4HP.js.map} +0 -0
- /package/dist/{chunk-BQKF6HJH.js.map → chunk-TE6G6NVX.js.map} +0 -0
- /package/dist/{chunk-ICV7OTGX.js.map → chunk-X2NJKKXR.js.map} +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { BladeClient } from "../../client/index.js";
|
|
2
|
+
import type { MessageContent } from "../schemas/message.js";
|
|
3
|
+
type WorkspaceFilesChangedEvent = {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
filePath?: string;
|
|
6
|
+
};
|
|
7
|
+
type AgentBoardBoardTaskChangedEvent = {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
type AgentBoardFileOpEvent = {
|
|
11
|
+
project_id: number;
|
|
12
|
+
session_id: string;
|
|
13
|
+
tool_call_id?: string | null;
|
|
14
|
+
action: string;
|
|
15
|
+
file_path: string;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
content_preview?: string | null;
|
|
18
|
+
final_content?: string | null;
|
|
19
|
+
content_delta?: boolean | null;
|
|
20
|
+
is_final?: boolean | null;
|
|
21
|
+
created_at: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function setOnWorkspaceFilesChanged(fn: ((event: WorkspaceFilesChangedEvent) => void) | null): void;
|
|
24
|
+
export declare class AgentSocket {
|
|
25
|
+
private client;
|
|
26
|
+
private socket;
|
|
27
|
+
private subscribedSession;
|
|
28
|
+
private readonly attachedSessions;
|
|
29
|
+
private readonly previewArtifactsByToolCall;
|
|
30
|
+
private readonly deliveredBridgeKeys;
|
|
31
|
+
private readonly pendingReplayMessages;
|
|
32
|
+
private readonly pendingReplayModes;
|
|
33
|
+
private readonly oomNotifiedKeys;
|
|
34
|
+
private readonly pendingTurnPatches;
|
|
35
|
+
private readonly joinedSessions;
|
|
36
|
+
private readonly requestedJoins;
|
|
37
|
+
private readonly pendingJoins;
|
|
38
|
+
private readonly recentChatEndAt;
|
|
39
|
+
private readonly boardProjectRefCounts;
|
|
40
|
+
private frontendTelemetryCounter;
|
|
41
|
+
private patchFlushHandle;
|
|
42
|
+
private patchFlushCancel;
|
|
43
|
+
private readonly projectionBuilder;
|
|
44
|
+
constructor(client: BladeClient);
|
|
45
|
+
private _ensureConnected;
|
|
46
|
+
private _resolveSessionId;
|
|
47
|
+
private _reportFrontendTelemetry;
|
|
48
|
+
private _queueTurnPatch;
|
|
49
|
+
private _scheduleTurnPatchFlush;
|
|
50
|
+
private _flushPendingTurnPatches;
|
|
51
|
+
private _bindStoreHandlers;
|
|
52
|
+
private _bindConnectionHandlers;
|
|
53
|
+
private _applyProjectionSideEffects;
|
|
54
|
+
private _notifySandboxOom;
|
|
55
|
+
private _syncSessionTurnsFromHistory;
|
|
56
|
+
private _applySystemNotification;
|
|
57
|
+
subscribe(sessionId: string): void;
|
|
58
|
+
subscribeAgentBoardProject(projectId: string | number): void;
|
|
59
|
+
unsubscribeAgentBoardProject(projectId: string | number): void;
|
|
60
|
+
onAgentBoardTaskChanged(handler: (data: AgentBoardBoardTaskChangedEvent) => void): () => void;
|
|
61
|
+
onAgentBoardFileOp(handler: (data: AgentBoardFileOpEvent) => void): () => void;
|
|
62
|
+
/**
|
|
63
|
+
* 订阅 session:updated(智能体意图、状态等会话属性变更)。全局 handler 只会
|
|
64
|
+
* patch 已在 useSessionStore 列表里的会话;看板任务这类不在列表里的
|
|
65
|
+
* 会话,由调用方通过本方法自行消费属性更新。
|
|
66
|
+
*/
|
|
67
|
+
onSessionUpdated(handler: (data: {
|
|
68
|
+
session_id?: string;
|
|
69
|
+
intent?: string;
|
|
70
|
+
status?: string;
|
|
71
|
+
}) => void): () => void;
|
|
72
|
+
unsubscribe(): void;
|
|
73
|
+
/**
|
|
74
|
+
* 附加订阅:仅把当前 sid 加进 sessionId 的 room,不切 subscribedSession,
|
|
75
|
+
* 也不清空当前会话的 artifact/card state。用于"并行拟制"这类场景 ——
|
|
76
|
+
* 创建 N 个后台 session 后需要收到它们的 chat:end / task:updated 才能让
|
|
77
|
+
* 成果表里那几条卡片状态流转到"已完成";缺失订阅时广播事件永远到不了
|
|
78
|
+
* 前端,卡片就会停留在乐观写入的"运行中"态。
|
|
79
|
+
*
|
|
80
|
+
* 幂等:后端 session:subscribe handler 只做 enter_room,重复 emit 无副作用。
|
|
81
|
+
* 同时把 sessionId 记到 attachedSessions,连接断开重连时一并重新订阅,
|
|
82
|
+
* 避免长会话期间断网后再回来时丢掉该 session 的 turn 事件。
|
|
83
|
+
*/
|
|
84
|
+
attachSession(sessionId: string): void;
|
|
85
|
+
private _ensureJoined;
|
|
86
|
+
private _refreshRunningState;
|
|
87
|
+
private _shouldWaitForJoinBeforeSend;
|
|
88
|
+
send(sessionId: string, message: MessageContent, mode?: string, askuserAnswer?: Record<string, unknown>, extras?: {
|
|
89
|
+
model?: string;
|
|
90
|
+
thinkingOverride?: boolean;
|
|
91
|
+
whatif?: {
|
|
92
|
+
from_step: number;
|
|
93
|
+
quotes: Array<Record<string, unknown>>;
|
|
94
|
+
deprecate_entry_ids: string[];
|
|
95
|
+
};
|
|
96
|
+
replay_decision?: "keep_replay" | "continue_replay";
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
private _ensureSessionIdleBeforeSend;
|
|
99
|
+
/**
|
|
100
|
+
* 在 agent loop 运行期间追加补充消息。
|
|
101
|
+
* 消息会在下一轮 LLM 调用前以 user-supplement 形式注入。
|
|
102
|
+
*/
|
|
103
|
+
append(sessionId: string, message: string): void;
|
|
104
|
+
stop(sessionId: string): Promise<Record<string, unknown>>;
|
|
105
|
+
compact(sessionId: string): Promise<Record<string, unknown>>;
|
|
106
|
+
reconnect(): void;
|
|
107
|
+
disconnect(): void;
|
|
108
|
+
destroy(): void;
|
|
109
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
110
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
111
|
+
emit(event: string, data?: any): this;
|
|
112
|
+
getSubscribedSession(): string | null;
|
|
113
|
+
}
|
|
114
|
+
export declare function bridgeSocketEvents(client: BladeClient, _stores?: unknown): AgentSocket;
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AskUserAnswerData } from "../components/chat/AskUserQuestionBlock.js";
|
|
2
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
3
|
+
export type AnswerCallback = (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
|
|
4
|
+
interface AnswerCallbackState extends ClientAwareState {
|
|
5
|
+
callbacks: Record<string, AnswerCallback | undefined>;
|
|
6
|
+
setAnswerCallback: (sessionId: string, callback?: AnswerCallback) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useAnswerCallbackStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AnswerCallbackState>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
interface User {
|
|
3
|
+
id: string;
|
|
4
|
+
username: string;
|
|
5
|
+
display_name?: string | null;
|
|
6
|
+
avatar_url: string | null;
|
|
7
|
+
is_admin?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AuthState extends ClientAwareState {
|
|
10
|
+
token: string | null;
|
|
11
|
+
socketAuthToken: string | null;
|
|
12
|
+
user: User | null;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
error: string | null;
|
|
15
|
+
logout: () => void;
|
|
16
|
+
checkAuth: () => Promise<void>;
|
|
17
|
+
hydrateFromCookie: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare const useAuthStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AuthState>, "persist" | "setState"> & {
|
|
20
|
+
setState(partial: AuthState | Partial<AuthState> | ((state: AuthState) => AuthState | Partial<AuthState>), replace?: false | undefined): unknown;
|
|
21
|
+
setState(state: AuthState | ((state: AuthState) => AuthState), replace: true): unknown;
|
|
22
|
+
persist: {
|
|
23
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AuthState, {
|
|
24
|
+
token: string | null;
|
|
25
|
+
user: User | null;
|
|
26
|
+
}, unknown>>) => void;
|
|
27
|
+
clearStorage: () => void;
|
|
28
|
+
rehydrate: () => Promise<void> | void;
|
|
29
|
+
hasHydrated: () => boolean;
|
|
30
|
+
onHydrate: (fn: (state: AuthState) => void) => () => void;
|
|
31
|
+
onFinishHydration: (fn: (state: AuthState) => void) => () => void;
|
|
32
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, {
|
|
33
|
+
token: string | null;
|
|
34
|
+
user: User | null;
|
|
35
|
+
}, unknown>>;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BackgroundTask } from "../schemas/background.js";
|
|
2
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
3
|
+
interface BackgroundState extends ClientAwareState {
|
|
4
|
+
tasks: Record<string, BackgroundTask[]>;
|
|
5
|
+
selectedTaskId: Record<string, string | null>;
|
|
6
|
+
dismissedTaskIds: Record<string, string[]>;
|
|
7
|
+
setTasks: (sessionId: string, tasks: BackgroundTask[]) => void;
|
|
8
|
+
upsertTask: (sessionId: string, task: BackgroundTask) => void;
|
|
9
|
+
selectTask: (sessionId: string, taskId: string | null) => void;
|
|
10
|
+
dismissTask: (sessionId: string, taskId: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useBackgroundStore: import("zustand").UseBoundStore<import("zustand").StoreApi<BackgroundState>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
interface CardStateStore extends ClientAwareState {
|
|
3
|
+
states: Record<string, unknown>;
|
|
4
|
+
getCardState: <T>(cardId: string) => T | undefined;
|
|
5
|
+
setCardState: <T>(cardId: string, state: T) => void;
|
|
6
|
+
removeCardState: (cardId: string) => void;
|
|
7
|
+
clearAllStates: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useCardStateStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CardStateStore>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AskUserAnswerData } from "../components/chat/AskUserQuestionBlock.js";
|
|
2
|
+
import type { ChatMessage, CompactionInfo, MessageContent } from "../schemas/message.js";
|
|
3
|
+
import type { PatchEnvelope, TurnProjection } from "../schemas/projection.js";
|
|
4
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
5
|
+
export declare function setChatStoreSessionAccessor(fn: () => string | null): void;
|
|
6
|
+
export interface AgentLoopInfo {
|
|
7
|
+
toolCallId: string;
|
|
8
|
+
description: string;
|
|
9
|
+
status: "running" | "done" | "error" | "cancelled" | "awaiting_answer";
|
|
10
|
+
}
|
|
11
|
+
export interface ActiveCompactionState extends CompactionInfo {
|
|
12
|
+
turn_id: string;
|
|
13
|
+
status: "streaming" | "completed" | "paused" | "failed" | "interrupted";
|
|
14
|
+
}
|
|
15
|
+
interface ChatState extends ClientAwareState {
|
|
16
|
+
turns: Record<string, TurnProjection[]>;
|
|
17
|
+
messages: Record<string, ChatMessage[]>;
|
|
18
|
+
askAnswers: Record<string, Record<string, AskUserAnswerData>>;
|
|
19
|
+
isStreaming: Record<string, boolean>;
|
|
20
|
+
agentLoops: Record<string, Record<string, AgentLoopInfo>>;
|
|
21
|
+
activeCompactions: Record<string, ActiveCompactionState | null>;
|
|
22
|
+
addUserMessage: (sessionId: string, content: MessageContent) => void;
|
|
23
|
+
setTurns: (sessionId: string, turns: TurnProjection[]) => void;
|
|
24
|
+
upsertTurn: (sessionId: string, turn: TurnProjection) => void;
|
|
25
|
+
applyTurnPatch: (sessionId: string, patch: PatchEnvelope) => void;
|
|
26
|
+
addErrorMessage: (sessionId: string, content: string) => void;
|
|
27
|
+
markInterrupted: (sessionId: string) => void;
|
|
28
|
+
markFailed: (sessionId: string) => void;
|
|
29
|
+
setStreaming: (sessionId: string, streaming: boolean) => void;
|
|
30
|
+
setAskAnswers: (sessionId: string, answers: Record<string, AskUserAnswerData>) => void;
|
|
31
|
+
clearMessages: (sessionId: string) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const useChatStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ChatState>>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StoreApi } from "zustand";
|
|
2
|
+
import type { BladeClient } from "../../client/index.js";
|
|
3
|
+
export interface ClientAwareState {
|
|
4
|
+
_client: BladeClient | null;
|
|
5
|
+
setClient: (client: BladeClient) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createClientActions<T extends ClientAwareState>(set: StoreApi<T>["setState"]): ClientAwareState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
export type ConnectionStatus = "connecting" | "connected" | "disconnected";
|
|
3
|
+
export interface ConnectionState extends ClientAwareState {
|
|
4
|
+
status: ConnectionStatus;
|
|
5
|
+
reconnectAttempt: number;
|
|
6
|
+
lastConnectedAt: number | null;
|
|
7
|
+
lastDisconnectedAt: number | null;
|
|
8
|
+
hasEverConnected: boolean;
|
|
9
|
+
markConnecting: (attempt?: number) => void;
|
|
10
|
+
markConnected: () => void;
|
|
11
|
+
markDisconnected: () => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const useConnectionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConnectionState>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GisGoal, GisMapCommand, GisResource, GisTarget } from "../schemas/gis.js";
|
|
2
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
3
|
+
interface GisStateStore extends ClientAwareState {
|
|
4
|
+
goalsBySession: Record<string, GisGoal[]>;
|
|
5
|
+
resourcesBySession: Record<string, GisResource[]>;
|
|
6
|
+
targetsBySession: Record<string, GisTarget[]>;
|
|
7
|
+
pendingMapCommandsBySession: Record<string, GisMapCommand[]>;
|
|
8
|
+
setGoals: (sessionId: string, goals: GisGoal[]) => void;
|
|
9
|
+
setResources: (sessionId: string, resources: GisResource[]) => void;
|
|
10
|
+
setTargets: (sessionId: string, targets: GisTarget[]) => void;
|
|
11
|
+
pushMapCommand: (sessionId: string, command: Omit<GisMapCommand, "id" | "createdAt">) => void;
|
|
12
|
+
consumeMapCommand: (sessionId: string, commandId: string) => void;
|
|
13
|
+
getGoals: (sessionId: string) => GisGoal[];
|
|
14
|
+
getResources: (sessionId: string) => GisResource[];
|
|
15
|
+
getTargets: (sessionId: string) => GisTarget[];
|
|
16
|
+
getPendingMapCommands: (sessionId: string) => GisMapCommand[];
|
|
17
|
+
}
|
|
18
|
+
export declare const useGisStore: import("zustand").UseBoundStore<import("zustand").StoreApi<GisStateStore>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { attachClientToStores } from "../bootstrap.js";
|
|
2
|
+
export * from "./answer-callback-store.js";
|
|
3
|
+
export * from "./auth-store.js";
|
|
4
|
+
export * from "./background-store.js";
|
|
5
|
+
export * from "./card-state-store.js";
|
|
6
|
+
export * from "./chat-store.js";
|
|
7
|
+
export * from "./connection-store.js";
|
|
8
|
+
export * from "./gis-store.js";
|
|
9
|
+
export * from "./runtime-features-store.js";
|
|
10
|
+
export * from "./runtime-store.js";
|
|
11
|
+
export * from "./session-store.js";
|
|
12
|
+
export * from "./task-store.js";
|
|
13
|
+
export * from "./ui-bridge-store.js";
|
|
14
|
+
export * from "./ui-store.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
export type AsrProvider = "volcengine" | "qwen";
|
|
3
|
+
interface RuntimeFeaturesState extends ClientAwareState {
|
|
4
|
+
asrEnabled: boolean;
|
|
5
|
+
asrProvider: AsrProvider;
|
|
6
|
+
publicSharingEnabled: boolean;
|
|
7
|
+
memoryEnabled: boolean;
|
|
8
|
+
checkpointsEnabled: boolean;
|
|
9
|
+
setFeatures: (features: {
|
|
10
|
+
asrEnabled?: boolean;
|
|
11
|
+
asrProvider?: AsrProvider;
|
|
12
|
+
publicSharingEnabled?: boolean;
|
|
13
|
+
memoryEnabled?: boolean;
|
|
14
|
+
checkpointsEnabled?: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 运行期特性开关(由后端 /api/config 下发)。默认全部关闭,main.tsx 启动时 fetch 一次填充。
|
|
19
|
+
*/
|
|
20
|
+
export declare const useRuntimeFeaturesStore: import("zustand").UseBoundStore<import("zustand").StoreApi<RuntimeFeaturesState>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
export interface RuntimeEvent {
|
|
3
|
+
id: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
type: string;
|
|
6
|
+
title: string;
|
|
7
|
+
status: "info" | "running" | "done" | "error";
|
|
8
|
+
timestamp: string;
|
|
9
|
+
loopName?: string;
|
|
10
|
+
detail?: string;
|
|
11
|
+
}
|
|
12
|
+
interface RuntimeState extends ClientAwareState {
|
|
13
|
+
events: Record<string, RuntimeEvent[]>;
|
|
14
|
+
addEvent: (sessionId: string, event: Omit<RuntimeEvent, "id" | "sessionId" | "timestamp">) => void;
|
|
15
|
+
clearSession: (sessionId: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const useRuntimeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<RuntimeState>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ModeId, SessionInfo, SessionStatus } from "../schemas/session.js";
|
|
2
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
3
|
+
export type SessionMode = ModeId;
|
|
4
|
+
interface SessionState extends ClientAwareState {
|
|
5
|
+
sessions: SessionInfo[];
|
|
6
|
+
activeSessionId: string | null;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
modes: Record<string, SessionMode>;
|
|
9
|
+
rewindDrafts: Record<string, string>;
|
|
10
|
+
errorMessages: Record<string, string>;
|
|
11
|
+
/** Session IDs that were just created and haven't had their first history load yet */
|
|
12
|
+
_freshSessions: Set<string>;
|
|
13
|
+
fetchAllSessions: () => Promise<void>;
|
|
14
|
+
createSession: (intent?: string) => Promise<string>;
|
|
15
|
+
registerCreatedSession: (session: SessionInfo, mode?: SessionMode, options?: {
|
|
16
|
+
fresh?: boolean;
|
|
17
|
+
}) => void;
|
|
18
|
+
upsertSession: (session: SessionInfo) => void;
|
|
19
|
+
isFreshSession: (sessionId: string) => boolean;
|
|
20
|
+
setActiveSession: (id: string) => void;
|
|
21
|
+
clearActiveSession: () => void;
|
|
22
|
+
deleteSession: (id: string) => Promise<void>;
|
|
23
|
+
updateSessionStatus: (sessionId: string, status: SessionStatus) => void;
|
|
24
|
+
updateSessionIntent: (sessionId: string, intent: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ship-attack v2:通用增量更新 session 字段。用于 session:updated 等事件
|
|
27
|
+
* 广播"后端刚改了 session 元数据(intent / bound_skill_id / ...)"时,
|
|
28
|
+
* 前端原地 patch sessions 缓存,而不需要重新拉整个列表。
|
|
29
|
+
*/
|
|
30
|
+
patchSession: (sessionId: string, patch: Partial<SessionInfo>) => void;
|
|
31
|
+
pinSession: (sessionId: string, pinned: boolean) => Promise<void>;
|
|
32
|
+
setErrorMessage: (sessionId: string, message: string) => void;
|
|
33
|
+
clearErrorMessage: (sessionId: string) => void;
|
|
34
|
+
setRewindDraft: (sessionId: string, text: string | null) => void;
|
|
35
|
+
setMode: (sessionId: string, mode: SessionMode) => void;
|
|
36
|
+
togglePlanningMode: (sessionId: string) => void;
|
|
37
|
+
toggleSharing: (sessionId: string) => Promise<void>;
|
|
38
|
+
reset: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function setOnSessionChange(fn: (sessionId: string | null) => void): void;
|
|
41
|
+
/** 侧栏等使用 React Query 拉取会话列表时,与 zustand patch 同步失效。 */
|
|
42
|
+
export declare function invalidateHomeSidebarSessions(): void;
|
|
43
|
+
export declare const useSessionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SessionState>>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Task } from "../schemas/task.js";
|
|
2
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
3
|
+
interface TaskState extends ClientAwareState {
|
|
4
|
+
tasks: Record<string, Task[]>;
|
|
5
|
+
setTasks: (sessionId: string, tasks: Task[]) => void;
|
|
6
|
+
getTasks: (sessionId: string) => Task[];
|
|
7
|
+
}
|
|
8
|
+
export declare const useTaskStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TaskState>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
export interface PendingContextSignal {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
content: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DraftAppendSignal {
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SendRequestSignal {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
interface UiBridgeState extends ClientAwareState {
|
|
16
|
+
pendingContexts: Record<string, PendingContextSignal[]>;
|
|
17
|
+
draftAppends: Record<string, DraftAppendSignal[]>;
|
|
18
|
+
sendRequests: Record<string, SendRequestSignal[]>;
|
|
19
|
+
addPendingContext: (sessionId: string, context: Omit<PendingContextSignal, "id">) => void;
|
|
20
|
+
removePendingContext: (sessionId: string, contextId: string) => void;
|
|
21
|
+
consumePendingContexts: (sessionId: string) => PendingContextSignal[];
|
|
22
|
+
clearPendingContexts: (sessionId: string) => void;
|
|
23
|
+
addDraftAppend: (sessionId: string, text: string) => void;
|
|
24
|
+
consumeDraftAppends: (sessionId: string) => DraftAppendSignal[];
|
|
25
|
+
clearDraftAppends: (sessionId: string) => void;
|
|
26
|
+
addSendRequest: (sessionId: string) => void;
|
|
27
|
+
consumeSendRequests: (sessionId: string) => SendRequestSignal[];
|
|
28
|
+
clearSendRequests: (sessionId: string) => void;
|
|
29
|
+
clearSession: (sessionId: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const useUiBridgeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UiBridgeState>>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ClientAwareState } from "./client-aware.js";
|
|
2
|
+
type ThemeValue = "light" | "dark" | "system";
|
|
3
|
+
export declare function resolveEffectiveTheme(theme: ThemeValue): "light" | "dark";
|
|
4
|
+
export interface PreviewTarget {
|
|
5
|
+
type: "file" | "markdown" | "image" | "url" | "html" | "resource-html" | "resource-uri" | "diff" | "pdf" | "docx" | "video" | "audio" | "download" | "card" | "excel" | "csv" | "ppt";
|
|
6
|
+
content: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Stable identity key for tab deduplication (e.g. file_path). Falls back to title. */
|
|
9
|
+
key?: string;
|
|
10
|
+
/** For diff type: the old content before edit */
|
|
11
|
+
oldContent?: string;
|
|
12
|
+
/** Optional bridge session binding for resource iframes. */
|
|
13
|
+
bridgeSessionId?: string;
|
|
14
|
+
/** Original source file URL when preview content uses a derived representation (e.g. PPT -> PDF). */
|
|
15
|
+
sourceUrl?: string;
|
|
16
|
+
/** Changes when an artifact with the same key is updated in place. */
|
|
17
|
+
revision?: number;
|
|
18
|
+
}
|
|
19
|
+
export type ActiveRightTab = "situation" | "preview" | "skill-test" | "vibe-service" | "vibe-preview" | "vibe-access" | "solution-editor" | "vibe-board";
|
|
20
|
+
interface UpsertArtifactOptions {
|
|
21
|
+
reveal?: boolean;
|
|
22
|
+
activate?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface UiState extends ClientAwareState {
|
|
25
|
+
leftPanelSize: number;
|
|
26
|
+
rightPanelSize: number;
|
|
27
|
+
leftPanelCollapsed: boolean;
|
|
28
|
+
rightPanelCollapsed: boolean;
|
|
29
|
+
activeRightTab: ActiveRightTab;
|
|
30
|
+
rightTabActivationId: number;
|
|
31
|
+
rightPanelAutoJump: boolean;
|
|
32
|
+
rightPanelUnreadTabs: string[];
|
|
33
|
+
/** All open artifact tabs */
|
|
34
|
+
artifacts: PreviewTarget[];
|
|
35
|
+
/** Index of the active tab (-1 if none) */
|
|
36
|
+
activeArtifactIndex: number;
|
|
37
|
+
previewUnreadArtifactKeys: string[];
|
|
38
|
+
theme: ThemeValue;
|
|
39
|
+
setLeftPanelSize: (size: number) => void;
|
|
40
|
+
setRightPanelSize: (size: number) => void;
|
|
41
|
+
setLeftPanelCollapsed: (collapsed: boolean) => void;
|
|
42
|
+
setRightPanelCollapsed: (collapsed: boolean) => void;
|
|
43
|
+
toggleLeftPanel: () => void;
|
|
44
|
+
toggleRightPanel: () => void;
|
|
45
|
+
setActiveRightTab: (tab: ActiveRightTab) => void;
|
|
46
|
+
setRightPanelAutoJump: (enabled: boolean) => void;
|
|
47
|
+
markRightPanelTabUnread: (tab: string) => void;
|
|
48
|
+
clearRightPanelTabUnread: (tab: string) => void;
|
|
49
|
+
markPreviewArtifactUnread: (key: string) => void;
|
|
50
|
+
clearPreviewArtifactUnread: (key: string) => void;
|
|
51
|
+
activateLatestUnreadArtifact: () => void;
|
|
52
|
+
/** Add or update an artifact tab (matched by key/title). Opens the panel automatically. */
|
|
53
|
+
pushArtifact: (target: PreviewTarget) => void;
|
|
54
|
+
/** Add or update an artifact tab with optional reveal/activate control. */
|
|
55
|
+
upsertArtifact: (target: PreviewTarget, options?: UpsertArtifactOptions) => void;
|
|
56
|
+
/** Switch to a tab by index */
|
|
57
|
+
setActiveArtifact: (index: number) => void;
|
|
58
|
+
/** Close a tab by index */
|
|
59
|
+
closeArtifact: (index: number) => void;
|
|
60
|
+
/** Close a tab by stable key if it exists. */
|
|
61
|
+
removeArtifactByKey: (key: string) => void;
|
|
62
|
+
/** Close all tabs and collapse panel */
|
|
63
|
+
clearArtifacts: () => void;
|
|
64
|
+
/** Legacy single-target setter for backwards compat */
|
|
65
|
+
setPreviewTarget: (target: PreviewTarget | null) => void;
|
|
66
|
+
setTheme: (theme: ThemeValue) => void;
|
|
67
|
+
}
|
|
68
|
+
export declare const useUiStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UiState>>;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ModeId, SessionInfo, SessionStatus, SkillEditorTemplateId, TemplateId } from "../schemas/session.js";
|
|
2
|
+
export type { Task, TaskStatus } from "../schemas/task.js";
|
|
3
|
+
export type { ChatMessage, FileContentPart, ToolCallInfo, MessageContent, MessageContentPart, TextContentPart, ImageUrlContentPart, } from "../schemas/message.js";
|
|
4
|
+
export type { ContentBlock, PatchEnvelope, ToolCallProjection, TurnProjection, } from "../schemas/projection.js";
|
|
5
|
+
export type { ContentDelta, ToolCallCreated, ToolResultDelta, ToolResultDone, LlmResponseDone, ChatEnd, SystemError, SessionStatusEvent, } from "../schemas/event.js";
|
|
6
|
+
export type { BackgroundTask } from "../schemas/background.js";
|
|
7
|
+
export type { SkillSummary, SkillDetail } from "../schemas/skill.js";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare enum LayoutType {
|
|
2
|
+
Default = "default",
|
|
3
|
+
SkillEditor = "skill-editor",
|
|
4
|
+
BladeCoa = "blade-coa",
|
|
5
|
+
SolutionEditor = "solution-editor",
|
|
6
|
+
SolutionEditor2 = "solution-editor2",
|
|
7
|
+
ChatPreview = "chat-preview",
|
|
8
|
+
ChatOnly = "chat-only",
|
|
9
|
+
SolutionApp = "solution-app",
|
|
10
|
+
Custom = "custom"
|
|
11
|
+
}
|
|
12
|
+
export interface Solution {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
version: string;
|
|
16
|
+
description?: string | null;
|
|
17
|
+
source?: "builtin" | "personal" | string | null;
|
|
18
|
+
layout_type: LayoutType | string;
|
|
19
|
+
initial_mode?: "planning" | "executing" | string | null;
|
|
20
|
+
initial_message?: string | null;
|
|
21
|
+
preview?: {
|
|
22
|
+
url: string;
|
|
23
|
+
title?: string | null;
|
|
24
|
+
} | null;
|
|
25
|
+
layout?: {
|
|
26
|
+
available?: boolean;
|
|
27
|
+
source_dir?: string;
|
|
28
|
+
entry?: string;
|
|
29
|
+
export?: string;
|
|
30
|
+
} | null;
|
|
31
|
+
roles?: BizRole[] | null;
|
|
32
|
+
data?: Record<string, unknown> | null;
|
|
33
|
+
ui_config?: SolutionAppUiConfig | null;
|
|
34
|
+
}
|
|
35
|
+
export interface SolutionAppUiConfig {
|
|
36
|
+
branding: {
|
|
37
|
+
name: string;
|
|
38
|
+
subtitle?: string;
|
|
39
|
+
icon_text: string;
|
|
40
|
+
icon_gradient?: string;
|
|
41
|
+
};
|
|
42
|
+
list: {
|
|
43
|
+
title: string;
|
|
44
|
+
create_button: string;
|
|
45
|
+
card?: {
|
|
46
|
+
subtitle?: string;
|
|
47
|
+
stats?: Array<{
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
color?: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
create: {
|
|
55
|
+
title: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
submit_button: string;
|
|
58
|
+
sections: Array<{
|
|
59
|
+
id: string;
|
|
60
|
+
title: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
fields: Array<SolutionAppField>;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export type SolutionAppField = {
|
|
67
|
+
id: string;
|
|
68
|
+
kind: "textarea";
|
|
69
|
+
label: string;
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
} | {
|
|
72
|
+
id: string;
|
|
73
|
+
kind: "file-upload";
|
|
74
|
+
accept?: string[];
|
|
75
|
+
categories?: Array<{
|
|
76
|
+
label: string;
|
|
77
|
+
description: string;
|
|
78
|
+
color: string;
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
export interface SolutionAppState {
|
|
82
|
+
pipeline: Array<{
|
|
83
|
+
id: string;
|
|
84
|
+
label: string;
|
|
85
|
+
status: "done" | "active" | "pending" | "error";
|
|
86
|
+
}>;
|
|
87
|
+
meta: Record<string, {
|
|
88
|
+
label: string;
|
|
89
|
+
value: string;
|
|
90
|
+
color?: string;
|
|
91
|
+
}>;
|
|
92
|
+
}
|
|
93
|
+
export interface BizRole {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
description?: string | null;
|
|
97
|
+
preview?: {
|
|
98
|
+
url: string;
|
|
99
|
+
title?: string | null;
|
|
100
|
+
} | null;
|
|
101
|
+
}
|