@runcofactor/cli 0.13.0 → 0.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/dist/account-22LMP5PX.js +255 -0
- package/dist/account-22LMP5PX.js.map +1 -0
- package/dist/{api-catalog-7HLEN7C2.js → api-catalog-WTFQNLK6.js} +5 -5
- package/dist/{attachment-OVNQD6Z2.js → attachment-U3NKVPEY.js} +5 -5
- package/dist/augmentor-5GMNAX4M.js +198 -0
- package/dist/augmentor-5GMNAX4M.js.map +1 -0
- package/dist/{auth-VUHL74FH.js → auth-VQG2CDUD.js} +3 -3
- package/dist/{chunk-PZ4LCN6K.js → chunk-3X3NW7QA.js} +2 -2
- package/dist/{chunk-VGTKUOYS.js → chunk-46IUJXSD.js} +2 -2
- package/dist/{chunk-YN763NWQ.js → chunk-7VMO2WOZ.js} +10 -4
- package/dist/chunk-7VMO2WOZ.js.map +1 -0
- package/dist/{chunk-Z5LUTUDN.js → chunk-CMGI7UZD.js} +3 -3
- package/dist/{chunk-EEN2TZUQ.js → chunk-FNPMWDUQ.js} +3 -3
- package/dist/{chunk-EJ4U242G.js → chunk-HDFYUFBI.js} +2 -2
- package/dist/{chunk-JZMJUPZP.js → chunk-JMJVGMXI.js} +2 -2
- package/dist/{chunk-JZMJUPZP.js.map → chunk-JMJVGMXI.js.map} +1 -1
- package/dist/{chunk-QGI4UCJX.js → chunk-JYGNMKZ5.js} +62 -35
- package/dist/chunk-JYGNMKZ5.js.map +1 -0
- package/dist/{chunk-CRHPDPRS.js → chunk-KCHKFYVX.js} +30 -8
- package/dist/{chunk-CRHPDPRS.js.map → chunk-KCHKFYVX.js.map} +1 -1
- package/dist/{chunk-ZD3KHESI.js → chunk-KRWRUU6R.js} +27 -7
- package/dist/chunk-KRWRUU6R.js.map +1 -0
- package/dist/{chunk-ENDHMYEJ.js → chunk-NHTEKEYE.js} +3 -3
- package/dist/{chunk-CQE46HSM.js → chunk-PRBRSIZP.js} +14 -8
- package/dist/chunk-PRBRSIZP.js.map +1 -0
- package/dist/{chunk-NL7CVG56.js → chunk-UETBLPKM.js} +57 -10
- package/dist/chunk-UETBLPKM.js.map +1 -0
- package/dist/{chunk-QQVWGWPI.js → chunk-VGYN2KU2.js} +8494 -1504
- package/dist/chunk-VGYN2KU2.js.map +1 -0
- package/dist/{chunk-ZTOE3ND3.js → chunk-XJ5YYYGC.js} +4 -4
- package/dist/{credential-LO2SEEHU.js → credential-E6KUHRGU.js} +5 -5
- package/dist/{credential-template-ZN7W7734.js → credential-template-4GPOPBGD.js} +5 -5
- package/dist/{debug-workflow-R3RYYAXK.js → debug-workflow-XCLCY6S7.js} +5 -5
- package/dist/{docs-DIAFBDXQ.js → docs-COCZYMW6.js} +95 -11
- package/dist/docs-COCZYMW6.js.map +1 -0
- package/dist/{doctor-NZPUSCRE.js → doctor-ERIVTCQS.js} +3 -3
- package/dist/{environment-RQVU4P5M.js → environment-7Y4BV6XY.js} +5 -5
- package/dist/{feature-flag-XG26RURR.js → feature-flag-MHONEX6T.js} +98 -12
- package/dist/feature-flag-MHONEX6T.js.map +1 -0
- package/dist/index.js +107 -51
- package/dist/index.js.map +1 -1
- package/dist/{init-EDNLKGPT.js → init-OROOM4HF.js} +5 -5
- package/dist/{install-FYZ3HNZK.js → install-OJFXHY6U.js} +5 -5
- package/dist/{issues-NNRVTJ4L.js → issues-32GONR6C.js} +5 -5
- package/dist/{knobs-A2BOBH22.js → knobs-UQGGY3CP.js} +7 -6
- package/dist/knobs-UQGGY3CP.js.map +1 -0
- package/dist/{list-F33VZ4BJ.js → list-ZMIKEC5P.js} +5 -5
- package/dist/{local-DQDTM3XA.js → local-PUD24GGQ.js} +7 -7
- package/dist/{login-BUMVIB36.js → login-BSO7YX2D.js} +5 -5
- package/dist/{mcp-B5Y5CDMQ.js → mcp-4LS7OJUT.js} +9 -9
- package/dist/{mcp-B5Y5CDMQ.js.map → mcp-4LS7OJUT.js.map} +1 -1
- package/dist/{pdf-extract-ABWV3L5X.js → pdf-extract-YHE54XU4.js} +2 -2
- package/dist/product-3JKSJCBC.js +346 -0
- package/dist/product-3JKSJCBC.js.map +1 -0
- package/dist/{property-NJ4SRXQG.js → property-K5DBL4UE.js} +5 -5
- package/dist/{psql-VBZFCMNR.js → psql-PQFUFTSE.js} +3 -3
- package/dist/{record-WAO36O7G.js → record-EIIYLFJ4.js} +6 -6
- package/dist/{redis-DHZXHL4S.js → redis-BU36EZZI.js} +3 -3
- package/dist/redis-BU36EZZI.js.map +1 -0
- package/dist/{release-STJKUKTE.js → release-LYC2P7DZ.js} +5 -5
- package/dist/{sandbox-DWSGLY7B.js → sandbox-CKHXXZHU.js} +51 -7
- package/dist/sandbox-CKHXXZHU.js.map +1 -0
- package/dist/{scenarios-HCIDY725.js → scenarios-2XJ2G3KR.js} +5 -5
- package/dist/{session-Y5RHU54D.js → session-UTOD5ZYH.js} +8 -9
- package/dist/session-UTOD5ZYH.js.map +1 -0
- package/dist/{skill-23WAHUOB.js → skill-GMAERMQL.js} +10 -10
- package/dist/{skill-23WAHUOB.js.map → skill-GMAERMQL.js.map} +1 -1
- package/dist/skills/debug-run/SKILL.md +7 -1
- package/dist/skills/debug-run/history/1.3.1.md +279 -0
- package/dist/skills/debug-run/version.json +1 -1
- package/dist/skills/optimize-cache/SKILL.md +29 -2
- package/dist/{spec-LM5XHOQ5.js → spec-2NP36U3Y.js} +5 -5
- package/dist/{src-22RI5VP2.js → src-4T6GHXVO.js} +2 -2
- package/dist/{src-NCJPUAE6.js → src-CG52HEE7.js} +10 -8
- package/dist/{src-Y3K7UJEF.js → src-PK5OZXCM.js} +2 -2
- package/dist/{src-BGDRMOKC.js → src-UEOOC425.js} +295 -102
- package/dist/src-UEOOC425.js.map +1 -0
- package/dist/{start-SWY55CZX.js → start-3C7EEFW2.js} +5 -5
- package/dist/{tag-YSU2XXPI.js → tag-JSHOMLBR.js} +6 -6
- package/dist/{task-NLBKLD7D.js → task-YGWVYTBJ.js} +5 -5
- package/dist/{test-suite-QCPWZ2LS.js → test-suite-LI7ZH367.js} +10 -8
- package/dist/{test-suite-QCPWZ2LS.js.map → test-suite-LI7ZH367.js.map} +1 -1
- package/dist/trace-UMLOSIIR.js +16 -0
- package/dist/{triage-TT4BMDBU.js → triage-ZWJG4NBJ.js} +6 -6
- package/dist/{upgrade-6ZUFETKX.js → upgrade-S7CGEK6H.js} +3 -3
- package/dist/{workflow-2CX3ZNOQ.js → workflow-T4HSAOGW.js} +86 -15
- package/dist/workflow-T4HSAOGW.js.map +1 -0
- package/dist/{workflow-cache-GXNE6SU2.js → workflow-cache-XVEZ36KF.js} +8 -8
- package/dist/{workflow-debug-PRX3DWGD.js → workflow-debug-T2BULXZ7.js} +9 -9
- package/dist/{workflow-proposals-BW327WGL.js → workflow-proposals-XXEZICN2.js} +5 -7
- package/dist/workflow-proposals-XXEZICN2.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-CQE46HSM.js.map +0 -1
- package/dist/chunk-NL7CVG56.js.map +0 -1
- package/dist/chunk-QGI4UCJX.js.map +0 -1
- package/dist/chunk-QQVWGWPI.js.map +0 -1
- package/dist/chunk-YN763NWQ.js.map +0 -1
- package/dist/chunk-ZD3KHESI.js.map +0 -1
- package/dist/docs-DIAFBDXQ.js.map +0 -1
- package/dist/feature-flag-XG26RURR.js.map +0 -1
- package/dist/knobs-A2BOBH22.js.map +0 -1
- package/dist/redis-DHZXHL4S.js.map +0 -1
- package/dist/sandbox-DWSGLY7B.js.map +0 -1
- package/dist/session-Y5RHU54D.js.map +0 -1
- package/dist/src-BGDRMOKC.js.map +0 -1
- package/dist/trace-A3ZY6K26.js +0 -16
- package/dist/workflow-2CX3ZNOQ.js.map +0 -1
- package/dist/workflow-proposals-BW327WGL.js.map +0 -1
- /package/dist/{api-catalog-7HLEN7C2.js.map → api-catalog-WTFQNLK6.js.map} +0 -0
- /package/dist/{attachment-OVNQD6Z2.js.map → attachment-U3NKVPEY.js.map} +0 -0
- /package/dist/{auth-VUHL74FH.js.map → auth-VQG2CDUD.js.map} +0 -0
- /package/dist/{chunk-PZ4LCN6K.js.map → chunk-3X3NW7QA.js.map} +0 -0
- /package/dist/{chunk-VGTKUOYS.js.map → chunk-46IUJXSD.js.map} +0 -0
- /package/dist/{chunk-Z5LUTUDN.js.map → chunk-CMGI7UZD.js.map} +0 -0
- /package/dist/{chunk-EEN2TZUQ.js.map → chunk-FNPMWDUQ.js.map} +0 -0
- /package/dist/{chunk-EJ4U242G.js.map → chunk-HDFYUFBI.js.map} +0 -0
- /package/dist/{chunk-ENDHMYEJ.js.map → chunk-NHTEKEYE.js.map} +0 -0
- /package/dist/{chunk-ZTOE3ND3.js.map → chunk-XJ5YYYGC.js.map} +0 -0
- /package/dist/{credential-LO2SEEHU.js.map → credential-E6KUHRGU.js.map} +0 -0
- /package/dist/{credential-template-ZN7W7734.js.map → credential-template-4GPOPBGD.js.map} +0 -0
- /package/dist/{debug-workflow-R3RYYAXK.js.map → debug-workflow-XCLCY6S7.js.map} +0 -0
- /package/dist/{doctor-NZPUSCRE.js.map → doctor-ERIVTCQS.js.map} +0 -0
- /package/dist/{environment-RQVU4P5M.js.map → environment-7Y4BV6XY.js.map} +0 -0
- /package/dist/{init-EDNLKGPT.js.map → init-OROOM4HF.js.map} +0 -0
- /package/dist/{install-FYZ3HNZK.js.map → install-OJFXHY6U.js.map} +0 -0
- /package/dist/{issues-NNRVTJ4L.js.map → issues-32GONR6C.js.map} +0 -0
- /package/dist/{list-F33VZ4BJ.js.map → list-ZMIKEC5P.js.map} +0 -0
- /package/dist/{local-DQDTM3XA.js.map → local-PUD24GGQ.js.map} +0 -0
- /package/dist/{login-BUMVIB36.js.map → login-BSO7YX2D.js.map} +0 -0
- /package/dist/{pdf-extract-ABWV3L5X.js.map → pdf-extract-YHE54XU4.js.map} +0 -0
- /package/dist/{property-NJ4SRXQG.js.map → property-K5DBL4UE.js.map} +0 -0
- /package/dist/{psql-VBZFCMNR.js.map → psql-PQFUFTSE.js.map} +0 -0
- /package/dist/{record-WAO36O7G.js.map → record-EIIYLFJ4.js.map} +0 -0
- /package/dist/{release-STJKUKTE.js.map → release-LYC2P7DZ.js.map} +0 -0
- /package/dist/{scenarios-HCIDY725.js.map → scenarios-2XJ2G3KR.js.map} +0 -0
- /package/dist/{spec-LM5XHOQ5.js.map → spec-2NP36U3Y.js.map} +0 -0
- /package/dist/{src-22RI5VP2.js.map → src-4T6GHXVO.js.map} +0 -0
- /package/dist/{src-NCJPUAE6.js.map → src-CG52HEE7.js.map} +0 -0
- /package/dist/{src-Y3K7UJEF.js.map → src-PK5OZXCM.js.map} +0 -0
- /package/dist/{start-SWY55CZX.js.map → start-3C7EEFW2.js.map} +0 -0
- /package/dist/{tag-YSU2XXPI.js.map → tag-JSHOMLBR.js.map} +0 -0
- /package/dist/{task-NLBKLD7D.js.map → task-YGWVYTBJ.js.map} +0 -0
- /package/dist/{trace-A3ZY6K26.js.map → trace-UMLOSIIR.js.map} +0 -0
- /package/dist/{triage-TT4BMDBU.js.map → triage-ZWJG4NBJ.js.map} +0 -0
- /package/dist/{upgrade-6ZUFETKX.js.map → upgrade-S7CGEK6H.js.map} +0 -0
- /package/dist/{workflow-cache-GXNE6SU2.js.map → workflow-cache-XVEZ36KF.js.map} +0 -0
- /package/dist/{workflow-debug-PRX3DWGD.js.map → workflow-debug-T2BULXZ7.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getArgValue
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3X3NW7QA.js";
|
|
5
5
|
import {
|
|
6
6
|
formatSemanticSnapshot
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VGYN2KU2.js";
|
|
8
8
|
|
|
9
9
|
// src/trace.ts
|
|
10
10
|
import fs from "fs";
|
|
@@ -55,7 +55,7 @@ async function runTraceSnapshot(argv) {
|
|
|
55
55
|
process.exit(1);
|
|
56
56
|
}
|
|
57
57
|
const filter = filterArg;
|
|
58
|
-
const { reconstructSnapshots, downloadTrace, cleanupTrace } = await import("./src-
|
|
58
|
+
const { reconstructSnapshots, downloadTrace, cleanupTrace } = await import("./src-PK5OZXCM.js");
|
|
59
59
|
let localPath = tracePath;
|
|
60
60
|
let isTemp = false;
|
|
61
61
|
if (tracePath.startsWith("http://") || tracePath.startsWith("https://")) {
|
|
@@ -175,4 +175,4 @@ function slugify(text) {
|
|
|
175
175
|
export {
|
|
176
176
|
runTrace
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
178
|
+
//# sourceMappingURL=chunk-XJ5YYYGC.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
apiRequest,
|
|
4
4
|
fetchProperties,
|
|
5
5
|
getApplicationArg
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PRBRSIZP.js";
|
|
7
7
|
import {
|
|
8
8
|
apiFetch,
|
|
9
9
|
exitOnFailure
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
getArgValue,
|
|
13
13
|
hasFlag,
|
|
14
14
|
resolveConfig
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-3X3NW7QA.js";
|
|
16
|
+
import "./chunk-JMJVGMXI.js";
|
|
17
17
|
import "./chunk-JWHYXEA2.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-JYGNMKZ5.js";
|
|
19
19
|
import "./chunk-VKVL7WBN.js";
|
|
20
20
|
|
|
21
21
|
// src/credential.ts
|
|
@@ -451,4 +451,4 @@ async function runCredential(argv) {
|
|
|
451
451
|
export {
|
|
452
452
|
runCredential
|
|
453
453
|
};
|
|
454
|
-
//# sourceMappingURL=credential-
|
|
454
|
+
//# sourceMappingURL=credential-E6KUHRGU.js.map
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
apiRequest,
|
|
4
4
|
fetchProperties,
|
|
5
5
|
getApplicationArg
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PRBRSIZP.js";
|
|
7
7
|
import "./chunk-3CZU7XCS.js";
|
|
8
8
|
import {
|
|
9
9
|
getArgValue,
|
|
10
10
|
hasFlag,
|
|
11
11
|
resolveConfig
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-3X3NW7QA.js";
|
|
13
|
+
import "./chunk-JMJVGMXI.js";
|
|
14
14
|
import "./chunk-JWHYXEA2.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-JYGNMKZ5.js";
|
|
16
16
|
import "./chunk-VKVL7WBN.js";
|
|
17
17
|
|
|
18
18
|
// src/credential-template.ts
|
|
@@ -290,4 +290,4 @@ async function runCredentialTemplate(argv) {
|
|
|
290
290
|
export {
|
|
291
291
|
runCredentialTemplate
|
|
292
292
|
};
|
|
293
|
-
//# sourceMappingURL=credential-template-
|
|
293
|
+
//# sourceMappingURL=credential-template-4GPOPBGD.js.map
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
} from "./chunk-J6SH7GQT.js";
|
|
8
8
|
import {
|
|
9
9
|
downloadStorageState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PRBRSIZP.js";
|
|
11
11
|
import "./chunk-3CZU7XCS.js";
|
|
12
12
|
import {
|
|
13
13
|
getArgValue,
|
|
14
14
|
hasFlag,
|
|
15
15
|
resolveConfig
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-3X3NW7QA.js";
|
|
17
|
+
import "./chunk-JMJVGMXI.js";
|
|
18
18
|
import "./chunk-JWHYXEA2.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-JYGNMKZ5.js";
|
|
20
20
|
import "./chunk-VKVL7WBN.js";
|
|
21
21
|
|
|
22
22
|
// src/debug-workflow.ts
|
|
@@ -257,4 +257,4 @@ async function runDebugWorkflow(argv) {
|
|
|
257
257
|
export {
|
|
258
258
|
runDebugWorkflow
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=debug-workflow-
|
|
260
|
+
//# sourceMappingURL=debug-workflow-XCLCY6S7.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
apiRequest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PRBRSIZP.js";
|
|
5
5
|
import "./chunk-3CZU7XCS.js";
|
|
6
6
|
import {
|
|
7
7
|
getArgValue,
|
|
8
8
|
hasFlag,
|
|
9
9
|
resolveConfig
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-3X3NW7QA.js";
|
|
11
|
+
import "./chunk-JMJVGMXI.js";
|
|
12
12
|
import {
|
|
13
13
|
getSubDir
|
|
14
14
|
} from "./chunk-JWHYXEA2.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-JYGNMKZ5.js";
|
|
16
16
|
import "./chunk-VKVL7WBN.js";
|
|
17
17
|
|
|
18
18
|
// src/docs.ts
|
|
@@ -25,9 +25,9 @@ function parseNavFields(argv) {
|
|
|
25
25
|
const section = getArgValue(argv, "--section");
|
|
26
26
|
const group = getArgValue(argv, "--group");
|
|
27
27
|
const order = getArgValue(argv, "--order");
|
|
28
|
-
if (section
|
|
29
|
-
if (group
|
|
30
|
-
if (order
|
|
28
|
+
if (section !== null && section !== void 0) out.navSection = section;
|
|
29
|
+
if (group !== null && group !== void 0) out.navGroup = group;
|
|
30
|
+
if (order !== null && order !== void 0) {
|
|
31
31
|
const n = Number.parseInt(order, 10);
|
|
32
32
|
if (Number.isNaN(n)) {
|
|
33
33
|
console.error("Error: --order must be an integer.");
|
|
@@ -289,6 +289,83 @@ async function handleDelete(argv, apiUrl, token, orgMode) {
|
|
|
289
289
|
}
|
|
290
290
|
console.log(`Deleted page: ${slug}`);
|
|
291
291
|
}
|
|
292
|
+
async function handleNav(argv, apiUrl, token) {
|
|
293
|
+
const [action, ...rest] = argv;
|
|
294
|
+
switch (action) {
|
|
295
|
+
case void 0:
|
|
296
|
+
case "list": {
|
|
297
|
+
const result = await apiRequest(
|
|
298
|
+
apiUrl,
|
|
299
|
+
token,
|
|
300
|
+
"GET",
|
|
301
|
+
"/public/docs/nav"
|
|
302
|
+
);
|
|
303
|
+
const groups = result.data?.groups ?? [];
|
|
304
|
+
if (hasFlag(rest, "--json")) {
|
|
305
|
+
console.log(JSON.stringify(groups, null, 2));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (groups.length === 0) {
|
|
309
|
+
console.log("No sidebar groups found.");
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const keyWidth = Math.max(3, ...groups.map((g) => g.key.length));
|
|
313
|
+
const titleWidth = Math.max(5, ...groups.map((g) => g.title.length));
|
|
314
|
+
console.log(`| ${"Key".padEnd(keyWidth)} | ${"Title".padEnd(titleWidth)} | Order |`);
|
|
315
|
+
console.log(`| ${"-".repeat(keyWidth)} | ${"-".repeat(titleWidth)} | ----- |`);
|
|
316
|
+
for (const g of groups) {
|
|
317
|
+
console.log(`| ${g.key.padEnd(keyWidth)} | ${g.title.padEnd(titleWidth)} | ${String(g.sortOrder).padEnd(5)} |`);
|
|
318
|
+
}
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
case "set": {
|
|
322
|
+
const key = rest[0];
|
|
323
|
+
if (!key || key.startsWith("--")) {
|
|
324
|
+
console.error("Usage: canary docs nav set <key> [--title <text>] [--order <n>]");
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
const title = getArgValue(rest, "--title");
|
|
328
|
+
const orderRaw = getArgValue(rest, "--order");
|
|
329
|
+
const body = {};
|
|
330
|
+
if (title !== null && title !== void 0) body.title = title;
|
|
331
|
+
if (orderRaw !== null && orderRaw !== void 0) {
|
|
332
|
+
const n = Number.parseInt(orderRaw, 10);
|
|
333
|
+
if (Number.isNaN(n)) {
|
|
334
|
+
console.error("Error: --order must be an integer.");
|
|
335
|
+
process.exit(1);
|
|
336
|
+
}
|
|
337
|
+
body.sortOrder = n;
|
|
338
|
+
}
|
|
339
|
+
await apiRequest(apiUrl, token, "PUT", `/superadmin/docs/nav?key=${encodeURIComponent(key)}`, body);
|
|
340
|
+
console.log(`Updated sidebar group: ${key}`);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
case "reorder": {
|
|
344
|
+
const keys = rest.filter((a) => !a.startsWith("--"));
|
|
345
|
+
if (keys.length === 0) {
|
|
346
|
+
console.error("Usage: canary docs nav reorder <key1> <key2> ...");
|
|
347
|
+
process.exit(1);
|
|
348
|
+
}
|
|
349
|
+
await apiRequest(apiUrl, token, "PUT", "/superadmin/docs/nav/reorder", { keys });
|
|
350
|
+
console.log(`Reordered ${keys.length} sidebar groups.`);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
case "delete": {
|
|
354
|
+
const key = rest[0];
|
|
355
|
+
if (!key || key.startsWith("--")) {
|
|
356
|
+
console.error("Usage: canary docs nav delete <key>");
|
|
357
|
+
process.exit(1);
|
|
358
|
+
}
|
|
359
|
+
await apiRequest(apiUrl, token, "DELETE", `/superadmin/docs/nav?key=${encodeURIComponent(key)}`);
|
|
360
|
+
console.log(`Deleted sidebar group: ${key}`);
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
default:
|
|
364
|
+
console.error(`Unknown nav action: ${action}`);
|
|
365
|
+
console.error("Actions: list, set <key>, reorder <keys...>, delete <key>");
|
|
366
|
+
process.exit(1);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
292
369
|
function printDocsHelp() {
|
|
293
370
|
console.log(
|
|
294
371
|
[
|
|
@@ -303,15 +380,19 @@ function printDocsHelp() {
|
|
|
303
380
|
" history <slug> Show version history",
|
|
304
381
|
" create <slug> --file <path> --title ... Create new page",
|
|
305
382
|
" delete <slug> Soft-delete a page",
|
|
383
|
+
" nav list [--json] List sidebar groups + order",
|
|
384
|
+
" nav set <key> [--title <t>] [--order n] Create or update a sidebar group",
|
|
385
|
+
" nav reorder <key1> <key2> ... Set sidebar group order",
|
|
386
|
+
" nav delete <key> Remove a sidebar group",
|
|
306
387
|
"",
|
|
307
388
|
"Options:",
|
|
308
389
|
" --org Use org-scoped endpoints (requires auth)",
|
|
309
390
|
" --file <path> Path to markdown file",
|
|
310
391
|
" --title <text> Page title (create only)",
|
|
311
392
|
" --description <text> Page description (create only)",
|
|
312
|
-
" --
|
|
313
|
-
" --
|
|
314
|
-
" --
|
|
393
|
+
" --group <key> Sidebar group key the page belongs to (see `nav list`; create/push)",
|
|
394
|
+
" --order <n> Sort order within the group (create/push)",
|
|
395
|
+
" --section <text> Deprecated; sidebar grouping is driven by --group now",
|
|
315
396
|
" --message <text> Version commit message",
|
|
316
397
|
" --limit <n> Max results for search (default: 8, max: 20)",
|
|
317
398
|
" --output <path> Output path for pull (default: <tmpdir>/canary/docs/<slug>.md)",
|
|
@@ -355,6 +436,9 @@ async function runDocs(argv) {
|
|
|
355
436
|
case "delete":
|
|
356
437
|
await handleDelete(rest, apiUrl, token, orgMode);
|
|
357
438
|
break;
|
|
439
|
+
case "nav":
|
|
440
|
+
await handleNav(rest, apiUrl, token);
|
|
441
|
+
break;
|
|
358
442
|
default:
|
|
359
443
|
console.error(`Unknown sub-command: ${subCommand}`);
|
|
360
444
|
printDocsHelp();
|
|
@@ -364,4 +448,4 @@ async function runDocs(argv) {
|
|
|
364
448
|
export {
|
|
365
449
|
runDocs
|
|
366
450
|
};
|
|
367
|
-
//# sourceMappingURL=docs-
|
|
451
|
+
//# sourceMappingURL=docs-COCZYMW6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docs.ts"],"sourcesContent":["/**\n * CLI Documentation Management\n *\n * Allows agents and superadmins to list, pull, edit, and push documentation pages.\n * Supports both global (public/superadmin) and org-scoped (--org) modes.\n */\n\nimport { readFile, writeFile, mkdir } from 'node:fs/promises';\nimport path from 'node:path';\nimport { getSubDir } from '@chatsdet/tmp';\nimport process from 'node:process';\nimport { resolveConfig, getArgValue, hasFlag } from './auth.js';\nimport { apiRequest } from './cli-helpers.js';\n\ntype DocsPageListItem = {\n slug: string;\n title: string;\n description: string | null;\n updatedAt: string;\n publishedBy: string | null;\n};\n\ntype DocsVersionItem = {\n version: number;\n title: string;\n checksum: string;\n message: string | null;\n createdBy: string;\n createdAt: string;\n};\n\ntype DocsApiResponse = {\n ok: boolean;\n error?: string;\n data?: {\n slug?: string;\n title?: string;\n pages?: DocsPageListItem[];\n content?: string;\n versions?: DocsVersionItem[];\n };\n};\n\nconst DEFAULT_PULL_DIR = getSubDir('docs');\n\n/**\n * Parse the optional data-driven sidebar-placement flags. Only present flags\n * are included, so `push`/`create` without them leaves existing values intact.\n */\nfunction parseNavFields(argv: string[]): {\n navSection?: string;\n navGroup?: string;\n navOrder?: number;\n} {\n const out: { navSection?: string; navGroup?: string; navOrder?: number } = {};\n const section = getArgValue(argv, '--section');\n const group = getArgValue(argv, '--group');\n const order = getArgValue(argv, '--order');\n if (section !== null && section !== undefined) out.navSection = section;\n if (group !== null && group !== undefined) out.navGroup = group;\n if (order !== null && order !== undefined) {\n const n = Number.parseInt(order, 10);\n if (Number.isNaN(n)) {\n console.error('Error: --order must be an integer.');\n process.exit(1);\n }\n out.navOrder = n;\n }\n return out;\n}\n\n/** Return the base path prefix for read endpoints based on --org flag */\nfunction readPrefix(orgMode: boolean): string {\n return orgMode ? '/docs' : '/public/docs';\n}\n\n/** Return the base path prefix for write endpoints based on --org flag */\nfunction writePrefix(orgMode: boolean): string {\n return orgMode ? '/docs' : '/superadmin/docs';\n}\n\nasync function handleList(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const jsonOutput = hasFlag(argv, '--json');\n const result = await apiRequest<DocsApiResponse>(apiUrl, token, 'GET', `${readPrefix(orgMode)}/pages`);\n const pages: DocsPageListItem[] = result.data?.pages ?? [];\n\n if (jsonOutput) {\n console.log(JSON.stringify(pages, null, 2));\n return;\n }\n\n if (pages.length === 0) {\n console.log('No documentation pages found.');\n return;\n }\n\n // Default: markdown table for easy consumption by agents and humans\n const slugWidth = Math.max(4, ...pages.map((p) => p.slug.length));\n const titleWidth = Math.max(5, ...pages.map((p) => p.title.length));\n const header = `| ${'Slug'.padEnd(slugWidth)} | ${'Title'.padEnd(titleWidth)} | Updated | Published By |`;\n const sep = `| ${'-'.repeat(slugWidth)} | ${'-'.repeat(titleWidth)} | ---------- | ------------ |`;\n console.log(header);\n console.log(sep);\n for (const page of pages) {\n const date = new Date(page.updatedAt).toISOString().slice(0, 10);\n const by = page.publishedBy ?? '';\n console.log(`| ${page.slug.padEnd(slugWidth)} | ${page.title.padEnd(titleWidth)} | ${date} | ${by.padEnd(12)} |`);\n }\n}\n\nasync function fetchDocContent(slug: string, apiUrl: string, token: string, orgMode: boolean): Promise<string> {\n if (orgMode) {\n const result = await apiRequest<DocsApiResponse>(\n apiUrl,\n token,\n 'GET',\n `/docs/pages/content?slug=${encodeURIComponent(slug)}`\n );\n if (!result.ok) {\n console.error(`Error: ${result.error}`);\n process.exit(1);\n }\n return result.data?.content ?? '';\n }\n\n const res = await fetch(`${apiUrl}/public/docs/pages/raw?slug=${encodeURIComponent(slug)}`, {\n headers: { Authorization: `Bearer ${token}` },\n });\n\n if (res.status === 404) {\n console.error(`Error: Page not found: ${slug}`);\n process.exit(1);\n }\n\n if (!res.ok) {\n console.error(`Error: ${res.statusText}`);\n process.exit(1);\n }\n\n return res.text();\n}\n\nasync function handleGet(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs get <slug>');\n process.exit(1);\n }\n\n const content = await fetchDocContent(slug, apiUrl, token, orgMode);\n console.log(content);\n}\n\nasync function handlePull(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs pull <slug> [--output <path>]');\n process.exit(1);\n }\n\n const outputPath = getArgValue(argv, '--output') ?? path.join(DEFAULT_PULL_DIR, `${slug}.md`);\n const content = await fetchDocContent(slug, apiUrl, token, orgMode);\n\n await mkdir(path.dirname(outputPath), { recursive: true });\n await writeFile(outputPath, content, 'utf8');\n console.log(`Pulled ${slug} → ${outputPath}`);\n}\n\nasync function handlePush(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs push <slug> --file <path> [--message <text>]');\n process.exit(1);\n }\n\n const filePath = getArgValue(argv, '--file');\n if (!filePath) {\n console.error('Error: Missing --file <path>.');\n process.exit(1);\n }\n\n const message = getArgValue(argv, '--message') ?? undefined;\n const createdBy = getArgValue(argv, '--created-by') ?? undefined;\n\n let content: string;\n try {\n content = await readFile(filePath, 'utf8');\n } catch {\n console.error(`Error: Could not read file: ${filePath}`);\n process.exit(1);\n }\n\n // Strip `export const meta = { ... };` block so raw JS isn't stored as doc content\n content = content.replace(/^\\s*export\\s+const\\s+meta\\s*=\\s*\\{[^}]*\\};\\s*/, '');\n\n const result = await apiRequest<DocsApiResponse>(\n apiUrl,\n token,\n 'PUT',\n `${writePrefix(orgMode)}/pages?slug=${encodeURIComponent(slug)}`,\n { content, message, createdBy, ...parseNavFields(argv) }\n );\n\n if (!result.ok) {\n console.error(`Error: ${result.error}`);\n process.exit(1);\n }\n\n console.log(`Published new version of ${slug}`);\n}\n\nasync function handleHistory(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs history <slug>');\n process.exit(1);\n }\n\n const jsonOutput = hasFlag(argv, '--json');\n\n const res = await fetch(`${apiUrl}${readPrefix(orgMode)}/pages/versions?slug=${encodeURIComponent(slug)}`, {\n headers: { Authorization: `Bearer ${token}` },\n });\n\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.error(`Error: ${(body as { error?: string }).error ?? res.statusText}`);\n process.exit(1);\n }\n\n const body = (await res.json()) as DocsApiResponse;\n const versions = body.data?.versions ?? [];\n\n if (jsonOutput) {\n console.log(JSON.stringify(versions, null, 2));\n return;\n }\n\n if (versions.length === 0) {\n console.log(`No versions found for ${slug}.`);\n return;\n }\n\n for (const v of versions) {\n const date = new Date(v.createdAt).toISOString().slice(0, 19).replace('T', ' ');\n const msg = v.message ? ` — ${v.message}` : '';\n console.log(` v${v.version} ${date} ${v.createdBy}${msg}`);\n }\n}\n\nasync function handleCreate(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs create <slug> --file <path> --title <text>');\n process.exit(1);\n }\n\n const filePath = getArgValue(argv, '--file');\n const title = getArgValue(argv, '--title');\n\n if (!filePath) {\n console.error('Error: Missing --file <path>.');\n process.exit(1);\n }\n if (!title) {\n console.error('Error: Missing --title <text>.');\n process.exit(1);\n }\n\n const description = getArgValue(argv, '--description') ?? undefined;\n const message = getArgValue(argv, '--message') ?? undefined;\n\n let content: string;\n try {\n content = await readFile(filePath, 'utf8');\n } catch {\n console.error(`Error: Could not read file: ${filePath}`);\n process.exit(1);\n }\n\n // Strip `export const meta = { ... };` block so raw JS isn't stored as doc content\n content = content.replace(/^\\s*export\\s+const\\s+meta\\s*=\\s*\\{[^}]*\\};\\s*/, '');\n\n const result = await apiRequest<DocsApiResponse>(\n apiUrl,\n token,\n 'POST',\n `${writePrefix(orgMode)}/pages`,\n {\n slug,\n title,\n description,\n content,\n message,\n ...parseNavFields(argv),\n }\n );\n\n if (!result.ok) {\n console.error(`Error: ${result.error}`);\n process.exit(1);\n }\n\n console.log(`Created page: ${slug}`);\n}\n\ntype DocsSearchResult = {\n path: string;\n title: string;\n description: string | null;\n excerpt: string;\n};\n\ntype DocsSearchResponse = {\n ok: boolean;\n error?: string;\n data?: { results: DocsSearchResult[] };\n};\n\nasync function handleSearch(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const query = argv.filter((a) => !a.startsWith('--')).join(' ').trim();\n if (!query) {\n console.error('Error: Missing search query.');\n console.error('Usage: canary docs search <query> [--limit <n>] [--json]');\n process.exit(1);\n }\n\n const jsonOutput = hasFlag(argv, '--json');\n const limitArg = getArgValue(argv, '--limit');\n const params = new URLSearchParams({ q: query });\n if (limitArg) params.set('limit', limitArg);\n\n const searchPath = orgMode ? '/docs/search' : '/public/docs/search';\n const res = await fetch(`${apiUrl}${searchPath}?${params.toString()}`, {\n headers: { Authorization: `Bearer ${token}` },\n });\n\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: res.statusText }));\n console.error(`Error: ${(body as { error?: string }).error ?? res.statusText}`);\n process.exit(1);\n }\n\n const body = (await res.json()) as DocsSearchResponse;\n const results = body.data?.results ?? [];\n\n if (jsonOutput) {\n console.log(JSON.stringify(results, null, 2));\n return;\n }\n\n if (results.length === 0) {\n console.log('No results found.');\n return;\n }\n\n for (const r of results) {\n const desc = r.description ? ` ${r.description}` : '';\n const excerpt = r.excerpt\n ? ` ${r.excerpt.replace(/<\\/?mark>/g, '').replace(/\\n/g, ' ').slice(0, 120)}`\n : '';\n console.log(` ${r.path ?? r.title}`);\n if (r.title) console.log(` ${r.title}${desc}`);\n if (excerpt) console.log(` ${excerpt}`);\n console.log();\n }\n}\n\nasync function handleDelete(argv: string[], apiUrl: string, token: string, orgMode: boolean): Promise<void> {\n const slug = argv[0];\n if (!slug || slug.startsWith('--')) {\n console.error('Error: Missing slug.');\n console.error('Usage: canary docs delete <slug>');\n process.exit(1);\n }\n\n const result = await apiRequest<DocsApiResponse>(\n apiUrl,\n token,\n 'DELETE',\n `${writePrefix(orgMode)}/pages?slug=${encodeURIComponent(slug)}`\n );\n\n if (!result.ok) {\n console.error(`Error: ${result.error}`);\n process.exit(1);\n }\n\n console.log(`Deleted page: ${slug}`);\n}\n\ntype DocsNavGroup = { key: string; title: string; sortOrder: number };\n\nasync function handleNav(argv: string[], apiUrl: string, token: string): Promise<void> {\n const [action, ...rest] = argv;\n\n switch (action) {\n case undefined:\n case 'list': {\n const result = await apiRequest<{ ok: boolean; data?: { groups: DocsNavGroup[] }; error?: string }>(\n apiUrl,\n token,\n 'GET',\n '/public/docs/nav'\n );\n const groups = result.data?.groups ?? [];\n if (hasFlag(rest, '--json')) {\n console.log(JSON.stringify(groups, null, 2));\n return;\n }\n if (groups.length === 0) {\n console.log('No sidebar groups found.');\n return;\n }\n const keyWidth = Math.max(3, ...groups.map((g) => g.key.length));\n const titleWidth = Math.max(5, ...groups.map((g) => g.title.length));\n console.log(`| ${'Key'.padEnd(keyWidth)} | ${'Title'.padEnd(titleWidth)} | Order |`);\n console.log(`| ${'-'.repeat(keyWidth)} | ${'-'.repeat(titleWidth)} | ----- |`);\n for (const g of groups) {\n console.log(`| ${g.key.padEnd(keyWidth)} | ${g.title.padEnd(titleWidth)} | ${String(g.sortOrder).padEnd(5)} |`);\n }\n return;\n }\n case 'set': {\n const key = rest[0];\n if (!key || key.startsWith('--')) {\n console.error('Usage: canary docs nav set <key> [--title <text>] [--order <n>]');\n process.exit(1);\n }\n const title = getArgValue(rest, '--title');\n const orderRaw = getArgValue(rest, '--order');\n const body: Record<string, unknown> = {};\n if (title !== null && title !== undefined) body.title = title;\n if (orderRaw !== null && orderRaw !== undefined) {\n const n = Number.parseInt(orderRaw, 10);\n if (Number.isNaN(n)) {\n console.error('Error: --order must be an integer.');\n process.exit(1);\n }\n body.sortOrder = n;\n }\n await apiRequest(apiUrl, token, 'PUT', `/superadmin/docs/nav?key=${encodeURIComponent(key)}`, body);\n console.log(`Updated sidebar group: ${key}`);\n return;\n }\n case 'reorder': {\n const keys = rest.filter((a) => !a.startsWith('--'));\n if (keys.length === 0) {\n console.error('Usage: canary docs nav reorder <key1> <key2> ...');\n process.exit(1);\n }\n await apiRequest(apiUrl, token, 'PUT', '/superadmin/docs/nav/reorder', { keys });\n console.log(`Reordered ${keys.length} sidebar groups.`);\n return;\n }\n case 'delete': {\n const key = rest[0];\n if (!key || key.startsWith('--')) {\n console.error('Usage: canary docs nav delete <key>');\n process.exit(1);\n }\n await apiRequest(apiUrl, token, 'DELETE', `/superadmin/docs/nav?key=${encodeURIComponent(key)}`);\n console.log(`Deleted sidebar group: ${key}`);\n return;\n }\n default:\n console.error(`Unknown nav action: ${action}`);\n console.error('Actions: list, set <key>, reorder <keys...>, delete <key>');\n process.exit(1);\n }\n}\n\nfunction printDocsHelp(): void {\n console.log(\n [\n 'Usage: canary docs <sub-command> [options]',\n '',\n 'Sub-commands:',\n ' list List all doc pages',\n ' get <slug> Print content to stdout',\n ' search <query> Full-text search docs',\n ' pull <slug> [--output <path>] Download to local file',\n ' push <slug> --file <path> [--message] Publish new version',\n ' history <slug> Show version history',\n ' create <slug> --file <path> --title ... Create new page',\n ' delete <slug> Soft-delete a page',\n ' nav list [--json] List sidebar groups + order',\n ' nav set <key> [--title <t>] [--order n] Create or update a sidebar group',\n ' nav reorder <key1> <key2> ... Set sidebar group order',\n ' nav delete <key> Remove a sidebar group',\n '',\n 'Options:',\n ' --org Use org-scoped endpoints (requires auth)',\n ' --file <path> Path to markdown file',\n ' --title <text> Page title (create only)',\n ' --description <text> Page description (create only)',\n ' --group <key> Sidebar group key the page belongs to (see `nav list`; create/push)',\n ' --order <n> Sort order within the group (create/push)',\n ' --section <text> Deprecated; sidebar grouping is driven by --group now',\n ' --message <text> Version commit message',\n ' --limit <n> Max results for search (default: 8, max: 20)',\n ' --output <path> Output path for pull (default: <tmpdir>/canary/docs/<slug>.md)',\n ' --json Output as JSON (list, history, search)',\n ' --env <env> Target environment (prod, dev)',\n ' --api-url <url> API URL override',\n ' --token <key> API token override',\n ].join('\\n')\n );\n}\n\nexport async function runDocs(argv: string[]): Promise<void> {\n const [subCommand, ...rest] = argv;\n\n if (!subCommand || subCommand === 'help' || hasFlag(argv, '--help', '-h')) {\n printDocsHelp();\n return;\n }\n\n const { apiUrl, token } = await resolveConfig(argv);\n const orgMode = hasFlag(rest, '--org');\n\n switch (subCommand) {\n case 'list':\n await handleList(rest, apiUrl, token, orgMode);\n break;\n case 'get':\n await handleGet(rest, apiUrl, token, orgMode);\n break;\n case 'search':\n await handleSearch(rest, apiUrl, token, orgMode);\n break;\n case 'pull':\n await handlePull(rest, apiUrl, token, orgMode);\n break;\n case 'push':\n await handlePush(rest, apiUrl, token, orgMode);\n break;\n case 'history':\n await handleHistory(rest, apiUrl, token, orgMode);\n break;\n case 'create':\n await handleCreate(rest, apiUrl, token, orgMode);\n break;\n case 'delete':\n await handleDelete(rest, apiUrl, token, orgMode);\n break;\n case 'nav':\n await handleNav(rest, apiUrl, token);\n break;\n default:\n console.error(`Unknown sub-command: ${subCommand}`);\n printDocsHelp();\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAOA,SAAS,UAAU,WAAW,aAAa;AAC3C,OAAO,UAAU;AAEjB,OAAO,aAAa;AAiCpB,IAAM,mBAAmB,UAAU,MAAM;AAMzC,SAAS,eAAe,MAItB;AACA,QAAM,MAAqE,CAAC;AAC5E,QAAM,UAAU,YAAY,MAAM,WAAW;AAC7C,QAAM,QAAQ,YAAY,MAAM,SAAS;AACzC,QAAM,QAAQ,YAAY,MAAM,SAAS;AACzC,MAAI,YAAY,QAAQ,YAAY,OAAW,KAAI,aAAa;AAChE,MAAI,UAAU,QAAQ,UAAU,OAAW,KAAI,WAAW;AAC1D,MAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,UAAM,IAAI,OAAO,SAAS,OAAO,EAAE;AACnC,QAAI,OAAO,MAAM,CAAC,GAAG;AACnB,cAAQ,MAAM,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ACzE,kBAAc;AACd;AAAA,EACF;AAEA,QAAM,EAAE,QAAQ,MAAM,IAAI,MAAM,cAAc,IAAI;AAClD,QAAM,UAAU,QAAQ,MAAM,OAAO;AAErC,UAAQ,YAAY;AAAA,IAClB,KAAK;AACH,YAAM,WAAW,MAAM,QAAQ,OAAO,OAAO;AAC7C;AAAA,IACF,KAAK;AACH,YAAM,UAAU,MAAM,QAAQ,OAAO,OAAO;AAC5C;AAAA,IACF,KAAK;AACH,YAAM,aAAa,MAAM,QAAQ,OAAO,OAAO;AAC/C;AAAA,IACF,KAAK;AACH,YAAM,WAAW,MAAM,QAAQ,OAAO,OAAO;AAC7C;AAAA,IACF,KAAK;AACH,YAAM,WAAW,MAAM,QAAQ,OAAO,OAAO;AAC7C;AAAA,IACF,KAAK;AACH,YAAM,cAAc,MAAM,QAAQ,OAAO,OAAO;AAChD;AAAA,IACF,KAAK;AACH,YAAM,aAAa,MAAM,QAAQ,OAAO,OAAO;AAC/C;AAAA,IACF,KAAK;AACH,YAAM,aAAa,MAAM,QAAQ,OAAO,OAAO;AAC/C;AAAA,IACF,KAAK;AACH,YAAM,UAAU,MAAM,QAAQ,KAAK;AACnC;AAAA,IACF;AACE,cAAQ,MAAM,wBAAwB,UAAU,EAAE;AAClD,oBAAc;AACd,cAAQ,KAAK,CAAC;AAAA,EAClB;AACF;","names":["body"]}
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
envToProfile,
|
|
9
9
|
getArgValue,
|
|
10
10
|
readStoredAuth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3X3NW7QA.js";
|
|
12
12
|
import {
|
|
13
13
|
readBrandEnv
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JMJVGMXI.js";
|
|
15
15
|
import "./chunk-VKVL7WBN.js";
|
|
16
16
|
|
|
17
17
|
// src/doctor.ts
|
|
@@ -133,4 +133,4 @@ async function runAuthDoctor(argv) {
|
|
|
133
133
|
export {
|
|
134
134
|
runAuthDoctor
|
|
135
135
|
};
|
|
136
|
-
//# sourceMappingURL=doctor-
|
|
136
|
+
//# sourceMappingURL=doctor-ERIVTCQS.js.map
|
|
@@ -2,16 +2,16 @@ import { createRequire as __cr } from "module"; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
apiRequest,
|
|
4
4
|
fetchProperties
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PRBRSIZP.js";
|
|
6
6
|
import "./chunk-3CZU7XCS.js";
|
|
7
7
|
import {
|
|
8
8
|
getArgValue,
|
|
9
9
|
hasFlag,
|
|
10
10
|
resolveConfig
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-3X3NW7QA.js";
|
|
12
|
+
import "./chunk-JMJVGMXI.js";
|
|
13
13
|
import "./chunk-JWHYXEA2.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-JYGNMKZ5.js";
|
|
15
15
|
import "./chunk-VKVL7WBN.js";
|
|
16
16
|
|
|
17
17
|
// src/environment.ts
|
|
@@ -218,4 +218,4 @@ async function runEnvironment(argv) {
|
|
|
218
218
|
export {
|
|
219
219
|
runEnvironment
|
|
220
220
|
};
|
|
221
|
-
//# sourceMappingURL=environment-
|
|
221
|
+
//# sourceMappingURL=environment-7Y4BV6XY.js.map
|
|
@@ -4,20 +4,41 @@ import {
|
|
|
4
4
|
fetchList,
|
|
5
5
|
parseLifecycleStage,
|
|
6
6
|
toLifecycleLabel
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PRBRSIZP.js";
|
|
8
8
|
import "./chunk-3CZU7XCS.js";
|
|
9
9
|
import {
|
|
10
10
|
getArgValue,
|
|
11
11
|
hasFlag,
|
|
12
12
|
resolveConfig
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-3X3NW7QA.js";
|
|
14
|
+
import "./chunk-JMJVGMXI.js";
|
|
15
15
|
import "./chunk-JWHYXEA2.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-JYGNMKZ5.js";
|
|
17
17
|
import "./chunk-VKVL7WBN.js";
|
|
18
18
|
|
|
19
19
|
// src/feature-flag.ts
|
|
20
20
|
import process from "process";
|
|
21
|
+
import { readFileSync } from "fs";
|
|
22
|
+
function readContent(value) {
|
|
23
|
+
if (value.startsWith("@")) {
|
|
24
|
+
return readFileSync(value.slice(1), "utf8");
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
29
|
+
var DEFAULT_REVIEW_INTERVAL_DAYS = 7;
|
|
30
|
+
var DEFAULT_MAX_WINDOW_DAYS = 30;
|
|
31
|
+
function bakeStatus(flag) {
|
|
32
|
+
if (!flag.bakeStartedAt) return { ageDays: 0, burning: false };
|
|
33
|
+
const startedMs = new Date(flag.bakeStartedAt).getTime();
|
|
34
|
+
const ageMs = Date.now() - startedMs;
|
|
35
|
+
const maxWindow = flag.bakeMaxWindowDays ?? DEFAULT_MAX_WINDOW_DAYS;
|
|
36
|
+
return { ageDays: Math.floor(ageMs / DAY_MS), burning: ageMs > maxWindow * DAY_MS };
|
|
37
|
+
}
|
|
38
|
+
function formatBakeSuffix(flag) {
|
|
39
|
+
const { ageDays, burning } = bakeStatus(flag);
|
|
40
|
+
return ` baked=${ageDays}d${burning ? " \u{1F525}BURNING" : ""}`;
|
|
41
|
+
}
|
|
21
42
|
function fetchFlags(apiUrl, token) {
|
|
22
43
|
return fetchList(apiUrl, token, "/superadmin/feature-flags", "flags");
|
|
23
44
|
}
|
|
@@ -36,10 +57,11 @@ async function handleList(argv, apiUrl, token) {
|
|
|
36
57
|
const orgCount = flag.organizations?.length ?? 0;
|
|
37
58
|
const userCount = flag.users?.length ?? 0;
|
|
38
59
|
const lifecycle = `lifecycle=${toLifecycleLabel(flag.lifecycleStage)}`;
|
|
39
|
-
const finalValue = flag.lifecycleStage === "active" ? "" : ` final=${flag.finalValue === true ? "true" : "false"}`;
|
|
60
|
+
const finalValue = flag.lifecycleStage === "active" || flag.lifecycleStage === "baking" ? "" : ` final=${flag.finalValue === true ? "true" : "false"}`;
|
|
61
|
+
const bake = flag.lifecycleStage === "baking" ? formatBakeSuffix(flag) : "";
|
|
40
62
|
const stale = flag.isStale ? " [STALE]" : "";
|
|
41
63
|
const product = flag.productCardId ? ` product=${flag.productTitle ?? flag.productCardId}` : "";
|
|
42
|
-
console.log(` ${flag.name} ${flag.description ?? ""} (${lifecycle}${finalValue}) [orgs=${orgCount}, users=${userCount}]${product}${stale}`);
|
|
64
|
+
console.log(` ${flag.name} ${flag.description ?? ""} (${lifecycle}${finalValue})${bake} [orgs=${orgCount}, users=${userCount}]${product}${stale}`);
|
|
43
65
|
}
|
|
44
66
|
}
|
|
45
67
|
async function handleCreate(argv, apiUrl, token) {
|
|
@@ -218,20 +240,21 @@ async function handleLifecycle(argv, apiUrl, token) {
|
|
|
218
240
|
const name = argv[0];
|
|
219
241
|
if (!name || name.startsWith("--")) {
|
|
220
242
|
console.error("Error: Missing flag name.");
|
|
221
|
-
console.error(
|
|
243
|
+
console.error('Usage: canary feature-flag lifecycle <name> --stage <active|baking|deprecated|ready_for_cleanup> [--final-value true|false] [--plan @file|"text"] [--review-interval <days>] [--max-window <days>]');
|
|
222
244
|
process.exit(1);
|
|
223
245
|
}
|
|
224
246
|
const stage = parseLifecycleStage(argv);
|
|
225
247
|
const rawFinalValue = getArgValue(argv, "--final-value");
|
|
226
248
|
const clearFinalValue = hasFlag(argv, "--clear-final-value");
|
|
249
|
+
const gateDriven = stage === "active" || stage === "baking";
|
|
227
250
|
if (rawFinalValue !== void 0 && clearFinalValue) {
|
|
228
251
|
console.error("Error: use either --final-value or --clear-final-value, not both.");
|
|
229
252
|
process.exit(1);
|
|
230
253
|
}
|
|
231
254
|
let finalValue = void 0;
|
|
232
|
-
if (
|
|
255
|
+
if (gateDriven) {
|
|
233
256
|
if (rawFinalValue !== void 0) {
|
|
234
|
-
console.error(
|
|
257
|
+
console.error(`Error: ${stage} stage does not accept --final-value.`);
|
|
235
258
|
process.exit(1);
|
|
236
259
|
}
|
|
237
260
|
finalValue = void 0;
|
|
@@ -250,20 +273,74 @@ async function handleLifecycle(argv, apiUrl, token) {
|
|
|
250
273
|
}
|
|
251
274
|
finalValue = rawFinalValue === "true";
|
|
252
275
|
}
|
|
276
|
+
let monitoringPlan;
|
|
277
|
+
let reviewIntervalDays;
|
|
278
|
+
let maxWindowDays;
|
|
279
|
+
if (stage === "baking") {
|
|
280
|
+
const rawPlan = getArgValue(argv, "--plan");
|
|
281
|
+
if (rawPlan !== void 0) monitoringPlan = readContent(rawPlan);
|
|
282
|
+
const rawInterval = getArgValue(argv, "--review-interval");
|
|
283
|
+
if (rawInterval !== void 0) {
|
|
284
|
+
reviewIntervalDays = Number.parseInt(rawInterval, 10);
|
|
285
|
+
if (!Number.isInteger(reviewIntervalDays) || reviewIntervalDays <= 0) {
|
|
286
|
+
console.error("Error: --review-interval must be a positive integer (days).");
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const rawWindow = getArgValue(argv, "--max-window");
|
|
291
|
+
if (rawWindow !== void 0) {
|
|
292
|
+
maxWindowDays = Number.parseInt(rawWindow, 10);
|
|
293
|
+
if (!Number.isInteger(maxWindowDays) || maxWindowDays <= 0) {
|
|
294
|
+
console.error("Error: --max-window must be a positive integer (days).");
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
253
299
|
const result = await apiRequest(
|
|
254
300
|
apiUrl,
|
|
255
301
|
token,
|
|
256
302
|
"POST",
|
|
257
303
|
`/superadmin/feature-flags/${encodeURIComponent(name)}/lifecycle`,
|
|
258
|
-
{ stage, finalValue }
|
|
304
|
+
{ stage, finalValue, monitoringPlan, reviewIntervalDays, maxWindowDays }
|
|
259
305
|
);
|
|
260
306
|
if (!result.ok || !result.flag) {
|
|
261
307
|
console.error(`Error: ${result.error ?? "Failed to update lifecycle"}`);
|
|
262
308
|
process.exit(1);
|
|
263
309
|
}
|
|
310
|
+
if (result.flag.lifecycleStage === "baking") {
|
|
311
|
+
const { ageDays } = bakeStatus(result.flag);
|
|
312
|
+
console.log(
|
|
313
|
+
`Put ${name} in the oven: stage=baking, baked=${ageDays}d, review every ${result.flag.bakeReviewIntervalDays ?? DEFAULT_REVIEW_INTERVAL_DAYS}d, burns after ${result.flag.bakeMaxWindowDays ?? DEFAULT_MAX_WINDOW_DAYS}d.`
|
|
314
|
+
);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
264
317
|
const final = result.flag.lifecycleStage === "active" ? "(none)" : result.flag.finalValue === true ? "true" : "false";
|
|
265
318
|
console.log(`Updated lifecycle for ${name}: stage=${toLifecycleLabel(result.flag.lifecycleStage)}, final=${final}`);
|
|
266
319
|
}
|
|
320
|
+
async function handleOven(argv, apiUrl, token) {
|
|
321
|
+
const jsonOutput = hasFlag(argv, "--json");
|
|
322
|
+
const flags = await fetchList(apiUrl, token, "/superadmin/feature-flags/oven", "flags");
|
|
323
|
+
if (jsonOutput) {
|
|
324
|
+
console.log(JSON.stringify(flags, null, 2));
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (flags.length === 0) {
|
|
328
|
+
console.log("The oven is empty \u2014 no flags are baking.");
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
console.log(`In the oven (${flags.length}):`);
|
|
332
|
+
for (const flag of flags) {
|
|
333
|
+
const burn = flag.burning ? " \u{1F525}BURNING" : "";
|
|
334
|
+
const product = flag.productCardId ? ` product=${flag.productTitle ?? flag.productCardId}` : "";
|
|
335
|
+
console.log(
|
|
336
|
+
` ${flag.name} baked=${flag.bakeAgeDays}d (review ${flag.bakeReviewIntervalDays}d / burns ${flag.bakeMaxWindowDays}d)${burn}${product}`
|
|
337
|
+
);
|
|
338
|
+
if (flag.bakeMonitoringPlan) {
|
|
339
|
+
const firstLine = flag.bakeMonitoringPlan.split("\n")[0]?.slice(0, 100) ?? "";
|
|
340
|
+
console.log(` plan: ${firstLine}`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
267
344
|
function printFeatureFlagHelp() {
|
|
268
345
|
console.log(
|
|
269
346
|
[
|
|
@@ -280,11 +357,14 @@ function printFeatureFlagHelp() {
|
|
|
280
357
|
" Disable a flag for an org or user (kept as 'was enabled' history)",
|
|
281
358
|
" lifecycle <name> --stage <stage> [--final-value true|false]",
|
|
282
359
|
" Mark lifecycle + final value",
|
|
360
|
+
" --stage baking --plan @file [--review-interval <days>] [--max-window <days>]",
|
|
361
|
+
" Put a flag in the oven (requires a linked product card)",
|
|
283
362
|
" product <name> (--product <productCardId> | --clear)",
|
|
284
363
|
" Link/unlink a flag to a product board item",
|
|
285
364
|
" products [--search <text>] List product board items (find product card ids)",
|
|
365
|
+
" oven [--json] List flags currently baking (age + burning state)",
|
|
286
366
|
"",
|
|
287
|
-
"Stages: active, deprecated, ready_for_cleanup",
|
|
367
|
+
"Stages: active, baking, deprecated, ready_for_cleanup",
|
|
288
368
|
"",
|
|
289
369
|
"Options:",
|
|
290
370
|
" --org <orgId> Target organization",
|
|
@@ -294,6 +374,9 @@ function printFeatureFlagHelp() {
|
|
|
294
374
|
" --search <text> Filter product cards by title (products sub-command only)",
|
|
295
375
|
" --final-value <true|false> Final value for deprecated/ready_for_cleanup",
|
|
296
376
|
" --clear-final-value Clear final value (only valid with --stage active)",
|
|
377
|
+
' --plan @file|"text" Monitoring/telemetry plan (required to enter baking)',
|
|
378
|
+
" --review-interval <days> Days between oven-check reviews (baking; default 7)",
|
|
379
|
+
" --max-window <days> Days before a baking flag 'burns' (default 30)",
|
|
297
380
|
" --env <env> Target environment (prod, dev, local)",
|
|
298
381
|
" --json Output as JSON (list only)",
|
|
299
382
|
" --api-url <url> API URL override (takes precedence over --env)",
|
|
@@ -333,6 +416,9 @@ async function runFeatureFlag(argv) {
|
|
|
333
416
|
case "products":
|
|
334
417
|
await handleProducts(rest, apiUrl, token);
|
|
335
418
|
break;
|
|
419
|
+
case "oven":
|
|
420
|
+
await handleOven(rest, apiUrl, token);
|
|
421
|
+
break;
|
|
336
422
|
default:
|
|
337
423
|
console.error(`Unknown sub-command: ${subCommand}`);
|
|
338
424
|
printFeatureFlagHelp();
|
|
@@ -342,4 +428,4 @@ async function runFeatureFlag(argv) {
|
|
|
342
428
|
export {
|
|
343
429
|
runFeatureFlag
|
|
344
430
|
};
|
|
345
|
-
//# sourceMappingURL=feature-flag-
|
|
431
|
+
//# sourceMappingURL=feature-flag-MHONEX6T.js.map
|