flavor-code 1.3.23 → 1.4.0-beta.10

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 (181) hide show
  1. package/README.md +439 -434
  2. package/README.zh-CN.md +436 -431
  3. package/dist/agent/loop.d.ts +7 -2
  4. package/dist/{app-NTEUPJKJ.js → app-SMIB6P23.js} +82 -161
  5. package/dist/{chunk-Z62P4LL7.js → chunk-BYHO2CA5.js} +10412 -8712
  6. package/dist/{chunk-RPFWB45Y.js → chunk-EXOSMO57.js} +13 -8
  7. package/dist/chunk-N5MXHJKD.js +107 -0
  8. package/dist/{chunk-7OICVL2M.js → chunk-RAYH6K2H.js} +2 -44
  9. package/dist/{chunk-VEUSROUQ.js → chunk-UO4DLWU5.js} +8 -2
  10. package/dist/{chunk-SUSLIHXO.js → chunk-XMRKRPNC.js} +179 -14253
  11. package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
  12. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-6EZHF64C.js} +2 -3
  13. package/dist/cli-main.js +75 -28
  14. package/dist/cli.js +54 -10
  15. package/dist/config/load.d.ts +2 -0
  16. package/dist/config/schema.d.ts +8 -0
  17. package/dist/context/manager.d.ts +9 -0
  18. package/dist/desktop/main.js +3035 -1237
  19. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  20. package/dist/desktop-renderer/assets/index-RNe5Gtum.js +154 -0
  21. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-DestMQ2z.js} +1 -1
  22. package/dist/desktop-renderer/index.html +2 -2
  23. package/dist/doctor.d.ts +38 -0
  24. package/dist/execution/docker.d.ts +5 -1
  25. package/dist/execution/types.d.ts +11 -0
  26. package/dist/git/service.d.ts +3 -3
  27. package/dist/git/tools.d.ts +1 -1
  28. package/dist/goal/classifier.d.ts +2 -0
  29. package/dist/goal/orchestrator.d.ts +23 -2
  30. package/dist/goal/planner.d.ts +2 -0
  31. package/dist/goal/store.d.ts +2 -0
  32. package/dist/goal/types.d.ts +14 -0
  33. package/dist/harness/journal.d.ts +2 -0
  34. package/dist/harness/local.d.ts +2 -0
  35. package/dist/init/project.d.ts +0 -6
  36. package/dist/jobs/registry.d.ts +8 -1
  37. package/dist/{load-4FWNXE6F.js → load-EW56Q2MM.js} +1 -1
  38. package/dist/loop/orchestrator.d.ts +20 -0
  39. package/dist/loop/types.d.ts +7 -0
  40. package/dist/loop/verifier.d.ts +2 -0
  41. package/dist/models/openai.d.ts +1 -1
  42. package/dist/models/structured.d.ts +7 -0
  43. package/dist/models/types.d.ts +1 -1
  44. package/dist/production.d.ts +17 -0
  45. package/dist/sdk/index.js +5 -5
  46. package/dist/session/tree.d.ts +2 -0
  47. package/dist/tools/lsp.d.ts +15 -10
  48. package/dist/tools/runtime.d.ts +2 -1
  49. package/dist/tools/search.d.ts +1 -0
  50. package/dist/tools/shell.d.ts +17 -12
  51. package/dist/tools/types.d.ts +2 -1
  52. package/dist/ui/commands.d.ts +1 -1
  53. package/dist/ui/session.d.ts +12 -0
  54. package/dist/ui/transcript.d.ts +9 -0
  55. package/dist/update/check.d.ts +20 -0
  56. package/dist/utils/abort.d.ts +20 -0
  57. package/dist/utils/execFileNoThrow.d.ts +1 -0
  58. package/dist/utils/heap.d.ts +58 -0
  59. package/dist/utils/memory-restart.d.ts +42 -3
  60. package/dist/utils/process-tree.d.ts +2 -0
  61. package/dist/utils/rotation-census.d.ts +36 -0
  62. package/dist/utils/semver.d.ts +3 -0
  63. package/dist/utils/spawn-executable.d.ts +2 -0
  64. package/package.json +3 -2
  65. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  66. package/dist/astgraph/db.mjs +0 -237
  67. package/dist/astgraph/extract.mjs +0 -239
  68. package/dist/astgraph/flavor-plugin.json +0 -25
  69. package/dist/astgraph/grammars.mjs +0 -68
  70. package/dist/astgraph/index.js +0 -301
  71. package/dist/astgraph/indexer.mjs +0 -175
  72. package/dist/astgraph/query.mjs +0 -165
  73. package/dist/astgraph/resolve.mjs +0 -93
  74. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  75. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  76. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  77. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  78. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  79. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  80. package/dist/astgraph/vendor/zod/index.js +0 -4
  81. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  82. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/package.json +0 -135
  84. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  85. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  86. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  87. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  88. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  89. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  90. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  91. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  92. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  93. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  94. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  95. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  96. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  97. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  98. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  99. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  100. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  101. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  102. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  103. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  104. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  105. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  106. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  107. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  108. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  109. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  110. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  111. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  112. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  113. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  114. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  115. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  116. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  117. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  118. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  119. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  120. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  121. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  122. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  123. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  124. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  125. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  126. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  127. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  128. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  129. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  130. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  131. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  132. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  133. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  134. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  135. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  136. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  137. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  138. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  139. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  140. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  141. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  142. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  143. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  144. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  145. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  146. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  147. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  148. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  149. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  150. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  151. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  152. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  153. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  154. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  155. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  156. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  157. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  158. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  159. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  160. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  161. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  162. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  163. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  164. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  165. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  166. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  167. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  168. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  169. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  170. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  171. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  172. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  173. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  174. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  175. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  176. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  177. package/dist/chunk-CIVPKHF4.js +0 -53
  178. package/dist/chunk-OTYFL4AG.js +0 -16
  179. package/dist/desktop-renderer/assets/index-D75ozXnZ.js +0 -154
  180. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
  181. package/dist/devtools-4QTPKBKK.js +0 -2
@@ -2,6 +2,7 @@ import type { ContextManager } from "../context/manager.js";
2
2
  import type { HallucinationGuard } from "../hallucination/guard.js";
3
3
  import type { HookBus } from "../hooks/bus.js";
4
4
  import type { ModelRegistry } from "../models/registry.js";
5
+ import { MEMORY_PRESSURE_HEAP_RATIO } from "../utils/heap.js";
5
6
  import { type ModelMessage, type ModelTool } from "../models/types.js";
6
7
  import type { ToolRuntime } from "../tools/runtime.js";
7
8
  import type { AgentError, AgentEvent, AgentRunRequest } from "./types.js";
@@ -10,9 +11,10 @@ import type { AgentError, AgentEvent, AgentRunRequest } from "./types.js";
10
11
  * leak otherwise ends in a native OOM crash with no recovery; tripping this
11
12
  * watermark saves the session and lets the launcher relaunch on a fresh heap.
12
13
  * 0.8 keeps headroom for compaction payloads and the GC death spiral that
13
- * starts near ~0.95.
14
+ * starts near ~0.95. The reading is GC-verified: uncollected garbage alone
15
+ * must not stop a turn.
14
16
  */
15
- export declare const MEMORY_PRESSURE_HEAP_RATIO = 0.8;
17
+ export { MEMORY_PRESSURE_HEAP_RATIO };
16
18
  export declare function memoryPressureError(heapUsed: number, heapLimit: number): AgentError | undefined;
17
19
  export interface AgentLoopOptions {
18
20
  registry: ModelRegistry;
@@ -46,6 +48,9 @@ export declare class AgentLoop {
46
48
  constructor(options: AgentLoopOptions);
47
49
  get modelId(): string;
48
50
  get iterationLimitMode(): "standard" | "d2c";
51
+ get maxIterations(): number;
52
+ get softLimitFactor(): number;
53
+ get extendIterations(): number;
49
54
  setModel(modelId: string): void;
50
55
  setFallbackModel(modelId: string): void;
51
56
  /** D2C keeps a hard cap, but may automatically expand it up to ten times. */
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
3
3
  import {
4
- checkForUpdate,
5
4
  statusPresentation
6
- } from "./chunk-7OICVL2M.js";
5
+ } from "./chunk-RAYH6K2H.js";
7
6
  import {
8
7
  COMMAND_DESCRIPTIONS,
9
8
  MVP_COMMANDS,
10
9
  charWidth,
10
+ checkForUpdate,
11
11
  createGlobTool,
12
12
  createProductionRuntime,
13
13
  createTranscriptState,
@@ -19,9 +19,9 @@ import {
19
19
  thinkingWindow,
20
20
  transcriptReducer,
21
21
  withTimeout
22
- } from "./chunk-Z62P4LL7.js";
23
- import "./chunk-CIVPKHF4.js";
24
- import "./chunk-RPFWB45Y.js";
22
+ } from "./chunk-BYHO2CA5.js";
23
+ import "./chunk-N5MXHJKD.js";
24
+ import "./chunk-EXOSMO57.js";
25
25
  import {
26
26
  Box_default,
27
27
  ClockContext,
@@ -38,11 +38,10 @@ import {
38
38
  useStdout,
39
39
  use_app_default,
40
40
  use_input_default
41
- } from "./chunk-SUSLIHXO.js";
42
- import "./chunk-OTYFL4AG.js";
41
+ } from "./chunk-XMRKRPNC.js";
43
42
  import {
44
43
  execFileNoThrow
45
- } from "./chunk-RQTYHUMK.js";
44
+ } from "./chunk-ZJCAQXA7.js";
46
45
  import "./chunk-S32JRDZK.js";
47
46
 
48
47
  // src/ui/app.tsx
@@ -1008,7 +1007,7 @@ function TaskStatusLine({ block, interactive }) {
1008
1007
  thinkingScroll.current = { start: state.start, lastTime: time };
1009
1008
  return state.text;
1010
1009
  })() : void 0;
1011
- return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "column", children: [
1010
+ return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "column", width: "100%", children: [
1012
1011
  /* @__PURE__ */ jsxs2(Box_default, { ref, flexDirection: "row", children: [
1013
1012
  /* @__PURE__ */ jsxs2(Text, { ...presentation.color === void 0 ? {} : { color: presentation.color }, children: [
1014
1013
  presentation.glyph,
@@ -1040,38 +1039,70 @@ function ThinkingLineView({ text }) {
1040
1039
  /* @__PURE__ */ jsx3(Text, { color: THINKING_TEXT, wrap: "truncate-end", children: text })
1041
1040
  ] });
1042
1041
  }
1042
+ var SPLIT_TRACK_MIN_COLUMNS = 72;
1043
1043
  function TaskProgressPanel({
1044
1044
  blocks,
1045
1045
  interactive,
1046
1046
  maxHeight = 8,
1047
+ columns = 80,
1047
1048
  scrollRef,
1048
1049
  onHoverChange
1049
1050
  }) {
1050
1051
  if (blocks.length === 0 || maxHeight <= 0) return null;
1052
+ const taskBlocks = blocks.filter((block) => block.task?.role === "main");
1053
+ const subagentBlocks = blocks.filter((block) => block.task?.role === "subagent");
1054
+ const hasTasks = taskBlocks.length > 0;
1055
+ const hasSubagents = subagentBlocks.length > 0;
1056
+ const split = hasTasks && hasSubagents && columns >= SPLIT_TRACK_MIN_COLUMNS;
1051
1057
  return /* @__PURE__ */ jsxs2(
1052
1058
  Box_default,
1053
1059
  {
1054
1060
  flexDirection: "column",
1055
1061
  flexShrink: 0,
1062
+ width: "100%",
1056
1063
  maxHeight,
1057
1064
  onMouseEnter: () => onHoverChange?.(true),
1058
1065
  onMouseLeave: () => onHoverChange?.(false),
1059
1066
  children: [
1060
- /* @__PURE__ */ jsx3(Text, { dimColor: true, children: "\u2500\u2500 task progress \u2500\u2500" }),
1067
+ split ? /* @__PURE__ */ jsx3(SplitTrackHeaders, {}) : /* @__PURE__ */ jsx3(TrackHeader, { role: hasTasks ? "main" : "subagent" }),
1061
1068
  maxHeight > 1 ? /* @__PURE__ */ jsx3(
1062
1069
  ScrollBox_default,
1063
1070
  {
1064
1071
  ...scrollRef === void 0 ? {} : { ref: scrollRef },
1065
1072
  flexDirection: "column",
1066
1073
  flexShrink: 1,
1074
+ width: "100%",
1067
1075
  maxHeight: maxHeight - 1,
1068
- children: blocks.map((block) => /* @__PURE__ */ jsx3(TaskStatusLine, { block, interactive }, block.id))
1076
+ children: split ? pairedTrackRows(taskBlocks, subagentBlocks).map(([task, subagent], index) => /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "row", width: "100%", columnGap: 2, children: [
1077
+ /* @__PURE__ */ jsx3(Box_default, { flexBasis: 0, flexGrow: 1, minWidth: 0, flexDirection: "column", children: task === void 0 ? null : /* @__PURE__ */ jsx3(TaskStatusLine, { block: task, interactive }) }),
1078
+ /* @__PURE__ */ jsx3(Box_default, { flexBasis: 0, flexGrow: 1, minWidth: 0, flexDirection: "column", children: subagent === void 0 ? null : /* @__PURE__ */ jsx3(TaskStatusLine, { block: subagent, interactive }) })
1079
+ ] }, `${task?.id ?? "task"}:${subagent?.id ?? "subagent"}:${index}`)) : hasTasks && hasSubagents ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
1080
+ taskBlocks.map((block) => /* @__PURE__ */ jsx3(TaskStatusLine, { block, interactive }, block.id)),
1081
+ /* @__PURE__ */ jsx3(TrackHeader, { role: "subagent" }),
1082
+ subagentBlocks.map((block) => /* @__PURE__ */ jsx3(TaskStatusLine, { block, interactive }, block.id))
1083
+ ] }) : (hasTasks ? taskBlocks : subagentBlocks).map((block) => /* @__PURE__ */ jsx3(TaskStatusLine, { block, interactive }, block.id))
1069
1084
  }
1070
1085
  ) : null
1071
1086
  ]
1072
1087
  }
1073
1088
  );
1074
1089
  }
1090
+ function TrackHeader({ role }) {
1091
+ return /* @__PURE__ */ jsxs2(Text, { dimColor: true, children: [
1092
+ "\u2500\u2500 ",
1093
+ role === "main" ? "task plan" : "subagent exploration",
1094
+ " \u2500\u2500"
1095
+ ] });
1096
+ }
1097
+ function SplitTrackHeaders() {
1098
+ return /* @__PURE__ */ jsxs2(Box_default, { flexDirection: "row", width: "100%", columnGap: 2, children: [
1099
+ /* @__PURE__ */ jsx3(Box_default, { flexBasis: 0, flexGrow: 1, minWidth: 0, children: /* @__PURE__ */ jsx3(TrackHeader, { role: "main" }) }),
1100
+ /* @__PURE__ */ jsx3(Box_default, { flexBasis: 0, flexGrow: 1, minWidth: 0, children: /* @__PURE__ */ jsx3(TrackHeader, { role: "subagent" }) })
1101
+ ] });
1102
+ }
1103
+ function pairedTrackRows(tasks, subagents) {
1104
+ return Array.from({ length: Math.max(tasks.length, subagents.length) }, (_, index) => [tasks[index], subagents[index]]);
1105
+ }
1075
1106
 
1076
1107
  // src/ui/file-diff-style.ts
1077
1108
  var CONTENT = "#f8f8f2";
@@ -1308,7 +1339,7 @@ function WelcomeCard({
1308
1339
  columns
1309
1340
  }) {
1310
1341
  const wide = Math.max(1, Math.floor(columns)) >= WIDE_WELCOME_COLUMNS;
1311
- const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ jsxs3(Text, { color: "yellowBright", wrap: "truncate-end", children: [
1342
+ const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ jsxs3(Text, { color: "yellowBright", wrap: "wrap", children: [
1312
1343
  "\u25B2 ",
1313
1344
  "Update available: v",
1314
1345
  packageVersion(),
@@ -1316,7 +1347,7 @@ function WelcomeCard({
1316
1347
  "\u2192",
1317
1348
  " v",
1318
1349
  updateTo,
1319
- " \xB7 run: flavor update"
1350
+ "\nRun: flavor update"
1320
1351
  ] });
1321
1352
  return /* @__PURE__ */ jsx4(Box_default, { width: "100%", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: wide ? /* @__PURE__ */ jsxs3(Box_default, { width: "100%", flexDirection: "row", children: [
1322
1353
  /* @__PURE__ */ jsxs3(
@@ -1523,160 +1554,45 @@ function isBridgeMethod(value, method) {
1523
1554
  && typeof value[method] === "function";
1524
1555
  }
1525
1556
 
1526
- function safeDataForType(pasteboard, type) {
1527
- try {
1528
- return isBridgeMethod(pasteboard, "dataForType")
1529
- ? pasteboard.dataForType(type)
1530
- : null;
1531
- } catch (error) {
1532
- return null;
1533
- }
1534
- }
1535
-
1536
- function pngDataFromTiff(tiff) {
1537
- if (!isBridgeMethod(tiff, "base64EncodedStringWithOptions")) {
1538
- return null;
1539
- }
1540
- try {
1541
- const representation = $.NSBitmapImageRep.imageRepWithData(tiff);
1542
- if (!isBridgeMethod(representation, "representationUsingTypeProperties")) {
1543
- return null;
1544
- }
1545
- const converted = representation.representationUsingTypeProperties(
1546
- $.NSBitmapImageFileTypePNG,
1547
- $({})
1548
- );
1549
- return isBridgeMethod(converted, "base64EncodedStringWithOptions")
1550
- ? converted
1551
- : null;
1552
- } catch (error) {
1553
- return null;
1554
- }
1555
- }
1556
-
1557
- function base64FromData(data) {
1558
- if (!isBridgeMethod(data, "base64EncodedStringWithOptions")) {
1559
- return null;
1560
- }
1561
- try {
1562
- const encoded = data.base64EncodedStringWithOptions(0);
1563
- if (!encoded) {
1564
- return null;
1565
- }
1566
- const unwrapped = ObjC.unwrap(encoded);
1567
- return typeof unwrapped === "string" && unwrapped.length > 0
1568
- ? unwrapped
1569
- : null;
1570
- } catch (error) {
1571
- return null;
1572
- }
1573
- }
1574
-
1575
- function firstReadableObject(pasteboard, objectClass) {
1576
- try {
1577
- if (!isBridgeMethod(pasteboard, "readObjectsForClassesOptions")) {
1578
- return null;
1579
- }
1580
- const classes = $.NSArray.arrayWithObject(objectClass);
1581
- const objects = pasteboard.readObjectsForClassesOptions(classes, $({}));
1582
- return objects === null || objects === undefined ? null : objects.firstObject;
1583
- } catch (error) {
1584
- return null;
1585
- }
1586
- }
1587
-
1588
- function imageFromWholePasteboard(pasteboard) {
1589
- try {
1590
- const image = $.NSImage.alloc.initWithPasteboard(pasteboard);
1591
- return image === null || image === undefined ? null : image;
1592
- } catch (error) {
1593
- return null;
1594
- }
1595
- }
1596
-
1597
- function imageFromFileUrl(pasteboard) {
1598
- try {
1599
- const url = firstReadableObject(pasteboard, $.NSURL);
1600
- if (url === null || url === undefined || !url.isFileURL) {
1601
- return null;
1602
- }
1603
- const image = $.NSImage.alloc.initWithContentsOfURL(url);
1604
- return image === null || image === undefined ? null : image;
1605
- } catch (error) {
1606
- return null;
1607
- }
1608
- }
1609
-
1610
- function base64FromImage(image) {
1611
- try {
1612
- return image === null || image === undefined
1613
- ? null
1614
- : base64FromData(pngDataFromTiff(image.TIFFRepresentation));
1615
- } catch (error) {
1616
- return null;
1617
- }
1618
- }
1619
-
1620
- function pasteboardTypeNames(pasteboard) {
1621
- try {
1622
- const types = pasteboard.types;
1623
- if (!isBridgeMethod(types, "objectAtIndex")) {
1624
- return [];
1625
- }
1626
- const count = Number(types.count);
1627
- const names = [];
1628
- for (let index = 0; index < count; index += 1) {
1629
- const name = ObjC.unwrap(types.objectAtIndex(index));
1630
- if (typeof name === "string") {
1631
- names.push(name);
1557
+ try {
1558
+ const pasteboard = $.NSPasteboard.generalPasteboard;
1559
+ let data = null;
1560
+ if (isBridgeMethod(pasteboard, "dataForType")) {
1561
+ const png = pasteboard.dataForType($.NSPasteboardTypePNG);
1562
+ if (isBridgeMethod(png, "base64EncodedStringWithOptions")) {
1563
+ data = png;
1564
+ } else {
1565
+ const tiff = pasteboard.dataForType($.NSPasteboardTypeTIFF);
1566
+ // NSData.length is exposed by JXA as a property value, not a
1567
+ // callable bridge method. Probe a real NSData method so a valid
1568
+ // TIFF-only pasteboard item is not mistaken for ObjC nil.
1569
+ if (isBridgeMethod(tiff, "base64EncodedStringWithOptions")) {
1570
+ const representation = $.NSBitmapImageRep.imageRepWithData(tiff);
1571
+ if (isBridgeMethod(representation, "representationUsingTypeProperties")) {
1572
+ const converted = representation.representationUsingTypeProperties(
1573
+ $.NSBitmapImageFileTypePNG,
1574
+ $.NSDictionary.dictionary
1575
+ );
1576
+ if (isBridgeMethod(converted, "base64EncodedStringWithOptions")) {
1577
+ data = converted;
1578
+ }
1579
+ }
1632
1580
  }
1633
1581
  }
1634
- return names;
1635
- } catch (error) {
1636
- return [];
1637
1582
  }
1638
- }
1639
-
1640
- const pasteboard = $.NSPasteboard.generalPasteboard;
1641
- let encoded = base64FromData(safeDataForType(pasteboard, $("public.png")));
1642
-
1643
- if (!encoded) {
1644
- encoded = base64FromData(
1645
- pngDataFromTiff(safeDataForType(pasteboard, $("public.tiff")))
1646
- );
1647
- }
1648
-
1649
- // Ask AppKit for objects conforming to NSPasteboardReading. This covers image
1650
- // formats and lazy providers that do not expose direct PNG/TIFF NSData.
1651
- if (!encoded) {
1652
- encoded = base64FromImage(firstReadableObject(pasteboard, $.NSImage));
1653
- }
1654
-
1655
- if (!encoded) {
1656
- encoded = base64FromImage(imageFromWholePasteboard(pasteboard));
1657
- }
1658
-
1659
- // Finder copies files as file URLs instead of image bytes. Load the first
1660
- // local file through NSImage, which also rejects non-image files.
1661
- if (!encoded) {
1662
- encoded = base64FromImage(imageFromFileUrl(pasteboard));
1663
- }
1664
-
1665
- if (!encoded) {
1666
- const types = pasteboardTypeNames(pasteboard);
1667
- const advertisedImage = types.some(function (type) {
1668
- return /image|png|tiff|jpeg|jpg|heic|gif|webp|bmp|pdf|file-url|filenames/i.test(type);
1669
- });
1670
- if (advertisedImage) {
1671
- throw new Error(
1672
- "Clipboard advertises image or file data but AppKit could not decode it. Types: "
1673
- + types.join(", ")
1674
- );
1583
+ if (!data) {
1584
+ $.exit(3);
1585
+ }
1586
+ const encoded = data.base64EncodedStringWithOptions(0);
1587
+ if (!encoded) {
1588
+ $.exit(3);
1675
1589
  }
1590
+ const output = encoded.stringByAppendingString("\n")
1591
+ .dataUsingEncoding($.NSUTF8StringEncoding);
1592
+ $.NSFileHandle.fileHandleWithStandardOutput.writeData(output);
1593
+ } catch (error) {
1676
1594
  $.exit(3);
1677
1595
  }
1678
-
1679
- console.log(encoded);
1680
1596
  `.trim();
1681
1597
  function shouldReadClipboardImage(input, key, isPasted) {
1682
1598
  return (key.ctrl || key.meta === true) && input.toLowerCase() === "v" || isPasted && input.length === 0;
@@ -2666,6 +2582,7 @@ function TerminalLayout({
2666
2582
  blocks: activeTaskBlocks,
2667
2583
  interactive: activeSession,
2668
2584
  maxHeight: taskPanelRows,
2585
+ columns,
2669
2586
  ...taskScrollRef === void 0 ? {} : { scrollRef: taskScrollRef },
2670
2587
  ...onTaskPanelHoverChange === void 0 ? {} : { onHoverChange: onTaskPanelHoverChange }
2671
2588
  }
@@ -3252,6 +3169,10 @@ function CommandPresentationView({
3252
3169
  ] }),
3253
3170
  stdout.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
3254
3171
  stderr.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
3172
+ presentation.diagnostic === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
3173
+ /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
3174
+ /* @__PURE__ */ jsx5(Text, { color: tone, children: presentation.diagnostic })
3175
+ ] }),
3255
3176
  /* @__PURE__ */ jsxs4(Box_default, { children: [
3256
3177
  /* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2514\u2500 " }),
3257
3178
  /* @__PURE__ */ jsx5(Text, { dimColor: true, children: commandFooter(presentation, state) })