@rucher/carnet 0.3.0-beta.0 → 0.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/carnet-BFA2yya4.d.mts.map +1 -1
- package/dist/index.d.mts +19 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +119 -7
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +16 -4
- package/dist/mcp.mjs.map +1 -1
- package/dist/{steps-j8vhVj8h.mjs → steps-Zp-DXCuQ.mjs} +53 -16
- package/dist/steps-Zp-DXCuQ.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/steps-j8vhVj8h.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carnet-BFA2yya4.d.mts","names":["_$__merge_ts0.MergeResult","_$__questions_ts0.Question","_$__findings_ts0.Finding","_$__table_ts0.TableItem","_$__events_ts0.CarnetEvent","_$__notes_ts0.AddNoteResult","_$__notes_ts0.Note","_$__notes_ts0.NoteDetail","_$__notes_ts0.WeightedNote","_$__notes_ts0.NoteCitation","_$__notes_ts0.NoteActivity","_$__status_view_ts0.StatusView"],"sources":["../src/context.ts","../src/events.ts","../src/status/model.ts","../src/agents.ts","../src/workspace/workspace.ts","../src/workspace/locate.ts","../src/workspace/undo.ts","../src/hosts/host.ts","../src/sessions.ts","../src/merge.ts","../src/questions.ts","../src/findings.ts","../src/table.ts","../src/notes.ts","../src/turn.ts","../src/status/view.ts","../src/memory.ts","../src/status/render.ts","../src/carnet.ts"],"mappings":";UAEiB;EACf,IAAI;EACJ,WAAW;EAEX;;cCFW;cAaA;KAOD,yBAAyB;KACzB,2BAA2B;KAC3B,YAAY,iBAAiB;UAIxB;EACf;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN;EACA;EACA;EACA;;iBAqBc,YAAY,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1B;KACA;UAEK;EACf;EACA;EACA;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAwBU,qBAAqB;UAEhB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf;EACA;;cA2QW;iBAEG,QAAQ;UCvVP;EACf,SAAS;EACT;EACA;EACA;EACA;;UCLe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;cCtBW;KACD,0BAA0B;cAEzB;KACD,0BAA0B;
|
|
1
|
+
{"version":3,"file":"carnet-BFA2yya4.d.mts","names":["_$__merge_ts0.MergeResult","_$__questions_ts0.Question","_$__findings_ts0.Finding","_$__table_ts0.TableItem","_$__events_ts0.CarnetEvent","_$__notes_ts0.AddNoteResult","_$__notes_ts0.Note","_$__notes_ts0.NoteDetail","_$__notes_ts0.WeightedNote","_$__notes_ts0.NoteCitation","_$__notes_ts0.NoteActivity","_$__status_view_ts0.StatusView"],"sources":["../src/context.ts","../src/events.ts","../src/status/model.ts","../src/agents.ts","../src/workspace/workspace.ts","../src/workspace/locate.ts","../src/workspace/undo.ts","../src/hosts/host.ts","../src/sessions.ts","../src/merge.ts","../src/questions.ts","../src/findings.ts","../src/table.ts","../src/notes.ts","../src/turn.ts","../src/status/view.ts","../src/memory.ts","../src/status/render.ts","../src/carnet.ts"],"mappings":";UAEiB;EACf,IAAI;EACJ,WAAW;EAEX;;cCFW;cAaA;KAOD,yBAAyB;KACzB,2BAA2B;KAC3B,YAAY,iBAAiB;UAIxB;EACf;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN;EACA;EACA;EACA;;iBAqBc,YAAY,iBAAiB,SAAS;cCnEzC;KAUD,sBAAsB;cAErB;KAED,2BAA2B;cAE1B,OA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EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAwBU,qBAAqB;UAEhB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf;EACA;;cA2QW;iBAEG,QAAQ;UCvVP;EACf,SAAS;EACT;EACA;EACA;EACA;;UCLe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;cCtBW;KACD,0BAA0B;cAEzB;KACD,0BAA0B;UAerB;EACf,UAAU;EACV;EACA;EACA;;UAGe;EACf;EACA;EACA,UAAU;EACV;EACA;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA,UAAU;EACV;;UCtCe;EACf;EACA;EACA,QAAQ;EACR;;UAGe;EACf;EACA,SAAS;;cCVE;KACD,mBAAmB;cAElB;cACA;cACA;cACA;iBAIG,WAAW,gBAAgB,SAAS;iBAIpC,eAAe;UAKd;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe,qBAAqB;EACpC;EACA;;UAGe,mBAAmB;EAClC,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf,MAAM;EACN,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;;iBA0Cc,mBAAmB,WAAW;iBAqB9B,WAAW,eAAe;iBAS1B,SAAS,MAAM;KAsQnB;UAEK;EACf,UAAU;EACV;EACA,MAAM;EACN;EACA;EACA;EACA;;iBAec,oBAAoB,KAAK,KAAK,kBAAkB;cC3bnD;KACD,eAAe;UAEV;EAEf;;UCGe;EACf;EACA,MAAM;EACN,QAAQ;EACR;EAEA;EACA;EACA;;UAGe;EACf;EACA;EACA,OAAO;EACP,MAAM;EACN,SAAS;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AAa,qBAAAC;IACjB,QAAK,0BAD4BA;IAEjC,OAAI,YAAa,OAAS,kBAAAF;IAC1B,OAAI,YAAa,OAAS,kBAAAG;IAC1B;IACA,WAAQ,oBAF+BC;;WAKhC;IACP,UAAO,SAAY,SAAO,UAAY;IAEtC,YAAS,SAAY,SAAO,UAAY;IAExC,UAAO,SAAY,SAAO,cAAc,UAAY;IAEpD,YAAS,cAAe;;WAGjB;IACP,OAAI,SAAY,SAAO,UAAY,sBAAAC;IAEnC,SAAM,SAAY,SAAO,UAAY,gBAAgB;IAErD,WAAQ,SAAY;;EAGtB;;UAKe,0BAA0B;EACzC;EACA;EACA;EACA,MAAM,OAAO;EACb;;iBASc,WAAW,UAAS,oBAAyB;UAI5C;EACf,QAAQ;EACR,YAAY;;iBAGE,mBAAmB,UAAS,oBAAyB;iBAWrD,oBACd,WAAW,kBACX,UAAS,oBACR"}
|
package/dist/index.d.mts
CHANGED
|
@@ -29,6 +29,21 @@ interface RunningSessionRow {
|
|
|
29
29
|
name: string | null;
|
|
30
30
|
hostPid: number;
|
|
31
31
|
}
|
|
32
|
+
type GitTreeKind = 'worktree' | 'orphan' | 'clone';
|
|
33
|
+
interface GitTree {
|
|
34
|
+
path: string;
|
|
35
|
+
kind: GitTreeKind;
|
|
36
|
+
repo?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
interface GitTreeHolder {
|
|
39
|
+
session: string;
|
|
40
|
+
name: string;
|
|
41
|
+
}
|
|
42
|
+
interface TreeMove extends GitTree {
|
|
43
|
+
to: string;
|
|
44
|
+
holders: GitTreeHolder[];
|
|
45
|
+
}
|
|
46
|
+
export declare function findGitTrees(root: string, skip?: readonly string[]): GitTree[];
|
|
32
47
|
interface RenameWorkspaceOptions {
|
|
33
48
|
env?: NodeJS.ProcessEnv | undefined;
|
|
34
49
|
dryRun?: boolean | undefined;
|
|
@@ -44,6 +59,7 @@ interface RenamePlan {
|
|
|
44
59
|
from: string;
|
|
45
60
|
to: string;
|
|
46
61
|
moves: FolderMove[];
|
|
62
|
+
trees: TreeMove[];
|
|
47
63
|
rows: WorkspaceRowCounts;
|
|
48
64
|
running: RunningSessionRow[];
|
|
49
65
|
}
|
|
@@ -76,6 +92,7 @@ interface MergePlan {
|
|
|
76
92
|
settingsConflicts: string[];
|
|
77
93
|
reports: FileMove[];
|
|
78
94
|
sandboxes: FileMove[];
|
|
95
|
+
trees: TreeMove[];
|
|
79
96
|
files: FileMove[];
|
|
80
97
|
instructions: string;
|
|
81
98
|
}
|
|
@@ -109,6 +126,7 @@ interface ReportDocument {
|
|
|
109
126
|
path: string;
|
|
110
127
|
}
|
|
111
128
|
export declare function reportDocument(carnet: Carnet, session: string, name: string): ReportDocument;
|
|
129
|
+
export declare function findingsBrief(carnet: Carnet, session: string, name: string, numbers: readonly number[], kind: string): string;
|
|
112
130
|
interface RucherPaths {
|
|
113
131
|
config: string;
|
|
114
132
|
data: string;
|
|
@@ -244,5 +262,5 @@ export declare function markdownCopy(content: string): string;
|
|
|
244
262
|
export declare function removeStaleCopies(directory: string, keep: ReadonlySet<string>): string[];
|
|
245
263
|
export declare function writeGenerated(path: string, content: string): boolean;
|
|
246
264
|
export declare function mergeSettings(base: Record<string, unknown>, extra: Record<string, unknown>): Record<string, unknown>;
|
|
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 };
|
|
265
|
+
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 GitTree, type GitTreeHolder, type GitTreeKind, 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 TreeMove, 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 };
|
|
248
266
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,IAAI,eAAe;wBAU1C,oBAAoB,IAAI,eAAe;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["MergeResult"],"sources":["../src/move.ts","../src/workspace-rows.ts","../src/workspace/git-trees.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;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5C,eAAa;UAGT;EACf,MAAM;EACN;EACA;EACA;EACA;EACA;EAEA;EAEA;;wBA0Dc,cAAc,OAAO;wBAkBrB,gBAAgB,gCAAgC;qBC7FnD,cAAc;qBAEd;UAiBI;EACf;EACA;EACA,QAAQ;EAER,cAAc;;wBAGA,YAAY,MAAM;wBCyGlB,gBAAgB;wBAsFhB,kBAAkB,WAAW,YAAY;wBA4DzC,oBAAoB,aAAa,MAAK,OAAO;wBAI7C,iBAAiB,MAAK,OAAO;qBA0HhC,YAAY;qBCpZZ;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;qBCJhB;wBAgBG,iBAAiB,MAAM,YAAY;wBAenC,gBAAgB;wBAIhB,eAAe,mBAAmB,MAAM,OAAO;UAI9C;EACf,MAAM,OAAO;EACb;;wBAKc,gBACd,QAAQ,QACR,mBACA,UAAS;KCjDN,0BAA0B;qBAElB;KAQD,oBAAoB;UAEf;EACf;EACA,MAAM;EACN;EACA;EACA,OAAO;;wBAYO,UAAU,QAAQ,QAAQ,iBAAiB,OAAO;UC/BjD;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"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as renderMemory, $n as LEGEND, $t as outsideRucherContext, A as TURNS, An as sandboxesDirectory, At as claudeCode, B as renderAgentLine, Bt as MARKDOWN_MARKER, C as openCarnet, Cn as corePromptPath, Ct as sessionWorkspaceName, D as STOPPED_NOTE, Dn as reportPath, Dt as DEFAULT_HOST, E as PAIRING_WINDOW_MILLISECONDS, En as promptsDirectory, Et as workspaceSessionCounts, F as MAIN_WAITING_SUFFIX, Fn as migrate, Ft as UndoList, G as renderSections, Gn as statusWhenDone, Gt as OUTSIDE_RUCHER_NOTICE, H as renderNoteLine, Hn as REPORTING_NOTE, Ht as mergeSettings, I as MAIN_WORKING_SUFFIX, In as migrations, It as moveTracked, J as DEFAULT_PURGE_DAYS, Jn as AGENT_STATUSES, Jt as SUBAGENT_RULES, K as renderStatus, Kn as NOTE_MAX, Kt as PROMPT_FILE, L as NOTES_FOLD_LINES, Ln as schemaVersion, Lt as relocateFailed, M as MAIN_FAILED_SUFFIX, Mn as workspacesDirectory, Mt as claudeProjectFolder, N as MAIN_HEADER, Nn as MEMORY_DB, Nt as transcriptTitle, O as buildStatusView, On as reportsDirectory, Ot as allHosts, P as MAIN_IDLE, Pn as openDatabase, Pt as workspaceSettings, Q as memoryMaxCharacters, Qn as KIND_TAG_PATTERN, Qt as compactReminder, R as NOTES_HEADER, Rn as AGENT_KINDS, Rt as shellQuote, S as Carnet, St as runningWorkspaceSessions, T as openWorkspaceCarnet, Tn as defaultRunDirectory, Tt as workspaceRowCounts, U as renderNotes, Un as SANDBOX_KINDS, Ut as removeStaleCopies, V as renderMainLine, Vn as PUBLISH_FALLBACK_MILLISECONDS, Vt as markdownCopy, W as renderNotesSummary, Wn as isAgentKind, Wt as writeGenerated, Xn as KIND_ABBREVIATIONS, Xt as assemblePrompt, Y as purgeDays, Yn as EMOJI, Yt as appendPromptFile, Z as MEMORY_MAX_CHARACTERS, Zn as KIND_LEGEND, Zt as baseRules, _n as removeWorkspaceRepo, _t as archiveWorkspaceSessions, a as formatEventLine, an as shortId, ar as isAgentStatus, at as isNoteKind, bt as nextNoteNumber, cn as WORKSPACE_FILE, cr as EVENT_TYPES, ct as sessionNoteActivity, dn as definitionInstructions, dr as CarnetError, dt as isInside, en as rulesText, er as MAIN_FAILED_EMOJI, et as DEFAULT_HALF_LIFE_DAYS, fn as dropWorkspace, ft as repoNameFor, g as nextAgent, gn as loadWorkspace, gt as workspaceLabel, h as locateAgent, hn as listWorkspaces, ht as resolveWorkspace, i as RESUME_MAX_CHARACTERS, in as MINIMUM_ID_PREFIX, ir as USER_ACTION_STATUSES, it as STALE_AFTER_ACTIVE_DAYS, j as BLOCKED_HEADER, jn as workspaceDefinition, jt as claudeConfigFile, k as formatClock, kn as rucherPaths, kt as hostById, ln as addWorkspaceRepo, lr as SESSION_EVENT_TYPES, lt as similarity, mn as isWorkspaceName, mt as requireWorkspace, n as stepAgent, nn as workspaceRules, nr as MAIN_WORKING_EMOJI, nt as NOTE_KINDS, o as resumeContext, on as AGENTS_FILE, or as isUserActionStatus, ot as localDay, pn as expandHome, pt as repoPathFor, q as renderTableLine, qn as sanitizeNote, qt as RULES_UPDATED_NOTICE, r as RESUME_EVENTS, rn as CORE_RULES, rt as NOTE_TEXT_LIMIT, s as sessionLabel, sn as INSTRUCTIONS_FILE, sr as kindTag, st as memoryHalfLife, t as AGENT_STEPS, tn as rulesVersion, tr as MAIN_WAITING_EMOJI, tt as DUPLICATE_SIMILARITY, u as findingsBrief, un as createWorkspace, ur as isEventType, ut as workspaceRepoNames, vn as workspaceExists, vt as deleteWorkspaceNotes, w as openResolvedCarnet, wn as databasePath, wt as workspaceLastActive, xt as renameWorkspaceRows, y as reportDocument, yn as workspaceHosts, yt as mergeWorkspaceRows, z as SIMILAR_PREFIX, zn as KIND_REQUIRED, zt as GENERATED_MARKER } from "./steps-Zp-DXCuQ.mjs";
|
|
2
2
|
import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
|
+
import { execFileSync } from "node:child_process";
|
|
5
6
|
// src/move.ts
|
|
6
7
|
function count(carnet, sql, ...parameters) {
|
|
7
8
|
return Number(carnet.db.prepare(sql).get(...parameters).total);
|
|
@@ -65,6 +66,82 @@ function writeBackup(db, folder, plan) {
|
|
|
65
66
|
db.prepare("VACUUM INTO ?").run(join(folder, "carnet.db"));
|
|
66
67
|
writeFileSync(join(folder, "plan.json"), `${JSON.stringify(plan, null, 2)}\n`);
|
|
67
68
|
}
|
|
69
|
+
// src/workspace/git-trees.ts
|
|
70
|
+
function adminFolder(tree) {
|
|
71
|
+
const match = /^gitdir:\s*(.+)$/m.exec(readFileSync(join(tree, ".git"), "utf8"));
|
|
72
|
+
if (!match?.[1]) return void 0;
|
|
73
|
+
const admin = match[1].trim();
|
|
74
|
+
return isAbsolute(admin) ? admin : resolve(tree, admin);
|
|
75
|
+
}
|
|
76
|
+
function classify(tree) {
|
|
77
|
+
if (lstatSync(join(tree, ".git")).isDirectory()) return {
|
|
78
|
+
path: tree,
|
|
79
|
+
kind: "clone"
|
|
80
|
+
};
|
|
81
|
+
const admin = adminFolder(tree);
|
|
82
|
+
if (!admin || !existsSync(admin)) return {
|
|
83
|
+
path: tree,
|
|
84
|
+
kind: "orphan"
|
|
85
|
+
};
|
|
86
|
+
const common = join(admin, "commondir");
|
|
87
|
+
const gitDirectory = existsSync(common) ? resolve(admin, readFileSync(common, "utf8").trim()) : dirname(dirname(admin));
|
|
88
|
+
return {
|
|
89
|
+
path: tree,
|
|
90
|
+
kind: "worktree",
|
|
91
|
+
repo: dirname(gitDirectory)
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function findGitTrees(root, skip = []) {
|
|
95
|
+
const trees = [];
|
|
96
|
+
const visit = (folder) => {
|
|
97
|
+
if (!existsSync(folder)) return;
|
|
98
|
+
for (const name of readdirSync(folder).sort()) {
|
|
99
|
+
const path = join(folder, name);
|
|
100
|
+
if (skip.includes(relative(root, path))) continue;
|
|
101
|
+
if (!lstatSync(path).isDirectory()) continue;
|
|
102
|
+
if (existsSync(join(path, ".git"))) trees.push(classify(path));
|
|
103
|
+
else visit(path);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
visit(root);
|
|
107
|
+
return trees;
|
|
108
|
+
}
|
|
109
|
+
function treeHolders(db, path) {
|
|
110
|
+
return db.prepare(`SELECT session, name FROM agents WHERE status != 'closed' AND worktree = ?
|
|
111
|
+
ORDER BY session, name`).all(path);
|
|
112
|
+
}
|
|
113
|
+
function repairWorktree(path) {
|
|
114
|
+
try {
|
|
115
|
+
execFileSync("git", [
|
|
116
|
+
"-C",
|
|
117
|
+
path,
|
|
118
|
+
"worktree",
|
|
119
|
+
"repair"
|
|
120
|
+
], {
|
|
121
|
+
stdio: "pipe",
|
|
122
|
+
timeout: 3e4
|
|
123
|
+
});
|
|
124
|
+
} catch (error) {
|
|
125
|
+
const stderr = error.stderr?.toString().trim();
|
|
126
|
+
throw new CarnetError("WORKSPACE_RELOCATE_FAILED", `git worktree repair failed in ${path}${stderr ? `: ${stderr}` : ""}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function repairCommand(path) {
|
|
130
|
+
return `git -C ${shellQuote(path)} worktree repair`;
|
|
131
|
+
}
|
|
132
|
+
function moveWithTrees(undo, move, trees) {
|
|
133
|
+
const linked = trees.filter((tree) => tree.kind === "worktree");
|
|
134
|
+
const at = (base, tree) => join(base, relative(move.from, tree.path));
|
|
135
|
+
renameSync(move.from, move.to);
|
|
136
|
+
undo.push({
|
|
137
|
+
command: [`mv ${shellQuote(move.to)} ${shellQuote(move.from)}`, ...linked.map((tree) => repairCommand(tree.path))].join(" && "),
|
|
138
|
+
run: () => {
|
|
139
|
+
renameSync(move.to, move.from);
|
|
140
|
+
for (const tree of linked) repairWorktree(tree.path);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
for (const tree of linked) repairWorktree(at(move.to, tree));
|
|
144
|
+
}
|
|
68
145
|
// src/workspace/rename.ts
|
|
69
146
|
function requireFree(db, name, env) {
|
|
70
147
|
const rows = workspaceRowCounts(db, name);
|
|
@@ -97,6 +174,11 @@ function planWorkspaceRename(db, from, to, options) {
|
|
|
97
174
|
from,
|
|
98
175
|
to,
|
|
99
176
|
moves,
|
|
177
|
+
trees: findGitTrees(workspace.runDirectory).map((tree) => ({
|
|
178
|
+
...tree,
|
|
179
|
+
to: join(runDirectory, relative(workspace.runDirectory, tree.path)),
|
|
180
|
+
holders: treeHolders(db, tree.path)
|
|
181
|
+
})),
|
|
100
182
|
rows: workspaceRowCounts(db, from),
|
|
101
183
|
running: runningWorkspaceSessions(db, from).filter((row) => options.isAlive(row.hostPid))
|
|
102
184
|
};
|
|
@@ -126,7 +208,8 @@ function renameWorkspace(db, from, to, options) {
|
|
|
126
208
|
const undo = new UndoList();
|
|
127
209
|
let paths = 0;
|
|
128
210
|
try {
|
|
129
|
-
for (const move of plan.moves)
|
|
211
|
+
for (const move of plan.moves) if (move.what === "run directory") moveWithTrees(undo, move, plan.trees);
|
|
212
|
+
else moveTracked(undo, move);
|
|
130
213
|
rewriteName(workspaceDefinition(to, env), to);
|
|
131
214
|
for (const host of hosts) {
|
|
132
215
|
const relocation = host.relocateProject?.(runDirectories.from, runDirectories.to, env);
|
|
@@ -236,13 +319,26 @@ function generated(path) {
|
|
|
236
319
|
if (!lstatSync(path).isFile()) return false;
|
|
237
320
|
return readFileSync(path, "utf8").includes(GENERATED_MARKER);
|
|
238
321
|
}
|
|
239
|
-
|
|
322
|
+
const OWN_FOLDERS = ["reports", "sandboxes"];
|
|
323
|
+
function treeMoves(db, from, into) {
|
|
324
|
+
return findGitTrees(from.runDirectory, OWN_FOLDERS).map((tree) => {
|
|
325
|
+
const rest = relative(from.runDirectory, tree.path);
|
|
326
|
+
const target = join(into.runDirectory, rest);
|
|
327
|
+
return {
|
|
328
|
+
...tree,
|
|
329
|
+
to: existsSync(target) ? join(dirname(target), `${from.name}-${basename(target)}`) : target,
|
|
330
|
+
holders: treeHolders(db, tree.path)
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function fileMoves(from, into, trees) {
|
|
240
335
|
const moves = [];
|
|
336
|
+
const treePaths = new Set(trees.map((tree) => tree.path));
|
|
241
337
|
const visit = (folder) => {
|
|
242
338
|
for (const name of entries(folder)) {
|
|
243
339
|
const path = join(folder, name);
|
|
244
340
|
const rest = relative(from.runDirectory, path);
|
|
245
|
-
if (rest
|
|
341
|
+
if (OWN_FOLDERS.includes(rest) || treePaths.has(path)) continue;
|
|
246
342
|
if (lstatSync(path).isDirectory()) {
|
|
247
343
|
visit(path);
|
|
248
344
|
continue;
|
|
@@ -270,6 +366,7 @@ function planWorkspaceMerge(db, fromName, intoName, options) {
|
|
|
270
366
|
if (instructions !== definitionInstructions(into)) throw new CarnetError("WORKSPACE_INSTRUCTIONS_CONFLICT", `${fromName} keeps its instructions in ${instructions} and ${intoName} in ${definitionInstructions(into)}: use the same file in both first`);
|
|
271
367
|
const rows = workspaceRowCounts(db, fromName);
|
|
272
368
|
const firstNumber = nextNoteNumber(db, intoName);
|
|
369
|
+
const trees = treeMoves(db, from, into);
|
|
273
370
|
const top = db.prepare("SELECT COALESCE(MAX(number), 0) AS top FROM notes WHERE workspace = ?").get(fromName);
|
|
274
371
|
return {
|
|
275
372
|
from: fromName,
|
|
@@ -283,7 +380,8 @@ function planWorkspaceMerge(db, fromName, intoName, options) {
|
|
|
283
380
|
settingsConflicts: conflicts(settingsOf(readFile(into)), settingsOf(readFile(from))),
|
|
284
381
|
reports: reportMoves(from, into),
|
|
285
382
|
sandboxes: sandboxMoves(from, into),
|
|
286
|
-
|
|
383
|
+
trees,
|
|
384
|
+
files: fileMoves(from, into, trees),
|
|
287
385
|
instructions
|
|
288
386
|
};
|
|
289
387
|
}
|
|
@@ -340,6 +438,13 @@ function mergeWorkspaces(db, fromName, intoName, options) {
|
|
|
340
438
|
projectMoves += relocation.moves.length;
|
|
341
439
|
for (const step of relocation.undo) undo.push(step);
|
|
342
440
|
}
|
|
441
|
+
for (const tree of plan.trees) {
|
|
442
|
+
mkdirSync(dirname(tree.to), { recursive: true });
|
|
443
|
+
moveWithTrees(undo, {
|
|
444
|
+
from: tree.path,
|
|
445
|
+
to: tree.to
|
|
446
|
+
}, [tree]);
|
|
447
|
+
}
|
|
343
448
|
for (const move of [
|
|
344
449
|
...plan.reports,
|
|
345
450
|
...plan.sandboxes,
|
|
@@ -348,7 +453,14 @@ function mergeWorkspaces(db, fromName, intoName, options) {
|
|
|
348
453
|
mkdirSync(dirname(move.to), { recursive: true });
|
|
349
454
|
moveTracked(undo, move);
|
|
350
455
|
}
|
|
351
|
-
const renamed = new Map([
|
|
456
|
+
const renamed = new Map([
|
|
457
|
+
...plan.reports,
|
|
458
|
+
...plan.sandboxes,
|
|
459
|
+
...plan.trees.map((tree) => ({
|
|
460
|
+
...tree,
|
|
461
|
+
from: tree.path
|
|
462
|
+
}))
|
|
463
|
+
].filter((move) => move.to !== join(into.runDirectory, relative(from.runDirectory, move.from))).map((move) => [move.from, move.to]));
|
|
352
464
|
mergeWorkspaceRows(db, {
|
|
353
465
|
names: {
|
|
354
466
|
from: fromName,
|
|
@@ -1090,6 +1202,6 @@ function writeStatusLine(carnet, sessionId, options = {}) {
|
|
|
1090
1202
|
writeFileSync(temporary, line ? `${line}\n` : "");
|
|
1091
1203
|
renameSync(temporary, path);
|
|
1092
1204
|
}
|
|
1093
|
-
export { AGENTS_FILE, AGENT_KINDS, AGENT_STATUSES, AGENT_STEPS, BLOCKED_HEADER, BUILT_IN_PLAN_DENIED, CORE_RULES, Carnet, CarnetError, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DEFAULT_PURGE_DAYS, DUPLICATE_SIMILARITY, EMOJI, EVENT_TYPES, GENERATED_MARKER, GUARDED_TOOLS, INSTRUCTIONS_FILE, KIND_ABBREVIATIONS, KIND_LEGEND, KIND_REQUIRED, KIND_TAG_PATTERN, LAUNCH_TOOLS, LEGEND, MAIN_FAILED_EMOJI, MAIN_FAILED_SUFFIX, MAIN_HEADER, MAIN_IDLE, MAIN_WAITING_EMOJI, MAIN_WAITING_SUFFIX, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MARKDOWN_MARKER, MEMORY_DB, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, NOTES_FOLD_LINES, NOTES_HEADER, NOTE_KINDS, NOTE_MAX, NOTE_TEXT_LIMIT, OUTSIDE_RUCHER_NOTICE, PAIRING_WINDOW_MILLISECONDS, PROMPT_FILE, PUBLISH_FALLBACK_MILLISECONDS, REPORTING_NOTE, RESUME_EVENTS, RESUME_MAX_CHARACTERS, RULES_UPDATED_NOTICE, SANDBOX_KINDS, SESSION_EVENT_TYPES, SIMILAR_PREFIX, STALE_AFTER_ACTIVE_DAYS, STATUS_LINE_LABEL, STOPPED_NOTE, SUBAGENT_RULES, TURNS, USER_ACTION_STATUSES, WAITING_TOOL, WORKSPACE_FILE, addWorkspaceRepo, allHosts, appendPromptFile, archiveWorkspaceSessions, assemblePrompt, backupsDirectory, baseRules, buildStatusView, claudeCode, claudeConfigFile, claudeProjectFolder, compactReminder, corePromptPath, createWorkspace, databasePath, defaultRunDirectory, definitionInstructions, deleteWorkspaceNotes, dropWorkspace, expandHome, formatClock, formatEventLine, guardLaunch, guardMainLaunch, guardSubagentCall, guardToolCall, handleSessionEnd, handleSessionStart, handleStop, handleToolStart, handleToolUse, handleUserPromptSubmit, hostById, isAgentKind, isAgentStatus, isEventType, isInside, isNoteKind, isUserActionStatus, isWorkspaceName, kindOfAgentType, kindTag, labelStatusLine, listWorkspaces, loadWorkspace, localDay, locateAgent, markdownCopy, memoryHalfLife, memoryMaxCharacters, mergeSettings, mergeWorkspaces, migrate, migrations, moveSession, nextAgent, openCarnet, openDatabase, openResolvedCarnet, openWorkspaceCarnet, outsideRucherContext, planWorkspaceMerge, planWorkspaceRename, promptsDirectory, purgeDays, removeStaleCopies, removeWorkspaceRepo, renameWorkspace, renderAgentLine, renderMainLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderRunDirectory, renderSections, renderStatus, renderStatusLine, renderTableLine, repoNameFor, repoPathFor, reportDocument, reportPath, reportsDirectory, requireWorkspace, resolveWorkspace, resumeContext, rucherPaths, rulesText, rulesVersion, sandboxesDirectory, sanitizeNote, schemaVersion, sessionLabel, sessionNoteActivity, sessionWorkspaceName, shortId, similarity, statusLinePath, statusWhenDone, stepAgent, transcriptTitle, workspaceDefinition, workspaceExists, workspaceHosts, workspaceLabel, workspaceLastActive, workspaceRepoNames, workspaceRules, workspaceSessionCounts, workspaceSettings, workspacesDirectory, writeGenerated, writeStatusLine };
|
|
1205
|
+
export { AGENTS_FILE, AGENT_KINDS, AGENT_STATUSES, AGENT_STEPS, BLOCKED_HEADER, BUILT_IN_PLAN_DENIED, CORE_RULES, Carnet, CarnetError, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HOST, DEFAULT_PURGE_DAYS, DUPLICATE_SIMILARITY, EMOJI, EVENT_TYPES, GENERATED_MARKER, GUARDED_TOOLS, INSTRUCTIONS_FILE, KIND_ABBREVIATIONS, KIND_LEGEND, KIND_REQUIRED, KIND_TAG_PATTERN, LAUNCH_TOOLS, LEGEND, MAIN_FAILED_EMOJI, MAIN_FAILED_SUFFIX, MAIN_HEADER, MAIN_IDLE, MAIN_WAITING_EMOJI, MAIN_WAITING_SUFFIX, MAIN_WORKING_EMOJI, MAIN_WORKING_SUFFIX, MARKDOWN_MARKER, MEMORY_DB, MEMORY_MAX_CHARACTERS, MINIMUM_ID_PREFIX, NOTES_FOLD_LINES, NOTES_HEADER, NOTE_KINDS, NOTE_MAX, NOTE_TEXT_LIMIT, OUTSIDE_RUCHER_NOTICE, PAIRING_WINDOW_MILLISECONDS, PROMPT_FILE, PUBLISH_FALLBACK_MILLISECONDS, REPORTING_NOTE, RESUME_EVENTS, RESUME_MAX_CHARACTERS, RULES_UPDATED_NOTICE, SANDBOX_KINDS, SESSION_EVENT_TYPES, SIMILAR_PREFIX, STALE_AFTER_ACTIVE_DAYS, STATUS_LINE_LABEL, STOPPED_NOTE, SUBAGENT_RULES, TURNS, USER_ACTION_STATUSES, WAITING_TOOL, WORKSPACE_FILE, addWorkspaceRepo, allHosts, appendPromptFile, archiveWorkspaceSessions, assemblePrompt, backupsDirectory, baseRules, buildStatusView, claudeCode, claudeConfigFile, claudeProjectFolder, compactReminder, corePromptPath, createWorkspace, databasePath, defaultRunDirectory, definitionInstructions, deleteWorkspaceNotes, dropWorkspace, expandHome, findGitTrees, findingsBrief, formatClock, formatEventLine, guardLaunch, guardMainLaunch, guardSubagentCall, guardToolCall, handleSessionEnd, handleSessionStart, handleStop, handleToolStart, handleToolUse, handleUserPromptSubmit, hostById, isAgentKind, isAgentStatus, isEventType, isInside, isNoteKind, isUserActionStatus, isWorkspaceName, kindOfAgentType, kindTag, labelStatusLine, listWorkspaces, loadWorkspace, localDay, locateAgent, markdownCopy, memoryHalfLife, memoryMaxCharacters, mergeSettings, mergeWorkspaces, migrate, migrations, moveSession, nextAgent, openCarnet, openDatabase, openResolvedCarnet, openWorkspaceCarnet, outsideRucherContext, planWorkspaceMerge, planWorkspaceRename, promptsDirectory, purgeDays, removeStaleCopies, removeWorkspaceRepo, renameWorkspace, renderAgentLine, renderMainLine, renderMemory, renderNoteLine, renderNotes, renderNotesSummary, renderRunDirectory, renderSections, renderStatus, renderStatusLine, renderTableLine, repoNameFor, repoPathFor, reportDocument, reportPath, reportsDirectory, requireWorkspace, resolveWorkspace, resumeContext, rucherPaths, rulesText, rulesVersion, sandboxesDirectory, sanitizeNote, schemaVersion, sessionLabel, sessionNoteActivity, sessionWorkspaceName, shortId, similarity, statusLinePath, statusWhenDone, stepAgent, transcriptTitle, workspaceDefinition, workspaceExists, workspaceHosts, workspaceLabel, workspaceLastActive, workspaceRepoNames, workspaceRules, workspaceSessionCounts, workspaceSettings, workspacesDirectory, writeGenerated, writeStatusLine };
|
|
1094
1206
|
|
|
1095
1207
|
//# sourceMappingURL=index.mjs.map
|