@rucher/carnet 0.2.0-beta.7 → 0.2.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.
@@ -4,58 +4,19 @@ 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;
30
7
  declare const AGENT_STATUSES: readonly ['running', 'discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch', 'closed'];
31
8
  type AgentStatus = (typeof AGENT_STATUSES)[number];
32
9
  declare const USER_ACTION_STATUSES: readonly ['discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch'];
33
10
  type UserActionStatus = (typeof USER_ACTION_STATUSES)[number];
34
11
  declare const EMOJI: Record<Exclude<AgentStatus, 'closed'>, string>;
35
12
  declare const MAIN_WORKING_EMOJI = "⚙️";
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";
13
+ declare const LEGEND = "⚙️ main working · 💬 discussing · ❓ answer · 👀 review · 📥 apply · 🧪 test · ✅ commit · 🌿 branch · ⏳ running";
46
14
  declare function isAgentStatus(value: unknown): value is AgentStatus;
47
15
  declare function isUserActionStatus(value: unknown): value is UserActionStatus;
48
16
  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;
53
17
  interface Agent {
54
18
  session: string;
55
19
  name: string;
56
- kind: AgentKind;
57
- promotedFrom: AgentKind | null;
58
- target: string | null;
59
20
  task: string | null;
60
21
  status: AgentStatus;
61
22
  note: string | null;
@@ -72,14 +33,12 @@ interface Agent {
72
33
  interface StartAgentInput {
73
34
  name: string;
74
35
  task: string;
75
- kind?: AgentKind | undefined;
76
- target?: string | undefined;
77
36
  baseCommit?: string | undefined;
78
37
  worktree?: string | undefined;
79
38
  }
80
39
  interface UpdateAgentInput {
81
40
  status: AgentStatus;
82
- note?: string | null | undefined;
41
+ note?: string | undefined;
83
42
  reportPath?: string | undefined;
84
43
  }
85
44
  interface FinishAgentInput {
@@ -91,11 +50,6 @@ interface ListAgentsOptions {
91
50
  }
92
51
  declare const REPORTING_NOTE = "reporting";
93
52
  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
- }
99
53
  interface WorkspaceRepo {
100
54
  path: string;
101
55
  name: string;
@@ -142,10 +96,11 @@ declare function dropWorkspace(name: string, options?: DropWorkspaceOptions): Wo
142
96
  declare function isInside(directory: string, path: string): boolean;
143
97
  declare function repoNameFor(workspace: Workspace | null, path: string | undefined): string | null;
144
98
  declare function repoPathFor(workspace: Workspace | null, path: string | undefined | null): string | null;
145
- type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | 'none';
99
+ type WorkspaceOrigin = 'session' | 'option' | 'env' | 'run-directory' | 'repo' | 'none';
146
100
  interface WorkspaceResolution {
147
101
  workspace: Workspace | null;
148
102
  origin: WorkspaceOrigin;
103
+ repo?: WorkspaceRepo | undefined;
149
104
  }
150
105
  interface ResolveWorkspaceOptions {
151
106
  db?: DatabaseSync | undefined;
@@ -157,6 +112,7 @@ interface ResolveWorkspaceOptions {
157
112
  declare function resolveWorkspace({ db, sessionId, workspace, cwd, env }?: ResolveWorkspaceOptions): WorkspaceResolution;
158
113
  declare function workspaceLabel(workspace: Workspace | null): string;
159
114
  declare function requireWorkspace(workspace: Workspace | null): Workspace;
115
+ declare function ambiguousWorkspaceContext(reason: string): string;
160
116
  interface HostSessionPayload {
161
117
  session_id: string;
162
118
  cwd?: string | undefined;
@@ -177,11 +133,6 @@ interface HostSubagentPayload {
177
133
  description?: string | undefined;
178
134
  agent_transcript_path?: string | undefined;
179
135
  }
180
- interface HostStopPayload {
181
- session_id: string;
182
- cwd?: string | undefined;
183
- failed: boolean;
184
- }
185
136
  interface HostSessionEndPayload {
186
137
  session_id: string;
187
138
  cwd?: string | undefined;
@@ -192,10 +143,7 @@ interface HostToolPayload {
192
143
  cwd?: string | undefined;
193
144
  tool_name?: string | undefined;
194
145
  agent_id?: string | undefined;
195
- agent_type?: string | undefined;
196
146
  path?: string | undefined;
197
- file_path?: string | undefined;
198
- command?: string | undefined;
199
147
  }
200
148
  interface ResumeCommand {
201
149
  command: string;
@@ -218,7 +166,6 @@ interface Host {
218
166
  sessionIdFromEnvironment(env: NodeJS.ProcessEnv): string | undefined;
219
167
  projectDirectory(env: NodeJS.ProcessEnv): string | undefined;
220
168
  parseSessionPayload(json: string): HostSessionPayload;
221
- parseStopPayload(json: string): HostStopPayload;
222
169
  parsePromptPayload(json: string): HostPromptPayload;
223
170
  parseSubagentPayload(json: string): HostSubagentPayload;
224
171
  parseSessionEndPayload(json: string): HostSessionEndPayload;
@@ -242,7 +189,7 @@ type SessionKind = 'active' | 'temp';
242
189
  type SessionStatus = 'running' | 'idle' | 'archived';
243
190
  interface Session {
244
191
  id: string;
245
- workspace: string;
192
+ workspace: string | null;
246
193
  name: string | null;
247
194
  purpose: string | null;
248
195
  kind: SessionKind;
@@ -293,61 +240,41 @@ interface MergeResult {
293
240
  movedEvents: number;
294
241
  movedTable: boolean;
295
242
  }
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
- }
341
243
  interface TableItem {
342
244
  session: string;
343
245
  text: string;
344
246
  status: UserActionStatus | null;
247
+ mainWorking: boolean;
345
248
  updatedAt: string;
346
249
  }
347
250
  interface SetTableInput {
348
251
  text: string;
252
+ mainWorking?: boolean | undefined;
349
253
  status?: UserActionStatus | undefined;
350
254
  }
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;
351
278
  declare const NOTE_KINDS: readonly ['dead_end', 'decision', 'learning'];
352
279
  type NoteKind = (typeof NOTE_KINDS)[number];
353
280
  declare const NOTE_TEXT_LIMIT = 200;
@@ -428,30 +355,22 @@ interface NoteActivity {
428
355
  at: string;
429
356
  }
430
357
  declare function sessionNoteActivity(ctx: Ctx, session: string): NoteActivity[];
431
- declare const TURNS: readonly ['working', 'waiting', 'failed'];
432
- type Turn = (typeof TURNS)[number];
433
358
  interface StatusLine {
434
359
  name: string;
435
- kind: AgentKind;
436
360
  status: AgentStatus;
437
361
  emoji: string;
438
- action: string | null;
439
362
  note: string | null;
440
363
  }
441
364
  interface StatusView {
442
365
  time: string;
443
366
  sessionName: string | null;
444
367
  table: TableItem | null;
445
- turn: Turn | null;
446
368
  waiting: StatusLine[];
447
369
  running: StatusLine[];
448
370
  notes: NoteActivity[];
449
371
  }
450
- interface StatusViewOptions {
451
- kind?: AgentKind | undefined;
452
- }
453
372
  declare function formatClock(date: Date): string;
454
- declare function buildStatusView(ctx: Ctx, session: Session, options?: StatusViewOptions): StatusView;
373
+ declare function buildStatusView(ctx: Ctx, session: Session): StatusView;
455
374
  declare const MEMORY_MAX_CHARACTERS = 2000;
456
375
  declare function memoryMaxCharacters(value: string | undefined): number;
457
376
  interface MemoryOptions {
@@ -463,13 +382,9 @@ interface MemoryScope {
463
382
  notes: WeightedNote[];
464
383
  }
465
384
  declare function renderMemory(scope: MemoryScope, maxCharacters?: number): string;
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
+ declare const MAIN_WORKING_SUFFIX = "(main working, not ready)";
470
386
  declare function renderTableLine(item: TableItem): string;
471
- declare function renderMainLine(item: TableItem | null, turn: Turn | null): string | null;
472
- declare function renderAgentLine(line: StatusLine, nameWidth?: number): string;
387
+ declare function renderAgentLine(line: StatusLine): string;
473
388
  declare const NOTES_HEADER = "Notes";
474
389
  declare const NOTES_FOLD_LINES = 5;
475
390
  declare const SIMILAR_PREFIX = "similar to ";
@@ -490,7 +405,6 @@ declare class Carnet {
490
405
  readonly db: DatabaseSync;
491
406
  private readonly ctx;
492
407
  constructor(db: DatabaseSync, workspace: Workspace | null, options?: CarnetOptions);
493
- now(): Date;
494
408
  requireWorkspace(): Workspace;
495
409
  readonly sessions: {
496
410
  get: (id: string) => Session | undefined;
@@ -526,39 +440,19 @@ declare class Carnet {
526
440
  update: (session: string, name: string, input: UpdateAgentInput) => Agent;
527
441
  finish: (session: string, name: string, input: FinishAgentInput) => Agent;
528
442
  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;
531
443
  list: (session: string, options?: ListAgentsOptions) => Agent[];
532
444
  reorderQueue: (session: string, names: string[]) => Agent[];
533
- byHostAgentId: (session: string, hostAgentId: string) => Agent | undefined;
534
445
  pairSubagent: (session: string, hostAgentId: string) => Agent | undefined;
535
446
  stopSubagent: (session: string, hostAgentId: string, names?: string[]) => Agent | undefined;
536
447
  };
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
- };
547
448
  readonly table: {
548
449
  get: (session: string) => TableItem | undefined;
549
450
  set: (session: string, input: SetTableInput) => TableItem;
550
451
  clear: (session: string) => void;
551
452
  };
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
- };
559
453
  readonly events: {
560
454
  log: (session: string, input: LogEventInput) => CarnetEvent;
561
- read: (session: string, limit?: number, agentOnly?: boolean, kind?: AgentKind) => CarnetEvent[];
455
+ read: (session: string, limit?: number, agentOnly?: boolean) => CarnetEvent[];
562
456
  };
563
457
  readonly notes: {
564
458
  add: (input: AddNoteInput) => AddNoteResult;
@@ -578,8 +472,8 @@ declare class Carnet {
578
472
  copyRepos: (from: string, into: string) => void;
579
473
  };
580
474
  readonly status: {
581
- view: (session: Session, options?: StatusViewOptions) => StatusView;
582
- render: (session: Session, options?: RenderOptions & StatusViewOptions) => string;
475
+ view: (session: Session) => StatusView;
476
+ render: (session: Session, options?: RenderOptions) => string;
583
477
  sections: (session: Session) => string;
584
478
  };
585
479
  close(): void;
@@ -598,5 +492,5 @@ interface ResolvedCarnet {
598
492
  }
599
493
  declare function openResolvedCarnet(options?: OpenCarnetOptions): ResolvedCarnet;
600
494
  declare function openWorkspaceCarnet(workspace: Workspace | null, options?: OpenCarnetOptions): 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
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carnet-DHw_oXJs.d.mts","names":["_$__merge_ts0.MergeResult","_$__agents_ts0.Agent","_$__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/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/table.ts","../src/events.ts","../src/notes.ts","../src/status/view.ts","../src/memory.ts","../src/status/render.ts","../src/carnet.ts"],"mappings":";UAEiB;EACf,IAAI;EACJ,WAAW;EAEX;;cCNW;KAYD,sBAAsB;cAErB;KAUD,2BAA2B;cAE1B,OAAO,OAAO,QAAQ;cAWtB;cAEA;iBAGG,cAAc,iBAAiB,SAAS;iBAIxC,mBAAmB,iBAAiB,SAAS;cAIhD;UC5CI;EACf;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;;UAGe;EACf;EACA;;UAGe;EACf;;cAuCW;cACA;UC3EI;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,OAAO;EACP,UAAU;IAAiB,WAAW;;;UAGvB;EACf;EACA;IAAU;IAAc;;EACxB,W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AgB;EAC3D,cAAc,SAAS,SAAS,UAAU,gBAAgB;EAC1D,YAAY,QAAQ,SAAS,UAAU,gBAAgB;EACvD,kBAAkB;EAClB,gBAAgB,SAAS,SAAS,MAAM,OAAO;EAC/C,gBAAgB,SAAS,SAAS,MAAM,OAAO;EAC/C,mBAAmB,WAAW,YAAY;;cAG/B;iBAIG,YAAY;iBAIZ,SAAS,aAAa;KCrF1B;KACA;UAEK;EACf;EACA;EACA;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAuBU,qBAAqB;UAEhB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf;EACA;;cA+PW;iBAEG,QAAQ;UCxUP;EACf,SAAS;EACT;EACA;EACA;EACA;;UCJe;EACf;EACA;EACA,QAAQ;EACR;EACA;;UAGe;EACf;EAEA;EACA,SAAS;;cCdE;cAUA;KAOD,yBAAyB;KACzB,2BAA2B;KAC3B,YAAY,iBAAiB;UAIxB;EACf;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN;EACA;EACA;EACA;;iBAoBc,YAAY,iBAAiB,SAAS;cC1DzC;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,eAA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BACR"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
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";
1
+ import { $ as CarnetEvent, $t as isWorkspaceName, A as AddNoteResult, At as ResolveWorkspaceOptions, B as NoteActivityKind, Bt as AGENTS_FILE, C as memoryMaxCharacters, Ct as HostSessionPayload, D as buildStatusView, Dt as ResumeCommand, E as StatusView, Et as LaunchOptions, F as ListNotesOptions, Ft as repoNameFor, G as WeightedNote, Gt as Workspace, H as NoteDetail, Ht as DropWorkspaceOptions, I as NOTE_KINDS, It as repoPathFor, J as memoryHalfLife, Jt as addWorkspaceRepo, K as isNoteKind, Kt as WorkspaceFile, L as NOTE_TEXT_LIMIT, Lt as requireWorkspace, M as DEFAULT_HALF_LIFE_DAYS, Mt as WorkspaceResolution, N as DUPLICATE_SIMILARITY, Nt as ambiguousWorkspaceContext, O as formatClock, Ot as allHosts, P as DropNoteInput, Pt as isInside, Q as AgentEventType, Qt as expandHome, R as Note, Rt as resolveWorkspace, S as MemoryOptions, St as HostSessionEndPayload, T as StatusLine, Tt as HostToolPayload, U as NoteKind, Ut as INSTRUCTIONS_FILE, V as NoteCitation, Vt as CreateWorkspaceOptions, W as STALE_AFTER_ACTIVE_DAYS, Wt as WORKSPACE_FILE, X as similarity, Xt as definitionInstructions, Y as sessionNoteActivity, Yt as createWorkspace, Z as workspaceRepoNames, Zt as dropWorkspace, _ as renderNotesSummary, _n as OPEN_AGENT_STATUSES, _t as shortId, a as openCarnet, an as Agent, at as isEventType, b as renderTableLine, bn as isAgentStatus, bt as HostPromptPayload, c as MAIN_WORKING_SUFFIX, cn as PUBLISH_FALLBACK_MILLISECONDS, ct as MergeResult, d as NotesMode, dn as UpdateAgentInput, dt as HookSessionPayload, en as listWorkspaces, et as EVENT_TYPES, f as RenderOptions, fn as AGENT_STATUSES, ft as ListSessionsOptions, g as renderNotes, gn as MAIN_WORKING_EMOJI, gt as SessionStatus, h as renderNoteLine, hn as LEGEND, ht as SessionKind, i as ResolvedCarnet, in as workspaceHosts, it as SessionEventType, j as CiteNoteInput, jt as WorkspaceOrigin, k as AddNoteInput, kt as hostById, l as NOTES_FOLD_LINES, ln as REPORTING_NOTE, lt as CreateSessionInput, m as renderAgentLine, mn as EMOJI, mt as Session, n as CarnetOptions, nn as removeWorkspaceRepo, nt as LogEventInput, o as openResolvedCarnet, on as FinishAgentInput, ot as SetTableInput, p as SIMILAR_PREFIX, pn as AgentStatus, pt as MINIMUM_ID_PREFIX, q as localDay, qt as WorkspaceRepo, r as OpenCarnetOptions, rn as workspaceExists, rt as SESSION_EVENT_TYPES, s as openWorkspaceCarnet, sn as ListAgentsOptions, st as TableItem, t as Carnet, tn as loadWorkspace, tt as EventType, u as NOTES_HEADER, un as StartAgentInput, ut as HookEnv, v as renderSections, vn as USER_ACTION_STATUSES, vt as DEFAULT_HOST, w as renderMemory, wt as HostSubagentPayload, x as MEMORY_MAX_CHARACTERS, xn as isUserActionStatus, xt as HostRender, y as renderStatus, yn as UserActionStatus, yt as Host, z as NoteActivity, zt as workspaceLabel } from "./carnet-DHw_oXJs.mjs";
2
2
  import { DatabaseSync } from "node:sqlite";
3
3
  interface MoveOptions {
4
4
  merge?: boolean | undefined;
@@ -14,17 +14,16 @@ 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 | undefined;
17
+ export declare function sessionWorkspaceName(db: DatabaseSync, sessionId: string): string | null | 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>;
22
21
  export declare const MEMORY_DB = ":memory:";
23
22
  export declare function openDatabase(path: string): DatabaseSync;
24
23
  export declare const migrations: readonly string[];
25
24
  export declare function schemaVersion(db: DatabaseSync): number;
26
25
  export declare function migrate(db: DatabaseSync): void;
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';
26
+ type CarnetErrorCode = 'NO_WORKSPACE' | 'WORKSPACE_AMBIGUOUS' | '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_STATUS' | 'INVALID_EVENT_TYPE' | 'COMMIT_REQUIRED' | 'TABLE_STATUS_WITH_MAIN_WORKING';
28
27
  export declare class CarnetError extends Error {
29
28
  readonly code: CarnetErrorCode;
30
29
  constructor(code: CarnetErrorCode, message: string);
@@ -45,7 +44,6 @@ export declare function corePromptPath(env?: NodeJS.ProcessEnv): string;
45
44
  export declare function reportsDirectory(workspace: Workspace): string;
46
45
  export declare function reportPath(workspace: Workspace, agentName: string): string;
47
46
  export declare function handleSessionEnd(carnet: Carnet, payload: HostSessionEndPayload): Session | undefined;
48
- export declare function handleStop(carnet: Carnet, payload: HostStopPayload): void;
49
47
  interface SessionStartResult {
50
48
  session: Session;
51
49
  additionalContext?: string;
@@ -77,25 +75,10 @@ export declare function compactReminder(workspace: Workspace | null, env?: NodeJ
77
75
  export declare function outsideRucherContext(workspace: Workspace | null, env?: NodeJS.ProcessEnv): string;
78
76
  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)";
79
77
  export declare const RULES_UPDATED_NOTICE = "rucher: rules updated, will apply after the next compaction or in a new session";
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.";
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 forks, applies, tests and commits. Agents propose, they never push.\n- Status lives in Carnet: agent statuses, the \"On the table\" 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 a fork finishes, say only \"<name> finished, report ready\". Never summarise, quote or act on its report or final message until the human asks for that fork's report, even when answering about something else.\n- Forks never commit, push, stash or record notes. A fork 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 dispatch, apply or review forks, load the rucher skill: it holds the full workflow.";
82
80
  export declare function handleUserPromptSubmit(carnet: Carnet, host: Host, payload: HostPromptPayload): Session;
83
81
  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;
99
82
  export declare function transcriptTitle(path: string): string | undefined;
100
83
  export declare function workspaceSettings(workspace: Workspace): Record<string, unknown>;
101
84
  export declare const claudeCode: Host;
@@ -141,5 +124,5 @@ export declare function markdownCopy(content: string): string;
141
124
  export declare function removeStaleCopies(directory: string, keep: ReadonlySet<string>): string[];
142
125
  export declare function writeGenerated(path: string, content: string): boolean;
143
126
  export declare function mergeSettings(base: Record<string, unknown>, extra: Record<string, unknown>): Record<string, unknown>;
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 };
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, ambiguousWorkspaceContext, buildStatusView, createWorkspace, definitionInstructions, dropWorkspace, expandHome, formatClock, hostById, isAgentStatus, isEventType, isInside, isNoteKind, isUserActionStatus, isWorkspaceName, listWorkspaces, loadWorkspace, localDay, memoryHalfLife, memoryMaxCharacters, openCarnet, openResolvedCarnet, openWorkspaceCarnet, removeWorkspaceRepo, renderAgentLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderSections, renderStatus, renderTableLine, repoNameFor, repoPathFor, requireWorkspace, resolveWorkspace, sessionNoteActivity, shortId, similarity, workspaceExists, workspaceHosts, workspaceLabel, workspaceRepoNames };
145
128
  //# sourceMappingURL=index.d.mts.map
@@ -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/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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N,SAAS,oBACR;wBCAa,cACd,QAAQ,QACR,SAAS,iBACT,KAAK;qBAcM;wBAGG,gBAAgB,QAAQ,QAAQ,SAAS;wBAKzC,kBACd,QAAQ,QACR,SAAS,iBACT;qBCjCW,eAAa;UAGT;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;EAEA;;wBA4Cc,cAAc,OAAO;wBA2BrB,gBAAgB,gCAAgC;wBCgBhD,gBAAgB;wBA4DhB,kBAAkB,WAAW,YAAY;qBA2D5C,YAAY;qBC1NZ;wBAGG,UAAU;qBCAb;qBACA;UAEI;EACf;EACA;;wBAGc,gBAAgB,OAAO;wBAYvB,aAAa,SAAS;wBAKtB,cACd,QAAQ,QACR,SAAS,WACP,QAAwB,kBAAyC;qBC7BxD;qBACA;qBCLA;wBAWG,aAAa;KCLxB,0BAA0B;qBAElB;KAQD,oBAAoB;UAEf;EACf;EACA,MAAM;EACN;EACA;EACA,OAAO;;wBAYO,UAAU,QAAQ,QAAQ,iBAAiB,OAAO;UC9BjD;EACf;EACA;EACA;;UAGe;EACf,MAAM,OAAO;EACb;;wBAGc,mBACd,WAAW,WACX,UAAS,4BACR;qBCfU;qBAkBA;wBAEG,aAAa;wBAWb,kBAAkB,mBAAmB,MAAM;wBAa3C,eAAe,cAAc;wBAiB7B,cACd,MAAM,yBACN,OAAO,0BACN"}
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,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