@kvman/kvcoder 0.1.11 → 0.1.12

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 (235) hide show
  1. package/dist/api.d.ts +45 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/calls/call-name.d.ts.map +1 -1
  4. package/dist/calls/call-name.js +10 -1
  5. package/dist/calls/call-name.js.map +1 -1
  6. package/dist/calls/run-tool.d.ts.map +1 -1
  7. package/dist/calls/run-tool.js +2 -0
  8. package/dist/calls/run-tool.js.map +1 -1
  9. package/dist/connector-call.d.ts +2 -2
  10. package/dist/connector-call.d.ts.map +1 -1
  11. package/dist/connector-call.js +5 -3
  12. package/dist/connector-call.js.map +1 -1
  13. package/dist/connectors/artifact.d.ts +1 -0
  14. package/dist/connectors/artifact.d.ts.map +1 -1
  15. package/dist/connectors/background.d.ts.map +1 -1
  16. package/dist/connectors/background.js +8 -4
  17. package/dist/connectors/background.js.map +1 -1
  18. package/dist/connectors/builtin-connectors.d.ts +38 -0
  19. package/dist/connectors/builtin-connectors.d.ts.map +1 -1
  20. package/dist/connectors/builtin-connectors.js +4 -1
  21. package/dist/connectors/builtin-connectors.js.map +1 -1
  22. package/dist/connectors/delegate.d.ts.map +1 -1
  23. package/dist/connectors/delegate.js +3 -0
  24. package/dist/connectors/delegate.js.map +1 -1
  25. package/dist/connectors/execution-map.d.ts +1 -1
  26. package/dist/connectors/execution-map.d.ts.map +1 -1
  27. package/dist/connectors/execution-map.js +1 -1
  28. package/dist/connectors/execution-map.js.map +1 -1
  29. package/dist/connectors/fs.d.ts +29 -1
  30. package/dist/connectors/fs.d.ts.map +1 -1
  31. package/dist/connectors/fs.js +46 -9
  32. package/dist/connectors/fs.js.map +1 -1
  33. package/dist/connectors/payload-fields.d.ts +3 -0
  34. package/dist/connectors/payload-fields.d.ts.map +1 -1
  35. package/dist/connectors/payload-fields.js +8 -2
  36. package/dist/connectors/payload-fields.js.map +1 -1
  37. package/dist/connectors/web.d.ts +16 -0
  38. package/dist/connectors/web.d.ts.map +1 -0
  39. package/dist/connectors/web.js +22 -0
  40. package/dist/connectors/web.js.map +1 -0
  41. package/dist/delegate/permission.d.ts +6 -0
  42. package/dist/delegate/permission.d.ts.map +1 -1
  43. package/dist/files/change-diff.d.ts +17 -0
  44. package/dist/files/change-diff.d.ts.map +1 -0
  45. package/dist/files/change-diff.js +59 -0
  46. package/dist/files/change-diff.js.map +1 -0
  47. package/dist/files/edit-places.d.ts +11 -0
  48. package/dist/files/edit-places.d.ts.map +1 -0
  49. package/dist/files/edit-places.js +105 -0
  50. package/dist/files/edit-places.js.map +1 -0
  51. package/dist/files/edit-text.d.ts +1 -0
  52. package/dist/files/edit-text.d.ts.map +1 -1
  53. package/dist/files/edit-text.js +22 -10
  54. package/dist/files/edit-text.js.map +1 -1
  55. package/dist/files/file-change.d.ts.map +1 -1
  56. package/dist/files/file-change.js +12 -0
  57. package/dist/files/file-change.js.map +1 -1
  58. package/dist/files/find-paths.d.ts +9 -0
  59. package/dist/files/find-paths.d.ts.map +1 -0
  60. package/dist/files/find-paths.js +38 -0
  61. package/dist/files/find-paths.js.map +1 -0
  62. package/dist/files/read-file.d.ts +3 -1
  63. package/dist/files/read-file.d.ts.map +1 -1
  64. package/dist/files/read-file.js +7 -6
  65. package/dist/files/read-file.js.map +1 -1
  66. package/dist/files/read-files.d.ts +11 -0
  67. package/dist/files/read-files.d.ts.map +1 -0
  68. package/dist/files/read-files.js +35 -0
  69. package/dist/files/read-files.js.map +1 -0
  70. package/dist/files/read-text.d.ts +63 -0
  71. package/dist/files/read-text.d.ts.map +1 -0
  72. package/dist/files/read-text.js +67 -0
  73. package/dist/files/read-text.js.map +1 -0
  74. package/dist/files/register-changes.d.ts +3 -0
  75. package/dist/files/register-changes.d.ts.map +1 -0
  76. package/dist/files/register-changes.js +78 -0
  77. package/dist/files/register-changes.js.map +1 -0
  78. package/dist/files/search-text.d.ts +10 -1
  79. package/dist/files/search-text.d.ts.map +1 -1
  80. package/dist/files/search-text.js +32 -57
  81. package/dist/files/search-text.js.map +1 -1
  82. package/dist/files/workspace-files.d.ts +5 -0
  83. package/dist/files/workspace-files.d.ts.map +1 -0
  84. package/dist/files/workspace-files.js +66 -0
  85. package/dist/files/workspace-files.js.map +1 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +4 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/prompt/build-prompt.d.ts +4 -0
  90. package/dist/prompt/build-prompt.d.ts.map +1 -1
  91. package/dist/prompt/build-prompt.js +6 -2
  92. package/dist/prompt/build-prompt.js.map +1 -1
  93. package/dist/prompt/person-preferences.d.ts +5 -0
  94. package/dist/prompt/person-preferences.d.ts.map +1 -0
  95. package/dist/prompt/person-preferences.js +14 -0
  96. package/dist/prompt/person-preferences.js.map +1 -0
  97. package/dist/prompt/session-grants.d.ts +4 -0
  98. package/dist/prompt/session-grants.d.ts.map +1 -1
  99. package/dist/prompt/session-grants.js +3 -2
  100. package/dist/prompt/session-grants.js.map +1 -1
  101. package/dist/prompt/session-prompt.d.ts.map +1 -1
  102. package/dist/prompt/session-prompt.js +15 -6
  103. package/dist/prompt/session-prompt.js.map +1 -1
  104. package/dist/prompt/working-method.d.ts +2 -2
  105. package/dist/prompt/working-method.d.ts.map +1 -1
  106. package/dist/prompt/working-method.js +49 -43
  107. package/dist/prompt/working-method.js.map +1 -1
  108. package/dist/register-settings.d.ts +23 -0
  109. package/dist/register-settings.d.ts.map +1 -1
  110. package/dist/register-settings.js +13 -0
  111. package/dist/register-settings.js.map +1 -1
  112. package/dist/schemas/approval-rule.d.ts +9 -0
  113. package/dist/schemas/approval-rule.d.ts.map +1 -0
  114. package/dist/schemas/approval-rule.js +7 -0
  115. package/dist/schemas/approval-rule.js.map +1 -0
  116. package/dist/schemas/check.d.ts +7 -0
  117. package/dist/schemas/check.d.ts.map +1 -0
  118. package/dist/schemas/check.js +9 -0
  119. package/dist/schemas/check.js.map +1 -0
  120. package/dist/schemas/records.d.ts +10 -0
  121. package/dist/schemas/records.d.ts.map +1 -1
  122. package/dist/schemas/records.js +8 -0
  123. package/dist/schemas/records.js.map +1 -1
  124. package/dist/sessions/new-session.d.ts.map +1 -1
  125. package/dist/sessions/new-session.js +4 -1
  126. package/dist/sessions/new-session.js.map +1 -1
  127. package/dist/sessions/register-fork-export.d.ts.map +1 -1
  128. package/dist/sessions/register-fork-export.js +3 -2
  129. package/dist/sessions/register-fork-export.js.map +1 -1
  130. package/dist/sessions/register-sessions.d.ts.map +1 -1
  131. package/dist/sessions/register-sessions.js +17 -9
  132. package/dist/sessions/register-sessions.js.map +1 -1
  133. package/dist/sessions/session-view.d.ts +8 -1
  134. package/dist/sessions/session-view.d.ts.map +1 -1
  135. package/dist/sessions/session-view.js +6 -1
  136. package/dist/sessions/session-view.js.map +1 -1
  137. package/dist/sessions/waiting-on.d.ts +7 -0
  138. package/dist/sessions/waiting-on.d.ts.map +1 -0
  139. package/dist/sessions/waiting-on.js +20 -0
  140. package/dist/sessions/waiting-on.js.map +1 -0
  141. package/dist/store/collections.d.ts +18 -0
  142. package/dist/store/collections.d.ts.map +1 -1
  143. package/dist/store/collections.js +3 -1
  144. package/dist/store/collections.js.map +1 -1
  145. package/dist/turns/answer-extras.d.ts +21 -0
  146. package/dist/turns/answer-extras.d.ts.map +1 -0
  147. package/dist/turns/answer-extras.js +43 -0
  148. package/dist/turns/answer-extras.js.map +1 -0
  149. package/dist/turns/answer-fingerprint.d.ts +6 -2
  150. package/dist/turns/answer-fingerprint.d.ts.map +1 -1
  151. package/dist/turns/answer-fingerprint.js +9 -3
  152. package/dist/turns/answer-fingerprint.js.map +1 -1
  153. package/dist/turns/apply-answer.d.ts +2 -1
  154. package/dist/turns/apply-answer.d.ts.map +1 -1
  155. package/dist/turns/apply-answer.js +10 -4
  156. package/dist/turns/apply-answer.js.map +1 -1
  157. package/dist/turns/approval-rules.d.ts +13 -0
  158. package/dist/turns/approval-rules.d.ts.map +1 -0
  159. package/dist/turns/approval-rules.js +65 -0
  160. package/dist/turns/approval-rules.js.map +1 -0
  161. package/dist/turns/check-after-edits.d.ts +8 -0
  162. package/dist/turns/check-after-edits.d.ts.map +1 -0
  163. package/dist/turns/check-after-edits.js +23 -0
  164. package/dist/turns/check-after-edits.js.map +1 -0
  165. package/dist/turns/clear-results.d.ts +15 -0
  166. package/dist/turns/clear-results.d.ts.map +1 -0
  167. package/dist/turns/clear-results.js +58 -0
  168. package/dist/turns/clear-results.js.map +1 -0
  169. package/dist/turns/cleared-results.d.ts +17 -0
  170. package/dist/turns/cleared-results.d.ts.map +1 -0
  171. package/dist/turns/cleared-results.js +46 -0
  172. package/dist/turns/cleared-results.js.map +1 -0
  173. package/dist/turns/compaction.js +6 -6
  174. package/dist/turns/compaction.js.map +1 -1
  175. package/dist/turns/file-results.d.ts +15 -0
  176. package/dist/turns/file-results.d.ts.map +1 -0
  177. package/dist/turns/file-results.js +39 -0
  178. package/dist/turns/file-results.js.map +1 -0
  179. package/dist/turns/lost-reply.js +2 -2
  180. package/dist/turns/lost-reply.js.map +1 -1
  181. package/dist/turns/model-context.d.ts +2 -0
  182. package/dist/turns/model-context.d.ts.map +1 -1
  183. package/dist/turns/model-context.js +28 -5
  184. package/dist/turns/model-context.js.map +1 -1
  185. package/dist/turns/read-again.d.ts +11 -5
  186. package/dist/turns/read-again.d.ts.map +1 -1
  187. package/dist/turns/read-again.js +39 -10
  188. package/dist/turns/read-again.js.map +1 -1
  189. package/dist/turns/register-turns.d.ts.map +1 -1
  190. package/dist/turns/register-turns.js +12 -4
  191. package/dist/turns/register-turns.js.map +1 -1
  192. package/dist/turns/run-calls.d.ts +4 -0
  193. package/dist/turns/run-calls.d.ts.map +1 -1
  194. package/dist/turns/run-calls.js +35 -5
  195. package/dist/turns/run-calls.js.map +1 -1
  196. package/dist/turns/run-command.d.ts.map +1 -1
  197. package/dist/turns/run-command.js +4 -4
  198. package/dist/turns/run-command.js.map +1 -1
  199. package/dist/turns/step.d.ts.map +1 -1
  200. package/dist/turns/step.js +43 -8
  201. package/dist/turns/step.js.map +1 -1
  202. package/dist/ui/register-ui.js +2 -2
  203. package/dist/ui/register-ui.js.map +1 -1
  204. package/dist/web/components/approval.css +1 -1
  205. package/dist/web/components/approval.js +122 -89
  206. package/dist/web/components/call.css +1 -1
  207. package/dist/web/components/call.js +400 -302
  208. package/dist/web/components/connectors.css +1 -1
  209. package/dist/web/components/connectors.js +440 -427
  210. package/dist/web/components/conversation.css +1 -1
  211. package/dist/web/components/conversation.js +2509 -1500
  212. package/dist/web/components/mcp-sign-in.css +1 -1
  213. package/dist/web/components/model.css +1 -1
  214. package/dist/web/components/model.js +138 -126
  215. package/dist/web/components/preferences.css +2 -0
  216. package/dist/web/components/preferences.js +151 -0
  217. package/dist/web/components/question.css +1 -1
  218. package/dist/web/components/sessions.css +1 -1
  219. package/dist/web/components/sessions.js +44 -21
  220. package/dist/web-fetch/fetch-page.d.ts +28 -0
  221. package/dist/web-fetch/fetch-page.d.ts.map +1 -0
  222. package/dist/web-fetch/fetch-page.js +108 -0
  223. package/dist/web-fetch/fetch-page.js.map +1 -0
  224. package/dist/web-fetch/private-address.d.ts +3 -0
  225. package/dist/web-fetch/private-address.d.ts.map +1 -0
  226. package/dist/web-fetch/private-address.js +69 -0
  227. package/dist/web-fetch/private-address.js.map +1 -0
  228. package/dist/web-fetch/web-hosts.d.ts +7 -0
  229. package/dist/web-fetch/web-hosts.d.ts.map +1 -0
  230. package/dist/web-fetch/web-hosts.js +19 -0
  231. package/dist/web-fetch/web-hosts.js.map +1 -0
  232. package/docs/connectors.md +2 -2
  233. package/locales/ar.json +66 -1
  234. package/locales/en.json +66 -1
  235. package/package.json +17 -3
@@ -53,60 +53,60 @@ function S(e, t = {}) {
53
53
  var C = (e) => {
54
54
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
55
55
  return !1;
56
- }, w = (e) => e === "", T = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ee = /* @__PURE__ */ Symbol("lucide-icons");
57
- function te() {
58
- return u(ee, {});
56
+ }, w = (e) => e === "", T = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = /* @__PURE__ */ Symbol("lucide-icons");
57
+ function D() {
58
+ return u(E, {});
59
59
  }
60
60
  //#endregion
61
61
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
62
- var ne = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
62
+ var O = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
63
  name: e && T(e),
64
64
  node: t ?? n ?? [],
65
65
  size: 24,
66
66
  aliases: []
67
67
  }, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
68
- let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: ee = "" } = te(), ne = w(i) || w(a) || i === !0 || a === !0 || b === !0, E = w(o) || w(s) || o === !0 || s === !0 || x === !0;
68
+ let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: E = "" } = D(), O = w(i) || w(a) || i === !0 || a === !0 || b === !0, k = w(o) || w(s) || o === !0 || s === !0 || x === !0;
69
69
  delete h.class;
70
- let D = g.default?.(), [, O, k = []] = S(r, {
70
+ let A = g.default?.(), [, ee, j = []] = S(r, {
71
71
  color: m ?? v,
72
72
  width: f ?? d ?? _,
73
73
  height: p ?? d ?? _,
74
74
  strokeWidth: c ?? u ?? y,
75
- absoluteStrokeWidth: ne,
76
- nonScalingStroke: E,
77
- className: ee,
78
- hasA11yProp: D != null && D.length > 0 || C(h),
75
+ absoluteStrokeWidth: O,
76
+ nonScalingStroke: k,
77
+ className: E,
78
+ hasA11yProp: A != null && A.length > 0 || C(h),
79
79
  attributes: h
80
80
  });
81
- return l("svg", O, [...k.map(([e, t]) => l(e, t)), ...D ?? []]);
81
+ return l("svg", ee, [...j.map(([e, t]) => l(e, t)), ...A ?? []]);
82
82
  };
83
83
  //#endregion
84
84
  //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
85
- function E(e, t = []) {
85
+ function k(e, t = []) {
86
86
  let n = typeof e == "string" ? {
87
87
  name: e,
88
88
  node: t
89
89
  } : e;
90
- return (e, { slots: t }) => l(ne, {
90
+ return (e, { slots: t }) => l(O, {
91
91
  ...e,
92
92
  icon: n
93
93
  }, t.default ? { default: t.default } : void 0);
94
94
  }
95
- var D = E({
95
+ var A = k({
96
96
  name: "chevron-down",
97
97
  size: 24,
98
98
  node: [["path", {
99
99
  d: "m6 9 6 6 6-6",
100
100
  key: "qrunsl"
101
101
  }]]
102
- }), O = E({
102
+ }), ee = k({
103
103
  name: "chevron-right",
104
104
  size: 24,
105
105
  node: [["path", {
106
106
  d: "m9 18 6-6-6-6",
107
107
  key: "mthhwq"
108
108
  }]]
109
- }), k = E({
109
+ }), j = k({
110
110
  name: "file",
111
111
  size: 24,
112
112
  node: [["path", {
@@ -116,92 +116,148 @@ var D = E({
116
116
  d: "M14 2v5a1 1 0 0 0 1 1h5",
117
117
  key: "wfsgrz"
118
118
  }]]
119
- }), re = E({
119
+ }), te = k({
120
120
  name: "folder",
121
121
  size: 24,
122
122
  node: [["path", {
123
123
  d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
124
124
  key: "1kt360"
125
125
  }]]
126
- }), ie = 160, ae = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
127
- function oe(e) {
126
+ }), ne = 160, re = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
127
+ function ie(e) {
128
128
  let t = (e.split("\n", 1)[0] ?? "").trim();
129
- return t.length > ie ? `${t.slice(0, ie)}…` : t;
129
+ return t.length > ne ? `${t.slice(0, ne)}…` : t;
130
130
  }
131
- function se(e) {
131
+ function ae(e) {
132
132
  if (e.startsWith("denied by the user")) return { kind: "denied" };
133
- let t = ae.exec(e);
133
+ let t = re.exec(e);
134
134
  return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
135
135
  kind: "error",
136
- message: oe(e)
136
+ message: ie(e)
137
137
  } : {
138
138
  kind: "error",
139
- message: oe(t[2] ?? "")
139
+ message: ie(t[2] ?? "")
140
140
  };
141
141
  }
142
142
  //#endregion
143
+ //#region web/src/durations.ts
144
+ function M(e, t) {
145
+ if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
146
+ if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
147
+ let n = Math.round(t / 1e3);
148
+ return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : n < 3600 ? e("kvcoder.ui.minutesSeconds", {
149
+ minutes: Math.floor(n / 60),
150
+ seconds: n % 60
151
+ }) : oe(e, n);
152
+ }
153
+ function oe(e, t) {
154
+ let n = Math.floor(t / 60);
155
+ return e("kvcoder.ui.hoursMinutes", {
156
+ hours: Math.floor(n / 60),
157
+ minutes: n % 60
158
+ });
159
+ }
160
+ //#endregion
143
161
  //#region web/src/kvman.ts
144
- function A() {
162
+ function N() {
145
163
  let e = u("kvman");
146
164
  if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
147
165
  return e;
148
166
  }
149
- function j(e) {
167
+ function P(e) {
150
168
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
151
169
  }
152
170
  //#endregion
153
171
  //#region web/src/call-results.ts
154
- function ce(e) {
155
- let { replacements: t, firstChangedLine: n } = j(e);
172
+ function se(e) {
173
+ let { replacements: t, firstChangedLine: n } = P(e);
156
174
  return typeof t == "number" && typeof n == "number" ? {
157
175
  replacements: t,
158
176
  firstChangedLine: n
159
177
  } : void 0;
160
178
  }
161
- function le(e) {
162
- let { fromLine: t, content: n } = j(e);
179
+ function ce(e) {
180
+ let { fromLine: t, content: n } = P(e);
163
181
  return typeof t == "number" && typeof n == "string" ? {
164
182
  fromLine: t,
165
183
  content: n
166
184
  } : void 0;
167
185
  }
186
+ function le(e) {
187
+ let { path: t, error: n, notRead: r, unchanged: i } = P(e);
188
+ if (typeof t != "string") return [];
189
+ let a = ce(e);
190
+ if (a !== void 0) return [{
191
+ path: t,
192
+ read: a
193
+ }];
194
+ let { message: o } = P(n);
195
+ return typeof o == "string" ? [{
196
+ path: t,
197
+ error: o
198
+ }] : r === !0 ? [{
199
+ path: t,
200
+ state: "notRead"
201
+ }] : i === !0 ? [{
202
+ path: t,
203
+ state: "unchanged"
204
+ }] : [];
205
+ }
168
206
  function ue(e) {
169
- let { name: t, kind: n, bytes: r } = j(e);
207
+ let t = P(e).files;
208
+ return Array.isArray(t) ? t.flatMap(le) : void 0;
209
+ }
210
+ function de(e) {
211
+ let { name: t, kind: n, bytes: r } = P(e);
170
212
  return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
171
213
  name: t,
172
214
  kind: n,
173
215
  bytes: r
174
216
  }] : [];
175
217
  }
176
- function de(e) {
177
- let t = j(e).entries;
178
- return Array.isArray(t) ? t.flatMap(ue) : void 0;
179
- }
180
218
  function fe(e) {
181
- let { path: t, matches: n } = j(e);
182
- return typeof t != "string" || !Array.isArray(n) ? [] : [{
219
+ let t = P(e).entries;
220
+ return Array.isArray(t) ? t.flatMap(de) : void 0;
221
+ }
222
+ function pe(e) {
223
+ let t = P(e).paths;
224
+ return Array.isArray(t) ? t.filter((e) => typeof e == "string") : void 0;
225
+ }
226
+ function me(e) {
227
+ let { path: t, matches: n, count: r } = P(e);
228
+ if (typeof t != "string") return [];
229
+ if (typeof r == "number") return [{
183
230
  path: t,
184
- matches: n.flatMap((e) => {
185
- let { line: t, text: n } = j(e);
186
- return typeof t == "number" && typeof n == "string" ? [{
187
- line: t,
188
- text: n
189
- }] : [];
190
- })
231
+ matches: [],
232
+ count: r
233
+ }];
234
+ if (!Array.isArray(n)) return [];
235
+ let i = n.flatMap((e) => {
236
+ let { line: t, text: n, context: r } = P(e);
237
+ return typeof t == "number" && typeof n == "string" ? [{
238
+ line: t,
239
+ text: n,
240
+ context: r === !0
241
+ }] : [];
242
+ });
243
+ return [{
244
+ path: t,
245
+ matches: i,
246
+ count: i.filter((e) => !e.context).length
191
247
  }];
192
248
  }
193
- var pe = [
249
+ var he = [
194
250
  "running",
195
251
  "succeeded",
196
252
  "failed",
197
253
  "cancelled",
198
254
  "interrupted"
199
255
  ];
200
- function M(e, t) {
201
- return pe.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
256
+ function F(e, t) {
257
+ return he.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
202
258
  }
203
- function N(e) {
204
- let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = j(e);
259
+ function I(e) {
260
+ let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = P(e);
205
261
  if (typeof n != "string" || typeof r != "string") return;
206
262
  let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
207
263
  return {
@@ -214,36 +270,36 @@ function N(e) {
214
270
  ...c === void 0 ? {} : { problem: c }
215
271
  };
216
272
  }
217
- function me(e) {
218
- let t = j(e).files;
219
- return Array.isArray(t) ? t.flatMap(fe) : void 0;
273
+ function L(e) {
274
+ let t = P(e).files;
275
+ return Array.isArray(t) ? t.flatMap(me) : void 0;
220
276
  }
221
277
  //#endregion
222
278
  //#region web/src/edit-diff.ts
223
- var P = 3;
224
- function F(e) {
279
+ var R = 3;
280
+ function z(e) {
225
281
  if (e === "") return [];
226
282
  let t = e.split("\n");
227
283
  return e.endsWith("\n") ? t.slice(0, -1) : t;
228
284
  }
229
- function I(e, t) {
285
+ function ge(e, t) {
230
286
  let n = 0;
231
287
  for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
232
288
  return n;
233
289
  }
234
- function L(e, t) {
235
- let n = F(e), r = F(t), i = I(n, r), a = I(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
290
+ function _e(e, t) {
291
+ let n = z(e), r = z(t), i = ge(n, r), a = ge(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
236
292
  kind: e,
237
293
  text: t
238
294
  }));
239
295
  return [
240
- ...o("context", n.slice(Math.max(i - P, 0), i)),
296
+ ...o("context", n.slice(Math.max(i - R, 0), i)),
241
297
  ...o("removed", n.slice(i, n.length - a)),
242
298
  ...o("added", r.slice(i, r.length - a)),
243
- ...o("context", n.slice(n.length - a, n.length - a + P))
299
+ ...o("context", n.slice(n.length - a, n.length - a + R))
244
300
  ];
245
301
  }
246
- function he(e) {
302
+ function ve(e) {
247
303
  return {
248
304
  added: e.filter((e) => e.kind === "added").length,
249
305
  removed: e.filter((e) => e.kind === "removed").length
@@ -251,23 +307,23 @@ function he(e) {
251
307
  }
252
308
  //#endregion
253
309
  //#region web/src/mcp-steps.ts
254
- function R(e) {
310
+ function ye(e) {
255
311
  let t = e.steps;
256
312
  return Array.isArray(t) ? t.map((e, t) => {
257
- let { tool: n, arguments: r } = j(e), i = `${t + 1}.`;
313
+ let { tool: n, arguments: r } = P(e), i = `${t + 1}.`;
258
314
  return typeof n != "string" || n.trim() === "" ? {
259
315
  label: i,
260
- arguments: j(r)
316
+ arguments: P(r)
261
317
  } : {
262
318
  label: `${i} ${n}`,
263
319
  tool: n,
264
- arguments: j(r)
320
+ arguments: P(r)
265
321
  };
266
322
  }) : [];
267
323
  }
268
324
  //#endregion
269
325
  //#region web/src/call-summary.ts
270
- function ge(e) {
326
+ function be(e) {
271
327
  if (e !== void 0 && /^\s*[[{]/.test(e)) try {
272
328
  return JSON.parse(e);
273
329
  } catch (e) {
@@ -275,129 +331,142 @@ function ge(e) {
275
331
  throw e;
276
332
  }
277
333
  }
278
- var z = 1024;
279
- function B(e, t) {
280
- return t < z ? e("kvcoder.ui.call.bytes", { count: t }) : t < z * z ? e("kvcoder.ui.call.kilobytes", { count: (t / z).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (z * z)).toFixed(1) });
334
+ var B = 1024;
335
+ function xe(e, t) {
336
+ return t < B ? e("kvcoder.ui.call.bytes", { count: t }) : t < B * B ? e("kvcoder.ui.call.kilobytes", { count: (t / B).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (B * B)).toFixed(1) });
281
337
  }
282
338
  var V = (e) => typeof e == "string" && e !== "" ? e : void 0;
283
- function _e(e) {
339
+ function Se(e) {
284
340
  let t = e.edits;
285
341
  return Array.isArray(t) ? t.flatMap((e) => {
286
- let { oldText: t, newText: n } = j(e);
342
+ let { oldText: t, newText: n } = P(e);
287
343
  return typeof t == "string" && typeof n == "string" ? [{
288
344
  oldText: t,
289
345
  newText: n
290
346
  }] : [];
291
347
  }) : [];
292
348
  }
293
- function ve(e) {
294
- let t = _e(e).map((e) => he(L(e.oldText, e.newText)));
349
+ function Ce(e) {
350
+ let t = Se(e).map((e) => ve(_e(e.oldText, e.newText)));
295
351
  return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
296
352
  }
297
- function ye(e, t) {
298
- if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: B(e, t.bytes) });
353
+ function we(e, t) {
354
+ if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: xe(e, t.bytes) });
299
355
  }
300
- function be(e, t) {
356
+ function Te(e, t) {
301
357
  let { fromLine: n, totalLines: r, content: i } = t;
302
358
  if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
303
- let a = F(i).length;
359
+ let a = z(i).length;
304
360
  return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
305
361
  from: n,
306
362
  to: n + a - 1,
307
363
  total: r
308
364
  });
309
365
  }
310
- function xe(e, t) {
366
+ function Ee(e, t) {
311
367
  let n = t.entries;
312
368
  if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
313
369
  }
314
- function Se(e, t) {
315
- let n = t.files;
316
- if (!Array.isArray(n)) return;
317
- let r = n.reduce((e, t) => {
318
- let n = j(t).matches;
319
- return e + (Array.isArray(n) ? n.length : 0);
320
- }, 0);
370
+ function De(e, t) {
371
+ let n = t.paths;
372
+ if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.filesFirst" : "kvcoder.ui.call.files", { count: n.length });
373
+ }
374
+ function Oe(e, t) {
375
+ let n = L(t);
376
+ if (n === void 0) return;
377
+ let r = n.reduce((e, t) => e + t.count, 0);
321
378
  return e(t.truncated === !0 ? "kvcoder.ui.call.matchesFirst" : "kvcoder.ui.call.matches", {
322
379
  matches: r,
323
380
  files: n.length
324
381
  });
325
382
  }
326
- var Ce = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
327
- function H(e, t, n) {
383
+ var H = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
384
+ function U(e, t, n) {
328
385
  return {
329
386
  ...e === void 0 ? {} : { words: e },
330
387
  ...t === void 0 ? {} : { subject: t },
331
388
  ...n === void 0 ? {} : { outcome: n }
332
389
  };
333
390
  }
334
- function we(e, t, n, r) {
335
- let i = r === void 0 ? void 0 : j(r), a = V(n.path);
336
- if (t === "edit") return H(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : ve(n));
337
- if (t === "write") return H(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : ye(e, i));
338
- if (t === "read") return H(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : be(e, i));
339
- if (t === "list") return H(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : xe(e, i));
340
- if (t === "search") return H(e("kvcoder.ui.call.search"), V(n.pattern), i === void 0 ? void 0 : Se(e, i));
391
+ function ke(e) {
392
+ let t = e.files;
393
+ if (!Array.isArray(t)) return;
394
+ let n = t.flatMap((e) => {
395
+ let { path: t } = P(e);
396
+ return typeof t == "string" ? [t] : [];
397
+ });
398
+ return n.length === 0 ? void 0 : n.join(", ");
399
+ }
400
+ function Ae(e, t, n, r) {
401
+ let i = r === void 0 ? void 0 : P(r), a = V(n.path);
402
+ if (t === "edit") return U(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Ce(n));
403
+ if (t === "write") return U(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : we(e, i));
404
+ if (t === "read") return U(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Te(e, i));
405
+ if (t === "read-files") return U(e("kvcoder.ui.call.read"), ke(n), i === void 0 ? void 0 : H(e, "kvcoder.ui.call.files", i.files));
406
+ if (t === "list") return U(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Ee(e, i));
407
+ if (t === "find") return U(e("kvcoder.ui.call.find"), V(n.pattern), i === void 0 ? void 0 : De(e, i));
408
+ if (t === "search") return U(e("kvcoder.ui.call.search"), V(n.pattern), i === void 0 ? void 0 : Oe(e, i));
341
409
  }
342
- function Te(e, t, n, r) {
410
+ function je(e, t, n, r) {
343
411
  let i = V(n.server), a = [i, V(n.tool)].filter((e) => e !== void 0).join(" · ");
344
- if (t === "call") return H(void 0, a === "" ? void 0 : a);
345
- if (t === "run") return H(void 0, [i, R(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
346
- if (t === "tools") return H(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, Ce(e, "kvcoder.ui.call.toolCount", j(r).tools));
412
+ if (t === "call") return U(void 0, a === "" ? void 0 : a);
413
+ if (t === "run") return U(void 0, [i, ye(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
414
+ if (t === "tools") return U(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, H(e, "kvcoder.ui.call.toolCount", P(r).tools));
347
415
  }
348
- function Ee(e, t, n, r) {
349
- if (t === "list") return H(e("kvcoder.ui.call.backgroundRuns"), void 0, Ce(e, "kvcoder.ui.call.runCount", r));
416
+ function Me(e, t, n, r) {
417
+ if (t === "list") return U(e("kvcoder.ui.call.backgroundRuns"), void 0, H(e, "kvcoder.ui.call.runCount", r));
350
418
  if (t === "output" || t === "wait") {
351
- let i = N(r);
352
- return H(e(`kvcoder.ui.call.${t}`), V(n.id), i === void 0 ? void 0 : M(e, i.status));
419
+ let i = I(r);
420
+ return U(e(`kvcoder.ui.call.${t}`), V(n.id), i === void 0 ? void 0 : F(e, i.status));
353
421
  }
354
- if (t === "stop") return H(e("kvcoder.ui.call.stop"), V(n.id));
422
+ if (t === "stop") return U(e("kvcoder.ui.call.stop"), V(n.id));
355
423
  }
356
- function De(e, t, n, r) {
357
- let i = V(j(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => V(j(e).id) === void 0 ? [] : [String(j(e).id)]).join(", ") : void 0;
358
- return t === "set" ? H(e("kvcoder.ui.call.mapSet"), V(n.goal), i) : t === "detail" ? H(e("kvcoder.ui.call.mapDetail"), V(n.id), i) : t === "update" ? H(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? H(e("kvcoder.ui.call.mapNote"), V(n.text)) : t === "get" ? H(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
424
+ function Ne(e, t, n, r) {
425
+ let i = V(P(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => V(P(e).id) === void 0 ? [] : [String(P(e).id)]).join(", ") : void 0;
426
+ return t === "set" ? U(e("kvcoder.ui.call.mapSet"), V(n.goal), i) : t === "detail" ? U(e("kvcoder.ui.call.mapDetail"), V(n.id), i) : t === "update" ? U(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? U(e("kvcoder.ui.call.mapNote"), V(n.text)) : t === "get" ? U(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
359
427
  }
360
- function Oe(e, t, n) {
428
+ function Pe(e, t, n) {
361
429
  let { connector: r, command: i } = t, a = t.fields ?? {};
362
430
  if (r !== void 0 && i !== void 0) {
363
431
  if (t.line !== void 0) return { subject: `$ ${t.line}` };
364
- if (i === "help") return H(e("kvcoder.ui.call.help"), [r, V(a.command)].filter((e) => e !== void 0).join(" "));
365
- if (r === "fs") return we(e, i, a, n);
366
- if (r === "mcp") return Te(e, i, a, n);
367
- if (r === "background") return Ee(e, i, a, n);
368
- if (r === "execution-map") return De(e, i, a, n);
369
- if (r === "delegate" && i === "run") return H(e("kvcoder.ui.call.delegate"), [V(a.worker), V(a.title)].filter((e) => e !== void 0).join(" · "));
370
- if (r === "artifact" && i === "get") return H(e("kvcoder.ui.call.readArtifact"), V(a.id));
371
- if (r === "artifact" && (i === "write" || i === "edit")) return H(e(`kvcoder.ui.call.${i}Artifact`), V(a.id));
432
+ if (i === "help") return U(e("kvcoder.ui.call.help"), [r, V(a.command)].filter((e) => e !== void 0).join(" "));
433
+ if (r === "fs") return Ae(e, i, a, n);
434
+ if (r === "mcp") return je(e, i, a, n);
435
+ if (r === "background") return Me(e, i, a, n);
436
+ if (r === "execution-map") return Ne(e, i, a, n);
437
+ if (r === "delegate" && i === "run") return U(e("kvcoder.ui.call.delegate"), [V(a.worker), V(a.title)].filter((e) => e !== void 0).join(" · "));
438
+ if (r === "artifact" && i === "get") return U(e("kvcoder.ui.call.readArtifact"), V(a.id));
439
+ if (r === "web" && i === "fetch") return U(e("kvcoder.ui.call.fetch"), V(a.url));
440
+ if (r === "artifact" && (i === "write" || i === "edit")) return U(e(`kvcoder.ui.call.${i}Artifact`), V(a.id));
372
441
  }
373
442
  }
374
443
  //#endregion
375
444
  //#region web/src/call-view.ts
376
- var ke = 200, Ae = [
445
+ var Fe = 200, Ie = [
377
446
  "text",
378
447
  "choice",
379
448
  "confirm"
380
449
  ];
381
- function je(e) {
450
+ function Le(e) {
382
451
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
383
452
  }
384
- var U = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
385
- function Me(e, t) {
386
- let n = U(t.args);
387
- return U(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
453
+ var W = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
454
+ function Re(e, t) {
455
+ let n = W(t.args);
456
+ return W(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
388
457
  }
389
- function Ne(e) {
390
- let t = U(e.title) ?? U(e.description), n = U(e.command);
458
+ function ze(e) {
459
+ let t = W(e.title) ?? W(e.description), n = W(e.command);
391
460
  return {
392
461
  ...t === void 0 ? {} : { description: t },
393
462
  ...n === void 0 ? {} : { line: n },
394
463
  ...e.mode === "async" ? { background: !0 } : {}
395
464
  };
396
465
  }
397
- function Pe(e) {
398
- let t = U(e.connector), n = U(e.command);
399
- if (t === void 0) return Ne(e);
400
- let r = U(e.description), i = je(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? Ae.find((e) => e === n) : void 0;
466
+ function Be(e) {
467
+ let t = W(e.connector), n = W(e.command);
468
+ if (t === void 0) return ze(e);
469
+ let r = W(e.description), i = Le(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? Ie.find((e) => e === n) : void 0;
401
470
  return {
402
471
  ...r === void 0 ? {} : { description: r },
403
472
  connector: t,
@@ -405,7 +474,7 @@ function Pe(e) {
405
474
  command: n,
406
475
  label: `${t} · ${n}`
407
476
  },
408
- ...n === "exec" ? { line: Me(t, i) } : {},
477
+ ...n === "exec" ? { line: Re(t, i) } : {},
409
478
  fields: i,
410
479
  ...i.risky === !0 ? { risky: !0 } : {},
411
480
  ...i.background === !0 ? { background: !0 } : {},
@@ -415,60 +484,62 @@ function Pe(e) {
415
484
  } }
416
485
  };
417
486
  }
418
- var Fe = [
487
+ var Ve = [
419
488
  "edit",
420
489
  "write",
421
490
  "read",
491
+ "read-files",
422
492
  "list",
493
+ "find",
423
494
  "search"
424
495
  ];
425
- function W(e) {
426
- return e.line === void 0 ? e.connector === "fs" ? Fe.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "mcp" && e.command === "run" ? "mcp-run" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
496
+ function G(e) {
497
+ return e.line === void 0 ? e.connector === "fs" ? Ve.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "mcp" && e.command === "run" ? "mcp-run" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
427
498
  }
428
- function Ie(e) {
499
+ function K(e) {
429
500
  let t = e.replace(/\s+/g, " ");
430
- return t.length > ke ? `${t.slice(0, ke)}…` : t;
501
+ return t.length > Fe ? `${t.slice(0, Fe)}…` : t;
431
502
  }
432
503
  //#endregion
433
504
  //#region web/src/field-rows.ts
434
- var Le = "—", Re = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", G = (e) => e === null ? Le : String(e);
435
- function ze(e) {
505
+ var He = "—", Ue = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", We = (e) => e === null ? He : String(e);
506
+ function Ge(e) {
436
507
  return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
437
508
  }
438
- function Be(e) {
439
- let t = ze(e);
509
+ function Ke(e) {
510
+ let t = Ge(e);
440
511
  if (t === void 0) return;
441
512
  let n = {};
442
513
  for (let [e, r] of Object.entries(t)) {
443
- if (!Re(r)) return;
514
+ if (!Ue(r)) return;
444
515
  n[e] = r;
445
516
  }
446
517
  return n;
447
518
  }
448
- function Ve(e) {
519
+ function qe(e) {
449
520
  let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
450
521
  return {
451
522
  kind: "table",
452
523
  columns: t,
453
- rows: e.map((e) => t.map((t) => t in e ? G(e[t] ?? null) : ""))
524
+ rows: e.map((e) => t.map((t) => t in e ? We(e[t] ?? null) : ""))
454
525
  };
455
526
  }
456
- function He(e) {
527
+ function Je(e) {
457
528
  if (e.length === 0) return { kind: "empty" };
458
- if (e.every(Re)) return {
529
+ if (e.every(Ue)) return {
459
530
  kind: "items",
460
- items: e.map(G)
531
+ items: e.map(We)
461
532
  };
462
- let t = e.map(Be).filter((e) => e !== void 0);
463
- return t.length === e.length ? Ve(t) : {
533
+ let t = e.map(Ke).filter((e) => e !== void 0);
534
+ return t.length === e.length ? qe(t) : {
464
535
  kind: "rows",
465
536
  rows: e.map((e, t) => ({
466
537
  name: String(t + 1),
467
- value: K(e)
538
+ value: q(e)
468
539
  }))
469
540
  };
470
541
  }
471
- function K(e) {
542
+ function q(e) {
472
543
  if (typeof e == "string") return e.includes("\n") ? {
473
544
  kind: "block",
474
545
  text: e
@@ -480,27 +551,27 @@ function K(e) {
480
551
  kind: "text",
481
552
  text: String(e)
482
553
  };
483
- if (Array.isArray(e)) return He(e);
484
- let t = ze(e);
554
+ if (Array.isArray(e)) return Je(e);
555
+ let t = Ge(e);
485
556
  return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
486
557
  kind: "rows",
487
- rows: Ue(t)
558
+ rows: Ye(t)
488
559
  };
489
560
  }
490
- function Ue(e) {
561
+ function Ye(e) {
491
562
  return Object.entries(e).map(([e, t]) => ({
492
563
  name: e,
493
- value: K(t)
564
+ value: q(t)
494
565
  }));
495
566
  }
496
- function q(e, t) {
567
+ function J(e, t) {
497
568
  return t || e.length <= 12 ? e : e.slice(0, 12);
498
569
  }
499
- var We = (e) => F(e).map((e) => ({ text: e })), Ge = (e, t) => F(e).map((e, n) => ({
570
+ var Xe = (e) => z(e).map((e) => ({ text: e })), Y = (e, t) => z(e).map((e, n) => ({
500
571
  text: e,
501
572
  number: t + n
502
573
  }));
503
- function Ke(e, t) {
574
+ function Ze(e, t) {
504
575
  return t || e.length <= 17 ? e : [
505
576
  ...e.slice(0, 12),
506
577
  "⋯",
@@ -509,7 +580,7 @@ function Ke(e, t) {
509
580
  }
510
581
  //#endregion
511
582
  //#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
512
- var qe = ["aria-expanded"], J = /* @__PURE__ */ c({
583
+ var Qe = ["aria-expanded"], X = /* @__PURE__ */ c({
513
584
  __name: "FoldButton",
514
585
  props: {
515
586
  count: {},
@@ -518,7 +589,7 @@ var qe = ["aria-expanded"], J = /* @__PURE__ */ c({
518
589
  },
519
590
  emits: ["toggle"],
520
591
  setup(e, { emit: t }) {
521
- let n = e, a = t, o = A();
592
+ let n = e, a = t, o = N();
522
593
  return (e, t) => n.count > (n.over ?? v(12)) ? (f(), i("button", {
523
594
  key: 0,
524
595
  type: "button",
@@ -526,13 +597,13 @@ var qe = ["aria-expanded"], J = /* @__PURE__ */ c({
526
597
  "aria-expanded": n.open,
527
598
  "data-test": "show-all",
528
599
  onClick: t[0] ||= (e) => a("toggle")
529
- }, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, qe)) : r("v-if", !0);
600
+ }, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, Qe)) : r("v-if", !0);
530
601
  }
531
- }), Je = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, Ye = /[.,;:!?]+$/;
532
- function Xe(e) {
602
+ }), $e = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, et = /[.,;:!?]+$/;
603
+ function tt(e) {
533
604
  let t = [], n = 0;
534
- for (let r of e.matchAll(Je)) {
535
- let i = r[0].replace(Ye, "");
605
+ for (let r of e.matchAll($e)) {
606
+ let i = r[0].replace(et, "");
536
607
  r.index > n && t.push({
537
608
  kind: "text",
538
609
  text: e.slice(n, r.index)
@@ -548,134 +619,134 @@ function Xe(e) {
548
619
  }
549
620
  //#endregion
550
621
  //#region web/src/LinkedText.vue?vue&type=script&setup=true&lang.ts
551
- var Ze = ["href"], Y = /* @__PURE__ */ c({
622
+ var nt = ["href"], Z = /* @__PURE__ */ c({
552
623
  __name: "LinkedText",
553
624
  props: { text: {} },
554
625
  setup(n) {
555
- let r = n, a = t(() => Xe(r.text));
626
+ let r = n, a = t(() => tt(r.text));
556
627
  return (t, n) => (f(!0), i(e, null, m(a.value, (t, n) => (f(), i(e, { key: n }, [t.kind === "link" ? (f(), i("a", {
557
628
  key: 0,
558
629
  href: t.href,
559
630
  target: "_blank",
560
631
  rel: "noopener noreferrer",
561
632
  class: "kvc-link"
562
- }, _(t.href), 9, Ze)) : (f(), i(e, { key: 1 }, [o(_(t.text), 1)], 64))], 64))), 128));
633
+ }, _(t.href), 9, nt)) : (f(), i(e, { key: 1 }, [o(_(t.text), 1)], 64))], 64))), 128));
563
634
  }
564
- }), Qe = { class: "kvc-code-lines" }, $e = ["dir", "data-kind"], et = {
635
+ }), rt = { class: "kvc-code-lines" }, it = ["dir", "data-kind"], at = {
565
636
  key: 0,
566
637
  class: "kvc-line-number",
567
638
  "data-test": "call-line-number"
568
- }, tt = {
639
+ }, ot = {
569
640
  key: 1,
570
641
  class: "kvc-line-mark",
571
642
  "aria-hidden": "true"
572
- }, nt = {
643
+ }, st = {
573
644
  class: "kvc-line-text",
574
645
  dir: "auto",
575
646
  "data-test": "call-line-text"
576
- }, X = /* @__PURE__ */ c({
647
+ }, Q = /* @__PURE__ */ c({
577
648
  __name: "FoldedLines",
578
649
  props: { lines: {} },
579
650
  setup(n) {
580
- let o = n, c = p(!1), l = t(() => q(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), h = {
651
+ let o = n, c = p(!1), l = t(() => J(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), h = {
581
652
  context: " ",
582
653
  removed: "−",
583
654
  added: "+"
584
655
  };
585
- return (t, n) => (f(), i("div", Qe, [(f(!0), i(e, null, m(l.value, (e, t) => (f(), i("div", {
656
+ return (t, n) => (f(), i("div", rt, [(f(!0), i(e, null, m(l.value, (e, t) => (f(), i("div", {
586
657
  key: t,
587
658
  class: "kvc-code-line",
588
659
  dir: u.value || d.value ? "ltr" : void 0,
589
660
  "data-kind": e.kind,
590
661
  "data-test": "call-line-row"
591
662
  }, [
592
- u.value ? (f(), i("span", et, _(e.number), 1)) : r("v-if", !0),
593
- d.value ? (f(), i("span", tt, _(h[e.kind ?? "context"]), 1)) : r("v-if", !0),
594
- a("span", nt, [s(Y, { text: e.text }, null, 8, ["text"])])
595
- ], 8, $e))), 128)), s(J, {
663
+ u.value ? (f(), i("span", at, _(e.number), 1)) : r("v-if", !0),
664
+ d.value ? (f(), i("span", ot, _(h[e.kind ?? "context"]), 1)) : r("v-if", !0),
665
+ a("span", st, [s(Z, { text: e.text }, null, 8, ["text"])])
666
+ ], 8, it))), 128)), s(X, {
596
667
  count: o.lines.length,
597
668
  open: c.value,
598
669
  onToggle: n[0] ||= (e) => c.value = !c.value
599
670
  }, null, 8, ["count", "open"])]));
600
671
  }
601
- }), rt = {
672
+ }), ct = {
602
673
  key: 0,
603
674
  dir: "auto",
604
675
  "data-test": "field-text"
605
- }, it = {
676
+ }, lt = {
606
677
  key: 1,
607
678
  class: "kvc-muted",
608
679
  "data-test": "field-empty"
609
- }, at = {
680
+ }, ut = {
610
681
  key: 3,
611
682
  class: "kvc-field-table"
612
- }, ot = { "data-test": "field-table" }, st = {
683
+ }, dt = { "data-test": "field-table" }, ft = {
613
684
  key: 4,
614
685
  class: "kvc-field-items",
615
686
  "data-test": "field-items"
616
- }, ct = {
687
+ }, pt = {
617
688
  key: 5,
618
689
  class: "kvc-fields",
619
690
  "data-test": "call-fields"
620
- }, lt = ["data-name"], ut = {
691
+ }, mt = ["data-name"], ht = {
621
692
  class: "kvc-muted",
622
693
  dir: "ltr"
623
- }, dt = { "data-test": "field-value" }, Z = /* @__PURE__ */ c({
694
+ }, gt = { "data-test": "field-value" }, $ = /* @__PURE__ */ c({
624
695
  __name: "FieldsView",
625
696
  props: { value: {} },
626
697
  setup(r) {
627
- let o = r, c = p(!1), l = t(() => o.value.kind === "table" ? q(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? q(o.value.items, c.value) : []);
698
+ let o = r, c = p(!1), l = t(() => o.value.kind === "table" ? J(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? J(o.value.items, c.value) : []);
628
699
  return (t, r) => {
629
700
  let d = h("FieldsView", !0);
630
- return o.value.kind === "text" ? (f(), i("span", rt, [s(Y, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (f(), i("span", it, "—")) : o.value.kind === "block" ? (f(), n(X, {
701
+ return o.value.kind === "text" ? (f(), i("span", ct, [s(Z, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (f(), i("span", lt, "—")) : o.value.kind === "block" ? (f(), n(Q, {
631
702
  key: 2,
632
703
  class: "kvc-field-block",
633
- lines: v(We)(o.value.text),
704
+ lines: v(Xe)(o.value.text),
634
705
  "data-test": "field-block"
635
- }, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div", at, [a("table", ot, [a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(o.value.columns, (e) => (f(), i("th", {
706
+ }, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div", ut, [a("table", dt, [a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(o.value.columns, (e) => (f(), i("th", {
636
707
  key: e,
637
708
  scope: "col",
638
709
  dir: "ltr"
639
710
  }, _(e), 1))), 128))])]), a("tbody", null, [(f(!0), i(e, null, m(l.value, (t, n) => (f(), i("tr", { key: n }, [(f(!0), i(e, null, m(t, (e, t) => (f(), i("td", {
640
711
  key: t,
641
712
  dir: "auto"
642
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(J, {
713
+ }, [s(Z, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(X, {
643
714
  count: o.value.rows.length,
644
715
  open: c.value,
645
716
  onToggle: r[0] ||= (e) => c.value = !c.value
646
- }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div", st, [(f(!0), i(e, null, m(u.value, (e, t) => (f(), i("div", {
717
+ }, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div", ft, [(f(!0), i(e, null, m(u.value, (e, t) => (f(), i("div", {
647
718
  key: t,
648
719
  dir: "auto"
649
- }, [s(Y, { text: e }, null, 8, ["text"])]))), 128)), s(J, {
720
+ }, [s(Z, { text: e }, null, 8, ["text"])]))), 128)), s(X, {
650
721
  count: o.value.items.length,
651
722
  open: c.value,
652
723
  onToggle: r[1] ||= (e) => c.value = !c.value
653
- }, null, 8, ["count", "open"])])) : (f(), i("dl", ct, [(f(!0), i(e, null, m(o.value.rows, (e) => (f(), i("div", {
724
+ }, null, 8, ["count", "open"])])) : (f(), i("dl", pt, [(f(!0), i(e, null, m(o.value.rows, (e) => (f(), i("div", {
654
725
  key: e.name,
655
726
  class: "kvc-field-row",
656
727
  "data-name": e.name,
657
728
  "data-test": "field-row"
658
- }, [a("dt", ut, _(e.name), 1), a("dd", dt, [s(d, { value: e.value }, null, 8, ["value"])])], 8, lt))), 128))]));
729
+ }, [a("dt", ht, _(e.name), 1), a("dd", gt, [s(d, { value: e.value }, null, 8, ["value"])])], 8, mt))), 128))]));
659
730
  };
660
731
  }
661
- }), ft = ["aria-label"], pt = ["aria-label"], mt = {
732
+ }), _t = ["aria-label"], vt = ["aria-label"], yt = {
662
733
  class: "kvc-mono",
663
734
  dir: "ltr",
664
735
  "data-test": "call-step-tool"
665
- }, ht = { class: "kvc-step-arguments" }, gt = ["aria-label"], _t = /* @__PURE__ */ c({
736
+ }, bt = { class: "kvc-step-arguments" }, xt = ["aria-label"], St = /* @__PURE__ */ c({
666
737
  __name: "CallRequest",
667
738
  props: { view: {} },
668
739
  setup(o) {
669
- let c = o, l = A(), u = t(() => W(c.view)), d = t(() => c.view.fields ?? {}), p = t(() => _e(d.value).map((e) => L(e.oldText, e.newText))), h = t(() => typeof d.value.content == "string" ? d.value.content : ""), g = t(() => typeof d.value.task == "string" ? d.value.task : ""), y = t(() => u.value === "mcp-run" ? R(d.value) : []), b = t(() => u.value === "mcp-call" ? j(d.value.arguments) : u.value === "fields" ? d.value : {});
670
- return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(X, {
740
+ let c = o, l = N(), u = t(() => G(c.view)), d = t(() => c.view.fields ?? {}), p = t(() => Se(d.value).map((e) => _e(e.oldText, e.newText))), h = t(() => typeof d.value.content == "string" ? d.value.content : ""), g = t(() => typeof d.value.task == "string" ? d.value.task : ""), y = t(() => u.value === "mcp-run" ? ye(d.value) : []), b = t(() => u.value === "mcp-call" ? P(d.value.arguments) : u.value === "fields" ? d.value : {});
741
+ return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(Q, {
671
742
  key: t,
672
743
  class: "kvc-block",
673
744
  lines: e,
674
745
  "data-test": "call-diff"
675
- }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(X, {
746
+ }, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(Q, {
676
747
  key: 1,
677
748
  class: "kvc-block",
678
- lines: v(Ge)(h.value, 1),
749
+ lines: v(Y)(h.value, 1),
679
750
  "data-test": "call-content"
680
751
  }, null, 8, ["lines"])) : u.value === "line" ? (f(), i("pre", {
681
752
  key: 2,
@@ -683,7 +754,7 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
683
754
  dir: "ltr",
684
755
  "aria-label": v(l).t("kvcoder.ui.command"),
685
756
  "data-test": "call-payload"
686
- }, "$ " + _(c.view.line), 9, ft)) : y.value.length > 0 ? (f(), i("ol", {
757
+ }, "$ " + _(c.view.line), 9, _t)) : y.value.length > 0 ? (f(), i("ol", {
687
758
  key: 3,
688
759
  class: "kvc-block kvc-steps",
689
760
  "aria-label": v(l).t("kvcoder.ui.call.payload"),
@@ -691,10 +762,10 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
691
762
  }, [(f(!0), i(e, null, m(y.value, (e, t) => (f(), i("li", {
692
763
  key: t,
693
764
  "data-test": "call-step"
694
- }, [a("span", mt, _(e.label), 1), a("div", ht, [s(Z, { value: v(K)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, pt)) : u.value === "delegate" ? (f(), n(X, {
765
+ }, [a("span", yt, _(e.label), 1), a("div", bt, [s($, { value: v(q)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, vt)) : u.value === "delegate" ? (f(), n(Q, {
695
766
  key: 4,
696
767
  class: "kvc-block kvc-prose-lines",
697
- lines: v(We)(g.value),
768
+ lines: v(Xe)(g.value),
698
769
  "aria-label": v(l).t("kvcoder.ui.call.task"),
699
770
  "data-test": "call-task"
700
771
  }, null, 8, ["lines", "aria-label"])) : Object.keys(b.value).length > 0 ? (f(), i("div", {
@@ -702,19 +773,19 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
702
773
  class: "kvc-block",
703
774
  "aria-label": v(l).t("kvcoder.ui.call.payload"),
704
775
  "data-test": "call-payload-fields"
705
- }, [s(Z, { value: v(K)(b.value) }, null, 8, ["value"])], 8, gt)) : r("v-if", !0);
776
+ }, [s($, { value: v(q)(b.value) }, null, 8, ["value"])], 8, xt)) : r("v-if", !0);
706
777
  }
707
- }), vt = { class: "kvc-output-block" }, yt = ["aria-label"], Q = /* @__PURE__ */ c({
778
+ }), Ct = { class: "kvc-output-block" }, wt = ["aria-label"], Tt = /* @__PURE__ */ c({
708
779
  __name: "FoldedOutput",
709
780
  props: { output: {} },
710
781
  setup(e) {
711
- let n = e, r = A(), o = p(!1), c = t(() => n.output.split("\n")), l = t(() => Ke(c.value, o.value).join("\n"));
712
- return (e, t) => (f(), i("div", vt, [a("pre", {
782
+ let n = e, r = N(), o = p(!1), c = t(() => n.output.split("\n")), l = t(() => Ze(c.value, o.value).join("\n"));
783
+ return (e, t) => (f(), i("div", Ct, [a("pre", {
713
784
  class: "kvc-output",
714
785
  dir: "auto",
715
786
  "aria-label": v(r).t("kvcoder.ui.output"),
716
787
  "data-test": "call-output"
717
- }, [s(Y, { text: l.value }, null, 8, ["text"])], 8, yt), s(J, {
788
+ }, [s(Z, { text: l.value }, null, 8, ["text"])], 8, wt), s(X, {
718
789
  count: c.value.length,
719
790
  open: o.value,
720
791
  over: v(12) + v(5),
@@ -725,97 +796,103 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
725
796
  "over"
726
797
  ])]));
727
798
  }
728
- });
729
- //#endregion
730
- //#region web/src/durations.ts
731
- function $(e, t) {
732
- if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
733
- if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
734
- let n = Math.round(t / 1e3);
735
- return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.minutesSeconds", {
736
- minutes: Math.floor(n / 60),
737
- seconds: n % 60
738
- });
739
- }
740
- //#endregion
741
- //#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
742
- var bt = {
799
+ }), Et = {
743
800
  class: "kvc-block kvc-run-row",
744
801
  "data-test": "run-row"
745
- }, xt = {
802
+ }, Dt = {
746
803
  class: "kvc-run-call",
747
804
  dir: "auto",
748
805
  "data-test": "run-call"
749
- }, St = {
806
+ }, Ot = {
750
807
  class: "kvc-chip",
751
808
  "data-test": "run-status"
752
- }, Ct = {
809
+ }, kt = {
753
810
  key: 0,
754
811
  class: "kvc-muted",
755
812
  "data-test": "run-time"
756
- }, wt = ["aria-label"], Tt = ["aria-label"], Et = ["aria-label"], Dt = ["aria-label"], Ot = /* @__PURE__ */ c({
813
+ }, At = ["aria-label"], jt = ["aria-label"], Mt = ["aria-label"], Nt = ["aria-label"], Pt = /* @__PURE__ */ c({
757
814
  __name: "RunOutput",
758
815
  props: { run: {} },
759
816
  setup(c) {
760
- let l = c, u = A(), d = (e) => typeof e == "string" ? e : void 0, p = t(() => d(l.run.output)), m = t(() => d(l.run.problem)), h = t(() => ({
817
+ let l = c, u = N(), d = (e) => typeof e == "string" ? e : void 0, p = t(() => d(l.run.output)), m = t(() => d(l.run.problem)), h = t(() => ({
761
818
  type: "markdown",
762
819
  text: "kvcoder.markdown",
763
820
  params: { text: p.value ?? "" }
764
821
  }));
765
822
  return (t, c) => (f(), i(e, null, [
766
- a("div", bt, [
767
- a("span", xt, _(l.run.call), 1),
768
- a("span", St, [o(_(v(M)(v(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (f(), i(e, { key: 0 }, [o(" · " + _(v(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
769
- l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span", Ct, _(v($)(v(u).t, l.run.ranMs)), 1))
823
+ a("div", Et, [
824
+ a("span", Dt, _(l.run.call), 1),
825
+ a("span", Ot, [o(_(v(F)(v(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (f(), i(e, { key: 0 }, [o(" · " + _(v(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
826
+ l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span", kt, _(v(M)(v(u).t, l.run.ranMs)), 1))
770
827
  ]),
771
828
  m.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (f(), i("div", {
772
829
  key: 1,
773
830
  class: "kvc-block kvc-error",
774
831
  "aria-label": v(u).t("kvcoder.ui.call.error"),
775
832
  "data-test": "run-problem"
776
- }, [s(Z, { value: v(K)(l.run.problem) }, null, 8, ["value"])], 8, Tt)) : (f(), i("pre", {
833
+ }, [s($, { value: v(q)(l.run.problem) }, null, 8, ["value"])], 8, jt)) : (f(), i("pre", {
777
834
  key: 0,
778
835
  class: "kvc-block kvc-error",
779
836
  dir: "auto",
780
837
  "aria-label": v(u).t("kvcoder.ui.call.error"),
781
838
  "data-test": "run-problem"
782
- }, [s(Y, { text: m.value }, null, 8, ["text"])], 8, wt)),
839
+ }, [s(Z, { text: m.value }, null, 8, ["text"])], 8, At)),
783
840
  p.value === void 0 && l.run.output !== void 0 ? (f(), i("div", {
784
841
  key: 2,
785
842
  class: "kvc-block",
786
843
  "aria-label": v(u).t("kvcoder.ui.output"),
787
844
  "data-test": "call-result-fields"
788
- }, [s(Z, { value: v(K)(l.run.output) }, null, 8, ["value"])], 8, Et)) : l.run.answer && p.value ? (f(), i("div", {
845
+ }, [s($, { value: v(q)(l.run.output) }, null, 8, ["value"])], 8, Mt)) : l.run.answer && p.value ? (f(), i("div", {
789
846
  key: 3,
790
847
  class: "kvc-block",
791
848
  "aria-label": v(u).t("kvcoder.ui.call.answer"),
792
849
  "data-test": "call-answer"
793
- }, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8, Dt)) : p.value ? (f(), n(Q, {
850
+ }, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8, Nt)) : p.value ? (f(), n(Tt, {
794
851
  key: 4,
795
852
  output: p.value
796
853
  }, null, 8, ["output"])) : r("v-if", !0)
797
854
  ], 64));
798
855
  }
799
- }), kt = {
856
+ }), Ft = {
800
857
  key: 0,
801
858
  class: "kvc-muted kvc-call-parts",
802
859
  "data-test": "call-replacements"
803
- }, At = {
860
+ }, It = {
804
861
  key: 2,
805
862
  class: "kvc-block kvc-entries",
806
863
  "data-test": "call-entries"
807
- }, jt = ["data-kind"], Mt = {
864
+ }, Lt = ["data-kind"], Rt = {
808
865
  class: "kvc-mono",
809
866
  dir: "auto",
810
867
  "data-test": "call-entry-name"
811
- }, Nt = {
868
+ }, zt = {
812
869
  key: 0,
813
870
  class: "kvc-muted",
814
871
  "data-test": "call-entry-size"
815
- }, Pt = {
872
+ }, Bt = {
873
+ key: 3,
874
+ class: "kvc-block kvc-entries",
875
+ "data-test": "call-paths"
876
+ }, Vt = {
877
+ class: "kvc-mono",
878
+ dir: "auto"
879
+ }, Ht = {
880
+ class: "kvc-mono kvc-file-path",
881
+ "data-test": "call-file-path"
882
+ }, Ut = {
883
+ key: 1,
884
+ class: "kvc-muted kvc-call-parts",
885
+ "data-test": "call-file-count"
886
+ }, Wt = {
816
887
  class: "kvc-mono kvc-file-path",
888
+ dir: "auto",
817
889
  "data-test": "call-file-path"
818
- }, Ft = ["aria-label"], It = ["aria-label"], Lt = /* @__PURE__ */ c({
890
+ }, Gt = {
891
+ key: 1,
892
+ class: "kvc-muted kvc-call-parts",
893
+ dir: "auto",
894
+ "data-test": "call-read-file-note"
895
+ }, Kt = ["aria-label"], qt = ["aria-label"], Jt = /* @__PURE__ */ c({
819
896
  __name: "CallResult",
820
897
  props: {
821
898
  view: {},
@@ -823,78 +900,99 @@ var bt = {
823
900
  result: {}
824
901
  },
825
902
  setup(o) {
826
- let c = o, l = A(), u = t(() => W(c.view)), d = t(() => u.value === "edit" ? ce(c.result) : void 0), h = t(() => u.value === "read" ? le(c.result) : void 0), y = t(() => u.value === "list" ? de(c.result) : void 0), b = t(() => u.value === "search" ? me(c.result) : void 0), x = t(() => u.value === "run-output" ? N(c.result) : void 0), S = p(!1), C = t(() => q(y.value ?? [], S.value)), w = t(() => ({
903
+ let c = o, l = N(), u = t(() => G(c.view)), d = t(() => u.value === "edit" ? se(c.result) : void 0), h = t(() => u.value === "read" ? ce(c.result) : void 0), y = t(() => u.value === "read-files" ? ue(c.result) : void 0), b = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), x = t(() => u.value === "list" ? fe(c.result) : void 0), S = t(() => u.value === "search" ? L(c.result) : void 0), C = t(() => u.value === "find" ? pe(c.result) : void 0), w = p(!1), T = t(() => J(C.value ?? [], w.value)), E = t(() => u.value === "run-output" ? I(c.result) : void 0), D = p(!1), O = t(() => J(x.value ?? [], D.value)), k = t(() => ({
827
904
  type: "markdown",
828
905
  text: "kvcoder.markdown",
829
906
  params: { text: c.output }
830
- })), T = t(() => u.value !== "line" && typeof c.result == "object" && c.result !== null);
831
- return (t, o) => d.value === void 0 ? h.value === void 0 ? y.value === void 0 ? b.value === void 0 ? u.value === "write" && T.value ? (f(), i(e, { key: 4 }, [], 64)) : x.value === void 0 ? u.value === "delegate" && c.output !== "" ? (f(), i("div", {
832
- key: 6,
907
+ })), A = t(() => u.value !== "line" && typeof c.result == "object" && c.result !== null);
908
+ return (t, o) => d.value === void 0 ? h.value === void 0 ? x.value === void 0 ? C.value === void 0 ? S.value === void 0 ? y.value === void 0 ? u.value === "write" && A.value ? (f(), i(e, { key: 6 }, [], 64)) : E.value === void 0 ? u.value === "delegate" && c.output !== "" ? (f(), i("div", {
909
+ key: 8,
833
910
  class: "kvc-block",
834
911
  "aria-label": v(l).t("kvcoder.ui.call.answer"),
835
912
  "data-test": "call-answer"
836
- }, [(f(), n(g(v(l).View), { view: w.value }, null, 8, ["view"]))], 8, Ft)) : T.value ? (f(), i("div", {
837
- key: 7,
913
+ }, [(f(), n(g(v(l).View), { view: k.value }, null, 8, ["view"]))], 8, Kt)) : A.value ? (f(), i("div", {
914
+ key: 9,
838
915
  class: "kvc-block",
839
916
  "aria-label": v(l).t("kvcoder.ui.output"),
840
917
  "data-test": "call-result-fields"
841
- }, [s(Z, { value: v(K)(c.result) }, null, 8, ["value"])], 8, It)) : c.output === "" ? r("v-if", !0) : (f(), n(Q, {
842
- key: 8,
918
+ }, [s($, { value: v(q)(c.result) }, null, 8, ["value"])], 8, qt)) : c.output === "" ? r("v-if", !0) : (f(), n(Tt, {
919
+ key: 10,
843
920
  output: c.output
844
- }, null, 8, ["output"])) : (f(), n(Ot, {
845
- key: 5,
846
- run: x.value
847
- }, null, 8, ["run"])) : (f(!0), i(e, { key: 3 }, m(b.value, (e) => (f(), i("div", {
921
+ }, null, 8, ["output"])) : (f(), n(Pt, {
922
+ key: 7,
923
+ run: E.value
924
+ }, null, 8, ["run"])) : (f(!0), i(e, { key: 5 }, m(y.value, (e, t) => (f(), i("div", {
925
+ key: `${t}:${e.path}`,
926
+ class: "kvc-block",
927
+ "data-test": "call-read-file"
928
+ }, [a("div", Wt, _(e.path), 1), e.read === void 0 ? (f(), i("p", Gt, _(b(e)), 1)) : (f(), n(Q, {
929
+ key: 0,
930
+ lines: v(Y)(e.read.content, e.read.fromLine)
931
+ }, null, 8, ["lines"]))]))), 128)) : (f(!0), i(e, { key: 4 }, m(S.value, (e) => (f(), i("div", {
848
932
  key: e.path,
849
933
  class: "kvc-block",
850
934
  "data-test": "call-file"
851
- }, [a("div", Pt, _(e.path), 1), s(X, { lines: e.matches.map((e) => ({
852
- text: e.text,
853
- number: e.line
854
- })) }, null, 8, ["lines"])]))), 128)) : (f(), i("div", At, [(f(!0), i(e, null, m(C.value, (e) => (f(), i("div", {
935
+ }, [a("div", Ht, _(e.path), 1), e.matches.length > 0 ? (f(), n(Q, {
936
+ key: 0,
937
+ lines: e.matches.map((e) => ({
938
+ text: e.text,
939
+ number: e.line
940
+ }))
941
+ }, null, 8, ["lines"])) : (f(), i("p", Ut, _(v(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (f(), i("div", Bt, [(f(!0), i(e, null, m(T.value, (e) => (f(), i("div", {
942
+ key: e,
943
+ class: "kvc-entry",
944
+ "data-test": "call-path"
945
+ }, [s(v(j), {
946
+ size: 14,
947
+ "aria-hidden": "true"
948
+ }), a("span", Vt, _(e), 1)]))), 128)), s(X, {
949
+ count: C.value.length,
950
+ open: w.value,
951
+ onToggle: o[1] ||= (e) => w.value = !w.value
952
+ }, null, 8, ["count", "open"])])) : (f(), i("div", It, [(f(!0), i(e, null, m(O.value, (e) => (f(), i("div", {
855
953
  key: e.name,
856
954
  class: "kvc-entry",
857
955
  "data-kind": e.kind,
858
956
  "data-test": "call-entry"
859
957
  }, [
860
- (f(), n(g(e.kind === "folder" ? v(re) : v(k)), {
958
+ (f(), n(g(e.kind === "folder" ? v(te) : v(j)), {
861
959
  size: 14,
862
960
  "aria-hidden": "true"
863
961
  })),
864
- a("span", Mt, _(e.name), 1),
865
- e.kind === "file" ? (f(), i("span", Nt, _(v(B)(v(l).t, e.bytes)), 1)) : r("v-if", !0)
866
- ], 8, jt))), 128)), s(J, {
867
- count: y.value.length,
868
- open: S.value,
869
- onToggle: o[0] ||= (e) => S.value = !S.value
870
- }, null, 8, ["count", "open"])])) : (f(), n(X, {
962
+ a("span", Rt, _(e.name), 1),
963
+ e.kind === "file" ? (f(), i("span", zt, _(v(xe)(v(l).t, e.bytes)), 1)) : r("v-if", !0)
964
+ ], 8, Lt))), 128)), s(X, {
965
+ count: x.value.length,
966
+ open: D.value,
967
+ onToggle: o[0] ||= (e) => D.value = !D.value
968
+ }, null, 8, ["count", "open"])])) : (f(), n(Q, {
871
969
  key: 1,
872
970
  class: "kvc-block",
873
- lines: v(Ge)(h.value.content, h.value.fromLine),
971
+ lines: v(Y)(h.value.content, h.value.fromLine),
874
972
  "data-test": "call-content"
875
- }, null, 8, ["lines"])) : (f(), i("p", kt, _(v(l).t("kvcoder.ui.call.replacements", {
973
+ }, null, 8, ["lines"])) : (f(), i("p", Ft, _(v(l).t("kvcoder.ui.call.replacements", {
876
974
  count: d.value.replacements,
877
975
  line: d.value.firstChangedLine
878
976
  })), 1));
879
977
  }
880
- }), Rt = {
978
+ }), Yt = {
881
979
  key: 0,
882
980
  class: "kvc-summary",
883
981
  "data-test": "call-summary"
884
- }, zt = {
982
+ }, Xt = {
885
983
  key: 0,
886
984
  "data-test": "call-words"
887
- }, Bt = {
985
+ }, Zt = {
888
986
  key: 1,
889
987
  class: "kvc-mono",
890
988
  "data-test": "call-subject"
891
- }, Vt = ["dir"], Ht = {
989
+ }, Qt = ["dir"], $t = {
892
990
  key: 1,
893
991
  class: "kvc-muted",
894
992
  dir: "ltr",
895
993
  style: { "align-self": "flex-start" },
896
994
  "data-test": "call-label"
897
- }, Ut = /* @__PURE__ */ c({
995
+ }, en = /* @__PURE__ */ c({
898
996
  __name: "CallSummaryLine",
899
997
  props: {
900
998
  view: {},
@@ -902,50 +1000,50 @@ var bt = {
902
1000
  whole: { type: Boolean }
903
1001
  },
904
1002
  setup(e) {
905
- let n = e, a = A(), o = t(() => Oe(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : Ie(o.value.subject));
906
- return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span", Ht, _(n.view.label), 1)) : r("v-if", !0) : (f(), i("span", Rt, [
907
- o.value.words ? (f(), i("span", zt, _(o.value.words), 1)) : r("v-if", !0),
908
- c.value ? (f(), i("span", Bt, _(c.value), 1)) : r("v-if", !0),
1003
+ let n = e, a = N(), o = t(() => Pe(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : K(o.value.subject));
1004
+ return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span", $t, _(n.view.label), 1)) : r("v-if", !0) : (f(), i("span", Yt, [
1005
+ o.value.words ? (f(), i("span", Xt, _(o.value.words), 1)) : r("v-if", !0),
1006
+ c.value ? (f(), i("span", Zt, _(c.value), 1)) : r("v-if", !0),
909
1007
  o.value.outcome ? (f(), i("span", {
910
1008
  key: 2,
911
1009
  class: "kvc-muted",
912
1010
  dir: s.value,
913
1011
  "data-test": "call-outcome"
914
- }, _(o.value.outcome), 9, Vt)) : r("v-if", !0)
1012
+ }, _(o.value.outcome), 9, Qt)) : r("v-if", !0)
915
1013
  ]));
916
1014
  }
917
- }), Wt = ["aria-expanded", "disabled"], Gt = ["aria-label"], Kt = { class: "kvc-lines" }, qt = {
1015
+ }), tn = ["aria-expanded", "disabled"], nn = ["aria-label"], rn = { class: "kvc-lines" }, an = {
918
1016
  key: 0,
919
1017
  style: { "font-weight": "600" },
920
1018
  "data-test": "call-description"
921
- }, Jt = {
1019
+ }, on = {
922
1020
  key: 1,
923
1021
  class: "kvc-oneline",
924
1022
  "data-test": "call-line"
925
- }, Yt = { class: "kvc-mono" }, Xt = {
1023
+ }, sn = { class: "kvc-mono" }, cn = {
926
1024
  key: 2,
927
1025
  class: "kvc-chip kvc-warn",
928
1026
  "data-test": "call-risky"
929
- }, Zt = {
1027
+ }, ln = {
930
1028
  key: 3,
931
1029
  class: "kvc-chip",
932
1030
  "data-test": "call-background"
933
- }, Qt = {
1031
+ }, un = {
934
1032
  key: 4,
935
1033
  class: "kvc-chip",
936
1034
  "data-test": "call-not-run"
937
- }, $t = {
1035
+ }, dn = {
938
1036
  key: 5,
939
1037
  class: "kvc-chip kvc-danger",
940
1038
  "data-test": "call-failed"
941
- }, en = {
1039
+ }, fn = {
942
1040
  class: "kvc-muted",
943
1041
  "data-test": "call-time"
944
- }, tn = {
1042
+ }, pn = {
945
1043
  key: 0,
946
1044
  class: "kvc-muted kvc-call-parts",
947
1045
  "data-test": "call-parts"
948
- }, nn = ["aria-expanded"], rn = ["aria-label"], an = /* @__PURE__ */ c({
1046
+ }, mn = ["aria-expanded"], hn = ["aria-label"], gn = /* @__PURE__ */ c({
949
1047
  __name: "CallCard",
950
1048
  props: {
951
1049
  view: {},
@@ -955,14 +1053,14 @@ var bt = {
955
1053
  running: { type: Boolean }
956
1054
  },
957
1055
  setup(o) {
958
- let c = o, l = A(), u = t(() => W(c.view)), m = p(c.output !== void 0 && c.failed !== !0 && (u.value === "edit" || u.value === "write")), h = p(!1), y = t(() => c.failed === !0 && c.output !== void 0 ? se(c.output) : void 0), b = t(() => y.value?.kind === "invalid"), x = t(() => {
1056
+ let c = o, l = N(), u = t(() => G(c.view)), m = p(!1), h = p(!1), y = t(() => c.failed === !0 && c.output !== void 0 ? ae(c.output) : void 0), b = t(() => y.value?.kind === "invalid"), x = t(() => {
959
1057
  let e = y.value;
960
1058
  return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
961
- }), S = t(() => c.failed === !0 ? void 0 : ge(c.output)), C = t(() => c.failed === !0 && u.value !== "line"), w = t(() => c.durationMs === void 0 ? "" : $(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), T = t(() => {
1059
+ }), S = t(() => c.failed === !0 ? void 0 : be(c.output)), C = t(() => c.failed === !0 && u.value !== "line"), w = t(() => c.durationMs === void 0 ? "" : M(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), T = t(() => {
962
1060
  if (c.durationMs === void 0) return "";
963
- let e = $(l.t, c.durationMs);
1061
+ let e = M(l.t, c.durationMs);
964
1062
  return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
965
- written: $(l.t, c.view.writtenMs),
1063
+ written: M(l.t, c.view.writtenMs),
966
1064
  ran: e
967
1065
  });
968
1066
  });
@@ -984,14 +1082,14 @@ var bt = {
984
1082
  key: 0,
985
1083
  class: "kvc-spin",
986
1084
  "aria-label": v(l).t("kvcoder.ui.running")
987
- }, null, 8, Gt)) : (f(), n(g(m.value ? v(D) : v(O)), {
1085
+ }, null, 8, nn)) : (f(), n(g(m.value ? v(A) : v(ee)), {
988
1086
  key: 1,
989
1087
  size: 16,
990
1088
  "aria-hidden": "true"
991
1089
  })),
992
- a("span", Kt, [
993
- c.view.description ? (f(), i("span", qt, _(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (f(), i("span", Jt, [a("span", Yt, _(v(Ie)(c.view.line)), 1)])) : r("v-if", !0),
994
- s(Ut, {
1090
+ a("span", rn, [
1091
+ c.view.description ? (f(), i("span", an, _(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (f(), i("span", on, [a("span", sn, _(v(K)(c.view.line)), 1)])) : r("v-if", !0),
1092
+ s(en, {
995
1093
  view: c.view,
996
1094
  result: S.value
997
1095
  }, null, 8, ["view", "result"]),
@@ -1002,22 +1100,22 @@ var bt = {
1002
1100
  "data-test": "call-reason"
1003
1101
  }, _(x.value), 3))
1004
1102
  ]),
1005
- c.view.risky ? (f(), i("span", Xt, _(v(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
1006
- c.view.background ? (f(), i("span", Zt, _(v(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
1007
- b.value ? (f(), i("span", Qt, _(v(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (f(), i("span", $t, _(v(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
1008
- a("span", en, _(w.value), 1)
1009
- ], 8, Wt), m.value && c.output !== void 0 ? (f(), i(e, { key: 0 }, [T.value === "" ? r("v-if", !0) : (f(), i("p", tn, _(T.value), 1)), C.value ? (f(), i(e, { key: 1 }, [a("button", {
1103
+ c.view.risky ? (f(), i("span", cn, _(v(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
1104
+ c.view.background ? (f(), i("span", ln, _(v(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
1105
+ b.value ? (f(), i("span", un, _(v(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (f(), i("span", dn, _(v(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
1106
+ a("span", fn, _(w.value), 1)
1107
+ ], 8, tn), m.value && c.output !== void 0 ? (f(), i(e, { key: 0 }, [T.value === "" ? r("v-if", !0) : (f(), i("p", pn, _(T.value), 1)), C.value ? (f(), i(e, { key: 1 }, [a("button", {
1010
1108
  type: "button",
1011
1109
  class: "kvc-text-button kvc-fold",
1012
1110
  "aria-expanded": h.value,
1013
1111
  "data-test": "call-details",
1014
1112
  onClick: o[1] ||= (e) => h.value = !h.value
1015
- }, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, nn), h.value ? (f(), i(e, { key: 0 }, [a("pre", {
1113
+ }, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, mn), h.value ? (f(), i(e, { key: 0 }, [a("pre", {
1016
1114
  class: "kvc-block kvc-error",
1017
1115
  dir: "auto",
1018
1116
  "aria-label": v(l).t("kvcoder.ui.call.error"),
1019
1117
  "data-test": "call-error"
1020
- }, [s(Y, { text: c.output }, null, 8, ["text"])], 8, rn), s(_t, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (f(), i(e, { key: 2 }, [s(_t, { view: c.view }, null, 8, ["view"]), s(Lt, {
1118
+ }, [s(Z, { text: c.output }, null, 8, ["text"])], 8, hn), s(St, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (f(), i(e, { key: 2 }, [s(St, { view: c.view }, null, 8, ["view"]), s(Jt, {
1021
1119
  view: c.view,
1022
1120
  output: c.output,
1023
1121
  result: S.value
@@ -1027,7 +1125,7 @@ var bt = {
1027
1125
  "result"
1028
1126
  ])], 64))], 64)) : r("v-if", !0)], 2));
1029
1127
  }
1030
- }), on = /* @__PURE__ */ c({
1128
+ }), _n = /* @__PURE__ */ c({
1031
1129
  __name: "call",
1032
1130
  props: {
1033
1131
  description: {},
@@ -1043,13 +1141,13 @@ var bt = {
1043
1141
  let r = e, i = t(() => r.connector === void 0 ? {
1044
1142
  ...r.description === void 0 ? {} : { description: r.description },
1045
1143
  ...r.line === void 0 ? {} : { line: r.line }
1046
- } : Pe({
1144
+ } : Be({
1047
1145
  description: r.description,
1048
1146
  connector: r.connector,
1049
1147
  command: r.command,
1050
1148
  payload: r.payload ?? {}
1051
1149
  }));
1052
- return (e, t) => (f(), n(an, {
1150
+ return (e, t) => (f(), n(gn, {
1053
1151
  view: i.value,
1054
1152
  failed: r.failed,
1055
1153
  "duration-ms": r.durationMs,
@@ -1063,4 +1161,4 @@ var bt = {
1063
1161
  }
1064
1162
  });
1065
1163
  //#endregion
1066
- export { on as default };
1164
+ export { _n as default };