@rucher/carnet 0.2.0 → 0.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
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";
1
+ import { $ as NoteDetail, $t as addWorkspaceRepo, A as memoryMaxCharacters, An as MAIN_FAILED_EMOJI, At as LaunchOptions, B as AddNoteInput, Bn as CarnetEvent, Bt as repoNameFor, C as renderNotes, Cn as AGENT_STATUSES, Ct as HostPromptPayload, D as renderTableLine, Dn as KIND_LEGEND, Dt as HostStopPayload, E as renderStatus, En as KIND_ABBREVIATIONS, Et as HostSessionPayload, F as buildStatusView, Fn as UserActionStatus, Ft as hostById, G as DropNoteInput, Gn as SessionEventType, Gt as AGENTS_FILE, H as CiteNoteInput, Hn as EventType, Ht as requireWorkspace, I as formatClock, In as isAgentStatus, It as ResolveWorkspaceOptions, J as NOTE_TEXT_LIMIT, Jt as INSTRUCTIONS_FILE, K as ListNotesOptions, Kn as isEventType, Kt as CreateWorkspaceOptions, L as TURNS, Ln as isUserActionStatus, Lt as WorkspaceOrigin, M as StatusLine, Mn as MAIN_WORKING_EMOJI, Mt as RelocatedFolder, N as StatusView, Nn as OPEN_AGENT_STATUSES, Nt as ResumeCommand, O as MEMORY_MAX_CHARACTERS, On as KIND_TAG_PATTERN, Ot as HostSubagentPayload, P as StatusViewOptions, Pn as USER_ACTION_STATUSES, Pt as allHosts, Q as NoteCitation, Qt as WorkspaceRepo, R as Turn, Rn as kindTag, Rt as WorkspaceResolution, S as renderNoteLine, Sn as statusWhenDone, St as Host, T as renderSections, Tn as EMOJI, Tt as HostSessionEndPayload, U as DEFAULT_HALF_LIFE_DAYS, Un as LogEventInput, Ut as resolveWorkspace, V as AddNoteResult, Vn as EVENT_TYPES, Vt as repoPathFor, W as DUPLICATE_SIMILARITY, Wn as SESSION_EVENT_TYPES, Wt as workspaceLabel, X as NoteActivity, Xt as Workspace, Y as Note, Yt as WORKSPACE_FILE, Z as NoteActivityKind, Zt as WorkspaceFile, _ as NotesMode, _n as REPORTING_NOTE, _t as Session, a as ResolvedCarnet, an as listWorkspaces, at as memoryHalfLife, b as renderAgentLine, bn as UpdateAgentInput, bt as shortId, c as openWorkspaceCarnet, cn as workspaceExists, ct as workspaceRepoNames, d as MAIN_HEADER, dn as Agent, dt as MergeResult, en as createWorkspace, et as NoteKind, f as MAIN_IDLE, fn as AgentKind, ft as CreateSessionInput, g as NOTES_HEADER, gn as PUBLISH_FALLBACK_MILLISECONDS, gt as MINIMUM_ID_PREFIX, h as NOTES_FOLD_LINES, hn as ListAgentsOptions, ht as ListSessionsOptions, i as OpenCarnetOptions, in as isWorkspaceName, it as localDay, j as renderMemory, jn as MAIN_WAITING_EMOJI, jt as ProjectRelocation, k as MemoryOptions, kn as LEGEND, kt as HostToolPayload, l as BLOCKED_HEADER, ln as workspaceHosts, lt as SetTableInput, m as MAIN_WORKING_SUFFIX, mn as KIND_REQUIRED, mt as HookSessionPayload, n as CarnetOptions, nn as dropWorkspace, nt as WeightedNote, o as openCarnet, on as loadWorkspace, ot as sessionNoteActivity, p as MAIN_WAITING_SUFFIX, pn as FinishAgentInput, pt as HookEnv, q as NOTE_KINDS, qt as DropWorkspaceOptions, r as ClosedAgent, rn as expandHome, rt as isNoteKind, s as openResolvedCarnet, sn as removeWorkspaceRepo, st as similarity, t as Carnet, tn as definitionInstructions, tt as STALE_AFTER_ACTIVE_DAYS, u as MAIN_FAILED_SUFFIX, un as AGENT_KINDS, ut as TableItem, v as RenderOptions, vn as SANDBOX_KINDS, vt as SessionKind, w as renderNotesSummary, wn as AgentStatus, wt as HostRender, x as renderMainLine, xn as isAgentKind, xt as DEFAULT_HOST, y as SIMILAR_PREFIX, yn as StartAgentInput, yt as SessionStatus, z as TurnOptions, zn as AgentEventType, zt as isInside } from "./carnet-BFA2yya4.mjs";
2
2
  import { DatabaseSync } from "node:sqlite";
3
3
  interface MoveOptions {
4
4
  merge?: boolean | undefined;
@@ -14,20 +14,101 @@ 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 | null | undefined;
17
+ export declare function sessionWorkspaceName(db: DatabaseSync, sessionId: string): string | undefined;
18
18
  export declare function archiveWorkspaceSessions(db: DatabaseSync, name: string, at: string): number;
19
19
  export declare function deleteWorkspaceNotes(db: DatabaseSync, name: string): number;
20
20
  export declare function workspaceSessionCounts(db: DatabaseSync): Map<string, number>;
21
+ export declare function workspaceLastActive(db: DatabaseSync): Map<string, string>;
22
+ interface WorkspaceRowCounts {
23
+ sessions: number;
24
+ notes: number;
25
+ activeDays: number;
26
+ }
27
+ interface RunningSessionRow {
28
+ id: string;
29
+ name: string | null;
30
+ hostPid: number;
31
+ }
32
+ interface RenameWorkspaceOptions {
33
+ env?: NodeJS.ProcessEnv | undefined;
34
+ dryRun?: boolean | undefined;
35
+ isAlive: (processId: number) => boolean;
36
+ now?: (() => Date) | undefined;
37
+ }
38
+ interface FolderMove {
39
+ what: string;
40
+ from: string;
41
+ to: string;
42
+ }
43
+ interface RenamePlan {
44
+ from: string;
45
+ to: string;
46
+ moves: FolderMove[];
47
+ rows: WorkspaceRowCounts;
48
+ running: RunningSessionRow[];
49
+ }
50
+ interface RenameResult extends RenamePlan {
51
+ backup: string;
52
+ paths: number;
53
+ trustMoved: boolean;
54
+ warnings: string[];
55
+ }
56
+ export declare function planWorkspaceRename(db: DatabaseSync, from: string, to: string, options: RenameWorkspaceOptions): RenamePlan;
57
+ export declare function renameWorkspace(db: DatabaseSync, from: string, to: string, options: RenameWorkspaceOptions): RenamePlan | RenameResult;
58
+ interface MergeWorkspacesOptions {
59
+ env?: NodeJS.ProcessEnv | undefined;
60
+ isAlive: (processId: number) => boolean;
61
+ now?: (() => Date) | undefined;
62
+ }
63
+ interface FileMove {
64
+ from: string;
65
+ to: string;
66
+ }
67
+ interface MergePlan {
68
+ from: string;
69
+ into: string;
70
+ rows: WorkspaceRowCounts;
71
+ firstNumber: number;
72
+ lastNumber: number;
73
+ running: RunningSessionRow[];
74
+ reposAdded: string[];
75
+ reposRenamed: [string, string][];
76
+ settingsConflicts: string[];
77
+ reports: FileMove[];
78
+ sandboxes: FileMove[];
79
+ files: FileMove[];
80
+ instructions: string;
81
+ }
82
+ interface MergeResult$1 extends MergePlan {
83
+ backup: string;
84
+ projectMoves: number;
85
+ trustDropped: boolean;
86
+ instructionsPath: string;
87
+ warnings: string[];
88
+ }
89
+ export declare function planWorkspaceMerge(db: DatabaseSync, fromName: string, intoName: string, options: MergeWorkspacesOptions): MergePlan;
90
+ export declare function mergeWorkspaces(db: DatabaseSync, fromName: string, intoName: string, options: MergeWorkspacesOptions): MergeResult$1;
91
+ export declare function backupsDirectory(env?: NodeJS.ProcessEnv): string;
21
92
  export declare const MEMORY_DB = ":memory:";
22
93
  export declare function openDatabase(path: string): DatabaseSync;
23
94
  export declare const migrations: readonly string[];
24
95
  export declare function schemaVersion(db: DatabaseSync): number;
25
96
  export declare function migrate(db: DatabaseSync): void;
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';
97
+ type CarnetErrorCode = 'NO_WORKSPACE' | 'WORKSPACE_EXISTS' | 'WORKSPACE_NOT_FOUND' | 'WORKSPACE_NAME_INVALID' | 'WORKSPACE_BUSY' | 'WORKSPACE_RELOCATE_FAILED' | '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' | 'AGENT_AMBIGUOUS' | 'INVALID_TARGET' | 'INVALID_BLOCKER' | 'INVALID_KIND' | 'INVALID_SANDBOX' | 'INVALID_QUESTIONS' | 'QUESTION_NOT_FOUND' | 'FINDING_NOT_FOUND' | 'REASON_REQUIRED' | 'SECTION_NOT_FOUND' | 'REPORT_MISSING' | 'INVALID_STATUS' | 'INVALID_EVENT_TYPE' | 'COMMIT_REQUIRED' | 'SCHEMA_TOO_NEW';
27
98
  export declare class CarnetError extends Error {
28
99
  readonly code: CarnetErrorCode;
29
100
  constructor(code: CarnetErrorCode, message: string);
30
101
  }
102
+ export declare function locateAgent(carnet: Carnet, name: string): {
103
+ session: Session;
104
+ agent: Agent;
105
+ };
106
+ export declare function nextAgent(carnet: Carnet, session: string, prefix?: string): string | undefined;
107
+ interface ReportDocument {
108
+ text: string;
109
+ path: string;
110
+ }
111
+ export declare function reportDocument(carnet: Carnet, session: string, name: string): ReportDocument;
31
112
  interface RucherPaths {
32
113
  config: string;
33
114
  data: string;
@@ -42,8 +123,10 @@ export declare function defaultRunDirectory(name: string, env?: NodeJS.ProcessEn
42
123
  export declare function promptsDirectory(env?: NodeJS.ProcessEnv): string;
43
124
  export declare function corePromptPath(env?: NodeJS.ProcessEnv): string;
44
125
  export declare function reportsDirectory(workspace: Workspace): string;
126
+ export declare function sandboxesDirectory(workspace: Workspace): string;
45
127
  export declare function reportPath(workspace: Workspace, agentName: string): string;
46
128
  export declare function handleSessionEnd(carnet: Carnet, payload: HostSessionEndPayload): Session | undefined;
129
+ export declare function handleStop(carnet: Carnet, payload: HostStopPayload): void;
47
130
  interface SessionStartResult {
48
131
  session: Session;
49
132
  additionalContext?: string;
@@ -75,12 +158,40 @@ export declare function compactReminder(workspace: Workspace | null, env?: NodeJ
75
158
  export declare function outsideRucherContext(workspace: Workspace | null, env?: NodeJS.ProcessEnv): string;
76
159
  export declare const OUTSIDE_RUCHER_NOTICE = "rucher: session started without rucher, the Rucher rules are not in its system prompt (use rucher new, tmp or resume)";
77
160
  export declare const RULES_UPDATED_NOTICE = "rucher: rules updated, will apply after the next compaction or in a new session";
78
- export declare const SUBAGENT_RULES = "Rucher rules for sub-agents: never commit, push or stash. When your task asks for a report, write it to the file it names. If your prompt names you as a Carnet agent, call agent_update at meaningful progress and agent_done as your last tool action, then reply with one line.";
79
- export declare const CORE_RULES = "- Work can be parallel, review stays sequential: forks work at the same time, the human handles their results one at a time.\n- The human keeps the hand: only the human launches 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.";
80
- export declare function handleUserPromptSubmit(carnet: Carnet, host: Host, payload: HostPromptPayload): Session;
81
- export declare function handleToolUse(carnet: Carnet, payload: HostToolPayload, env: HookEnv): string | undefined;
161
+ 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.";
162
+ 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, asks for their report and its next 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 next action (/rucher:next), 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.";
163
+ export declare function handleUserPromptSubmit(carnet: Carnet, host: Host, payload: HostPromptPayload, options?: TurnOptions): Session;
164
+ export declare function handleToolUse(carnet: Carnet, payload: HostToolPayload, env: HookEnv, options?: TurnOptions): string | undefined;
165
+ export declare const WAITING_TOOL = "AskUserQuestion";
166
+ export declare function handleToolStart(carnet: Carnet, payload: HostToolPayload): void;
167
+ export declare function guardSubagentCall(carnet: Carnet, payload: HostToolPayload, scratchRoots: string[]): string | undefined;
168
+ export declare function guardMainLaunch(carnet: Carnet, payload: HostToolPayload): string | undefined;
169
+ export declare const GUARDED_TOOLS: Set<string>;
170
+ interface GuardInput {
171
+ kind: AgentKind;
172
+ toolName: string;
173
+ filePath?: string | undefined;
174
+ command?: string | undefined;
175
+ cwd?: string | undefined;
176
+ worktree?: string | null | undefined;
177
+ sandbox?: string | null | undefined;
178
+ scratchRoots: string[];
179
+ }
180
+ export declare function guardToolCall(input: GuardInput): string | undefined;
181
+ export declare function kindOfAgentType(agentType: string | undefined): AgentKind | undefined;
182
+ export declare const LAUNCH_TOOLS: ReadonlySet<string>;
183
+ export declare const BUILT_IN_PLAN_DENIED = "In a Rucher session a plan agent is a Rucher fork, never the built-in Plan subagent: use /rucher:start:plan (agent_start with kind plan, then Agent with subagent_type fork and the agent name as description). For a question with no change, use /rucher:start:research.";
184
+ interface LaunchCall {
185
+ toolName: string;
186
+ subagentType?: string | undefined;
187
+ named?: Agent | undefined;
188
+ pendingPlan?: Agent | undefined;
189
+ }
190
+ export declare function guardLaunch(call: LaunchCall): string | undefined;
82
191
  export declare function transcriptTitle(path: string): string | undefined;
83
192
  export declare function workspaceSettings(workspace: Workspace): Record<string, unknown>;
193
+ export declare function claudeProjectFolder(cwd: string, env?: NodeJS.ProcessEnv): string;
194
+ export declare function claudeConfigFile(env?: NodeJS.ProcessEnv): string;
84
195
  export declare const claudeCode: Host;
85
196
  export declare const DEFAULT_PURGE_DAYS = 3;
86
197
  export declare function purgeDays(value: string | undefined): number;
@@ -97,6 +208,15 @@ export declare const PAIRING_WINDOW_MILLISECONDS = 60000;
97
208
  export declare const STOPPED_NOTE = "stopped without agent_done";
98
209
  export declare const NOTE_MAX = 60;
99
210
  export declare function sanitizeNote(text: string): string;
211
+ export declare const STATUS_LINE_LABEL = "rucher";
212
+ export declare function renderStatusLine(view: StatusView, lag?: string | null): string;
213
+ export declare function labelStatusLine(line: string): string;
214
+ export declare function statusLinePath(sessionId: string, env?: NodeJS.ProcessEnv): string;
215
+ interface StatusLineOptions {
216
+ env?: NodeJS.ProcessEnv | undefined;
217
+ lag?: string | null | undefined;
218
+ }
219
+ export declare function writeStatusLine(carnet: Carnet, sessionId: string, options?: StatusLineOptions): void;
100
220
  type OpenAgentStatus = (typeof OPEN_AGENT_STATUSES)[number];
101
221
  export declare const AGENT_STEPS: readonly ['answered', 'applying', 'applied', 'tested', 'committed', 'dropped'];
102
222
  type AgentStep = (typeof AGENT_STEPS)[number];
@@ -124,5 +244,5 @@ export declare function markdownCopy(content: string): string;
124
244
  export declare function removeStaleCopies(directory: string, keep: ReadonlySet<string>): string[];
125
245
  export declare function writeGenerated(path: string, content: string): boolean;
126
246
  export declare function mergeSettings(base: Record<string, unknown>, extra: Record<string, unknown>): Record<string, unknown>;
127
- export { AGENTS_FILE, AGENT_STATUSES, type AddNoteInput, type AddNoteResult, type Agent, type AgentEventType, type AgentStatus, type AgentStep, type AppendPromptFile, type AssembledPrompt, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type CiteNoteInput, type CreateSessionInput, type CreateWorkspaceOptions, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DUPLICATE_SIMILARITY, type DropNoteInput, type DropWorkspaceOptions, EMOJI, EVENT_TYPES, type EventType, type FinishAgentInput, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostRender, type HostSessionEndPayload, type HostSessionPayload, type HostSubagentPayload, type HostToolPayload, INSTRUCTIONS_FILE, LEGEND, type LaunchOptions, type ListAgentsOptions, type ListNotesOptions, type ListSessionsOptions, type LogEventInput, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, type MemoryOptions, type MergeResult, type MoveOptions, type MoveResult, NOTES_FOLD_LINES, NOTES_HEADER, NOTE_KINDS, NOTE_TEXT_LIMIT, type Note, type NoteActivity, type NoteActivityKind, type NoteCitation, type NoteDetail, type NoteKind, type NotesMode, type OpenCarnetOptions, PUBLISH_FALLBACK_MILLISECONDS, type PromptSession, REPORTING_NOTE, type RenderOptions, type RenderResult, type ResolveWorkspaceOptions, type ResolvedCarnet, type ResumeCommand, type ResumeContextOptions, type RucherPaths, type RunDirectoryRenderOptions, SESSION_EVENT_TYPES, SIMILAR_PREFIX, STALE_AFTER_ACTIVE_DAYS, type Session, type SessionEventType, type SessionKind, type SessionStartResult, type SessionStatus, type SetTableInput, type StartAgentInput, type StatusLine, type StatusView, type StepAgentInput, type TableItem, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, WORKSPACE_FILE, type WeightedNote, type Workspace, type WorkspaceFile, type WorkspaceOrigin, type WorkspaceRepo, type WorkspaceResolution, addWorkspaceRepo, allHosts, 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 };
247
+ 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, BLOCKED_HEADER, Carnet, type CarnetErrorCode, type CarnetEvent, type CarnetOptions, type CiteNoteInput, type ClosedAgent, type CreateSessionInput, type CreateWorkspaceOptions, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DUPLICATE_SIMILARITY, type DropNoteInput, type DropWorkspaceOptions, EMOJI, EVENT_TYPES, type EventType, type FileMove, type FinishAgentInput, type FolderMove, type HookEnv, type HookSessionPayload, type Host, type HostPromptPayload, type HostRender, type HostSessionEndPayload, type HostSessionPayload, type HostSubagentPayload, type HostToolPayload, INSTRUCTIONS_FILE, KIND_ABBREVIATIONS, KIND_LEGEND, KIND_REQUIRED, KIND_TAG_PATTERN, LEGEND, type LaunchOptions, type ListAgentsOptions, type ListNotesOptions, type ListSessionsOptions, type LogEventInput, MAIN_FAILED_EMOJI, MAIN_FAILED_SUFFIX, MAIN_HEADER, MAIN_IDLE, MAIN_WAITING_EMOJI, MAIN_WAITING_SUFFIX, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, type MemoryOptions, type MergePlan, type MergeResult, type MergeWorkspacesOptions, 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 ProjectRelocation, type PromptSession, REPORTING_NOTE, type RelocatedFolder, type RenamePlan, type RenameResult, type RenameWorkspaceOptions, type RenderOptions, type RenderResult, type ReportDocument, type ResolveWorkspaceOptions, type ResolvedCarnet, type ResumeCommand, type ResumeContextOptions, type RucherPaths, type RunDirectoryRenderOptions, type RunningSessionRow, SANDBOX_KINDS, 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 StatusLineOptions, type StatusView, type StatusViewOptions, type StepAgentInput, TURNS, type TableItem, type Turn, type TurnOptions, USER_ACTION_STATUSES, type UpdateAgentInput, type UserActionStatus, WORKSPACE_FILE, type WeightedNote, type Workspace, type WorkspaceFile, type MergeResult$1 as WorkspaceMergeResult, type WorkspaceOrigin, type WorkspaceRepo, type WorkspaceResolution, type WorkspaceRowCounts, addWorkspaceRepo, allHosts, buildStatusView, createWorkspace, definitionInstructions, dropWorkspace, expandHome, formatClock, hostById, isAgentKind, isAgentStatus, isEventType, isInside, isNoteKind, isUserActionStatus, isWorkspaceName, kindTag, listWorkspaces, loadWorkspace, localDay, memoryHalfLife, memoryMaxCharacters, openCarnet, openResolvedCarnet, openWorkspaceCarnet, removeWorkspaceRepo, renderAgentLine, renderMainLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderSections, renderStatus, renderTableLine, repoNameFor, repoPathFor, requireWorkspace, resolveWorkspace, sessionNoteActivity, shortId, similarity, statusWhenDone, workspaceExists, workspaceHosts, workspaceLabel, workspaceRepoNames };
128
248
  //# 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/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;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C0FS,gBAAgB;wBA4DhB,kBAAkB,WAAW,YAAY;qBA2D5C,YAAY;qBCzNZ;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;KCPxB,0BAA0B;qBAElB;KAQD,oBAAoB;UAEf;EACf;EACA,MAAM;EACN;EACA;EACA,OAAO;;wBAkBO,UAAU,QAAQ,QAAQ,iBAAiB,OAAO;UClCjD;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":["MergeResult"],"sources":["../src/move.ts","../src/workspace-rows.ts","../src/workspace/rename.ts","../src/workspace/merge.ts","../src/workspace/backup.ts","../src/db/open.ts","../src/db/schema.ts","../src/errors.ts","../src/kinds.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/launch.ts","../src/hosts/claude-code.ts","../src/purge.ts","../src/resume.ts","../src/subagents.ts","../src/status/note.ts","../src/status/line.ts","../src/steps.ts","../src/render.ts","../src/run-directory-files.ts"],"mappings":";;UAIiB;EACf;EACA;;UAGe;EACf,SAAS;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;;wBAwBc,YACd,QAAQ,QACR,mBACA,yBACA,UAAS,cACR;wBC9Ba,qBAAqB,IAAI,cAAc;wBAOvC,yBAAyB,IAAI,cAAc,cAAc;wBAczD,qBAAqB,IAAI,cAAc;wBAIvC,uBAAuB,IAA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