@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,7 @@
|
|
|
1
|
+
export type AnalyticsEventName = "message_sent" | "skill_invoked" | "session_shared";
|
|
2
|
+
type AnalyticsClient = {
|
|
3
|
+
capture: (name: AnalyticsEventName, props?: Record<string, unknown>) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare function setAnalyticsClient(client: AnalyticsClient | null): void;
|
|
6
|
+
export declare function trackEvent(name: AnalyticsEventName, props?: Record<string, unknown>): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ATTACHMENT_SIZE_LIMIT_BYTES: number;
|
|
2
|
+
export type OversizedFileInfo = {
|
|
3
|
+
name: string;
|
|
4
|
+
size: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function formatFileSize(size: number): string;
|
|
7
|
+
export declare function splitFilesBySize(files: FileList | File[], limitBytes?: number): {
|
|
8
|
+
accepted: File[];
|
|
9
|
+
rejected: OversizedFileInfo[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
export interface Card {
|
|
3
|
+
type: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
payload?: Record<string, unknown>;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CardComponentProps {
|
|
10
|
+
card: Card;
|
|
11
|
+
sendMessage?: (content: string) => Promise<void>;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
}
|
|
14
|
+
export type CardComponent = ComponentType<CardComponentProps>;
|
|
15
|
+
export declare class CardComponentRegistry {
|
|
16
|
+
private readonly components;
|
|
17
|
+
constructor(initial?: Record<string, CardComponent> | Map<string, CardComponent>);
|
|
18
|
+
register(type: string, component: CardComponent): void;
|
|
19
|
+
get(type: string): CardComponent | undefined;
|
|
20
|
+
has(type: string): boolean;
|
|
21
|
+
keys(): string[];
|
|
22
|
+
clear(): void;
|
|
23
|
+
get size(): number;
|
|
24
|
+
}
|
|
25
|
+
export declare const cardRegistry: CardComponentRegistry;
|
|
26
|
+
export interface ParseResult<T> {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
value?: T;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const CardJSON: {
|
|
32
|
+
safeParseJSON<T = unknown>(text: string): ParseResult<T>;
|
|
33
|
+
toCardArray(value: unknown): Card[] | null;
|
|
34
|
+
isCardsLanguage(lang?: string): boolean;
|
|
35
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ChatMessage, FileContentPart, ImageUrlContentPart, MessageContent } from "../schemas/message.js";
|
|
2
|
+
export declare function normalizeMessageContent(content: unknown): MessageContent;
|
|
3
|
+
export declare function getTextContent(content: MessageContent): string;
|
|
4
|
+
export declare function isSystemReminderText(text: string): boolean;
|
|
5
|
+
export declare function isLegacyForkContextText(text: string): boolean;
|
|
6
|
+
export declare function isHiddenInternalMessage(message: Pick<ChatMessage, "role" | "content">): boolean;
|
|
7
|
+
export declare function buildMessageContent(text: string, attachments: Array<{
|
|
8
|
+
kind: "file";
|
|
9
|
+
name: string;
|
|
10
|
+
uploadedPath?: string;
|
|
11
|
+
textContent?: string | null;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
}>): MessageContent;
|
|
14
|
+
export declare function contentPreview(content: MessageContent, maxLen?: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* Transform a skill mention into a natural language skill invocation.
|
|
17
|
+
* Strips the `<skill>name</skill>` tag from the raw input and prepends the instruction.
|
|
18
|
+
*/
|
|
19
|
+
export declare function transformSlashCommand(skillName: string, rawInput: string): string;
|
|
20
|
+
export interface ParsedTextAttachment {
|
|
21
|
+
name: string;
|
|
22
|
+
uploadedPath?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ParsedTextContext {
|
|
25
|
+
label: string;
|
|
26
|
+
content: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Extract `[附件: name]` and `[上下文: label]` tags from text parts and return
|
|
30
|
+
* the cleaned text plus the collected attachment / context metadata. 每个 text
|
|
31
|
+
* part 独立匹配,以避免跨 part 拼接打乱正则。
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractTextAttachments(content: MessageContent): {
|
|
34
|
+
cleanText: string;
|
|
35
|
+
attachments: ParsedTextAttachment[];
|
|
36
|
+
contexts: ParsedTextContext[];
|
|
37
|
+
};
|
|
38
|
+
export declare function getImageParts(content: MessageContent): ImageUrlContentPart[];
|
|
39
|
+
export declare function getFileParts(content: MessageContent): FileContentPart[];
|
|
40
|
+
interface MessageGroup {
|
|
41
|
+
root: ChatMessage | null;
|
|
42
|
+
childLoops: {
|
|
43
|
+
loopName: string;
|
|
44
|
+
messages: ChatMessage[];
|
|
45
|
+
}[];
|
|
46
|
+
}
|
|
47
|
+
export declare function groupMessagesByLoop(messages: ChatMessage[]): MessageGroup[];
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const SUPPORTED_LANGUAGES: readonly ["python", "javascript", "typescript", "tsx", "jsx", "yaml", "markdown", "bash", "json", "go", "rust", "css", "html"];
|
|
2
|
+
export type SupportedCodeLanguage = (typeof SUPPORTED_LANGUAGES)[number];
|
|
3
|
+
export declare function normalizeCodeLanguage(language?: string | null): SupportedCodeLanguage | null;
|
|
4
|
+
export declare function getCodeLanguageFromFilename(filePath?: string | null): SupportedCodeLanguage | null;
|
|
5
|
+
export declare function useHighlightedCodeHtml(code: string, language?: string | null): {
|
|
6
|
+
highlightedHtml: string | null;
|
|
7
|
+
language: "bash" | "css" | "go" | "html" | "javascript" | "json" | "jsx" | "markdown" | "python" | "rust" | "tsx" | "typescript" | "yaml" | null;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export interface HtmlElementSelectionRaw {
|
|
2
|
+
tag: string;
|
|
3
|
+
selectionMode?: "single" | "group";
|
|
4
|
+
groupLabel?: string;
|
|
5
|
+
groupCount?: number;
|
|
6
|
+
groupItems?: HtmlElementSelectionGroupItem[];
|
|
7
|
+
visibleText?: string;
|
|
8
|
+
accessibleName?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
attributes?: Record<string, string>;
|
|
11
|
+
selectors?: HtmlElementSelector[];
|
|
12
|
+
domPath?: string;
|
|
13
|
+
rect?: HtmlElementRect;
|
|
14
|
+
style?: Record<string, string>;
|
|
15
|
+
surroundings?: HtmlElementSurroundings;
|
|
16
|
+
viewport?: {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
devicePixelRatio: number;
|
|
20
|
+
};
|
|
21
|
+
screenshotDataUrl?: string;
|
|
22
|
+
screenshotStatus?: "included" | "failed";
|
|
23
|
+
screenshotError?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HtmlElementSelectionGroupItem {
|
|
26
|
+
label?: string;
|
|
27
|
+
tag: string;
|
|
28
|
+
role?: string;
|
|
29
|
+
visibleText?: string;
|
|
30
|
+
accessibleName?: string;
|
|
31
|
+
selectors?: HtmlElementSelector[];
|
|
32
|
+
domPath?: string;
|
|
33
|
+
rect?: HtmlElementRect;
|
|
34
|
+
}
|
|
35
|
+
export interface HtmlElementSelector {
|
|
36
|
+
kind: string;
|
|
37
|
+
value: string;
|
|
38
|
+
confidence: "high" | "medium" | "low";
|
|
39
|
+
}
|
|
40
|
+
export interface HtmlElementRect {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}
|
|
46
|
+
export interface HtmlElementSurroundings {
|
|
47
|
+
parentSummary?: string;
|
|
48
|
+
childrenSummary?: string[];
|
|
49
|
+
previousSiblings?: string[];
|
|
50
|
+
nextSiblings?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface HtmlElementSelectionContext {
|
|
53
|
+
schema: "blade.html_element_selection.v1";
|
|
54
|
+
selected_at: string;
|
|
55
|
+
source_kind: "html_file" | "running_page";
|
|
56
|
+
file: {
|
|
57
|
+
path: string;
|
|
58
|
+
name: string;
|
|
59
|
+
language: "html";
|
|
60
|
+
content_hash: string;
|
|
61
|
+
};
|
|
62
|
+
preview: {
|
|
63
|
+
mode: "render" | "running_page";
|
|
64
|
+
title?: string;
|
|
65
|
+
url?: string;
|
|
66
|
+
viewport: {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
device_pixel_ratio: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
element: {
|
|
73
|
+
label: string;
|
|
74
|
+
tag: string;
|
|
75
|
+
role?: string;
|
|
76
|
+
accessible_name?: string;
|
|
77
|
+
visible_text?: string;
|
|
78
|
+
attributes: Record<string, string>;
|
|
79
|
+
selectors: HtmlElementSelector[];
|
|
80
|
+
dom_path?: string;
|
|
81
|
+
rect?: HtmlElementRect;
|
|
82
|
+
style: Record<string, string>;
|
|
83
|
+
};
|
|
84
|
+
group?: {
|
|
85
|
+
label: string;
|
|
86
|
+
count: number;
|
|
87
|
+
items: Array<{
|
|
88
|
+
label?: string;
|
|
89
|
+
tag: string;
|
|
90
|
+
role?: string;
|
|
91
|
+
accessible_name?: string;
|
|
92
|
+
visible_text?: string;
|
|
93
|
+
selectors: HtmlElementSelector[];
|
|
94
|
+
dom_path?: string;
|
|
95
|
+
rect?: HtmlElementRect;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
98
|
+
source: {
|
|
99
|
+
snippet?: string;
|
|
100
|
+
start_line?: number;
|
|
101
|
+
end_line?: number;
|
|
102
|
+
start_column?: number;
|
|
103
|
+
end_column?: number;
|
|
104
|
+
search_anchors: string[];
|
|
105
|
+
locator_confidence: "high" | "medium" | "low";
|
|
106
|
+
reason: string;
|
|
107
|
+
};
|
|
108
|
+
surroundings: {
|
|
109
|
+
parent_summary?: string;
|
|
110
|
+
children_summary?: string[];
|
|
111
|
+
previous_siblings?: string[];
|
|
112
|
+
next_siblings?: string[];
|
|
113
|
+
};
|
|
114
|
+
screenshot?: {
|
|
115
|
+
included: boolean;
|
|
116
|
+
note: string;
|
|
117
|
+
reason?: string;
|
|
118
|
+
};
|
|
119
|
+
limits: {
|
|
120
|
+
truncated: boolean;
|
|
121
|
+
omitted_sensitive_fields: string[];
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export interface BuildHtmlElementSelectionInput {
|
|
125
|
+
filePath: string;
|
|
126
|
+
fileName?: string;
|
|
127
|
+
title?: string;
|
|
128
|
+
html?: string;
|
|
129
|
+
sourceKind?: "html_file" | "running_page";
|
|
130
|
+
pageUrl?: string;
|
|
131
|
+
selection: HtmlElementSelectionRaw;
|
|
132
|
+
selectedAt?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface PendingHtmlElementContext {
|
|
135
|
+
label: string;
|
|
136
|
+
content: string;
|
|
137
|
+
context: HtmlElementSelectionContext;
|
|
138
|
+
imageUrl?: string;
|
|
139
|
+
}
|
|
140
|
+
export declare function buildHtmlElementSelectionContext(input: BuildHtmlElementSelectionInput): PendingHtmlElementContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface HtmlSourceLocatorElement {
|
|
2
|
+
tag: string;
|
|
3
|
+
attributes?: Record<string, string>;
|
|
4
|
+
visibleText?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HtmlSourceLocation {
|
|
7
|
+
snippet?: string;
|
|
8
|
+
startLine?: number;
|
|
9
|
+
endLine?: number;
|
|
10
|
+
startColumn?: number;
|
|
11
|
+
endColumn?: number;
|
|
12
|
+
searchAnchors: string[];
|
|
13
|
+
locatorConfidence: "high" | "medium" | "low";
|
|
14
|
+
reason: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function locateHtmlElementSource(html: string, element: HtmlSourceLocatorElement): HtmlSourceLocation;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface BladeBridgeEnvelope {
|
|
2
|
+
__bladeBridge: true;
|
|
3
|
+
direction: "agent-to-host" | "host-to-agent";
|
|
4
|
+
action: string;
|
|
5
|
+
payload?: unknown;
|
|
6
|
+
meta?: {
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
toolCallId?: string;
|
|
9
|
+
timestamp?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface HostBridgeStateSnapshot {
|
|
13
|
+
sessionId: string | null;
|
|
14
|
+
activeSessionId: string | null;
|
|
15
|
+
isStreaming: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type BladeBridgeHandler = (envelope: BladeBridgeEnvelope) => void;
|
|
18
|
+
export declare function isInsideIframe(): boolean;
|
|
19
|
+
export declare function subscribeBladeBridge(handler: BladeBridgeHandler): () => void;
|
|
20
|
+
export declare function dispatchBladeBridge(envelope: BladeBridgeEnvelope): void;
|
|
21
|
+
export declare function postToParent(envelope: BladeBridgeEnvelope): void;
|
|
22
|
+
export declare function attachHostBridgeListener(getState: () => HostBridgeStateSnapshot): () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按文件扩展名决定预览渲染方式(R6)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么按扩展名不按 MIME:当前消息 schema 里 FileContentPart / TextAttachment
|
|
5
|
+
* 都只存 `name` + `uploadedPath`,没有 mime_type(见 design.md §3.6)。
|
|
6
|
+
* 改 schema 面太大,扩展名在实际数据里足够稳定(前端上传时就是文件名)。
|
|
7
|
+
*
|
|
8
|
+
* 动图(.gif/.webp/.apng/.avif)归为 image,因为浏览器 `<img>` 原生播放。
|
|
9
|
+
* video 类扩展名本期不覆盖(见 design.md §3.6 决策:"只动图,不视频")。
|
|
10
|
+
*/
|
|
11
|
+
export type PreviewKind = "image" | "text" | "default";
|
|
12
|
+
export interface PreviewDescriptor {
|
|
13
|
+
kind: PreviewKind;
|
|
14
|
+
filename: string;
|
|
15
|
+
url: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 判断扩展名能不能用 `<img>` 预览(含动图)。
|
|
19
|
+
* 独立导出是为了让调用方可以在不走完整 dispatchPreview 的场景(如 UserMessageBubble
|
|
20
|
+
* 已经在 render 时把图片渲染成 <img>,不需要再走 kind 分派)直接查一次。
|
|
21
|
+
*/
|
|
22
|
+
export declare function isImageFilename(filename: string): boolean;
|
|
23
|
+
export declare function isTextFilename(filename: string): boolean;
|
|
24
|
+
export declare function dispatchPreview(filename: string, url: string): PreviewDescriptor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const BRIDGE_ACTIONS: readonly ["addContext", "appendInput", "sendMessage"];
|
|
2
|
+
export type ResourceBridgeAction = (typeof BRIDGE_ACTIONS)[number];
|
|
3
|
+
export interface ResourceBridgeDispatchParams {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
activeSessionId: string | null;
|
|
6
|
+
isStreaming: boolean;
|
|
7
|
+
action: string;
|
|
8
|
+
payload?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export declare function resourceBridgeDispatch({ sessionId, activeSessionId, isStreaming, action, payload, }: ResourceBridgeDispatchParams): boolean;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreviewTarget } from "../stores/ui-store.js";
|
|
2
|
+
export declare function getSessionFilePath(sessionId: string, filePath: string): string;
|
|
3
|
+
export declare function buildBinaryPreviewTarget(fileUrl: string, downloadUrl: string, filePath: string, fileName?: string): PreviewTarget | null;
|
|
4
|
+
export declare function buildSessionBinaryPreviewTarget(sessionId: string, filePath: string, fileName?: string): PreviewTarget | null;
|
|
5
|
+
/** 判断文件是否需要后端 soffice 转 PDF 才能预览 */
|
|
6
|
+
export declare function isOfficePdfPreviewable(fileName: string): boolean;
|
|
7
|
+
export declare function resolveTextPreviewType(fileName: string): PreviewTarget["type"];
|
|
8
|
+
export declare function resolveSessionFilePreviewTarget(sessionId: string, filePath: string, fileName?: string): Promise<PreviewTarget>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ChatMessage } from "../schemas/message.js";
|
|
2
|
+
/**
|
|
3
|
+
* 每个 step 在消息流中的一段连续范围(R5 whatif 重跑的边界单位)。
|
|
4
|
+
*
|
|
5
|
+
* `[startIndex, endIndex)` 包含所有属于这个 step 的消息。
|
|
6
|
+
* - 中间段:endIndex == 下一段的 startIndex(把本段 assistant 总结纳入本段)
|
|
7
|
+
* - 末段:endIndex 停在最后一条显式 tag 该 step 的消息之后,避免把跑完 skill
|
|
8
|
+
* 后的闲聊尾段误当成 step 的一部分
|
|
9
|
+
*
|
|
10
|
+
* 同一 stepNumber 可以在 stepRanges 里出现多次(每次 what-if 重跑后 step3/4
|
|
11
|
+
* 会产生新一段),每次出现都是独立 range。
|
|
12
|
+
*/
|
|
13
|
+
export interface StepMessageRange {
|
|
14
|
+
stepNumber: number;
|
|
15
|
+
startIndex: number;
|
|
16
|
+
endIndex: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 把消息流切成 step-aligned 的 ranges 数组(纯函数)。
|
|
20
|
+
*
|
|
21
|
+
* 传 `steps` 只是为了拿 stepNumber 白名单,所以参数接受任何带 `stepNumber` 字段
|
|
22
|
+
* 的对象,避免引入 apps/web 的 StepInfo 依赖。
|
|
23
|
+
*
|
|
24
|
+
* 算法概述:
|
|
25
|
+
* 1. 每条消息过 `findStepInMessage`,得到 perMessageStep[]
|
|
26
|
+
* 2. 顺序扫,遇到 step transition 时开新段;往前吃紧邻的 Q&A(user/assistant),
|
|
27
|
+
* 遇到 what-if 重跑 user 消息立即停(它是边界)
|
|
28
|
+
* 3. 末段 endIndex 停在最后一条 tag 该 step 的消息之后(避免吞下尾部闲聊)
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildStepRanges(messages: ChatMessage[], steps: ReadonlyArray<{
|
|
31
|
+
stepNumber: number;
|
|
32
|
+
}>): StepMessageRange[];
|
|
33
|
+
/**
|
|
34
|
+
* 从 stepRanges 里按 step 归属筛选出需作废(whatif)的消息 id。
|
|
35
|
+
*
|
|
36
|
+
* 输入 `fromStep = min(quotes.map(q => q.step_number))`,返回 stepNumber >=
|
|
37
|
+
* fromStep 的每段 range 内所有 message.entry_id,按 range.startIndex 升序。
|
|
38
|
+
* 重复 id 自动去重。
|
|
39
|
+
*
|
|
40
|
+
* 纯函数,便于放在 core 供 apps/web 的 hook 共用并独立单测。
|
|
41
|
+
*/
|
|
42
|
+
export declare function deriveDeprecateEntryIds(stepRanges: StepMessageRange[], messages: ChatMessage[], fromStep: number): string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 把 whatif-rerun 后端组装的 prompt 文本解析成可折叠展示的结构。
|
|
3
|
+
*
|
|
4
|
+
* 当前后端格式(`host/orchestrator/whatif_rerun.py::_compose_whatif_prompt`):
|
|
5
|
+
*
|
|
6
|
+
* 以下消息和 step 产物标记为 deprecated_by_rerun,请基于最新用户假设从 step{N} 开始完整重新推演,不要复用旧结论。
|
|
7
|
+
*
|
|
8
|
+
* [引用]
|
|
9
|
+
* [步骤{n} · {label}]
|
|
10
|
+
* {snapshot markdown…(内部允许空行)}
|
|
11
|
+
* [步骤{m} · {label}]
|
|
12
|
+
* {snapshot markdown…}
|
|
13
|
+
*
|
|
14
|
+
* [用户输入]
|
|
15
|
+
* {用户真正输入的文本}
|
|
16
|
+
*
|
|
17
|
+
* Legacy 格式(历史 session 里没有 `[用户输入]` 标签):
|
|
18
|
+
* …最后一条 snapshot 末尾…
|
|
19
|
+
* <空行>
|
|
20
|
+
* {用户真正输入的文本}
|
|
21
|
+
*
|
|
22
|
+
* Legacy 情况下用"从末尾反向扫描第一段连续空行"做切分。markdown 末尾段落
|
|
23
|
+
* 被误吃的风险可接受——总比让用户完全看不到自己的输入好。
|
|
24
|
+
*/
|
|
25
|
+
export interface WhatIfQuote {
|
|
26
|
+
stepNumber: number | null;
|
|
27
|
+
label: string;
|
|
28
|
+
snapshot: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ParsedWhatIfPrompt {
|
|
31
|
+
fromStep: number | null;
|
|
32
|
+
quotes: WhatIfQuote[];
|
|
33
|
+
userText: string;
|
|
34
|
+
}
|
|
35
|
+
export interface BuildWhatIfPromptInput {
|
|
36
|
+
fromStep: number;
|
|
37
|
+
quotes: Array<{
|
|
38
|
+
stepNumber?: number | null;
|
|
39
|
+
label?: string | null;
|
|
40
|
+
snapshot?: string | null;
|
|
41
|
+
}>;
|
|
42
|
+
userText: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function buildWhatIfPrompt({ fromStep, quotes, userText, }: BuildWhatIfPromptInput): string;
|
|
45
|
+
export declare function parseWhatIfPrompt(text: string): ParsedWhatIfPrompt | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { TurnProjection } from "../schemas/projection.js";
|
|
2
|
+
export interface RawEvent {
|
|
3
|
+
type: string;
|
|
4
|
+
payload: Record<string, unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type ProjectionUpdate = {
|
|
7
|
+
kind: "upsert";
|
|
8
|
+
turn: TurnProjection;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "workspace_changed";
|
|
11
|
+
loopId: string;
|
|
12
|
+
toolCallId?: string;
|
|
13
|
+
toolName?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class ClientProjectionBuilder {
|
|
16
|
+
private activeTurns;
|
|
17
|
+
private lastTurnIds;
|
|
18
|
+
private latestTurns;
|
|
19
|
+
private loopDescriptions;
|
|
20
|
+
private pendingChildPauses;
|
|
21
|
+
private pendingMemoryRefs;
|
|
22
|
+
private activeCompactions;
|
|
23
|
+
private seq;
|
|
24
|
+
private syntheticCounter;
|
|
25
|
+
private displayNameResolver;
|
|
26
|
+
constructor(displayNameResolver?: (name: string) => string);
|
|
27
|
+
processBatch(events: RawEvent[]): ProjectionUpdate[];
|
|
28
|
+
processEvent(event: RawEvent): ProjectionUpdate[] | null;
|
|
29
|
+
reset(): void;
|
|
30
|
+
seedSequence(maxSeq: number): void;
|
|
31
|
+
private onMemoryInject;
|
|
32
|
+
private onLoopTurn;
|
|
33
|
+
private onModeChange;
|
|
34
|
+
private onPlanStatusUpdate;
|
|
35
|
+
private onWorkspaceChanged;
|
|
36
|
+
private onAgentStart;
|
|
37
|
+
private onBgStarted;
|
|
38
|
+
private onBgTasksCompleted;
|
|
39
|
+
private onAskUserAnswer;
|
|
40
|
+
private onUserMessage;
|
|
41
|
+
private onDelta;
|
|
42
|
+
private onToolCallCreated;
|
|
43
|
+
private onResponseDone;
|
|
44
|
+
private onToolResultDone;
|
|
45
|
+
private onToolResultDelta;
|
|
46
|
+
private onToolUi;
|
|
47
|
+
private onToolBridge;
|
|
48
|
+
private onToolApprovalRequired;
|
|
49
|
+
private onChildPause;
|
|
50
|
+
private onChatEnd;
|
|
51
|
+
private onAgentEnd;
|
|
52
|
+
private onCompaction;
|
|
53
|
+
private syncPatch;
|
|
54
|
+
private finalize;
|
|
55
|
+
private shouldFinalizeAfterToolResults;
|
|
56
|
+
private collectLoopUpdates;
|
|
57
|
+
private nextSeq;
|
|
58
|
+
private nextTurnId;
|
|
59
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ContentBlock, PendingQuestionRef, ToolCallProjection, TurnProjection } from "../schemas/projection.js";
|
|
2
|
+
import type { TurnState } from "./state.js";
|
|
3
|
+
export declare function upsertToolCall(state: TurnState, toolCallId: string, toolName: string, displayName: string, args: string): void;
|
|
4
|
+
export declare function applyToolResult(state: TurnState, toolCallId: string, result: unknown, status: ToolCallProjection["status"], durationMs: number | null, sourceLoop: {
|
|
5
|
+
loop_name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
} | null): void;
|
|
8
|
+
export declare function appendToolResultDelta(state: TurnState, toolCallId: string, delta: string): void;
|
|
9
|
+
export declare function appendTextBlock(state: TurnState, blockType: ContentBlock["type"], content: unknown): void;
|
|
10
|
+
export declare function appendToolCallArguments(state: TurnState, toolCallId: string, delta: string): void;
|
|
11
|
+
export declare function buildSystemNotificationTurn(sequence: number, turnId: string, loopId: string, notificationType: string, status: string, title: string, detail: string | null, metadata: Record<string, unknown>): TurnProjection;
|
|
12
|
+
export declare function buildSystemNotificationBlock(notificationType: string, status: string, title: string, detail: string | null, metadata: Record<string, unknown>): ContentBlock;
|
|
13
|
+
export declare function buildMarkerTurn(sequence: number, turnId: string, loopId: string, blockType: ContentBlock["type"], content: unknown): TurnProjection;
|
|
14
|
+
export declare function buildCompactionTurn(sequence: number, compactionId: string, loopId: string, status: TurnProjection["status"], data: Record<string, unknown>): TurnProjection;
|
|
15
|
+
export interface ChildPauseInfo {
|
|
16
|
+
parentLoopName: string;
|
|
17
|
+
parentToolCallId: string;
|
|
18
|
+
childLoopName: string;
|
|
19
|
+
childToolCallId: string;
|
|
20
|
+
description: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function setToolCallStatus(turn: TurnState | TurnProjection | null | undefined, toolCallId: string, status: ToolCallProjection["status"], result: unknown, pendingQuestionRef: PendingQuestionRef | null): void;
|
|
23
|
+
export declare function applyAskUserPauseToTurn(turn: TurnState | TurnProjection | null | undefined, pauseToolData: Record<string, unknown>, toolCallId: string, childLoopName: string, description: string, displayNameResolver: (name: string) => string): void;
|
|
24
|
+
export declare function applyChildPauseToParent(parentTurn: TurnState | TurnProjection | null | undefined, parentToolCallId: string, childLoopName: string, childToolCallId: string, description: string, displayNameResolver: (name: string) => string): void;
|
|
25
|
+
export declare function sourceLoopFor(loopId: string, loopDescriptions: Map<string, string>): {
|
|
26
|
+
loop_name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
} | null;
|
|
29
|
+
export declare function normalizeChildPause(pausePayload: Record<string, unknown>): {
|
|
30
|
+
pauseToolData: Record<string, unknown>;
|
|
31
|
+
childLoopName: string;
|
|
32
|
+
childToolCallId: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ContentBlock, MemoryRef, ToolCallProjection, TurnProjection } from "../schemas/projection.js";
|
|
2
|
+
export interface TurnState {
|
|
3
|
+
turnId: string;
|
|
4
|
+
loopId: string;
|
|
5
|
+
role: "user" | "assistant" | "system";
|
|
6
|
+
model: string | null;
|
|
7
|
+
startedAt: number;
|
|
8
|
+
contextWindow: number;
|
|
9
|
+
blocks: ContentBlock[];
|
|
10
|
+
toolCalls: ToolCallProjection[];
|
|
11
|
+
usage: Record<string, unknown> | null;
|
|
12
|
+
memoryRefs: MemoryRef[] | null;
|
|
13
|
+
parentForkToolCallId: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function createTurnState(turnId: string, loopId: string, opts?: {
|
|
16
|
+
model?: string | null;
|
|
17
|
+
contextWindow?: number;
|
|
18
|
+
memoryRefs?: MemoryRef[] | null;
|
|
19
|
+
}): TurnState;
|
|
20
|
+
export declare function snapshot(state: TurnState, sequence: number, status: TurnProjection["status"]): TurnProjection;
|
|
21
|
+
export declare const PAUSE_TOOL_NAMES: Set<string>;
|
|
22
|
+
export declare function toolStatusFromResult(result: unknown): ToolCallProjection["status"];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { BladeClient } from "../client/index.js";
|
|
3
|
+
export interface BladeClientProviderProps {
|
|
4
|
+
client?: BladeClient;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function BladeClientProvider({ client, children }: BladeClientProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useBladeClient(): BladeClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MEMORIES_ROUTE = "/memories";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface BackgroundTask {
|
|
2
|
+
id: string;
|
|
3
|
+
command: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
status: "queued" | "starting" | "running" | "succeeded" | "done" | "failed" | "timeout" | "cancelled" | "lost";
|
|
6
|
+
legacy_status?: "running" | "done" | "failed";
|
|
7
|
+
exit_code?: number | null;
|
|
8
|
+
elapsed_seconds: number;
|
|
9
|
+
output_lines_count?: number;
|
|
10
|
+
output_preview?: string[];
|
|
11
|
+
output?: string;
|
|
12
|
+
log_path?: string | null;
|
|
13
|
+
started_at?: number | null;
|
|
14
|
+
finished_at?: number | null;
|
|
15
|
+
heartbeat_at?: number | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface ContentDelta {
|
|
2
|
+
content: string;
|
|
3
|
+
loop_name?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ToolCallCreated {
|
|
6
|
+
index: number;
|
|
7
|
+
id: string;
|
|
8
|
+
loop_name?: string;
|
|
9
|
+
function: {
|
|
10
|
+
name: string;
|
|
11
|
+
arguments: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface ToolResultDone {
|
|
15
|
+
tool_call_id: string;
|
|
16
|
+
loop_name?: string;
|
|
17
|
+
function: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolResultDelta {
|
|
23
|
+
tool_call_id: string;
|
|
24
|
+
loop_name?: string;
|
|
25
|
+
content: string;
|
|
26
|
+
stream?: "stdout" | "stderr";
|
|
27
|
+
}
|
|
28
|
+
export interface LlmResponseDone {
|
|
29
|
+
role: string;
|
|
30
|
+
content?: string | null;
|
|
31
|
+
reasoning?: string | null;
|
|
32
|
+
loop_name?: string;
|
|
33
|
+
tool_calls?: {
|
|
34
|
+
id: string;
|
|
35
|
+
function: {
|
|
36
|
+
name: string;
|
|
37
|
+
arguments: string;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
}
|
|
41
|
+
export interface ChatEnd {
|
|
42
|
+
status: string;
|
|
43
|
+
duration_ms: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SystemError {
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SessionStatusEvent {
|
|
49
|
+
session_id: string;
|
|
50
|
+
status: string;
|
|
51
|
+
}
|