tracerkit 1.14.0 → 1.15.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/README.md +15 -7
- package/dist/bin.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{uninstall-C4K7aNpf.js → uninstall-k_ZGY-Mk.js} +189 -82
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,14 @@ tracerkit config github.repo org/repo # set target repo
|
|
|
103
103
|
|
|
104
104
|
PRDs and plans become GitHub Issues with `tk:prd` and `tk:plan` labels. On `/tk:check` pass, issues are closed instead of archived locally. Each project can use a different backend; local is the default. See [Configuration](docs/configuration.md) for details.
|
|
105
105
|
|
|
106
|
+
To migrate existing artifacts between backends:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
tracerkit migrate-storage # local→github or github→local (auto-detected)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Direction is inferred from the current `storage` config. All artifacts are migrated, existing duplicates are skipped, and the config is flipped to the target backend. Source artifacts are left intact as backup. For archived features migrating to GitHub, merged PRs matching the slug are linked automatically.
|
|
113
|
+
|
|
106
114
|
</details>
|
|
107
115
|
|
|
108
116
|
## Skills
|
|
@@ -137,13 +145,13 @@ Without arguments, shows a feature dashboard with status and progress before ask
|
|
|
137
145
|
|
|
138
146
|
## Docs
|
|
139
147
|
|
|
140
|
-
| Document | Description
|
|
141
|
-
| ------------------------------------------------ |
|
|
142
|
-
| [Examples](docs/examples.md) | Walk through end-to-end usage scenarios
|
|
143
|
-
| [CLI Reference](docs/cli-reference.md) | Commands: init, update, config, uninstall
|
|
144
|
-
| [Configuration](docs/configuration.md) | Storage backends, GitHub options, custom paths
|
|
145
|
-
| [Metadata Lifecycle](docs/metadata-lifecycle.md) | Understand YAML frontmatter states and transitions
|
|
146
|
-
| [Comparison](docs/comparison.md) | Compare TracerKit to Spec Kit, Kiro, and OpenSpec
|
|
148
|
+
| Document | Description |
|
|
149
|
+
| ------------------------------------------------ | ---------------------------------------------------------- |
|
|
150
|
+
| [Examples](docs/examples.md) | Walk through end-to-end usage scenarios |
|
|
151
|
+
| [CLI Reference](docs/cli-reference.md) | Commands: init, update, config, migrate-storage, uninstall |
|
|
152
|
+
| [Configuration](docs/configuration.md) | Storage backends, GitHub options, custom paths |
|
|
153
|
+
| [Metadata Lifecycle](docs/metadata-lifecycle.md) | Understand YAML frontmatter states and transitions |
|
|
154
|
+
| [Comparison](docs/comparison.md) | Compare TracerKit to Spec Kit, Kiro, and OpenSpec |
|
|
147
155
|
|
|
148
156
|
## Contributing
|
|
149
157
|
|
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as e, f as t, i as n, l as r, n as i, o as a, p as o, r as s, s as c, t as l, u } from "./uninstall-
|
|
2
|
+
import { a as e, f as t, i as n, l as r, n as i, o as a, p as o, r as s, s as c, t as l, u } from "./uninstall-k_ZGY-Mk.js";
|
|
3
3
|
import { existsSync as d, readFileSync as f, statSync as p } from "node:fs";
|
|
4
4
|
import { dirname as m, join as h, resolve as g } from "node:path";
|
|
5
5
|
import { fileURLToPath as _ } from "node:url";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as e, i as t, n, o as r, r as i, t as a, u as o } from "./uninstall-
|
|
1
|
+
import { c as e, i as t, n, o as r, r as i, t as a, u as o } from "./uninstall-k_ZGY-Mk.js";
|
|
2
2
|
export { r as COMMANDS, e as DEPRECATED_SKILLS, o as SKILL_NAMES, i as init, n as migrateStorage, a as uninstall, t as update };
|
|
@@ -26,24 +26,24 @@ function _(t) {
|
|
|
26
26
|
throw Error("Invalid .tracerkit/config.json — expected valid JSON");
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
|
-
storage:
|
|
30
|
-
paths:
|
|
31
|
-
github:
|
|
29
|
+
storage: ee(i.storage),
|
|
30
|
+
paths: v(i.paths),
|
|
31
|
+
github: y(i.github)
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function ee(e) {
|
|
35
35
|
return typeof e == "string" && m.includes(e) ? e : f;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let t =
|
|
37
|
+
function v(e) {
|
|
38
|
+
let t = S(e) ? e : {};
|
|
39
39
|
return {
|
|
40
40
|
prds: typeof t.prds == "string" ? t.prds : h.prds,
|
|
41
41
|
plans: typeof t.plans == "string" ? t.plans : h.plans,
|
|
42
42
|
archives: typeof t.archives == "string" ? t.archives : h.archives
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
let t =
|
|
45
|
+
function y(e) {
|
|
46
|
+
let t = S(e) ? e : {}, n = S(t.labels) ? t.labels : {};
|
|
47
47
|
return {
|
|
48
48
|
...typeof t.repo == "string" ? { repo: t.repo } : {},
|
|
49
49
|
labels: {
|
|
@@ -52,7 +52,7 @@ function b(e) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function b(r, i) {
|
|
56
56
|
let o = c(r, ".tracerkit", "config.json");
|
|
57
57
|
t(s(o), { recursive: !0 });
|
|
58
58
|
let l = {};
|
|
@@ -61,31 +61,31 @@ function x(r, i) {
|
|
|
61
61
|
} catch {
|
|
62
62
|
l = {};
|
|
63
63
|
}
|
|
64
|
-
let u =
|
|
64
|
+
let u = x(l, i);
|
|
65
65
|
a(o, JSON.stringify(u, null, 2) + "\n");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function x(e, t) {
|
|
68
68
|
let n = { ...e };
|
|
69
|
-
for (let e of Object.keys(t))
|
|
69
|
+
for (let e of Object.keys(t)) S(n[e]) && S(t[e]) ? n[e] = x(n[e], t[e]) : n[e] = t[e];
|
|
70
70
|
return n;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function S(e) {
|
|
73
73
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
74
74
|
}
|
|
75
|
-
var
|
|
75
|
+
var C = [
|
|
76
76
|
"tk:brief",
|
|
77
77
|
"tk:prd",
|
|
78
78
|
"tk:plan",
|
|
79
79
|
"tk:check"
|
|
80
|
-
],
|
|
80
|
+
], w = ["tk:verify"], T = {
|
|
81
81
|
force: "--force",
|
|
82
82
|
help: "--help",
|
|
83
83
|
version: "--version"
|
|
84
|
-
},
|
|
84
|
+
}, E = [
|
|
85
85
|
"brief",
|
|
86
86
|
"progress",
|
|
87
87
|
"archive"
|
|
88
|
-
],
|
|
88
|
+
], D = [
|
|
89
89
|
{
|
|
90
90
|
name: "init",
|
|
91
91
|
args: "[path]",
|
|
@@ -111,44 +111,44 @@ var w = [
|
|
|
111
111
|
args: "[path]",
|
|
112
112
|
desc: "Migrate artifacts between local and GitHub storage backends"
|
|
113
113
|
}
|
|
114
|
-
],
|
|
115
|
-
function
|
|
114
|
+
], O = c(s(u(import.meta.url)), "..", "skills");
|
|
115
|
+
function k(e, t = "") {
|
|
116
116
|
let n = r(e, { withFileTypes: !0 }), i = [];
|
|
117
117
|
for (let r of n) {
|
|
118
118
|
let n = t ? `${t}/${r.name}` : r.name;
|
|
119
|
-
r.isDirectory() ? i.push(...
|
|
119
|
+
r.isDirectory() ? i.push(...k(c(e, r.name), n)) : i.push(n);
|
|
120
120
|
}
|
|
121
121
|
return i.sort();
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function A(e) {
|
|
124
124
|
return `.claude/skills/tk:${e}`;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function j(e) {
|
|
127
127
|
return e.slice(18);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function M(e, t) {
|
|
130
130
|
let n = e;
|
|
131
131
|
return t.paths.prds !== h.prds && (n = n.replaceAll(h.prds, t.paths.prds)), t.paths.plans !== h.plans && (n = n.replaceAll(h.plans, t.paths.plans)), t.paths.archives !== h.archives && (n = n.replaceAll(h.archives, t.paths.archives)), t.github?.repo && (n = n.replaceAll("{{github.repo}}", t.github.repo)), t.github?.labels?.prd && (n = n.replaceAll("{{github.labels.prd}}", t.github.labels.prd)), t.github?.labels?.plan && (n = n.replaceAll("{{github.labels.plan}}", t.github.labels.plan)), n;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
let o = i ??
|
|
133
|
+
function N(e, r, i) {
|
|
134
|
+
let o = i ?? k(O).map(A);
|
|
135
135
|
for (let i of o) {
|
|
136
|
-
let o = c(
|
|
137
|
-
t(s(l), { recursive: !0 }), a(l,
|
|
136
|
+
let o = c(O, j(i)), l = c(e, i);
|
|
137
|
+
t(s(l), { recursive: !0 }), a(l, M(n(o, "utf8"), r));
|
|
138
138
|
}
|
|
139
139
|
return { copied: o };
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function P(e) {
|
|
142
142
|
return l("sha256").update(e).digest("hex");
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
let i =
|
|
144
|
+
function F(t, r) {
|
|
145
|
+
let i = k(O).map(A), a = [], o = [], s = [];
|
|
146
146
|
for (let l of i) {
|
|
147
147
|
let i = c(t, l);
|
|
148
148
|
if (!e(i)) s.push(l);
|
|
149
149
|
else {
|
|
150
|
-
let e =
|
|
151
|
-
|
|
150
|
+
let e = M(n(c(O, j(l)), "utf8"), r);
|
|
151
|
+
P(Buffer.from(e)) === P(n(i)) ? a.push(l) : o.push(l);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return {
|
|
@@ -159,10 +159,10 @@ function I(t, r) {
|
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
161
|
//#region src/commands/update.ts
|
|
162
|
-
function
|
|
163
|
-
if (!
|
|
164
|
-
let r = _(t), { unchanged: a, modified: o, missing: s } =
|
|
165
|
-
for (let n of
|
|
162
|
+
function I(t, n) {
|
|
163
|
+
if (!C.some((n) => e(c(t, ".claude", "skills", n)))) throw Error("TracerKit not initialized — run `tracerkit init` first");
|
|
164
|
+
let r = _(t), { unchanged: a, modified: o, missing: s } = F(t, r), l = [];
|
|
165
|
+
for (let n of w) {
|
|
166
166
|
let r = c(t, ".claude", "skills", n);
|
|
167
167
|
e(r) && (i(r, {
|
|
168
168
|
recursive: !0,
|
|
@@ -175,7 +175,7 @@ function L(t, n) {
|
|
|
175
175
|
...u ? o : []
|
|
176
176
|
];
|
|
177
177
|
if (d.length > 0) {
|
|
178
|
-
|
|
178
|
+
N(t, r, d);
|
|
179
179
|
for (let e of a) l.push(`✓ ${e}`);
|
|
180
180
|
for (let e of s) l.push(`✓ ${e} (added)`);
|
|
181
181
|
if (u) for (let e of o) l.push(`✓ ${e} (replaced)`);
|
|
@@ -188,19 +188,23 @@ function L(t, n) {
|
|
|
188
188
|
}
|
|
189
189
|
//#endregion
|
|
190
190
|
//#region src/commands/init.ts
|
|
191
|
-
function
|
|
192
|
-
if (
|
|
193
|
-
let { copied: n } =
|
|
191
|
+
function te(t) {
|
|
192
|
+
if (C.some((n) => e(c(t, ".claude", "skills", n)))) return I(t, { force: !1 });
|
|
193
|
+
let { copied: n } = N(t, _(t));
|
|
194
194
|
return n.map((e) => `✓ ${e}`);
|
|
195
195
|
}
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region src/commands/migrate-storage.ts
|
|
198
|
-
var
|
|
198
|
+
var L = {
|
|
199
199
|
created: "tk:created",
|
|
200
200
|
in_progress: "tk:in-progress",
|
|
201
201
|
done: "tk:done"
|
|
202
|
+
}, R = {
|
|
203
|
+
"tk:created": "created",
|
|
204
|
+
"tk:in-progress": "in_progress",
|
|
205
|
+
"tk:done": "done"
|
|
202
206
|
};
|
|
203
|
-
function
|
|
207
|
+
function z(e) {
|
|
204
208
|
let t = e.match(/^---\n([\s\S]*?)---\n([\s\S]*)$/);
|
|
205
209
|
if (!t) return {
|
|
206
210
|
metadata: {},
|
|
@@ -218,32 +222,54 @@ function B(e) {
|
|
|
218
222
|
body: t[2]
|
|
219
223
|
};
|
|
220
224
|
}
|
|
221
|
-
function
|
|
225
|
+
function B(e) {
|
|
222
226
|
let t = Object.entries(e);
|
|
223
227
|
return t.length === 0 ? "<!-- tk:metadata\n-->" : `<!-- tk:metadata\n${t.map(([e, t]) => `${e}: ${t}`).join("\n")}\n-->`;
|
|
224
228
|
}
|
|
229
|
+
function V(e) {
|
|
230
|
+
return L[e] ?? "tk:created";
|
|
231
|
+
}
|
|
225
232
|
function H(e) {
|
|
226
|
-
|
|
233
|
+
let t = e.match(/<!--\s*tk:metadata\n([\s\S]*?)-->\n*([\s\S]*)$/);
|
|
234
|
+
if (!t) return {
|
|
235
|
+
metadata: {},
|
|
236
|
+
body: e
|
|
237
|
+
};
|
|
238
|
+
let n = {};
|
|
239
|
+
for (let e of t[1].split("\n")) {
|
|
240
|
+
let t = e.indexOf(":");
|
|
241
|
+
if (t === -1) continue;
|
|
242
|
+
let r = e.slice(0, t).trim(), i = e.slice(t + 1).trim();
|
|
243
|
+
r && (n[r] = i);
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
metadata: n,
|
|
247
|
+
body: t[2]
|
|
248
|
+
};
|
|
227
249
|
}
|
|
228
250
|
function U(e) {
|
|
251
|
+
let t = Object.entries(e);
|
|
252
|
+
return t.length === 0 ? "---\n---\n" : `---\n${t.map(([e, t]) => `${e}: ${t}`).join("\n")}\n---\n`;
|
|
253
|
+
}
|
|
254
|
+
function W(e) {
|
|
229
255
|
let t = e.match(/\[[^\]]+\]\s+([^:]+):/);
|
|
230
256
|
return t ? t[1].trim() : null;
|
|
231
257
|
}
|
|
232
|
-
function
|
|
258
|
+
function G(e) {
|
|
233
259
|
let t = e.match(/^#\s+(.+)$/m);
|
|
234
260
|
return t ? t[1].trim() : "Untitled";
|
|
235
261
|
}
|
|
236
|
-
function
|
|
262
|
+
function K(t, i) {
|
|
237
263
|
let a = [], s = c(t, i.paths.prds);
|
|
238
264
|
if (e(s)) for (let e of r(s)) {
|
|
239
265
|
if (!e.endsWith(".md")) continue;
|
|
240
|
-
let t = o(e, ".md"), { metadata: r, body: i } =
|
|
266
|
+
let t = o(e, ".md"), { metadata: r, body: i } = z(n(c(s, e), "utf8"));
|
|
241
267
|
a.push({
|
|
242
268
|
slug: t,
|
|
243
269
|
type: "prd",
|
|
244
270
|
metadata: r,
|
|
245
271
|
body: i,
|
|
246
|
-
title:
|
|
272
|
+
title: G(i),
|
|
247
273
|
archived: !1
|
|
248
274
|
});
|
|
249
275
|
}
|
|
@@ -256,7 +282,7 @@ function G(t, i) {
|
|
|
256
282
|
type: "plan",
|
|
257
283
|
metadata: {},
|
|
258
284
|
body: r,
|
|
259
|
-
title:
|
|
285
|
+
title: G(r),
|
|
260
286
|
archived: !1
|
|
261
287
|
});
|
|
262
288
|
}
|
|
@@ -265,7 +291,7 @@ function G(t, i) {
|
|
|
265
291
|
if (!t.isDirectory()) continue;
|
|
266
292
|
let r = t.name, i = c(u, r, "prd.md"), o = c(u, r, "plan.md");
|
|
267
293
|
if (e(i)) {
|
|
268
|
-
let { metadata: e, body: t } =
|
|
294
|
+
let { metadata: e, body: t } = z(n(i, "utf8"));
|
|
269
295
|
a.push({
|
|
270
296
|
slug: r,
|
|
271
297
|
type: "prd",
|
|
@@ -274,7 +300,7 @@ function G(t, i) {
|
|
|
274
300
|
status: "done"
|
|
275
301
|
},
|
|
276
302
|
body: t,
|
|
277
|
-
title:
|
|
303
|
+
title: G(t),
|
|
278
304
|
archived: !0
|
|
279
305
|
});
|
|
280
306
|
}
|
|
@@ -285,14 +311,14 @@ function G(t, i) {
|
|
|
285
311
|
type: "plan",
|
|
286
312
|
metadata: { status: "done" },
|
|
287
313
|
body: e,
|
|
288
|
-
title:
|
|
314
|
+
title: G(e),
|
|
289
315
|
archived: !0
|
|
290
316
|
});
|
|
291
317
|
}
|
|
292
318
|
}
|
|
293
319
|
return a;
|
|
294
320
|
}
|
|
295
|
-
function
|
|
321
|
+
function q(e) {
|
|
296
322
|
return d(`gh ${e.map((e) => `'${e.replace(/'/g, "'\\''")}'`).join(" ")}`, {
|
|
297
323
|
encoding: "utf8",
|
|
298
324
|
stdio: [
|
|
@@ -302,7 +328,7 @@ function K(e) {
|
|
|
302
328
|
]
|
|
303
329
|
}).trim();
|
|
304
330
|
}
|
|
305
|
-
function
|
|
331
|
+
function J(e, t) {
|
|
306
332
|
return e.github.repo ? e.github.repo : t([
|
|
307
333
|
"repo",
|
|
308
334
|
"view",
|
|
@@ -312,7 +338,7 @@ function q(e, t) {
|
|
|
312
338
|
".nameWithOwner"
|
|
313
339
|
]);
|
|
314
340
|
}
|
|
315
|
-
function
|
|
341
|
+
function Y(e, t, n) {
|
|
316
342
|
let r = n([
|
|
317
343
|
"issue",
|
|
318
344
|
"list",
|
|
@@ -323,16 +349,16 @@ function J(e, t, n) {
|
|
|
323
349
|
"--state",
|
|
324
350
|
"all",
|
|
325
351
|
"--json",
|
|
326
|
-
"number,title,labels,state",
|
|
352
|
+
"number,title,body,labels,state",
|
|
327
353
|
"--limit",
|
|
328
354
|
"1000"
|
|
329
355
|
]);
|
|
330
356
|
return JSON.parse(r || "[]");
|
|
331
357
|
}
|
|
332
|
-
function
|
|
333
|
-
return t.some((t) =>
|
|
358
|
+
function X(e, t) {
|
|
359
|
+
return t.some((t) => W(t.title) === e);
|
|
334
360
|
}
|
|
335
|
-
function
|
|
361
|
+
function Z(e, t, n) {
|
|
336
362
|
for (let r of t) n([
|
|
337
363
|
"label",
|
|
338
364
|
"create",
|
|
@@ -342,7 +368,7 @@ function X(e, t, n) {
|
|
|
342
368
|
"--force"
|
|
343
369
|
]);
|
|
344
370
|
}
|
|
345
|
-
function
|
|
371
|
+
function ne(e, t, n) {
|
|
346
372
|
let r = [
|
|
347
373
|
"issue",
|
|
348
374
|
"create",
|
|
@@ -357,7 +383,7 @@ function Z(e, t, n) {
|
|
|
357
383
|
let i = n(r).match(/\/(\d+)\s*$/);
|
|
358
384
|
return i ? parseInt(i[1], 10) : 0;
|
|
359
385
|
}
|
|
360
|
-
function
|
|
386
|
+
function re(e, t, n) {
|
|
361
387
|
n([
|
|
362
388
|
"issue",
|
|
363
389
|
"close",
|
|
@@ -366,39 +392,120 @@ function Q(e, t, n) {
|
|
|
366
392
|
e
|
|
367
393
|
]);
|
|
368
394
|
}
|
|
395
|
+
function ie(e, t, n) {
|
|
396
|
+
let r = n([
|
|
397
|
+
"pr",
|
|
398
|
+
"list",
|
|
399
|
+
"--repo",
|
|
400
|
+
e,
|
|
401
|
+
"--search",
|
|
402
|
+
t,
|
|
403
|
+
"--state",
|
|
404
|
+
"merged",
|
|
405
|
+
"--json",
|
|
406
|
+
"number,title",
|
|
407
|
+
"--limit",
|
|
408
|
+
"5"
|
|
409
|
+
]);
|
|
410
|
+
return JSON.parse(r || "[]");
|
|
411
|
+
}
|
|
412
|
+
function ae(e, t, n, r) {
|
|
413
|
+
r([
|
|
414
|
+
"issue",
|
|
415
|
+
"comment",
|
|
416
|
+
String(t),
|
|
417
|
+
"--repo",
|
|
418
|
+
e,
|
|
419
|
+
"--body",
|
|
420
|
+
n
|
|
421
|
+
]);
|
|
422
|
+
}
|
|
423
|
+
function oe(e) {
|
|
424
|
+
for (let t of e) {
|
|
425
|
+
let e = R[t];
|
|
426
|
+
if (e) return e;
|
|
427
|
+
}
|
|
428
|
+
return "created";
|
|
429
|
+
}
|
|
430
|
+
function Q(e, n) {
|
|
431
|
+
t(s(e), { recursive: !0 }), a(e, n);
|
|
432
|
+
}
|
|
369
433
|
function $(e, t) {
|
|
370
|
-
let n = t?.runGh ??
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
let
|
|
375
|
-
|
|
434
|
+
let n = t?.runGh ?? q, r = _(e);
|
|
435
|
+
return r.storage === "local" ? se(e, r, n) : le(e, r, n);
|
|
436
|
+
}
|
|
437
|
+
function se(e, t, n) {
|
|
438
|
+
let r = [], i = J(t, n), a = K(e, t);
|
|
439
|
+
if (a.length === 0) return b(e, { storage: p }), r.push("No artifacts found — nothing to migrate."), r.push(`✓ Storage switched to "${p}".`), r;
|
|
440
|
+
let o = t.github.labels?.prd ?? "tk:prd", s = t.github.labels?.plan ?? "tk:plan";
|
|
441
|
+
Z(i, [
|
|
442
|
+
o,
|
|
376
443
|
s,
|
|
377
|
-
|
|
378
|
-
...[...new Set(o.map((e) => H(e.metadata.status ?? "created")))]
|
|
444
|
+
...[...new Set(a.map((e) => V(e.metadata.status ?? "created")))]
|
|
379
445
|
], n);
|
|
380
|
-
let
|
|
381
|
-
for (let e of
|
|
382
|
-
let t = e.type === "prd" ?
|
|
383
|
-
if (
|
|
384
|
-
|
|
446
|
+
let c = Y(i, o, n), l = Y(i, s, n);
|
|
447
|
+
for (let e of a) {
|
|
448
|
+
let t = e.type === "prd" ? o : s, a = e.type === "prd" ? c : l;
|
|
449
|
+
if (X(e.slug, a)) {
|
|
450
|
+
r.push(`⚠ skip ${e.type} "${e.slug}" — already exists on GitHub`);
|
|
385
451
|
continue;
|
|
386
452
|
}
|
|
387
|
-
let
|
|
453
|
+
let u = V(e.metadata.status ?? "created"), d = `${B(e.metadata)}\n\n${e.body.replace(/^\n/, "")}`, f = ne(i, {
|
|
388
454
|
title: `[${t}] ${e.slug}: ${e.title}`,
|
|
389
455
|
body: d,
|
|
390
|
-
labels: [t,
|
|
456
|
+
labels: [t, u]
|
|
391
457
|
}, n);
|
|
392
|
-
e.archived ? (
|
|
458
|
+
e.archived ? (re(i, f, n), ce(i, e.slug, f, n), r.push(`✓ ${e.type} "${e.slug}" → issue #${f} (closed)`)) : r.push(`✓ ${e.type} "${e.slug}" → issue #${f}`);
|
|
459
|
+
}
|
|
460
|
+
return b(e, { storage: p }), r.push(`✓ Storage switched to "${p}".`), r;
|
|
461
|
+
}
|
|
462
|
+
function ce(e, t, n, r) {
|
|
463
|
+
let i = ie(e, t, r);
|
|
464
|
+
i.length !== 0 && ae(e, n, `Linked PR: ${i.map((e) => `#${e.number}`).join(", ")}`, r);
|
|
465
|
+
}
|
|
466
|
+
function le(t, n, r) {
|
|
467
|
+
let i = [], a = J(n, r), o = n.github.labels?.prd ?? "tk:prd", s = n.github.labels?.plan ?? "tk:plan", l = Y(a, o, r), u = Y(a, s, r), d = [...l.map((e) => ({
|
|
468
|
+
...e,
|
|
469
|
+
type: "prd"
|
|
470
|
+
})), ...u.map((e) => ({
|
|
471
|
+
...e,
|
|
472
|
+
type: "plan"
|
|
473
|
+
}))];
|
|
474
|
+
if (d.length === 0) return b(t, { storage: f }), i.push("No GitHub issues found — nothing to migrate."), i.push(`✓ Storage switched to "${f}".`), i;
|
|
475
|
+
for (let r of d) {
|
|
476
|
+
let a = W(r.title);
|
|
477
|
+
if (!a) continue;
|
|
478
|
+
let o = r.labels.map((e) => e.name), s = o.includes("tk:done") && r.state === "CLOSED", { metadata: l, body: u } = H(r.body ?? ""), d = l.status ?? oe(o);
|
|
479
|
+
if (s) {
|
|
480
|
+
let o = c(t, n.paths.archives, a), s = c(o, "prd.md"), f = c(o, "plan.md"), p = r.type === "prd" ? s : f;
|
|
481
|
+
if (e(p)) {
|
|
482
|
+
i.push(`⚠ skip ${r.type} "${a}" — local file already exists`);
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
r.type === "prd" ? Q(p, `${U({
|
|
486
|
+
...l,
|
|
487
|
+
status: d
|
|
488
|
+
})}\n${u}`) : Q(p, u), i.push(`✓ ${r.type} "${a}" → ${p} (archived)`);
|
|
489
|
+
} else {
|
|
490
|
+
let o = c(t, r.type === "prd" ? n.paths.prds : n.paths.plans, `${a}.md`);
|
|
491
|
+
if (e(o)) {
|
|
492
|
+
i.push(`⚠ skip ${r.type} "${a}" — local file already exists`);
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
r.type === "prd" ? Q(o, `${U({
|
|
496
|
+
...l,
|
|
497
|
+
status: d
|
|
498
|
+
})}\n${u}`) : Q(o, u), i.push(`✓ ${r.type} "${a}" → ${o}`);
|
|
499
|
+
}
|
|
393
500
|
}
|
|
394
|
-
return
|
|
501
|
+
return b(t, { storage: f }), i.push(`✓ Storage switched to "${f}".`), i;
|
|
395
502
|
}
|
|
396
503
|
//#endregion
|
|
397
504
|
//#region src/commands/uninstall.ts
|
|
398
|
-
function
|
|
399
|
-
if (!
|
|
505
|
+
function ue(t) {
|
|
506
|
+
if (!C.some((n) => e(c(t, ".claude", "skills", n)))) throw Error("TracerKit not initialized — nothing to uninstall");
|
|
400
507
|
let n = [];
|
|
401
|
-
for (let r of
|
|
508
|
+
for (let r of C) {
|
|
402
509
|
let a = c(t, ".claude", "skills", r);
|
|
403
510
|
e(a) && (i(a, {
|
|
404
511
|
recursive: !0,
|
|
@@ -408,4 +515,4 @@ function ee(t) {
|
|
|
408
515
|
return n;
|
|
409
516
|
}
|
|
410
517
|
//#endregion
|
|
411
|
-
export {
|
|
518
|
+
export { N as a, w as c, f as d, _ as f, I as i, T as l, $ as n, D as o, b as p, te as r, E as s, ue as t, C as u };
|