@surething/cockpit 1.0.239 → 1.0.241

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 (56) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +4 -4
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next-prod/server/app/_global-error.html +1 -1
  7. package/.next-prod/server/app/_global-error.rsc +1 -1
  8. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next-prod/server/app/_not-found.html +2 -2
  16. package/.next-prod/server/app/_not-found.rsc +3 -3
  17. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  18. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  20. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next-prod/server/app/api/commands/route.js +1 -1
  24. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  25. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  26. package/.next-prod/server/app/api/sessions/route.js +1 -1
  27. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  28. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  29. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  30. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  31. package/.next-prod/server/app-paths-manifest.json +4 -4
  32. package/.next-prod/server/chunks/4848.js +33 -3
  33. package/.next-prod/server/chunks/9658.js +6 -6
  34. package/.next-prod/server/chunks/9830.js +1 -1
  35. package/.next-prod/server/middleware-build-manifest.js +1 -1
  36. package/.next-prod/server/pages/404.html +2 -2
  37. package/.next-prod/server/pages/500.html +1 -1
  38. package/.next-prod/server/server-reference-manifest.json +1 -1
  39. package/.next-prod/static/chunks/5408-e785cb62df051a22.js +25 -0
  40. package/.next-prod/static/chunks/9530-44f82b2151a66f3c.js +15 -0
  41. package/.next-prod/static/chunks/app/{layout-b8d5256d3bf96b1e.js → layout-fdd40a9f4769a9d2.js} +1 -1
  42. package/.next-prod/static/chunks/app/m/{page-149145e4714873de.js → page-54053828af79704f.js} +1 -1
  43. package/.next-prod/static/chunks/app/{page-497c9c5c75bf40f2.js → page-7e283c0e1ba7bf80.js} +1 -1
  44. package/.next-prod/static/chunks/app/project/{page-497c9c5c75bf40f2.js → page-7e283c0e1ba7bf80.js} +1 -1
  45. package/.next-prod/static/css/9f26a08be661160a.css +1 -0
  46. package/.next-prod/trace +13 -13
  47. package/.next-prod/trace-build +1 -1
  48. package/dist/{chunk-MNMFPTV4.mjs → chunk-JDX7Z54G.mjs} +58 -30
  49. package/dist/scheduledTasks.mjs +36 -1
  50. package/dist/wsServer.mjs +1 -1
  51. package/package.json +1 -1
  52. package/.next-prod/static/chunks/5408-f7b9470b57c6690e.js +0 -25
  53. package/.next-prod/static/chunks/543-9c1455693df33cd1.js +0 -15
  54. package/.next-prod/static/css/5b0dd8036a3ffc10.css +0 -1
  55. /package/.next-prod/static/{c1JrZ4eVs2JR2ujEC_UrJ → x_Nlb9WAVX__4ygoUBUWt}/_buildManifest.js +0 -0
  56. /package/.next-prod/static/{c1JrZ4eVs2JR2ujEC_UrJ → x_Nlb9WAVX__4ygoUBUWt}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":16919234,"timestamp":191907680,"id":14,"parentId":1,"tags":{},"startTime":1783597477376,"traceId":"35125c29bd3037f0"},{"name":"run-typescript","duration":13939603,"timestamp":208840441,"id":1630,"parentId":1,"tags":{},"startTime":1783597494309,"traceId":"35125c29bd3037f0"},{"name":"static-check","duration":801105,"timestamp":222817702,"id":1633,"parentId":1,"tags":{},"startTime":1783597508286,"traceId":"35125c29bd3037f0"},{"name":"static-generation","duration":4379333,"timestamp":223910526,"id":1911,"parentId":1,"tags":{},"startTime":1783597509379,"traceId":"35125c29bd3037f0"},{"name":"collect-build-traces","duration":13989328,"timestamp":223619417,"id":1908,"parentId":1,"tags":{},"startTime":1783597509088,"traceId":"35125c29bd3037f0"},{"name":"telemetry-flush","duration":43,"timestamp":237611897,"id":1920,"parentId":1,"tags":{},"startTime":1783597523080,"traceId":"35125c29bd3037f0"},{"name":"next-build","duration":45825290,"timestamp":191786660,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1783597477255,"traceId":"35125c29bd3037f0"}]
1
+ [{"name":"run-webpack","duration":20941601,"timestamp":153035611,"id":14,"parentId":1,"tags":{},"startTime":1783860627367,"traceId":"ab55847427515199"},{"name":"run-typescript","duration":19490937,"timestamp":173981362,"id":1630,"parentId":1,"tags":{},"startTime":1783860648312,"traceId":"ab55847427515199"},{"name":"static-check","duration":1228750,"timestamp":193519852,"id":1633,"parentId":1,"tags":{},"startTime":1783860667851,"traceId":"ab55847427515199"},{"name":"static-generation","duration":7033939,"timestamp":194897471,"id":1911,"parentId":1,"tags":{},"startTime":1783860669228,"traceId":"ab55847427515199"},{"name":"collect-build-traces","duration":21350217,"timestamp":194749213,"id":1908,"parentId":1,"tags":{},"startTime":1783860669080,"traceId":"ab55847427515199"},{"name":"telemetry-flush","duration":60,"timestamp":216103438,"id":1920,"parentId":1,"tags":{},"startTime":1783860690434,"traceId":"ab55847427515199"},{"name":"next-build","duration":63248768,"timestamp":152854744,"id":1,"tags":{"buildMode":"default","version":"16.2.6","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1783860627186,"traceId":"ab55847427515199"}]
@@ -101,6 +101,43 @@ async function sendPushNotification(payload) {
101
101
  return { sent, pruned: dead.length };
102
102
  }
103
103
 
104
+ // packages/feature/agent/src/server/sessionTitle.ts
105
+ function filterCommandTags(text) {
106
+ const argsMatch = text.match(/<command-args>([^<]*)<\/command-args>/);
107
+ if (argsMatch && argsMatch[1].trim()) {
108
+ return argsMatch[1].trim();
109
+ }
110
+ const nameMatch = text.match(/<command-name>([^<]*)<\/command-name>/);
111
+ if (nameMatch && nameMatch[1].trim()) {
112
+ return nameMatch[1].trim();
113
+ }
114
+ let filtered = text.replace(/<command-message>[^<]*<\/command-message>/g, "");
115
+ filtered = filtered.replace(/<command-name>[^<]*<\/command-name>/g, "");
116
+ filtered = filtered.replace(/<command-args>[^<]*<\/command-args>/g, "");
117
+ filtered = filtered.replace(/<local-command-stdout>[\s\S]*?<\/local-command-stdout>/g, "");
118
+ filtered = filtered.replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g, "");
119
+ return filtered.trim();
120
+ }
121
+ function generateTitle(aiTitle, summary, userMessages) {
122
+ if (aiTitle) return aiTitle;
123
+ if (summary) return summary;
124
+ let commandName = "";
125
+ for (const msg of userMessages) {
126
+ const filtered = filterCommandTags(msg);
127
+ if (!filtered) continue;
128
+ if (filtered.startsWith("/") && !commandName) {
129
+ commandName = filtered;
130
+ continue;
131
+ }
132
+ if (commandName) {
133
+ return `${commandName} ${filtered}`;
134
+ }
135
+ return filtered;
136
+ }
137
+ if (commandName) return commandName;
138
+ return "Untitled Session";
139
+ }
140
+
104
141
  // packages/feature/agent/src/server/state/globalState.ts
105
142
  var MAX_SESSIONS = 100;
106
143
  var MIN_SESSIONS = 15;
@@ -226,17 +263,17 @@ async function getSessionContent(cwd, sessionId) {
226
263
  if (existsSync(ollamaPath)) return getClaudeStyleContent(ollamaPath);
227
264
  const codexPath = findCodexSessionPath(sessionId);
228
265
  if (codexPath && existsSync(codexPath)) {
229
- return { summary: "", messages: await getCodexUserMessages(codexPath) };
266
+ return { aiTitle: "", summary: "", messages: await getCodexUserMessages(codexPath) };
230
267
  }
231
268
  const kimiPath = findKimiSessionPath(sessionId);
232
269
  if (kimiPath && existsSync(kimiPath)) {
233
- return { summary: "", messages: await getKimiUserMessages(kimiPath) };
270
+ return { aiTitle: "", summary: "", messages: await getKimiUserMessages(kimiPath) };
234
271
  }
235
- return { summary: "", messages: [] };
272
+ return { aiTitle: "", summary: "", messages: [] };
236
273
  }
237
274
  async function getSessionPreview(cwd, sessionId) {
238
- const { summary, messages } = await getSessionContent(cwd, sessionId);
239
- const title = generateTitle(summary, messages);
275
+ const { aiTitle, summary, messages } = await getSessionContent(cwd, sessionId);
276
+ const title = generateTitle(aiTitle, summary, messages);
240
277
  const lastUserMessage = messages[messages.length - 1];
241
278
  const searchText = [summary, ...messages].join("\n").toLowerCase();
242
279
  if (messages.length <= SUMMARY_THRESHOLD) {
@@ -277,7 +314,7 @@ async function getGlobalSessionsSnapshot(limit = 15) {
277
314
  })
278
315
  );
279
316
  }
280
- function filterCommandTags(text) {
317
+ function filterCommandTags2(text) {
281
318
  let filtered = text.replace(/<command-[^>]*>[\s\S]*?<\/command-[^>]*>/g, "");
282
319
  filtered = filtered.replace(/<local-command-[^>]*>[\s\S]*?<\/local-command-[^>]*>/g, "");
283
320
  filtered = filtered.trim();
@@ -293,12 +330,16 @@ async function getClaudeStyleTitle(filePath) {
293
330
  try {
294
331
  const fileStream = createReadStream(filePath);
295
332
  const rl = createInterface({ input: fileStream, crlfDelay: Infinity });
333
+ let aiTitle = "";
296
334
  let summary = "";
297
335
  const userMessages = [];
298
336
  for await (const line of rl) {
299
337
  if (!line.trim()) continue;
300
338
  try {
301
339
  const entry = JSON.parse(line);
340
+ if (entry.type === "ai-title" && entry.aiTitle) {
341
+ aiTitle = entry.aiTitle;
342
+ }
302
343
  if (entry.type === "summary" && entry.summary) {
303
344
  summary = entry.summary;
304
345
  }
@@ -316,7 +357,7 @@ async function getClaudeStyleTitle(filePath) {
316
357
  } catch {
317
358
  }
318
359
  }
319
- return generateTitle(summary, userMessages);
360
+ return generateTitle(aiTitle, summary, userMessages);
320
361
  } catch {
321
362
  return "Untitled Session";
322
363
  }
@@ -345,7 +386,7 @@ async function getClaudeStyleUserMessages(filePath) {
345
386
  }
346
387
  }
347
388
  if (!text) continue;
348
- const filtered = filterCommandTags(text);
389
+ const filtered = filterCommandTags2(text);
349
390
  if (filtered && isValidUserMessage(filtered)) {
350
391
  messages.push(filtered);
351
392
  }
@@ -357,6 +398,7 @@ async function getClaudeStyleUserMessages(filePath) {
357
398
  return messages;
358
399
  }
359
400
  async function getClaudeStyleContent(filePath) {
401
+ let aiTitle = "";
360
402
  let summary = "";
361
403
  const messages = [];
362
404
  try {
@@ -366,6 +408,10 @@ async function getClaudeStyleContent(filePath) {
366
408
  if (!line.trim()) continue;
367
409
  try {
368
410
  const entry = JSON.parse(line);
411
+ if (entry.type === "ai-title" && entry.aiTitle) {
412
+ aiTitle = entry.aiTitle;
413
+ continue;
414
+ }
369
415
  if (entry.type === "summary" && entry.summary) {
370
416
  summary = entry.summary;
371
417
  continue;
@@ -385,7 +431,7 @@ async function getClaudeStyleContent(filePath) {
385
431
  }
386
432
  }
387
433
  if (!text) continue;
388
- const filtered = filterCommandTags(text);
434
+ const filtered = filterCommandTags2(text);
389
435
  if (filtered && isValidUserMessage(filtered)) {
390
436
  messages.push(filtered);
391
437
  }
@@ -394,7 +440,7 @@ async function getClaudeStyleContent(filePath) {
394
440
  }
395
441
  } catch {
396
442
  }
397
- return { summary, messages };
443
+ return { aiTitle, summary, messages };
398
444
  }
399
445
  async function getCodexUserMessages(filePath) {
400
446
  const messages = [];
@@ -414,7 +460,7 @@ async function getCodexUserMessages(filePath) {
414
460
  if (!payload || payload.type !== "message" || payload.role !== "user") continue;
415
461
  const text = payload.content?.filter((c) => c.type === "input_text" && c.text).map((c) => c.text).join("") || "";
416
462
  if (!text || text.startsWith("<") || text.startsWith("#")) continue;
417
- const filtered = filterCommandTags(text);
463
+ const filtered = filterCommandTags2(text);
418
464
  if (filtered && isValidUserMessage(filtered)) {
419
465
  messages.push(filtered);
420
466
  }
@@ -465,7 +511,7 @@ async function getKimiUserMessages(filePath) {
465
511
  if (!text || text.startsWith("<system") || text.startsWith("<environment") || text.startsWith("# AGENTS.md") || text.startsWith("<permissions")) {
466
512
  continue;
467
513
  }
468
- const filtered = filterCommandTags(text);
514
+ const filtered = filterCommandTags2(text);
469
515
  if (filtered && isValidUserMessage(filtered)) {
470
516
  messages.push(filtered);
471
517
  }
@@ -498,24 +544,6 @@ async function getKimiTitle(filePath) {
498
544
  return void 0;
499
545
  }
500
546
  }
501
- function generateTitle(summary, userMessages) {
502
- if (summary) return summary;
503
- let commandName = "";
504
- for (const msg of userMessages) {
505
- const filtered = filterCommandTags(msg);
506
- if (!filtered) continue;
507
- if (filtered.startsWith("/") && !commandName) {
508
- commandName = filtered;
509
- continue;
510
- }
511
- if (commandName) {
512
- return `${commandName} ${filtered}`;
513
- }
514
- return filtered;
515
- }
516
- if (commandName) return commandName;
517
- return "Untitled Session";
518
- }
519
547
 
520
548
  // packages/feature/agent/src/server/sessionRunHub.ts
521
549
  var GRACE_MS = 6e4;
@@ -10,7 +10,7 @@ import {
10
10
  setRunAbort,
11
11
  startRun,
12
12
  updateGlobalState
13
- } from "./chunk-MNMFPTV4.mjs";
13
+ } from "./chunk-JDX7Z54G.mjs";
14
14
  import {
15
15
  AgentError,
16
16
  AppRuntime,
@@ -150,6 +150,40 @@ function snapshotOnRunEvent(cwd, sessionKey, provider, event) {
150
150
  import { mkdirSync, writeFileSync, readFileSync } from "fs";
151
151
  import { join } from "path";
152
152
 
153
+ // packages/feature/agent/src/server/lib/apPrompt.ts
154
+ var AP_PROMPT_ZH = `---
155
+ name: ap
156
+ description: "apply\uFF1A\u5B9E\u73B0 <SPEC>\uFF0C\u5E76\u5728\u5B9E\u73B0\u8FC7\u7A0B\u4E2D\u6301\u7EED\u7EF4\u62A4\u4E00\u4EFD apply-notes HTML \u6587\u4EF6\uFF08\u653E\u5728\u4E34\u65F6\u76EE\u5F55\uFF09\uFF0C\u8BB0\u5F55\u89C4\u683C\u672A\u8986\u76D6\u7684\u51B3\u7B56\u3001\u6539\u52A8\u4E0E\u6743\u8861\u3002"
157
+ argument-hint: "[SPEC \u8DEF\u5F84 / \u7559\u7A7A = \u672C\u6B21\u5BF9\u8BDD\u4E2D\u5DF2\u8FBE\u6210\u4E00\u81F4\u7684 spec]"
158
+ ---
159
+
160
+ \u5B9E\u73B0 <SPEC>\uFF1B\u5728\u5B9E\u73B0\u8FC7\u7A0B\u4E2D\uFF0C\u6301\u7EED\u7EF4\u62A4\u4E00\u4E2A apply-notes.html \u6587\u4EF6\uFF0C\u8BB0\u5F55\u90A3\u4E9B
161
+ \u89C4\u683C\u91CC\u6CA1\u6709\u3001\u4F46\u4F60\u4E0D\u5F97\u4E0D\u505A\u7684\u51B3\u7B56\uFF0C\u4E0D\u5F97\u4E0D\u6539\u7684\u4E1C\u897F\uFF0C\u4E0D\u5F97\u4E0D\u505A\u7684\u6743\u8861\uFF0C\u4EE5\u53CA\u4EFB\u4F55
162
+ \u6211\u5E94\u8BE5\u77E5\u9053\u7684\u4E8B\u60C5\u3002\u5B83\u4E0D\u662F\u5DE5\u4F5C\u65E5\u5FD7\u2014\u2014\u6D4B\u8BD5\u901A\u8FC7\u3001\u6784\u5EFA\u53D8\u7EFF\u8FD9\u7C7B\u5E38\u89C4\u8FDB\u5C55\u4E0D\u8BE5\u5199\u8FDB\u53BB\u3002
163
+
164
+ \u6587\u4EF6\u653E\u5728 \`\${TMPDIR%/}/apply-notes-<feature-name>.html\`\uFF0C\u7EDD\u4E0D\u653E\u8FDB\u4ED3\u5E93\u91CC\uFF0C
165
+ \u6BCF\u4E2A\u9700\u6C42\u4E00\u4E2A\u6587\u4EF6\uFF1A\u5F53\u67D0\u4E00\u8F6E\u662F\u5728\u5EF6\u7EED\u540C\u4E00\u4E2A\u4EFB\u52A1\u65F6\uFF0C\u5728\u5DF2\u6709\u6587\u4EF6\u91CC\u65B0\u8D77\u4E00\u4E2A round
166
+ \u5C0F\u8282\u8FFD\u52A0\uFF0C\u800C\u4E0D\u662F\u65B0\u5EFA\u4E00\u4E2A\uFF1B\u53EA\u6709\u65B0\u9700\u6C42\u624D\u65B0\u5EFA\u6587\u4EF6\u3002\u59CB\u7EC8\u7528 Edit \u5DE5\u5177\u66F4\u65B0\u5B83
167
+ \uFF08\u4EC5\u9996\u6B21\u521B\u5EFA\u65F6\u7528 Write\uFF09\uFF0C\u7EDD\u4E0D\u901A\u8FC7 shell \u91CD\u5B9A\u5411\u5199\u5165\u3002`;
168
+ var AP_PROMPT_EN = `---
169
+ name: ap
170
+ description: "apply: implement <SPEC> while keeping a running apply-notes HTML file (in temp dir) of decisions not covered by the spec, changes, and tradeoffs."
171
+ argument-hint: "[SPEC path / empty = spec agreed in this conversation]"
172
+ ---
173
+
174
+ Implement <SPEC>; and while you do, keep a running apply-notes.html file
175
+ with decisions you had to make that weren't in the spec, things you had
176
+ to change, tradeoffs you had to make, or anything else I should know.
177
+ It is not a work log \u2014 routine progress like tests passing or builds
178
+ going green doesn't belong in it.
179
+
180
+ Keep the file at \`\${TMPDIR%/}/apply-notes-<feature-name>.html\`, never
181
+ inside the repo, one file per requirement: when a round continues the
182
+ same task, append to the existing file under a new round heading rather
183
+ than starting a fresh one; only a new requirement gets a new file.
184
+ Always update it with the Edit tool (Write only when first creating it),
185
+ never through shell redirection.`;
186
+
153
187
  // packages/feature/agent/src/server/lib/ccPrompt.ts
154
188
  var CC_LABEL_ZH = "\u4EFB\u52A1\uFF1A";
155
189
  var CC_LABEL_EN = "Task: ";
@@ -1650,6 +1684,7 @@ When done, briefly report: skill slug, source path (\`<skills-dir>/<slug>/SKILL.
1650
1684
  // packages/feature/agent/src/server/lib/slashCommands.ts
1651
1685
  var COMMAND_CONTENT = {
1652
1686
  qa: { zh: QA_PROMPT_ZH, en: QA_PROMPT_EN },
1687
+ ap: { zh: AP_PROMPT_ZH, en: AP_PROMPT_EN },
1653
1688
  fx: { zh: FX_PROMPT_ZH, en: FX_PROMPT_EN },
1654
1689
  ex: { zh: EX_PROMPT_ZH, en: EX_PROMPT_EN },
1655
1690
  go: { zh: GO_PROMPT_ZH, en: GO_PROMPT_EN },
package/dist/wsServer.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  addRunListener,
3
3
  getGlobalSessionsSnapshot,
4
4
  getRunSnapshot
5
- } from "./chunk-MNMFPTV4.mjs";
5
+ } from "./chunk-JDX7Z54G.mjs";
6
6
  import {
7
7
  addExitListener,
8
8
  addOutputListener,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surething/cockpit",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
4
4
  "description": "The open-source Claude Code GUI — an IDE-like workbench for parallel AI coding. Drive Claude (default), Codex, DeepSeek, Kimi, or local Ollama in tabs. Terminal, browser & DB bubbles, code review. Self-host on a shared dev box — a seat for every teammate. Local-first, MIT.",
5
5
  "author": "Robert",
6
6
  "license": "MIT",