@fungi.computer/parakeet 0.11.36 → 0.11.38

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.
@@ -19,7 +19,10 @@ function ShowMore({ hidden, onShowAll, }) {
19
19
  return null;
20
20
  return (_jsxs("button", { className: "btn btn-ghost btn-xs text-dim", onClick: onShowAll, type: "button", children: ["Show ", String(hidden), " more lines"] }));
21
21
  }
22
- const monoBlock = "not-prose m-0 overflow-x-auto rounded-lg border border-base-300 bg-base-200 px-sm py-xs font-mono text-[10px] leading-relaxed";
22
+ /** A bordered, rounded output box; only the inner pre scrolls and fades. */
23
+ function MonoBlock({ children, ...props }) {
24
+ return (_jsx("div", { className: "not-prose overflow-hidden rounded-lg border border-base-300 bg-base-200", children: _jsx("pre", { ...props, className: "parakeet-edge-fade m-0 overflow-x-auto px-sm py-xs font-mono text-[10px] leading-relaxed", children: children }) }));
25
+ }
23
26
  function SectionView({ section, full, onShowAll, }) {
24
27
  switch (section.kind) {
25
28
  case "diff": {
@@ -28,20 +31,20 @@ function SectionView({ section, full, onShowAll, }) {
28
31
  }
29
32
  case "excerpt": {
30
33
  const { shown, hidden } = visible(section.lines, section.preview, full);
31
- return (_jsxs("div", { children: [_jsx("pre", { className: monoBlock, "data-parakeet-section": "excerpt", children: shown.map((line, index) => (_jsxs("span", { className: "block whitespace-pre", children: [line.number === undefined ? null : (_jsx("span", { className: "text-dim mr-sm inline-block w-8 select-none text-right", children: String(line.number) })), line.text] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
34
+ return (_jsxs("div", { children: [_jsx(MonoBlock, { "data-parakeet-section": "excerpt", children: shown.map((line, index) => (_jsxs("span", { className: "block whitespace-pre", children: [line.number === undefined ? null : (_jsx("span", { className: "text-dim mr-sm inline-block w-8 select-none text-right", children: String(line.number) })), line.text] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
32
35
  }
33
36
  case "matches": {
34
37
  const { shown, hidden } = visible(section.matches, section.preview, full);
35
- return (_jsxs("div", { children: [_jsx("pre", { className: monoBlock, "data-parakeet-section": "matches", children: shown.map((match, index) => (_jsxs("span", { className: "block whitespace-pre", children: [match.location === "" ? null : (_jsx("span", { className: "text-info mr-sm", children: match.location })), match.text] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
38
+ return (_jsxs("div", { children: [_jsx(MonoBlock, { "data-parakeet-section": "matches", children: shown.map((match, index) => (_jsxs("span", { className: "block whitespace-pre", children: [match.location === "" ? null : (_jsx("span", { className: "text-info mr-sm", children: match.location })), match.text] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
36
39
  }
37
40
  case "command":
38
41
  case "script": {
39
42
  const { shown, hidden } = visible(section.lines, section.preview, full);
40
- return (_jsxs("div", { children: [_jsx("pre", { className: monoBlock, "data-parakeet-section": section.kind, children: shown.map((line, index) => (_jsxs("span", { className: "block whitespace-pre", children: [section.kind === "command" && index === 0 ? (_jsx("span", { className: "text-dim select-none", children: "$ " })) : null, line] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
43
+ return (_jsxs("div", { children: [_jsx(MonoBlock, { "data-parakeet-section": section.kind, children: shown.map((line, index) => (_jsxs("span", { className: "block whitespace-pre", children: [section.kind === "command" && index === 0 ? (_jsx("span", { className: "text-dim select-none", children: "$ " })) : null, line] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
41
44
  }
42
45
  case "output": {
43
46
  const { shown, hidden } = visible(section.lines, section.preview, full);
44
- return (_jsxs("div", { children: [_jsx("pre", { className: monoBlock, "data-parakeet-section": "output", children: shown.map((line, index) => (_jsxs("span", { className: line.stream === "stderr"
47
+ return (_jsxs("div", { children: [_jsx(MonoBlock, { "data-parakeet-section": "output", children: shown.map((line, index) => (_jsxs("span", { className: line.stream === "stderr"
45
48
  ? "block whitespace-pre text-error"
46
49
  : "block whitespace-pre", "data-stream": line.stream, children: [line.stream === "stderr" ? (_jsx("span", { className: "select-none", children: "\u258D" })) : null, line.text] }, String(index)))) }), _jsx(ShowMore, { hidden: hidden, onShowAll: onShowAll })] }));
47
50
  }
@@ -73,7 +76,7 @@ function CallRow({ call, tool, disclosureId, size, disclosure, onToggle, renderT
73
76
  ? "error"
74
77
  : "neutral", trailing: _jsxs(_Fragment, { children: [call.recovered === true ? _jsx("span", { children: "recovered" }) : null, call.exitCode === undefined ? null : (_jsxs(Badge, { size: "sm", tone: call.status === "error" && call.recovered !== true
75
78
  ? "error"
76
- : "neutral", children: ["exit ", String(call.exitCode)] })), call.durationMs === undefined ? null : (_jsx("span", { children: formatToolDuration(call.durationMs) })), _jsx(Status, { motion: running ? "bounce" : "none", title: call.status === "unknown" ? "result unavailable" : call.status, tone: statusTone(call.status, call.recovered === true) })] }), children: _jsx(CallBody, { call: call, disclosure: disclosure, onToggle: onToggle, mediaClaimed: tool !== undefined && claimsToolMedia?.(tool) === true, tool: tool }) }), call.live === undefined ? null : (_jsx("pre", { className: monoBlock, "aria-label": "Live tool output", children: toolLiveLines(call, open).map((line, index) => (_jsx("span", { className: "block whitespace-pre", children: line || "\u00a0" }, String(index)))) })), call.status === "completed" && tool?.result !== undefined
79
+ : "neutral", children: ["exit ", String(call.exitCode)] })), call.durationMs === undefined ? null : (_jsx("span", { children: formatToolDuration(call.durationMs) })), _jsx(Status, { motion: running ? "bounce" : "none", title: call.status === "unknown" ? "result unavailable" : call.status, tone: statusTone(call.status, call.recovered === true) })] }), children: _jsx(CallBody, { call: call, disclosure: disclosure, onToggle: onToggle, mediaClaimed: tool !== undefined && claimsToolMedia?.(tool) === true, tool: tool }) }), call.live === undefined ? null : (_jsx(MonoBlock, { "aria-label": "Live tool output", children: toolLiveLines(call, open).map((line, index) => (_jsx("span", { className: "block whitespace-pre", children: line || "\u00a0" }, String(index)))) })), call.status === "completed" && tool?.result !== undefined
77
80
  ? renderToolActions?.(tool)
78
81
  : null] }));
79
82
  }
@@ -116,7 +116,7 @@ export declare function approvalCardCopy(view: ApprovalFacts, review: ApprovalRe
116
116
  now: number;
117
117
  }>): ApprovalCard;
118
118
  /** What an answer was refused for, in words for the person. */
119
- export declare function approvalRefusal(reason: string, decision: "approve" | "deny" | "always-allow"): string;
119
+ export declare function approvalRefusal(reason: string, decision: "approve" | "deny" | "always-allow"): "This request changed. Look again before answering." | "This request expired. Nothing ran." | "This request is gone. Nothing ran. Ask the Agent to try again." | "This request was already denied. Nothing ran." | "Always allow isn't available for this command. Approve once or deny." | "You can't answer this request. Nothing ran. Ask whoever owns it." | "You aren't allowed to answer this request. Nothing ran. Ask whoever owns it." | "This request no longer matches what you saw. Nothing ran. Refresh and look again." | "This request hasn't been answered yet. Answer it first." | "This is already running. Wait for it to finish." | "We can't tell whether this ran. Check before trying again." | "This session isn't connected anymore. Reconnect and try again. Nothing ran." | "Couldn't answer this request. Nothing ran. Try again.";
120
120
  /** What the person decided. */
121
121
  export type ApprovalDecision = "approve" | "deny" | "always-allow";
122
122
  /** A decision, pinned to the revision the person saw. */
@@ -155,17 +155,35 @@ export function approvalRefusal(reason, decision) {
155
155
  switch (reason) {
156
156
  case "stale-revision":
157
157
  case "already-answered":
158
+ case "not-pending":
158
159
  return "This request changed. Look again before answering.";
159
160
  case "expired":
160
161
  return "This request expired. Nothing ran.";
162
+ case "not-found":
163
+ return "This request is gone. Nothing ran. Ask the Agent to try again.";
164
+ case "declined":
165
+ return "This request was already denied. Nothing ran.";
161
166
  case "not-eligible":
162
- if (decision === "always-allow")
163
- return "Always allow isn't available for this command. Approve once or deny.";
164
- break;
167
+ return decision === "always-allow"
168
+ ? "Always allow isn't available for this command. Approve once or deny."
169
+ : "You can't answer this request. Nothing ran. Ask whoever owns it.";
170
+ case "not-granted":
171
+ case "read-only":
172
+ return "You aren't allowed to answer this request. Nothing ran. Ask whoever owns it.";
173
+ case "fenced":
174
+ case "identity-conflict":
175
+ return "This request no longer matches what you saw. Nothing ran. Refresh and look again.";
176
+ case "pending":
177
+ return "This request hasn't been answered yet. Answer it first.";
178
+ case "in-flight":
179
+ return "This is already running. Wait for it to finish.";
180
+ case "outcome-unknown":
181
+ return "We can't tell whether this ran. Check before trying again.";
182
+ case "not-attached":
183
+ return "This session isn't connected anymore. Reconnect and try again. Nothing ran.";
165
184
  default:
166
- break;
185
+ return "Couldn't answer this request. Nothing ran. Try again.";
167
186
  }
168
- return `Couldn't answer (${reason}). Nothing ran.`;
169
187
  }
170
188
  const failureMessage = "Couldn't send your answer. It may not have been recorded.";
171
189
  /**
package/dist/parakeet.js CHANGED
@@ -230,7 +230,12 @@ function ConversationTimeline({ disambiguateAuthors, clientActions, onOpen, focu
230
230
  scroller.scrollHeight - 1 &&
231
231
  hasNewerHistory)
232
232
  loadNewerHistory();
233
- }, style: { overscrollBehavior: "contain" }, children: [count > 0 ? (_jsx("div", { className: "relative w-full", style: { height: `${String(timeline.getTotalSize())}px` }, children: virtualItems.map((virtualItem) => {
233
+ }, style: { overscrollBehavior: "contain" }, children: [count > 0 ? (_jsx("div", { className: "relative w-full", style: {
234
+ // Room under the last row for the jump-to-bottom control
235
+ // (2rem plus its 1rem offset), so the row can scroll clear of
236
+ // it. At the end the control is hidden: one gap (the 8px composer inset), not two.
237
+ height: `${String(timeline.getTotalSize() + (atBottom ? 8 : 48))}px`,
238
+ }, children: virtualItems.map((virtualItem) => {
234
239
  const item = itemAt(virtualItem.index);
235
240
  if (item === undefined)
236
241
  return null;
@@ -245,9 +250,6 @@ function ConversationTimeline({ disambiguateAuthors, clientActions, onOpen, focu
245
250
  ? "error"
246
251
  : undefined, ref: timeline.measureElement, style: {
247
252
  left: 0,
248
- // The last row keeps room for the jump-to-bottom control
249
- // (2rem plus its 1rem offset) so it can scroll clear of it.
250
- paddingBottom: virtualItem.index === count - 1 ? 48 : undefined,
251
253
  position: "absolute",
252
254
  top: 0,
253
255
  transform: `translateY(${String(virtualItem.start)}px)`,
package/dist/styles.css CHANGED
@@ -19543,6 +19543,11 @@
19543
19543
  height: var(--caps-status-tray-key-height);
19544
19544
  min-height: var(--caps-status-tray-key-height);
19545
19545
  }
19546
+ @media (pointer: coarse) {
19547
+ .parakeet-composer-shell .caps-composer-toolbar > .caps-status-tray {
19548
+ --caps-status-tray-key-height: 2.75rem;
19549
+ }
19550
+ }
19546
19551
  .parakeet-composer-row .caps-keycap-led {
19547
19552
  display: none;
19548
19553
  }
@@ -19615,6 +19620,40 @@
19615
19620
  .prose pre, .prose table {
19616
19621
  max-width: none;
19617
19622
  }
19623
+ @property --edge-start {
19624
+ syntax: "<length>";
19625
+ inherits: false;
19626
+ initial-value: 0rem;
19627
+ }
19628
+ @property --edge-end {
19629
+ syntax: "<length>";
19630
+ inherits: false;
19631
+ initial-value: 0rem;
19632
+ }
19633
+ @keyframes parakeet-edge-fade {
19634
+ 0% {
19635
+ --edge-start: 0rem;
19636
+ --edge-end: 2.5rem;
19637
+ }
19638
+ 4% {
19639
+ --edge-start: 2.5rem;
19640
+ }
19641
+ 96% {
19642
+ --edge-end: 2.5rem;
19643
+ }
19644
+ 100% {
19645
+ --edge-start: 2.5rem;
19646
+ --edge-end: 0rem;
19647
+ }
19648
+ }
19649
+ .parakeet-edge-fade {
19650
+ animation: parakeet-edge-fade linear both;
19651
+ animation-timeline: scroll(self inline);
19652
+ mask-image: linear-gradient( to right, transparent, #000 var(--edge-start), #000 calc(100% - var(--edge-end)), transparent );
19653
+ }
19654
+ [data-parakeet-entry="tool_group"] {
19655
+ border-inline-start: 3px solid var(--color-primary);
19656
+ }
19618
19657
  .text-dim {
19619
19658
  color: var(--stipe-fg-muted);
19620
19659
  }
@@ -20724,6 +20763,8 @@ pre.tm-code, pre.th-code {
20724
20763
  --tw-drop-shadow-size: initial;
20725
20764
  --tw-ease: initial;
20726
20765
  --tw-content: "";
20766
+ --edge-start: 0rem;
20767
+ --edge-end: 0rem;
20727
20768
  }
20728
20769
  }
20729
20770
  }
@@ -1832,7 +1832,23 @@ shortens paths inside it to `~`; `now` dates the expiry.
1832
1832
  ### approvalRefusal()
1833
1833
 
1834
1834
  ```ts
1835
- function approvalRefusal(reason, decision): string;
1835
+ function approvalRefusal(
1836
+ reason,
1837
+ decision,
1838
+ ):
1839
+ | "This request changed. Look again before answering."
1840
+ | "This request expired. Nothing ran."
1841
+ | "This request is gone. Nothing ran. Ask the Agent to try again."
1842
+ | "This request was already denied. Nothing ran."
1843
+ | "Always allow isn't available for this command. Approve once or deny."
1844
+ | "You can't answer this request. Nothing ran. Ask whoever owns it."
1845
+ | "You aren't allowed to answer this request. Nothing ran. Ask whoever owns it."
1846
+ | "This request no longer matches what you saw. Nothing ran. Refresh and look again."
1847
+ | "This request hasn't been answered yet. Answer it first."
1848
+ | "This is already running. Wait for it to finish."
1849
+ | "We can't tell whether this ran. Check before trying again."
1850
+ | "This session isn't connected anymore. Reconnect and try again. Nothing ran."
1851
+ | "Couldn't answer this request. Nothing ran. Try again.";
1836
1852
  ```
1837
1853
 
1838
1854
  What an answer was refused for, in words for the person.
@@ -1846,7 +1862,20 @@ What an answer was refused for, in words for the person.
1846
1862
 
1847
1863
  #### Returns
1848
1864
 
1849
- `string`
1865
+ \| `"This request changed. Look again before answering."` \|
1866
+ `"This request expired. Nothing ran."` \|
1867
+ `"This request is gone. Nothing ran. Ask the Agent to try again."` \|
1868
+ `"This request was already denied. Nothing ran."` \|
1869
+ `"Always allow isn't available for this command. Approve once or deny."` \|
1870
+ `"You can't answer this request. Nothing ran. Ask whoever owns it."` \|
1871
+ `"You aren't allowed to answer this request. Nothing ran. Ask whoever owns it."`
1872
+ \|
1873
+ `"This request no longer matches what you saw. Nothing ran. Refresh and look again."`
1874
+ \| `"This request hasn't been answered yet. Answer it first."` \|
1875
+ `"This is already running. Wait for it to finish."` \|
1876
+ `"We can't tell whether this ran. Check before trying again."` \|
1877
+ `"This session isn't connected anymore. Reconnect and try again. Nothing ran."`
1878
+ \| `"Couldn't answer this request. Nothing ran. Try again."`
1850
1879
 
1851
1880
  ---
1852
1881
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/parakeet",
3
- "version": "0.11.36",
3
+ "version": "0.11.38",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "private": false,
6
6
  "description": "Standalone React composer for a typed Shiitake Session",
@@ -53,6 +53,14 @@
53
53
  min-height: var(--caps-status-tray-key-height);
54
54
  }
55
55
 
56
+ /* Touch phones: composer keys are 44px targets. The caps toolbar sets the key
57
+ height on the tray itself, so the rule sits on the tray, not the shell. */
58
+ @media (pointer: coarse) {
59
+ .parakeet-composer-shell .caps-composer-toolbar > .caps-status-tray {
60
+ --caps-status-tray-key-height: 2.75rem;
61
+ }
62
+ }
63
+
56
64
  /* Composer keys already disclose through their face and chevron. Keep native
57
65
  expanded/pressed semantics without redundant decorative corner lamps. */
58
66
  .parakeet-composer-row .caps-keycap-led {
package/src/styles.css CHANGED
@@ -29,6 +29,56 @@
29
29
  max-width: none;
30
30
  }
31
31
 
32
+ /* Long tool output scrolls sideways; where it runs past an edge it fades out
33
+ * instead of hard-clipping. Scroll-driven, so a block that fits, or a browser
34
+ * without scroll timelines, keeps the plain edge. */
35
+ @property --edge-start {
36
+ syntax: "<length>";
37
+ inherits: false;
38
+ initial-value: 0rem;
39
+ }
40
+
41
+ @property --edge-end {
42
+ syntax: "<length>";
43
+ inherits: false;
44
+ initial-value: 0rem;
45
+ }
46
+
47
+ @keyframes parakeet-edge-fade {
48
+ 0% {
49
+ --edge-start: 0rem;
50
+ --edge-end: 2.5rem;
51
+ }
52
+ 4% {
53
+ --edge-start: 2.5rem;
54
+ }
55
+ 96% {
56
+ --edge-end: 2.5rem;
57
+ }
58
+ 100% {
59
+ --edge-start: 2.5rem;
60
+ --edge-end: 0rem;
61
+ }
62
+ }
63
+
64
+ .parakeet-edge-fade {
65
+ animation: parakeet-edge-fade linear both;
66
+ animation-timeline: scroll(self inline);
67
+ mask-image: linear-gradient(
68
+ to right,
69
+ transparent,
70
+ #000 var(--edge-start),
71
+ #000 calc(100% - var(--edge-end)),
72
+ transparent
73
+ );
74
+ }
75
+
76
+ /* The turn's accent rail (the prompt's primary bar) continues through its
77
+ * tool rows instead of stopping at the prompt. */
78
+ [data-parakeet-entry="tool_group"] {
79
+ border-inline-start: 3px solid var(--color-primary);
80
+ }
81
+
32
82
  .text-dim {
33
83
  color: var(--stipe-fg-muted);
34
84
  }