@blade-hq/agent-kit 0.5.19 → 0.5.20

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 (30) hide show
  1. package/dist/{SkillStatusBar-DR-R6Mpa.d.ts → SkillStatusBar-CxQCMH1U.d.ts} +1 -1
  2. package/dist/{blade-client-ByosYYkS.d.ts → blade-client-CVT77eg3.d.ts} +4 -0
  3. package/dist/{chunk-GIY3MV6F.js → chunk-7ATUCEPR.js} +2 -2
  4. package/dist/{chunk-AN45BWO7.js → chunk-FQSLHSA4.js} +50 -31
  5. package/dist/chunk-FQSLHSA4.js.map +1 -0
  6. package/dist/{chunk-SPHQXYME.js → chunk-ML3IOWX4.js} +6 -6
  7. package/dist/chunk-ML3IOWX4.js.map +1 -0
  8. package/dist/{chunk-SZKVEYL6.js → chunk-TCHV7UF4.js} +1 -1
  9. package/dist/chunk-TCHV7UF4.js.map +1 -0
  10. package/dist/{chunk-MEAVJOEQ.js → chunk-TIUG3ZHJ.js} +2 -2
  11. package/dist/{chunk-RQUD3FGD.js → chunk-V5ZO5YX2.js} +2 -2
  12. package/dist/client/index.d.ts +6 -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 +3 -3
  21. package/dist/react/index.d.ts +4 -4
  22. package/dist/react/index.js +6 -6
  23. package/dist/style.css +1 -1
  24. package/package.json +1 -1
  25. package/dist/chunk-AN45BWO7.js.map +0 -1
  26. package/dist/chunk-SPHQXYME.js.map +0 -1
  27. package/dist/chunk-SZKVEYL6.js.map +0 -1
  28. /package/dist/{chunk-GIY3MV6F.js.map → chunk-7ATUCEPR.js.map} +0 -0
  29. /package/dist/{chunk-MEAVJOEQ.js.map → chunk-TIUG3ZHJ.js.map} +0 -0
  30. /package/dist/{chunk-RQUD3FGD.js.map → chunk-V5ZO5YX2.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-BuaeCsMC.js';
7
- import { j as BladeClient } from './blade-client-ByosYYkS.js';
7
+ import { j as BladeClient } from './blade-client-CVT77eg3.js';
8
8
  import { C as ContentBlock } from './projection-BWYEFYNn.js';
9
9
 
10
10
  /**
@@ -29,6 +29,10 @@ interface ApiKeyPublic {
29
29
  * 完整 key 原文。后端按 #761 设计存明文,支持反复获取;存量 hash-only 行为 null。
30
30
  */
31
31
  plaintext: string | null;
32
+ /**
33
+ * 只读行(如经 bo 经纪人下发的 GIT_ACCESS_TOKEN):UI 只给复制,不给改名/撤销。
34
+ */
35
+ readonly?: boolean;
32
36
  }
33
37
  interface ApiKeyCreateResponse {
34
38
  key: ApiKeyPublic;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useSessionStore
3
- } from "./chunk-SPHQXYME.js";
3
+ } from "./chunk-ML3IOWX4.js";
4
4
 
5
5
  // src/react/hooks/use-session.ts
6
6
  function useSession() {
@@ -27,4 +27,4 @@ function useSession() {
27
27
  export {
28
28
  useSession
29
29
  };
30
- //# sourceMappingURL=chunk-GIY3MV6F.js.map
30
+ //# sourceMappingURL=chunk-7ATUCEPR.js.map
@@ -8,13 +8,13 @@ import {
8
8
  getCodeLanguageFromFilename,
9
9
  parseAskUserQuestion,
10
10
  useHighlightedCodeHtml
11
- } from "./chunk-RQUD3FGD.js";
11
+ } from "./chunk-V5ZO5YX2.js";
12
12
  import {
13
13
  Collapsible,
14
14
  CollapsibleContent,
15
15
  CollapsibleTrigger,
16
16
  resolveSessionFilePreviewTarget
17
- } from "./chunk-MEAVJOEQ.js";
17
+ } from "./chunk-TIUG3ZHJ.js";
18
18
  import {
19
19
  apiFetchResponse,
20
20
  buildMessageContent,
@@ -58,7 +58,7 @@ import {
58
58
  useUiBridgeStore,
59
59
  useUiStore,
60
60
  writeFile
61
- } from "./chunk-SPHQXYME.js";
61
+ } from "./chunk-ML3IOWX4.js";
62
62
  import {
63
63
  registerBridgeIframe,
64
64
  tapBridgeEvent
@@ -67,7 +67,7 @@ import {
67
67
  ModelOption,
68
68
  ModelsConfig,
69
69
  ModelsResource
70
- } from "./chunk-SZKVEYL6.js";
70
+ } from "./chunk-TCHV7UF4.js";
71
71
  import {
72
72
  cn,
73
73
  copyToClipboard
@@ -6212,6 +6212,7 @@ function isUserMessage(message) {
6212
6212
  function isErrorMessage(message) {
6213
6213
  return message.role === "error";
6214
6214
  }
6215
+ var USER_MESSAGE_MARKDOWN_CLASS = "prose prose-sm prose-invert max-w-none [&_li>p]:inline [&_li>p]:whitespace-pre-wrap [&_p]:mb-3 [&_p]:whitespace-pre-wrap [&_p:last-child]:mb-0";
6215
6216
  function isImageTextAttachment(name, uploadedPath) {
6216
6217
  return isImageFilename(name) || isImageFilename(uploadedPath ?? "");
6217
6218
  }
@@ -6391,7 +6392,7 @@ function UserMessageBubble({ message, className }) {
6391
6392
  trimmedClean && /* @__PURE__ */ jsx28("div", { className: "rounded-2xl border border-[hsl(var(--user-msg-border))] bg-[hsl(var(--user-msg-bg))] px-4 py-2.5 text-sm leading-relaxed text-[hsl(var(--user-msg-fg))] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)]", children: /* @__PURE__ */ jsx28(
6392
6393
  MarkdownContent,
6393
6394
  {
6394
- className: "prose prose-sm prose-invert max-w-none [&_li>p]:inline [&_p]:mb-3 [&_p:last-child]:mb-0",
6395
+ className: USER_MESSAGE_MARKDOWN_CLASS,
6395
6396
  controls: { code: true },
6396
6397
  children: cleanText
6397
6398
  }
@@ -6399,7 +6400,7 @@ function UserMessageBubble({ message, className }) {
6399
6400
  trimmedClean && /* @__PURE__ */ jsx28(
6400
6401
  MessageActions,
6401
6402
  {
6402
- content: trimmedClean,
6403
+ content: cleanText,
6403
6404
  className: "opacity-0 transition-opacity group-hover:opacity-100"
6404
6405
  }
6405
6406
  )
@@ -7894,8 +7895,10 @@ function MessageList({
7894
7895
  const messages = Array.isArray(rawMessages) ? rawMessages : [];
7895
7896
  const agentLoops = useChatStore((state) => state.agentLoops[sessionId]);
7896
7897
  const askAnswers = useChatStore((state) => state.askAnswers[sessionId]);
7898
+ const sessionIsStreaming = useChatStore((state) => !!state.isStreaming[sessionId]);
7897
7899
  const agentLoopNameSet = useMemo17(() => new Set(Object.keys(agentLoops ?? {})), [agentLoops]);
7898
7900
  const assistantMessagesCacheRef = useRef13(/* @__PURE__ */ new Map());
7901
+ const stickContextRef = useRef13(null);
7899
7902
  const renderBlocks = useMemo17(() => {
7900
7903
  const stableAssistantMessages = (key, buffer) => {
7901
7904
  const previous = assistantMessagesCacheRef.current.get(key);
@@ -7921,9 +7924,9 @@ function MessageList({
7921
7924
  const flushAssistant = () => {
7922
7925
  if (assistantBuffer.length === 0) return;
7923
7926
  assistantTurnCount += 1;
7924
- const last = assistantBuffer[assistantBuffer.length - 1];
7927
+ const first = assistantBuffer[0];
7925
7928
  const isStreaming = assistantBuffer.some((message) => message.status === "streaming");
7926
- const key = last.entry_id ?? `assistant-${blocks.length}`;
7929
+ const key = first.entry_id ?? `assistant-${assistantTurnCount}`;
7927
7930
  const stableMessages = stableAssistantMessages(key, assistantBuffer);
7928
7931
  blocks.push({
7929
7932
  type: "assistant_turn",
@@ -7970,6 +7973,13 @@ function MessageList({
7970
7973
  });
7971
7974
  }
7972
7975
  flushAssistant();
7976
+ if (sessionIsStreaming) {
7977
+ const last = blocks[blocks.length - 1];
7978
+ if (last?.type === "assistant_turn") {
7979
+ ;
7980
+ last.isStreaming = true;
7981
+ }
7982
+ }
7973
7983
  const activeAssistantKeys = new Set(
7974
7984
  blocks.filter((block) => block.type === "assistant_turn").map((block) => block.key)
7975
7985
  );
@@ -7979,7 +7989,7 @@ function MessageList({
7979
7989
  }
7980
7990
  }
7981
7991
  return blocks;
7982
- }, [agentLoopNameSet, messages]);
7992
+ }, [agentLoopNameSet, messages, sessionIsStreaming]);
7983
7993
  const hasInterruptedTurn = useMemo17(
7984
7994
  () => renderBlocks.some(
7985
7995
  (block) => block.type === "assistant_turn" && block.messages.some((message) => message.status === "interrupted")
@@ -8052,7 +8062,7 @@ function MessageList({
8052
8062
  });
8053
8063
  });
8054
8064
  useEffect17(() => {
8055
- scrollContainerRef.current = findScrollContainer(containerRef.current);
8065
+ scrollContainerRef.current = stickContextRef.current?.scrollRef.current ?? findScrollContainer(containerRef.current);
8056
8066
  const sc = scrollContainerRef.current;
8057
8067
  if (!sc) return;
8058
8068
  sc.addEventListener("scroll", scheduleMeasure, { passive: true });
@@ -8087,26 +8097,35 @@ function MessageList({
8087
8097
  onSelectTurn: handleSelectTurn
8088
8098
  }
8089
8099
  ) : null,
8090
- /* @__PURE__ */ jsxs30(StickToBottom, { className: "h-full overflow-y-hidden", resize: "instant", children: [
8091
- /* @__PURE__ */ jsx35(StickToBottom.Content, { className: "px-5 py-6", children: /* @__PURE__ */ jsx35(
8092
- MessageListContent,
8093
- {
8094
- askAnswers,
8095
- hasInterruptedTurn,
8096
- lastTurnId,
8097
- layoutSignature,
8098
- messages,
8099
- onAnswer,
8100
- onConfirmPlan,
8101
- renderBlocks,
8102
- sessionId,
8103
- sessionStatus,
8104
- stickyTurn,
8105
- customization
8106
- }
8107
- ) }),
8108
- /* @__PURE__ */ jsx35(ScrollToBottomButton, {})
8109
- ] })
8100
+ /* @__PURE__ */ jsxs30(
8101
+ StickToBottom,
8102
+ {
8103
+ contextRef: stickContextRef,
8104
+ className: "h-full overflow-y-hidden",
8105
+ initial: "instant",
8106
+ resize: stickyTurn ? { damping: 0.8, stiffness: 0.08, mass: 1 } : "instant",
8107
+ children: [
8108
+ /* @__PURE__ */ jsx35(StickToBottom.Content, { className: "px-5 py-6", children: /* @__PURE__ */ jsx35(
8109
+ MessageListContent,
8110
+ {
8111
+ askAnswers,
8112
+ hasInterruptedTurn,
8113
+ lastTurnId,
8114
+ layoutSignature,
8115
+ messages,
8116
+ onAnswer,
8117
+ onConfirmPlan,
8118
+ renderBlocks,
8119
+ sessionId,
8120
+ sessionStatus,
8121
+ stickyTurn,
8122
+ customization
8123
+ }
8124
+ ) }),
8125
+ /* @__PURE__ */ jsx35(ScrollToBottomButton, {})
8126
+ ]
8127
+ }
8128
+ )
8110
8129
  ]
8111
8130
  }
8112
8131
  );
@@ -8429,4 +8448,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
8429
8448
  * Licensed under the MIT License. See License.txt in the project root for license information.
8430
8449
  *--------------------------------------------------------------------------------------------*)
8431
8450
  */
8432
- //# sourceMappingURL=chunk-AN45BWO7.js.map
8451
+ //# sourceMappingURL=chunk-FQSLHSA4.js.map