@fungi.computer/parakeet 0.11.15 → 0.11.17

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.
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { hasVisibleReasoning } from "../core/assistant-visibility.js";
2
3
  import { MarkdownRenderer } from "./MarkdownRenderer.js";
3
4
  import { ThinkingBlock } from "./ThinkingBlock.js";
4
5
  /** User-message admission state, shared by full and compact transcript rows. */
@@ -14,7 +15,8 @@ export function ChatMessage({ children, isError, pending, speaker, thinking, mar
14
15
  }, children: [_jsx(PendingMessageStatus, { pending: pending }), _jsx("div", { className: "message-body text-base-content", children: content })] }));
15
16
  }
16
17
  const hasText = children.trim().length > 0;
17
- if (!hasText && !thinking)
18
+ const hasThinking = hasVisibleReasoning(thinking);
19
+ if (!hasText && !hasThinking)
18
20
  return null;
19
- return (_jsxs("div", { "data-speaker": "agent", "data-pending": pending ? "true" : undefined, children: [thinking ? _jsx(ThinkingBlock, { thinking: thinking }) : null, hasText ? (_jsx("div", { className: `px-3 py-2 ${isError ? "text-error" : "text-base-content"}`, children: content })) : null] }));
21
+ return (_jsxs("div", { "data-speaker": "agent", "data-pending": pending ? "true" : undefined, children: [hasThinking && thinking !== undefined ? (_jsx(ThinkingBlock, { thinking: thinking })) : null, hasText ? (_jsx("div", { className: `px-3 py-2 ${isError ? "text-error" : "text-base-content"}`, children: content })) : null] }));
20
22
  }
@@ -85,8 +85,8 @@ export const ToolGroup = memo(function ToolGroup({ group, disclosure, onToggle,
85
85
  const active = group.active;
86
86
  const single = group.calls.length === 1 ? group.calls[0] : undefined;
87
87
  if (single !== undefined)
88
- return (_jsx("div", { className: "px-1", children: _jsx(CallRow, { call: single, disclosure: disclosure, disclosureId: single.id, onToggle: onToggle, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, size: "row", tool: group.tools[0] }) }));
89
- return (_jsxs("div", { className: "px-1", children: [_jsx(Disclosure, { className: "[&>.caps-disclosure-panel]:hidden", leading: _jsx(Sigil, { name: "list", size: 16 }), onOpenChange: () => {
88
+ return (_jsx("div", { children: _jsx(CallRow, { call: single, disclosure: disclosure, disclosureId: single.id, onToggle: onToggle, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, size: "row", tool: group.tools[0] }) }));
89
+ return (_jsxs("div", { children: [_jsx(Disclosure, { className: "[&>.caps-disclosure-panel]:hidden", leading: _jsx(Sigil, { name: "list", size: 16 }), onOpenChange: () => {
90
90
  onToggle(group.id, defaultOpen);
91
91
  }, open: open, summary: running && active !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-base-content", children: active.activeVerb }), " ", _jsx("span", { className: "font-mono", children: active.label }), " \u00B7", " ", String(group.calls.length), " ", group.calls.length === 1 ? "call" : "calls"] })) : (_jsxs("span", { className: "text-base-content", children: [group.summary, " \u00B7 ", String(group.calls.length), " ", group.calls.length === 1 ? "call" : "calls"] })), tone: group.status === "error" ? "error" : "neutral", trailing: _jsxs(_Fragment, { children: [group.failedCount > 0 ? (_jsxs("span", { className: "text-error", children: [String(group.failedCount), " failed"] })) : null, group.recoveredCount > 0 ? (_jsxs("span", { children: [String(group.recoveredCount), " recovered"] })) : null, group.durationMs === undefined ? null : (_jsx("span", { children: formatToolDuration(group.durationMs) })), _jsx(Status, { motion: running ? "bounce" : "none", title: group.status === "unknown" ? "result unavailable" : group.status, tone: statusTone(group.status) })] }) }), visibleToolCalls(group, open).map((call) => (_jsx(CallRow, { call: call, disclosure: disclosure, disclosureId: call.id, onToggle: onToggle, renderToolActions: renderToolActions, claimsToolMedia: claimsToolMedia, size: "row", tool: group.tools.find((tool) => tool.id === call.id) }, call.id))), group.status === "completed" && group.calls.length > 3 ? (_jsx("button", { "aria-expanded": open, className: "btn btn-ghost btn-xs text-dim", onClick: () => {
92
92
  onToggle(group.id, defaultOpen);
@@ -1,3 +1,9 @@
1
1
  import type { AssistantMessageItem } from "../store/types.js";
2
+ /**
3
+ * Whether reasoning text shows anything a reader can see. Whitespace and
4
+ * invisible format characters (zero-width spaces and joiners, byte-order
5
+ * marks) are not text; a thinking row made only of them renders nothing.
6
+ */
7
+ export declare function hasVisibleReasoning(thinking: string | undefined): boolean;
2
8
  /** One rule for whether an assistant row has content either renderer shows. */
3
9
  export declare function assistantMessageVisible(item: AssistantMessageItem): boolean;
@@ -1,4 +1,12 @@
1
+ /**
2
+ * Whether reasoning text shows anything a reader can see. Whitespace and
3
+ * invisible format characters (zero-width spaces and joiners, byte-order
4
+ * marks) are not text; a thinking row made only of them renders nothing.
5
+ */
6
+ export function hasVisibleReasoning(thinking) {
7
+ return thinking !== undefined && /[^\s\p{Cf}]/u.test(thinking);
8
+ }
1
9
  /** One rule for whether an assistant row has content either renderer shows. */
2
10
  export function assistantMessageVisible(item) {
3
- return item.text.trim() !== "" || (item.thinking?.trim() ?? "") !== "";
11
+ return item.text.trim() !== "" || hasVisibleReasoning(item.thinking);
4
12
  }
@@ -69,7 +69,8 @@ function collectAssistantBlocks(value) {
69
69
  for (const block of value.content) {
70
70
  if (block.type === "text")
71
71
  text.push(block.text);
72
- if (block.type === "thinking")
72
+ // Redacted reasoning carries a placeholder, not text a reader can read.
73
+ if (block.type === "thinking" && block.redacted !== true)
73
74
  thinking.push(block.thinking);
74
75
  if (block.type === "toolCall")
75
76
  tools.push(toolItem(block, value.timestamp));
package/dist/styles.css CHANGED
@@ -6881,9 +6881,6 @@
6881
6881
  padding-inline: var(--spacing-sm);
6882
6882
  }
6883
6883
  }
6884
- .px-1 {
6885
- padding-inline: calc(var(--spacing) * 1);
6886
- }
6887
6884
  .px-2 {
6888
6885
  padding-inline: calc(var(--spacing) * 2);
6889
6886
  }
@@ -13543,6 +13540,7 @@
13543
13540
  opacity: 0.4;
13544
13541
  }
13545
13542
  .caps-generation-failure {
13543
+ position: relative;
13546
13544
  display: flex;
13547
13545
  flex-direction: column;
13548
13546
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/parakeet",
3
- "version": "0.11.15",
3
+ "version": "0.11.17",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "private": false,
6
6
  "description": "Standalone React composer for a typed Shiitake Session",
@@ -63,7 +63,7 @@
63
63
  "@fungi.computer/agar": "0.9.1",
64
64
  "@fungi.computer/bird-dog": "0.3.6",
65
65
  "@fungi.computer/cairn": "0.1.0",
66
- "@fungi.computer/caps": "0.10.7",
66
+ "@fungi.computer/caps": "0.10.8",
67
67
  "@fungi.computer/gills": "0.3.0",
68
68
  "@fungi.computer/knapsack": "0.4.9",
69
69
  "@fungi.computer/shiitake": "0.13.0",