@dendelion/paper-camp 0.26.0 → 0.27.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/app/assets/{index-DAhfAB9y.js → index-BEeox2IM.js} +2 -2
- package/dist/app/assets/{index-DAhfAB9y.js.map → index-BEeox2IM.js.map} +1 -1
- package/dist/app/assets/{index-X5ikcKAy.js → index-BW-jiFHN.js} +2 -2
- package/dist/app/assets/{index-X5ikcKAy.js.map → index-BW-jiFHN.js.map} +1 -1
- package/dist/app/assets/{index-DuhmLhzz.js → index-BhD5WS8p.js} +2 -2
- package/dist/app/assets/{index-DuhmLhzz.js.map → index-BhD5WS8p.js.map} +1 -1
- package/dist/app/assets/{index-HixYRYWW.js → index-C1zPjxRZ.js} +2 -2
- package/dist/app/assets/{index-HixYRYWW.js.map → index-C1zPjxRZ.js.map} +1 -1
- package/dist/app/assets/{index-sqaNs4DX.js → index-C2q1JS1i.js} +2 -2
- package/dist/app/assets/{index-sqaNs4DX.js.map → index-C2q1JS1i.js.map} +1 -1
- package/dist/app/assets/{index-CqDZ80wA.js → index-CHcj_gHq.js} +2 -2
- package/dist/app/assets/{index-CqDZ80wA.js.map → index-CHcj_gHq.js.map} +1 -1
- package/dist/app/assets/{index-DYGnWiFG.js → index-DN8Ti3Ov.js} +2 -2
- package/dist/app/assets/{index-DYGnWiFG.js.map → index-DN8Ti3Ov.js.map} +1 -1
- package/dist/app/assets/{index-VoRTCwB6.js → index-DX3JeGXT.js} +2 -2
- package/dist/app/assets/{index-VoRTCwB6.js.map → index-DX3JeGXT.js.map} +1 -1
- package/dist/app/assets/{main-Ceiva0Al.js → main-DCzV1FeH.js} +97 -97
- package/dist/app/assets/main-DCzV1FeH.js.map +1 -0
- package/dist/app/assets/{sidebar-section-CW3WaioH.js → sidebar-section-CFrPSdM0.js} +2 -2
- package/dist/app/assets/{sidebar-section-CW3WaioH.js.map → sidebar-section-CFrPSdM0.js.map} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/chunks/{machine-registry.DF3kTKHr.js → phase-progress.DoB5EhtE.js} +276 -272
- package/dist/chunks/phase-progress.DoB5EhtE.js.map +1 -0
- package/dist/cli/index.js +3096 -3071
- package/dist/cli/index.js.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/runtime-reachability.d.ts +6 -0
- package/dist/core/runtime-reachability.d.ts.map +1 -0
- package/dist/core/runtime-reachability.test.d.ts +2 -0
- package/dist/core/runtime-reachability.test.d.ts.map +1 -0
- package/dist/core/scaffold/scaffold.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/app/assets/main-Ceiva0Al.js.map +0 -1
- package/dist/chunks/machine-registry.DF3kTKHr.js.map +0 -1
|
@@ -5,8 +5,8 @@ import { AGENT_IDS as De, PLAN_KINDS as Ii } from "../types/index.js";
|
|
|
5
5
|
import { createHash as Ti, randomBytes as Ai } from "node:crypto";
|
|
6
6
|
import { existsSync as Oi, readFileSync as Ci } from "node:fs";
|
|
7
7
|
import { fileURLToPath as _i } from "node:url";
|
|
8
|
-
import { z as y } from "zod";
|
|
9
8
|
import { homedir as Li } from "node:os";
|
|
9
|
+
import { z as y } from "zod";
|
|
10
10
|
const Pi = /^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/;
|
|
11
11
|
function Ri(n) {
|
|
12
12
|
return n.length >= 2 && (n.startsWith('"') && n.endsWith('"') || n.startsWith("'") && n.endsWith("'")) ? n.slice(1, -1) : n;
|
|
@@ -20,7 +20,7 @@ function Wn(n) {
|
|
|
20
20
|
const t = e.match(Pi);
|
|
21
21
|
return t ? { key: t[1], value: Ri(t[2]) } : null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Vc(n) {
|
|
24
24
|
const e = [];
|
|
25
25
|
for (const t of n.split(`
|
|
26
26
|
`)) {
|
|
@@ -29,7 +29,7 @@ function Uc(n) {
|
|
|
29
29
|
}
|
|
30
30
|
return e;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Jc(n, e) {
|
|
33
33
|
const t = new Map(e.map((r) => [r.key, r.value])), s = n.length > 0 ? n.split(`
|
|
34
34
|
`) : [], i = [];
|
|
35
35
|
for (const r of s) {
|
|
@@ -47,7 +47,7 @@ function Hc(n, e) {
|
|
|
47
47
|
`)}
|
|
48
48
|
` : "";
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Wc(n) {
|
|
51
51
|
return n.archived === !0 || n.status === "done";
|
|
52
52
|
}
|
|
53
53
|
function St(n) {
|
|
@@ -102,10 +102,10 @@ function Ki(n = []) {
|
|
|
102
102
|
kind: e.kind
|
|
103
103
|
}));
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function zc(n, e, t) {
|
|
106
106
|
return [...(n ?? []).filter((s) => !e.includes(s.kind)), ...t];
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Qc(n, e, t, s) {
|
|
109
109
|
return n.map((i, r) => {
|
|
110
110
|
if (r !== e) return i;
|
|
111
111
|
const o = s ? `${i.text}
|
|
@@ -116,7 +116,7 @@ ${s}` : i.text;
|
|
|
116
116
|
return { ...c, kind: t, text: o };
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Xc(n = []) {
|
|
120
120
|
const e = n.reduce((t, s, i) => s.kind === "log" ? i : t, -1);
|
|
121
121
|
return n.slice(e + 1).filter((t) => t.kind === "chat");
|
|
122
122
|
}
|
|
@@ -333,7 +333,7 @@ query($owner: String!, $repo: String!, $number: Int!) {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
}`;
|
|
336
|
-
async function
|
|
336
|
+
async function Zc(n, e) {
|
|
337
337
|
var r, o, a;
|
|
338
338
|
const t = je(e);
|
|
339
339
|
if (!t) return [];
|
|
@@ -360,12 +360,12 @@ mutation($threadId: ID!, $body: String!) {
|
|
|
360
360
|
comment { id }
|
|
361
361
|
}
|
|
362
362
|
}`;
|
|
363
|
-
async function
|
|
363
|
+
async function el(n, e) {
|
|
364
364
|
var s, i, r;
|
|
365
365
|
const t = await rs(n, Zi, { threadId: e });
|
|
366
366
|
return !!((r = (i = (s = t == null ? void 0 : t.data) == null ? void 0 : s.resolveReviewThread) == null ? void 0 : i.thread) != null && r.isResolved);
|
|
367
367
|
}
|
|
368
|
-
async function
|
|
368
|
+
async function tl(n, e, t) {
|
|
369
369
|
var i, r, o;
|
|
370
370
|
const s = await rs(n, er, { threadId: e, body: t });
|
|
371
371
|
return !!((o = (r = (i = s == null ? void 0 : s.data) == null ? void 0 : i.addPullRequestReviewThreadReply) == null ? void 0 : r.comment) != null && o.id);
|
|
@@ -387,7 +387,7 @@ function as(n, e, t) {
|
|
|
387
387
|
}), (c = i.stdin) == null || c.end(JSON.stringify(t));
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
async function
|
|
390
|
+
async function nl(n, e, t) {
|
|
391
391
|
const s = je(e);
|
|
392
392
|
return s ? as(
|
|
393
393
|
n,
|
|
@@ -395,7 +395,7 @@ async function Qc(n, e, t) {
|
|
|
395
395
|
t
|
|
396
396
|
) : { delivered: !1 };
|
|
397
397
|
}
|
|
398
|
-
async function
|
|
398
|
+
async function sl(n, e, t) {
|
|
399
399
|
const s = je(e);
|
|
400
400
|
return s ? as(n, `repos/${s.owner}/${s.repo}/dispatches`, {
|
|
401
401
|
event_type: "paper-camp-review",
|
|
@@ -449,7 +449,7 @@ async function cs(n, e = xi) {
|
|
|
449
449
|
}
|
|
450
450
|
return t == null ? void 0 : t.prs;
|
|
451
451
|
}
|
|
452
|
-
async function
|
|
452
|
+
async function il(n) {
|
|
453
453
|
let e = X.get(n);
|
|
454
454
|
if (!e) {
|
|
455
455
|
const t = await ts(n);
|
|
@@ -457,7 +457,7 @@ async function Zc(n) {
|
|
|
457
457
|
}
|
|
458
458
|
return (e == null ? void 0 : e.fetchedAt) ?? null;
|
|
459
459
|
}
|
|
460
|
-
async function
|
|
460
|
+
async function rl(n) {
|
|
461
461
|
if (n === void 0) {
|
|
462
462
|
X.clear();
|
|
463
463
|
return;
|
|
@@ -5005,7 +5005,7 @@ function wo(n) {
|
|
|
5005
5005
|
}
|
|
5006
5006
|
return s;
|
|
5007
5007
|
}
|
|
5008
|
-
function
|
|
5008
|
+
function ol(n, e) {
|
|
5009
5009
|
return {
|
|
5010
5010
|
durationMs: ((n == null ? void 0 : n.durationMs) ?? 0) + e.durationMs,
|
|
5011
5011
|
inputTokens: ((n == null ? void 0 : n.inputTokens) ?? 0) + e.inputTokens,
|
|
@@ -5364,7 +5364,7 @@ function qo(n) {
|
|
|
5364
5364
|
}
|
|
5365
5365
|
return s;
|
|
5366
5366
|
}
|
|
5367
|
-
function
|
|
5367
|
+
function al(n) {
|
|
5368
5368
|
const e = [], t = [];
|
|
5369
5369
|
for (const s of qo(n)) {
|
|
5370
5370
|
const i = Oo.safeParse(s.fields);
|
|
@@ -5477,7 +5477,7 @@ function ei(n) {
|
|
|
5477
5477
|
...m && { unknownFrontmatter: m }
|
|
5478
5478
|
}], warnings: e };
|
|
5479
5479
|
}
|
|
5480
|
-
function
|
|
5480
|
+
function cl(n) {
|
|
5481
5481
|
const e = [], {
|
|
5482
5482
|
data: t,
|
|
5483
5483
|
body: s,
|
|
@@ -5506,7 +5506,7 @@ function sl(n) {
|
|
|
5506
5506
|
review: f
|
|
5507
5507
|
}], warnings: e };
|
|
5508
5508
|
}
|
|
5509
|
-
function
|
|
5509
|
+
function ll(n) {
|
|
5510
5510
|
const {
|
|
5511
5511
|
data: e,
|
|
5512
5512
|
body: t,
|
|
@@ -5525,7 +5525,7 @@ function il(n) {
|
|
|
5525
5525
|
}], warnings: s };
|
|
5526
5526
|
}
|
|
5527
5527
|
const xo = /^(IDEA-\d+):\s*/, Yo = /\n---+\n/;
|
|
5528
|
-
function
|
|
5528
|
+
function ul(n) {
|
|
5529
5529
|
return n.split(Yo).filter(Boolean).map((t) => {
|
|
5530
5530
|
var c;
|
|
5531
5531
|
const s = t.match(/^#{1,3}\s+(.+)/m), i = s ? s[1].trim() : ((c = t.trim().split(`
|
|
@@ -5568,7 +5568,7 @@ function Vo(n) {
|
|
|
5568
5568
|
}
|
|
5569
5569
|
return e;
|
|
5570
5570
|
}
|
|
5571
|
-
function
|
|
5571
|
+
function fl(n) {
|
|
5572
5572
|
const e = [];
|
|
5573
5573
|
for (const t of n.split(`
|
|
5574
5574
|
`)) {
|
|
@@ -5583,7 +5583,7 @@ function ol(n) {
|
|
|
5583
5583
|
return e;
|
|
5584
5584
|
}
|
|
5585
5585
|
const ti = /^-\s+(\d{4}-\d{2}-\d{2}):\s+(.+?)\s+—\s+(.*)$/;
|
|
5586
|
-
function
|
|
5586
|
+
function dl(n) {
|
|
5587
5587
|
const e = [];
|
|
5588
5588
|
for (const t of n.split(`
|
|
5589
5589
|
`)) {
|
|
@@ -5603,7 +5603,7 @@ function Jo(n) {
|
|
|
5603
5603
|
};
|
|
5604
5604
|
});
|
|
5605
5605
|
}
|
|
5606
|
-
function
|
|
5606
|
+
function hl(n) {
|
|
5607
5607
|
return n.length === 0 ? "" : `${n.map((e) => `${e.id}${Bt}${e.title}`).join(`
|
|
5608
5608
|
`)}
|
|
5609
5609
|
`;
|
|
@@ -5658,7 +5658,7 @@ async function hn(n, e) {
|
|
|
5658
5658
|
]);
|
|
5659
5659
|
return { entries: t, warnings: s, prs: r, resolved: r !== void 0, mainActivityIds: o };
|
|
5660
5660
|
}
|
|
5661
|
-
async function
|
|
5661
|
+
async function pl(n) {
|
|
5662
5662
|
const { entries: e, warnings: t, prs: s, resolved: i, mainActivityIds: r } = await hn(n), o = e.map((c) => ({
|
|
5663
5663
|
...c,
|
|
5664
5664
|
status: lt(c, s == null ? void 0 : s.get(c.id), i, r.has(c.id))
|
|
@@ -5669,7 +5669,7 @@ async function ll(n) {
|
|
|
5669
5669
|
return { ...c, status: zn(l) };
|
|
5670
5670
|
}), warnings: t };
|
|
5671
5671
|
}
|
|
5672
|
-
async function
|
|
5672
|
+
async function ml(n, e) {
|
|
5673
5673
|
const { entries: t, warnings: s, prs: i, resolved: r, mainActivityIds: o } = await hn(
|
|
5674
5674
|
n,
|
|
5675
5675
|
e
|
|
@@ -5681,7 +5681,7 @@ async function ul(n, e) {
|
|
|
5681
5681
|
return { ...l, status: zn(f) };
|
|
5682
5682
|
}), warnings: s, resolved: r };
|
|
5683
5683
|
}
|
|
5684
|
-
async function
|
|
5684
|
+
async function gl(n) {
|
|
5685
5685
|
const { entries: e, prs: t, resolved: s } = await hn(n);
|
|
5686
5686
|
return {
|
|
5687
5687
|
entries: e.flatMap((i) => {
|
|
@@ -5691,7 +5691,7 @@ async function fl(n) {
|
|
|
5691
5691
|
resolved: s
|
|
5692
5692
|
};
|
|
5693
5693
|
}
|
|
5694
|
-
async function
|
|
5694
|
+
async function yl(n) {
|
|
5695
5695
|
const { entries: e, warnings: t } = await ve(n);
|
|
5696
5696
|
return {
|
|
5697
5697
|
entries: e.filter((s) => s.kind === "note").map(qi),
|
|
@@ -5765,7 +5765,7 @@ function si(n) {
|
|
|
5765
5765
|
(e, t) => e.file.localeCompare(t.file) || e.line - t.line || Un[rt(e)] - Un[rt(t)] || e.rule.localeCompare(t.rule)
|
|
5766
5766
|
);
|
|
5767
5767
|
}
|
|
5768
|
-
function
|
|
5768
|
+
function wl(n) {
|
|
5769
5769
|
const e = si(n).map((t) => ({
|
|
5770
5770
|
...t,
|
|
5771
5771
|
severity: rt(t)
|
|
@@ -5776,7 +5776,7 @@ function hl(n) {
|
|
|
5776
5776
|
warningCount: e.filter((t) => t.severity === "warning").length
|
|
5777
5777
|
};
|
|
5778
5778
|
}
|
|
5779
|
-
function
|
|
5779
|
+
function bl(n) {
|
|
5780
5780
|
const e = si(n);
|
|
5781
5781
|
let t = 0, s = 0;
|
|
5782
5782
|
const i = e.map((o) => {
|
|
@@ -5816,12 +5816,12 @@ function ri(n) {
|
|
|
5816
5816
|
const e = n == null ? void 0 : n.version;
|
|
5817
5817
|
return typeof e == "number" ? e : null;
|
|
5818
5818
|
}
|
|
5819
|
-
async function
|
|
5819
|
+
async function kl(n) {
|
|
5820
5820
|
const e = ri(await ii(n));
|
|
5821
5821
|
if (e !== null && e > te)
|
|
5822
5822
|
throw new Zo(e);
|
|
5823
5823
|
}
|
|
5824
|
-
async function
|
|
5824
|
+
async function Sl(n) {
|
|
5825
5825
|
const e = await ii(n);
|
|
5826
5826
|
if (!e) return null;
|
|
5827
5827
|
const t = ri(e);
|
|
@@ -6084,7 +6084,7 @@ async function Ia(n) {
|
|
|
6084
6084
|
function Ta(n) {
|
|
6085
6085
|
return Na.flatMap((e) => e(n));
|
|
6086
6086
|
}
|
|
6087
|
-
async function
|
|
6087
|
+
async function El(n) {
|
|
6088
6088
|
return Ta(await Ia(n));
|
|
6089
6089
|
}
|
|
6090
6090
|
const Aa = {
|
|
@@ -6097,7 +6097,7 @@ const Aa = {
|
|
|
6097
6097
|
}, Oa = [Aa], Ca = new Map(
|
|
6098
6098
|
Oa.map((n) => [n.rule, n])
|
|
6099
6099
|
);
|
|
6100
|
-
function
|
|
6100
|
+
function Nl(n, e) {
|
|
6101
6101
|
const t = new Map(n.files.map((a) => [a.path, a])), s = [], i = [], r = [], o = [];
|
|
6102
6102
|
for (const a of e) {
|
|
6103
6103
|
const c = Ca.get(a.rule), l = t.get(a.file), f = c && l ? c.fix(a, l) : null;
|
|
@@ -6176,7 +6176,7 @@ async function Ba(n, e) {
|
|
|
6176
6176
|
l ? l.push(o) : r.set(c, [o]);
|
|
6177
6177
|
}), r;
|
|
6178
6178
|
}
|
|
6179
|
-
async function
|
|
6179
|
+
async function $l(n, e) {
|
|
6180
6180
|
const [{ entries: t }, s, i, r, o, a] = await Promise.all([
|
|
6181
6181
|
ve($(n, "papercamp", "ideas")),
|
|
6182
6182
|
cs(n),
|
|
@@ -6281,7 +6281,7 @@ function yn(n, e, t) {
|
|
|
6281
6281
|
return { start: i, end: o };
|
|
6282
6282
|
}
|
|
6283
6283
|
}
|
|
6284
|
-
function
|
|
6284
|
+
function vl(n, e, t, s) {
|
|
6285
6285
|
const i = n.split(`
|
|
6286
6286
|
`), r = yn(i, e, t);
|
|
6287
6287
|
if (!r) return n;
|
|
@@ -6296,7 +6296,7 @@ function kl(n, e, t, s) {
|
|
|
6296
6296
|
}
|
|
6297
6297
|
return n;
|
|
6298
6298
|
}
|
|
6299
|
-
function
|
|
6299
|
+
function Il(n, e, t, s) {
|
|
6300
6300
|
const i = n.split(`
|
|
6301
6301
|
`), r = pi(i, e);
|
|
6302
6302
|
if (!r) return n;
|
|
@@ -6305,13 +6305,13 @@ function Sl(n, e, t, s) {
|
|
|
6305
6305
|
return i.splice(o, 0, `- **${t}** — ${s}`), i.join(`
|
|
6306
6306
|
`);
|
|
6307
6307
|
}
|
|
6308
|
-
function
|
|
6308
|
+
function Tl(n, e, t, s) {
|
|
6309
6309
|
const i = n.split(`
|
|
6310
6310
|
`), r = yn(i, e, t);
|
|
6311
6311
|
return r ? (i.splice(r.end, 0, ` - ${s}`), i.join(`
|
|
6312
6312
|
`)) : n;
|
|
6313
6313
|
}
|
|
6314
|
-
function
|
|
6314
|
+
function Al(n, e, t, s) {
|
|
6315
6315
|
const i = n.split(`
|
|
6316
6316
|
`), r = yn(i, e, t);
|
|
6317
6317
|
return r ? (i.splice(r.end, 0, ` - → ${s}`), i.join(`
|
|
@@ -6323,7 +6323,7 @@ function Ha(n) {
|
|
|
6323
6323
|
...n.standingConcerns.map((e) => e.name)
|
|
6324
6324
|
];
|
|
6325
6325
|
}
|
|
6326
|
-
function
|
|
6326
|
+
function Ol(n, e, t = [], s = "") {
|
|
6327
6327
|
const i = new Map(e.filter((c) => c.id).map((c) => [c.id, c])), r = /* @__PURE__ */ new Map();
|
|
6328
6328
|
for (const c of t)
|
|
6329
6329
|
c.planId && r.set(c.planId, (r.get(c.planId) ?? 0) + 1);
|
|
@@ -6450,7 +6450,7 @@ function mi(n, e) {
|
|
|
6450
6450
|
});
|
|
6451
6451
|
}
|
|
6452
6452
|
const Va = 6e4;
|
|
6453
|
-
function
|
|
6453
|
+
function Cl(n, e, t = Va) {
|
|
6454
6454
|
return new Promise((s) => {
|
|
6455
6455
|
var o, a;
|
|
6456
6456
|
const i = D("gh", ["pr", "diff", e], { cwd: n, stdio: ["ignore", "pipe", "pipe"] });
|
|
@@ -6489,7 +6489,7 @@ async function ce(n, e) {
|
|
|
6489
6489
|
if (o)
|
|
6490
6490
|
return { id: s, view: t, entry: o };
|
|
6491
6491
|
}
|
|
6492
|
-
async function
|
|
6492
|
+
async function _l(n, e) {
|
|
6493
6493
|
const t = await ce(n, e);
|
|
6494
6494
|
if (!t) return;
|
|
6495
6495
|
const { id: s, entry: i } = t;
|
|
@@ -6519,7 +6519,7 @@ function za(n, e, t) {
|
|
|
6519
6519
|
}), i.on("close", (a) => s(a === 0)), i.on("error", () => s(!1)), (o = i.stdin) == null || o.end(t);
|
|
6520
6520
|
});
|
|
6521
6521
|
}
|
|
6522
|
-
async function
|
|
6522
|
+
async function Ll(n, e) {
|
|
6523
6523
|
const t = await ce(n, e);
|
|
6524
6524
|
if (!(t != null && t.view)) return "unresolved";
|
|
6525
6525
|
const { view: s, entry: i } = t, r = Wa(s.body, i.phases);
|
|
@@ -6579,7 +6579,7 @@ function ec(n, e, t) {
|
|
|
6579
6579
|
}), i.on("close", (o) => s(o === 0)), i.on("error", () => s(!1));
|
|
6580
6580
|
});
|
|
6581
6581
|
}
|
|
6582
|
-
async function
|
|
6582
|
+
async function Pl(n, e) {
|
|
6583
6583
|
const t = await ce(n, e);
|
|
6584
6584
|
if (!(t != null && t.view)) return "unresolved";
|
|
6585
6585
|
const { view: s, entry: i } = t, r = Qa({ kind: i.type, tags: i.tags }), o = new Set((s.labels ?? []).map((f) => f.name)), a = r.filter((f) => !o.has(f));
|
|
@@ -6612,19 +6612,19 @@ function sc(n, e, t) {
|
|
|
6612
6612
|
}), i.on("close", (o) => s(o === 0)), i.on("error", () => s(!1));
|
|
6613
6613
|
});
|
|
6614
6614
|
}
|
|
6615
|
-
async function
|
|
6615
|
+
async function Rl(n, e) {
|
|
6616
6616
|
const t = await ce(n, e);
|
|
6617
6617
|
if (!(t != null && t.view)) return "unresolved";
|
|
6618
6618
|
const { id: s, view: i, entry: r } = t, o = wi(s, r);
|
|
6619
6619
|
return i.title === o ? "unchanged" : await sc(n, e, o) ? "updated" : "unresolved";
|
|
6620
6620
|
}
|
|
6621
|
-
async function
|
|
6621
|
+
async function Ml(n, e) {
|
|
6622
6622
|
const t = await mi(n, e);
|
|
6623
6623
|
if (!t) return "no-pr";
|
|
6624
6624
|
const s = await ce(n, e);
|
|
6625
6625
|
return s ? t.title === wi(s.id, s.entry) ? "valid" : "invalid" : nc(t.title) ? "valid" : "invalid";
|
|
6626
6626
|
}
|
|
6627
|
-
function
|
|
6627
|
+
function Dl(n, e) {
|
|
6628
6628
|
return new Promise((t) => {
|
|
6629
6629
|
var r;
|
|
6630
6630
|
const s = D("gh", ["pr", "merge", e, "--squash"], {
|
|
@@ -6664,7 +6664,7 @@ function rc(n, e) {
|
|
|
6664
6664
|
}), s.on("close", (r) => t(r === 0)), s.on("error", () => t(!1));
|
|
6665
6665
|
});
|
|
6666
6666
|
}
|
|
6667
|
-
async function
|
|
6667
|
+
async function jl(n, e) {
|
|
6668
6668
|
const t = await ce(n, e);
|
|
6669
6669
|
if (!(t != null && t.view)) return "unresolved";
|
|
6670
6670
|
const { view: s, entry: i } = t;
|
|
@@ -6715,7 +6715,7 @@ function lc(n, e, t, s, i) {
|
|
|
6715
6715
|
}), o.on("close", (l) => r(l === 0)), o.on("error", () => r(!1)), (c = o.stdin) == null || c.end(i);
|
|
6716
6716
|
});
|
|
6717
6717
|
}
|
|
6718
|
-
async function
|
|
6718
|
+
async function Bl(n, e) {
|
|
6719
6719
|
var g, d;
|
|
6720
6720
|
const t = await ce(n, e);
|
|
6721
6721
|
if (!((g = t == null ? void 0 : t.view) != null && g.url)) return "unresolved";
|
|
@@ -6733,11 +6733,100 @@ async function Pl(n, e) {
|
|
|
6733
6733
|
}
|
|
6734
6734
|
return await cc(n, e, u) ? "created" : "unresolved";
|
|
6735
6735
|
}
|
|
6736
|
-
function
|
|
6736
|
+
function Fl(n, e, t) {
|
|
6737
6737
|
if (!n) return;
|
|
6738
6738
|
const s = (e ?? "feat").toLowerCase(), i = t.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), r = i.length <= 40 ? i : i[40] === "-" ? i.slice(0, 40) : i.slice(0, 40).replace(/-[^-]*$/, "");
|
|
6739
6739
|
return `${s}/${n.toLowerCase()}-${r}`;
|
|
6740
6740
|
}
|
|
6741
|
+
const At = { version: 1, projects: [] };
|
|
6742
|
+
function uc() {
|
|
6743
|
+
return process.env.PAPERCAMP_CONFIG_DIR ?? $(Li(), ".config", "paper-camp");
|
|
6744
|
+
}
|
|
6745
|
+
function fc() {
|
|
6746
|
+
return $(uc(), "projects.json");
|
|
6747
|
+
}
|
|
6748
|
+
function dc(n) {
|
|
6749
|
+
const e = n;
|
|
6750
|
+
return typeof e == "object" && e !== null && typeof e.slug == "string" && typeof e.path == "string" && typeof e.name == "string";
|
|
6751
|
+
}
|
|
6752
|
+
function hc(n) {
|
|
6753
|
+
const e = n;
|
|
6754
|
+
return typeof e == "object" && e !== null && e.version === 1 && Array.isArray(e.projects) && e.projects.every(dc);
|
|
6755
|
+
}
|
|
6756
|
+
async function pc(n) {
|
|
6757
|
+
let e;
|
|
6758
|
+
try {
|
|
6759
|
+
e = await j(n, "utf-8");
|
|
6760
|
+
} catch (t) {
|
|
6761
|
+
return t.code !== "ENOENT" && console.error("paper-camp: could not read machine registry:", t), At;
|
|
6762
|
+
}
|
|
6763
|
+
try {
|
|
6764
|
+
const t = JSON.parse(e);
|
|
6765
|
+
return hc(t) ? t : At;
|
|
6766
|
+
} catch {
|
|
6767
|
+
return At;
|
|
6768
|
+
}
|
|
6769
|
+
}
|
|
6770
|
+
async function mc(n, e) {
|
|
6771
|
+
await Q(_e(n), { recursive: !0 });
|
|
6772
|
+
const t = `${n}.${Ai(6).toString("hex")}.tmp`;
|
|
6773
|
+
await B(t, `${JSON.stringify(e, null, 2)}
|
|
6774
|
+
`, "utf-8"), await Vn(t, n);
|
|
6775
|
+
}
|
|
6776
|
+
function gc(n) {
|
|
6777
|
+
return n.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "project";
|
|
6778
|
+
}
|
|
6779
|
+
function yc(n, e) {
|
|
6780
|
+
if (!e.has(n)) return n;
|
|
6781
|
+
let t = 2;
|
|
6782
|
+
for (; e.has(`${n}-${t}`); ) t++;
|
|
6783
|
+
return `${n}-${t}`;
|
|
6784
|
+
}
|
|
6785
|
+
function wc(n, e, t) {
|
|
6786
|
+
const s = Jn(e), i = n.projects.find((c) => c.path === s);
|
|
6787
|
+
if (i) return { registry: n, entry: i, created: !1 };
|
|
6788
|
+
const r = new Set(n.projects.map((c) => c.slug)), a = { slug: yc(gc(Ct(s)), r), path: s, name: t ?? Ct(s) };
|
|
6789
|
+
return {
|
|
6790
|
+
registry: { ...n, projects: [...n.projects, a] },
|
|
6791
|
+
entry: a,
|
|
6792
|
+
created: !0
|
|
6793
|
+
};
|
|
6794
|
+
}
|
|
6795
|
+
function Kl(n, e) {
|
|
6796
|
+
return n.projects.some((t) => t.slug === e) ? {
|
|
6797
|
+
registry: { ...n, projects: n.projects.filter((t) => t.slug !== e) },
|
|
6798
|
+
removed: !0
|
|
6799
|
+
} : { registry: n, removed: !1 };
|
|
6800
|
+
}
|
|
6801
|
+
function ql(n) {
|
|
6802
|
+
return [...n.projects].sort((e, t) => e.slug.localeCompare(t.slug));
|
|
6803
|
+
}
|
|
6804
|
+
async function bc(n, e) {
|
|
6805
|
+
let t;
|
|
6806
|
+
try {
|
|
6807
|
+
t = await j(n, "utf-8");
|
|
6808
|
+
} catch {
|
|
6809
|
+
return { hasConfig: !1, name: e };
|
|
6810
|
+
}
|
|
6811
|
+
try {
|
|
6812
|
+
const s = JSON.parse(t), i = s == null ? void 0 : s.projectName;
|
|
6813
|
+
return {
|
|
6814
|
+
hasConfig: !0,
|
|
6815
|
+
name: typeof i == "string" && i ? i : e
|
|
6816
|
+
};
|
|
6817
|
+
} catch {
|
|
6818
|
+
return { hasConfig: !0, name: e };
|
|
6819
|
+
}
|
|
6820
|
+
}
|
|
6821
|
+
async function Ul(n) {
|
|
6822
|
+
const e = Jn(n), t = await Me(e, { withFileTypes: !0 }), s = [];
|
|
6823
|
+
for (const i of t) {
|
|
6824
|
+
if (!i.isDirectory()) continue;
|
|
6825
|
+
const r = $(e, i.name), o = $(r, "papercamp", "config.json"), { hasConfig: a, name: c } = await bc(o, i.name);
|
|
6826
|
+
s.push({ path: r, name: c, hasConfig: a });
|
|
6827
|
+
}
|
|
6828
|
+
return s.sort((i, r) => i.name.localeCompare(r.name));
|
|
6829
|
+
}
|
|
6741
6830
|
function kt(n, e) {
|
|
6742
6831
|
for (const { entries: t, section: s } of e)
|
|
6743
6832
|
t && t.length > 0 && n.push(s.formatLines(t).join(`
|
|
@@ -6746,7 +6835,7 @@ function kt(n, e) {
|
|
|
6746
6835
|
function ki() {
|
|
6747
6836
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
6748
6837
|
}
|
|
6749
|
-
function
|
|
6838
|
+
function Hl(n, e = "log") {
|
|
6750
6839
|
return {
|
|
6751
6840
|
kind: e,
|
|
6752
6841
|
date: ki(),
|
|
@@ -6755,7 +6844,7 @@ function Ml(n, e = "log") {
|
|
|
6755
6844
|
...e === "question" ? { state: "open" } : {}
|
|
6756
6845
|
};
|
|
6757
6846
|
}
|
|
6758
|
-
function
|
|
6847
|
+
function kc(n) {
|
|
6759
6848
|
const e = [`## ${n.title}`, "", `**Status:** ${n.status}`];
|
|
6760
6849
|
n.kind && e.push(`**Kind:** ${n.kind}`), n.id && e.push(`**Id:** ${n.id}`), n.idea && e.push(`**Idea:** ${n.idea}`), n.agent && e.push(`**Agent:** ${n.agent}`), e.push(`**Created:** ${n.created}`), n.updated && e.push(`**Updated:** ${n.updated}`), n.tags && n.tags.length > 0 && e.push(`**Tags:** ${n.tags.join(", ")}`);
|
|
6761
6850
|
const t = [e.join(`
|
|
@@ -6769,8 +6858,8 @@ function uc(n) {
|
|
|
6769
6858
|
|
|
6770
6859
|
`).trimEnd();
|
|
6771
6860
|
}
|
|
6772
|
-
function
|
|
6773
|
-
return n.length === 0 ? "" : `${n.map((e) =>
|
|
6861
|
+
function xl(n) {
|
|
6862
|
+
return n.length === 0 ? "" : `${n.map((e) => kc(e)).join(`
|
|
6774
6863
|
|
|
6775
6864
|
`)}
|
|
6776
6865
|
`;
|
|
@@ -6780,7 +6869,7 @@ function bn(n) {
|
|
|
6780
6869
|
${ho(n).trimEnd()}
|
|
6781
6870
|
---`;
|
|
6782
6871
|
}
|
|
6783
|
-
function
|
|
6872
|
+
function Yl(n) {
|
|
6784
6873
|
const e = {
|
|
6785
6874
|
id: n.id,
|
|
6786
6875
|
title: n.title,
|
|
@@ -6799,7 +6888,7 @@ function jl(n) {
|
|
|
6799
6888
|
|
|
6800
6889
|
`).trimEnd();
|
|
6801
6890
|
}
|
|
6802
|
-
function
|
|
6891
|
+
function Sc(n) {
|
|
6803
6892
|
const e = {
|
|
6804
6893
|
id: n.id,
|
|
6805
6894
|
title: n.title
|
|
@@ -6816,7 +6905,7 @@ function fc(n) {
|
|
|
6816
6905
|
|
|
6817
6906
|
`).trimEnd();
|
|
6818
6907
|
}
|
|
6819
|
-
function
|
|
6908
|
+
function Gl(n) {
|
|
6820
6909
|
const e = {
|
|
6821
6910
|
id: n.id,
|
|
6822
6911
|
title: n.title
|
|
@@ -6829,7 +6918,7 @@ ${n.body}` : s), kt(t, [{ entries: n.log, section: xe }]), t.join(`
|
|
|
6829
6918
|
|
|
6830
6919
|
`).trimEnd();
|
|
6831
6920
|
}
|
|
6832
|
-
function
|
|
6921
|
+
function Vl(n, e) {
|
|
6833
6922
|
let t = !1;
|
|
6834
6923
|
const s = n.split(`
|
|
6835
6924
|
`).filter((i) => {
|
|
@@ -6844,7 +6933,7 @@ function Fl(n, e) {
|
|
|
6844
6933
|
`) : n;
|
|
6845
6934
|
}
|
|
6846
6935
|
let ct = Promise.resolve();
|
|
6847
|
-
async function
|
|
6936
|
+
async function Ec(n, e) {
|
|
6848
6937
|
const t = new RegExp(`^${e.toUpperCase()}-(\\d+)\\.md$`), s = [
|
|
6849
6938
|
$(n, "ideas"),
|
|
6850
6939
|
$(n, "ideas", "archive"),
|
|
@@ -6875,20 +6964,20 @@ async function Si(n, e) {
|
|
|
6875
6964
|
return;
|
|
6876
6965
|
}
|
|
6877
6966
|
if (!(s != null && s.nextId)) return;
|
|
6878
|
-
const i = s.nextId[e] ?? 1, r = await
|
|
6967
|
+
const i = s.nextId[e] ?? 1, r = await Ec(_e(n), e), o = Math.max(i, r + 1), a = `${e.toUpperCase()}-${o}`;
|
|
6879
6968
|
return s.nextId[e] = o + 1, await B(n, `${JSON.stringify(s, null, 2)}
|
|
6880
6969
|
`), a;
|
|
6881
6970
|
});
|
|
6882
6971
|
return ct = t.catch(() => {
|
|
6883
6972
|
}), t;
|
|
6884
6973
|
}
|
|
6885
|
-
async function
|
|
6974
|
+
async function Jl(n) {
|
|
6886
6975
|
return Si(n, "idea");
|
|
6887
6976
|
}
|
|
6888
|
-
async function
|
|
6977
|
+
async function Wl(n) {
|
|
6889
6978
|
return Si(n, "ticket");
|
|
6890
6979
|
}
|
|
6891
|
-
async function
|
|
6980
|
+
async function zl(n, e) {
|
|
6892
6981
|
const t = ct.then(async () => {
|
|
6893
6982
|
let s = null;
|
|
6894
6983
|
try {
|
|
@@ -6903,7 +6992,7 @@ async function Ul(n, e) {
|
|
|
6903
6992
|
return ct = t.catch(() => {
|
|
6904
6993
|
}), t;
|
|
6905
6994
|
}
|
|
6906
|
-
async function
|
|
6995
|
+
async function Ql(n, e) {
|
|
6907
6996
|
const t = $(n, "papercamp", "ideas"), s = $(t, "archive"), i = $(t, `${e}.md`), r = $(s, `${e}.md`);
|
|
6908
6997
|
await Q(s, { recursive: !0 });
|
|
6909
6998
|
try {
|
|
@@ -6913,7 +7002,7 @@ async function Hl(n, e) {
|
|
|
6913
7002
|
throw o;
|
|
6914
7003
|
}
|
|
6915
7004
|
}
|
|
6916
|
-
const
|
|
7005
|
+
const Nc = `---
|
|
6917
7006
|
name: paper-camp
|
|
6918
7007
|
description: Work inside a project that has a papercamp/ folder — its unified idea entities (each holding its plan as a section), with decisions and open questions logged as notes on the idea they bind. Use this whenever the working directory contains papercamp/ (papercamp/ideas/), and especially before starting, continuing, or completing any plan phase, drafting an idea, logging a decision, or answering "what are we working on / what's next".
|
|
6919
7008
|
---
|
|
@@ -6982,13 +7071,13 @@ session start from live plan data, not hand-maintained here. It does
|
|
|
6982
7071
|
not define the file formats in full; treat the existing files under
|
|
6983
7072
|
\`papercamp/\` as the grammar reference (mirror their structure exactly rather
|
|
6984
7073
|
than inventing a new shape).
|
|
6985
|
-
`,
|
|
7074
|
+
`, $c = "$CLAUDE_PROJECT_DIR/node_modules/.bin/paper-camp", vc = `${JSON.stringify(
|
|
6986
7075
|
{
|
|
6987
7076
|
hooks: {
|
|
6988
7077
|
SessionStart: [
|
|
6989
7078
|
{
|
|
6990
7079
|
matcher: "*",
|
|
6991
|
-
hooks: [{ type: "command", command: `"${
|
|
7080
|
+
hooks: [{ type: "command", command: `"${$c}" session-focus` }]
|
|
6992
7081
|
}
|
|
6993
7082
|
]
|
|
6994
7083
|
}
|
|
@@ -6996,11 +7085,11 @@ than inventing a new shape).
|
|
|
6996
7085
|
null,
|
|
6997
7086
|
2
|
|
6998
7087
|
)}
|
|
6999
|
-
`,
|
|
7000
|
-
function
|
|
7088
|
+
`, Ic = 5;
|
|
7089
|
+
function Tc() {
|
|
7001
7090
|
try {
|
|
7002
7091
|
let n = _e(_i(import.meta.url));
|
|
7003
|
-
for (let e = 0; e <
|
|
7092
|
+
for (let e = 0; e < Ic; e++) {
|
|
7004
7093
|
const t = $(n, "package.json");
|
|
7005
7094
|
if (Oi(t))
|
|
7006
7095
|
return JSON.parse(Ci(t, "utf-8")).version ?? "0.0.0";
|
|
@@ -7011,8 +7100,8 @@ function yc() {
|
|
|
7011
7100
|
return "0.0.0";
|
|
7012
7101
|
}
|
|
7013
7102
|
}
|
|
7014
|
-
const
|
|
7015
|
-
class
|
|
7103
|
+
const Xl = Tc();
|
|
7104
|
+
class Ac extends Error {
|
|
7016
7105
|
constructor(e) {
|
|
7017
7106
|
super(`Paper Camp is already initialized in ${e} (papercamp/config.json exists).`);
|
|
7018
7107
|
}
|
|
@@ -7024,11 +7113,11 @@ async function ge(n) {
|
|
|
7024
7113
|
return !1;
|
|
7025
7114
|
}
|
|
7026
7115
|
}
|
|
7027
|
-
const
|
|
7028
|
-
async function
|
|
7116
|
+
const Oc = ["suggestions.md"];
|
|
7117
|
+
async function Zl(n, e) {
|
|
7029
7118
|
const t = $(n, "papercamp"), s = $(t, "config.json");
|
|
7030
7119
|
if (await ge(s))
|
|
7031
|
-
throw new
|
|
7120
|
+
throw new Ac(n);
|
|
7032
7121
|
const i = {
|
|
7033
7122
|
version: te,
|
|
7034
7123
|
projectName: e.projectName,
|
|
@@ -7042,7 +7131,7 @@ async function Yl(n, e) {
|
|
|
7042
7131
|
await Q(o, { recursive: !0 });
|
|
7043
7132
|
const a = $(r, "IDEA-1.md");
|
|
7044
7133
|
if (!await ge(a)) {
|
|
7045
|
-
const c =
|
|
7134
|
+
const c = Sc({
|
|
7046
7135
|
id: "IDEA-1",
|
|
7047
7136
|
title: "Capture your first idea",
|
|
7048
7137
|
status: "idea",
|
|
@@ -7054,18 +7143,22 @@ Use the New idea button to capture what you're building next, or ask an agent fo
|
|
|
7054
7143
|
await B(a, `${c}
|
|
7055
7144
|
`, "utf-8");
|
|
7056
7145
|
}
|
|
7057
|
-
for (const c of
|
|
7146
|
+
for (const c of Oc) {
|
|
7058
7147
|
const l = $(t, c);
|
|
7059
7148
|
await ge(l) || await B(l, "", "utf-8");
|
|
7060
7149
|
}
|
|
7061
7150
|
await B(s, `${JSON.stringify(i, null, 2)}
|
|
7062
|
-
`, "utf-8"), await
|
|
7151
|
+
`, "utf-8"), await _c(n), await Lc(n), await Cc(n, e.projectName);
|
|
7152
|
+
}
|
|
7153
|
+
async function Cc(n, e) {
|
|
7154
|
+
const t = fc(), s = await pc(t), { registry: i, created: r } = wc(s, n, e);
|
|
7155
|
+
r && await mc(t, i);
|
|
7063
7156
|
}
|
|
7064
|
-
const
|
|
7065
|
-
async function
|
|
7157
|
+
const Ot = "papercamp/.pairing.json";
|
|
7158
|
+
async function _c(n) {
|
|
7066
7159
|
const e = $(n, ".gitignore"), t = await ge(e) ? await j(e, "utf-8") : "", s = t.length > 0 ? t.split(`
|
|
7067
7160
|
`) : [];
|
|
7068
|
-
if (s.some((r) => r.trim() ===
|
|
7161
|
+
if (s.some((r) => r.trim() === Ot)) return;
|
|
7069
7162
|
const i = s.reduce(
|
|
7070
7163
|
(r, o, a) => o.startsWith("papercamp/") ? a : r,
|
|
7071
7164
|
-1
|
|
@@ -7074,22 +7167,22 @@ async function kc(n) {
|
|
|
7074
7167
|
const r = t.length > 0 && !t.endsWith(`
|
|
7075
7168
|
`) ? `
|
|
7076
7169
|
` : "";
|
|
7077
|
-
await B(e, `${t}${r}${
|
|
7170
|
+
await B(e, `${t}${r}${Ot}
|
|
7078
7171
|
`, "utf-8");
|
|
7079
7172
|
return;
|
|
7080
7173
|
}
|
|
7081
|
-
s.splice(i + 1, 0,
|
|
7174
|
+
s.splice(i + 1, 0, Ot), await B(e, s.join(`
|
|
7082
7175
|
`), "utf-8");
|
|
7083
7176
|
}
|
|
7084
|
-
async function
|
|
7177
|
+
async function Lc(n) {
|
|
7085
7178
|
const e = $(n, ".claude", "skills", "paper-camp");
|
|
7086
7179
|
await Q(e, { recursive: !0 });
|
|
7087
7180
|
const t = $(e, "SKILL.md");
|
|
7088
|
-
await ge(t) || await B(t,
|
|
7181
|
+
await ge(t) || await B(t, Nc, "utf-8");
|
|
7089
7182
|
const s = $(n, ".claude");
|
|
7090
7183
|
await Q(s, { recursive: !0 });
|
|
7091
7184
|
const i = $(s, "settings.json");
|
|
7092
|
-
await ge(i) || await B(i,
|
|
7185
|
+
await ge(i) || await B(i, vc, "utf-8");
|
|
7093
7186
|
}
|
|
7094
7187
|
const Ei = {
|
|
7095
7188
|
feat: "Features",
|
|
@@ -7097,8 +7190,8 @@ const Ei = {
|
|
|
7097
7190
|
refactor: "Code Refactoring",
|
|
7098
7191
|
docs: "Documentation",
|
|
7099
7192
|
chore: "Miscellaneous"
|
|
7100
|
-
},
|
|
7101
|
-
async function
|
|
7193
|
+
}, Pc = Array.from(new Set(Object.values(Ei)));
|
|
7194
|
+
async function eu(n, e) {
|
|
7102
7195
|
const t = await ot($(n, "CHANGELOG.md")), s = La(t).find((a) => a.version === e);
|
|
7103
7196
|
if (!s) return null;
|
|
7104
7197
|
const [{ entries: i }, r] = await Promise.all([
|
|
@@ -7111,12 +7204,12 @@ async function Gl(n, e) {
|
|
|
7111
7204
|
const l = Ei[c.type ?? "chore"], f = o.get(l) ?? [];
|
|
7112
7205
|
f.push({ id: c.id, title: c.title }), o.set(l, f);
|
|
7113
7206
|
}
|
|
7114
|
-
return
|
|
7207
|
+
return Pc.filter((a) => o.has(a)).map((a) => ({
|
|
7115
7208
|
label: a,
|
|
7116
7209
|
ideas: o.get(a)
|
|
7117
7210
|
}));
|
|
7118
7211
|
}
|
|
7119
|
-
function
|
|
7212
|
+
function tu(n, e) {
|
|
7120
7213
|
const t = [`## ${n}`];
|
|
7121
7214
|
for (const s of e) {
|
|
7122
7215
|
t.push("", `### ${s.label}`, "");
|
|
@@ -7126,24 +7219,24 @@ function Vl(n, e) {
|
|
|
7126
7219
|
return t.join(`
|
|
7127
7220
|
`);
|
|
7128
7221
|
}
|
|
7129
|
-
function
|
|
7222
|
+
function Rc(n) {
|
|
7130
7223
|
return Math.floor((Date.now() - Date.parse(n)) / 864e5);
|
|
7131
7224
|
}
|
|
7132
|
-
const
|
|
7133
|
-
function
|
|
7225
|
+
const Mc = (n, e) => n === "question" && (e ?? "open") === "open";
|
|
7226
|
+
function Dc(n) {
|
|
7134
7227
|
return n.flatMap(
|
|
7135
|
-
(e) => (e.thread ?? []).filter((t) =>
|
|
7228
|
+
(e) => (e.thread ?? []).filter((t) => Mc(t.kind, t.state)).map((t) => ({
|
|
7136
7229
|
entityId: e.id,
|
|
7137
7230
|
entityTitle: e.title,
|
|
7138
7231
|
text: t.text,
|
|
7139
7232
|
date: t.date,
|
|
7140
|
-
ageDays: t.date ?
|
|
7233
|
+
ageDays: t.date ? Rc(t.date) : Number.POSITIVE_INFINITY
|
|
7141
7234
|
}))
|
|
7142
7235
|
).sort((e, t) => t.ageDays - e.ageDays);
|
|
7143
7236
|
}
|
|
7144
|
-
async function
|
|
7237
|
+
async function nu(n) {
|
|
7145
7238
|
const { entries: e } = await ve(n);
|
|
7146
|
-
return
|
|
7239
|
+
return Dc(e);
|
|
7147
7240
|
}
|
|
7148
7241
|
const Ft = 0.95, Ni = 3e4, Kt = {
|
|
7149
7242
|
implement: { from: 0, to: 0.6 },
|
|
@@ -7159,7 +7252,7 @@ function Gn(n, ...e) {
|
|
|
7159
7252
|
if (typeof (n == null ? void 0 : n[t]) == "string") return n[t];
|
|
7160
7253
|
return "";
|
|
7161
7254
|
}
|
|
7162
|
-
function
|
|
7255
|
+
function su(n, e) {
|
|
7163
7256
|
const t = n.toLowerCase();
|
|
7164
7257
|
if (t === "bash")
|
|
7165
7258
|
return (typeof (e == null ? void 0 : e.command) == "string" ? e.command : "").includes("check-types") ? "verify" : null;
|
|
@@ -7169,27 +7262,27 @@ function Wl(n, e) {
|
|
|
7169
7262
|
}
|
|
7170
7263
|
return null;
|
|
7171
7264
|
}
|
|
7172
|
-
function
|
|
7265
|
+
function iu(n, e) {
|
|
7173
7266
|
return n ? Yn[e] > Yn[n] ? e : n : e;
|
|
7174
7267
|
}
|
|
7175
|
-
function
|
|
7268
|
+
function ru(n, e) {
|
|
7176
7269
|
return n === void 0 ? !1 : e - n >= Ni;
|
|
7177
7270
|
}
|
|
7178
|
-
function
|
|
7271
|
+
function jc(n) {
|
|
7179
7272
|
const e = [...n].sort((s, i) => s - i), t = Math.floor(e.length / 2);
|
|
7180
7273
|
return e.length % 2 === 0 ? (e[t - 1] + e[t]) / 2 : e[t];
|
|
7181
7274
|
}
|
|
7182
|
-
function
|
|
7275
|
+
function ou(n) {
|
|
7183
7276
|
const e = n.filter((i) => i.taskKind === "phase" && i.outcome === "done").map((i) => Date.parse(i.endedAt) - Date.parse(i.startedAt)).filter((i) => Number.isFinite(i) && i > 0);
|
|
7184
7277
|
if (e.length === 0) return {};
|
|
7185
|
-
const t =
|
|
7278
|
+
const t = jc(e), s = {};
|
|
7186
7279
|
for (const i of ["implement", "verify"]) {
|
|
7187
7280
|
const r = Kt[i].to - Kt[i].from;
|
|
7188
7281
|
s[i] = t * r / Ft;
|
|
7189
7282
|
}
|
|
7190
7283
|
return s;
|
|
7191
7284
|
}
|
|
7192
|
-
function
|
|
7285
|
+
function au({
|
|
7193
7286
|
anchor: n,
|
|
7194
7287
|
anchorEnteredAt: e,
|
|
7195
7288
|
lastStreamAt: t,
|
|
@@ -7203,235 +7296,146 @@ function Zl({
|
|
|
7203
7296
|
const c = t === void 0 ? s : Math.min(s, t + Ni), l = Math.min(1, Math.max(0, c - e) / a);
|
|
7204
7297
|
return Math.min(r.from + l * (r.to - r.from), Ft);
|
|
7205
7298
|
}
|
|
7206
|
-
const Ot = { version: 1, projects: [] };
|
|
7207
|
-
function Tc() {
|
|
7208
|
-
return process.env.PAPERCAMP_CONFIG_DIR ?? $(Li(), ".config", "paper-camp");
|
|
7209
|
-
}
|
|
7210
|
-
function eu() {
|
|
7211
|
-
return $(Tc(), "projects.json");
|
|
7212
|
-
}
|
|
7213
|
-
function Ac(n) {
|
|
7214
|
-
const e = n;
|
|
7215
|
-
return typeof e == "object" && e !== null && typeof e.slug == "string" && typeof e.path == "string" && typeof e.name == "string";
|
|
7216
|
-
}
|
|
7217
|
-
function Oc(n) {
|
|
7218
|
-
const e = n;
|
|
7219
|
-
return typeof e == "object" && e !== null && e.version === 1 && Array.isArray(e.projects) && e.projects.every(Ac);
|
|
7220
|
-
}
|
|
7221
|
-
async function tu(n) {
|
|
7222
|
-
let e;
|
|
7223
|
-
try {
|
|
7224
|
-
e = await j(n, "utf-8");
|
|
7225
|
-
} catch (t) {
|
|
7226
|
-
return t.code !== "ENOENT" && console.error("paper-camp: could not read machine registry:", t), Ot;
|
|
7227
|
-
}
|
|
7228
|
-
try {
|
|
7229
|
-
const t = JSON.parse(e);
|
|
7230
|
-
return Oc(t) ? t : Ot;
|
|
7231
|
-
} catch {
|
|
7232
|
-
return Ot;
|
|
7233
|
-
}
|
|
7234
|
-
}
|
|
7235
|
-
async function nu(n, e) {
|
|
7236
|
-
await Q(_e(n), { recursive: !0 });
|
|
7237
|
-
const t = `${n}.${Ai(6).toString("hex")}.tmp`;
|
|
7238
|
-
await B(t, `${JSON.stringify(e, null, 2)}
|
|
7239
|
-
`, "utf-8"), await Vn(t, n);
|
|
7240
|
-
}
|
|
7241
|
-
function Cc(n) {
|
|
7242
|
-
return n.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "project";
|
|
7243
|
-
}
|
|
7244
|
-
function _c(n, e) {
|
|
7245
|
-
if (!e.has(n)) return n;
|
|
7246
|
-
let t = 2;
|
|
7247
|
-
for (; e.has(`${n}-${t}`); ) t++;
|
|
7248
|
-
return `${n}-${t}`;
|
|
7249
|
-
}
|
|
7250
|
-
function su(n, e, t) {
|
|
7251
|
-
const s = Jn(e), i = n.projects.find((c) => c.path === s);
|
|
7252
|
-
if (i) return { registry: n, entry: i, created: !1 };
|
|
7253
|
-
const r = new Set(n.projects.map((c) => c.slug)), a = { slug: _c(Cc(Ct(s)), r), path: s, name: t ?? Ct(s) };
|
|
7254
|
-
return {
|
|
7255
|
-
registry: { ...n, projects: [...n.projects, a] },
|
|
7256
|
-
entry: a,
|
|
7257
|
-
created: !0
|
|
7258
|
-
};
|
|
7259
|
-
}
|
|
7260
|
-
function iu(n, e) {
|
|
7261
|
-
return n.projects.some((t) => t.slug === e) ? {
|
|
7262
|
-
registry: { ...n, projects: n.projects.filter((t) => t.slug !== e) },
|
|
7263
|
-
removed: !0
|
|
7264
|
-
} : { registry: n, removed: !1 };
|
|
7265
|
-
}
|
|
7266
|
-
function ru(n) {
|
|
7267
|
-
return [...n.projects].sort((e, t) => e.slug.localeCompare(t.slug));
|
|
7268
|
-
}
|
|
7269
|
-
async function Lc(n, e) {
|
|
7270
|
-
let t;
|
|
7271
|
-
try {
|
|
7272
|
-
t = await j(n, "utf-8");
|
|
7273
|
-
} catch {
|
|
7274
|
-
return { hasConfig: !1, name: e };
|
|
7275
|
-
}
|
|
7276
|
-
try {
|
|
7277
|
-
const s = JSON.parse(t), i = s == null ? void 0 : s.projectName;
|
|
7278
|
-
return {
|
|
7279
|
-
hasConfig: !0,
|
|
7280
|
-
name: typeof i == "string" && i ? i : e
|
|
7281
|
-
};
|
|
7282
|
-
} catch {
|
|
7283
|
-
return { hasConfig: !0, name: e };
|
|
7284
|
-
}
|
|
7285
|
-
}
|
|
7286
|
-
async function ou(n) {
|
|
7287
|
-
const e = Jn(n), t = await Me(e, { withFileTypes: !0 }), s = [];
|
|
7288
|
-
for (const i of t) {
|
|
7289
|
-
if (!i.isDirectory()) continue;
|
|
7290
|
-
const r = $(e, i.name), o = $(r, "papercamp", "config.json"), { hasConfig: a, name: c } = await Lc(o, i.name);
|
|
7291
|
-
s.push({ path: r, name: c, hasConfig: a });
|
|
7292
|
-
}
|
|
7293
|
-
return s.sort((i, r) => i.name.localeCompare(r.name));
|
|
7294
|
-
}
|
|
7295
7299
|
export {
|
|
7296
7300
|
ui as $,
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7301
|
+
Ac as A,
|
|
7302
|
+
nl as B,
|
|
7303
|
+
vc as C,
|
|
7300
7304
|
Na as D,
|
|
7301
7305
|
ee as E,
|
|
7302
|
-
|
|
7306
|
+
fc as F,
|
|
7303
7307
|
Qa as G,
|
|
7304
7308
|
xa as H,
|
|
7305
7309
|
Ha as I,
|
|
7306
|
-
|
|
7310
|
+
wl as J,
|
|
7307
7311
|
Ro as K,
|
|
7308
7312
|
Mo as L,
|
|
7309
7313
|
qn as M,
|
|
7310
7314
|
Do as N,
|
|
7311
7315
|
Po as O,
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
+
Xl as P,
|
|
7317
|
+
sl as Q,
|
|
7318
|
+
zl as R,
|
|
7319
|
+
Nc as S,
|
|
7316
7320
|
Lo as T,
|
|
7317
7321
|
Zs as U,
|
|
7318
7322
|
qi as V,
|
|
7319
7323
|
Xn as W,
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7324
|
+
Cl as X,
|
|
7325
|
+
Zc as Y,
|
|
7326
|
+
gl as Z,
|
|
7323
7327
|
Go as _,
|
|
7324
7328
|
wn as a,
|
|
7325
7329
|
bn as a$,
|
|
7326
7330
|
rt as a0,
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7331
|
+
Sc as a1,
|
|
7332
|
+
Gl as a2,
|
|
7333
|
+
kc as a3,
|
|
7334
|
+
Yl as a4,
|
|
7335
|
+
xl as a5,
|
|
7336
|
+
tu as a6,
|
|
7337
|
+
il as a7,
|
|
7334
7338
|
_o as a8,
|
|
7335
|
-
|
|
7339
|
+
Zl as a9,
|
|
7336
7340
|
ot as aA,
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7341
|
+
yl as aB,
|
|
7342
|
+
nu as aC,
|
|
7343
|
+
ml as aD,
|
|
7344
|
+
Kl as aE,
|
|
7345
|
+
vl as aF,
|
|
7346
|
+
Vl as aG,
|
|
7343
7347
|
ac as aH,
|
|
7344
7348
|
Wa as aI,
|
|
7345
|
-
|
|
7346
|
-
|
|
7349
|
+
tl as aJ,
|
|
7350
|
+
bl as aK,
|
|
7347
7351
|
ja as aL,
|
|
7348
|
-
|
|
7352
|
+
$l as aM,
|
|
7349
7353
|
_t as aN,
|
|
7350
7354
|
Ba as aO,
|
|
7351
|
-
|
|
7355
|
+
_l as aP,
|
|
7352
7356
|
Ga as aQ,
|
|
7353
7357
|
cs as aR,
|
|
7354
|
-
|
|
7358
|
+
eu as aS,
|
|
7355
7359
|
La as aT,
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7360
|
+
el as aU,
|
|
7361
|
+
Ol as aV,
|
|
7362
|
+
El as aW,
|
|
7359
7363
|
Ta as aX,
|
|
7360
|
-
|
|
7361
|
-
|
|
7364
|
+
mc as aY,
|
|
7365
|
+
Ul as aZ,
|
|
7362
7366
|
Wi as a_,
|
|
7363
7367
|
nc as aa,
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7368
|
+
ru as ab,
|
|
7369
|
+
Al as ac,
|
|
7370
|
+
ql as ad,
|
|
7371
|
+
pc as ae,
|
|
7372
|
+
uc as af,
|
|
7373
|
+
ou as ag,
|
|
7370
7374
|
jo as ah,
|
|
7371
7375
|
ei as ai,
|
|
7372
|
-
|
|
7376
|
+
Vc as aj,
|
|
7373
7377
|
dn as ak,
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7378
|
+
ll as al,
|
|
7379
|
+
ul as am,
|
|
7380
|
+
fl as an,
|
|
7381
|
+
cl as ao,
|
|
7382
|
+
al as ap,
|
|
7379
7383
|
qo as aq,
|
|
7380
7384
|
Ua as ar,
|
|
7381
|
-
|
|
7385
|
+
dl as as,
|
|
7382
7386
|
Vo as at,
|
|
7383
|
-
|
|
7384
|
-
|
|
7387
|
+
au,
|
|
7388
|
+
Nl as av,
|
|
7385
7389
|
Oo as aw,
|
|
7386
7390
|
Co as ax,
|
|
7387
7391
|
ve as ay,
|
|
7388
|
-
|
|
7392
|
+
pl as az,
|
|
7389
7393
|
Ui as b,
|
|
7390
7394
|
si as b0,
|
|
7391
|
-
|
|
7395
|
+
Dl as b1,
|
|
7392
7396
|
Bo as b2,
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7397
|
+
Bl as b3,
|
|
7398
|
+
Ll as b4,
|
|
7399
|
+
Pl as b5,
|
|
7400
|
+
jl as b6,
|
|
7401
|
+
Rl as b7,
|
|
7398
7402
|
ki as b8,
|
|
7399
|
-
|
|
7400
|
-
|
|
7403
|
+
Ml as b9,
|
|
7404
|
+
kl as ba,
|
|
7401
7405
|
Jo as bb,
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7406
|
+
hl as bc,
|
|
7407
|
+
Wc as bd,
|
|
7408
|
+
Qc as be,
|
|
7405
7409
|
Qn as bf,
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7410
|
+
ol as bg,
|
|
7411
|
+
Xc as bh,
|
|
7412
|
+
zc as bi,
|
|
7409
7413
|
be as bj,
|
|
7410
7414
|
ji as bk,
|
|
7411
|
-
|
|
7415
|
+
Sl as bl,
|
|
7412
7416
|
Oa as c,
|
|
7413
7417
|
Qo as d,
|
|
7414
7418
|
Xo as e,
|
|
7415
7419
|
Ft as f,
|
|
7416
7420
|
Ni as g,
|
|
7417
7421
|
ti as h,
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
+
wc as i,
|
|
7423
|
+
Tl as j,
|
|
7424
|
+
Il as k,
|
|
7425
|
+
iu as l,
|
|
7422
7426
|
ne as m,
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
+
Hl as n,
|
|
7428
|
+
Jc as o,
|
|
7429
|
+
Ql as p,
|
|
7430
|
+
Jl as q,
|
|
7427
7431
|
Si as r,
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
+
Wl as s,
|
|
7433
|
+
Fl as t,
|
|
7434
|
+
su as u,
|
|
7435
|
+
rl as v,
|
|
7432
7436
|
Ia as w,
|
|
7433
|
-
|
|
7437
|
+
Dc as x,
|
|
7434
7438
|
Ya as y,
|
|
7435
7439
|
wi as z
|
|
7436
7440
|
};
|
|
7437
|
-
//# sourceMappingURL=
|
|
7441
|
+
//# sourceMappingURL=phase-progress.DoB5EhtE.js.map
|