@rucher/carnet 0.2.0-beta.5 → 0.2.0-beta.7
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/{carnet-v6FelCYZ.d.mts → carnet-jmxAmm-u.d.mts} +146 -39
- package/dist/carnet-jmxAmm-u.d.mts.map +1 -0
- package/dist/index.d.mts +23 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +100 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.d.mts +2 -2
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +329 -22
- package/dist/mcp.mjs.map +1 -1
- package/dist/{steps-CzJOqsBI.mjs → steps-Bd8FlgLs.mjs} +532 -118
- package/dist/steps-Bd8FlgLs.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/carnet-v6FelCYZ.d.mts.map +0 -1
- package/dist/steps-CzJOqsBI.mjs.map +0 -1
|
@@ -4,19 +4,58 @@ interface Ctx {
|
|
|
4
4
|
now: () => Date;
|
|
5
5
|
workspace: string | null;
|
|
6
6
|
}
|
|
7
|
+
declare const EVENT_TYPES: readonly ['started', 'finished', 'answered', 'applied', 'tested', 'committed', 'dropped', 'injected', 'promoted', 'triaged'];
|
|
8
|
+
declare const SESSION_EVENT_TYPES: readonly ['session.started', 'session.resumed', 'session.ended', 'session.forked'];
|
|
9
|
+
type AgentEventType = (typeof EVENT_TYPES)[number];
|
|
10
|
+
type SessionEventType = (typeof SESSION_EVENT_TYPES)[number];
|
|
11
|
+
type EventType = AgentEventType | SessionEventType;
|
|
12
|
+
interface CarnetEvent {
|
|
13
|
+
id: number;
|
|
14
|
+
session: string;
|
|
15
|
+
at: string;
|
|
16
|
+
type: EventType;
|
|
17
|
+
agent: string | null;
|
|
18
|
+
commit: string | null;
|
|
19
|
+
link: string | null;
|
|
20
|
+
note: string | null;
|
|
21
|
+
}
|
|
22
|
+
interface LogEventInput {
|
|
23
|
+
type: EventType;
|
|
24
|
+
agent?: string | undefined;
|
|
25
|
+
commit?: string | undefined;
|
|
26
|
+
link?: string | undefined;
|
|
27
|
+
note?: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
declare function isEventType(value: unknown): value is EventType;
|
|
7
30
|
declare const AGENT_STATUSES: readonly ['running', 'discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch', 'closed'];
|
|
8
31
|
type AgentStatus = (typeof AGENT_STATUSES)[number];
|
|
9
32
|
declare const USER_ACTION_STATUSES: readonly ['discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch'];
|
|
10
33
|
type UserActionStatus = (typeof USER_ACTION_STATUSES)[number];
|
|
11
34
|
declare const EMOJI: Record<Exclude<AgentStatus, 'closed'>, string>;
|
|
12
35
|
declare const MAIN_WORKING_EMOJI = "⚙️";
|
|
13
|
-
declare const
|
|
36
|
+
declare const MAIN_WAITING_EMOJI = "⏸";
|
|
37
|
+
declare const MAIN_FAILED_EMOJI = "⚠";
|
|
38
|
+
declare const LEGEND = "⚙️ main working · ⏸ waiting on you · ⚠ turn failed · 💬 discussing · ❓ answer · 👀 review · 📥 apply · 🧪 test · ✅ commit · 🌿 branch · ⏳ running";
|
|
39
|
+
declare const KIND_ABBREVIATIONS: {
|
|
40
|
+
readonly research: 'rs';
|
|
41
|
+
readonly analyze: 'an';
|
|
42
|
+
readonly implement: 'im';
|
|
43
|
+
readonly review: 'rv';
|
|
44
|
+
};
|
|
45
|
+
declare const KIND_LEGEND = "rs research · an analyze · im implement · rv review";
|
|
14
46
|
declare function isAgentStatus(value: unknown): value is AgentStatus;
|
|
15
47
|
declare function isUserActionStatus(value: unknown): value is UserActionStatus;
|
|
16
48
|
declare const OPEN_AGENT_STATUSES: readonly ["running", "discussing", "answer", "review", "apply", "test", "commit", "branch"];
|
|
49
|
+
declare const AGENT_KINDS: readonly ['research', 'analyze', 'implement', 'review'];
|
|
50
|
+
type AgentKind = (typeof AGENT_KINDS)[number];
|
|
51
|
+
declare const DEFAULT_AGENT_KIND: AgentKind;
|
|
52
|
+
declare function isAgentKind(value: unknown): value is AgentKind;
|
|
17
53
|
interface Agent {
|
|
18
54
|
session: string;
|
|
19
55
|
name: string;
|
|
56
|
+
kind: AgentKind;
|
|
57
|
+
promotedFrom: AgentKind | null;
|
|
58
|
+
target: string | null;
|
|
20
59
|
task: string | null;
|
|
21
60
|
status: AgentStatus;
|
|
22
61
|
note: string | null;
|
|
@@ -33,12 +72,14 @@ interface Agent {
|
|
|
33
72
|
interface StartAgentInput {
|
|
34
73
|
name: string;
|
|
35
74
|
task: string;
|
|
75
|
+
kind?: AgentKind | undefined;
|
|
76
|
+
target?: string | undefined;
|
|
36
77
|
baseCommit?: string | undefined;
|
|
37
78
|
worktree?: string | undefined;
|
|
38
79
|
}
|
|
39
80
|
interface UpdateAgentInput {
|
|
40
81
|
status: AgentStatus;
|
|
41
|
-
note?: string | undefined;
|
|
82
|
+
note?: string | null | undefined;
|
|
42
83
|
reportPath?: string | undefined;
|
|
43
84
|
}
|
|
44
85
|
interface FinishAgentInput {
|
|
@@ -50,6 +91,11 @@ interface ListAgentsOptions {
|
|
|
50
91
|
}
|
|
51
92
|
declare const REPORTING_NOTE = "reporting";
|
|
52
93
|
declare const PUBLISH_FALLBACK_MILLISECONDS = 120000;
|
|
94
|
+
declare function statusWhenDone(kind: AgentKind, hasQuestions: boolean): AgentStatus;
|
|
95
|
+
interface PromoteAgentInput {
|
|
96
|
+
worktree?: string | undefined;
|
|
97
|
+
baseCommit?: string | undefined;
|
|
98
|
+
}
|
|
53
99
|
interface WorkspaceRepo {
|
|
54
100
|
path: string;
|
|
55
101
|
name: string;
|
|
@@ -96,11 +142,10 @@ declare function dropWorkspace(name: string, options?: DropWorkspaceOptions): Wo
|
|
|
96
142
|
declare function isInside(directory: string, path: string): boolean;
|
|
97
143
|
declare function repoNameFor(workspace: Workspace | null, path: string | undefined): string | null;
|
|
98
144
|
declare function repoPathFor(workspace: Workspace | null, path: string | undefined | null): string | null;
|
|
99
|
-
type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | '
|
|
145
|
+
type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | 'none';
|
|
100
146
|
interface WorkspaceResolution {
|
|
101
147
|
workspace: Workspace | null;
|
|
102
148
|
origin: WorkspaceOrigin;
|
|
103
|
-
repo?: WorkspaceRepo | undefined;
|
|
104
149
|
}
|
|
105
150
|
interface ResolveWorkspaceOptions {
|
|
106
151
|
db?: DatabaseSync | undefined;
|
|
@@ -112,7 +157,6 @@ interface ResolveWorkspaceOptions {
|
|
|
112
157
|
declare function resolveWorkspace({ db, sessionId, workspace, cwd, env }?: ResolveWorkspaceOptions): WorkspaceResolution;
|
|
113
158
|
declare function workspaceLabel(workspace: Workspace | null): string;
|
|
114
159
|
declare function requireWorkspace(workspace: Workspace | null): Workspace;
|
|
115
|
-
declare function ambiguousWorkspaceContext(reason: string): string;
|
|
116
160
|
interface HostSessionPayload {
|
|
117
161
|
session_id: string;
|
|
118
162
|
cwd?: string | undefined;
|
|
@@ -133,6 +177,11 @@ interface HostSubagentPayload {
|
|
|
133
177
|
description?: string | undefined;
|
|
134
178
|
agent_transcript_path?: string | undefined;
|
|
135
179
|
}
|
|
180
|
+
interface HostStopPayload {
|
|
181
|
+
session_id: string;
|
|
182
|
+
cwd?: string | undefined;
|
|
183
|
+
failed: boolean;
|
|
184
|
+
}
|
|
136
185
|
interface HostSessionEndPayload {
|
|
137
186
|
session_id: string;
|
|
138
187
|
cwd?: string | undefined;
|
|
@@ -143,7 +192,10 @@ interface HostToolPayload {
|
|
|
143
192
|
cwd?: string | undefined;
|
|
144
193
|
tool_name?: string | undefined;
|
|
145
194
|
agent_id?: string | undefined;
|
|
195
|
+
agent_type?: string | undefined;
|
|
146
196
|
path?: string | undefined;
|
|
197
|
+
file_path?: string | undefined;
|
|
198
|
+
command?: string | undefined;
|
|
147
199
|
}
|
|
148
200
|
interface ResumeCommand {
|
|
149
201
|
command: string;
|
|
@@ -166,6 +218,7 @@ interface Host {
|
|
|
166
218
|
sessionIdFromEnvironment(env: NodeJS.ProcessEnv): string | undefined;
|
|
167
219
|
projectDirectory(env: NodeJS.ProcessEnv): string | undefined;
|
|
168
220
|
parseSessionPayload(json: string): HostSessionPayload;
|
|
221
|
+
parseStopPayload(json: string): HostStopPayload;
|
|
169
222
|
parsePromptPayload(json: string): HostPromptPayload;
|
|
170
223
|
parseSubagentPayload(json: string): HostSubagentPayload;
|
|
171
224
|
parseSessionEndPayload(json: string): HostSessionEndPayload;
|
|
@@ -179,6 +232,7 @@ interface Host {
|
|
|
179
232
|
forkCommand(parent: Session, options?: LaunchOptions): ResumeCommand;
|
|
180
233
|
renameInstruction(name: string): string;
|
|
181
234
|
transcriptFiles(session: Session, env?: NodeJS.ProcessEnv): string[];
|
|
235
|
+
hasConversation(session: Session, env?: NodeJS.ProcessEnv): boolean;
|
|
182
236
|
renderRunDirectory(workspace: Workspace): HostRender;
|
|
183
237
|
}
|
|
184
238
|
declare const DEFAULT_HOST = "claude-code";
|
|
@@ -188,7 +242,7 @@ type SessionKind = 'active' | 'temp';
|
|
|
188
242
|
type SessionStatus = 'running' | 'idle' | 'archived';
|
|
189
243
|
interface Session {
|
|
190
244
|
id: string;
|
|
191
|
-
workspace: string
|
|
245
|
+
workspace: string;
|
|
192
246
|
name: string | null;
|
|
193
247
|
purpose: string | null;
|
|
194
248
|
kind: SessionKind;
|
|
@@ -239,41 +293,61 @@ interface MergeResult {
|
|
|
239
293
|
movedEvents: number;
|
|
240
294
|
movedTable: boolean;
|
|
241
295
|
}
|
|
296
|
+
interface QuestionInput {
|
|
297
|
+
text: string;
|
|
298
|
+
context?: string | undefined;
|
|
299
|
+
recommendation: string;
|
|
300
|
+
alternatives?: readonly string[] | undefined;
|
|
301
|
+
}
|
|
302
|
+
interface Question {
|
|
303
|
+
n: number;
|
|
304
|
+
total: number;
|
|
305
|
+
text: string;
|
|
306
|
+
context: string | null;
|
|
307
|
+
recommendation: string;
|
|
308
|
+
alternatives: string[];
|
|
309
|
+
answer: string | null;
|
|
310
|
+
answeredAt: string | null;
|
|
311
|
+
}
|
|
312
|
+
interface AnswerInput {
|
|
313
|
+
n: number;
|
|
314
|
+
answer: string;
|
|
315
|
+
}
|
|
316
|
+
declare const FINDING_SEVERITIES: readonly ['blocking', 'to_fix', 'suggestion'];
|
|
317
|
+
type FindingSeverity = (typeof FINDING_SEVERITIES)[number];
|
|
318
|
+
declare const FINDING_DECISIONS: readonly ['sent', 'fixed', 'ignored'];
|
|
319
|
+
type FindingDecision = (typeof FINDING_DECISIONS)[number];
|
|
320
|
+
interface FindingInput {
|
|
321
|
+
severity: FindingSeverity;
|
|
322
|
+
location?: string | undefined;
|
|
323
|
+
text: string;
|
|
324
|
+
fix?: string | undefined;
|
|
325
|
+
}
|
|
326
|
+
interface Finding {
|
|
327
|
+
n: number;
|
|
328
|
+
total: number;
|
|
329
|
+
severity: FindingSeverity;
|
|
330
|
+
location: string | null;
|
|
331
|
+
text: string;
|
|
332
|
+
fix: string | null;
|
|
333
|
+
decision: FindingDecision | null;
|
|
334
|
+
reason: string | null;
|
|
335
|
+
}
|
|
336
|
+
interface DecisionInput {
|
|
337
|
+
n: number;
|
|
338
|
+
decision: FindingDecision;
|
|
339
|
+
reason?: string | undefined;
|
|
340
|
+
}
|
|
242
341
|
interface TableItem {
|
|
243
342
|
session: string;
|
|
244
343
|
text: string;
|
|
245
344
|
status: UserActionStatus | null;
|
|
246
|
-
mainWorking: boolean;
|
|
247
345
|
updatedAt: string;
|
|
248
346
|
}
|
|
249
347
|
interface SetTableInput {
|
|
250
348
|
text: string;
|
|
251
|
-
mainWorking?: boolean | undefined;
|
|
252
349
|
status?: UserActionStatus | undefined;
|
|
253
350
|
}
|
|
254
|
-
declare const EVENT_TYPES: readonly ['started', 'finished', 'answered', 'applied', 'tested', 'committed', 'dropped'];
|
|
255
|
-
declare const SESSION_EVENT_TYPES: readonly ['session.started', 'session.resumed', 'session.ended', 'session.forked'];
|
|
256
|
-
type AgentEventType = (typeof EVENT_TYPES)[number];
|
|
257
|
-
type SessionEventType = (typeof SESSION_EVENT_TYPES)[number];
|
|
258
|
-
type EventType = AgentEventType | SessionEventType;
|
|
259
|
-
interface CarnetEvent {
|
|
260
|
-
id: number;
|
|
261
|
-
session: string;
|
|
262
|
-
at: string;
|
|
263
|
-
type: EventType;
|
|
264
|
-
agent: string | null;
|
|
265
|
-
commit: string | null;
|
|
266
|
-
link: string | null;
|
|
267
|
-
note: string | null;
|
|
268
|
-
}
|
|
269
|
-
interface LogEventInput {
|
|
270
|
-
type: EventType;
|
|
271
|
-
agent?: string | undefined;
|
|
272
|
-
commit?: string | undefined;
|
|
273
|
-
link?: string | undefined;
|
|
274
|
-
note?: string | undefined;
|
|
275
|
-
}
|
|
276
|
-
declare function isEventType(value: unknown): value is EventType;
|
|
277
351
|
declare const NOTE_KINDS: readonly ['dead_end', 'decision', 'learning'];
|
|
278
352
|
type NoteKind = (typeof NOTE_KINDS)[number];
|
|
279
353
|
declare const NOTE_TEXT_LIMIT = 200;
|
|
@@ -354,22 +428,30 @@ interface NoteActivity {
|
|
|
354
428
|
at: string;
|
|
355
429
|
}
|
|
356
430
|
declare function sessionNoteActivity(ctx: Ctx, session: string): NoteActivity[];
|
|
431
|
+
declare const TURNS: readonly ['working', 'waiting', 'failed'];
|
|
432
|
+
type Turn = (typeof TURNS)[number];
|
|
357
433
|
interface StatusLine {
|
|
358
434
|
name: string;
|
|
435
|
+
kind: AgentKind;
|
|
359
436
|
status: AgentStatus;
|
|
360
437
|
emoji: string;
|
|
438
|
+
action: string | null;
|
|
361
439
|
note: string | null;
|
|
362
440
|
}
|
|
363
441
|
interface StatusView {
|
|
364
442
|
time: string;
|
|
365
443
|
sessionName: string | null;
|
|
366
444
|
table: TableItem | null;
|
|
445
|
+
turn: Turn | null;
|
|
367
446
|
waiting: StatusLine[];
|
|
368
447
|
running: StatusLine[];
|
|
369
448
|
notes: NoteActivity[];
|
|
370
449
|
}
|
|
450
|
+
interface StatusViewOptions {
|
|
451
|
+
kind?: AgentKind | undefined;
|
|
452
|
+
}
|
|
371
453
|
declare function formatClock(date: Date): string;
|
|
372
|
-
declare function buildStatusView(ctx: Ctx, session: Session): StatusView;
|
|
454
|
+
declare function buildStatusView(ctx: Ctx, session: Session, options?: StatusViewOptions): StatusView;
|
|
373
455
|
declare const MEMORY_MAX_CHARACTERS = 2000;
|
|
374
456
|
declare function memoryMaxCharacters(value: string | undefined): number;
|
|
375
457
|
interface MemoryOptions {
|
|
@@ -381,9 +463,13 @@ interface MemoryScope {
|
|
|
381
463
|
notes: WeightedNote[];
|
|
382
464
|
}
|
|
383
465
|
declare function renderMemory(scope: MemoryScope, maxCharacters?: number): string;
|
|
384
|
-
declare const
|
|
466
|
+
declare const MAIN_HEADER = "Main";
|
|
467
|
+
declare const MAIN_WORKING_SUFFIX = "(main working)";
|
|
468
|
+
declare const MAIN_WAITING_SUFFIX = "(waiting on you)";
|
|
469
|
+
declare const MAIN_FAILED_SUFFIX = "(turn failed)";
|
|
385
470
|
declare function renderTableLine(item: TableItem): string;
|
|
386
|
-
declare function
|
|
471
|
+
declare function renderMainLine(item: TableItem | null, turn: Turn | null): string | null;
|
|
472
|
+
declare function renderAgentLine(line: StatusLine, nameWidth?: number): string;
|
|
387
473
|
declare const NOTES_HEADER = "Notes";
|
|
388
474
|
declare const NOTES_FOLD_LINES = 5;
|
|
389
475
|
declare const SIMILAR_PREFIX = "similar to ";
|
|
@@ -404,6 +490,7 @@ declare class Carnet {
|
|
|
404
490
|
readonly db: DatabaseSync;
|
|
405
491
|
private readonly ctx;
|
|
406
492
|
constructor(db: DatabaseSync, workspace: Workspace | null, options?: CarnetOptions);
|
|
493
|
+
now(): Date;
|
|
407
494
|
requireWorkspace(): Workspace;
|
|
408
495
|
readonly sessions: {
|
|
409
496
|
get: (id: string) => Session | undefined;
|
|
@@ -439,19 +526,39 @@ declare class Carnet {
|
|
|
439
526
|
update: (session: string, name: string, input: UpdateAgentInput) => Agent;
|
|
440
527
|
finish: (session: string, name: string, input: FinishAgentInput) => Agent;
|
|
441
528
|
drop: (session: string, name: string, reason?: string) => Agent;
|
|
529
|
+
close: (session: string, name: string, event: Omit<LogEventInput, 'agent'>) => Agent;
|
|
530
|
+
promote: (session: string, name: string, input: PromoteAgentInput) => Agent;
|
|
442
531
|
list: (session: string, options?: ListAgentsOptions) => Agent[];
|
|
443
532
|
reorderQueue: (session: string, names: string[]) => Agent[];
|
|
533
|
+
byHostAgentId: (session: string, hostAgentId: string) => Agent | undefined;
|
|
444
534
|
pairSubagent: (session: string, hostAgentId: string) => Agent | undefined;
|
|
445
535
|
stopSubagent: (session: string, hostAgentId: string, names?: string[]) => Agent | undefined;
|
|
446
536
|
};
|
|
537
|
+
readonly questions: {
|
|
538
|
+
list: (session: string, agent: string, openOnly?: boolean) => Question[];
|
|
539
|
+
add: (session: string, agent: string, inputs: readonly QuestionInput[]) => Question[];
|
|
540
|
+
answer: (session: string, agent: string, answers: readonly AnswerInput[]) => Question[];
|
|
541
|
+
};
|
|
542
|
+
readonly findings: {
|
|
543
|
+
list: (session: string, agent: string, pendingOnly?: boolean) => Finding[];
|
|
544
|
+
replace: (session: string, agent: string, inputs: readonly FindingInput[]) => Finding[];
|
|
545
|
+
decide: (session: string, agent: string, decisions: readonly DecisionInput[]) => Finding[];
|
|
546
|
+
};
|
|
447
547
|
readonly table: {
|
|
448
548
|
get: (session: string) => TableItem | undefined;
|
|
449
549
|
set: (session: string, input: SetTableInput) => TableItem;
|
|
450
550
|
clear: (session: string) => void;
|
|
451
551
|
};
|
|
552
|
+
readonly turn: {
|
|
553
|
+
get: (session: string) => "failed" | "waiting" | "working" | null;
|
|
554
|
+
start: (session: string) => void;
|
|
555
|
+
wait: (session: string) => void;
|
|
556
|
+
fail: (session: string) => void;
|
|
557
|
+
end: (session: string) => void;
|
|
558
|
+
};
|
|
452
559
|
readonly events: {
|
|
453
560
|
log: (session: string, input: LogEventInput) => CarnetEvent;
|
|
454
|
-
read: (session: string, limit?: number, agentOnly?: boolean) => CarnetEvent[];
|
|
561
|
+
read: (session: string, limit?: number, agentOnly?: boolean, kind?: AgentKind) => CarnetEvent[];
|
|
455
562
|
};
|
|
456
563
|
readonly notes: {
|
|
457
564
|
add: (input: AddNoteInput) => AddNoteResult;
|
|
@@ -471,8 +578,8 @@ declare class Carnet {
|
|
|
471
578
|
copyRepos: (from: string, into: string) => void;
|
|
472
579
|
};
|
|
473
580
|
readonly status: {
|
|
474
|
-
view: (session: Session) => StatusView;
|
|
475
|
-
render: (session: Session, options?: RenderOptions) => string;
|
|
581
|
+
view: (session: Session, options?: StatusViewOptions) => StatusView;
|
|
582
|
+
render: (session: Session, options?: RenderOptions & StatusViewOptions) => string;
|
|
476
583
|
sections: (session: Session) => string;
|
|
477
584
|
};
|
|
478
585
|
close(): void;
|
|
@@ -491,5 +598,5 @@ interface ResolvedCarnet {
|
|
|
491
598
|
}
|
|
492
599
|
declare function openResolvedCarnet(options?: OpenCarnetOptions): ResolvedCarnet;
|
|
493
600
|
declare function openWorkspaceCarnet(workspace: Workspace | null, options?: OpenCarnetOptions): Carnet;
|
|
494
|
-
export {
|
|
495
|
-
//# sourceMappingURL=carnet-
|
|
601
|
+
export { isNoteKind as $, listWorkspaces as $t, StatusView as A, AgentEventType as An, ResolveWorkspaceOptions as At, DUPLICATE_SIMILARITY as B, CreateWorkspaceOptions as Bt, renderStatus as C, MAIN_WAITING_EMOJI as Cn, HostStopPayload as Ct, memoryMaxCharacters as D, UserActionStatus as Dn, ResumeCommand as Dt, MemoryOptions as E, USER_ACTION_STATUSES as En, LaunchOptions as Et, Turn as F, SESSION_EVENT_TYPES as Fn, repoPathFor as Ft, Note as G, WorkspaceFile as Gt, ListNotesOptions as H, INSTRUCTIONS_FILE as Ht, AddNoteInput as I, SessionEventType as In, requireWorkspace as It, NoteCitation as J, createWorkspace as Jt, NoteActivity as K, WorkspaceRepo as Kt, AddNoteResult as L, isEventType as Ln, resolveWorkspace as Lt, buildStatusView as M, EVENT_TYPES as Mn, WorkspaceResolution as Mt, formatClock as N, EventType as Nn, isInside as Nt, renderMemory as O, isAgentStatus as On, allHosts as Ot, TURNS as P, LogEventInput as Pn, repoNameFor as Pt, WeightedNote as Q, isWorkspaceName as Qt, CiteNoteInput as R, workspaceLabel as Rt, renderSections as S, MAIN_FAILED_EMOJI as Sn, HostSessionPayload as St, MEMORY_MAX_CHARACTERS as T, OPEN_AGENT_STATUSES as Tn, HostToolPayload as Tt, NOTE_KINDS as U, WORKSPACE_FILE as Ut, DropNoteInput as V, DropWorkspaceOptions as Vt, NOTE_TEXT_LIMIT as W, Workspace as Wt, NoteKind as X, dropWorkspace as Xt, NoteDetail as Y, definitionInstructions as Yt, STALE_AFTER_ACTIVE_DAYS as Z, expandHome as Zt, renderAgentLine as _, AgentStatus as _n, DEFAULT_HOST as _t, openCarnet as a, Agent as an, SetTableInput as at, renderNotes as b, KIND_LEGEND as bn, HostRender as bt, MAIN_FAILED_SUFFIX as c, FinishAgentInput as cn, CreateSessionInput as ct, MAIN_WORKING_SUFFIX as d, REPORTING_NOTE as dn, ListSessionsOptions as dt, loadWorkspace as en, localDay as et, NOTES_FOLD_LINES as f, StartAgentInput as fn, MINIMUM_ID_PREFIX as ft, SIMILAR_PREFIX as g, AGENT_STATUSES as gn, shortId as gt, RenderOptions as h, statusWhenDone as hn, SessionStatus as ht, ResolvedCarnet as i, AGENT_KINDS as in, workspaceRepoNames as it, StatusViewOptions as j, CarnetEvent as jn, WorkspaceOrigin as jt, StatusLine as k, isUserActionStatus as kn, hostById as kt, MAIN_HEADER as l, ListAgentsOptions as ln, HookEnv as lt, NotesMode as m, isAgentKind as mn, SessionKind as mt, CarnetOptions as n, workspaceExists as nn, sessionNoteActivity as nt, openResolvedCarnet as o, AgentKind as on, TableItem as ot, NOTES_HEADER as p, UpdateAgentInput as pn, Session as pt, NoteActivityKind as q, addWorkspaceRepo as qt, OpenCarnetOptions as r, workspaceHosts as rn, similarity as rt, openWorkspaceCarnet as s, DEFAULT_AGENT_KIND as sn, MergeResult as st, Carnet as t, removeWorkspaceRepo as tn, memoryHalfLife as tt, MAIN_WAITING_SUFFIX as u, PUBLISH_FALLBACK_MILLISECONDS as un, HookSessionPayload as ut, renderMainLine as v, EMOJI as vn, Host as vt, renderTableLine as w, MAIN_WORKING_EMOJI as wn, HostSubagentPayload as wt, renderNotesSummary as x, LEGEND as xn, HostSessionEndPayload as xt, renderNoteLine as y, KIND_ABBREVIATIONS as yn, HostPromptPayload as yt, DEFAULT_HALF_LIFE_DAYS as z, AGENTS_FILE as zt };
|
|
602
|
+
//# sourceMappingURL=carnet-jmxAmm-u.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carnet-jmxAmm-u.d.mts","names":["_$__merge_ts0.MergeResult","_$__agents_ts0.Agent","_$__questions_ts0.Question","_$__findings_ts0.Finding","_$__table_ts0.TableItem","_$__events_ts0.CarnetEvent","_$__notes_ts0.AddNoteResult","_$__notes_ts0.Note","_$__notes_ts0.NoteDetail","_$__notes_ts0.WeightedNote","_$__notes_ts0.NoteCitation","_$__notes_ts0.NoteActivity","_$__status_view_ts0.StatusView"],"sources":["../src/context.ts","../src/events.ts","../src/status/model.ts","../src/agents.ts","../src/workspace/workspace.ts","../src/workspace/locate.ts","../src/hosts/host.ts","../src/sessions.ts","../src/merge.ts","../src/questions.ts","../src/findings.ts","../src/table.ts","../src/notes.ts","../src/turn.ts","../src/status/view.ts","../src/memory.ts","../src/status/render.ts","../src/carnet.ts"],"mappings":";UAEiB;EACf,IAAI;EACJ,WAAW;EAEX;;cCFW;cAaA;KAOD,yBAAyB;KACzB,2BAA2B;KAC3B,YAAY,iBAAiB;UAIxB;EACf;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN;EACA;EACA;EACA;;iBAqBc,YAAY,iBAAiB,SAAS;cCnEzC;KAYD,sBAAsB;cAErB;KAUD,2BAA2B;cAE1B,OAAO,OAAO,QAAQ;cAWtB;c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;EACf;EACA;;cCtBW;KACD,0BAA0B;cAEzB;KACD,0BAA0B;UAErB;EACf,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA;EACA,UAAU;EACV;EACA;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA,UAAU;EACV;;UCzBe;EACf;EACA;EACA,QAAQ;EACR;;UAGe;EACf;EACA,SAAS;;cCVE;KACD,mBAAmB;cAElB;cACA;cACA;cACA;iBAIG,WAAW,gBAAgB,SAAS;iBAIpC,eAAe;UAKd;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe,qBAAqB;EACpC;EACA;;UAGe,mBAAmB;EAClC,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;;iBA0Cc,mBAAmB,WAAW;iBAqB9B,WAAW,eAAe;iBAS1B,SAAS,MAAM;KAsQnB;UAEK;EACf,UAAU;EACV;EACA,MAAM;EACN;EACA;EACA;EACA;;iBAec,oBAAoB,KAAK,KAAK,kBAAkB;cC3bnD;KACD,eAAe;UCOV;EACf;EACA,MAAM;EACN,QAAQ;EACR;EAEA;EACA;;UAGe;EACf;EACA;EACA,OAAO;EACP,MAAM;EACN,SAAS;EACT,SAAS;EACT,OAAO;;UAGQ;EACf,OAAO;;iBAkFO,YAAY,MAAM;iBAMlB,gBACd,KAAK,KACL,SAAS,SACT,UAAS,oBACR;cChHU;iBAWG,oBAAoB;UAKnB;EACf;EACA;;UAGQ;EACR;EACA,OAAO;;iBAsBO,aAAa,OAAO,aAAa;cC1CpC;cACA;cACA;cACA;iBAEG,gBAAgB,MAAM;iBAUtB,eAAe,MAAM,kBAAkB,MAAM;iBAM7C,gBAAgB,MAAM,YAAY;cAarC;cACA;cAGA;KAED;UAEK;EACf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BAAyB;iBAWrD,oBACd,WAAW,kBACX,UAAS,oBACR"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isNoteKind, $t as listWorkspaces, A as StatusView, An as AgentEventType, At as ResolveWorkspaceOptions, B as DUPLICATE_SIMILARITY, Bt as CreateWorkspaceOptions, C as renderStatus, Cn as MAIN_WAITING_EMOJI, Ct as HostStopPayload, D as memoryMaxCharacters, Dn as UserActionStatus, Dt as ResumeCommand, E as MemoryOptions, En as USER_ACTION_STATUSES, Et as LaunchOptions, F as Turn, Fn as SESSION_EVENT_TYPES, Ft as repoPathFor, G as Note, Gt as WorkspaceFile, H as ListNotesOptions, Ht as INSTRUCTIONS_FILE, I as AddNoteInput, In as SessionEventType, It as requireWorkspace, J as NoteCitation, Jt as createWorkspace, K as NoteActivity, Kt as WorkspaceRepo, L as AddNoteResult, Ln as isEventType, Lt as resolveWorkspace, M as buildStatusView, Mn as EVENT_TYPES, Mt as WorkspaceResolution, N as formatClock, Nn as EventType, Nt as isInside, O as renderMemory, On as isAgentStatus, Ot as allHosts, P as TURNS, Pn as LogEventInput, Pt as repoNameFor, Q as WeightedNote, Qt as isWorkspaceName, R as CiteNoteInput, Rt as workspaceLabel, S as renderSections, Sn as MAIN_FAILED_EMOJI, St as HostSessionPayload, T as MEMORY_MAX_CHARACTERS, Tn as OPEN_AGENT_STATUSES, Tt as HostToolPayload, U as NOTE_KINDS, Ut as WORKSPACE_FILE, V as DropNoteInput, Vt as DropWorkspaceOptions, W as NOTE_TEXT_LIMIT, Wt as Workspace, X as NoteKind, Xt as dropWorkspace, Y as NoteDetail, Yt as definitionInstructions, Z as STALE_AFTER_ACTIVE_DAYS, Zt as expandHome, _ as renderAgentLine, _n as AgentStatus, _t as DEFAULT_HOST, a as openCarnet, an as Agent, at as SetTableInput, b as renderNotes, bn as KIND_LEGEND, bt as HostRender, c as MAIN_FAILED_SUFFIX, cn as FinishAgentInput, ct as CreateSessionInput, d as MAIN_WORKING_SUFFIX, dn as REPORTING_NOTE, dt as ListSessionsOptions, en as loadWorkspace, et as localDay, f as NOTES_FOLD_LINES, fn as StartAgentInput, ft as MINIMUM_ID_PREFIX, g as SIMILAR_PREFIX, gn as AGENT_STATUSES, gt as shortId, h as RenderOptions, hn as statusWhenDone, ht as SessionStatus, i as ResolvedCarnet, in as AGENT_KINDS, it as workspaceRepoNames, j as StatusViewOptions, jn as CarnetEvent, jt as WorkspaceOrigin, k as StatusLine, kn as isUserActionStatus, kt as hostById, l as MAIN_HEADER, ln as ListAgentsOptions, lt as HookEnv, m as NotesMode, mn as isAgentKind, mt as SessionKind, n as CarnetOptions, nn as workspaceExists, nt as sessionNoteActivity, o as openResolvedCarnet, on as AgentKind, ot as TableItem, p as NOTES_HEADER, pn as UpdateAgentInput, pt as Session, q as NoteActivityKind, qt as addWorkspaceRepo, r as OpenCarnetOptions, rn as workspaceHosts, rt as similarity, s as openWorkspaceCarnet, sn as DEFAULT_AGENT_KIND, st as MergeResult, t as Carnet, tn as removeWorkspaceRepo, tt as memoryHalfLife, u as MAIN_WAITING_SUFFIX, un as PUBLISH_FALLBACK_MILLISECONDS, ut as HookSessionPayload, v as renderMainLine, vn as EMOJI, vt as Host, w as renderTableLine, wn as MAIN_WORKING_EMOJI, wt as HostSubagentPayload, x as renderNotesSummary, xn as LEGEND, xt as HostSessionEndPayload, y as renderNoteLine, yn as KIND_ABBREVIATIONS, yt as HostPromptPayload, z as DEFAULT_HALF_LIFE_DAYS, zt as AGENTS_FILE } from "./carnet-jmxAmm-u.mjs";
|
|
2
2
|
import { DatabaseSync } from "node:sqlite";
|
|
3
3
|
interface MoveOptions {
|
|
4
4
|
merge?: boolean | undefined;
|
|
@@ -14,16 +14,17 @@ interface MoveResult {
|
|
|
14
14
|
keptNotes: number;
|
|
15
15
|
}
|
|
16
16
|
export declare function moveSession(carnet: Carnet, sessionId: string, targetWorkspace: string, options?: MoveOptions): MoveResult;
|
|
17
|
-
export declare function sessionWorkspaceName(db: DatabaseSync, sessionId: string): string |
|
|
17
|
+
export declare function sessionWorkspaceName(db: DatabaseSync, sessionId: string): string | undefined;
|
|
18
18
|
export declare function archiveWorkspaceSessions(db: DatabaseSync, name: string, at: string): number;
|
|
19
19
|
export declare function deleteWorkspaceNotes(db: DatabaseSync, name: string): number;
|
|
20
20
|
export declare function workspaceSessionCounts(db: DatabaseSync): Map<string, number>;
|
|
21
|
+
export declare function workspaceLastActive(db: DatabaseSync): Map<string, string>;
|
|
21
22
|
export declare const MEMORY_DB = ":memory:";
|
|
22
23
|
export declare function openDatabase(path: string): DatabaseSync;
|
|
23
24
|
export declare const migrations: readonly string[];
|
|
24
25
|
export declare function schemaVersion(db: DatabaseSync): number;
|
|
25
26
|
export declare function migrate(db: DatabaseSync): void;
|
|
26
|
-
type CarnetErrorCode = 'NO_WORKSPACE' | '
|
|
27
|
+
type CarnetErrorCode = 'NO_WORKSPACE' | 'WORKSPACE_EXISTS' | 'WORKSPACE_NOT_FOUND' | 'WORKSPACE_NAME_INVALID' | 'REPO_NOT_FOUND' | 'REPO_NAME_TAKEN' | 'NOTE_NOT_FOUND' | 'INVALID_NOTE' | 'UNKNOWN_HOST' | 'NO_SESSION' | 'SESSION_NOT_FOUND' | 'SESSION_AMBIGUOUS' | 'SESSION_NAME_TAKEN' | 'SESSION_NAME_REQUIRED' | 'SESSION_RUNNING' | 'SESSION_KIND_INVALID' | 'SESSION_MERGE_INVALID' | 'SESSION_EXISTS' | 'SESSION_MOVE_INVALID' | 'SESSION_CWD_MISSING' | 'RUN_DIRECTORY_FILE_CONFLICT' | 'WORKSPACE_INSTRUCTIONS_CONFLICT' | 'AGENT_EXISTS' | 'AGENT_NOT_FOUND' | 'INVALID_TARGET' | 'INVALID_KIND' | 'INVALID_QUESTIONS' | 'QUESTION_NOT_FOUND' | 'FINDING_NOT_FOUND' | 'REASON_REQUIRED' | 'SECTION_NOT_FOUND' | 'REPORT_MISSING' | 'INVALID_STATUS' | 'INVALID_EVENT_TYPE' | 'COMMIT_REQUIRED';
|
|
27
28
|
export declare class CarnetError extends Error {
|
|
28
29
|
readonly code: CarnetErrorCode;
|
|
29
30
|
constructor(code: CarnetErrorCode, message: string);
|
|
@@ -44,6 +45,7 @@ export declare function corePromptPath(env?: NodeJS.ProcessEnv): string;
|
|
|
44
45
|
export declare function reportsDirectory(workspace: Workspace): string;
|
|
45
46
|
export declare function reportPath(workspace: Workspace, agentName: string): string;
|
|
46
47
|
export declare function handleSessionEnd(carnet: Carnet, payload: HostSessionEndPayload): Session | undefined;
|
|
48
|
+
export declare function handleStop(carnet: Carnet, payload: HostStopPayload): void;
|
|
47
49
|
interface SessionStartResult {
|
|
48
50
|
session: Session;
|
|
49
51
|
additionalContext?: string;
|
|
@@ -75,10 +77,25 @@ export declare function compactReminder(workspace: Workspace | null, env?: NodeJ
|
|
|
75
77
|
export declare function outsideRucherContext(workspace: Workspace | null, env?: NodeJS.ProcessEnv): string;
|
|
76
78
|
export declare const OUTSIDE_RUCHER_NOTICE = "rucher: session started without rucher, the Rucher rules are not in its system prompt (use rucher new, tmp or resume)";
|
|
77
79
|
export declare const RULES_UPDATED_NOTICE = "rucher: rules updated, will apply after the next compaction or in a new session";
|
|
78
|
-
export declare const SUBAGENT_RULES = "Rucher rules for sub-agents: never commit, push or stash. When your task asks for a report, write it to the file it names. If your prompt names you as a Carnet agent, call agent_update at meaningful progress and agent_done as your last tool action, then reply with one line.";
|
|
79
|
-
export declare const CORE_RULES = "- Work can be parallel, review stays sequential: forks work at the same time, the human handles their results one at a time.\n- The human keeps the hand: only the human launches
|
|
80
|
+
export declare const SUBAGENT_RULES = "Rucher rules for sub-agents: never commit, push or stash. When your task asks for a report, write it to the file it names. If your prompt names you as a Carnet agent, follow the contract of its kind, call agent_update at meaningful progress and agent_done as your last tool action, then reply with one line.";
|
|
81
|
+
export declare const CORE_RULES = "- Work can be parallel, review stays sequential: forks work at the same time, the human handles their results one at a time.\n- The human keeps the hand: only the human launches agents, triggers their final action (inject, validate, apply, triage), applies, tests and commits. Agents propose, they never push.\n- Status lives in Carnet: agent statuses, the Main line and the journal go through the Carnet tools, never into status files nor chat updates. Update before and after each piece of work.\n- When an agent finishes, say only \"<name> finished, report ready\". Never summarise, quote or act on its report or final message until the human asks for that report or its final action, even when answering about something else.\n- Agents never commit, push, stash or record notes. An agent follows its kind's contract, writes its report to a file ending with a Learnings section, calls agent_done as its last tool action, then replies with one line that carries no results, such as \"<name> done, report written\". Only the main agent records notes, at the end of a step.\n- To launch agents or handle their results, load the rucher skill: it holds the full workflow.";
|
|
80
82
|
export declare function handleUserPromptSubmit(carnet: Carnet, host: Host, payload: HostPromptPayload): Session;
|
|
81
83
|
export declare function handleToolUse(carnet: Carnet, payload: HostToolPayload, env: HookEnv): string | undefined;
|
|
84
|
+
export declare const WAITING_TOOL = "AskUserQuestion";
|
|
85
|
+
export declare function handleToolStart(carnet: Carnet, payload: HostToolPayload): void;
|
|
86
|
+
export declare function guardSubagentCall(carnet: Carnet, payload: HostToolPayload, scratchRoot: string): string | undefined;
|
|
87
|
+
export declare const GUARDED_TOOLS: Set<string>;
|
|
88
|
+
interface GuardInput {
|
|
89
|
+
kind: AgentKind;
|
|
90
|
+
toolName: string;
|
|
91
|
+
filePath?: string | undefined;
|
|
92
|
+
command?: string | undefined;
|
|
93
|
+
cwd?: string | undefined;
|
|
94
|
+
worktree?: string | null | undefined;
|
|
95
|
+
scratchRoot: string;
|
|
96
|
+
}
|
|
97
|
+
export declare function guardToolCall(input: GuardInput): string | undefined;
|
|
98
|
+
export declare function kindOfAgentType(agentType: string | undefined): AgentKind | undefined;
|
|
82
99
|
export declare function transcriptTitle(path: string): string | undefined;
|
|
83
100
|
export declare function workspaceSettings(workspace: Workspace): Record<string, unknown>;
|
|
84
101
|
export declare const claudeCode: Host;
|
|
@@ -124,5 +141,5 @@ export declare function markdownCopy(content: string): string;
|
|
|
124
141
|
export declare function removeStaleCopies(directory: string, keep: ReadonlySet<string>): string[];
|
|
125
142
|
export declare function writeGenerated(path: string, content: string): boolean;
|
|
126
143
|
export declare function mergeSettings(base: Record<string, unknown>, extra: Record<string, unknown>): Record<string, unknown>;
|
|
127
|
-
export { AGENTS_FILE, AGENT_STATUSES, type AddNoteInput, type AddNoteResult, type Agent, type AgentEventType, type AgentStatus, type AgentStep, type AppendPromptFile, type AssembledPrompt, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type CiteNoteInput, type CreateSessionInput, type CreateWorkspaceOptions, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DUPLICATE_SIMILARITY, type DropNoteInput, type DropWorkspaceOptions, EMOJI, EVENT_TYPES, type EventType, type FinishAgentInput, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostRender, type HostSessionEndPayload, type HostSessionPayload, type HostSubagentPayload, type HostToolPayload, INSTRUCTIONS_FILE, LEGEND, type LaunchOptions, type ListAgentsOptions, type ListNotesOptions, type ListSessionsOptions, type LogEventInput, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, type MemoryOptions, type MergeResult, type MoveOptions, type MoveResult, NOTES_FOLD_LINES, NOTES_HEADER, NOTE_KINDS, NOTE_TEXT_LIMIT, type Note, type NoteActivity, type NoteActivityKind, type NoteCitation, type NoteDetail, type NoteKind, type NotesMode, type OpenCarnetOptions, PUBLISH_FALLBACK_MILLISECONDS, type PromptSession, REPORTING_NOTE, type RenderOptions, type RenderResult, type ResolveWorkspaceOptions, type ResolvedCarnet, type ResumeCommand, type ResumeContextOptions, type RucherPaths, type RunDirectoryRenderOptions, SESSION_EVENT_TYPES, SIMILAR_PREFIX, STALE_AFTER_ACTIVE_DAYS, type Session, type SessionEventType, type SessionKind, type SessionStartResult, type SessionStatus, type SetTableInput, type StartAgentInput, type StatusLine, type StatusView, type StepAgentInput, type TableItem, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, WORKSPACE_FILE, type WeightedNote, type Workspace, type WorkspaceFile, type WorkspaceOrigin, type WorkspaceRepo, type WorkspaceResolution, addWorkspaceRepo, allHosts,
|
|
144
|
+
export { AGENTS_FILE, AGENT_KINDS, AGENT_STATUSES, type AddNoteInput, type AddNoteResult, type Agent, type AgentEventType, type AgentKind, type AgentStatus, type AgentStep, type AppendPromptFile, type AssembledPrompt, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type CiteNoteInput, type CreateSessionInput, type CreateWorkspaceOptions, DEFAULT_AGENT_KIND, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DUPLICATE_SIMILARITY, type DropNoteInput, type DropWorkspaceOptions, EMOJI, EVENT_TYPES, type EventType, type FinishAgentInput, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostRender, type HostSessionEndPayload, type HostSessionPayload, type HostSubagentPayload, type HostToolPayload, INSTRUCTIONS_FILE, KIND_ABBREVIATIONS, KIND_LEGEND, LEGEND, type LaunchOptions, type ListAgentsOptions, type ListNotesOptions, type ListSessionsOptions, type LogEventInput, MAIN_FAILED_EMOJI, MAIN_FAILED_SUFFIX, MAIN_HEADER, MAIN_WAITING_EMOJI, MAIN_WAITING_SUFFIX, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, type MemoryOptions, type MergeResult, type MoveOptions, type MoveResult, NOTES_FOLD_LINES, NOTES_HEADER, NOTE_KINDS, NOTE_TEXT_LIMIT, type Note, type NoteActivity, type NoteActivityKind, type NoteCitation, type NoteDetail, type NoteKind, type NotesMode, type OpenCarnetOptions, PUBLISH_FALLBACK_MILLISECONDS, type PromptSession, REPORTING_NOTE, type RenderOptions, type RenderResult, type ResolveWorkspaceOptions, type ResolvedCarnet, type ResumeCommand, type ResumeContextOptions, type RucherPaths, type RunDirectoryRenderOptions, SESSION_EVENT_TYPES, SIMILAR_PREFIX, STALE_AFTER_ACTIVE_DAYS, type Session, type SessionEventType, type SessionKind, type SessionStartResult, type SessionStatus, type SetTableInput, type StartAgentInput, type StatusLine, type StatusView, type StatusViewOptions, type StepAgentInput, TURNS, type TableItem, type Turn, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, WORKSPACE_FILE, type WeightedNote, type Workspace, type WorkspaceFile, type WorkspaceOrigin, type WorkspaceRepo, type WorkspaceResolution, addWorkspaceRepo, allHosts, buildStatusView, createWorkspace, definitionInstructions, dropWorkspace, expandHome, formatClock, hostById, isAgentKind, isAgentStatus, isEventType, isInside, isNoteKind, isUserActionStatus, isWorkspaceName, listWorkspaces, loadWorkspace, localDay, memoryHalfLife, memoryMaxCharacters, openCarnet, openResolvedCarnet, openWorkspaceCarnet, removeWorkspaceRepo, renderAgentLine, renderMainLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderSections, renderStatus, renderTableLine, repoNameFor, repoPathFor, requireWorkspace, resolveWorkspace, sessionNoteActivity, shortId, similarity, statusWhenDone, workspaceExists, workspaceHosts, workspaceLabel, workspaceRepoNames };
|
|
128
145
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/move.ts","../src/workspace-rows.ts","../src/db/open.ts","../src/db/schema.ts","../src/errors.ts","../src/paths.ts","../src/hook/session-end.ts","../src/hook/session-start.ts","../src/prompt/prompt.ts","../src/prompt/core-rules.ts","../src/hook/user-prompt-submit.ts","../src/hook/post-tool-use.ts","../src/hosts/claude-code.ts","../src/purge.ts","../src/resume.ts","../src/subagents.ts","../src/status/note.ts","../src/steps.ts","../src/render.ts","../src/run-directory-files.ts"],"mappings":";;UAIiB;EACf;EACA;;UAGe;EACf,SAAS;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;;wBAwBc,YACd,QAAQ,QACR,mBACA,yBACA,UAAS,cACR;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/move.ts","../src/workspace-rows.ts","../src/db/open.ts","../src/db/schema.ts","../src/errors.ts","../src/paths.ts","../src/hook/session-end.ts","../src/hook/session-start.ts","../src/prompt/prompt.ts","../src/prompt/core-rules.ts","../src/hook/user-prompt-submit.ts","../src/hook/post-tool-use.ts","../src/guard.ts","../src/hosts/claude-code.ts","../src/purge.ts","../src/resume.ts","../src/subagents.ts","../src/status/note.ts","../src/steps.ts","../src/render.ts","../src/run-directory-files.ts"],"mappings":";;UAIiB;EACf;EACA;;UAGe;EACf,SAAS;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;;wBAwBc,YACd,QAAQ,QACR,mBACA,yBACA,UAAS,cACR;wBC/Ba,qBAAqB,IAAI,cAAc;wBAOvC,yBAAyB,IAAI,cAAc,cAAc;wBAiBzD,qBAAqB,IAAI,cAAc;wBAIvC,uBAAuB,IAAI,eAAe;wBAU1C,oBAAoB,IAAI,eAAe;qBCjD1C;wBAEG,aAAa,eAAe;qBCQ/B;wBAiWG,cAAc,IAAI;wBASlB,QAAQ,IAAI;KCvXhB;qBAqCC,oBAAoB;WAEpB,MAAM;EADjB,YACW,MAAM,iBACf;;UCpCa;EACf;EACA;EACA;EACA;;wBAQc,YAAY,MAAK,OAAO,aAA2B;wBAuBnD,aAAa,MAAM,OAAO;wBAI1B,oBAAoB,MAAM,OAAO;wBAIjC,oBAAoB,cAAc,MAAM,OAAO;wBAI/C,oBAAoB,cAAc,MAAM,OAAO;wBAI/C,iBAAiB,MAAM,OAAO;wBAI9B,eAAe,MAAM,OAAO;wBAI5B,iBAAiB,WAAW;wBAI5B,WAAW,WAAW,WAAW;wBC/DjC,iBACd,QAAQ,QACR,SAAS,wBACR;wBAOa,WAAW,QAAQ,QAAQ,SAAS;UCEnC;EACf,SAAS;EACT;EACA;EACA;;wBAsCc,mBACd,QAAQ,QACR,SAAS,oBACT,KAAK,UACJ;qBCtDU;UAEI;EACf;EACA;EACA,MAAM;;UAGS;EACf;EACA;;UAGe;EACf;EACA;;wBASc,UAAU,MA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