@rucher/carnet 0.2.0 → 0.3.0-beta.1

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @rucher/carnet
2
2
 
3
- Shared state for Rucher: workspaces, sessions, agents, the "On the table" line and the event journal, stored in one SQLite database for every workspace (`~/.local/share/rucher/carnet.db`, via `node:sqlite`), with workspaces defined in `~/.config/rucher/workspaces/<name>/workspace.json`.
3
+ Shared state for Rucher: workspaces, sessions, agents, the Main line and the event journal, stored in one SQLite database for every workspace (`~/.local/share/rucher/carnet.db`, via `node:sqlite`), with workspaces defined in `~/.config/rucher/workspaces/<name>/workspace.json`.
4
4
 
5
- Used by the `rucher` CLI and the Carnet MCP server. See [`docs/reference.md`](https://github.com/Florian-Varrin/Rucher/blob/master/docs/reference.md) in the [repository](https://github.com/Florian-Varrin/Rucher).
5
+ Used by the `rucher` CLI and the Carnet MCP server. See the [documentation](https://github.com/Florian-Varrin/Rucher/blob/master/docs/README.md) in the [repository](https://github.com/Florian-Varrin/Rucher).
6
6
 
7
7
  ```ts
8
8
  import { openCarnet } from '@rucher/carnet';
@@ -4,42 +4,91 @@ interface Ctx {
4
4
  now: () => Date;
5
5
  workspace: string | null;
6
6
  }
7
- declare const AGENT_STATUSES: readonly ['running', 'discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch', 'closed'];
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;
30
+ declare const AGENT_STATUSES: readonly ['running', 'discussing', 'answer', 'review', 'apply', 'test', 'closed'];
8
31
  type AgentStatus = (typeof AGENT_STATUSES)[number];
9
- declare const USER_ACTION_STATUSES: readonly ['discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch'];
32
+ declare const USER_ACTION_STATUSES: readonly ['discussing', 'answer', 'review', 'apply', 'test'];
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 LEGEND = "⚙️ main working · 💬 discussing · ❓ answer · 👀 review · 📥 apply · 🧪 test · ✅ commit · 🌿 branch · ⏳ running";
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 · ⏳ running";
39
+ declare const KIND_ABBREVIATIONS: {
40
+ readonly research: 'rs';
41
+ readonly plan: 'pl';
42
+ readonly implement: 'im';
43
+ readonly review: 'rv';
44
+ };
45
+ declare function kindTag(kind: keyof typeof KIND_ABBREVIATIONS): string;
46
+ declare const KIND_TAG_PATTERN: RegExp;
47
+ declare const KIND_LEGEND = "[rs] research · [pl] plan · [im] implement · [rv] review";
14
48
  declare function isAgentStatus(value: unknown): value is AgentStatus;
15
49
  declare function isUserActionStatus(value: unknown): value is UserActionStatus;
16
- declare const OPEN_AGENT_STATUSES: readonly ["running", "discussing", "answer", "review", "apply", "test", "commit", "branch"];
50
+ declare const OPEN_AGENT_STATUSES: readonly ["running", "discussing", "answer", "review", "apply", "test"];
51
+ declare const AGENT_KINDS: readonly ['research', 'plan', 'implement', 'review'];
52
+ type AgentKind = (typeof AGENT_KINDS)[number];
53
+ declare const KIND_REQUIRED = "kind is required: research, plan, implement or review";
54
+ declare function isAgentKind(value: unknown): value is AgentKind;
17
55
  interface Agent {
18
56
  session: string;
19
57
  name: string;
58
+ kind: AgentKind;
59
+ promotedFrom: AgentKind | null;
60
+ target: string | null;
61
+ blockedOn: string | null;
20
62
  task: string | null;
21
63
  status: AgentStatus;
22
64
  note: string | null;
23
65
  reportPath: string | null;
24
66
  baseCommit: string | null;
25
67
  worktree: string | null;
68
+ sandbox: string | null;
26
69
  queueOrder: number | null;
27
70
  hostAgentId: string | null;
28
71
  pendingStatus: AgentStatus | null;
29
72
  doneAt: string | null;
30
73
  startedAt: string;
31
74
  updatedAt: string;
75
+ statusSince: string;
32
76
  }
33
77
  interface StartAgentInput {
34
78
  name: string;
35
79
  task: string;
80
+ kind: AgentKind;
81
+ target?: string | undefined;
36
82
  baseCommit?: string | undefined;
37
83
  worktree?: string | undefined;
84
+ sandbox?: string | undefined;
38
85
  }
86
+ declare const SANDBOX_KINDS: readonly AgentKind[];
39
87
  interface UpdateAgentInput {
40
88
  status: AgentStatus;
41
- note?: string | undefined;
89
+ note?: string | null | undefined;
42
90
  reportPath?: string | undefined;
91
+ blockedOn?: string | null | undefined;
43
92
  }
44
93
  interface FinishAgentInput {
45
94
  reportPath: string;
@@ -50,6 +99,12 @@ interface ListAgentsOptions {
50
99
  }
51
100
  declare const REPORTING_NOTE = "reporting";
52
101
  declare const PUBLISH_FALLBACK_MILLISECONDS = 120000;
102
+ declare function statusWhenDone(kind: AgentKind, hasQuestions: boolean): AgentStatus;
103
+ interface PromoteAgentInput {
104
+ kind: AgentKind | undefined;
105
+ worktree?: string | undefined;
106
+ baseCommit?: string | undefined;
107
+ }
53
108
  interface WorkspaceRepo {
54
109
  path: string;
55
110
  name: string;
@@ -96,11 +151,10 @@ declare function dropWorkspace(name: string, options?: DropWorkspaceOptions): Wo
96
151
  declare function isInside(directory: string, path: string): boolean;
97
152
  declare function repoNameFor(workspace: Workspace | null, path: string | undefined): string | null;
98
153
  declare function repoPathFor(workspace: Workspace | null, path: string | undefined | null): string | null;
99
- type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | 'repo' | 'none';
154
+ type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | 'none';
100
155
  interface WorkspaceResolution {
101
156
  workspace: Workspace | null;
102
157
  origin: WorkspaceOrigin;
103
- repo?: WorkspaceRepo | undefined;
104
158
  }
105
159
  interface ResolveWorkspaceOptions {
106
160
  db?: DatabaseSync | undefined;
@@ -112,7 +166,10 @@ interface ResolveWorkspaceOptions {
112
166
  declare function resolveWorkspace({ db, sessionId, workspace, cwd, env }?: ResolveWorkspaceOptions): WorkspaceResolution;
113
167
  declare function workspaceLabel(workspace: Workspace | null): string;
114
168
  declare function requireWorkspace(workspace: Workspace | null): Workspace;
115
- declare function ambiguousWorkspaceContext(reason: string): string;
169
+ interface UndoStep {
170
+ command: string;
171
+ run: () => void;
172
+ }
116
173
  interface HostSessionPayload {
117
174
  session_id: string;
118
175
  cwd?: string | undefined;
@@ -133,6 +190,11 @@ interface HostSubagentPayload {
133
190
  description?: string | undefined;
134
191
  agent_transcript_path?: string | undefined;
135
192
  }
193
+ interface HostStopPayload {
194
+ session_id: string;
195
+ cwd?: string | undefined;
196
+ failed: boolean;
197
+ }
136
198
  interface HostSessionEndPayload {
137
199
  session_id: string;
138
200
  cwd?: string | undefined;
@@ -143,7 +205,12 @@ interface HostToolPayload {
143
205
  cwd?: string | undefined;
144
206
  tool_name?: string | undefined;
145
207
  agent_id?: string | undefined;
208
+ agent_type?: string | undefined;
146
209
  path?: string | undefined;
210
+ file_path?: string | undefined;
211
+ command?: string | undefined;
212
+ subagent_type?: string | undefined;
213
+ launched_names?: string[] | undefined;
147
214
  }
148
215
  interface ResumeCommand {
149
216
  command: string;
@@ -159,6 +226,14 @@ interface HostRender {
159
226
  written: string[];
160
227
  removed: string[];
161
228
  }
229
+ interface RelocatedFolder {
230
+ from: string;
231
+ to: string;
232
+ }
233
+ interface ProjectRelocation {
234
+ moves: RelocatedFolder[];
235
+ undo: UndoStep[];
236
+ }
162
237
  interface Host {
163
238
  id: string;
164
239
  displayName: string;
@@ -166,6 +241,7 @@ interface Host {
166
241
  sessionIdFromEnvironment(env: NodeJS.ProcessEnv): string | undefined;
167
242
  projectDirectory(env: NodeJS.ProcessEnv): string | undefined;
168
243
  parseSessionPayload(json: string): HostSessionPayload;
244
+ parseStopPayload(json: string): HostStopPayload;
169
245
  parsePromptPayload(json: string): HostPromptPayload;
170
246
  parseSubagentPayload(json: string): HostSubagentPayload;
171
247
  parseSessionEndPayload(json: string): HostSessionEndPayload;
@@ -180,7 +256,10 @@ interface Host {
180
256
  renameInstruction(name: string): string;
181
257
  transcriptFiles(session: Session, env?: NodeJS.ProcessEnv): string[];
182
258
  hasConversation(session: Session, env?: NodeJS.ProcessEnv): boolean;
259
+ continues(parent: Session, childId: string, env?: NodeJS.ProcessEnv): boolean;
183
260
  renderRunDirectory(workspace: Workspace): HostRender;
261
+ relocateProject?(from: string, to: string, env: NodeJS.ProcessEnv, mode?: 'move' | 'merge'): ProjectRelocation | null;
262
+ moveTrust?(from: string, to: string | null, env: NodeJS.ProcessEnv): boolean;
184
263
  }
185
264
  declare const DEFAULT_HOST = "claude-code";
186
265
  declare function allHosts(): Host[];
@@ -189,7 +268,7 @@ type SessionKind = 'active' | 'temp';
189
268
  type SessionStatus = 'running' | 'idle' | 'archived';
190
269
  interface Session {
191
270
  id: string;
192
- workspace: string | null;
271
+ workspace: string;
193
272
  name: string | null;
194
273
  purpose: string | null;
195
274
  kind: SessionKind;
@@ -202,6 +281,7 @@ interface Session {
202
281
  lastTitle: string | null;
203
282
  parentId: string | null;
204
283
  promptVersion: string | null;
284
+ pluginVersion: string | null;
205
285
  createdAt: string;
206
286
  lastActiveAt: string;
207
287
  endedAt: string | null;
@@ -218,6 +298,7 @@ interface HookEnv {
218
298
  RUCHER_PROMPT_VERSION?: string | undefined;
219
299
  RUCHER_MEMORY_MAX_CHARACTERS?: string | undefined;
220
300
  RUCHER_MEMORY_HALF_LIFE_DAYS?: string | undefined;
301
+ CLAUDE_CONFIG_DIR?: string | undefined;
221
302
  }
222
303
  interface CreateSessionInput {
223
304
  id: string;
@@ -240,41 +321,61 @@ interface MergeResult {
240
321
  movedEvents: number;
241
322
  movedTable: boolean;
242
323
  }
324
+ interface QuestionInput {
325
+ text: string;
326
+ context?: string | undefined;
327
+ recommendation: string;
328
+ alternatives?: readonly string[] | undefined;
329
+ }
330
+ interface Question {
331
+ n: number;
332
+ total: number;
333
+ text: string;
334
+ context: string | null;
335
+ recommendation: string;
336
+ alternatives: string[];
337
+ answer: string | null;
338
+ answeredAt: string | null;
339
+ }
340
+ interface AnswerInput {
341
+ n: number;
342
+ answer: string;
343
+ }
344
+ declare const FINDING_SEVERITIES: readonly ['blocking', 'to_fix', 'suggestion'];
345
+ type FindingSeverity = (typeof FINDING_SEVERITIES)[number];
346
+ declare const FINDING_DECISIONS: readonly ['sent', 'fixed', 'ignored'];
347
+ type FindingDecision = (typeof FINDING_DECISIONS)[number];
348
+ interface FindingInput {
349
+ severity: FindingSeverity;
350
+ location?: string | undefined;
351
+ text: string;
352
+ fix?: string | undefined;
353
+ }
354
+ interface Finding {
355
+ n: number;
356
+ total: number;
357
+ severity: FindingSeverity;
358
+ location: string | null;
359
+ text: string;
360
+ fix: string | null;
361
+ decision: FindingDecision | null;
362
+ reason: string | null;
363
+ }
364
+ interface DecisionInput {
365
+ n: number;
366
+ decision: FindingDecision;
367
+ reason?: string | undefined;
368
+ }
243
369
  interface TableItem {
244
370
  session: string;
245
371
  text: string;
246
372
  status: UserActionStatus | null;
247
- mainWorking: boolean;
248
373
  updatedAt: string;
249
374
  }
250
375
  interface SetTableInput {
251
376
  text: string;
252
- mainWorking?: boolean | undefined;
253
377
  status?: UserActionStatus | undefined;
254
378
  }
255
- declare const EVENT_TYPES: readonly ['started', 'finished', 'answered', 'applied', 'tested', 'committed', 'dropped'];
256
- declare const SESSION_EVENT_TYPES: readonly ['session.started', 'session.resumed', 'session.ended', 'session.forked'];
257
- type AgentEventType = (typeof EVENT_TYPES)[number];
258
- type SessionEventType = (typeof SESSION_EVENT_TYPES)[number];
259
- type EventType = AgentEventType | SessionEventType;
260
- interface CarnetEvent {
261
- id: number;
262
- session: string;
263
- at: string;
264
- type: EventType;
265
- agent: string | null;
266
- commit: string | null;
267
- link: string | null;
268
- note: string | null;
269
- }
270
- interface LogEventInput {
271
- type: EventType;
272
- agent?: string | undefined;
273
- commit?: string | undefined;
274
- link?: string | undefined;
275
- note?: string | undefined;
276
- }
277
- declare function isEventType(value: unknown): value is EventType;
278
379
  declare const NOTE_KINDS: readonly ['dead_end', 'decision', 'learning'];
279
380
  type NoteKind = (typeof NOTE_KINDS)[number];
280
381
  declare const NOTE_TEXT_LIMIT = 200;
@@ -355,22 +456,35 @@ interface NoteActivity {
355
456
  at: string;
356
457
  }
357
458
  declare function sessionNoteActivity(ctx: Ctx, session: string): NoteActivity[];
459
+ declare const TURNS: readonly ['working', 'waiting', 'failed'];
460
+ type Turn = (typeof TURNS)[number];
461
+ interface TurnOptions {
462
+ trackTurn?: boolean | undefined;
463
+ }
358
464
  interface StatusLine {
359
465
  name: string;
466
+ kind: AgentKind;
360
467
  status: AgentStatus;
361
468
  emoji: string;
469
+ action: string | null;
362
470
  note: string | null;
471
+ pinned: boolean;
363
472
  }
364
473
  interface StatusView {
365
474
  time: string;
366
475
  sessionName: string | null;
367
476
  table: TableItem | null;
477
+ turn: Turn | null;
368
478
  waiting: StatusLine[];
479
+ blocked: StatusLine[];
369
480
  running: StatusLine[];
370
481
  notes: NoteActivity[];
371
482
  }
483
+ interface StatusViewOptions {
484
+ kind?: AgentKind | undefined;
485
+ }
372
486
  declare function formatClock(date: Date): string;
373
- declare function buildStatusView(ctx: Ctx, session: Session): StatusView;
487
+ declare function buildStatusView(ctx: Ctx, session: Session, options?: StatusViewOptions): StatusView;
374
488
  declare const MEMORY_MAX_CHARACTERS = 2000;
375
489
  declare function memoryMaxCharacters(value: string | undefined): number;
376
490
  interface MemoryOptions {
@@ -382,9 +496,15 @@ interface MemoryScope {
382
496
  notes: WeightedNote[];
383
497
  }
384
498
  declare function renderMemory(scope: MemoryScope, maxCharacters?: number): string;
385
- declare const MAIN_WORKING_SUFFIX = "(main working, not ready)";
499
+ declare const MAIN_HEADER = "Main";
500
+ declare const MAIN_WORKING_SUFFIX = "(main working)";
501
+ declare const BLOCKED_HEADER = "Waiting on agents";
502
+ declare const MAIN_WAITING_SUFFIX = "(waiting on you)";
503
+ declare const MAIN_FAILED_SUFFIX = "(turn failed)";
386
504
  declare function renderTableLine(item: TableItem): string;
387
- declare function renderAgentLine(line: StatusLine): string;
505
+ declare const MAIN_IDLE = "idle";
506
+ declare function renderMainLine(item: TableItem | null, turn: Turn | null): string;
507
+ declare function renderAgentLine(line: StatusLine, nameWidth?: number): string;
388
508
  declare const NOTES_HEADER = "Notes";
389
509
  declare const NOTES_FOLD_LINES = 5;
390
510
  declare const SIMILAR_PREFIX = "similar to ";
@@ -400,11 +520,15 @@ declare function renderStatus(view: StatusView, options?: RenderOptions): string
400
520
  interface CarnetOptions {
401
521
  now?: () => Date;
402
522
  }
523
+ interface ClosedAgent extends Agent {
524
+ sandboxRemoved: boolean;
525
+ }
403
526
  declare class Carnet {
404
527
  readonly workspace: Workspace | null;
405
528
  readonly db: DatabaseSync;
406
529
  private readonly ctx;
407
530
  constructor(db: DatabaseSync, workspace: Workspace | null, options?: CarnetOptions);
531
+ now(): Date;
408
532
  requireWorkspace(): Workspace;
409
533
  readonly sessions: {
410
534
  get: (id: string) => Session | undefined;
@@ -422,6 +546,7 @@ declare class Carnet {
422
546
  default: () => Session | undefined;
423
547
  byName: (name: string) => Session | undefined;
424
548
  byHostProcess: (host: string, processId: number) => Session | undefined;
549
+ recordPluginVersion: (id: string, version: string | null) => void;
425
550
  recordPromptVersion: (id: string, version: string | null) => Session;
426
551
  setParent: (id: string, parentId: string) => Session;
427
552
  setStatus: (id: string, status: SessionStatus) => Session;
@@ -434,25 +559,50 @@ declare class Carnet {
434
559
  staleTemp: (olderThanMilliseconds: number) => Session[];
435
560
  resetDead: (isAlive: (processId: number) => boolean) => Session[];
436
561
  };
562
+ private releaseSandbox;
563
+ releaseClosedSandboxes(session?: string): number;
437
564
  readonly agents: {
438
565
  get: (session: string, name: string) => Agent | undefined;
439
566
  start: (session: string, input: StartAgentInput) => Agent;
440
567
  update: (session: string, name: string, input: UpdateAgentInput) => Agent;
441
568
  finish: (session: string, name: string, input: FinishAgentInput) => Agent;
442
- drop: (session: string, name: string, reason?: string) => Agent;
569
+ drop: (session: string, name: string, reason?: string) => ClosedAgent;
570
+ close: (session: string, name: string, event: Omit<LogEventInput, 'agent'>) => ClosedAgent;
571
+ promote: (session: string, name: string, input: PromoteAgentInput) => ClosedAgent;
443
572
  list: (session: string, options?: ListAgentsOptions) => Agent[];
444
573
  reorderQueue: (session: string, names: string[]) => Agent[];
445
- pairSubagent: (session: string, hostAgentId: string) => Agent | undefined;
574
+ byHostAgentId: (session: string, hostAgentId: string) => Agent | undefined;
575
+ pairSubagent: (session: string, hostAgentId: string, names?: readonly string[], agentType?: string) => Agent | undefined;
576
+ unpaired: (session: string, names: readonly string[]) => Agent | undefined;
577
+ pendingPlan: (session: string) => Agent | undefined;
578
+ requestLaunch: (session: string, name: string) => void;
446
579
  stopSubagent: (session: string, hostAgentId: string, names?: string[]) => Agent | undefined;
447
580
  };
581
+ readonly questions: {
582
+ list: (session: string, agent: string, openOnly?: boolean) => Question[];
583
+ add: (session: string, agent: string, inputs: readonly QuestionInput[]) => Question[];
584
+ answer: (session: string, agent: string, answers: readonly AnswerInput[]) => Question[];
585
+ };
586
+ readonly findings: {
587
+ list: (session: string, agent: string, pendingOnly?: boolean) => Finding[];
588
+ replace: (session: string, agent: string, inputs: readonly FindingInput[]) => Finding[];
589
+ decide: (session: string, agent: string, decisions: readonly DecisionInput[]) => Finding[];
590
+ };
448
591
  readonly table: {
449
592
  get: (session: string) => TableItem | undefined;
450
593
  set: (session: string, input: SetTableInput) => TableItem;
451
594
  clear: (session: string) => void;
452
595
  };
596
+ readonly turn: {
597
+ get: (session: string) => "failed" | "waiting" | "working" | null;
598
+ start: (session: string) => void;
599
+ wait: (session: string) => void;
600
+ fail: (session: string) => void;
601
+ end: (session: string) => void;
602
+ };
453
603
  readonly events: {
454
604
  log: (session: string, input: LogEventInput) => CarnetEvent;
455
- read: (session: string, limit?: number, agentOnly?: boolean) => CarnetEvent[];
605
+ read: (session: string, limit?: number, agentOnly?: boolean, kind?: AgentKind) => CarnetEvent[];
456
606
  };
457
607
  readonly notes: {
458
608
  add: (input: AddNoteInput) => AddNoteResult;
@@ -472,8 +622,8 @@ declare class Carnet {
472
622
  copyRepos: (from: string, into: string) => void;
473
623
  };
474
624
  readonly status: {
475
- view: (session: Session) => StatusView;
476
- render: (session: Session, options?: RenderOptions) => string;
625
+ view: (session: Session, options?: StatusViewOptions) => StatusView;
626
+ render: (session: Session, options?: RenderOptions & StatusViewOptions) => string;
477
627
  sections: (session: Session) => string;
478
628
  };
479
629
  close(): void;
@@ -492,5 +642,5 @@ interface ResolvedCarnet {
492
642
  }
493
643
  declare function openResolvedCarnet(options?: OpenCarnetOptions): ResolvedCarnet;
494
644
  declare function openWorkspaceCarnet(workspace: Workspace | null, options?: OpenCarnetOptions): Carnet;
495
- export { CarnetEvent as $, isWorkspaceName as $t, AddNoteResult as A, ResolveWorkspaceOptions as At, NoteActivityKind as B, AGENTS_FILE as Bt, memoryMaxCharacters as C, HostSessionPayload as Ct, buildStatusView as D, ResumeCommand as Dt, StatusView as E, LaunchOptions as Et, ListNotesOptions as F, repoNameFor as Ft, WeightedNote as G, Workspace as Gt, NoteDetail as H, DropWorkspaceOptions as Ht, NOTE_KINDS as I, repoPathFor as It, memoryHalfLife as J, addWorkspaceRepo as Jt, isNoteKind as K, WorkspaceFile as Kt, NOTE_TEXT_LIMIT as L, requireWorkspace as Lt, DEFAULT_HALF_LIFE_DAYS as M, WorkspaceResolution as Mt, DUPLICATE_SIMILARITY as N, ambiguousWorkspaceContext as Nt, formatClock as O, allHosts as Ot, DropNoteInput as P, isInside as Pt, AgentEventType as Q, expandHome as Qt, Note as R, resolveWorkspace as Rt, MemoryOptions as S, HostSessionEndPayload as St, StatusLine as T, HostToolPayload as Tt, NoteKind as U, INSTRUCTIONS_FILE as Ut, NoteCitation as V, CreateWorkspaceOptions as Vt, STALE_AFTER_ACTIVE_DAYS as W, WORKSPACE_FILE as Wt, similarity as X, definitionInstructions as Xt, sessionNoteActivity as Y, createWorkspace as Yt, workspaceRepoNames as Z, dropWorkspace as Zt, renderNotesSummary as _, OPEN_AGENT_STATUSES as _n, shortId as _t, openCarnet as a, Agent as an, isEventType as at, renderTableLine as b, isAgentStatus as bn, HostPromptPayload as bt, MAIN_WORKING_SUFFIX as c, PUBLISH_FALLBACK_MILLISECONDS as cn, MergeResult as ct, NotesMode as d, UpdateAgentInput as dn, HookSessionPayload as dt, listWorkspaces as en, EVENT_TYPES as et, RenderOptions as f, AGENT_STATUSES as fn, ListSessionsOptions as ft, renderNotes as g, MAIN_WORKING_EMOJI as gn, SessionStatus as gt, renderNoteLine as h, LEGEND as hn, SessionKind as ht, ResolvedCarnet as i, workspaceHosts as in, SessionEventType as it, CiteNoteInput as j, WorkspaceOrigin as jt, AddNoteInput as k, hostById as kt, NOTES_FOLD_LINES as l, REPORTING_NOTE as ln, CreateSessionInput as lt, renderAgentLine as m, EMOJI as mn, Session as mt, CarnetOptions as n, removeWorkspaceRepo as nn, LogEventInput as nt, openResolvedCarnet as o, FinishAgentInput as on, SetTableInput as ot, SIMILAR_PREFIX as p, AgentStatus as pn, MINIMUM_ID_PREFIX as pt, localDay as q, WorkspaceRepo as qt, OpenCarnetOptions as r, workspaceExists as rn, SESSION_EVENT_TYPES as rt, openWorkspaceCarnet as s, ListAgentsOptions as sn, TableItem as st, Carnet as t, loadWorkspace as tn, EventType as tt, NOTES_HEADER as u, StartAgentInput as un, HookEnv as ut, renderSections as v, USER_ACTION_STATUSES as vn, DEFAULT_HOST as vt, renderMemory as w, HostSubagentPayload as wt, MEMORY_MAX_CHARACTERS as x, isUserActionStatus as xn, HostRender as xt, renderStatus as y, UserActionStatus as yn, Host as yt, NoteActivity as z, workspaceLabel as zt };
496
- //# sourceMappingURL=carnet-DHw_oXJs.d.mts.map
645
+ export { NoteDetail as $, addWorkspaceRepo as $t, memoryMaxCharacters as A, MAIN_FAILED_EMOJI as An, LaunchOptions as At, AddNoteInput as B, CarnetEvent as Bn, repoNameFor as Bt, renderNotes as C, AGENT_STATUSES as Cn, HostPromptPayload as Ct, renderTableLine as D, KIND_LEGEND as Dn, HostStopPayload as Dt, renderStatus as E, KIND_ABBREVIATIONS as En, HostSessionPayload as Et, buildStatusView as F, UserActionStatus as Fn, hostById as Ft, DropNoteInput as G, SessionEventType as Gn, AGENTS_FILE as Gt, CiteNoteInput as H, EventType as Hn, requireWorkspace as Ht, formatClock as I, isAgentStatus as In, ResolveWorkspaceOptions as It, NOTE_TEXT_LIMIT as J, INSTRUCTIONS_FILE as Jt, ListNotesOptions as K, isEventType as Kn, CreateWorkspaceOptions as Kt, TURNS as L, isUserActionStatus as Ln, WorkspaceOrigin as Lt, StatusLine as M, MAIN_WORKING_EMOJI as Mn, RelocatedFolder as Mt, StatusView as N, OPEN_AGENT_STATUSES as Nn, ResumeCommand as Nt, MEMORY_MAX_CHARACTERS as O, KIND_TAG_PATTERN as On, HostSubagentPayload as Ot, StatusViewOptions as P, USER_ACTION_STATUSES as Pn, allHosts as Pt, NoteCitation as Q, WorkspaceRepo as Qt, Turn as R, kindTag as Rn, WorkspaceResolution as Rt, renderNoteLine as S, statusWhenDone as Sn, Host as St, renderSections as T, EMOJI as Tn, HostSessionEndPayload as Tt, DEFAULT_HALF_LIFE_DAYS as U, LogEventInput as Un, resolveWorkspace as Ut, AddNoteResult as V, EVENT_TYPES as Vn, repoPathFor as Vt, DUPLICATE_SIMILARITY as W, SESSION_EVENT_TYPES as Wn, workspaceLabel as Wt, NoteActivity as X, Workspace as Xt, Note as Y, WORKSPACE_FILE as Yt, NoteActivityKind as Z, WorkspaceFile as Zt, NotesMode as _, REPORTING_NOTE as _n, Session as _t, ResolvedCarnet as a, listWorkspaces as an, memoryHalfLife as at, renderAgentLine as b, UpdateAgentInput as bn, shortId as bt, openWorkspaceCarnet as c, workspaceExists as cn, workspaceRepoNames as ct, MAIN_HEADER as d, Agent as dn, MergeResult as dt, createWorkspace as en, NoteKind as et, MAIN_IDLE as f, AgentKind as fn, CreateSessionInput as ft, NOTES_HEADER as g, PUBLISH_FALLBACK_MILLISECONDS as gn, MINIMUM_ID_PREFIX as gt, NOTES_FOLD_LINES as h, ListAgentsOptions as hn, ListSessionsOptions as ht, OpenCarnetOptions as i, isWorkspaceName as in, localDay as it, renderMemory as j, MAIN_WAITING_EMOJI as jn, ProjectRelocation as jt, MemoryOptions as k, LEGEND as kn, HostToolPayload as kt, BLOCKED_HEADER as l, workspaceHosts as ln, SetTableInput as lt, MAIN_WORKING_SUFFIX as m, KIND_REQUIRED as mn, HookSessionPayload as mt, CarnetOptions as n, dropWorkspace as nn, WeightedNote as nt, openCarnet as o, loadWorkspace as on, sessionNoteActivity as ot, MAIN_WAITING_SUFFIX as p, FinishAgentInput as pn, HookEnv as pt, NOTE_KINDS as q, DropWorkspaceOptions as qt, ClosedAgent as r, expandHome as rn, isNoteKind as rt, openResolvedCarnet as s, removeWorkspaceRepo as sn, similarity as st, Carnet as t, definitionInstructions as tn, STALE_AFTER_ACTIVE_DAYS as tt, MAIN_FAILED_SUFFIX as u, AGENT_KINDS as un, TableItem as ut, RenderOptions as v, SANDBOX_KINDS as vn, SessionKind as vt, renderNotesSummary as w, AgentStatus as wn, HostRender as wt, renderMainLine as x, isAgentKind as xn, DEFAULT_HOST as xt, SIMILAR_PREFIX as y, StartAgentInput as yn, SessionStatus as yt, TurnOptions as z, AgentEventType as zn, isInside as zt };
646
+ //# sourceMappingURL=carnet-BFA2yya4.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carnet-BFA2yya4.d.mts","names":["_$__merge_ts0.MergeResult","_$__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/workspace/undo.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;KAUD,sBAAsB;cAErB;KAED,2BAA2B;cAE1B,OAAO,OAAO,QAAQ;cAStB;cACA;cACA;cAEA;cAGA;WACX;WACA;WACA;WACA;;iBAIc,QAAQ,mBAAmB;cAI9B,kBAAgB;cAEhB;iBAEG,cAAc,iBAAiB,SAAS;iBAIxC,mBAAmB,iBAAiB,SAAS;cAIhD;cCjDA;KAED,oBAAoB;cAEnB;iBAWG,YAAY,iBAAiB,SAAS;UAWrC;EACf;EACA;EACA,MAAM;EACN,cAAc;EAEd;EAEA;EACA;EACA,QAAQ;EACR;EACA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ACA;EACA;;UAGe;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;;UCtCe;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;UAEV;EAEf;;UCGe;EACf;EACA,MAAM;EACN,QAAQ;EACR;EAEA;EACA;EACA;;UAGe;EACf;EACA;EACA,OAAO;EACP,MAAM;EACN,SAAS;EACT,SAAS;EACT,SAAS;EACT,OAAO;;UAGQ;EACf,OAAO;;iBAwFO,YAAY,MAAM;iBAMlB,gBACd,KAAK,KACL,SAAS,SACT,UAAS,oBACR;cCxHU;iBAWG,oBAAoB;UAKnB;EACf;EACA;;UAGQ;EACR;EACA,OAAO;;iBAsBO,aAAa,OAAO,aAAa;cC1CpC;cACA;cACA;cACA;cACA;iBAEG,gBAAgB,MAAM;cAUzB;iBAEG,eAAe,MAAM,kBAAkB,MAAM;iBAM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