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.
Files changed (91) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +339 -82
  3. package/dist/assets/{AppSettings-CgDhqrsU.js → AppSettings-CUfWY9vN.js} +2 -2
  4. package/dist/assets/History-DDnqaLyw.js +2 -0
  5. package/dist/assets/HomeClaudeConfig-CGD2Onjv.js +3 -0
  6. package/dist/assets/{Panel-CeDiyuNn.js → Panel-Csyd9HbD.js} +1 -1
  7. package/dist/assets/ProjectClaudeConfig-C-jlYpC_.js +26 -0
  8. package/dist/assets/{Scheduler-CkhTvG7C.js → Scheduler-NLs08fx7.js} +9 -9
  9. package/dist/assets/{SkillReferenceGraph-CFMK8NJh.js → SkillReferenceGraph-DcscPXAG.js} +1 -1
  10. package/dist/assets/Skills-BpGRKOcY.js +67 -0
  11. package/dist/assets/{TiptapBody-D1kTj-tn.js → TiptapBody-DSU3769X.js} +60 -54
  12. package/dist/assets/ViewTabs-C0PRZx4_.js +1 -0
  13. package/dist/assets/{VoiceButton-CZeyPM31.js → VoiceButton-D2rMurNg.js} +1 -1
  14. package/dist/assets/{historyTotals-B00l64Jw.js → historyTotals-TcIQs2sh.js} +1 -1
  15. package/dist/assets/{index-62tyjEQB.css → index-BCySPdtU.css} +1 -1
  16. package/dist/assets/{index-CgCxpunJ.js → index-C-d0DCre.js} +523 -515
  17. package/dist/index.html +2 -2
  18. package/dist-web/app.css +1 -1
  19. package/dist-web/app.js +469 -450
  20. package/package.json +13 -5
  21. package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
  22. package/plugins/session-manager-dev/skills/builder/SKILL.md +12 -4
  23. package/plugins/session-manager-dev/skills/builder/scripts/publish-preflight.cjs +255 -0
  24. package/plugins/session-manager-dev/skills/develop/SKILL.md +12 -5
  25. package/scripts/README.md +1 -0
  26. package/scripts/scheduler-mcp-server.cjs +161 -18
  27. package/src/main/build-info.json +4 -4
  28. package/src/main/chatRunner.cjs +2 -2
  29. package/src/main/exchanges.cjs +70 -5
  30. package/src/main/historyAggregator.cjs +84 -58
  31. package/src/main/historyDashboard.cjs +18 -13
  32. package/src/main/index.cjs +22 -2
  33. package/src/main/ipcSchemas.cjs +122 -5
  34. package/src/main/lib/claude/effectiveModelInfo.cjs +2 -2
  35. package/src/main/lib/claude/modelPricing.cjs +148 -0
  36. package/src/main/lib/epic/epicAdminRoutes.cjs +101 -0
  37. package/src/main/lib/epic/epicJobReceipt.cjs +87 -0
  38. package/src/main/lib/epic/epicOutsideRead.cjs +306 -0
  39. package/src/main/lib/epic/epicOutsideState.cjs +233 -0
  40. package/src/main/lib/epic/epicSettle.cjs +1 -1
  41. package/src/main/lib/epic/epicStateWatcher.cjs +157 -0
  42. package/src/main/lib/epic/externalRef.cjs +37 -0
  43. package/src/main/lib/epic/externalRefIndex.cjs +136 -0
  44. package/src/main/lib/epic/restorableSessions.cjs +151 -17
  45. package/src/main/lib/epic/transcriptUsage.cjs +197 -0
  46. package/src/main/lib/externalContract.cjs +111 -0
  47. package/src/main/lib/feedback-remote/crossProjectFeedback.cjs +121 -4
  48. package/src/main/lib/feedback-remote/crossProjectReply.cjs +83 -1
  49. package/src/main/lib/feedback-remote/customerFeedbackAdminRoutes.cjs +16 -6
  50. package/src/main/lib/feedback-remote/customerFeedbackClient.cjs +50 -8
  51. package/src/main/lib/feedback-remote/customerFeedbackInbox.cjs +218 -4
  52. package/src/main/lib/feedback-remote/customerFeedbackIpc.cjs +19 -3
  53. package/src/main/lib/feedback-remote/feedbackImages.cjs +171 -0
  54. package/src/main/lib/feedback-remote/localAdminHttp.cjs +11 -10
  55. package/src/main/lib/feedback-remote/macroAdminRoutes.cjs +120 -2
  56. package/src/main/lib/feedback-remote/needsYouAdminRoutes.cjs +133 -0
  57. package/src/main/lib/feedback-remote/needsYouIpc.cjs +50 -0
  58. package/src/main/lib/feedback-remote/needsYouStore.cjs +281 -0
  59. package/src/main/lib/historyRollup.cjs +32 -5
  60. package/src/main/lib/mcpToolCatalog.cjs +111 -14
  61. package/src/main/lib/persona-macro/agentAdminRoutes.cjs +121 -0
  62. package/src/main/lib/promptSessionSchema.cjs +4 -0
  63. package/src/main/lib/remoteTranscriptTail.cjs +32 -1
  64. package/src/main/lib/scheduler/schedulerPaths.cjs +9 -0
  65. package/src/main/lib/telemetry/auditEvents.cjs +176 -0
  66. package/src/main/lib/telemetry/eventsAdminRoutes.cjs +45 -0
  67. package/src/main/loopEfficiencyHandlers.cjs +1 -1
  68. package/src/main/scheduler.cjs +29 -0
  69. package/src/main/templates/PRD_AUTHORING.md +1 -0
  70. package/src/main/transcripts.cjs +62 -7
  71. package/src/main/webRemote.cjs +122 -18
  72. package/src/preload/api.d.ts +71 -8
  73. package/src/preload/apiSurface.cjs +7 -0
  74. package/src/preload/apiSurface.json +408 -83
  75. package/src/preload/index.cjs +15 -3
  76. package/dist/assets/AgentLibrary-C1d_D7uQ.js +0 -2
  77. package/dist/assets/Button-Bk23rEnZ.js +0 -1
  78. package/dist/assets/DocumentEditorPane-BqY5Nq6W.js +0 -1
  79. package/dist/assets/Extensions-CXem-uwI.js +0 -2
  80. package/dist/assets/History-BwO3coo4.js +0 -2
  81. package/dist/assets/Library-BDV69fSe.js +0 -32
  82. package/dist/assets/ListDetail-CD-Fm6mh.js +0 -1
  83. package/dist/assets/ProjectClaudeConfig-NjdKdwe8.js +0 -25
  84. package/dist/assets/ProvenanceBadge-Bu8NmI_R.js +0 -1
  85. package/dist/assets/Settings-COT34hBF.js +0 -2
  86. package/dist/assets/Skills-BgexoUkQ.js +0 -29
  87. package/dist/assets/SourceChip-BXjcdeb1.js +0 -1
  88. package/dist/assets/SystemPrompt-CeeH3EeW.js +0 -1
  89. package/dist/assets/Toggle-CENi19iK.js +0 -1
  90. package/dist/assets/ViewTabs-DDBb0x96.js +0 -1
  91. package/dist/assets/claude-settings-schema-COigsajx.js +0 -3
@@ -283,12 +283,16 @@ export type McpCheckResult =
283
283
  * HomeAgentTools section. */
284
284
  export interface McpToolCatalogEntry {
285
285
  name: string;
286
- group: 'scheduler' | 'chat' | 'feedback' | 'help';
286
+ group: 'scheduler' | 'chat' | 'feedback' | 'help' | 'project-home' | 'macros' | 'customer-feedback' | 'epics' | 'agents';
287
287
  purpose: string;
288
+ /** Plain one-line summary (10-90 chars) — the Dashboard row text. */
289
+ summary: string;
288
290
  whenToUse: string;
289
291
  whenNotToUse: string;
290
292
  exampleArgs: Record<string, unknown>;
291
293
  notes: string | null;
294
+ /** Arg groups the handler refuses a call without ('exactly one of'). */
295
+ requiredOneOf?: string[][];
292
296
  }
293
297
 
294
298
  export interface McpRecipe {
@@ -382,6 +386,23 @@ export interface MacroJobStatus {
382
386
  }
383
387
 
384
388
  /** One user-defined sidebar HOT KEYS macro (macroLibrary.cjs). `projects` = absolute cwds or `'*'` (every project); a surface `'project-home'` macro is always `['*']` (only its generated artifacts are per project). */
389
+ /** One "Needs you" item an outside app posted (main/lib/feedback-remote/needsYouStore.cjs StoredItemSchema). */
390
+ export interface NeedsYouItem {
391
+ app: string;
392
+ id: string;
393
+ title: string;
394
+ why: string;
395
+ link: string | null;
396
+ /** 2-5 distinct choices; null = no answer buttons (informational only). */
397
+ options: string[] | null;
398
+ externalRef: string | null;
399
+ status: 'open' | 'answered' | 'withdrawn';
400
+ answer: string | null;
401
+ createdAt: string;
402
+ updatedAt: string;
403
+ answeredAt: string | null;
404
+ }
405
+
385
406
  export interface Macro {
386
407
  id: string;
387
408
  label: string;
@@ -703,6 +724,8 @@ export interface CustomerFeedbackItem {
703
724
  statusNote: string | null;
704
725
  statusAt: number | string | null;
705
726
  seenStatusAt: number | string | null;
727
+ /** Images the feedback host confirmed it stored (0 when none were sent). */
728
+ imageCount?: number;
706
729
  }
707
730
 
708
731
  export interface CustomerFeedbackInboxItem {
@@ -718,6 +741,8 @@ export interface CustomerFeedbackInboxItem {
718
741
  statusNote: string | null;
719
742
  statusAt: string | number | null;
720
743
  epicId: string | null;
744
+ /** Screenshot metadata in submission order; `path` = local cache file, null until downloaded. */
745
+ images: { mime: string; bytes: number; path: string | null }[];
721
746
  }
722
747
 
723
748
  export interface CustomerFeedbackOwnerInfo {
@@ -1260,6 +1285,10 @@ export interface DayProjectRow {
1260
1285
  outputTokens: number;
1261
1286
  cacheReadTokens: number;
1262
1287
  cacheCreationTokens: number;
1288
+ /** Recorded 1-hour part of cacheCreationTokens. */
1289
+ cacheCreation1hTokens?: number;
1290
+ /** Part of cacheCreationTokens with no recorded 5-minute / 1-hour split (rollup lines written before v4); priced at the 1-hour rate and marked estimated when above zero. */
1291
+ cacheCreationUnknownTokens?: number;
1263
1292
  costUsd: number;
1264
1293
  /** Set when the model id didn't match opus/sonnet/haiku and was priced at Sonnet rates as a fallback. */
1265
1294
  estimated?: boolean;
@@ -1313,6 +1342,10 @@ export interface HistoryDashboardProjectRow extends HistoryDashboardTotals {
1313
1342
  outputTokens: number;
1314
1343
  cacheReadTokens: number;
1315
1344
  cacheCreationTokens: number;
1345
+ /** Recorded 1-hour part of cacheCreationTokens. */
1346
+ cacheCreation1hTokens?: number;
1347
+ /** Part of cacheCreationTokens with no recorded 5-minute / 1-hour split (rollup lines written before v4); priced at the 1-hour rate and marked estimated when above zero. */
1348
+ cacheCreationUnknownTokens?: number;
1316
1349
  costUsd: number;
1317
1350
  estimated?: boolean;
1318
1351
  }>;
@@ -1335,6 +1368,10 @@ export interface HistoryDashboardResult {
1335
1368
  outputTokens: number;
1336
1369
  cacheReadTokens: number;
1337
1370
  cacheCreationTokens: number;
1371
+ /** Recorded 1-hour part of cacheCreationTokens. */
1372
+ cacheCreation1hTokens?: number;
1373
+ /** Part of cacheCreationTokens with no recorded 5-minute / 1-hour split (rollup lines written before v4); priced at the 1-hour rate and marked estimated when above zero. */
1374
+ cacheCreationUnknownTokens?: number;
1338
1375
  costUsd: number;
1339
1376
  estimated?: boolean;
1340
1377
  }>;
@@ -1342,6 +1379,8 @@ export interface HistoryDashboardResult {
1342
1379
  generatedAt: number;
1343
1380
  /** Dates included in `days` that are NOT yet finalized (typically just today). */
1344
1381
  provisionalDates: string[];
1382
+ /** Dates in range finalized under an older rollup version (counted before once-per-call counting; read high). */
1383
+ legacyDates: string[];
1345
1384
  }
1346
1385
 
1347
1386
 
@@ -2309,8 +2348,10 @@ export interface SessionManagerAPI {
2309
2348
  exists: (cwd: string, sessionUuid: string) => Promise<boolean>;
2310
2349
  /** Batched token-usage totals, one map entry per requested sessionId. A
2311
2350
  * session with no transcript file yet (or one over the main-process size
2312
- * cap) maps to null. */
2313
- usageFor: (cwd: string, sessionIds: string[]) => Promise<Record<string, { inputTokens: number; outputTokens: number } | null>>;
2351
+ * cap) maps to null. `lastContext` = input + cache-read + cache-creation
2352
+ * tokens of the newest model call (null when there is none); `calls` =
2353
+ * number of model calls, each message.id counted once. */
2354
+ usageFor: (cwd: string, sessionIds: string[]) => Promise<Record<string, { inputTokens: number; outputTokens: number; lastContext: number | null; calls: number } | null>>;
2314
2355
  /** Fires once per main-process flush with the ORDERED batch of events that
2315
2356
  * flush produced (never one call per event) — see transcripts.cjs's
2316
2357
  * doFlush / MAX_EVENTS_PER_BATCH. */
@@ -2410,6 +2451,14 @@ export interface SessionManagerAPI {
2410
2451
  /** Fires after any save/delete/setProject — re-fetch list(). */
2411
2452
  onChanged: (handler: () => void) => () => void;
2412
2453
  };
2454
+ needsYou: {
2455
+ /** Open items only, across every app. */
2456
+ list: () => Promise<{ ok: true; items: NeedsYouItem[] }>;
2457
+ /** Answer one open item with one of its options; `ok: false` + error in words when no such open item/option. */
2458
+ answer: (payload: { app: string; id: string; answer: string }) => Promise<{ ok: true; item: NeedsYouItem } | { ok: false; error: string }>;
2459
+ /** Fires after any post/withdraw/answer — re-fetch list(). */
2460
+ onChanged: (handler: () => void) => () => void;
2461
+ };
2413
2462
  appPreview: {
2414
2463
  /** The Epic's package.json scripts (dir = worktree when it has one) plus a suggested dev script. */
2415
2464
  scripts: (payload: { cwd: string; epicId: string }) => Promise<AppPreviewScriptsResult>;
@@ -2511,8 +2560,14 @@ export interface SessionManagerAPI {
2511
2560
  configPath: () => Promise<string>;
2512
2561
  };
2513
2562
  customerFeedback: {
2514
- submit: (p: { title: string; body: string; tag: CustomerFeedbackTag }) => Promise<
2515
- { ok: true; item: CustomerFeedbackItem } | { ok: false; error: string }
2563
+ /** `images` are raw data URLs; main prepares (validates/downscales) them before sending. */
2564
+ submit: (p: {
2565
+ title: string;
2566
+ body: string;
2567
+ tag: CustomerFeedbackTag;
2568
+ images?: { dataUrl: string }[];
2569
+ }) => Promise<
2570
+ { ok: true; item: CustomerFeedbackItem; warning?: string } | { ok: false; error: string }
2516
2571
  >;
2517
2572
  list: () => Promise<CustomerFeedbackItem[]>;
2518
2573
  refreshStatus: () => Promise<
@@ -2533,6 +2588,10 @@ export interface SessionManagerAPI {
2533
2588
  inboxLinkEpic: (p: { id: string; epicId: string }) => Promise<
2534
2589
  { ok: true } | { ok: false; error: string }
2535
2590
  >;
2591
+ /** A cached inbox screenshot as a data URL; `index` is 0-based. */
2592
+ inboxImage(p: { id: string; index: number }): Promise<
2593
+ { ok: true; dataUrl: string } | { ok: false; error: string }
2594
+ >;
2536
2595
  };
2537
2596
  telemetry: {
2538
2597
  getConfig: () => Promise<TelemetryConfig>;
@@ -2783,8 +2842,8 @@ export interface SessionManagerAPI {
2783
2842
  * Kind allowlist is enforced main-side (ipcSchemas.cjs) — this channel is
2784
2843
  * append-only, no read/list IPC exists. */
2785
2844
  append: (
2786
- kind: 'epic_create' | 'epic_approve' | 'epic_complete' | 'epic_delete' | 'epic_resume' | 'epic_duplicate' | 'epic_draft_update',
2787
- fields: { cwd: string; epicId: string; source: string },
2845
+ kind: 'epic_create' | 'epic_approve' | 'epic_complete' | 'epic_delete' | 'epic_resume' | 'epic_duplicate' | 'epic_draft_update' | 'epic_continue',
2846
+ fields: { cwd: string; epicId: string; source: string; fromEpicId?: string },
2788
2847
  ) => Promise<{ ok: boolean }>;
2789
2848
  };
2790
2849
  git: {
@@ -2862,6 +2921,8 @@ export interface SessionManagerAPI {
2862
2921
  title: string;
2863
2922
  prompt: string;
2864
2923
  macroId?: string;
2924
+ /** An outside app's own id for the Epic to create. */
2925
+ externalRef?: string;
2865
2926
  /** Set when main awaits the result; echo it back via `reportExternalNewSessionResult`. */
2866
2927
  requestId?: string;
2867
2928
  via?: 'script';
@@ -2976,6 +3037,8 @@ export interface PromptSessionsCreateEpicPayload {
2976
3037
  sourceTabId?: string;
2977
3038
  /** The macro that launched this Epic. */
2978
3039
  macroId?: string;
3040
+ /** An outside app's own id for this Epic. */
3041
+ externalRef?: string;
2979
3042
  };
2980
3043
  /** Full first-prompt body + its labeled sections (epicIntake.ts's
2981
3044
  * composeEpicIntake) — carried alongside goalText so the Epic's first
@@ -2987,7 +3050,7 @@ export interface PromptSessionsCreateEpicPayload {
2987
3050
  text: string;
2988
3051
  source?: string;
2989
3052
  /** Which part of its AIM slot this entry is; absent on Epics minted before AIM sections. */
2990
- part?: 'persona' | 'grounding' | 'injection' | 'reference' | 'job-type' | 'goal';
3053
+ part?: 'persona' | 'grounding' | 'injection' | 'handoff' | 'reference' | 'job-type' | 'goal';
2991
3054
  }>;
2992
3055
  /** Adopt an existing CLI session of this project instead of minting one. */
2993
3056
  restoreSessionId?: string;
@@ -7,6 +7,13 @@
7
7
  * read — never writes state, spawns processes, or touches OS UI
8
8
  * mutate — everything else that is allowed remotely
9
9
  * deny — desktop-only (pty, clipboard, shell, updater, config fs access, …)
10
+ * pack: (invoke/send only, optional) preload packs the positional params into ONE
11
+ * object arg: `["path","base64"]` = `{ path, base64 }` in positional order. A
12
+ * `"...name"` entry spreads that (object) positional arg into the packed object
13
+ * instead of naming a key. Absent = args are forwarded positionally. Browser
14
+ * stand-in (renderer/web/remoteApi.ts) uses it to post the same shape preload would.
15
+ * Rows preload transforms in other ways (voice.setTtsEnabled `!!`, memory.ask /
16
+ * memory.proposeFix nested target) are pinned as KNOWN_UNDESCRIBED in the test.
10
17
  * Classification is conservative: when unsure, mutate; screen/clipboard/fs/shell => deny.
11
18
  *
12
19
  * Drift is caught by __tests__/apiSurface.test.cjs, which replays the real preload.