claude-code-session-manager 0.138.0 → 0.139.0
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +339 -82
- package/dist/assets/{AppSettings-CgDhqrsU.js → AppSettings-CUfWY9vN.js} +2 -2
- package/dist/assets/History-DDnqaLyw.js +2 -0
- package/dist/assets/HomeClaudeConfig-CGD2Onjv.js +3 -0
- package/dist/assets/{Panel-CeDiyuNn.js → Panel-Csyd9HbD.js} +1 -1
- package/dist/assets/ProjectClaudeConfig-C-jlYpC_.js +26 -0
- package/dist/assets/{Scheduler-CkhTvG7C.js → Scheduler-NLs08fx7.js} +9 -9
- package/dist/assets/{SkillReferenceGraph-CFMK8NJh.js → SkillReferenceGraph-DcscPXAG.js} +1 -1
- package/dist/assets/Skills-BpGRKOcY.js +67 -0
- package/dist/assets/{TiptapBody-D1kTj-tn.js → TiptapBody-DSU3769X.js} +60 -54
- package/dist/assets/ViewTabs-C0PRZx4_.js +1 -0
- package/dist/assets/{VoiceButton-CZeyPM31.js → VoiceButton-D2rMurNg.js} +1 -1
- package/dist/assets/{historyTotals-B00l64Jw.js → historyTotals-TcIQs2sh.js} +1 -1
- package/dist/assets/{index-62tyjEQB.css → index-BCySPdtU.css} +1 -1
- package/dist/assets/{index-CgCxpunJ.js → index-C-d0DCre.js} +523 -515
- package/dist/index.html +2 -2
- package/dist-web/app.css +1 -1
- package/dist-web/app.js +469 -450
- package/package.json +13 -5
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/builder/SKILL.md +12 -4
- package/plugins/session-manager-dev/skills/builder/scripts/publish-preflight.cjs +255 -0
- package/plugins/session-manager-dev/skills/develop/SKILL.md +12 -5
- package/scripts/README.md +1 -0
- package/scripts/scheduler-mcp-server.cjs +161 -18
- package/src/main/build-info.json +4 -4
- package/src/main/chatRunner.cjs +2 -2
- package/src/main/exchanges.cjs +70 -5
- package/src/main/historyAggregator.cjs +84 -58
- package/src/main/historyDashboard.cjs +18 -13
- package/src/main/index.cjs +22 -2
- package/src/main/ipcSchemas.cjs +122 -5
- package/src/main/lib/claude/effectiveModelInfo.cjs +2 -2
- package/src/main/lib/claude/modelPricing.cjs +148 -0
- package/src/main/lib/epic/epicAdminRoutes.cjs +101 -0
- package/src/main/lib/epic/epicJobReceipt.cjs +87 -0
- package/src/main/lib/epic/epicOutsideRead.cjs +306 -0
- package/src/main/lib/epic/epicOutsideState.cjs +233 -0
- package/src/main/lib/epic/epicSettle.cjs +1 -1
- package/src/main/lib/epic/epicStateWatcher.cjs +157 -0
- package/src/main/lib/epic/externalRef.cjs +37 -0
- package/src/main/lib/epic/externalRefIndex.cjs +136 -0
- package/src/main/lib/epic/restorableSessions.cjs +151 -17
- package/src/main/lib/epic/transcriptUsage.cjs +197 -0
- package/src/main/lib/externalContract.cjs +111 -0
- package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +121 -4
- package/src/main/lib/feedback-remote/crossProjectReply.cjs +83 -1
- package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +16 -6
- package/src/main/lib/feedback-remote/customerFeedbackClient.cjs +50 -8
- package/src/main/lib/feedback-remote/customerFeedbackInbox.cjs +218 -4
- package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +19 -3
- package/src/main/lib/feedback-remote/feedbackImages.cjs +171 -0
- package/src/main/lib/feedback-remote/localAdminHttp.cjs +11 -10
- package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +120 -2
- package/src/main/lib/feedback-remote/needsYouAdminRoutes.cjs +133 -0
- package/src/main/lib/feedback-remote/needsYouIpc.cjs +50 -0
- package/src/main/lib/feedback-remote/needsYouStore.cjs +281 -0
- package/src/main/lib/historyRollup.cjs +32 -5
- package/src/main/lib/mcpToolCatalog.cjs +111 -14
- package/src/main/lib/persona-macro/agentAdminRoutes.cjs +121 -0
- package/src/main/lib/promptSessionSchema.cjs +4 -0
- package/src/main/lib/remoteTranscriptTail.cjs +32 -1
- package/src/main/lib/scheduler/schedulerPaths.cjs +9 -0
- package/src/main/lib/telemetry/auditEvents.cjs +176 -0
- package/src/main/lib/telemetry/eventsAdminRoutes.cjs +45 -0
- package/src/main/loopEfficiencyHandlers.cjs +1 -1
- package/src/main/scheduler.cjs +29 -0
- package/src/main/templates/PRD_AUTHORING.md +1 -0
- package/src/main/transcripts.cjs +62 -7
- package/src/main/webRemote.cjs +122 -18
- package/src/preload/api.d.ts +71 -8
- package/src/preload/apiSurface.cjs +7 -0
- package/src/preload/apiSurface.json +408 -83
- package/src/preload/index.cjs +15 -3
- package/dist/assets/AgentLibrary-C1d_D7uQ.js +0 -2
- package/dist/assets/Button-Bk23rEnZ.js +0 -1
- package/dist/assets/DocumentEditorPane-BqY5Nq6W.js +0 -1
- package/dist/assets/Extensions-CXem-uwI.js +0 -2
- package/dist/assets/History-BwO3coo4.js +0 -2
- package/dist/assets/Library-BDV69fSe.js +0 -32
- package/dist/assets/ListDetail-CD-Fm6mh.js +0 -1
- package/dist/assets/ProjectClaudeConfig-NjdKdwe8.js +0 -25
- package/dist/assets/ProvenanceBadge-Bu8NmI_R.js +0 -1
- package/dist/assets/Settings-COT34hBF.js +0 -2
- package/dist/assets/Skills-BgexoUkQ.js +0 -29
- package/dist/assets/SourceChip-BXjcdeb1.js +0 -1
- package/dist/assets/SystemPrompt-CeeH3EeW.js +0 -1
- package/dist/assets/Toggle-CENi19iK.js +0 -1
- package/dist/assets/ViewTabs-DDBb0x96.js +0 -1
- package/dist/assets/claude-settings-schema-COigsajx.js +0 -3
|
@@ -25,7 +25,12 @@
|
|
|
25
25
|
* macro_delete({ id }) -> POST /admin/macros/delete
|
|
26
26
|
* customer_feedback_list({ pull?, includeHidden? }) -> GET /admin/customer-feedback/inbox
|
|
27
27
|
* customer_feedback_set_status({ id, status, note? }) -> POST /admin/customer-feedback/status
|
|
28
|
-
* customer_feedback_submit({
|
|
28
|
+
* customer_feedback_submit({ goal, description, tag, imagePaths? }) -> POST /admin/customer-feedback/submit
|
|
29
|
+
*
|
|
30
|
+
* epic_list({ cwd, state?, limit?, offset? }) -> GET /admin/epics?cwd=<encoded>&...
|
|
31
|
+
* epic_get({ cwd, id? | externalRef?, receipt? }) -> GET /admin/epic?cwd=<encoded>&(id|externalRef)=...[&receipt=1]
|
|
32
|
+
*
|
|
33
|
+
* agent_list({ cwd? }) -> GET /admin/agents[?cwd=<encoded>]
|
|
29
34
|
*
|
|
30
35
|
* This is a separate process from the Electron app — it only ever reaches
|
|
31
36
|
* it over the token-authed loopback HTTP API in admin-api.json, never by
|
|
@@ -46,6 +51,7 @@ const fsp = require('node:fs/promises');
|
|
|
46
51
|
const { createStdioServer } = require('../src/main/lib/mcpStdioServer.cjs');
|
|
47
52
|
const { PRD_WORK_TYPES } = require('../src/main/lib/prd/workTypeLibrary.cjs');
|
|
48
53
|
const { MCP_TOOL_CATALOG, MCP_RECIPES, composeDescription } = require('../src/main/lib/mcpToolCatalog.cjs');
|
|
54
|
+
const { EPIC_OUTSIDE_STATES } = require('../src/main/lib/epic/epicOutsideState.cjs');
|
|
49
55
|
|
|
50
56
|
const CATALOG_BY_NAME = new Map(MCP_TOOL_CATALOG.map((entry) => [entry.name, entry]));
|
|
51
57
|
|
|
@@ -168,12 +174,34 @@ function resolveCwdArg(args) {
|
|
|
168
174
|
return process.env.SM_PROJECT_ROOT || process.cwd();
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
// This server
|
|
172
|
-
//
|
|
177
|
+
// This server's package.json version. When it runs from a source checkout
|
|
178
|
+
// that number does not identify the code (the checkout can be far past the
|
|
179
|
+
// release it names), so the unknown-route message below never treats it as
|
|
180
|
+
// proof that a restart helps.
|
|
173
181
|
const MCP_SERVER_VERSION = (() => {
|
|
174
182
|
try { return require('../package.json').version; } catch { return 'unknown'; }
|
|
175
183
|
})();
|
|
176
184
|
|
|
185
|
+
// True when the package root holding this script has a .git entry (a folder
|
|
186
|
+
// in a clone, a file in a git worktree). Existence check only; no git spawn.
|
|
187
|
+
const MCP_SERVER_FROM_CHECKOUT = (() => {
|
|
188
|
+
try { return require('node:fs').existsSync(path.join(__dirname, '..', '.git')); } catch { return false; }
|
|
189
|
+
})();
|
|
190
|
+
|
|
191
|
+
// Numeric compare of dotted versions; anything after a hyphen is ignored.
|
|
192
|
+
// Returns <0, 0 or >0, or NaN when either side has no usable number.
|
|
193
|
+
function compareVersions(a, b) {
|
|
194
|
+
const parse = (v) => String(v).split('-')[0].split('.').map((n) => Number(n));
|
|
195
|
+
const pa = parse(a);
|
|
196
|
+
const pb = parse(b);
|
|
197
|
+
if (pa.some(Number.isNaN) || pb.some(Number.isNaN)) return NaN;
|
|
198
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i += 1) {
|
|
199
|
+
const d = (pa[i] || 0) - (pb[i] || 0);
|
|
200
|
+
if (d !== 0) return d;
|
|
201
|
+
}
|
|
202
|
+
return 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
177
205
|
// The transport's own unknown-route 404 (localAdminHttp handleRequest). Apps
|
|
178
206
|
// up to v0.136.2 send exactly { ok:false, error:'not found' }; newer ones add
|
|
179
207
|
// unknownRoute. Route handlers' own 'not found' replies use HTTP 200
|
|
@@ -185,15 +213,31 @@ function isUnknownRouteReply(status, body) {
|
|
|
185
213
|
return Object.keys(body).length === 2 && body.error === 'not found';
|
|
186
214
|
}
|
|
187
215
|
|
|
216
|
+
// Pure: states only what is known, and picks the advice from evidence.
|
|
217
|
+
function unknownRouteMessage({ method, pathname, appVersion, serverVersion, fromCheckout }) {
|
|
218
|
+
const appLabel = appVersion ? `v${appVersion}` : 'version not reported';
|
|
219
|
+
const head = `the running Session Manager app (${appLabel}) has no route ${method} ${pathname}. `
|
|
220
|
+
+ `This MCP server is v${serverVersion}.`;
|
|
221
|
+
if (fromCheckout) {
|
|
222
|
+
return `${head} This MCP server runs from a source checkout, so its version number does not say which code it has. `
|
|
223
|
+
+ 'The route may not be in any published release yet. '
|
|
224
|
+
+ 'Restarting the app helps only once a release containing this route is installed.';
|
|
225
|
+
}
|
|
226
|
+
const cmp = appVersion ? compareVersions(appVersion, serverVersion) : -1;
|
|
227
|
+
if (!appVersion || cmp < 0) {
|
|
228
|
+
return `${head} The app is older than this MCP server. `
|
|
229
|
+
+ "Restart Session Manager (Command Palette: 'Reboot app (drain first)') and call again.";
|
|
230
|
+
}
|
|
231
|
+
return `${head} A restart alone will not help. `
|
|
232
|
+
+ 'Session Manager must be updated to a build that has this route.';
|
|
233
|
+
}
|
|
234
|
+
|
|
188
235
|
function unknownRouteError(method, urlPath, body) {
|
|
189
236
|
const pathname = String(urlPath).split('?')[0];
|
|
190
|
-
const appVersion = body && typeof body.appVersion === 'string' && body.appVersion
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
+ `this MCP server (v${MCP_SERVER_VERSION}). Restart Session Manager (Command Palette: 'Reboot app (drain first)') `
|
|
195
|
-
+ 'and call again.',
|
|
196
|
-
);
|
|
237
|
+
const appVersion = body && typeof body.appVersion === 'string' && body.appVersion ? body.appVersion : null;
|
|
238
|
+
const err = new Error(unknownRouteMessage({
|
|
239
|
+
method, pathname, appVersion, serverVersion: MCP_SERVER_VERSION, fromCheckout: MCP_SERVER_FROM_CHECKOUT,
|
|
240
|
+
}));
|
|
197
241
|
// Tagged so callers can add a tool-specific hint (feedback_reply does).
|
|
198
242
|
err.code = 'SM_UNKNOWN_ROUTE';
|
|
199
243
|
return err;
|
|
@@ -392,6 +436,44 @@ const TOOLS = [
|
|
|
392
436
|
},
|
|
393
437
|
},
|
|
394
438
|
},
|
|
439
|
+
{
|
|
440
|
+
name: 'epic_list',
|
|
441
|
+
description: descriptionFor('epic_list'),
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: 'object',
|
|
444
|
+
properties: {
|
|
445
|
+
cwd: { type: 'string', description: 'Absolute path of the project whose open Epics to list' },
|
|
446
|
+
state: { type: 'string', enum: [...EPIC_OUTSIDE_STATES], description: 'Optional: only Epics in this outside-facing state' },
|
|
447
|
+
limit: { type: 'number', description: 'Optional: page size, default 50, max 200' },
|
|
448
|
+
offset: { type: 'number', description: 'Optional: page offset, default 0' },
|
|
449
|
+
},
|
|
450
|
+
required: ['cwd'],
|
|
451
|
+
},
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: 'agent_list',
|
|
455
|
+
description: descriptionFor('agent_list'),
|
|
456
|
+
inputSchema: {
|
|
457
|
+
type: 'object',
|
|
458
|
+
properties: {
|
|
459
|
+
cwd: { type: 'string', description: "Optional: absolute project path; when given, each agent also carries the model and effort it resolves to there" },
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: 'epic_get',
|
|
465
|
+
description: descriptionFor('epic_get'),
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
properties: {
|
|
469
|
+
cwd: { type: 'string', description: 'Absolute path of the project the Epic belongs to' },
|
|
470
|
+
id: { type: 'string', description: 'The Epic id. Give exactly one of id / externalRef.' },
|
|
471
|
+
externalRef: { type: 'string', description: 'The external reference the Epic was opened with. Give exactly one of id / externalRef.' },
|
|
472
|
+
receipt: { type: 'boolean', description: 'Optional: when true, the answer also carries epic.receipt, what the Epic cost in jobs and chat.' },
|
|
473
|
+
},
|
|
474
|
+
required: ['cwd'],
|
|
475
|
+
},
|
|
476
|
+
},
|
|
395
477
|
{
|
|
396
478
|
name: 'scheduler_get_prd',
|
|
397
479
|
description: descriptionFor('scheduler_get_prd'),
|
|
@@ -569,6 +651,15 @@ const TOOLS = [
|
|
|
569
651
|
type: 'string',
|
|
570
652
|
description: "Required with autoStart. Copy VERBATIM from the human's own message in this conversation; the quoted words themselves must name the target project. Do not paraphrase or write it yourself.",
|
|
571
653
|
},
|
|
654
|
+
externalRef: {
|
|
655
|
+
type: 'string',
|
|
656
|
+
description: 'Optional: your own id for this handoff, 1 to 200 characters of letters, digits or . _ : / @ - (trimmed). It is stored on the new session and returned. Repeating a call with the same toCwd, fromCwd and externalRef opens nothing new and returns the session that already exists (status "existing", existing: true); the same externalRef already used by a different sender is refused with 409.',
|
|
657
|
+
},
|
|
658
|
+
replyMode: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
enum: ['prompt', 'event'],
|
|
661
|
+
description: "Optional: how a reply comes back — 'prompt' (default) wakes your chat session, 'event' records it as data in the audit log for a caller with no chat.",
|
|
662
|
+
},
|
|
572
663
|
},
|
|
573
664
|
required: ['toCwd', 'fromCwd', 'title', 'motivation', 'acceptanceCriteria', 'body'],
|
|
574
665
|
},
|
|
@@ -781,11 +872,17 @@ const TOOLS = [
|
|
|
781
872
|
inputSchema: {
|
|
782
873
|
type: 'object',
|
|
783
874
|
properties: {
|
|
784
|
-
|
|
785
|
-
|
|
875
|
+
goal: { type: 'string', description: 'One line, max 120 chars: what the human wants or what went wrong. Show it to the human before calling.' },
|
|
876
|
+
description: { type: 'string', description: 'Details, max 4000 chars: what happened, what was expected, steps. No secrets, tokens, customer data or private file contents.' },
|
|
786
877
|
tag: { type: 'string', enum: ['bug', 'feature', 'discussion'], description: 'Kind of feedback.' },
|
|
878
|
+
imagePaths: {
|
|
879
|
+
type: 'array',
|
|
880
|
+
items: { type: 'string' },
|
|
881
|
+
maxItems: 5,
|
|
882
|
+
description: 'Optional: absolute paths of up to 5 PNG, JPEG, WebP or GIF images the human asked to include — for example the Attached: <path> lines of images pasted into this chat. Images are sent as-is; large PNG/JPEG are downscaled; anything that is not an image is refused.',
|
|
883
|
+
},
|
|
787
884
|
},
|
|
788
|
-
required: ['
|
|
885
|
+
required: ['goal', 'description', 'tag'],
|
|
789
886
|
},
|
|
790
887
|
},
|
|
791
888
|
{
|
|
@@ -851,7 +948,7 @@ function macroDeleteRefusal() {
|
|
|
851
948
|
function customerFeedbackSubmitRefusal() {
|
|
852
949
|
return humanSessionRefusal(
|
|
853
950
|
'refused: customer_feedback_submit runs only in a Session Manager chat or terminal session, because feedback is sent only when a human asks. '
|
|
854
|
-
+ 'Say in your final result what the feedback is; the human can send it from the
|
|
951
|
+
+ 'Say in your final result what the feedback is; the human can send it from the Feedback panel.',
|
|
855
952
|
);
|
|
856
953
|
}
|
|
857
954
|
|
|
@@ -937,6 +1034,41 @@ async function handleCallTool(request) {
|
|
|
937
1034
|
}
|
|
938
1035
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
939
1036
|
}
|
|
1037
|
+
if (name === 'epic_list') {
|
|
1038
|
+
const qs = new URLSearchParams();
|
|
1039
|
+
if (args?.cwd) qs.set('cwd', args.cwd);
|
|
1040
|
+
if (args?.state) qs.set('state', args.state);
|
|
1041
|
+
if (args?.limit !== undefined) qs.set('limit', String(args.limit));
|
|
1042
|
+
if (args?.offset !== undefined) qs.set('offset', String(args.offset));
|
|
1043
|
+
const result = await adminRequest('GET', `/admin/epics?${qs.toString()}`);
|
|
1044
|
+
// Same partial-page guard as scheduler_list_prds: never let a page pass
|
|
1045
|
+
// for the full list.
|
|
1046
|
+
if (result?.ok && result.hasMore) {
|
|
1047
|
+
result.note = `partial list: returned ${result.epics.length} of ${result.total} Epics (offset ${result.offset}, limit ${result.limit}) — pass a higher offset to see more`;
|
|
1048
|
+
}
|
|
1049
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1050
|
+
}
|
|
1051
|
+
if (name === 'agent_list') {
|
|
1052
|
+
const qs = new URLSearchParams();
|
|
1053
|
+
if (args?.cwd) qs.set('cwd', args.cwd);
|
|
1054
|
+
const suffix = qs.toString() ? `?${qs.toString()}` : '';
|
|
1055
|
+
const result = await adminRequest('GET', `/admin/agents${suffix}`);
|
|
1056
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1057
|
+
}
|
|
1058
|
+
if (name === 'epic_get') {
|
|
1059
|
+
const hasId = typeof args?.id === 'string' && args.id !== '';
|
|
1060
|
+
const hasRef = typeof args?.externalRef === 'string' && args.externalRef !== '';
|
|
1061
|
+
if (hasId === hasRef) {
|
|
1062
|
+
return errorResult('provide exactly one of id or externalRef');
|
|
1063
|
+
}
|
|
1064
|
+
const qs = new URLSearchParams();
|
|
1065
|
+
if (args?.cwd) qs.set('cwd', args.cwd);
|
|
1066
|
+
if (hasId) qs.set('id', args.id);
|
|
1067
|
+
else qs.set('externalRef', args.externalRef);
|
|
1068
|
+
if (args?.receipt === true) qs.set('receipt', '1');
|
|
1069
|
+
const result = await adminRequest('GET', `/admin/epic?${qs.toString()}`);
|
|
1070
|
+
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1071
|
+
}
|
|
940
1072
|
if (name === 'scheduler_get_prd') {
|
|
941
1073
|
const slug = args && typeof args.slug === 'string' ? args.slug : null;
|
|
942
1074
|
if (!slug) {
|
|
@@ -1139,6 +1271,8 @@ async function handleCallTool(request) {
|
|
|
1139
1271
|
if (result?.ok !== false) {
|
|
1140
1272
|
if (result?.delivery === 'delivered') {
|
|
1141
1273
|
note = ' — delivered into the asking session; it has not acted on it yet.';
|
|
1274
|
+
} else if (result?.delivery === 'event-only' && result?.reason === 'asker-requested-event') {
|
|
1275
|
+
note = ' — the answer was recorded as an event for the asking app, as it requested; no chat was prompted.';
|
|
1142
1276
|
} else if (result?.delivery === 'event-only') {
|
|
1143
1277
|
note = " — delivered as an event only on the asking Epic; its session was not prompted"
|
|
1144
1278
|
+ `${result.reason ? ` (${result.reason})` : ''}.`;
|
|
@@ -1319,10 +1453,17 @@ async function handleCallTool(request) {
|
|
|
1319
1453
|
if (name === 'customer_feedback_submit') {
|
|
1320
1454
|
const refusal = customerFeedbackSubmitRefusal();
|
|
1321
1455
|
if (refusal) return refusal;
|
|
1322
|
-
if (!args || typeof args.
|
|
1323
|
-
return errorResult('missing or invalid required argument(s):
|
|
1456
|
+
if (!args || typeof args.goal !== 'string' || typeof args.description !== 'string' || typeof args.tag !== 'string') {
|
|
1457
|
+
return errorResult('missing or invalid required argument(s): goal, description, tag');
|
|
1458
|
+
}
|
|
1459
|
+
const imagePaths = args.imagePaths;
|
|
1460
|
+
if (imagePaths !== undefined
|
|
1461
|
+
&& (!Array.isArray(imagePaths) || imagePaths.length > 5 || !imagePaths.every((p) => typeof p === 'string'))) {
|
|
1462
|
+
return errorResult('invalid argument: imagePaths must be an array of at most 5 absolute file path strings');
|
|
1324
1463
|
}
|
|
1325
|
-
const
|
|
1464
|
+
const payload = { title: args.goal, body: args.description, tag: args.tag };
|
|
1465
|
+
if (imagePaths && imagePaths.length > 0) payload.imagePaths = imagePaths;
|
|
1466
|
+
const result = await adminRequest('POST', '/admin/customer-feedback/submit', payload);
|
|
1326
1467
|
if (result?.ok === false) return errorResult(result.error ?? 'customer_feedback_submit failed');
|
|
1327
1468
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
1328
1469
|
}
|
|
@@ -1388,4 +1529,6 @@ if (require.main === module) {
|
|
|
1388
1529
|
});
|
|
1389
1530
|
}
|
|
1390
1531
|
|
|
1391
|
-
module.exports = {
|
|
1532
|
+
module.exports = {
|
|
1533
|
+
TOOLS, handleCallTool, HELP_POINTER, NOT_RUNNING_ERROR, busyError, unknownRouteMessage, compareVersions,
|
|
1534
|
+
};
|
package/src/main/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"gitSha": "
|
|
4
|
-
"gitShortSha": "
|
|
2
|
+
"version": "0.139.0",
|
|
3
|
+
"gitSha": "ca86eb20ac810d686da85bf23356b2e8a9ae86a8",
|
|
4
|
+
"gitShortSha": "ca86eb20",
|
|
5
5
|
"gitBranch": "HEAD",
|
|
6
|
-
"builtAt": "2026-11-
|
|
6
|
+
"builtAt": "2026-11-22T16:17:18.856Z",
|
|
7
7
|
"dirty": false
|
|
8
8
|
}
|
package/src/main/chatRunner.cjs
CHANGED
|
@@ -40,7 +40,7 @@ const { spawn } = require('node:child_process');
|
|
|
40
40
|
const { ipcMain } = require('electron');
|
|
41
41
|
const { resolveClaudeBin, claudeSpawnTarget } = require('./lib/claude/claudeBin.cjs');
|
|
42
42
|
const { cleanChildEnv, pathWithUserBins } = require('./lib/process/cleanEnv.cjs');
|
|
43
|
-
const { recordExchange } = require('./exchanges.cjs');
|
|
43
|
+
const { recordExchange, formatAskedResult } = require('./exchanges.cjs');
|
|
44
44
|
const { classifyToolUse } = require('./lib/toolUseClassify.cjs');
|
|
45
45
|
const { extractJson } = require('./lib/util/extractJson.cjs');
|
|
46
46
|
const { classifyPromptTicket } = require('./lib/classifyPromptTicket.cjs');
|
|
@@ -939,7 +939,7 @@ function executeRun({ tabId, sessionId, prompt, cwd, resume, silent, onSilentRes
|
|
|
939
939
|
sessionId,
|
|
940
940
|
cwd,
|
|
941
941
|
prompt,
|
|
942
|
-
result:
|
|
942
|
+
result: formatAskedResult(signal.answerBody, signal.questions),
|
|
943
943
|
promptId,
|
|
944
944
|
}).catch((err) => {
|
|
945
945
|
console.error('[chatRunner] recordExchange failed:', err?.message ?? err);
|
package/src/main/exchanges.cjs
CHANGED
|
@@ -78,13 +78,13 @@ const MAX_TAIL_BYTES = 8 * 1024 * 1024;
|
|
|
78
78
|
const DEFAULT_LIMIT = 100;
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* Parse the last MAX_TAIL_BYTES of the project's exchanges.jsonl into records,
|
|
82
|
+
* oldest-first. Missing/unreadable file → []. Malformed lines are skipped.
|
|
83
83
|
*
|
|
84
|
-
* @param {
|
|
84
|
+
* @param {string} cwd
|
|
85
85
|
* @returns {Promise<object[]>}
|
|
86
86
|
*/
|
|
87
|
-
async function
|
|
87
|
+
async function readTailRecords(cwd) {
|
|
88
88
|
const filePath = exchangesFilePath(cwd);
|
|
89
89
|
|
|
90
90
|
let stat;
|
|
@@ -122,6 +122,18 @@ async function listExchanges({ cwd, sessionId, limit = DEFAULT_LIMIT, offset = 0
|
|
|
122
122
|
if (rec && typeof rec.ts === 'string') records.push(rec);
|
|
123
123
|
} catch { /* skip malformed */ }
|
|
124
124
|
}
|
|
125
|
+
return records;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Read exchanges for a project, newest-first. Bounded to MAX_TAIL_BYTES from
|
|
130
|
+
* the end of the file so large logs never block the main thread.
|
|
131
|
+
*
|
|
132
|
+
* @param {{ cwd: string, sessionId?: string, limit?: number, offset?: number }}
|
|
133
|
+
* @returns {Promise<object[]>}
|
|
134
|
+
*/
|
|
135
|
+
async function listExchanges({ cwd, sessionId, limit = DEFAULT_LIMIT, offset = 0 }) {
|
|
136
|
+
const records = await readTailRecords(cwd);
|
|
125
137
|
|
|
126
138
|
// Newest-first
|
|
127
139
|
records.reverse();
|
|
@@ -133,4 +145,57 @@ async function listExchanges({ cwd, sessionId, limit = DEFAULT_LIMIT, offset = 0
|
|
|
133
145
|
return filtered.slice(offset, offset + limit);
|
|
134
146
|
}
|
|
135
147
|
|
|
136
|
-
|
|
148
|
+
// The needs-input marker. chatRunner.cjs records a turn that ended by asking
|
|
149
|
+
// the human questions as `<answerBody>\n\n[asked: q1 | q2]`; this is its one home.
|
|
150
|
+
const ASKED_PREFIX = '\n\n[asked: ';
|
|
151
|
+
const ASKED_SEPARATOR = ' | ';
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Build the `result` string recorded for a needs-input turn.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} answerBody
|
|
157
|
+
* @param {string[]} questions
|
|
158
|
+
* @returns {string}
|
|
159
|
+
*/
|
|
160
|
+
function formatAskedResult(answerBody, questions) {
|
|
161
|
+
return `${answerBody}${ASKED_PREFIX}${questions.join(ASKED_SEPARATOR)}]`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* True only for a string that ends with the `[asked: ...]` marker block.
|
|
166
|
+
*
|
|
167
|
+
* @param {unknown} result
|
|
168
|
+
* @returns {boolean}
|
|
169
|
+
*/
|
|
170
|
+
function resultAwaitsInput(result) {
|
|
171
|
+
if (typeof result !== 'string' || !result.endsWith(']')) return false;
|
|
172
|
+
const at = result.lastIndexOf(ASKED_PREFIX);
|
|
173
|
+
if (at === -1) return false;
|
|
174
|
+
// The marker block is a single line — nothing after it may start a new one.
|
|
175
|
+
return !result.slice(at + ASKED_PREFIX.length).includes('\n');
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Sessions (Claude session ids) whose newest exchange in this project is still
|
|
180
|
+
* waiting for the human's answer. Reads at most MAX_TAIL_BYTES of the log.
|
|
181
|
+
*
|
|
182
|
+
* @param {string} cwd
|
|
183
|
+
* @returns {Promise<Set<string>>}
|
|
184
|
+
*/
|
|
185
|
+
async function awaitingInputSessions(cwd) {
|
|
186
|
+
const waiting = new Set();
|
|
187
|
+
for (const rec of await readTailRecords(cwd)) {
|
|
188
|
+
if (typeof rec.sessionId !== 'string' || !rec.sessionId) continue;
|
|
189
|
+
if (resultAwaitsInput(rec.result)) waiting.add(rec.sessionId);
|
|
190
|
+
else waiting.delete(rec.sessionId);
|
|
191
|
+
}
|
|
192
|
+
return waiting;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
module.exports = {
|
|
196
|
+
recordExchange,
|
|
197
|
+
listExchanges,
|
|
198
|
+
formatAskedResult,
|
|
199
|
+
resultAwaitsInput,
|
|
200
|
+
awaitingInputSessions,
|
|
201
|
+
};
|