@blade-hq/agent-kit 0.5.2 → 0.5.4

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.
Files changed (31) hide show
  1. package/dist/{SkillStatusBar-DpbkD4Jx.d.ts → SkillStatusBar-BKAGU9tr.d.ts} +5 -3
  2. package/dist/{blade-client-CFvmjs5R.d.ts → blade-client-R3cLVOYs.d.ts} +25 -3
  3. package/dist/{chunk-4ZEOWH6U.js → chunk-3ZEWA2YM.js} +2 -2
  4. package/dist/{chunk-LVLGDM76.js → chunk-557R7QZV.js} +2 -2
  5. package/dist/{chunk-PTMCGZFG.js → chunk-HWOVPFWG.js} +29 -15
  6. package/dist/chunk-HWOVPFWG.js.map +1 -0
  7. package/dist/{chunk-YW2THJUX.js → chunk-NEI66DW6.js} +2 -2
  8. package/dist/{chunk-7JX26TWV.js → chunk-Q6CSM5DE.js} +60 -4
  9. package/dist/chunk-Q6CSM5DE.js.map +1 -0
  10. package/dist/{chunk-EV225FLR.js → chunk-S6EPGDAL.js} +227 -191
  11. package/dist/chunk-S6EPGDAL.js.map +1 -0
  12. package/dist/client/index.d.ts +1 -1
  13. package/dist/client/index.js +1 -1
  14. package/dist/react/api/vibe-coding.d.ts +2 -2
  15. package/dist/react/api/vibe-coding.js +2 -2
  16. package/dist/react/components/chat/index.d.ts +3 -3
  17. package/dist/react/components/chat/index.js +5 -5
  18. package/dist/react/components/plan/index.js +3 -3
  19. package/dist/react/components/session/index.js +3 -3
  20. package/dist/react/components/workspace/index.js +32 -4
  21. package/dist/react/components/workspace/index.js.map +1 -1
  22. package/dist/react/index.d.ts +9 -7
  23. package/dist/react/index.js +6 -6
  24. package/dist/style.css +1 -1
  25. package/package.json +1 -1
  26. package/dist/chunk-7JX26TWV.js.map +0 -1
  27. package/dist/chunk-EV225FLR.js.map +0 -1
  28. package/dist/chunk-PTMCGZFG.js.map +0 -1
  29. /package/dist/{chunk-4ZEOWH6U.js.map → chunk-3ZEWA2YM.js.map} +0 -0
  30. /package/dist/{chunk-LVLGDM76.js.map → chunk-557R7QZV.js.map} +0 -0
  31. /package/dist/{chunk-YW2THJUX.js.map → chunk-NEI66DW6.js.map} +0 -0
@@ -4,7 +4,7 @@ import { ComponentType, ReactNode } from 'react';
4
4
  import { C as ChatMessage, A as AskUserAnswerData, T as ToolCallInfo, M as MessageContent } from './AskUserQuestionBlock---kOTouk.js';
5
5
  import * as zustand from 'zustand';
6
6
  import { M as ModeId, S as SessionInfo, a as SessionStatus } from './session-nZdIuWrS.js';
7
- import { j as BladeClient } from './blade-client-CFvmjs5R.js';
7
+ import { j as BladeClient } from './blade-client-R3cLVOYs.js';
8
8
  import { C as ContentBlock } from './projection-BWYEFYNn.js';
9
9
 
10
10
  /**
@@ -213,8 +213,9 @@ declare const useSessionStore: zustand.UseBoundStore<zustand.StoreApi<SessionSta
213
213
 
214
214
  interface Props$2 {
215
215
  onSend: (message: MessageContent, targetSessionId?: string, model?: string | null) => void;
216
- onStop: () => void;
216
+ onStop: () => void | Promise<void>;
217
217
  isStreaming: boolean;
218
+ isStopping?: boolean;
218
219
  mode?: SessionMode;
219
220
  onToggleMode?: () => void;
220
221
  renderAttachments?: () => ReactNode;
@@ -274,8 +275,9 @@ type FileComposerAttachment = {
274
275
  file?: File;
275
276
  uploadedPath?: string;
276
277
  textContent?: string | null;
278
+ uploadProgress?: number | null;
277
279
  };
278
- declare function ChatInput({ onSend, onStop, isStreaming, mode, onToggleMode, renderAttachments, onBeforeSend, ensureSession, onCommand, canShareSession, slotAboveTextarea, externalDraft, externalAttachments, maxWidthClassName, className, innerClassName, SkillStatusBarComponent, skillStatusBarClassName, skillStatusBarInnerClassName, onResyncSkills, isResyncingSkills, }: Props$2): react_jsx_runtime.JSX.Element;
280
+ declare function ChatInput({ onSend, onStop, isStreaming, isStopping, mode, onToggleMode, renderAttachments, onBeforeSend, ensureSession, onCommand, canShareSession, slotAboveTextarea, externalDraft, externalAttachments, maxWidthClassName, className, innerClassName, SkillStatusBarComponent, skillStatusBarClassName, skillStatusBarInnerClassName, onResyncSkills, isResyncingSkills, }: Props$2): react_jsx_runtime.JSX.Element;
279
281
 
280
282
  interface Props$1 {
281
283
  open: boolean;
@@ -632,6 +632,9 @@ type UploadFileEntry = File | {
632
632
  file: File;
633
633
  name: string;
634
634
  };
635
+ interface UploadFilesOptions {
636
+ onProgress?: (progress: UploadProgress) => void;
637
+ }
635
638
  interface ImportPreviewSkill {
636
639
  name: string;
637
640
  description: string;
@@ -734,7 +737,7 @@ declare class SessionsResource {
734
737
  task?: BackgroundTask | null;
735
738
  }>;
736
739
  listDir(sessionId: string, dirPath: string): Promise<FileEntry[]>;
737
- uploadFiles(sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[]): Promise<{
740
+ uploadFiles(sessionId: string, dirPath: string, files: FileList | File[] | UploadFileEntry[], options?: UploadFilesOptions): Promise<{
738
741
  uploaded: string[];
739
742
  failed: string[];
740
743
  }>;
@@ -1510,6 +1513,18 @@ declare namespace VibeLogsEndPayloadSchema {
1510
1513
  }
1511
1514
  }
1512
1515
  type VibeLogsEndPayload = VibeLogsEndPayloadSchema.VibeLogsEndPayload;
1516
+ declare namespace ChatStopAckSchema {
1517
+ type Status = string;
1518
+ type Message = (string | null);
1519
+ type Code = (string | number | null);
1520
+ interface ChatStopAck {
1521
+ status: Status;
1522
+ message?: Message;
1523
+ code?: Code;
1524
+ [k: string]: unknown;
1525
+ }
1526
+ }
1527
+ type ChatStopAck = ChatStopAckSchema.ChatStopAck;
1513
1528
  declare namespace ChatCompactAckSchema {
1514
1529
  type Status = string;
1515
1530
  type Message = (string | null);
@@ -1524,7 +1539,7 @@ declare namespace ChatCompactAckSchema {
1524
1539
  type ChatCompactAck = ChatCompactAckSchema.ChatCompactAck;
1525
1540
  interface ClientToServerEvents {
1526
1541
  "chat:send": (payload: ChatSendPayload) => void;
1527
- "chat:stop": (payload: ChatStopPayload) => void;
1542
+ "chat:stop": (payload: ChatStopPayload, ack: (response: ChatStopAck) => void) => void;
1528
1543
  "chat:compact": (payload: ChatCompactPayload, ack: (response: ChatCompactAck) => void) => void;
1529
1544
  "session:subscribe": (payload: SessionSubscribePayload) => void;
1530
1545
  "session:unsubscribe": (payload: SessionUnsubscribePayload) => void;
@@ -1611,6 +1626,7 @@ declare class BladeClient {
1611
1626
  blob(method: HttpMethod, path: string): Promise<Blob>;
1612
1627
  formData(method: HttpMethod, path: string, form: FormData, options?: {
1613
1628
  expectOk?: boolean;
1629
+ onUploadProgress?: (progress: UploadProgress) => void;
1614
1630
  }): Promise<Response>;
1615
1631
  fetch(method: HttpMethod, path: string, init?: BladeFetchInit, isRetry?: boolean): Promise<Response>;
1616
1632
  buildAuthedUrl(path: string): string;
@@ -1626,6 +1642,12 @@ declare class BladeClient {
1626
1642
  private resolveRestToken;
1627
1643
  private resolveSocketToken;
1628
1644
  private resolveToken;
1645
+ private formDataWithUploadProgress;
1646
+ }
1647
+ interface UploadProgress {
1648
+ loaded: number;
1649
+ total?: number;
1650
+ percent?: number;
1629
1651
  }
1630
1652
 
1631
- export { ModelsResource as $, type ApiKeyCreateResponse as A, BladeApiError as B, type CreateVibeCodingSessionResult as C, type DeployBumpMode as D, type CreateSoftwareFactorySoftwarePayload as E, type FileEntry as F, GisResource as G, type GlobalSkillStats as H, HeadlessError as I, HeadlessResource as J, type HeadlessRunOptions as K, type HistoryNode as L, type HttpMethod as M, type ImportPreview as N, type ImportPreviewScenario as O, type PortMapping as P, type ImportPreviewSkill as Q, type InstalledRegistrySkill as R, type JsonSchemaObject as S, MemoriesResource as T, type Memory as U, VibeCodingResource as V, type MemoryCreateBody as W, type MemoryListParams as X, type MemoryListResponse as Y, ModelOption as Z, ModelsConfig as _, type VibeCodingDeployStatus as a, DatabaseDriver as a$, type PaginatedSessionsResult as a0, type PreviewUrlItem as a1, type ProvidersResponse as a2, PublishedAppsResource as a3, type QuickScenario as a4, REGISTRY_PREFIX as a5, RegistryResource as a6, type ResourceApi as a7, ScenariosResource as a8, type ServerToClientEvents as a9, createSocket as aA, normalizeResource as aB, EnvBucketsResource as aC, type EnvBucket as aD, type PlatformEnvBucket as aE, type GisState as aF, type RuntimeConfig as aG, type SkillDetail as aH, type SkillStats as aI, type SkillSummary as aJ, type SkillSearchResult as aK, PartnerSkillInstallPayload as aL, PartnerSkillInstallResult as aM, SessionSkillUploadPayload as aN, SessionSkillUploadResult as aO, PublishedApp as aP, PublishedAppListResponse as aQ, PublishedAppStatus as aR, UnpublishAppResponse as aS, type BackgroundTask as aT, type GisGoal as aU, type GisResource$1 as aV, type GisTarget as aW, type GisMapCommand as aX, Task as aY, AgentDriver as aZ, AgentResource as a_, type SessionContextStats as aa, type SessionHistory as ab, type SessionUpdatedPayload as ac, SessionsResource as ad, type ShareLinkResult as ae, type SkillDevSession as af, type SkillOrgListResponse as ag, type SkillOrgOption as ah, SkillsResource as ai, type SoftwareFactoryModuleBlueprint as aj, SoftwareFactoryResource as ak, type SoftwareFactorySharedFile as al, type SoftwareFactorySoftware as am, type SoftwareFactoryTopic as an, type SoftwareFactoryTopicModule as ao, SolutionsResource as ap, type SystemErrorPayload as aq, type SystemNotificationPayload as ar, type TokenizeResult as as, type TurnProjectionPayload as at, type TypedSocket as au, type UpdateQuickScenarioPayload as av, type UpgradeComputerResponse as aw, type UploadFileEntry as ax, type UserInfo as ay, UserPreferencesResource as az, type VibeCodingDebugSessionStatus as b, DatabaseResource as b0, DifyKnowledgeConfig as b1, type GisGoalStatus as b2, HttpToolConfig as b3, KnowledgeDriver as b4, KnowledgeResource as b5, McpToolConfig as b6, MysqlConfig as b7, type ParallelMode as b8, PartnerSkillFile as b9, PartnerSkillName as ba, PostgresqlConfig as bb, SessionSkillFile as bc, SessionSkillName as bd, type StageSpec as be, type StepSpec as bf, TaskStatus as bg, ToolDriver as bh, ToolResource as bi, skillDisplayName as bj, type VibeCodingSessionStatus as c, type VibeCodingDeployRecord as d, type VibeCodingSessionInfo as e, type CreateVibeCodingSessionParams as f, type ApiKeyPublic as g, ApiKeysResource as h, AuthResource as i, BladeClient as j, type BladeClientOptions as k, type BladeFetchInit as l, type BladeHubScenarioResource as m, type ChatEndPayload as n, type ChatSendPayload as o, type CheckpointNode as p, type ClientToServerEvents as q, type CodingTask as r, type CodingTaskTopic as s, type ComputerUpgradeReason as t, type ComputerUpgradeStatusResponse as u, type ContentPart as v, type CreateQuickScenarioPayload as w, type CreateSessionRequest as x, type CreateSocketOptions as y, type CreateSoftwareFactorySharedFilePayload as z };
1653
+ export { ModelsResource as $, type ApiKeyCreateResponse as A, BladeApiError as B, type CreateVibeCodingSessionResult as C, type DeployBumpMode as D, type CreateSoftwareFactorySoftwarePayload as E, type FileEntry as F, GisResource as G, type GlobalSkillStats as H, HeadlessError as I, HeadlessResource as J, type HeadlessRunOptions as K, type HistoryNode as L, type HttpMethod as M, type ImportPreview as N, type ImportPreviewScenario as O, type PortMapping as P, type ImportPreviewSkill as Q, type InstalledRegistrySkill as R, type JsonSchemaObject as S, MemoriesResource as T, type Memory as U, VibeCodingResource as V, type MemoryCreateBody as W, type MemoryListParams as X, type MemoryListResponse as Y, ModelOption as Z, ModelsConfig as _, type VibeCodingDeployStatus as a, AgentResource as a$, type PaginatedSessionsResult as a0, type PreviewUrlItem as a1, type ProvidersResponse as a2, PublishedAppsResource as a3, type QuickScenario as a4, REGISTRY_PREFIX as a5, RegistryResource as a6, type ResourceApi as a7, ScenariosResource as a8, type ServerToClientEvents as a9, UserPreferencesResource as aA, createSocket as aB, normalizeResource as aC, EnvBucketsResource as aD, type EnvBucket as aE, type PlatformEnvBucket as aF, type GisState as aG, type RuntimeConfig as aH, type SkillDetail as aI, type SkillStats as aJ, type SkillSummary as aK, type SkillSearchResult as aL, PartnerSkillInstallPayload as aM, PartnerSkillInstallResult as aN, SessionSkillUploadPayload as aO, SessionSkillUploadResult as aP, PublishedApp as aQ, PublishedAppListResponse as aR, PublishedAppStatus as aS, UnpublishAppResponse as aT, type BackgroundTask as aU, type GisGoal as aV, type GisResource$1 as aW, type GisTarget as aX, type GisMapCommand as aY, Task as aZ, AgentDriver as a_, type SessionContextStats as aa, type SessionHistory as ab, type SessionUpdatedPayload as ac, SessionsResource as ad, type ShareLinkResult as ae, type SkillDevSession as af, type SkillOrgListResponse as ag, type SkillOrgOption as ah, SkillsResource as ai, type SoftwareFactoryModuleBlueprint as aj, SoftwareFactoryResource as ak, type SoftwareFactorySharedFile as al, type SoftwareFactorySoftware as am, type SoftwareFactoryTopic as an, type SoftwareFactoryTopicModule as ao, SolutionsResource as ap, type SystemErrorPayload as aq, type SystemNotificationPayload as ar, type TokenizeResult as as, type TurnProjectionPayload as at, type TypedSocket as au, type UpdateQuickScenarioPayload as av, type UpgradeComputerResponse as aw, type UploadFileEntry as ax, type UploadFilesOptions as ay, type UserInfo as az, type VibeCodingDebugSessionStatus as b, DatabaseDriver as b0, DatabaseResource as b1, DifyKnowledgeConfig as b2, type GisGoalStatus as b3, HttpToolConfig as b4, KnowledgeDriver as b5, KnowledgeResource as b6, McpToolConfig as b7, MysqlConfig as b8, type ParallelMode as b9, PartnerSkillFile as ba, PartnerSkillName as bb, PostgresqlConfig as bc, SessionSkillFile as bd, SessionSkillName as be, type StageSpec as bf, type StepSpec as bg, TaskStatus as bh, ToolDriver as bi, ToolResource as bj, skillDisplayName as bk, type VibeCodingSessionStatus as c, type VibeCodingDeployRecord as d, type VibeCodingSessionInfo as e, type CreateVibeCodingSessionParams as f, type ApiKeyPublic as g, ApiKeysResource as h, AuthResource as i, BladeClient as j, type BladeClientOptions as k, type BladeFetchInit as l, type BladeHubScenarioResource as m, type ChatEndPayload as n, type ChatSendPayload as o, type CheckpointNode as p, type ClientToServerEvents as q, type CodingTask as r, type CodingTaskTopic as s, type ComputerUpgradeReason as t, type ComputerUpgradeStatusResponse as u, type ContentPart as v, type CreateQuickScenarioPayload as w, type CreateSessionRequest as x, type CreateSocketOptions as y, type CreateSoftwareFactorySharedFilePayload as z };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  apiFetchResponse,
3
3
  getAuthedUrl
4
- } from "./chunk-PTMCGZFG.js";
4
+ } from "./chunk-HWOVPFWG.js";
5
5
 
6
6
  // src/react/lib/session-file-preview.ts
7
7
  var IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp"]);
@@ -124,4 +124,4 @@ export {
124
124
  CollapsibleTrigger,
125
125
  CollapsibleContent
126
126
  };
127
- //# sourceMappingURL=chunk-4ZEOWH6U.js.map
127
+ //# sourceMappingURL=chunk-3ZEWA2YM.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  getAuthedUrl,
7
7
  useUiStore
8
- } from "./chunk-PTMCGZFG.js";
8
+ } from "./chunk-HWOVPFWG.js";
9
9
  import {
10
10
  cn,
11
11
  copyToClipboard
@@ -1576,4 +1576,4 @@ export {
1576
1576
  PlanSummaryCard,
1577
1577
  extractLatestPlanMessages
1578
1578
  };
1579
- //# sourceMappingURL=chunk-LVLGDM76.js.map
1579
+ //# sourceMappingURL=chunk-557R7QZV.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-J3XVFPOV.js";
4
4
  import {
5
5
  BladeClient
6
- } from "./chunk-7JX26TWV.js";
6
+ } from "./chunk-Q6CSM5DE.js";
7
7
  import {
8
8
  createClientActions,
9
9
  useCardStateStore
@@ -1124,17 +1124,17 @@ function buildMessageContent2(turn) {
1124
1124
  return JSON.stringify(block.content);
1125
1125
  }).join("");
1126
1126
  }
1127
- function buildReasoning(turn) {
1128
- const thinking = turn.blocks.filter((block) => block.type === "thinking").map((block) => typeof block.content === "string" ? block.content : JSON.stringify(block.content)).filter(Boolean);
1129
- if (thinking.length === 0) return void 0;
1130
- return thinking.join("\n\n");
1131
- }
1132
- function buildAskUserAnswerContent(turn) {
1127
+ function askUserAnswerContent(turn) {
1133
1128
  const answerBlock = turn.blocks.find((block) => block.type === "ask_user_answer");
1134
1129
  if (!answerBlock || !isRecord3(answerBlock.content)) return null;
1135
1130
  const answer = answerBlock.content.answer;
1136
1131
  return typeof answer === "string" && answer.trim().length > 0 ? answer : null;
1137
1132
  }
1133
+ function buildReasoning(turn) {
1134
+ const thinking = turn.blocks.filter((block) => block.type === "thinking").map((block) => typeof block.content === "string" ? block.content : JSON.stringify(block.content)).filter(Boolean);
1135
+ if (thinking.length === 0) return void 0;
1136
+ return thinking.join("\n\n");
1137
+ }
1138
1138
  function isModeChangeContent(value) {
1139
1139
  return typeof value === "object" && value !== null && typeof value.from === "string" && typeof value.to === "string";
1140
1140
  }
@@ -1193,14 +1193,12 @@ function projectionToMessage(turn) {
1193
1193
  status: turn.status
1194
1194
  };
1195
1195
  }
1196
- if (turn.blocks.some((block) => block.type === "ask_user_answer")) {
1197
- const answerContent = buildAskUserAnswerContent(turn);
1198
- if (answerContent === null) return null;
1196
+ const askAnswer = askUserAnswerContent(turn);
1197
+ if (askAnswer !== null) {
1199
1198
  return {
1200
1199
  role: "user",
1201
- content: answerContent,
1200
+ content: askAnswer,
1202
1201
  blocks: turn.blocks,
1203
- kind: "ask_user_answer",
1204
1202
  loop_name: turn.loop_id,
1205
1203
  entry_id: turn.turn_id,
1206
1204
  status: turn.status,
@@ -1278,7 +1276,11 @@ function applyPlanningSideEffects(sessionId, turns) {
1278
1276
  }
1279
1277
  }
1280
1278
  function materialize(turns) {
1281
- const messages = turns.map(projectionToMessage).filter((message) => message !== null);
1279
+ const messages = turns.map(projectionToMessage).filter((message) => message !== null).filter((message, index, allMessages) => {
1280
+ if (!message.blocks?.some((block) => block.type === "ask_user_answer")) return true;
1281
+ const next = allMessages[index + 1];
1282
+ return !(next?.role === "user" && next.content === message.content);
1283
+ });
1282
1284
  const activeCompaction = [...turns].reverse().find(
1283
1285
  (turn) => turn.kind === "compaction" && turn.status === "streaming" && typeof turn.compaction_id === "string"
1284
1286
  );
@@ -2824,7 +2826,19 @@ var AgentSocket = class {
2824
2826
  }
2825
2827
  }
2826
2828
  stop(sessionId) {
2827
- this.socket.emit("chat:stop", { session_id: sessionId });
2829
+ return new Promise((resolve, reject) => {
2830
+ this.socket.timeout(35e3).emit(
2831
+ "chat:stop",
2832
+ { session_id: sessionId },
2833
+ (err, response) => {
2834
+ if (err) {
2835
+ reject(err);
2836
+ return;
2837
+ }
2838
+ resolve(response ?? {});
2839
+ }
2840
+ );
2841
+ });
2828
2842
  }
2829
2843
  compact(sessionId) {
2830
2844
  return new Promise((resolve, reject) => {
@@ -3079,4 +3093,4 @@ export {
3079
3093
  bootstrapBladeClient,
3080
3094
  getBootstrappedClient
3081
3095
  };
3082
- //# sourceMappingURL=chunk-PTMCGZFG.js.map
3096
+ //# sourceMappingURL=chunk-HWOVPFWG.js.map