claude-code-session-manager 0.10.5 → 0.11.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/dist/assets/{TiptapBody-BroECZ_z.js → TiptapBody-CAJSNRPs.js} +1 -1
- package/dist/assets/{cssMode-Crq-Rykh.js → cssMode-o7rZCrm4.js} +1 -1
- package/dist/assets/{freemarker2-B6CC21Ql.js → freemarker2-CgmCS5Wh.js} +1 -1
- package/dist/assets/{handlebars-BLgR-12n.js → handlebars-BcPLqhPv.js} +1 -1
- package/dist/assets/{html-CiQkt_KY.js → html-CC9xWnC3.js} +1 -1
- package/dist/assets/{htmlMode-Cy8mc91p.js → htmlMode-DEgCqH7k.js} +1 -1
- package/dist/assets/{index-DU-o-LEm.js → index-C7ljEoqc.js} +1161 -1130
- package/dist/assets/{index-DW-tvyin.css → index-CH3K1pkS.css} +1 -1
- package/dist/assets/{javascript-CHNCN8qj.js → javascript-CjwqkQrn.js} +1 -1
- package/dist/assets/{jsonMode-BSN7mvBT.js → jsonMode-BYTLu76d.js} +1 -1
- package/dist/assets/{liquid-B0kmZauA.js → liquid-wbQUuJwT.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-DI_RToRa.js → lspLanguageFeatures-BJGMI7Xu.js} +1 -1
- package/dist/assets/{mdx-BSF-fsyJ.js → mdx-DcDstgPF.js} +1 -1
- package/dist/assets/{python-DUl3Fmgk.js → python-B96yyM_5.js} +1 -1
- package/dist/assets/{razor-Df7WxBjo.js → razor-C7aRIxIE.js} +1 -1
- package/dist/assets/{tsMode-qccVs0_G.js → tsMode-B3UYlGaL.js} +1 -1
- package/dist/assets/{typescript-BEwM5qbq.js → typescript-CV587TvC.js} +1 -1
- package/dist/assets/{xml-CCtx-_Kw.js → xml-PWUJecBf.js} +1 -1
- package/dist/assets/{yaml-B66nOkCW.js → yaml-D8bBNHE4.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/main/agentMemory.cjs +267 -0
- package/src/main/files.cjs +346 -0
- package/src/main/git.cjs +333 -0
- package/src/main/historyAggregator.cjs +70 -0
- package/src/main/index.cjs +12 -0
- package/src/main/ipcSchemas.cjs +62 -0
- package/src/main/projectSkills.cjs +124 -0
- package/src/main/superagent.cjs +202 -0
- package/src/preload/api.d.ts +203 -0
- package/src/preload/index.cjs +47 -0
package/src/preload/api.d.ts
CHANGED
|
@@ -377,6 +377,46 @@ export interface HistoryAggregateResult {
|
|
|
377
377
|
scannedMs: number;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
export interface ConversationSummary {
|
|
381
|
+
/** ISO 8601 timestamp of the first event in the conversation (or file mtime fallback). */
|
|
382
|
+
timestamp: string;
|
|
383
|
+
/** Decoded project cwd, e.g. /home/user/Projects/foo. */
|
|
384
|
+
projectFolder: string;
|
|
385
|
+
stats: {
|
|
386
|
+
/** Wall-clock duration in ms (first event ts → last event ts). Omitted when unknown. */
|
|
387
|
+
duration?: number;
|
|
388
|
+
/** Sum of input + output tokens across the file. 0 when no usage blocks present. */
|
|
389
|
+
estimatedTokens: number;
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface ListConversationsResult {
|
|
394
|
+
conversations: ConversationSummary[];
|
|
395
|
+
scannedMs: number;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface ProjectSkillState {
|
|
399
|
+
skillId: string;
|
|
400
|
+
enabled: boolean;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export interface FileEntry {
|
|
404
|
+
name: string;
|
|
405
|
+
path: string;
|
|
406
|
+
isDirectory: boolean;
|
|
407
|
+
isFile: boolean;
|
|
408
|
+
size: number;
|
|
409
|
+
mtimeMs: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export interface FilesListResult { ok: boolean; entries: FileEntry[]; error: string | null }
|
|
413
|
+
export interface FilesReadResult { ok: boolean; text: string; error: string | null; size: number }
|
|
414
|
+
export interface FilesWriteResult { ok: boolean; error: string | null }
|
|
415
|
+
export interface FilesCreateResult { ok: boolean; path?: string; error: string | null }
|
|
416
|
+
export interface FilesRenameResult { ok: boolean; newPath?: string; error: string | null }
|
|
417
|
+
export interface FilesDeleteResult { ok: boolean; error: string | null }
|
|
418
|
+
export interface FilesShellResult { ok: boolean; error?: string }
|
|
419
|
+
|
|
380
420
|
export interface WatcherInfo {
|
|
381
421
|
watcherId: string;
|
|
382
422
|
tabId: string;
|
|
@@ -506,6 +546,83 @@ export interface MemoryMutationResult {
|
|
|
506
546
|
error: string | null;
|
|
507
547
|
}
|
|
508
548
|
|
|
549
|
+
// ────────────────────────────────────────────── Per-subagent memory
|
|
550
|
+
// Stored at ~/.claude/session-manager/agent-memory/<agentId>.json. Keyed by
|
|
551
|
+
// agent name (the .md filename in ~/.claude/agents/), not by workspace cwd.
|
|
552
|
+
|
|
553
|
+
export type AgentMemoryCategory = 'command' | 'preference' | 'pattern' | 'failure' | 'workflow';
|
|
554
|
+
|
|
555
|
+
export interface AgentMemoryEntry {
|
|
556
|
+
id: string;
|
|
557
|
+
body: string;
|
|
558
|
+
category: AgentMemoryCategory | null;
|
|
559
|
+
createdAt: number;
|
|
560
|
+
updatedAt: number;
|
|
561
|
+
bytes: number;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export interface AgentMemoryListResult {
|
|
565
|
+
entries: AgentMemoryEntry[];
|
|
566
|
+
agentId: string;
|
|
567
|
+
error: string | null;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export interface AgentMemoryGetResult {
|
|
571
|
+
entry: AgentMemoryEntry | null;
|
|
572
|
+
error: string | null;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export interface AgentMemoryMutationResult {
|
|
576
|
+
ok: boolean;
|
|
577
|
+
error: string | null;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface AgentMemoryAgentSummary {
|
|
581
|
+
agentId: string;
|
|
582
|
+
bytes: number;
|
|
583
|
+
mtimeMs: number;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export interface AgentMemoryListAgentsResult {
|
|
587
|
+
agents: AgentMemoryAgentSummary[];
|
|
588
|
+
error: string | null;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// ────────────────────────────────────────────── Git status (richer than app:git-branch)
|
|
592
|
+
|
|
593
|
+
/** Mirrors the status returned by src/main/git.cjs mapStatus(). */
|
|
594
|
+
export type GitFileStatusType =
|
|
595
|
+
| 'modified'
|
|
596
|
+
| 'added'
|
|
597
|
+
| 'deleted'
|
|
598
|
+
| 'renamed'
|
|
599
|
+
| 'untracked'
|
|
600
|
+
| 'staged'
|
|
601
|
+
| 'conflict';
|
|
602
|
+
|
|
603
|
+
export interface GitFileStatus {
|
|
604
|
+
/** Absolute path. Always inside cwd (we resolve relative paths against it). */
|
|
605
|
+
path: string;
|
|
606
|
+
/** Path as git reported it, relative to the repo root. */
|
|
607
|
+
relativePath: string;
|
|
608
|
+
status: GitFileStatusType;
|
|
609
|
+
/** Raw porcelain X (index) character. ' ', 'M', 'A', 'D', 'R', 'C', 'U', '?'. */
|
|
610
|
+
indexStatus: string;
|
|
611
|
+
/** Raw porcelain Y (worktree) character. ' ', 'M', 'D', 'U', '?'. */
|
|
612
|
+
workTreeStatus: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface GitStatusResult {
|
|
616
|
+
branch: string;
|
|
617
|
+
ahead: number;
|
|
618
|
+
behind: number;
|
|
619
|
+
uncommittedCount: number;
|
|
620
|
+
files: GitFileStatus[];
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/** Map keyed by absolute path. Same enum as GitFileStatus.status. */
|
|
624
|
+
export type GitFileStatusMap = Record<string, GitFileStatusType>;
|
|
625
|
+
|
|
509
626
|
// ────────────────────────────────────────────── Bundle F — plugins install
|
|
510
627
|
|
|
511
628
|
export interface PluginInstallResult {
|
|
@@ -519,6 +636,40 @@ export interface PluginInstallProgressEvent {
|
|
|
519
636
|
line: string;
|
|
520
637
|
}
|
|
521
638
|
|
|
639
|
+
// ────────────────────────────────────────────── SuperAgent
|
|
640
|
+
// "Boss" run that dispatches specialist subagents on the active tab's claude
|
|
641
|
+
// session. Renderer-driven progress — main only owns lifecycle + prompt write.
|
|
642
|
+
|
|
643
|
+
export type SuperAgentDepth = 'quick' | 'standard' | 'deep';
|
|
644
|
+
export type SuperAgentStatus = 'idle' | 'running' | 'done' | 'error';
|
|
645
|
+
|
|
646
|
+
export interface SuperAgentRunState {
|
|
647
|
+
status: SuperAgentStatus;
|
|
648
|
+
prompt: string;
|
|
649
|
+
specialistCount: number;
|
|
650
|
+
depth: SuperAgentDepth;
|
|
651
|
+
startedAt: number | null;
|
|
652
|
+
finishedAt: number | null;
|
|
653
|
+
error?: string;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export interface SuperAgentStartArgs {
|
|
657
|
+
tabId: string;
|
|
658
|
+
prompt: string;
|
|
659
|
+
specialistCount: number;
|
|
660
|
+
depth: SuperAgentDepth;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export interface SuperAgentStartResult {
|
|
664
|
+
ok: boolean;
|
|
665
|
+
error?: string;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface SuperAgentStateChangedEvent {
|
|
669
|
+
tabId: string;
|
|
670
|
+
state: SuperAgentRunState | null;
|
|
671
|
+
}
|
|
672
|
+
|
|
522
673
|
export interface SessionManagerAPI {
|
|
523
674
|
app: {
|
|
524
675
|
version: () => Promise<string>;
|
|
@@ -623,8 +774,23 @@ export interface SessionManagerAPI {
|
|
|
623
774
|
status: () => Promise<OtelStatus>;
|
|
624
775
|
configPath: () => Promise<string>;
|
|
625
776
|
};
|
|
777
|
+
projectSkills: {
|
|
778
|
+
get: (cwd: string) => Promise<ProjectSkillState[]>;
|
|
779
|
+
set: (cwd: string, skillId: string, enabled: boolean) => Promise<{ ok: boolean }>;
|
|
780
|
+
};
|
|
781
|
+
files: {
|
|
782
|
+
list: (path: string, showHidden?: boolean) => Promise<FilesListResult>;
|
|
783
|
+
read: (path: string) => Promise<FilesReadResult>;
|
|
784
|
+
write: (path: string, content: string) => Promise<FilesWriteResult>;
|
|
785
|
+
create: (parentPath: string, name: string, kind: 'file' | 'folder') => Promise<FilesCreateResult>;
|
|
786
|
+
rename: (path: string, newName: string) => Promise<FilesRenameResult>;
|
|
787
|
+
delete: (path: string) => Promise<FilesDeleteResult>;
|
|
788
|
+
openExternal: (path: string) => Promise<FilesShellResult>;
|
|
789
|
+
showInFinder: (path: string) => Promise<FilesShellResult>;
|
|
790
|
+
};
|
|
626
791
|
history: {
|
|
627
792
|
aggregate: (req?: HistoryAggregateRequest) => Promise<HistoryAggregateResult>;
|
|
793
|
+
listConversations: () => Promise<ListConversationsResult>;
|
|
628
794
|
};
|
|
629
795
|
schedule: {
|
|
630
796
|
state: () => Promise<ScheduleStateSnapshot>;
|
|
@@ -690,11 +856,48 @@ export interface SessionManagerAPI {
|
|
|
690
856
|
/** Create a new memory entry with starter frontmatter + body. */
|
|
691
857
|
create: (name: string, description?: string, workspace?: string) => Promise<MemoryMutationResult>;
|
|
692
858
|
};
|
|
859
|
+
agentMemory: {
|
|
860
|
+
/** List all memory entries for one subagent. Sorted newest first. */
|
|
861
|
+
list: (agentId: string) => Promise<AgentMemoryListResult>;
|
|
862
|
+
/** Get one entry's full body. Returns `{entry:null}` if missing. */
|
|
863
|
+
get: (agentId: string, entryId: string) => Promise<AgentMemoryGetResult>;
|
|
864
|
+
/** Upsert one entry. Atomic write through config.cjs; max body 1 MiB. */
|
|
865
|
+
set: (
|
|
866
|
+
agentId: string,
|
|
867
|
+
entryId: string,
|
|
868
|
+
body: string,
|
|
869
|
+
category?: AgentMemoryCategory,
|
|
870
|
+
) => Promise<AgentMemoryMutationResult>;
|
|
871
|
+
/** Delete one entry. Removes the file outright when last entry is removed. */
|
|
872
|
+
delete: (agentId: string, entryId: string) => Promise<AgentMemoryMutationResult>;
|
|
873
|
+
/** List all agents that currently have a memory file on disk. */
|
|
874
|
+
listAgents: () => Promise<AgentMemoryListAgentsResult>;
|
|
875
|
+
};
|
|
693
876
|
docEditor: {
|
|
694
877
|
pickFile: (payload?: { lastDir?: string }) => Promise<{ path: string | null; error?: string }>;
|
|
695
878
|
readFile: (path: string) => Promise<{ ok: boolean; text?: string; mtimeMs?: number; error?: string }>;
|
|
696
879
|
writeFile: (path: string, text: string) => Promise<{ ok: boolean; mtimeMs?: number; error?: string }>;
|
|
697
880
|
};
|
|
881
|
+
git: {
|
|
882
|
+
/** Full git status for `cwd`. Returns null when not a git repo, git is
|
|
883
|
+
* missing, or the call times out (5s ceiling). Cached per-cwd for 5s. */
|
|
884
|
+
status: (cwd: string) => Promise<GitStatusResult | null>;
|
|
885
|
+
/** `{ absPath: status }` map. Returns `{}` for non-git / errored cwds.
|
|
886
|
+
* Same 5s cache as status(). Designed for a file-tree sidebar where the
|
|
887
|
+
* renderer needs per-row badges without a separate git call per file. */
|
|
888
|
+
fileStatus: (cwd: string) => Promise<GitFileStatusMap>;
|
|
889
|
+
};
|
|
890
|
+
superagent: {
|
|
891
|
+
/** Start a SuperAgent boss run — writes a structured prompt to the tab's
|
|
892
|
+
* PTY asking Claude to pick + dispatch specialists. Single run per tab. */
|
|
893
|
+
start: (args: SuperAgentStartArgs) => Promise<SuperAgentStartResult>;
|
|
894
|
+
/** Current run state for tab, or null if no run has been started. */
|
|
895
|
+
status: (tabId: string) => Promise<SuperAgentRunState | null>;
|
|
896
|
+
/** Mark the run as done. Does not interrupt Claude — the user can stop
|
|
897
|
+
* the in-PTY work via Ctrl-C; this only flips the renderer indicator. */
|
|
898
|
+
stop: (tabId: string) => Promise<{ ok: boolean }>;
|
|
899
|
+
onStateChanged: (handler: (ev: SuperAgentStateChangedEvent) => void) => () => void;
|
|
900
|
+
};
|
|
698
901
|
}
|
|
699
902
|
|
|
700
903
|
declare global {
|
package/src/preload/index.cjs
CHANGED
|
@@ -146,6 +146,22 @@ contextBridge.exposeInMainWorld('api', {
|
|
|
146
146
|
},
|
|
147
147
|
history: {
|
|
148
148
|
aggregate: (req) => ipcRenderer.invoke('history:aggregate', req),
|
|
149
|
+
listConversations: () => ipcRenderer.invoke('history:list-conversations'),
|
|
150
|
+
},
|
|
151
|
+
projectSkills: {
|
|
152
|
+
get: (cwd) => ipcRenderer.invoke('project-skills:get', { cwd }),
|
|
153
|
+
set: (cwd, skillId, enabled) =>
|
|
154
|
+
ipcRenderer.invoke('project-skills:set', { cwd, skillId, enabled }),
|
|
155
|
+
},
|
|
156
|
+
files: {
|
|
157
|
+
list: (path, showHidden) => ipcRenderer.invoke('files:list', { path, showHidden }),
|
|
158
|
+
read: (path) => ipcRenderer.invoke('files:read', { path }),
|
|
159
|
+
write: (path, content) => ipcRenderer.invoke('files:write', { path, content }),
|
|
160
|
+
create: (parentPath, name, kind) => ipcRenderer.invoke('files:create', { parentPath, name, kind }),
|
|
161
|
+
rename: (path, newName) => ipcRenderer.invoke('files:rename', { path, newName }),
|
|
162
|
+
delete: (path) => ipcRenderer.invoke('files:delete', { path }),
|
|
163
|
+
openExternal: (path) => ipcRenderer.invoke('files:open-external', { path }),
|
|
164
|
+
showInFinder: (path) => ipcRenderer.invoke('files:show-in-finder', { path }),
|
|
149
165
|
},
|
|
150
166
|
schedule: {
|
|
151
167
|
state: () => ipcRenderer.invoke('schedule:state'),
|
|
@@ -205,9 +221,40 @@ contextBridge.exposeInMainWorld('api', {
|
|
|
205
221
|
return ipcRenderer.invoke('memory:create', payload);
|
|
206
222
|
},
|
|
207
223
|
},
|
|
224
|
+
agentMemory: {
|
|
225
|
+
list: (agentId) => ipcRenderer.invoke('agent-memory:list', { agentId }),
|
|
226
|
+
get: (agentId, entryId) => ipcRenderer.invoke('agent-memory:get', { agentId, entryId }),
|
|
227
|
+
set: (agentId, entryId, body, category) => {
|
|
228
|
+
const payload = { agentId, entryId, body };
|
|
229
|
+
if (category) payload.category = category;
|
|
230
|
+
return ipcRenderer.invoke('agent-memory:set', payload);
|
|
231
|
+
},
|
|
232
|
+
delete: (agentId, entryId) => ipcRenderer.invoke('agent-memory:delete', { agentId, entryId }),
|
|
233
|
+
listAgents: () => ipcRenderer.invoke('agent-memory:list-agents'),
|
|
234
|
+
},
|
|
208
235
|
docEditor: {
|
|
209
236
|
pickFile: (payload) => ipcRenderer.invoke('doc-editor:pick-file', payload),
|
|
210
237
|
readFile: (p) => ipcRenderer.invoke('doc-editor:read-file', { path: p }),
|
|
211
238
|
writeFile: (p, text) => ipcRenderer.invoke('doc-editor:write-file', { path: p, text }),
|
|
212
239
|
},
|
|
240
|
+
git: {
|
|
241
|
+
// Returns null when cwd is not a git repo, git is missing, or the call
|
|
242
|
+
// times out (5s ceiling). The existing `app.gitBranch` is intentionally
|
|
243
|
+
// kept — StatusBar still uses it for the cheap per-tab branch readout.
|
|
244
|
+
status: (cwd) => ipcRenderer.invoke('git:status', { cwd }),
|
|
245
|
+
fileStatus: (cwd) => ipcRenderer.invoke('git:file-status', { cwd }),
|
|
246
|
+
},
|
|
247
|
+
superagent: {
|
|
248
|
+
/** Start a SuperAgent boss run on a tab — writes a structured prompt to
|
|
249
|
+
* the PTY asking Claude to pick + dispatch specialists. Single live run
|
|
250
|
+
* per tab; starting again on a running tab terminates the prior one. */
|
|
251
|
+
start: (payload) => ipcRenderer.invoke('superagent:start', payload),
|
|
252
|
+
status: (tabId) => ipcRenderer.invoke('superagent:status', { tabId }),
|
|
253
|
+
stop: (tabId) => ipcRenderer.invoke('superagent:stop', { tabId }),
|
|
254
|
+
onStateChanged: (handler) => {
|
|
255
|
+
const listener = (_e, payload) => handler(payload);
|
|
256
|
+
ipcRenderer.on('superagent:state-changed', listener);
|
|
257
|
+
return () => ipcRenderer.removeListener('superagent:state-changed', listener);
|
|
258
|
+
},
|
|
259
|
+
},
|
|
213
260
|
});
|