@granular-software/fractory 0.0.0-stage → 0.1.25
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/LICENSE +4 -0
- package/README.md +28 -2
- package/dist/activity-volume.d.ts +18 -0
- package/dist/activity-volume.js +94 -0
- package/dist/annotations.d.ts +122 -0
- package/dist/annotations.js +304 -0
- package/dist/benchmark-cli.d.ts +1 -0
- package/dist/benchmark-cli.js +95 -0
- package/dist/benchmark-worker.d.ts +2 -0
- package/dist/benchmark-worker.js +22 -0
- package/dist/benchmarks.d.ts +19 -0
- package/dist/benchmarks.js +414 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +63 -0
- package/dist/block-cli.d.ts +1 -0
- package/dist/block-cli.js +88 -0
- package/dist/block-documents.d.ts +35 -0
- package/dist/block-documents.js +84 -0
- package/dist/change-impact.d.ts +55 -0
- package/dist/change-impact.js +223 -0
- package/dist/check-source.d.ts +2 -0
- package/dist/check-source.js +66 -0
- package/dist/checks-model.d.ts +64 -0
- package/dist/checks-model.js +36 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +359 -0
- package/dist/code-model.d.ts +38 -0
- package/dist/code-model.js +94 -0
- package/dist/code-store.d.ts +9 -0
- package/dist/code-store.js +79 -0
- package/dist/compare-artifact.d.ts +6 -0
- package/dist/compare-artifact.js +277 -0
- package/dist/compare.d.ts +81 -0
- package/dist/compare.js +291 -0
- package/dist/compiler.d.ts +10 -0
- package/dist/compiler.js +1240 -0
- package/dist/compose.d.ts +9 -0
- package/dist/compose.js +72 -0
- package/dist/core.d.ts +87 -0
- package/dist/core.js +207 -0
- package/dist/coverage-cli.d.ts +1 -0
- package/dist/coverage-cli.js +42 -0
- package/dist/declaration-sources.d.ts +3 -0
- package/dist/declaration-sources.js +51 -0
- package/dist/declared-graph.d.ts +3 -0
- package/dist/declared-graph.js +67 -0
- package/dist/display-name.d.ts +2 -0
- package/dist/display-name.js +8 -0
- package/dist/error-heat.d.ts +58 -0
- package/dist/error-heat.js +96 -0
- package/dist/evidence.d.ts +3 -0
- package/dist/evidence.js +68 -0
- package/dist/factory-graph.d.ts +7 -0
- package/dist/factory-graph.js +389 -0
- package/dist/factory-model.d.ts +111 -0
- package/dist/factory-model.js +1 -0
- package/dist/git-code.d.ts +47 -0
- package/dist/git-code.js +352 -0
- package/dist/git-refs.d.ts +4 -0
- package/dist/git-refs.js +37 -0
- package/dist/history-activity.d.ts +4 -0
- package/dist/history-activity.js +129 -0
- package/dist/history-churn.d.ts +36 -0
- package/dist/history-churn.js +302 -0
- package/dist/history-git.d.ts +21 -0
- package/dist/history-git.js +125 -0
- package/dist/history-ledger.d.ts +43 -0
- package/dist/history-ledger.js +450 -0
- package/dist/history-ownership.d.ts +10 -0
- package/dist/history-ownership.js +75 -0
- package/dist/history-source.d.ts +13 -0
- package/dist/history-source.js +100 -0
- package/dist/integrations-cli.d.ts +2 -0
- package/dist/integrations-cli.js +159 -0
- package/dist/interface-map.d.ts +15 -0
- package/dist/interface-map.js +125 -0
- package/dist/issue-cache.d.ts +9 -0
- package/dist/issue-cache.js +68 -0
- package/dist/issue-cli.d.ts +1 -0
- package/dist/issue-cli.js +89 -0
- package/dist/issue-links.d.ts +15 -0
- package/dist/issue-links.js +125 -0
- package/dist/linear-issues.d.ts +19 -0
- package/dist/linear-issues.js +124 -0
- package/dist/local-runtime.d.ts +8 -0
- package/dist/local-runtime.js +59 -0
- package/dist/map-activity.d.ts +73 -0
- package/dist/map-activity.js +234 -0
- package/dist/map-model.d.ts +5 -0
- package/dist/map-model.js +166 -0
- package/dist/map-quality.d.ts +20 -0
- package/dist/map-quality.js +61 -0
- package/dist/mapping-coverage.d.ts +87 -0
- package/dist/mapping-coverage.js +404 -0
- package/dist/model.d.ts +186 -0
- package/dist/model.js +66 -0
- package/dist/operation-benchmark-worker.d.ts +2 -0
- package/dist/operation-benchmark-worker.js +60 -0
- package/dist/operation-benchmark.d.ts +29 -0
- package/dist/operation-benchmark.js +1 -0
- package/dist/otel-metrics.d.ts +21 -0
- package/dist/otel-metrics.js +146 -0
- package/dist/performance-model.d.ts +185 -0
- package/dist/performance-model.js +396 -0
- package/dist/product-map.d.ts +71 -0
- package/dist/product-map.js +197 -0
- package/dist/provider-access.cjs +207 -0
- package/dist/provider-access.d.cts +14 -0
- package/dist/public-boundaries.d.ts +13 -0
- package/dist/public-boundaries.js +115 -0
- package/dist/reports-cli.d.ts +1 -0
- package/dist/reports-cli.js +111 -0
- package/dist/reports-model.d.ts +27 -0
- package/dist/reports-model.js +39 -0
- package/dist/reports.d.ts +23 -0
- package/dist/reports.js +223 -0
- package/dist/repository-map.d.ts +22 -0
- package/dist/repository-map.js +153 -0
- package/dist/resource-cache.d.ts +17 -0
- package/dist/resource-cache.js +65 -0
- package/dist/review-cli.d.ts +19 -0
- package/dist/review-cli.js +224 -0
- package/dist/review.d.ts +48 -0
- package/dist/review.js +289 -0
- package/dist/runtime-metrics.d.ts +26 -0
- package/dist/runtime-metrics.js +290 -0
- package/dist/scope.d.ts +14 -0
- package/dist/scope.js +168 -0
- package/dist/sentry-activity.d.ts +39 -0
- package/dist/sentry-activity.js +174 -0
- package/dist/sentry.d.ts +130 -0
- package/dist/sentry.js +369 -0
- package/dist/service-release.d.ts +16 -0
- package/dist/service-release.js +14 -0
- package/dist/setup-cli.d.ts +2 -0
- package/dist/setup-cli.js +52 -0
- package/dist/setup-kit.cjs +163 -0
- package/dist/setup-kit.d.cts +32 -0
- package/dist/source-index.d.ts +37 -0
- package/dist/source-index.js +170 -0
- package/dist/source-review-git.d.ts +7 -0
- package/dist/source-review-git.js +105 -0
- package/dist/source-review.d.ts +18 -0
- package/dist/source-review.js +573 -0
- package/dist/telemetry.d.ts +17 -0
- package/dist/telemetry.js +51 -0
- package/dist/time-window.d.ts +9 -0
- package/dist/time-window.js +35 -0
- package/dist/trace-evidence.d.ts +23 -0
- package/dist/trace-evidence.js +55 -0
- package/dist/trace-model.d.ts +26 -0
- package/dist/trace-model.js +1 -0
- package/dist/tracing.d.ts +44 -0
- package/dist/tracing.js +123 -0
- package/dist/work-check.d.ts +18 -0
- package/dist/work-check.js +115 -0
- package/dist/work-cli.d.ts +1 -0
- package/dist/work-cli.js +176 -0
- package/dist/work-context.d.ts +59 -0
- package/dist/work-context.js +594 -0
- package/dist/work-intents.d.ts +6 -0
- package/dist/work-intents.js +140 -0
- package/dist/work-items.d.ts +58 -0
- package/dist/work-items.js +86 -0
- package/dist/work-lock-check.d.ts +12 -0
- package/dist/work-lock-check.js +339 -0
- package/dist/work-locks.d.ts +10 -0
- package/dist/work-locks.js +98 -0
- package/dist/work-model.d.ts +119 -0
- package/dist/work-model.js +310 -0
- package/dist/work-review-git.d.ts +8 -0
- package/dist/work-review-git.js +111 -0
- package/dist/work-review.d.ts +26 -0
- package/dist/work-review.js +426 -0
- package/dist/work-switcher-model.d.ts +43 -0
- package/dist/work-switcher-model.js +79 -0
- package/dist/work-switcher.d.ts +6 -0
- package/dist/work-switcher.js +171 -0
- package/dist/working-cli.d.ts +1 -0
- package/dist/working-cli.js +33 -0
- package/dist/working-code.d.ts +74 -0
- package/dist/working-code.js +421 -0
- package/dist/workspace-notes.d.ts +71 -0
- package/dist/workspace-notes.js +177 -0
- package/dist/workspace-tests.d.ts +21 -0
- package/dist/workspace-tests.js +573 -0
- package/package.json +547 -4
- package/src/activity-volume.ts +149 -0
- package/src/annotations.ts +485 -0
- package/src/benchmark-cli.ts +118 -0
- package/src/benchmark-worker.ts +22 -0
- package/src/benchmarks.ts +493 -0
- package/src/bin.ts +54 -0
- package/src/block-cli.ts +106 -0
- package/src/block-documents.ts +117 -0
- package/src/change-impact.ts +280 -0
- package/src/check-source.ts +82 -0
- package/src/checks-model.ts +108 -0
- package/src/cli.ts +440 -0
- package/src/code-model.ts +159 -0
- package/src/code-store.ts +98 -0
- package/src/compare-artifact.ts +314 -0
- package/src/compare.ts +440 -0
- package/src/compiler.ts +1512 -0
- package/src/compose.ts +94 -0
- package/src/core.ts +361 -0
- package/src/coverage-cli.ts +52 -0
- package/src/declaration-sources.ts +69 -0
- package/src/declared-graph.ts +75 -0
- package/src/display-name.ts +8 -0
- package/src/error-heat.ts +161 -0
- package/src/evidence.ts +94 -0
- package/src/factory-graph.ts +462 -0
- package/src/factory-model.ts +82 -0
- package/src/git-code.ts +461 -0
- package/src/git-refs.ts +43 -0
- package/src/history-activity.ts +146 -0
- package/src/history-churn.ts +416 -0
- package/src/history-git.ts +163 -0
- package/src/history-ledger.ts +636 -0
- package/src/history-ownership.ts +116 -0
- package/src/history-source.ts +117 -0
- package/src/integrations-cli.ts +187 -0
- package/src/interface-map.ts +166 -0
- package/src/issue-cache.ts +96 -0
- package/src/issue-cli.ts +137 -0
- package/src/issue-links.ts +153 -0
- package/src/linear-issues.ts +154 -0
- package/src/local-runtime.ts +70 -0
- package/src/map-activity.ts +309 -0
- package/src/map-model.ts +213 -0
- package/src/map-quality.ts +66 -0
- package/src/mapping-coverage.ts +570 -0
- package/src/model.ts +228 -0
- package/src/operation-benchmark-worker.ts +60 -0
- package/src/operation-benchmark.ts +28 -0
- package/src/otel-metrics.ts +176 -0
- package/src/performance-model.ts +575 -0
- package/src/product-map.ts +271 -0
- package/src/provider-access.cjs +207 -0
- package/src/provider-access.d.cts +14 -0
- package/src/public-boundaries.ts +143 -0
- package/src/reports-cli.ts +125 -0
- package/src/reports-model.ts +73 -0
- package/src/reports.ts +276 -0
- package/src/repository-map.ts +191 -0
- package/src/resource-cache.ts +76 -0
- package/src/review-cli.ts +256 -0
- package/src/review.ts +376 -0
- package/src/runtime-metrics.ts +386 -0
- package/src/scope.ts +192 -0
- package/src/sentry-activity.ts +234 -0
- package/src/sentry.ts +545 -0
- package/src/service-release.ts +18 -0
- package/src/setup-cli.ts +58 -0
- package/src/setup-kit.cjs +163 -0
- package/src/setup-kit.d.cts +32 -0
- package/src/source-index.ts +208 -0
- package/src/source-review-git.ts +131 -0
- package/src/source-review.ts +736 -0
- package/src/telemetry.ts +68 -0
- package/src/time-window.ts +51 -0
- package/src/trace-evidence.ts +80 -0
- package/src/trace-model.ts +26 -0
- package/src/tracing.ts +165 -0
- package/src/work-check.ts +149 -0
- package/src/work-cli.ts +229 -0
- package/src/work-context.ts +753 -0
- package/src/work-intents.ts +196 -0
- package/src/work-items.ts +151 -0
- package/src/work-lock-check.ts +549 -0
- package/src/work-locks.ts +108 -0
- package/src/work-model.ts +466 -0
- package/src/work-review-git.ts +130 -0
- package/src/work-review.ts +573 -0
- package/src/work-switcher-model.ts +121 -0
- package/src/work-switcher.ts +191 -0
- package/src/working-cli.ts +38 -0
- package/src/working-code.ts +582 -0
- package/src/workspace-notes.ts +203 -0
- package/src/workspace-tests.ts +654 -0
- package/toolkit/GUIDE.md +354 -0
- package/toolkit/SKILL.md +142 -0
- package/toolkit/bin/fractory +2 -0
- package/toolkit/build.json +1 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/** Work-switcher metadata. No checkout, compiler, diff or network calls. */
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { basename, dirname, join } from "node:path";
|
|
4
|
+
import { statSync } from "node:fs";
|
|
5
|
+
import { readGit } from "./git-refs.js";
|
|
6
|
+
import { fileBlocks } from "./map-activity.js";
|
|
7
|
+
import { listWorkContexts, workDirectory } from "./work-context.js";
|
|
8
|
+
import { workingOverview } from "./working-code.js";
|
|
9
|
+
const catalogs = new Map();
|
|
10
|
+
const details = new Map();
|
|
11
|
+
function topBlocks(graph, ids) {
|
|
12
|
+
const scope = [...ids];
|
|
13
|
+
if (!scope.length)
|
|
14
|
+
return [];
|
|
15
|
+
const nodes = new Map(graph.elements.map((n) => [n.id, n])), result = new Map();
|
|
16
|
+
for (const id of scope) {
|
|
17
|
+
let node = nodes.get(id), seen = new Set();
|
|
18
|
+
while (node?.parent && node.parent !== graph.id && !seen.has(node.id)) {
|
|
19
|
+
seen.add(node.id);
|
|
20
|
+
node = nodes.get(node.parent);
|
|
21
|
+
}
|
|
22
|
+
if (node && node.id !== graph.id)
|
|
23
|
+
result.set(node.id, { id: node.id, label: node.label });
|
|
24
|
+
}
|
|
25
|
+
return [...result.values()];
|
|
26
|
+
}
|
|
27
|
+
export function workChoiceCatalog(root, graph, fresh = false) {
|
|
28
|
+
const common = workDirectory(root);
|
|
29
|
+
const stamp = (path) => {
|
|
30
|
+
try {
|
|
31
|
+
return statSync(path).mtimeMs;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const key = `${common}:${graph.revision}:${stamp(common)}:${stamp(join(dirname(dirname(common)), "worktrees"))}`, cached = catalogs.get(key);
|
|
38
|
+
if (!fresh && cached && Date.now() - cached.at < 30000)
|
|
39
|
+
return cached.value;
|
|
40
|
+
const targets = listWorkContexts(root);
|
|
41
|
+
const heads = [
|
|
42
|
+
...new Set(targets
|
|
43
|
+
.map((t) => t.head)
|
|
44
|
+
.filter((h) => /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(h))),
|
|
45
|
+
];
|
|
46
|
+
const commits = new Map();
|
|
47
|
+
if (heads.length) {
|
|
48
|
+
// One bounded metadata read for all heads, including branches without a checkout.
|
|
49
|
+
for (let at = 0; at < heads.length; at += 500) {
|
|
50
|
+
const rows = readGit(root, [
|
|
51
|
+
"show",
|
|
52
|
+
"--no-patch",
|
|
53
|
+
"--no-walk",
|
|
54
|
+
"--format=%H%x00%s%x00%cI%x00%an",
|
|
55
|
+
...heads.slice(at, at + 500),
|
|
56
|
+
"--",
|
|
57
|
+
])
|
|
58
|
+
.trim()
|
|
59
|
+
.split("\n");
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
const [head, subject, date, author] = row.split("\0");
|
|
62
|
+
if (head && subject && Number.isFinite(Date.parse(date)))
|
|
63
|
+
commits.set(head, {
|
|
64
|
+
subject: subject.slice(0, 300),
|
|
65
|
+
at: date,
|
|
66
|
+
author: author?.slice(0, 120) || "",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const value = {
|
|
72
|
+
repository: createHash("sha256").update(common).digest("hex").slice(0, 20),
|
|
73
|
+
checkedAt: new Date().toISOString(),
|
|
74
|
+
detailed: false,
|
|
75
|
+
targets: targets.map((t) => ({
|
|
76
|
+
...t,
|
|
77
|
+
detached: t.branch === "Detached checkout",
|
|
78
|
+
checkout: t.path
|
|
79
|
+
? `${basename(dirname(t.path))}/${basename(t.path)}`
|
|
80
|
+
: undefined,
|
|
81
|
+
commit: commits.get(t.head),
|
|
82
|
+
blocks: topBlocks(graph, t.scope || []),
|
|
83
|
+
blockBasis: "plan",
|
|
84
|
+
})),
|
|
85
|
+
};
|
|
86
|
+
catalogs.set(key, { at: Date.now(), value });
|
|
87
|
+
while (catalogs.size > 12)
|
|
88
|
+
catalogs.delete(catalogs.keys().next().value);
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
/** Reuse the live-work adapter and its read budgets. Each checkout is independent; unknown is never clean. */
|
|
92
|
+
export async function workChoiceDetails(root, graph, fresh = false) {
|
|
93
|
+
const catalog = workChoiceCatalog(root, graph, fresh), key = JSON.stringify([
|
|
94
|
+
catalog.repository,
|
|
95
|
+
graph.revision,
|
|
96
|
+
catalog.targets.map((t) => [t.id, t.head, t.scope, t.title]),
|
|
97
|
+
]);
|
|
98
|
+
const saved = details.get(key);
|
|
99
|
+
if (!fresh && saved && Date.now() - saved.at < 30000)
|
|
100
|
+
return saved.value;
|
|
101
|
+
const value = (async () => {
|
|
102
|
+
const targets = catalog.targets.map((t) => ({ ...t })), local = targets.filter((t) => t.path);
|
|
103
|
+
const initial = await workingOverview(root, { fresh });
|
|
104
|
+
const byPath = new Map(initial.worktrees.map((t) => [t.path, t.id]));
|
|
105
|
+
let next = 0;
|
|
106
|
+
await Promise.all(Array.from({ length: Math.min(4, local.length) }, async () => {
|
|
107
|
+
while (next < local.length) {
|
|
108
|
+
const target = local[next++];
|
|
109
|
+
try {
|
|
110
|
+
const id = byPath.get(target.path);
|
|
111
|
+
if (!id)
|
|
112
|
+
throw Error("Checkout is outside the status read budget");
|
|
113
|
+
const overview = id === initial.selected
|
|
114
|
+
? initial
|
|
115
|
+
: await workingOverview(root, {
|
|
116
|
+
worktree: id,
|
|
117
|
+
refreshSelected: fresh,
|
|
118
|
+
});
|
|
119
|
+
const tree = overview.worktrees.find((t) => t.id === overview.selected);
|
|
120
|
+
const edited = overview.paths
|
|
121
|
+
.filter((p) => p.kind === "file")
|
|
122
|
+
.map((p) => p.modifiedAt)
|
|
123
|
+
.filter((at) => !!at)
|
|
124
|
+
.sort()
|
|
125
|
+
.at(-1);
|
|
126
|
+
target.status = {
|
|
127
|
+
changed: tree.changed,
|
|
128
|
+
conflicts: tree.conflicts,
|
|
129
|
+
checkedAt: tree.checkedAt,
|
|
130
|
+
editedAt: edited,
|
|
131
|
+
unavailable: tree.unavailable,
|
|
132
|
+
partial: overview.truncated,
|
|
133
|
+
};
|
|
134
|
+
if (!target.managed) {
|
|
135
|
+
target.blocks = topBlocks(graph, new Set(overview.paths.flatMap((p) => [...fileBlocks(graph, p.path)])));
|
|
136
|
+
target.blockBasis = "files";
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
target.status = {
|
|
141
|
+
changed: null,
|
|
142
|
+
conflicts: null,
|
|
143
|
+
checkedAt: null,
|
|
144
|
+
unavailable: error instanceof Error ? error.message : "Status unavailable",
|
|
145
|
+
partial: false,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
return {
|
|
151
|
+
...catalog,
|
|
152
|
+
targets,
|
|
153
|
+
detailed: true,
|
|
154
|
+
checkedAt: new Date().toISOString(),
|
|
155
|
+
};
|
|
156
|
+
})();
|
|
157
|
+
details.set(key, { at: Date.now(), value });
|
|
158
|
+
while (details.size > 12)
|
|
159
|
+
details.delete(details.keys().next().value);
|
|
160
|
+
void value.catch(() => details.delete(key));
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
export function invalidateWorkChoices(root) {
|
|
164
|
+
const common = workDirectory(root), repository = createHash("sha256").update(common).digest("hex").slice(0, 20);
|
|
165
|
+
for (const key of catalogs.keys())
|
|
166
|
+
if (key.startsWith(common + ":"))
|
|
167
|
+
catalogs.delete(key);
|
|
168
|
+
for (const key of details.keys())
|
|
169
|
+
if (JSON.parse(key)[0] === repository)
|
|
170
|
+
details.delete(key);
|
|
171
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runWorking(args: string[]): Promise<string>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
export async function runWorking(args) {
|
|
3
|
+
const option = (name) => {
|
|
4
|
+
const i = args.indexOf(name);
|
|
5
|
+
if (i < 0)
|
|
6
|
+
return undefined;
|
|
7
|
+
const value = args[i + 1];
|
|
8
|
+
if (!value || value.startsWith("--"))
|
|
9
|
+
throw Error(name + " needs a value");
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
const { workingOverview, workingDetail } = await import("./working-code.js");
|
|
13
|
+
const root = resolve(option("--root") || process.cwd()), worktree = option("--worktree"), file = option("--file");
|
|
14
|
+
if (file && !worktree)
|
|
15
|
+
throw Error("--file requires a worktree ID from fractal working --json");
|
|
16
|
+
if (file)
|
|
17
|
+
return JSON.stringify(await workingDetail(root, worktree, file), null, 2);
|
|
18
|
+
const value = await workingOverview(root, { worktree, fresh: true });
|
|
19
|
+
if (args.includes("--json"))
|
|
20
|
+
return JSON.stringify(value, null, 2);
|
|
21
|
+
const selected = value.worktrees.find((t) => t.id === value.selected);
|
|
22
|
+
return [
|
|
23
|
+
"Uncommitted work · " + value.checkedAt,
|
|
24
|
+
"Worktree attribution only; Git does not identify the editing agent.",
|
|
25
|
+
...value.worktrees.map((t) => `${t.current ? "*" : " "} ${t.id} ${t.branch || "detached"} · ${t.unavailable ? "unavailable" : t.changed === null ? "status not loaded" : `${t.changed} changed paths`}`),
|
|
26
|
+
"",
|
|
27
|
+
selected.path,
|
|
28
|
+
...value.paths.map((p) => `${p.conflict ? "UU" : p.untracked ? "??" : p.index + p.working} ${p.path}`),
|
|
29
|
+
...(value.truncated
|
|
30
|
+
? ["Showing first 500 paths; untracked folders are collapsed."]
|
|
31
|
+
: []),
|
|
32
|
+
].join("\n");
|
|
33
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface WorkingPath {
|
|
2
|
+
modifiedAt?: string;
|
|
3
|
+
/** Fingerprint of Git index metadata, not a source-content read. */
|
|
4
|
+
indexRevision?: string;
|
|
5
|
+
path: string;
|
|
6
|
+
index: string;
|
|
7
|
+
working: string;
|
|
8
|
+
kind: "file" | "directory" | "submodule";
|
|
9
|
+
untracked: boolean;
|
|
10
|
+
conflict: boolean;
|
|
11
|
+
originalPath?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Exact saved files for a worktree review. No scan of sibling checkouts and no directory placeholders. */
|
|
14
|
+
export declare function currentWorkingPaths(root: string): Promise<WorkingPath[]>;
|
|
15
|
+
export interface WorkingTree {
|
|
16
|
+
id: string;
|
|
17
|
+
path: string;
|
|
18
|
+
branch: string | null;
|
|
19
|
+
head: string | null;
|
|
20
|
+
current: boolean;
|
|
21
|
+
checkedAt: string | null;
|
|
22
|
+
locked: boolean;
|
|
23
|
+
unavailable?: string;
|
|
24
|
+
stale?: boolean;
|
|
25
|
+
changed: number | null;
|
|
26
|
+
staged: number | null;
|
|
27
|
+
unstaged: number | null;
|
|
28
|
+
conflicts: number | null;
|
|
29
|
+
untracked: number | null;
|
|
30
|
+
}
|
|
31
|
+
export interface WorkingOverview {
|
|
32
|
+
/** Complete attribution; the inspectable path list can remain bounded. */
|
|
33
|
+
mapping?: {
|
|
34
|
+
revision: string;
|
|
35
|
+
cells: Record<string, import("./map-activity.js").ActivityCell>;
|
|
36
|
+
unmapped: number;
|
|
37
|
+
};
|
|
38
|
+
checkedAt: string;
|
|
39
|
+
worktreesCheckedAt: string;
|
|
40
|
+
revision: string;
|
|
41
|
+
attribution: "worktree";
|
|
42
|
+
worktrees: WorkingTree[];
|
|
43
|
+
selected: string;
|
|
44
|
+
paths: WorkingPath[];
|
|
45
|
+
truncated: boolean;
|
|
46
|
+
omittedWorktrees: number;
|
|
47
|
+
}
|
|
48
|
+
export interface WorkingDetail {
|
|
49
|
+
path: string;
|
|
50
|
+
untracked: boolean;
|
|
51
|
+
conflict?: {
|
|
52
|
+
stages: number[];
|
|
53
|
+
};
|
|
54
|
+
members?: string[];
|
|
55
|
+
truncated: boolean;
|
|
56
|
+
layers: Array<{
|
|
57
|
+
layer: "staged" | "unstaged";
|
|
58
|
+
binary: boolean;
|
|
59
|
+
hunks: Array<{
|
|
60
|
+
beforeStart: number;
|
|
61
|
+
beforeCount: number;
|
|
62
|
+
afterStart: number;
|
|
63
|
+
afterCount: number;
|
|
64
|
+
}>;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
export declare function parseWorkingStatus(output: string): WorkingPath[];
|
|
68
|
+
export declare function workingOverview(root: string, options?: {
|
|
69
|
+
worktree?: string;
|
|
70
|
+
fresh?: boolean;
|
|
71
|
+
allPaths?: boolean;
|
|
72
|
+
refreshSelected?: boolean;
|
|
73
|
+
}): Promise<WorkingOverview>;
|
|
74
|
+
export declare function workingDetail(root: string, worktree: string, file: string): Promise<WorkingDetail>;
|