@rucher/carnet 0.1.0 → 0.2.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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Shared state for Rucher: groups, sessions, agents, the "On the table" line and the event journal, stored in one SQLite database per group (`<meta directory>/.rucher/carnet.db`, via `node:sqlite`).
4
4
 
5
- Used by the `rucher` CLI and the Carnet MCP server. See `docs/carnet-spec.md` at the repository root.
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).
6
6
 
7
7
  ```ts
8
8
  import { openCarnet } from '@rucher/carnet';
@@ -0,0 +1,451 @@
1
+ import { DatabaseSync } from "node:sqlite";
2
+ interface Ctx {
3
+ db: DatabaseSync;
4
+ now: () => Date;
5
+ }
6
+ declare const AGENT_STATUSES: readonly ['running', 'discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch', 'closed'];
7
+ type AgentStatus = (typeof AGENT_STATUSES)[number];
8
+ declare const USER_ACTION_STATUSES: readonly ['discussing', 'answer', 'review', 'apply', 'test', 'commit', 'branch'];
9
+ type UserActionStatus = (typeof USER_ACTION_STATUSES)[number];
10
+ declare const EMOJI: Record<Exclude<AgentStatus, 'closed'>, string>;
11
+ declare const MAIN_WORKING_EMOJI = "⚙️";
12
+ declare const LEGEND = "⚙️ main working · 💬 discussing · ❓ answer · 👀 review · 📥 apply · 🧪 test · ✅ commit · 🌿 branch · ⏳ running";
13
+ declare function isAgentStatus(value: unknown): value is AgentStatus;
14
+ declare function isUserActionStatus(value: unknown): value is UserActionStatus;
15
+ interface Agent {
16
+ session: string;
17
+ name: string;
18
+ task: string | null;
19
+ status: AgentStatus;
20
+ note: string | null;
21
+ reportPath: string | null;
22
+ baseCommit: string | null;
23
+ worktree: string | null;
24
+ queueOrder: number | null;
25
+ hostAgentId: string | null;
26
+ pendingStatus: AgentStatus | null;
27
+ doneAt: string | null;
28
+ startedAt: string;
29
+ updatedAt: string;
30
+ }
31
+ interface StartAgentInput {
32
+ name: string;
33
+ task: string;
34
+ baseCommit?: string | undefined;
35
+ worktree?: string | undefined;
36
+ }
37
+ interface UpdateAgentInput {
38
+ status: AgentStatus;
39
+ note?: string | undefined;
40
+ reportPath?: string | undefined;
41
+ }
42
+ interface FinishAgentInput {
43
+ reportPath: string;
44
+ hasQuestions: boolean;
45
+ }
46
+ interface ListAgentsOptions {
47
+ includeClosed?: boolean;
48
+ }
49
+ declare const REPORTING_NOTE = "reporting";
50
+ declare const PUBLISH_FALLBACK_MILLISECONDS = 120000;
51
+ declare const GROUP_DIRECTORY = ".rucher";
52
+ declare const REPORTS_DIRECTORY = "reports";
53
+ declare const GROUP_FILE = "group.json";
54
+ declare const DB_FILE = "carnet.db";
55
+ interface Group {
56
+ root: string;
57
+ name: string;
58
+ repos: string[];
59
+ hosts: string[];
60
+ dbPath: string;
61
+ }
62
+ interface GroupFile {
63
+ name: string;
64
+ repos: string[];
65
+ hosts?: string[] | undefined;
66
+ }
67
+ declare function isInside(directory: string, path: string): boolean;
68
+ declare function repoNameFor(group: Group, path: string | undefined): string | null;
69
+ declare function repoPathFor(group: Group, path: string | undefined | null): string | null;
70
+ declare function findGroupRoot(from: string): string | null;
71
+ declare function reportsDirectoryOf(group: Group): string;
72
+ declare function reportPathFor(group: Group, agentName: string): string;
73
+ declare function isGroupRoot(directory: string): boolean;
74
+ declare function loadGroup(root: string): Group;
75
+ interface LocateOptions {
76
+ cwd?: string;
77
+ env?: NodeJS.ProcessEnv;
78
+ sessionId?: string | undefined;
79
+ }
80
+ declare function pinnedGroup(env: NodeJS.ProcessEnv): Group | null;
81
+ declare function locateGroup({ cwd, env, sessionId }?: LocateOptions): Group;
82
+ declare function ambiguousGroupContext(reason: string): string;
83
+ interface HostSessionPayload {
84
+ session_id: string;
85
+ cwd?: string | undefined;
86
+ source?: string | undefined;
87
+ session_title?: string | undefined;
88
+ }
89
+ interface HostPromptPayload {
90
+ session_id: string;
91
+ cwd?: string | undefined;
92
+ session_title?: string | undefined;
93
+ transcript_path?: string | undefined;
94
+ }
95
+ interface HostSubagentPayload {
96
+ session_id: string;
97
+ agent_id: string;
98
+ agent_type?: string | undefined;
99
+ cwd?: string | undefined;
100
+ description?: string | undefined;
101
+ agent_transcript_path?: string | undefined;
102
+ }
103
+ interface HostSessionEndPayload {
104
+ session_id: string;
105
+ cwd?: string | undefined;
106
+ reason?: string | undefined;
107
+ }
108
+ interface HostToolPayload {
109
+ session_id: string;
110
+ cwd?: string | undefined;
111
+ tool_name?: string | undefined;
112
+ agent_id?: string | undefined;
113
+ path?: string | undefined;
114
+ }
115
+ interface ResumeCommand {
116
+ command: string;
117
+ args: string[];
118
+ }
119
+ interface LaunchOptions {
120
+ name?: string | null | undefined;
121
+ appendPromptFile?: string | undefined;
122
+ passthrough?: readonly string[] | undefined;
123
+ }
124
+ interface ContextFile {
125
+ path: string;
126
+ sync(group: Group, mode: 'merge' | 'exact'): ContextFileResult;
127
+ }
128
+ type ContextFileResult = 'written' | 'updated' | 'unchanged' | 'no-markers';
129
+ interface Host {
130
+ id: string;
131
+ displayName: string;
132
+ processId(env: NodeJS.ProcessEnv): number | null;
133
+ sessionIdFromEnvironment(env: NodeJS.ProcessEnv): string | undefined;
134
+ projectDirectory(env: NodeJS.ProcessEnv): string | undefined;
135
+ parseSessionPayload(json: string): HostSessionPayload;
136
+ parsePromptPayload(json: string): HostPromptPayload;
137
+ parseSubagentPayload(json: string): HostSubagentPayload;
138
+ parseSessionEndPayload(json: string): HostSessionEndPayload;
139
+ parseToolPayload(json: string): HostToolPayload;
140
+ subagentNames(payload: HostSubagentPayload): string[];
141
+ subagentInheritsContext(payload: HostSubagentPayload): boolean;
142
+ rendersSystemPrompt(source: string): boolean;
143
+ promptTitle(payload: HostPromptPayload): string | undefined;
144
+ launchCommand(sessionId: string, options?: LaunchOptions): ResumeCommand;
145
+ resumeCommand(session: Session, options?: LaunchOptions): ResumeCommand;
146
+ forkCommand(parent: Session, options?: LaunchOptions): ResumeCommand;
147
+ renameInstruction(name: string): string;
148
+ transcriptFiles(session: Session, env?: NodeJS.ProcessEnv): string[];
149
+ contextFiles: readonly ContextFile[];
150
+ }
151
+ declare const DEFAULT_HOST = "claude-code";
152
+ declare function allHosts(): Host[];
153
+ declare function hostById(id: string): Host;
154
+ type SessionKind = 'active' | 'temp';
155
+ type SessionStatus = 'running' | 'idle' | 'archived';
156
+ interface Session {
157
+ id: string;
158
+ name: string | null;
159
+ purpose: string | null;
160
+ kind: SessionKind;
161
+ status: SessionStatus;
162
+ cwd: string | null;
163
+ repo: string | null;
164
+ host: string;
165
+ hostPid: number | null;
166
+ hookedAt: string | null;
167
+ lastTitle: string | null;
168
+ parentId: string | null;
169
+ promptVersion: string | null;
170
+ createdAt: string;
171
+ lastActiveAt: string;
172
+ endedAt: string | null;
173
+ }
174
+ type HookSessionPayload = HostSessionPayload;
175
+ interface HookEnv {
176
+ host?: string | undefined;
177
+ processId?: number | null | undefined;
178
+ RUCHER_PURGE_DAYS?: string | undefined;
179
+ RUCHER_HOME?: string | undefined;
180
+ RUCHER_SESSION_ID?: string | undefined;
181
+ RUCHER_SESSION_KIND?: string | undefined;
182
+ RUCHER_SESSION_NAME?: string | undefined;
183
+ RUCHER_PROMPT_VERSION?: string | undefined;
184
+ RUCHER_MEMORY_MAX_CHARACTERS?: string | undefined;
185
+ RUCHER_MEMORY_HALF_LIFE_DAYS?: string | undefined;
186
+ }
187
+ interface CreateSessionInput {
188
+ id: string;
189
+ kind: SessionKind;
190
+ name?: string | null | undefined;
191
+ cwd: string;
192
+ repo?: string | null | undefined;
193
+ host?: string | undefined;
194
+ }
195
+ interface ListSessionsOptions {
196
+ includeTemp?: boolean | undefined;
197
+ includeArchived?: boolean | undefined;
198
+ }
199
+ declare const MINIMUM_ID_PREFIX = 4;
200
+ declare function shortId(id: string): string;
201
+ interface MergeResult {
202
+ session: Session;
203
+ movedAgents: string[];
204
+ closedAgents: string[];
205
+ movedEvents: number;
206
+ movedTable: boolean;
207
+ }
208
+ interface TableItem {
209
+ session: string;
210
+ text: string;
211
+ status: UserActionStatus | null;
212
+ mainWorking: boolean;
213
+ updatedAt: string;
214
+ }
215
+ interface SetTableInput {
216
+ text: string;
217
+ mainWorking: boolean;
218
+ status?: UserActionStatus | undefined;
219
+ }
220
+ declare const EVENT_TYPES: readonly ['started', 'finished', 'answered', 'applied', 'tested', 'committed', 'dropped'];
221
+ declare const SESSION_EVENT_TYPES: readonly ['session.started', 'session.resumed', 'session.ended', 'session.forked'];
222
+ type AgentEventType = (typeof EVENT_TYPES)[number];
223
+ type SessionEventType = (typeof SESSION_EVENT_TYPES)[number];
224
+ type EventType = AgentEventType | SessionEventType;
225
+ interface CarnetEvent {
226
+ id: number;
227
+ session: string;
228
+ at: string;
229
+ type: EventType;
230
+ agent: string | null;
231
+ commit: string | null;
232
+ link: string | null;
233
+ note: string | null;
234
+ }
235
+ interface LogEventInput {
236
+ type: EventType;
237
+ agent?: string | undefined;
238
+ commit?: string | undefined;
239
+ link?: string | undefined;
240
+ note?: string | undefined;
241
+ }
242
+ declare function isEventType(value: unknown): value is EventType;
243
+ declare const NOTE_KINDS: readonly ['dead_end', 'decision', 'learning'];
244
+ type NoteKind = (typeof NOTE_KINDS)[number];
245
+ declare const NOTE_TEXT_LIMIT = 200;
246
+ declare const DUPLICATE_SIMILARITY = 0.6;
247
+ declare const DEFAULT_HALF_LIFE_DAYS = 20;
248
+ declare const STALE_AFTER_ACTIVE_DAYS = 40;
249
+ declare function isNoteKind(value: string): value is NoteKind;
250
+ declare function memoryHalfLife(value: string | undefined): number;
251
+ interface Note {
252
+ id: number;
253
+ kind: NoteKind;
254
+ text: string;
255
+ repos: string[];
256
+ session: string | null;
257
+ agent: string | null;
258
+ similarNotes: number[];
259
+ createdAt: string;
260
+ droppedAt: string | null;
261
+ droppedReason: string | null;
262
+ droppedSession: string | null;
263
+ replacedBy: number | null;
264
+ }
265
+ interface NoteCitation {
266
+ id: number;
267
+ note: number;
268
+ session: string | null;
269
+ agent: string | null;
270
+ why: string;
271
+ at: string;
272
+ }
273
+ interface WeightedNote extends Note {
274
+ weight: number;
275
+ citationCount: number;
276
+ }
277
+ interface NoteDetail extends WeightedNote {
278
+ citations: NoteCitation[];
279
+ }
280
+ interface AddNoteInput {
281
+ kind: string;
282
+ text: string;
283
+ repos?: string[] | undefined;
284
+ session?: string | null | undefined;
285
+ agent?: string | null | undefined;
286
+ }
287
+ interface AddNoteResult {
288
+ note: Note;
289
+ similar: Note[];
290
+ }
291
+ interface ListNotesOptions {
292
+ kind?: string | undefined;
293
+ repo?: string | undefined;
294
+ general?: boolean | undefined;
295
+ query?: string | undefined;
296
+ includeDropped?: boolean | undefined;
297
+ halfLifeDays?: number | undefined;
298
+ }
299
+ interface DropNoteInput {
300
+ reason: string;
301
+ replacedBy?: number | undefined;
302
+ session?: string | null | undefined;
303
+ }
304
+ interface CiteNoteInput {
305
+ why: string;
306
+ session?: string | null | undefined;
307
+ agent?: string | null | undefined;
308
+ }
309
+ declare function groupRepoNames(group: Group): string[];
310
+ declare function similarity(first: string, second: string): number;
311
+ declare function localDay(date: Date): string;
312
+ type NoteActivityKind = 'added' | 'cited' | 'dropped';
313
+ interface NoteActivity {
314
+ activity: NoteActivityKind;
315
+ note: number;
316
+ kind: NoteKind;
317
+ text: string;
318
+ similarNotes: number[];
319
+ replacedBy: number | null;
320
+ at: string;
321
+ }
322
+ declare function sessionNoteActivity(ctx: Ctx, session: string): NoteActivity[];
323
+ interface StatusLine {
324
+ name: string;
325
+ status: AgentStatus;
326
+ emoji: string;
327
+ note: string | null;
328
+ }
329
+ interface StatusView {
330
+ time: string;
331
+ sessionName: string | null;
332
+ table: TableItem | null;
333
+ waiting: StatusLine[];
334
+ running: StatusLine[];
335
+ notes: NoteActivity[];
336
+ }
337
+ declare function formatClock(date: Date): string;
338
+ declare function buildStatusView(ctx: Ctx, session: Session): StatusView;
339
+ declare const MEMORY_MAX_CHARACTERS = 2000;
340
+ declare function memoryMaxCharacters(value: string | undefined): number;
341
+ interface MemoryOptions {
342
+ maxCharacters?: number | undefined;
343
+ halfLifeDays?: number | undefined;
344
+ }
345
+ interface MemoryScope {
346
+ title: string;
347
+ notes: WeightedNote[];
348
+ }
349
+ declare function renderMemory(scope: MemoryScope, maxCharacters?: number): string;
350
+ declare const MAIN_WORKING_SUFFIX = "(main working, not ready)";
351
+ declare function renderTableLine(item: TableItem): string;
352
+ declare function renderAgentLine(line: StatusLine): string;
353
+ declare const NOTES_HEADER = "Notes";
354
+ declare const NOTES_FOLD_LINES = 5;
355
+ declare const SIMILAR_PREFIX = "similar to ";
356
+ type NotesMode = 'full' | 'summary' | 'expanded';
357
+ interface RenderOptions {
358
+ notes?: NotesMode | undefined;
359
+ }
360
+ declare function renderNotesSummary(notes: NoteActivity[]): string;
361
+ declare function renderNoteLine(item: NoteActivity, idWidth: number): string;
362
+ declare function renderNotes(notes: NoteActivity[], mode?: NotesMode): string[];
363
+ declare function renderSections(view: StatusView, options?: RenderOptions): string;
364
+ declare function renderStatus(view: StatusView, options?: RenderOptions): string;
365
+ interface CarnetOptions {
366
+ now?: () => Date;
367
+ }
368
+ declare class Carnet {
369
+ readonly group: Group;
370
+ readonly db: DatabaseSync;
371
+ private readonly ctx;
372
+ constructor(group: Group, db: DatabaseSync, options?: CarnetOptions);
373
+ readonly sessions: {
374
+ get: (id: string) => Session | undefined;
375
+ find: (reference: string) => Session;
376
+ require: (id: string) => Session;
377
+ ensure: (id: string, cwd?: string) => Session;
378
+ upsertFromHook: (payload: HookSessionPayload, env?: HookEnv) => Session;
379
+ touch: (id: string) => void;
380
+ merge: (fromId: string, intoId: string) => MergeResult;
381
+ purge: (keepId: string, days: number) => string[];
382
+ name: (id: string, name: string, purpose?: string) => Session;
383
+ adoptTitle: (id: string, title: string | undefined) => Session;
384
+ list: (options?: ListSessionsOptions) => Session[];
385
+ drop: (id: string) => Session;
386
+ default: () => Session | undefined;
387
+ byName: (name: string) => Session | undefined;
388
+ byHostProcess: (host: string, processId: number) => Session | undefined;
389
+ recordPromptVersion: (id: string, version: string | null) => Session;
390
+ setParent: (id: string, parentId: string) => Session;
391
+ setStatus: (id: string, status: SessionStatus) => Session;
392
+ create: (input: CreateSessionInput) => Session;
393
+ setKind: (id: string, kind: SessionKind, name?: string | null) => Session;
394
+ end: (id: string) => Session;
395
+ rename: (id: string, name: string) => Session;
396
+ promote: (id: string, name?: string) => Session;
397
+ demote: (id: string) => Session;
398
+ staleTemp: (olderThanMilliseconds: number) => Session[];
399
+ resetDead: (isAlive: (processId: number) => boolean) => Session[];
400
+ };
401
+ readonly agents: {
402
+ get: (session: string, name: string) => Agent | undefined;
403
+ start: (session: string, input: StartAgentInput) => Agent;
404
+ update: (session: string, name: string, input: UpdateAgentInput) => Agent;
405
+ finish: (session: string, name: string, input: FinishAgentInput) => Agent;
406
+ drop: (session: string, name: string, reason?: string) => Agent;
407
+ list: (session: string, options?: ListAgentsOptions) => Agent[];
408
+ reorderQueue: (session: string, names: string[]) => Agent[];
409
+ pairSubagent: (session: string, hostAgentId: string) => Agent | undefined;
410
+ stopSubagent: (session: string, hostAgentId: string, names?: string[]) => Agent | undefined;
411
+ };
412
+ readonly table: {
413
+ get: (session: string) => TableItem | undefined;
414
+ set: (session: string, input: SetTableInput) => TableItem;
415
+ clear: (session: string) => void;
416
+ };
417
+ readonly events: {
418
+ log: (session: string, input: LogEventInput) => CarnetEvent;
419
+ read: (session: string, limit?: number, agentOnly?: boolean) => CarnetEvent[];
420
+ };
421
+ readonly notes: {
422
+ add: (input: AddNoteInput) => AddNoteResult;
423
+ get: (id: number) => Note | null;
424
+ show: (id: number, halfLifeDays?: number) => NoteDetail;
425
+ list: (options?: ListNotesOptions) => WeightedNote[];
426
+ stale: (halfLifeDays?: number) => WeightedNote[];
427
+ drop: (id: number, input: DropNoteInput) => Note;
428
+ cite: (id: number, input: CiteNoteInput) => NoteCitation;
429
+ recordActiveDay: () => void;
430
+ activity: (session: string) => NoteActivity[];
431
+ };
432
+ readonly memory: {
433
+ atStart: (session: Session, options?: MemoryOptions) => string | undefined;
434
+ ofSession: (session: Session, options?: MemoryOptions) => string | undefined;
435
+ forRepo: (session: Session, repo: string, options?: MemoryOptions) => string | undefined;
436
+ copyRepos: (from: string, into: string) => void;
437
+ };
438
+ readonly status: {
439
+ view: (session: Session) => StatusView;
440
+ render: (session: Session, options?: RenderOptions) => string;
441
+ sections: (session: Session) => string;
442
+ };
443
+ close(): void;
444
+ }
445
+ interface OpenCarnetOptions extends LocateOptions, CarnetOptions {
446
+ dbPath?: string;
447
+ }
448
+ declare function openCarnet(options?: OpenCarnetOptions): Carnet;
449
+ declare function openGroupCarnet(group: Group, options?: OpenCarnetOptions): Carnet;
450
+ export { EventType as $, UpdateAgentInput as $t, DEFAULT_HALF_LIFE_DAYS as A, GROUP_DIRECTORY as At, NoteDetail as B, loadGroup as Bt, StatusLine as C, HostSubagentPayload as Ct, AddNoteInput as D, allHosts as Dt, formatClock as E, ResumeCommand as Et, NOTE_TEXT_LIMIT as F, REPORTS_DIRECTORY as Ft, isNoteKind as G, reportPathFor as Gt, STALE_AFTER_ACTIVE_DAYS as H, pinnedGroup as Ht, Note as I, ambiguousGroupContext as It, sessionNoteActivity as J, FinishAgentInput as Jt, localDay as K, reportsDirectoryOf as Kt, NoteActivity as L, findGroupRoot as Lt, DropNoteInput as M, Group as Mt, ListNotesOptions as N, GroupFile as Nt, AddNoteResult as O, hostById as Ot, NOTE_KINDS as P, LocateOptions as Pt, EVENT_TYPES as Q, StartAgentInput as Qt, NoteActivityKind as R, isGroupRoot as Rt, renderMemory as S, HostSessionPayload as St, buildStatusView as T, LaunchOptions as Tt, WeightedNote as U, repoNameFor as Ut, NoteKind as V, locateGroup as Vt, groupRepoNames as W, repoPathFor as Wt, AgentEventType as X, PUBLISH_FALLBACK_MILLISECONDS as Xt, similarity as Y, ListAgentsOptions as Yt, CarnetEvent as Z, REPORTING_NOTE as Zt, renderStatus as _, ContextFileResult as _t, openGroupCarnet as a, USER_ACTION_STATUSES as an, TableItem as at, MemoryOptions as b, HostPromptPayload as bt, NOTES_HEADER as c, isUserActionStatus as cn, HookEnv as ct, SIMILAR_PREFIX as d, MINIMUM_ID_PREFIX as dt, AGENT_STATUSES as en, LogEventInput as et, renderAgentLine as f, Session as ft, renderSections as g, ContextFile as gt, renderNotesSummary as h, shortId as ht, openCarnet as i, MAIN_WORKING_EMOJI as in, SetTableInput as it, DUPLICATE_SIMILARITY as j, GROUP_FILE as jt, CiteNoteInput as k, DB_FILE as kt, NotesMode as l, HookSessionPayload as lt, renderNotes as m, SessionStatus as mt, CarnetOptions as n, EMOJI as nn, SessionEventType as nt, MAIN_WORKING_SUFFIX as o, UserActionStatus as on, MergeResult as ot, renderNoteLine as p, SessionKind as pt, memoryHalfLife as q, Agent as qt, OpenCarnetOptions as r, LEGEND as rn, isEventType as rt, NOTES_FOLD_LINES as s, isAgentStatus as sn, CreateSessionInput as st, Carnet as t, AgentStatus as tn, SESSION_EVENT_TYPES as tt, RenderOptions as u, ListSessionsOptions as ut, renderTableLine as v, DEFAULT_HOST as vt, StatusView as w, HostToolPayload as wt, memoryMaxCharacters as x, HostSessionEndPayload as xt, MEMORY_MAX_CHARACTERS as y, Host as yt, NoteCitation as z, isInside as zt };
451
+ //# sourceMappingURL=carnet--axAq8FF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carnet--axAq8FF.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/group/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;;cCJA;KAYD,sBAAsB;cAErB;KAUD,2BAA2B;cAE1B,OAAO,OAAO,QAAQ;cAWtB;cAEA;iBAGG,cAAc,iBAAiB,SAAS;iBAIxC,mBAAmB,iBAAiB,SAAS;UCxC5C;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;cC3EA;cACA;cACA;cACA;UAEI;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;iBAGc,SAAS,mBAAmB;iBAQ5B,YAAY,OAAO,OAAO;iBAM1B,YAAY,OAAO,OAAO;iBAS1B,cAAc;iBAWd,mBAAmB,OAAO;iBAI1B,cAAc,OAAO,OAAO;iBAI5B,YAAY;iBAIZ,UAAU,eAAe;UAaxB;EACf;EACA,MAAM,OAAO;EACb;;iBAyBc,YAAY,KAAK,OAAO,aAAa;iBAKrC,cACd,KACA,KACA,cACC,gBAAqB;iBA6BR,sBAAsB;UClJrB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA,KAAK,OAAO,OAAO,0BAA0B;;KAGnC;UAEK;EACf;EACA;EACA,UAAU,KAAK,OAAO;EACtB,yBAAyB,KAAK,OAAO;EACrC,iBAAiB,KAAK,OAAO;EAC7B,oBAAoB,eAAe;EACnC,mBAAmB,eAAe;EAClC,qBAAqB,eAAe;EACpC,uBAAuB,eAAe;EACtC,iBAAiB,eAAe;EAChC,cAAc,SAAS;EACvB,wBAAwB,SAAS;EACjC,oBAAoB;EACpB,YAAY,SAAS;EACrB,cAAc,mBAAmB,UAAU,gBAAgB;EAC3D,cAAc,SAAS,SAAS,UAAU,gBAAgB;EAC1D,YAAY,QAAQ,SAAS,UAAU,gBAAgB;EACvD,kBAAkB;EAClB,gBAAgB,SAAS,SAAS,MAAM,OAAO;EAC/C,uBAAuB;;cAGZ;iBAIG,YAAY;iBAIZ,SAAS,aAAa;KCrF1B;KACA;UAEK;EACf;EACA;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAsBU,qBAAqB;UAEhB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf;EACA;;cAoPW;iBAEG,QAAQ;UC3TP;EACf,SAAS;EACT;EACA;EACA;EACA;;UCJe;EACf;EACA;EACA,QAAQ;EACR;EACA;;UAGe;EACf;EACA;EACA,SAAS;;cCbE;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;cCzDzC;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;;U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1,11 +1,25 @@
1
- import { $ as PUBLISH_FALLBACK_MILLISECONDS, A as HostSubagentPayload, B as REPORTS_DIRECTORY, C as shortId, D as Host, E as DEFAULT_HOST, F as GROUP_DIRECTORY, G as locateGroup, H as isGroupRoot, I as GROUP_FILE, J as reportPathFor, K as repoNameFor, L as Group, M as allHosts, N as hostById, O as HostPromptPayload, P as DB_FILE, Q as ListAgentsOptions, R as GroupFile, S as SessionStatus, T as ContextFileResult, U as isInside, V as findGroupRoot, W as loadGroup, X as Agent, Y as reportsDirectoryOf, Z as FinishAgentInput, _ as HookEnv, a as StatusLine, at as EMOJI, b as MINIMUM_ID_PREFIX, c as formatClock, ct as USER_ACTION_STATUSES, d as EventType, dt as isUserActionStatus, et as REPORTING_NOTE, f as LogEventInput, g as MergeResult, h as TableItem, i as openCarnet, it as AgentStatus, j as ResumeCommand, k as HostSessionPayload, l as CarnetEvent, lt as UserActionStatus, m as SetTableInput, n as CarnetOptions, nt as UpdateAgentInput, o as StatusView, ot as LEGEND, p as isEventType, q as repoPathFor, r as OpenCarnetOptions, rt as AGENT_STATUSES, s as buildStatusView, st as MAIN_WORKING_EMOJI, t as Carnet, tt as StartAgentInput, u as EVENT_TYPES, ut as isAgentStatus, v as HookSessionPayload, w as ContextFile, x as Session, y as ListSessionsOptions, z as LocateOptions } from "./carnet-CSdqWDas.mjs";
1
+ import { $ as EventType, $t as UpdateAgentInput, A as DEFAULT_HALF_LIFE_DAYS, At as GROUP_DIRECTORY, B as NoteDetail, Bt as loadGroup, C as StatusLine, Ct as HostSubagentPayload, D as AddNoteInput, Dt as allHosts, E as formatClock, Et as ResumeCommand, F as NOTE_TEXT_LIMIT, Ft as REPORTS_DIRECTORY, G as isNoteKind, Gt as reportPathFor, H as STALE_AFTER_ACTIVE_DAYS, Ht as pinnedGroup, I as Note, It as ambiguousGroupContext, J as sessionNoteActivity, Jt as FinishAgentInput, K as localDay, Kt as reportsDirectoryOf, L as NoteActivity, Lt as findGroupRoot, M as DropNoteInput, Mt as Group, N as ListNotesOptions, Nt as GroupFile, O as AddNoteResult, Ot as hostById, P as NOTE_KINDS, Pt as LocateOptions, Q as EVENT_TYPES, Qt as StartAgentInput, R as NoteActivityKind, Rt as isGroupRoot, S as renderMemory, St as HostSessionPayload, T as buildStatusView, Tt as LaunchOptions, U as WeightedNote, Ut as repoNameFor, V as NoteKind, Vt as locateGroup, W as groupRepoNames, Wt as repoPathFor, X as AgentEventType, Xt as PUBLISH_FALLBACK_MILLISECONDS, Y as similarity, Yt as ListAgentsOptions, Z as CarnetEvent, Zt as REPORTING_NOTE, _ as renderStatus, _t as ContextFileResult, a as openGroupCarnet, an as USER_ACTION_STATUSES, at as TableItem, b as MemoryOptions, bt as HostPromptPayload, c as NOTES_HEADER, cn as isUserActionStatus, ct as HookEnv, d as SIMILAR_PREFIX, dt as MINIMUM_ID_PREFIX, en as AGENT_STATUSES, et as LogEventInput, f as renderAgentLine, ft as Session, g as renderSections, gt as ContextFile, h as renderNotesSummary, ht as shortId, i as openCarnet, in as MAIN_WORKING_EMOJI, it as SetTableInput, j as DUPLICATE_SIMILARITY, jt as GROUP_FILE, k as CiteNoteInput, kt as DB_FILE, l as NotesMode, lt as HookSessionPayload, m as renderNotes, mt as SessionStatus, n as CarnetOptions, nn as EMOJI, nt as SessionEventType, o as MAIN_WORKING_SUFFIX, on as UserActionStatus, ot as MergeResult, p as renderNoteLine, pt as SessionKind, q as memoryHalfLife, qt as Agent, r as OpenCarnetOptions, rn as LEGEND, rt as isEventType, s as NOTES_FOLD_LINES, sn as isAgentStatus, st as CreateSessionInput, t as Carnet, tn as AgentStatus, tt as SESSION_EVENT_TYPES, u as RenderOptions, ut as ListSessionsOptions, v as renderTableLine, vt as DEFAULT_HOST, w as StatusView, wt as HostToolPayload, x as memoryMaxCharacters, xt as HostSessionEndPayload, y as MEMORY_MAX_CHARACTERS, yt as Host, z as NoteCitation, zt as isInside } from "./carnet--axAq8FF.mjs";
2
2
  import { DatabaseSync } from "node:sqlite";
3
+ interface MoveOptions {
4
+ merge?: boolean | undefined;
5
+ dryRun?: boolean | undefined;
6
+ }
7
+ interface MoveResult {
8
+ session: Session;
9
+ into: Session | null;
10
+ movedAgents: string[];
11
+ skippedAgents: string[];
12
+ movedEvents: number;
13
+ movedTable: boolean;
14
+ unlinkedNotes: number;
15
+ }
16
+ export declare function moveSession(source: Carnet, sessionId: string, target: Carnet, options?: MoveOptions): MoveResult;
3
17
  export declare const MEMORY_DB = ":memory:";
4
18
  export declare function openDatabase(path: string): DatabaseSync;
5
19
  export declare const migrations: readonly string[];
6
20
  export declare function schemaVersion(db: DatabaseSync): number;
7
21
  export declare function migrate(db: DatabaseSync): void;
8
- type CarnetErrorCode = 'NO_GROUP' | 'GROUP_EXISTS' | 'REPO_NOT_FOUND' | 'UNKNOWN_HOST' | 'NO_SESSION' | 'SESSION_NOT_FOUND' | 'SESSION_AMBIGUOUS' | 'SESSION_NAME_TAKEN' | 'SESSION_MERGE_INVALID' | 'AGENT_EXISTS' | 'AGENT_NOT_FOUND' | 'INVALID_STATUS' | 'INVALID_EVENT_TYPE' | 'TABLE_STATUS_WITH_MAIN_WORKING';
22
+ type CarnetErrorCode = 'NO_GROUP' | 'GROUP_AMBIGUOUS' | 'GROUP_EXISTS' | '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' | 'AGENT_EXISTS' | 'AGENT_NOT_FOUND' | 'INVALID_STATUS' | 'INVALID_EVENT_TYPE' | 'TABLE_STATUS_WITH_MAIN_WORKING';
9
23
  export declare class CarnetError extends Error {
10
24
  readonly code: CarnetErrorCode;
11
25
  constructor(code: CarnetErrorCode, message: string);
@@ -27,12 +41,43 @@ export declare function rucherHome(env?: NodeJS.ProcessEnv): string;
27
41
  export declare function readRegistry(env?: NodeJS.ProcessEnv): GroupReference[];
28
42
  export declare function registerGroup(reference: GroupReference, env?: NodeJS.ProcessEnv): GroupReference[];
29
43
  export declare function unregisterGroups(paths: string[], env?: NodeJS.ProcessEnv): GroupReference[];
44
+ export declare function handleSessionEnd(carnet: Carnet, payload: HostSessionEndPayload): Session | undefined;
30
45
  interface SessionStartResult {
31
46
  session: Session;
32
47
  additionalContext?: string;
48
+ contextParts: string[];
49
+ notices: string[];
33
50
  }
34
51
  export declare function handleSessionStart(carnet: Carnet, payload: HookSessionPayload, env: HookEnv): SessionStartResult;
52
+ export declare const PROMPT_FILE = "prompt.md";
53
+ export declare const PROMPTS_DIRECTORY = "prompts";
54
+ interface PromptSession {
55
+ id: string;
56
+ name: string | null;
57
+ kind: SessionKind;
58
+ }
59
+ interface AssembledPrompt {
60
+ text: string;
61
+ version: string;
62
+ }
63
+ interface AppendPromptFile {
64
+ path: string;
65
+ version: string;
66
+ }
67
+ export declare function baseRules(env?: NodeJS.ProcessEnv): string;
68
+ export declare function groupRules(group: Group): string | undefined;
69
+ export declare function rulesText(group: Group, env?: NodeJS.ProcessEnv): string;
70
+ export declare function rulesVersion(group: Group, env?: NodeJS.ProcessEnv): string;
71
+ export declare function assemblePrompt(group: Group, session: PromptSession, env?: NodeJS.ProcessEnv): AssembledPrompt;
72
+ export declare function appendPromptFile(group: Group, session: PromptSession, env?: NodeJS.ProcessEnv): AppendPromptFile;
73
+ export declare function compactReminder(group: Group, env?: NodeJS.ProcessEnv): string;
74
+ export declare const OUTSIDE_RUCHER_CONTEXT = "This session was started without rucher, so the Rucher rules are not in its system prompt. Follow the Carnet server instructions and load the rucher skill before dispatching or applying forks.";
75
+ 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)";
76
+ export declare const RULES_UPDATED_NOTICE = "rucher: rules updated, will apply after the next compaction or in a new session";
77
+ 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.";
78
+ 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.";
35
79
  export declare function handleUserPromptSubmit(carnet: Carnet, host: Host, payload: HostPromptPayload): Session;
80
+ export declare function handleToolUse(carnet: Carnet, payload: HostToolPayload, env: HookEnv): string | undefined;
36
81
  export declare const REPOS_START = "<!-- rucher:repos start -->";
37
82
  export declare const REPOS_END = "<!-- rucher:repos end -->";
38
83
  export declare function transcriptTitle(path: string): string | undefined;
@@ -56,10 +101,5 @@ export declare const PAIRING_WINDOW_MILLISECONDS = 60000;
56
101
  export declare const STOPPED_NOTE = "stopped without agent_done";
57
102
  export declare const NOTE_MAX = 60;
58
103
  export declare function sanitizeNote(text: string): string;
59
- export declare const MAIN_WORKING_SUFFIX = "(main working, not ready)";
60
- export declare function renderTableLine(item: TableItem): string;
61
- export declare function renderAgentLine(line: StatusLine): string;
62
- export declare function renderSections(view: StatusView): string;
63
- export declare function renderStatus(view: StatusView): string;
64
- export { AGENT_STATUSES, type Agent, type AgentStatus, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type ContextFile, type ContextFileResult, DB_FILE, DEFAULT_HOST, EMOJI, EVENT_TYPES, type EventType, type FinishAgentInput, GROUP_DIRECTORY, GROUP_FILE, type Group, type GroupFile, type GroupReference, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostSessionPayload, type HostSubagentPayload, type InitOptions, LEGEND, type ListAgentsOptions, type ListSessionsOptions, type LocateOptions, type LogEventInput, MAIN_WORKING_EMOJI, MINIMUM_ID_PREFIX, type MergeResult, type OpenCarnetOptions, PUBLISH_FALLBACK_MILLISECONDS, REPORTING_NOTE, REPORTS_DIRECTORY, type ResumeCommand, type ResumeContextOptions, type Session, type SessionStartResult, type SessionStatus, type SetTableInput, type StartAgentInput, type StatusLine, type StatusView, type TableItem, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, allHosts, buildStatusView, findGroupRoot, formatClock, hostById, isAgentStatus, isEventType, isGroupRoot, isInside, isUserActionStatus, loadGroup, locateGroup, openCarnet, repoNameFor, repoPathFor, reportPathFor, reportsDirectoryOf, shortId };
104
+ export { AGENT_STATUSES, type AddNoteInput, type AddNoteResult, type Agent, type AgentEventType, type AgentStatus, type AppendPromptFile, type AssembledPrompt, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type CiteNoteInput, type ContextFile, type ContextFileResult, type CreateSessionInput, DB_FILE, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DUPLICATE_SIMILARITY, type DropNoteInput, EMOJI, EVENT_TYPES, type EventType, type FinishAgentInput, GROUP_DIRECTORY, GROUP_FILE, type Group, type GroupFile, type GroupReference, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostSessionEndPayload, type HostSessionPayload, type HostSubagentPayload, type HostToolPayload, type InitOptions, LEGEND, type LaunchOptions, type ListAgentsOptions, type ListNotesOptions, type ListSessionsOptions, type LocateOptions, 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, REPORTS_DIRECTORY, type RenderOptions, type ResumeCommand, type ResumeContextOptions, 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 TableItem, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, type WeightedNote, allHosts, ambiguousGroupContext, buildStatusView, findGroupRoot, formatClock, groupRepoNames, hostById, isAgentStatus, isEventType, isGroupRoot, isInside, isNoteKind, isUserActionStatus, loadGroup, localDay, locateGroup, memoryHalfLife, memoryMaxCharacters, openCarnet, openGroupCarnet, pinnedGroup, renderAgentLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderSections, renderStatus, renderTableLine, repoNameFor, repoPathFor, reportPathFor, reportsDirectoryOf, sessionNoteActivity, shortId, similarity };
65
105
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/db/open.ts","../src/db/schema.ts","../src/errors.ts","../src/group/init.ts","../src/group/registry.ts","../src/hook/session-start.ts","../src/hook/user-prompt-submit.ts","../src/hosts/claude-code.ts","../src/purge.ts","../src/resume.ts","../src/subagents.ts","../src/status/note.ts","../src/status/render.ts"],"mappings":";;qBAGa;wBAEG,aAAa,eAAe;qBCH/B;wBA6EG,cAAc,IAAI;wBAKlB,QAAQ,IAAI;KCpFhB;qBAgBC,oBAAoB;WAEpB,MAAM;EADjB,YACW,MAAM,iBACf;;UCHa;EACf;EACA;EACA;EACA,MAAM,OAAO;;wBAcC,UAAU,mBAAmB,UAAS,cAAmB;wBAkBzD,aAAa,cAAc,eAAe;wBAa1C,gBAAgB,cAAc,eAAe;UC7D5C;EACf;EACA;;wBAOc,WAAW,MAAK,OAAO;wBAQvB,aAAa,MAAM,OAAO,aAAa;wBAmBvC,cACd,WAAW,gBACX,MAAM,OAAO,aACZ;wBAOa,iBAAiB,iBAAiB,MAAM,OAAO,aAAa;UC7C3D;EACf,SAAS;EACT;;wBAGc,mBACd,QAAQ,QACR,SAAS,oBACT,KAAK,UACJ;wBCVa,uBACd,QAAQ,QACR,MAAM,MACN,SAAS,oBACR;qBCgBU;qBACA;wBAeG,gBAAgB;wBAkBhB,WAAW,OAAO;wBAOlB,kBAAkB,iBAAiB,OAAO;wBAO1C,kBAAkB,OAAO;wBAiBzB,cAAc,OAAO;qBAmDxB,YAAY;qBC1IZ;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;qBCPhB;wBAEG,gBAAgB,MAAM;wBAKtB,gBAAgB,MAAM;wBAItB,eAAe,MAAM;wBAgBrB,aAAa,MAAM"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/move.ts","../src/db/open.ts","../src/db/schema.ts","../src/errors.ts","../src/group/init.ts","../src/group/registry.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"],"mappings":";;UAKiB;EACf;EACA;;UAGe;EACf,SAAS;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;;wBA8Cc,YACd,QAAQ,QACR,mBACA,QAAQ,QACR,UAAS,cACR;qBCjEU;wBAEG,aAAa,eAAe;qBCH/B;wBAgLG,cAAc,IAA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