@outerlayer/cli 0.2.0 → 0.4.1

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/README.md +229 -60
  3. package/dist/agent-setup-IFH3FB5X.js +197 -0
  4. package/dist/build-TZUUTRGH.js +9 -0
  5. package/dist/build-info.json +1 -1
  6. package/dist/check-7MFH6HNC.js +94 -0
  7. package/dist/chunk-3TFPDVTI.js +94 -0
  8. package/dist/{chunk-4TNZMO7V.js → chunk-4C4THABW.js} +5566 -754
  9. package/dist/{chunk-R5KBGVII.js → chunk-5QRP3MVS.js} +30 -14
  10. package/dist/chunk-5Y3QQRUH.js +300 -0
  11. package/dist/chunk-774HEQL6.js +178 -0
  12. package/dist/{work-pr-cmd-AZQPWH4H.js → chunk-7WERLFVR.js} +9 -26
  13. package/dist/chunk-ABIWDUMS.js +104 -0
  14. package/dist/chunk-AUFG23AA.js +534 -0
  15. package/dist/chunk-B2G7JHHB.js +42 -0
  16. package/dist/chunk-BCJNHMZT.js +34 -0
  17. package/dist/chunk-BCLJSQCV.js +56 -0
  18. package/dist/chunk-BFESLKPP.js +61 -0
  19. package/dist/chunk-BJ3KTMDH.js +63 -0
  20. package/dist/chunk-BKO6JEZI.js +47 -0
  21. package/dist/chunk-BOLTI6LR.js +37 -0
  22. package/dist/chunk-CBPPJSAR.js +89 -0
  23. package/dist/chunk-DM3VFDS3.js +1461 -0
  24. package/dist/{chunk-65WXAANR.js → chunk-DVDEBNQJ.js} +17 -2
  25. package/dist/{chunk-TFUIDMOB.js → chunk-EABW6AJQ.js} +12 -1
  26. package/dist/{chunk-KFYJV2ZG.js → chunk-EMY4I27X.js} +1 -1
  27. package/dist/{chunk-NTTPJV35.js → chunk-F47JBIAW.js} +3 -1
  28. package/dist/chunk-F6GFZXZ3.js +60 -0
  29. package/dist/{chunk-YOOSBOKS.js → chunk-F7CU5ABH.js} +1 -1
  30. package/dist/{emit-cmd-TWSYYEZI.js → chunk-H5NCNVDA.js} +68 -17
  31. package/dist/chunk-HZRNMGLF.js +2233 -0
  32. package/dist/chunk-LF6MLJCY.js +38 -0
  33. package/dist/{chunk-U32VSRLO.js → chunk-LT5TZHYH.js} +95 -634
  34. package/dist/chunk-LYCDNMOH.js +83 -0
  35. package/dist/chunk-M5POMKKW.js +1051 -0
  36. package/dist/{mcp-install-cmd-FDQH6SEN.js → chunk-MQ3IPHIZ.js} +35 -18
  37. package/dist/{chunk-D77LS3UI.js → chunk-N5FOE5PS.js} +33 -4
  38. package/dist/chunk-N6LURUEF.js +64 -0
  39. package/dist/chunk-OGFGZQA3.js +23 -0
  40. package/dist/chunk-QDQEUVUF.js +9 -0
  41. package/dist/chunk-QOZKPLVJ.js +226 -0
  42. package/dist/chunk-QY22NZUW.js +1764 -0
  43. package/dist/chunk-RA3O54FC.js +30 -0
  44. package/dist/chunk-RFUPN6KX.js +71 -0
  45. package/dist/chunk-SY4GK4SP.js +55 -0
  46. package/dist/chunk-TBT347UY.js +41 -0
  47. package/dist/chunk-TWNWNS2Q.js +1084 -0
  48. package/dist/{chunk-NXLLURA4.js → chunk-UFFXNXLQ.js} +115 -71
  49. package/dist/chunk-USO2DKBD.js +421 -0
  50. package/dist/chunk-W4SQCOZU.js +206 -0
  51. package/dist/{chunk-Q6CL5THG.js → chunk-W5FVUZXV.js} +208 -61
  52. package/dist/chunk-WFJ65NUD.js +383 -0
  53. package/dist/{chunk-A3WLZX2F.js → chunk-WIOZAJ2W.js} +15 -2
  54. package/dist/chunk-WO2BXCTQ.js +83 -0
  55. package/dist/{chunk-I3ETLSNE.js → chunk-XCCLFVXM.js} +120 -11
  56. package/dist/{context-materialize-6WKT3RBQ.js → chunk-XDDW4FRS.js} +134 -26
  57. package/dist/chunk-Y7KJLXYN.js +232 -0
  58. package/dist/chunk-YFHIIH4B.js +102 -0
  59. package/dist/chunk-YYYXRJUW.js +101 -0
  60. package/dist/chunk-ZM2IMMYN.js +76 -0
  61. package/dist/chunk-ZMYPLFG3.js +71 -0
  62. package/dist/chunk-ZNA27WEV.js +470 -0
  63. package/dist/{cli-G7DILYJY.js → cli-W62AFRSW.js} +616 -878
  64. package/dist/{paths-D2VGWWFI.js → cli-build-K56DK4DS.js} +1 -1
  65. package/dist/config-XVJYZ4IQ.js +9 -0
  66. package/dist/connect-cmd-ZTJONP37.js +16 -0
  67. package/dist/context-adopt-UMA4O5NY.js +105 -0
  68. package/dist/context-materialize-G2FUFC72.js +19 -0
  69. package/dist/dist-44CQVWGT.js +6 -0
  70. package/dist/docker-NEGDLU6D.js +7 -0
  71. package/dist/doctor-53F2PYY7.js +43 -0
  72. package/dist/doctor-ZLGZYMDK.js +426 -0
  73. package/dist/{emit-artifact-cmd-UQVT3OKW.js → emit-artifact-cmd-AKZP7TMF.js} +87 -23
  74. package/dist/emit-cmd-DCERAU27.js +9 -0
  75. package/dist/emit-criteria-cmd-7MXQVCKD.js +166 -0
  76. package/dist/{emit-finding-cmd-FDOU2OPD.js → emit-finding-cmd-N2FTGCVC.js} +34 -31
  77. package/dist/{emit-result-cmd-H2T4C2K3.js → emit-result-cmd-4CPDBMN2.js} +34 -62
  78. package/dist/exec-client-4XGXV3XN.js +8 -0
  79. package/dist/guest-init-GENRHNP7.js +8 -0
  80. package/dist/hook-fast-EYENPK6F.js +9 -0
  81. package/dist/{hook-wrap-fast-KXYNX3AD.js → hook-wrap-fast-NPLHJXFK.js} +2 -2
  82. package/dist/host-key-KDYZ5ECC.js +7 -0
  83. package/dist/import-capture-cmd-AVZ4VIVJ.js +68 -0
  84. package/dist/{import-ruler-cmd-7LH2QOMG.js → import-ruler-cmd-GUHL6IY5.js} +1 -1
  85. package/dist/index.js +4 -4
  86. package/dist/init-55Y4LHWF.js +36 -0
  87. package/dist/init-XXEKWZQP.js +221 -0
  88. package/dist/init-cmd-WLST2F7G.js +135 -0
  89. package/dist/install-cmd-7WXOIFDO.js +55 -0
  90. package/dist/lima-XN65D7GN.js +55 -0
  91. package/dist/login-browser-7XGSV7MA.js +10 -0
  92. package/dist/{config-POF7DEQW.js → logout-cmd-QAUFDJ6J.js} +3 -1
  93. package/dist/{logs-TRNPQM42.js → logs-7RYUH5A6.js} +1 -1
  94. package/dist/loop-JFIBP4B7.js +43 -0
  95. package/dist/machine-ZBPT2J3R.js +35 -0
  96. package/dist/mcp-install-cmd-RLK4SO3N.js +9 -0
  97. package/dist/{mcp-serve-cmd-57EZZOTL.js → mcp-serve-cmd-N6UD2KBX.js} +20 -9
  98. package/dist/paths-OYKMVYJP.js +6 -0
  99. package/dist/{pidfile-PTW76F56.js → pidfile-UZRH774M.js} +2 -3
  100. package/dist/real-deps-SU24ZA2K.js +21 -0
  101. package/dist/relay-L76HDX72.js +46 -0
  102. package/dist/settings-J2652U5N.js +7 -0
  103. package/dist/starter-pack-LIZYMKYQ.js +10 -0
  104. package/dist/{status-I27IST4L.js → status-UJXWZRN5.js} +30 -13
  105. package/dist/{statusline-fast-3C5OXHDD.js → statusline-fast-SVTMBMD7.js} +3 -2
  106. package/dist/sync-cmd-4G4A7EVN.js +28 -0
  107. package/dist/version-BWM6VLDI.js +6 -0
  108. package/dist/{watch-3DTPJETH.js → watch-7SKJKGAA.js} +19 -8
  109. package/dist/{work-claim-cmd-5AUNCLS2.js → work-claim-cmd-5F7VZ42N.js} +34 -21
  110. package/dist/work-cmd-QAUZ7MTD.js +17 -0
  111. package/dist/work-comment-cmd-BNCSBTLH.js +106 -0
  112. package/dist/{work-launch-LT663PB3.js → work-launch-YI4CJDAP.js} +1 -1
  113. package/dist/work-open-pr-cmd-VFYZHIIW.js +156 -0
  114. package/dist/work-pr-cmd-PV32ZLSI.js +16 -0
  115. package/package.json +13 -3
  116. package/skill-pack/maintained/amend/SKILL.md +104 -0
  117. package/skill-pack/maintained/emitting-evidence/SKILL.md +108 -0
  118. package/skill-pack/maintained/emitting-evidence/references/agents-snippet.md +20 -0
  119. package/skill-pack/maintained/outerlayer/SKILL.md +55 -0
  120. package/skill-pack/maintained/reporting-findings/SKILL.md +148 -0
  121. package/skill-pack/template/build/SKILL.md +193 -0
  122. package/skill-pack/template/build/references/agent-briefs.md +243 -0
  123. package/skill-pack/template/build/references/criteria-judge.md +91 -0
  124. package/skill-pack/template/build/references/evidence.md +42 -0
  125. package/skill-pack/template/build/references/release.md +74 -0
  126. package/skill-pack/template/build/references/review-briefs.md +275 -0
  127. package/skill-pack/template/build/references/review-loop.md +158 -0
  128. package/skill-pack/template/build/scripts/record-criteria.mjs +235 -0
  129. package/skill-pack/template/spec/SKILL.md +84 -0
  130. package/skill-pack/template/writing-specs/SKILL.md +134 -0
  131. package/dist/chunk-DCNOXRMV.js +0 -589
  132. package/dist/chunk-JJP7YLMN.js +0 -25
  133. package/dist/chunk-OZ7C3XUE.js +0 -34
  134. package/dist/chunk-WQ6VGRGZ.js +0 -150
  135. package/dist/hook-fast-J5LCDHUJ.js +0 -8
  136. package/dist/import-capture-cmd-EUMBGIV3.js +0 -176
  137. package/dist/init-PTBITAUO.js +0 -103
  138. package/dist/login-cmd-IRX6LZT7.js +0 -62
  139. package/dist/loop-ASZRX3CZ.js +0 -648
  140. package/dist/sync-cmd-BBAUZ5JD.js +0 -17
  141. package/dist/work-cmd-2P4BVX47.js +0 -18
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-ZM2IMMYN.js';
4
+ import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
5
+ import { join, basename, sep, resolve } from 'path';
6
+
7
+ createRequire(import.meta.url);
8
+ var PACKAGE_PATH = join("node_modules", "@outerlayer", "cli");
9
+ var STAGING_PREFIX = ".staging-";
10
+ function versionsDir(configPath) {
11
+ return join(runnerDir(configPath), "versions");
12
+ }
13
+ function versionDir(configPath, version) {
14
+ return join(versionsDir(configPath), version);
15
+ }
16
+ function stagingDir(configPath, version) {
17
+ return join(versionsDir(configPath), `${STAGING_PREFIX}${version}`);
18
+ }
19
+ function currentLink(configPath) {
20
+ return join(runnerDir(configPath), "current");
21
+ }
22
+ function markerPath(configPath) {
23
+ return join(runnerDir(configPath), "update-marker.json");
24
+ }
25
+ function packageRootIn(dir) {
26
+ return join(dir, PACKAGE_PATH);
27
+ }
28
+ function entryIn(dir) {
29
+ return join(packageRootIn(dir), "dist", "index.js");
30
+ }
31
+ function currentVersion(configPath) {
32
+ try {
33
+ return basename(readlinkSync(currentLink(configPath)));
34
+ } catch {
35
+ return void 0;
36
+ }
37
+ }
38
+ function isInLayout(configPath, entryPath) {
39
+ try {
40
+ const versions = realpathSync(versionsDir(configPath));
41
+ return realpathSync(entryPath).startsWith(`${versions}${sep}`);
42
+ } catch {
43
+ return false;
44
+ }
45
+ }
46
+ function startedThroughCurrent(configPath, entryPath) {
47
+ const parts = resolve(entryPath).split(sep);
48
+ const at = parts.lastIndexOf("current");
49
+ if (at <= 0 || parts.slice(at + 1).join(sep) !== join(PACKAGE_PATH, "dist", "index.js")) return false;
50
+ try {
51
+ return realpathSync(parts.slice(0, at).join(sep) || sep) === realpathSync(runnerDir(configPath));
52
+ } catch {
53
+ return false;
54
+ }
55
+ }
56
+ function switchCurrent(configPath, version) {
57
+ mkdirSync(runnerDir(configPath), { recursive: true, mode: RUNNER_DIR_MODE });
58
+ const temporary = `${currentLink(configPath)}.new`;
59
+ try {
60
+ unlinkSync(temporary);
61
+ } catch (error) {
62
+ if (error.code !== "ENOENT") throw error;
63
+ }
64
+ symlinkSync(versionDir(configPath, version), temporary);
65
+ renameSync(temporary, currentLink(configPath));
66
+ }
67
+ function readMarker(configPath) {
68
+ try {
69
+ const parsed = JSON.parse(readFileSync(markerPath(configPath), "utf8"));
70
+ if (typeof parsed.from !== "string" || typeof parsed.to !== "string") return void 0;
71
+ return { from: parsed.from, to: parsed.to, starts: typeof parsed.starts === "number" && Number.isInteger(parsed.starts) ? parsed.starts : 0 };
72
+ } catch {
73
+ return void 0;
74
+ }
75
+ }
76
+ function writeMarker(configPath, marker) {
77
+ mkdirSync(runnerDir(configPath), { recursive: true, mode: RUNNER_DIR_MODE });
78
+ const temporary = `${markerPath(configPath)}.tmp`;
79
+ writeFileSync(temporary, `${JSON.stringify(marker)}
80
+ `, { mode: RUNNER_FILE_MODE });
81
+ renameSync(temporary, markerPath(configPath));
82
+ }
83
+ function removeMarker(configPath) {
84
+ rmSync(markerPath(configPath), { force: true });
85
+ }
86
+ function cleanVersions(configPath, keep) {
87
+ const dir = versionsDir(configPath);
88
+ if (!existsSync(dir)) return;
89
+ for (const name of readdirSync(dir)) {
90
+ if (keep.includes(name)) continue;
91
+ rmSync(join(dir, name), { recursive: true, force: true });
92
+ }
93
+ }
94
+ function execStartCommand(configPath, nodePath) {
95
+ return `${nodePath} ${join(currentLink(configPath), "node_modules", "@outerlayer", "cli", "dist", "index.js")} runner start --config ${configPath}`;
96
+ }
97
+ function execStartLine(configPath, nodePath) {
98
+ return `ExecStart=${execStartCommand(configPath, nodePath)}`;
99
+ }
100
+
101
+ export { cleanVersions, currentVersion, entryIn, execStartCommand, execStartLine, isInLayout, packageRootIn, readMarker, removeMarker, stagingDir, startedThroughCurrent, switchCurrent, versionDir, writeMarker };
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { join, dirname } from 'path';
4
+
5
+ createRequire(import.meta.url);
6
+ var RUNNER_DIR_MODE = 448;
7
+ var RUNNER_FILE_MODE = 384;
8
+ function runnerDir(configPath) {
9
+ return join(dirname(configPath), "runner");
10
+ }
11
+ function hostKeyPath(configPath) {
12
+ return join(runnerDir(configPath), "host-key.pem");
13
+ }
14
+ function pidFilePath(configPath) {
15
+ return join(runnerDir(configPath), "runner.pid");
16
+ }
17
+ function jobsDir(configPath) {
18
+ return join(runnerDir(configPath), "jobs");
19
+ }
20
+ function jobDir(configPath, queue, item, claimId, attempt) {
21
+ const suffix = attempt === void 0 ? "" : `-${attempt}`;
22
+ return join(jobsDir(configPath), `${queue}-${item}-${claimId}${suffix}`);
23
+ }
24
+ function attemptStamp(at) {
25
+ return at.toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
26
+ }
27
+ function imagesDir(configPath) {
28
+ return join(runnerDir(configPath), "images");
29
+ }
30
+ function repoCacheDir(configPath, owner, name) {
31
+ return join(runnerDir(configPath), "repos", owner, name);
32
+ }
33
+ function buildsDir(configPath) {
34
+ return join(runnerDir(configPath), "builds");
35
+ }
36
+ function buildDir(configPath, buildId) {
37
+ return join(buildsDir(configPath), buildId);
38
+ }
39
+ function ghConfigDir(buildDirPath) {
40
+ return join(buildDirPath, "gh");
41
+ }
42
+ function mirrorDir(runnerDirPath, owner, name) {
43
+ return join(runnerDirPath, "mirrors", owner, `${name}.git`);
44
+ }
45
+ function spoolDir(runnerDirPath) {
46
+ return join(runnerDirPath, "spool");
47
+ }
48
+ function contextHomeDir(configPath) {
49
+ return join(runnerDir(configPath), "context-home");
50
+ }
51
+ function stagedContextDir(buildDirPath) {
52
+ return join(buildDirPath, "context");
53
+ }
54
+ function runnerDirOfBuild(buildDirPath) {
55
+ return dirname(dirname(buildDirPath));
56
+ }
57
+ function vmDir(runnerDirPath) {
58
+ return join(runnerDirPath, "vm");
59
+ }
60
+ function vmAssetsDir(runnerDirPath) {
61
+ return join(vmDir(runnerDirPath), "assets");
62
+ }
63
+ function rootfsDir(runnerDirPath) {
64
+ return join(vmDir(runnerDirPath), "rootfs");
65
+ }
66
+ function rootfsPathFor(runnerDirPath, imageId) {
67
+ return join(rootfsDir(runnerDirPath), `${imageId.replace(/^sha256:/, "").replace(/[^A-Za-z0-9._-]/g, "_")}.ext4`);
68
+ }
69
+ function diskTemplatesDir(runnerDirPath) {
70
+ return join(vmDir(runnerDirPath), "templates");
71
+ }
72
+ function vsockPath(buildDirPath) {
73
+ return join(buildDirPath, "v.sock");
74
+ }
75
+
76
+ export { RUNNER_DIR_MODE, RUNNER_FILE_MODE, attemptStamp, buildDir, contextHomeDir, diskTemplatesDir, ghConfigDir, hostKeyPath, imagesDir, jobDir, jobsDir, mirrorDir, pidFilePath, repoCacheDir, rootfsDir, rootfsPathFor, runnerDir, runnerDirOfBuild, spoolDir, stagedContextDir, vmAssetsDir, vsockPath };
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { C } from './chunk-YRYMNBGQ.js';
4
+ import { resolvePackRoot, loadTemplateFiles, loadMaintainedFiles, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MAINTAINED_SKILLS } from './chunk-WO2BXCTQ.js';
5
+ import { resolvePackageVersion } from './chunk-RA3O54FC.js';
6
+ import { existsSync, mkdirSync, writeFileSync } from 'fs';
7
+ import { join, dirname } from 'path';
8
+
9
+ createRequire(import.meta.url);
10
+ var DEFAULT_TEMPLATE = "default";
11
+ var POLICY_PATH = ".outerlayer/policy.yaml";
12
+ var POLICY_CONTENT = "extends: outerlayer:recommended@v1\nreview: required\n";
13
+ var StarterPackError = class extends Error {
14
+ };
15
+ function assertKnownTemplate(name) {
16
+ if (name !== DEFAULT_TEMPLATE) {
17
+ throw new StarterPackError(`unknown template "${name}" \u2014 the only template is "${DEFAULT_TEMPLATE}"`);
18
+ }
19
+ }
20
+ function installStarterPack(opts) {
21
+ const packRoot = opts.packRoot ?? resolvePackRoot();
22
+ const version = opts.version ?? resolvePackageVersion();
23
+ const templateFiles = loadTemplateFiles(packRoot, version);
24
+ const maintainedFiles = loadMaintainedFiles(packRoot, version);
25
+ const copied = [];
26
+ const kept = [];
27
+ for (const skill of TEMPLATE_SKILLS) {
28
+ if (existsSync(join(opts.repoRoot, skillDir(skill)))) {
29
+ kept.push(skill);
30
+ continue;
31
+ }
32
+ for (const file of templateFiles.filter((f) => f.skill === skill)) {
33
+ const abs = join(opts.repoRoot, file.path);
34
+ mkdirSync(dirname(abs), { recursive: true });
35
+ writeFileSync(abs, file.content);
36
+ }
37
+ copied.push(skill);
38
+ }
39
+ const written = writeMaintainedFiles(opts.repoRoot, maintainedFiles);
40
+ let policy = "kept";
41
+ const policyAbs = join(opts.repoRoot, POLICY_PATH);
42
+ if (!existsSync(policyAbs)) {
43
+ mkdirSync(dirname(policyAbs), { recursive: true });
44
+ writeFileSync(policyAbs, POLICY_CONTENT);
45
+ policy = "written";
46
+ }
47
+ return { copied, kept, maintained: [...written.created, ...written.rewritten], policy };
48
+ }
49
+ var skillFile = (skill) => `${skillDir(skill)}/SKILL.md`;
50
+ function formatStarterPackOutput(result) {
51
+ const lines = [];
52
+ lines.push(`${C.green}\u2713${C.reset} Installed the starter skills in .outerlayer/skills/`, "");
53
+ lines.push("Yours to edit \u2014 copied once, never overwritten:");
54
+ for (const skill of TEMPLATE_SKILLS) {
55
+ lines.push(
56
+ result.kept.includes(skill) ? ` ${C.dim}kept${C.reset} ${skillDir(skill)}/ ${C.dim}(already exists, left exactly as it is)${C.reset}` : ` ${skillFile(skill)}`
57
+ );
58
+ }
59
+ lines.push("", "Rewritten on every emit \u2014 edits are overwritten by the installed CLI:");
60
+ for (const skill of MAINTAINED_SKILLS) lines.push(` ${skillFile(skill)}`);
61
+ lines.push(
62
+ "",
63
+ result.policy === "written" ? `${C.green}\u2713${C.reset} Wrote ${POLICY_PATH} (extends the recommended checks, review required)` : `${C.dim}${POLICY_PATH} already exists \u2014 left as it is${C.reset}`,
64
+ "",
65
+ `Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["claude-code"]},`,
66
+ `then run ${C.yellow}outerlayer context emit${C.reset} to compile the skills into their native files.`
67
+ );
68
+ return lines.join("\n") + "\n";
69
+ }
70
+
71
+ export { StarterPackError, assertKnownTemplate, formatStarterPackOutput, installStarterPack };