@commentkit/comment-kit 2.0.0 → 2.0.1

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 (72) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +109 -13
  3. package/SECURITY.md +2 -2
  4. package/dist/node/cli/doctor.js +84 -20
  5. package/dist/node/cli/init.js +349 -35
  6. package/dist/node/cli/main.js +35 -17
  7. package/dist/node/cli/mcp.js +187 -6
  8. package/dist/node/shared/dashboard-places.js +33 -0
  9. package/dist/npm/chunks/{AgentSend-DxRJIYiz.js → AgentSend-DOy3jhyF.js} +16 -16
  10. package/dist/npm/chunks/{Checklist-CnlfeSbc.js → Checklist-CW_SwMpS.js} +70 -70
  11. package/dist/npm/chunks/{Composer-B1bBVszY.js → Composer-Bveq5QrK.js} +276 -274
  12. package/dist/npm/chunks/{Guest-vvNPz8h-.js → Guest-7hcN765o.js} +58 -55
  13. package/dist/npm/chunks/{MarkupEditor-VCOXh9d2.js → MarkupEditor-6bJGpWGO.js} +46 -39
  14. package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
  15. package/dist/npm/chunks/{Settings-BGoZS2iV.js → Settings-CB5eEKnf.js} +77 -77
  16. package/dist/npm/chunks/{Shortcuts-B2OMvczr.js → Shortcuts-eAyjJ89P.js} +4 -4
  17. package/dist/npm/chunks/{StyleEditor-CJ_d8Huf.js → StyleEditor-CZTdAA5c.js} +10 -10
  18. package/dist/npm/chunks/{StylePanel-yQzHHlY7.js → StylePanel-B4pHQUL9.js} +61 -61
  19. package/dist/npm/chunks/{TaskFields-fmy6_HtK.js → TaskFields-C8BX0Sgg.js} +55 -55
  20. package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
  21. package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
  22. package/dist/npm/chunks/{agent-C1OQzBAm.js → agent-MTQHr9ei.js} +1 -1
  23. package/dist/npm/chunks/{ar-CAJ3XT8e.js → ar-L5cQ-NPe.js} +2 -0
  24. package/dist/npm/chunks/{card-bits-CAnzrqx3.js → card-bits-CTdrkYn8.js} +16 -16
  25. package/dist/npm/chunks/{client-kNAo2TTG.js → client-7eVxvg5j.js} +7 -7
  26. package/dist/npm/chunks/{confetti-CkBdSu19.js → confetti-BIs5s14P.js} +1 -1
  27. package/dist/npm/chunks/{context-B8UAzve0.js → context-Cf6khm7A.js} +1 -1
  28. package/dist/npm/chunks/{de-Dl18G48t.js → de-D0C-v6tP.js} +2 -0
  29. package/dist/npm/chunks/{dialog-GO04oC3D.js → dialog-DvdIkCW0.js} +1 -1
  30. package/dist/npm/chunks/{dpop-U48QIQd7.js → dpop-0A76OPa9.js} +1 -1
  31. package/dist/npm/chunks/{es-Dxk79lS9.js → es-Bw4Dj9tN.js} +2 -0
  32. package/dist/npm/chunks/{extension-CKFpPWmi.js → extension-DFVOvciD.js} +1 -1
  33. package/dist/npm/chunks/{extension-E81hWyiT.js → extension-SmoH5AA4.js} +2 -2
  34. package/dist/npm/chunks/{files-DyD5BZgp.js → files-4lV9YQIX.js} +2 -2
  35. package/dist/npm/chunks/{fr-8BebGKYD.js → fr-TkuQaIAa.js} +2 -0
  36. package/dist/npm/chunks/{hi-BIN6Yy_p.js → hi-DXSH2U8d.js} +2 -0
  37. package/dist/npm/chunks/{i18n-DOBt8e9U.js → i18n-aVSu9TcJ.js} +56 -47
  38. package/dist/npm/chunks/{identify-CN-3xzqL.js → identify-BGYh2dVo.js} +4 -4
  39. package/dist/npm/chunks/{it-Cr6EwpPQ.js → it-CiWA_bch.js} +2 -0
  40. package/dist/npm/chunks/{ja-Iy3s5aur.js → ja-C-QmR3yz.js} +2 -0
  41. package/dist/npm/chunks/{late-words-B2bmZceJ.js → late-words-80_VWt8S.js} +3 -1
  42. package/dist/npm/chunks/{live-CelVeZfP.js → live-BExWHzQ7.js} +1 -1
  43. package/dist/npm/chunks/{nl-B84WHqqe.js → nl-CEmZRqjX.js} +2 -0
  44. package/dist/npm/chunks/{page-key-DepmJzC1.js → page-key-HSY3Lze5.js} +1 -1
  45. package/dist/npm/chunks/{pick-yTyqtxN0.js → pick-B3sR7jtS.js} +1 -1
  46. package/dist/npm/chunks/{pkce-ChKGSW_4.js → pkce-CfZhiNBi.js} +1 -1
  47. package/dist/npm/chunks/{pt-BR-DOkdlfoe.js → pt-BR-b-a8sxO8.js} +2 -0
  48. package/dist/npm/chunks/{report-CrIqQZDI.js → report-DaVuoRYS.js} +1 -1
  49. package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
  50. package/dist/npm/chunks/{signin-Dd1rb2BP.js → signin-BOWr_WCo.js} +3 -3
  51. package/dist/npm/chunks/{source-pXVve2Cx.js → source-mk3rGBBQ.js} +1 -1
  52. package/dist/npm/chunks/{src-BTMy4Gyc.js → src-C8rZFyL_.js} +77 -70
  53. package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
  54. package/dist/npm/chunks/{states-sfTbjZz8.js → states-b9Bv3Ci7.js} +1 -1
  55. package/dist/npm/chunks/{upload-MgPYqPyE.js → upload-B2mkgMeJ.js} +1 -1
  56. package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
  57. package/dist/npm/chunks/{wrap-Bl0gbnFa.js → wrap-DW6EFbVQ.js} +1 -1
  58. package/dist/npm/chunks/{zh-CN-Z5fQCb7G.js → zh-CN-JTscW8u8.js} +2 -0
  59. package/dist/npm/element.js +1 -1
  60. package/dist/npm/headless.js +2 -2
  61. package/dist/npm/index.js +2 -2
  62. package/dist/npm/react.js +1 -1
  63. package/dist/npm/svelte.js +1 -1
  64. package/dist/npm/types/core/types.d.ts +2 -2
  65. package/dist/npm/vue.js +1 -1
  66. package/package.json +3 -1
  67. package/dist/npm/chunks/Panel-F37vIL1K.js +0 -1206
  68. package/dist/npm/chunks/ThreadCard-D51slKST.js +0 -1113
  69. package/dist/npm/chunks/Viewer-BOBadqmC.js +0 -111
  70. package/dist/npm/chunks/show-BgVC8gWY.js +0 -97
  71. package/dist/npm/chunks/start-DtVlpt7p.js +0 -1878
  72. package/dist/npm/chunks/uploads-D49mywwz.js +0 -1146
@@ -1,9 +1,11 @@
1
1
  // `npx @commentkit/comment-kit mcp install <agent>`: add the hosted MCP server to a coding agent's config file.
2
2
  // Merges into what is there, backs the file up first, and never replaces an entry without asking.
3
+ import { spawnSync } from "node:child_process";
3
4
  import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
4
5
  import { homedir } from "node:os";
5
- import { dirname, join } from "node:path";
6
+ import { basename, dirname, join, relative } from "node:path";
6
7
  import { CliError } from "./api.js";
8
+ import { credentialsPath } from "./credentials.js";
7
9
  export const AGENTS = ["cursor", "vscode", "claude", "codex"];
8
10
  const NAME = "commentkit";
9
11
  /** The scope each agent's own docs lead with. */
@@ -37,10 +39,131 @@ export function configPath(agent, scope, cwd, env = process.env, platform = proc
37
39
  export function entry(agent, url) {
38
40
  return agent === "cursor" ? { url } : { type: "http", url };
39
41
  }
40
- /** Add or replace mcpServers.commentkit (servers.commentkit for VS Code), keeping everything else. */
42
+ /** The file's own indentation unit (a tab, or the smallest run of leading spaces), 2 spaces when it has none. */
43
+ export function indentOf(text) {
44
+ let unit = null;
45
+ for (const m of text.matchAll(/\n([ \t]+)\S/g)) {
46
+ const ws = m[1];
47
+ if (ws.startsWith("\t"))
48
+ return "\t";
49
+ if (unit === null || ws.length < unit.length)
50
+ unit = ws;
51
+ }
52
+ return unit ?? " ";
53
+ }
54
+ /** Positions in a JSON text that JSON.parse accepted: just enough to find an object's members. */
55
+ class Scan {
56
+ text;
57
+ constructor(text) {
58
+ this.text = text;
59
+ }
60
+ ws(i) {
61
+ while (i < this.text.length && /\s/.test(this.text[i]))
62
+ i++;
63
+ return i;
64
+ }
65
+ string(i) {
66
+ for (i++; this.text[i] !== '"'; i++)
67
+ if (this.text[i] === "\\")
68
+ i++;
69
+ return i + 1;
70
+ }
71
+ value(i) {
72
+ const c = this.text[i];
73
+ if (c === '"')
74
+ return this.string(i);
75
+ if (c === "{" || c === "[") {
76
+ const close = c === "{" ? "}" : "]";
77
+ i = this.ws(i + 1);
78
+ while (this.text[i] !== close) {
79
+ if (c === "{")
80
+ i = this.ws(this.string(i)) + 1; // the key, then its ':'
81
+ i = this.ws(this.value(this.ws(i)));
82
+ if (this.text[i] === ",")
83
+ i = this.ws(i + 1);
84
+ }
85
+ return i + 1;
86
+ }
87
+ const m = /^-?[\w.+-]+/.exec(this.text.slice(i));
88
+ return i + (m ? m[0].length : 1);
89
+ }
90
+ /** The members of the object whose `{` is at `open`, and where its `}` is. */
91
+ members(open) {
92
+ const members = [];
93
+ let i = this.ws(open + 1);
94
+ while (this.text[i] !== "}") {
95
+ const keyStart = i;
96
+ const keyEnd = this.string(i);
97
+ const valueStart = this.ws(this.ws(keyEnd) + 1);
98
+ const valueEnd = this.value(valueStart);
99
+ members.push({ key: JSON.parse(this.text.slice(keyStart, keyEnd)), keyStart, valueStart, valueEnd });
100
+ i = this.ws(valueEnd);
101
+ if (this.text[i] === ",")
102
+ i = this.ws(i + 1);
103
+ }
104
+ return { members, close: i };
105
+ }
106
+ }
107
+ /** The whitespace that starts the line holding `pos`. */
108
+ function lineIndent(text, pos) {
109
+ const start = text.lastIndexOf("\n", pos - 1) + 1;
110
+ return /^[ \t]*/.exec(text.slice(start))[0];
111
+ }
112
+ /** `value` as JSON laid out like the file: multi-line at `indent` with `unit`, or on one line. */
113
+ function layout(value, indent, unit, nl, inline, spaced) {
114
+ if (!inline)
115
+ return JSON.stringify(value, null, unit).split("\n").join(nl + indent);
116
+ if (!spaced)
117
+ return JSON.stringify(value);
118
+ const one = (v) => v && typeof v === "object" && !Array.isArray(v)
119
+ ? `{ ${Object.entries(v).map(([k, x]) => `${JSON.stringify(k)}: ${one(x)}`).join(", ")} }`
120
+ : JSON.stringify(v);
121
+ return one(value);
122
+ }
123
+ /**
124
+ * Set `key` to `value` in the object at `open`, as an edit to the text: the rest of the file keeps its
125
+ * indentation, line endings and trailing newline. A new member goes last, laid out like its neighbours.
126
+ */
127
+ function setMember(text, open, key, value, unit) {
128
+ const scan = new Scan(text);
129
+ const nl = text.includes("\r\n") ? "\r\n" : "\n";
130
+ const spaced = /"\s*:\s/.test(text) || !/"\s*:\S/.test(text);
131
+ const { members, close } = scan.members(open);
132
+ const existing = members.find((m) => m.key === key);
133
+ if (existing) {
134
+ const inline = !text.slice(existing.valueStart, existing.valueEnd).includes("\n") && !text.slice(open, close).includes("\n");
135
+ const indent = lineIndent(text, existing.keyStart);
136
+ return `${text.slice(0, existing.valueStart)}${layout(value, indent, unit, nl, inline, spaced)}${text.slice(existing.valueEnd)}`;
137
+ }
138
+ const name = JSON.stringify(key);
139
+ const colon = spaced ? ": " : ":";
140
+ if (members.length) {
141
+ const last = members.at(-1);
142
+ const multiline = text.slice(open, members[0].keyStart).includes("\n");
143
+ if (multiline) {
144
+ const indent = lineIndent(text, members[0].keyStart);
145
+ return `${text.slice(0, last.valueEnd)},${nl}${indent}${name}${colon}${layout(value, indent, unit, nl, false, spaced)}${text.slice(last.valueEnd)}`;
146
+ }
147
+ return `${text.slice(0, last.valueEnd)},${spaced ? " " : ""}${name}${colon}${layout(value, "", unit, nl, true, spaced)}${text.slice(last.valueEnd)}`;
148
+ }
149
+ // An empty object: multi-line when the file is, one line when it is all on one line.
150
+ const multiline = text.trimEnd().includes("\n") || text.slice(open, close).includes("\n");
151
+ if (!multiline)
152
+ return `${text.slice(0, open + 1)}${spaced ? " " : ""}${name}${colon}${layout(value, "", unit, nl, true, spaced)}${spaced ? " " : ""}${text.slice(close)}`;
153
+ const outer = lineIndent(text, open);
154
+ const inner = outer + unit;
155
+ return `${text.slice(0, open + 1)}${nl}${inner}${name}${colon}${layout(value, inner, unit, nl, false, spaced)}${nl}${outer}${text.slice(close)}`;
156
+ }
157
+ /**
158
+ * Add or replace mcpServers.commentkit (servers.commentkit for VS Code), keeping everything else. The file
159
+ * is edited as text, so the change is only the entry: its indentation (spaces or tabs), line endings and
160
+ * trailing newline (or none) stay as they were. If the edit would not give exactly the intended JSON, the
161
+ * file is written out whole instead, still with its own indentation and trailing-newline state.
162
+ */
41
163
  export function mergeJson(text, agent, url) {
42
164
  let root = {};
43
- if (text !== null && text.trim() !== "") {
165
+ const empty = text === null || text.trim() === "";
166
+ if (!empty) {
44
167
  try {
45
168
  root = JSON.parse(text);
46
169
  }
@@ -59,7 +182,25 @@ export function mergeJson(text, agent, url) {
59
182
  if (current !== undefined && JSON.stringify(current) === JSON.stringify(wanted))
60
183
  return { status: "same", content: text ?? "" };
61
184
  root[key] = { ...servers, [NAME]: wanted };
62
- return { status: current === undefined ? "added" : "replaced", content: `${JSON.stringify(root, null, 2)}\n` };
185
+ const status = current === undefined ? "added" : "replaced";
186
+ if (empty)
187
+ return { status, content: `${JSON.stringify(root, null, 2)}\n` };
188
+ const unit = indentOf(text);
189
+ let content = null;
190
+ try {
191
+ const open = text.indexOf("{");
192
+ const { members } = new Scan(text).members(open);
193
+ const holder = members.find((m) => m.key === key);
194
+ content = holder && text[holder.valueStart] === "{" ? setMember(text, holder.valueStart, NAME, wanted, unit) : setMember(text, open, key, { [NAME]: wanted }, unit);
195
+ if (JSON.stringify(JSON.parse(content)) !== JSON.stringify(root))
196
+ content = null;
197
+ }
198
+ catch {
199
+ content = null;
200
+ }
201
+ // Fallback: the whole file, in its own indentation and with its own trailing-newline state.
202
+ content ??= `${JSON.stringify(root, null, unit)}${/\n$/.test(text) ? (text.endsWith("\r\n") ? "\r\n" : "\n") : ""}`;
203
+ return { status, content };
63
204
  }
64
205
  const TABLE = /^[ \t]*\[[ \t]*mcp_servers[ \t]*\.[ \t]*"?commentkit"?[ \t]*\][ \t]*(#.*)?$/m;
65
206
  /** Add or replace [mcp_servers.commentkit] in Codex's config.toml, as text, so comments and layout stay. */
@@ -89,9 +230,49 @@ export function mergeToml(text, url) {
89
230
  const tail = source.slice(end);
90
231
  return { status: "replaced", content: `${source.slice(0, start)}${block}${tail ? `\n${tail}` : ""}` };
91
232
  }
92
- /** A copy next to the file, named by the time, with the same permissions. */
233
+ /**
234
+ * Is `file` (which may not exist yet) in a git work tree, and does git ignore it? Asks git itself
235
+ * (`git check-ignore -v`), so nested .gitignore files, .git/info/exclude and the global excludes file all
236
+ * count. Without git, a .git folder above the file means "in a repository, not ignored".
237
+ */
238
+ export function gitPlace(file) {
239
+ let dir = dirname(file);
240
+ while (!existsSync(dir) && dirname(dir) !== dir)
241
+ dir = dirname(dir);
242
+ const result = spawnSync("git", ["-C", dir, "check-ignore", "-v", "--", relative(dir, file)], { encoding: "utf8", timeout: 10_000, stdio: ["ignore", "pipe", "pipe"] });
243
+ if (result.error) {
244
+ for (let d = dir;; d = dirname(d)) {
245
+ if (existsSync(join(d, ".git")))
246
+ return { repo: true, ignored: false };
247
+ if (dirname(d) === d)
248
+ return { repo: false, ignored: false };
249
+ }
250
+ }
251
+ if (result.status === 0) {
252
+ // "<source>:<line>:<pattern>\t<path>"; the source is relative to `dir`, or absolute for a global excludes file.
253
+ const m = /^(.*?):(\d+):/.exec(result.stdout);
254
+ return { repo: true, ignored: true, ...(m ? { rule: `${m[1]}:${m[2]}` } : {}) };
255
+ }
256
+ // 1: not ignored. 128: not a repository (or git could not tell).
257
+ return { repo: result.status === 1, ignored: false };
258
+ }
259
+ /** Where backups go when one next to the file would sit in a git work tree for git to pick up. */
260
+ export function backupFolder(env = process.env) {
261
+ return join(dirname(credentialsPath(env)), "backups");
262
+ }
263
+ /**
264
+ * A copy of the file, named by the time, with the same permissions: next to the file, unless that copy
265
+ * would land in a git work tree without being ignored; then in the CLI's own folder (backupFolder()).
266
+ */
93
267
  export function backup(file, now = new Date()) {
94
- const copy = `${file}.bak-${now.toISOString().replace(/[:.]/g, "-")}`;
268
+ const name = `${basename(file)}.bak-${now.toISOString().replace(/[:.]/g, "-")}`;
269
+ const beside = join(dirname(file), name);
270
+ const place = gitPlace(beside);
271
+ let copy = beside;
272
+ if (place.repo && !place.ignored) {
273
+ mkdirSync(backupFolder(), { recursive: true, mode: 0o700 });
274
+ copy = join(backupFolder(), name);
275
+ }
95
276
  copyFileSync(file, copy);
96
277
  try {
97
278
  chmodSync(copy, statSync(file).mode & 0o777);
@@ -0,0 +1,33 @@
1
+ // Shared by the CLI and the MCP server (copied into comment-kit-mcp at build time): where things are in
2
+ // the CommentKit dashboard, written the way the dashboard's own docs write a path ("the website's
3
+ // Settings → Install"). The labels are the dashboard's, word for word: each website has Settings pages
4
+ // General, Install, Feedback button, Integrations (only once a tool is connected), Agent approvals and,
5
+ // under "Advanced", For developers; the workspace's Coding agents page has the tabs Requests and Connect;
6
+ // your account's Settings has Profile, Security, Notifications and Workspaces. The old Setup, Connect
7
+ // and Developers pages are gone, and the dashboard says "website", not "project".
8
+ // test/dashboard-locations.test.ts checks every user-facing file against these lists. No imports.
9
+ /** The website settings pages, in the order the dashboard lists them. */
10
+ export const WEBSITE_SETTINGS_PAGES = ["General", "Install", "Feedback button", "Integrations", "Agent approvals", "For developers", "Hand over or delete"];
11
+ /** The tabs of the workspace's Coding agents page. */
12
+ export const CODING_AGENTS_TABS = ["Requests", "Connect"];
13
+ /** Your account's settings pages. */
14
+ export const ACCOUNT_SETTINGS_PAGES = ["Profile", "Security", "Notifications", "Workspaces"];
15
+ /** Where to send people, as the text to put after "in" or "open". */
16
+ export const DASHBOARD = {
17
+ /** The website addresses the button may load on. */
18
+ addresses: "the website's Settings → Install, under Addresses",
19
+ /** The install snippet, with the website key (pk_live_…) in it. */
20
+ install: "the website's Settings → Install",
21
+ /** "Feedback on this website": pause it or turn it back on. */
22
+ feedbackState: "the website's Settings → General, under Feedback on this website",
23
+ /** The "Approve agent changes first" switch. */
24
+ agentApprovals: "the website's Settings → Agent approvals",
25
+ /** Keys, Website ID, Sign in from your website, Send updates to your server (webhooks), code hosts. */
26
+ developers: "the website's Settings → For developers",
27
+ /** CI tokens (for the local MCP server, Zapier, Make and scripts) and the Website ID. */
28
+ ciTokens: "Coding agents → Connect → For CI and scripts",
29
+ /** An agent's writes waiting for a person. */
30
+ agentRequests: "Coding agents → Requests",
31
+ /** This person's MCP apps, CLI sign-ins and CI tokens, each with Disconnect. */
32
+ connectedAgents: "Settings → Security, under Connected coding agents",
33
+ };
@@ -1,6 +1,6 @@
1
- import { a as e, c as t, d as n, f as r, g as i, p as a, u as o } from "./i18n-DOBt8e9U.js";
2
- import { n as s, t as c } from "./agent-C1OQzBAm.js";
3
- import { A as l, h as u } from "./start-DtVlpt7p.js";
1
+ import { _ as e, a as t, c as n, d as r, f as i, m as a, u as o } from "./i18n-aVSu9TcJ.js";
2
+ import { n as s, t as c } from "./agent-MTQHr9ei.js";
3
+ import { A as l, h as u } from "./start-CV4j78_q.js";
4
4
  // src/ui/AgentSend.tsx
5
5
  var d = {
6
6
  cursor: "Cursor",
@@ -8,14 +8,14 @@ var d = {
8
8
  codex: "Codex"
9
9
  }, f = "commentkit:agent";
10
10
  function p({ client: p, threads: m, onDone: h, onError: g, onClose: _ }) {
11
- let [v, y] = i(null), b = a(null), x = a((e) => (b.current = e, l(e))).current, S = m.slice(0, 25);
12
- n(() => {
11
+ let [v, y] = e(null), b = a(null), x = a((e) => (b.current = e, l(e))).current, S = m.slice(0, 25);
12
+ r(() => {
13
13
  let e = !0;
14
14
  return Promise.all(S.map((e) => p.allMessages(e.id).then((t) => ({
15
15
  thread: e,
16
16
  messages: t
17
17
  })))).then((t) => e && y(t), (t) => e && (g(t), _())), () => void (e = !1);
18
- }, []), r(() => {
18
+ }, []), i(() => {
19
19
  v && b.current?.querySelector("[role=menuitem]")?.focus({ preventScroll: !0 });
20
20
  }, [!v]);
21
21
  let C = "copy";
@@ -27,21 +27,21 @@ function p({ client: p, threads: m, onDone: h, onError: g, onClose: _ }) {
27
27
  "claude",
28
28
  "codex",
29
29
  "copy"
30
- ], T = [C, ...w.filter((e) => e !== C)].filter((e) => w.includes(e)), E = (n) => {
30
+ ], T = [C, ...w.filter((e) => e !== C)].filter((e) => w.includes(e)), E = (e) => {
31
31
  if (!v) return;
32
32
  let r = s(v);
33
33
  navigator.clipboard?.writeText(r).catch(() => void 0);
34
34
  try {
35
- localStorage.setItem(f, n);
35
+ localStorage.setItem(f, e);
36
36
  } catch {}
37
- if (n === "copy") return h(e("agentCopied", v.length));
38
- let { url: i, complete: a } = c(n, v, r, p.state.get().session?.repository ?? null), o = document.createElement("a");
39
- o.href = i, o.rel = "noopener noreferrer", o.click(), h(t(a ? "agentOpened" : "agentOpenedShort", { agent: d[n] }));
37
+ if (e === "copy") return h(t("agentCopied", v.length));
38
+ let { url: i, complete: a } = c(e, v, r, p.state.get().session?.repository ?? null), o = document.createElement("a");
39
+ o.href = i, o.rel = "noopener noreferrer", o.click(), h(n(a ? "agentOpened" : "agentOpenedShort", { agent: d[e] }));
40
40
  };
41
41
  return /* @__PURE__ */ o("div", {
42
- class: "ck-menu ck-agent-menu",
42
+ class: "ck-menu ck-agent-menu ck-pop",
43
43
  role: "menu",
44
- "aria-label": t("sendToAgent"),
44
+ "aria-label": n("sendToAgent"),
45
45
  "aria-busy": !v,
46
46
  ref: x,
47
47
  onKeyDown: (e) => {
@@ -50,17 +50,17 @@ function p({ client: p, threads: m, onDone: h, onError: g, onClose: _ }) {
50
50
  children: [
51
51
  /* @__PURE__ */ o("div", {
52
52
  class: "ck-menu-head",
53
- children: v ? e("agentReady", v.length) : t("agentPreparing")
53
+ children: v ? t("agentReady", v.length) : n("agentPreparing")
54
54
  }),
55
55
  T.map((e) => /* @__PURE__ */ o("button", {
56
56
  role: "menuitem",
57
57
  "aria-disabled": !v || void 0,
58
58
  onClick: () => E(e),
59
- children: e === "copy" ? t("copyPrompt") : t("openIn", { agent: d[e] })
59
+ children: e === "copy" ? n("copyPrompt") : n("openIn", { agent: d[e] })
60
60
  })),
61
61
  m.length > 25 ? /* @__PURE__ */ o("p", {
62
62
  class: "ck-muted ck-agent-note",
63
- children: t("agentFirstOnly", { max: 25 })
63
+ children: n("agentFirstOnly", { max: 25 })
64
64
  }) : null
65
65
  ]
66
66
  });