@outerlayer/cli 0.22.2 → 0.23.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{agent-setup-KXPDPTAJ.js → agent-setup-SNDCEHG2.js} +13 -10
  3. package/dist/{artifact-link-cmd-OWRI5AJX.js → artifact-link-cmd-LEI6EOZE.js} +2 -2
  4. package/dist/{build-6WRNZPVR.js → build-WHHFA7KM.js} +2 -2
  5. package/dist/build-info.json +1 -1
  6. package/dist/{builder-G3MLDMTI.js → builder-7FBQAWQZ.js} +3 -3
  7. package/dist/{check-N6WLZCER.js → check-3CGLWMHM.js} +32 -32
  8. package/dist/{chunk-ZCXP35T3.js → chunk-2TT7DEMZ.js} +2 -2
  9. package/dist/{chunk-BVR6MQLS.js → chunk-6AOZD3LY.js} +2 -2
  10. package/dist/{chunk-WKSBSEWT.js → chunk-BOG4ENP7.js} +9 -9
  11. package/dist/{chunk-G3IJ3N6F.js → chunk-BUP5N3X6.js} +1 -1
  12. package/dist/{chunk-FVDVC2GF.js → chunk-C2XZBNHY.js} +1 -1
  13. package/dist/{chunk-FQE5RDHI.js → chunk-C64D7HR3.js} +5 -5
  14. package/dist/{chunk-AEKSX4EY.js → chunk-CBCKD6DO.js} +1 -1
  15. package/dist/{chunk-JD6GWYY7.js → chunk-D64E222W.js} +4 -4
  16. package/dist/{chunk-U6RKHNC7.js → chunk-DJYOCD65.js} +6 -6
  17. package/dist/{chunk-QZX6DAAW.js → chunk-FX6IHR5C.js} +8 -8
  18. package/dist/{chunk-IPS2JCHK.js → chunk-G3LHWUBK.js} +4 -4
  19. package/dist/{chunk-EMUNEAQK.js → chunk-GXV73IIS.js} +3 -3
  20. package/dist/{chunk-5OCIHFGE.js → chunk-HBISTTG3.js} +32 -23
  21. package/dist/chunk-JKNYTNYD.js +151 -0
  22. package/dist/{chunk-IMCVQF5F.js → chunk-KGKFEONR.js} +3 -3
  23. package/dist/{chunk-USWVXQIH.js → chunk-MQ743JX3.js} +3 -3
  24. package/dist/{chunk-XR56WEA5.js → chunk-OGMZJWWD.js} +1 -1
  25. package/dist/{chunk-KOIMUHIS.js → chunk-QSEPKZXR.js} +13 -13
  26. package/dist/{chunk-7VUK5RFS.js → chunk-QZBXLLTV.js} +36 -1
  27. package/dist/{chunk-WFSUUUAN.js → chunk-RKOTJQVG.js} +1 -1
  28. package/dist/{chunk-2CPOAPU4.js → chunk-TFGXOHF6.js} +12 -12
  29. package/dist/{chunk-V7SAQ645.js → chunk-VJBFQP3H.js} +21 -12
  30. package/dist/{chunk-ZNPE7FW5.js → chunk-VPEGE3QZ.js} +1 -1
  31. package/dist/{chunk-W3SWJ2TD.js → chunk-VWFOKRYS.js} +5 -2
  32. package/dist/{chunk-XCRZTXRL.js → chunk-WX2WEERU.js} +63 -43
  33. package/dist/{chunk-4542B3RR.js → chunk-WY7HFY62.js} +3 -3
  34. package/dist/{chunk-VSUXCMMH.js → chunk-XFGL53GU.js} +51 -33
  35. package/dist/{chunk-SNVXHNU7.js → chunk-XGPC3IOR.js} +3 -3
  36. package/dist/{chunk-HWZCE745.js → chunk-XOEV4FVK.js} +2 -2
  37. package/dist/{chunk-EAQSOE62.js → chunk-XSPA5ODY.js} +21 -19
  38. package/dist/{chunk-4OYKJJ2V.js → chunk-ZKWKQIJU.js} +86 -6
  39. package/dist/{chunk-B42BIYC6.js → chunk-ZLZ3XVPI.js} +2 -2
  40. package/dist/{claude-launcher-QD3C427Y.js → claude-launcher-KEESTJHO.js} +5 -5
  41. package/dist/{cli-A2Y67WAB.js → cli-44WGGICQ.js} +115 -108
  42. package/dist/{command-Q5Q2EIO4.js → command-4FAP2D3P.js} +21 -21
  43. package/dist/{connect-cmd-TNGEIWCA.js → connect-cmd-6DUTUK63.js} +7 -7
  44. package/dist/{context-cleanup-DSA3HGQU.js → context-cleanup-LTH77FC3.js} +3 -3
  45. package/dist/{control-plane-launch-HE6OSWKO.js → control-plane-launch-SEYCOZFH.js} +7 -7
  46. package/dist/{dist-7IH56ELA.js → dist-SOH3O24Y.js} +2 -2
  47. package/dist/{docker-JU422JL7.js → docker-KMK4LOET.js} +3 -3
  48. package/dist/{doctor-BRN4BGMA.js → doctor-4H77CEB7.js} +23 -23
  49. package/dist/{emit-artifact-cmd-GPAJCCUC.js → emit-artifact-cmd-XCZ3ALLV.js} +11 -11
  50. package/dist/emit-cmd-WQH2NK7H.js +15 -0
  51. package/dist/{emit-criteria-cmd-R3FKHSQG.js → emit-criteria-cmd-JE72JHKJ.js} +8 -8
  52. package/dist/{emit-finding-cmd-IK7RAVP5.js → emit-finding-cmd-ILIDRMYN.js} +8 -8
  53. package/dist/{emit-result-cmd-5FJTF7YD.js → emit-result-cmd-WPKG5YAS.js} +11 -11
  54. package/dist/{emit-step-cmd-VRTD5YPP.js → emit-step-cmd-OVMLQSL6.js} +9 -9
  55. package/dist/{governing-source-WM736XR4.js → governing-source-EQBKPME7.js} +15 -15
  56. package/dist/{guest-init-2OZ4YC7R.js → guest-init-HWSE7W6L.js} +2 -2
  57. package/dist/{hook-fast-QUGEI2IT.js → hook-fast-27SHD72I.js} +1 -1
  58. package/dist/{import-capture-cmd-Q56DDZVO.js → import-capture-cmd-TCOKNVBM.js} +12 -7
  59. package/dist/{import-ruler-cmd-T6LLO6Q7.js → import-ruler-cmd-VJOHOJQ7.js} +2 -2
  60. package/dist/index.js +4 -4
  61. package/dist/{init-X7FCQDFX.js → init-HAAHIQFN.js} +22 -22
  62. package/dist/{init-U3I43XCP.js → init-WQ62BXDN.js} +22 -22
  63. package/dist/{init-cmd-VCKH2DUQ.js → init-cmd-VPFIDY64.js} +19 -18
  64. package/dist/init-update-UZIJ2FMU.js +529 -0
  65. package/dist/layout-UOJQGEPW.js +10 -0
  66. package/dist/{login-browser-BN5UKPHS.js → login-browser-4OMZFP3U.js} +4 -3
  67. package/dist/{logout-cmd-RZFWTNYD.js → logout-cmd-5V5MMBSY.js} +2 -2
  68. package/dist/{loop-P3QDQOE5.js → loop-JPW2QJ64.js} +32 -32
  69. package/dist/{machine-EEFOW32K.js → machine-PGDRWPI2.js} +21 -21
  70. package/dist/{mcp-install-cmd-GD4QUP7Z.js → mcp-install-cmd-GGWB3JJ2.js} +2 -2
  71. package/dist/{runner-identity-FTHZFMGY.js → runner-identity-IIZ3RK7M.js} +3 -3
  72. package/dist/{runner-key-O42EUXQU.js → runner-key-BPP5XRYR.js} +22 -22
  73. package/dist/{session-sender-HF6DXFA2.js → session-sender-EKKZ5DEU.js} +12 -12
  74. package/dist/{spec-cmd-ADPH236D.js → spec-cmd-JDHGNFVJ.js} +9 -9
  75. package/dist/{starter-pack-5EQYGSJF.js → starter-pack-55EFILC5.js} +7 -4
  76. package/dist/{status-LXFIVGP3.js → status-UCQDEMFX.js} +26 -26
  77. package/dist/{sync-cmd-5XS3CUV5.js → sync-cmd-NSVXOYFJ.js} +11 -11
  78. package/dist/{watch-FBZHZV56.js → watch-NQVZWPBJ.js} +11 -11
  79. package/dist/{work-claim-cmd-LIIINECF.js → work-claim-cmd-FPJXQAXP.js} +11 -11
  80. package/dist/{work-cmd-SM6DY2WK.js → work-cmd-FMPDXPU6.js} +9 -9
  81. package/dist/{work-comment-cmd-VYVXGT4W.js → work-comment-cmd-ZVUE2IUN.js} +9 -9
  82. package/dist/{work-logs-cmd-XZSCWWMW.js → work-logs-cmd-CQH2SYT4.js} +9 -9
  83. package/dist/{work-open-pr-cmd-YZNC3P3R.js → work-open-pr-cmd-YY2OGJOI.js} +10 -10
  84. package/dist/{work-pr-cmd-AMN23KFJ.js → work-pr-cmd-EHFTEVJO.js} +9 -9
  85. package/dist/{work-stop-cmd-HSR2GOJJ.js → work-stop-cmd-LGWSBSBT.js} +9 -9
  86. package/package.json +1 -1
  87. package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +7 -1
  88. package/skill-pack/maintained/outerlayer-build/references/criteria-judge.md +10 -0
  89. package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +4 -0
  90. package/skill-pack/maintained/outerlayer-cli/SKILL.md +5 -3
  91. package/dist/emit-cmd-3W5IO5ET.js +0 -14
  92. package/dist/init-update-TCMH7M3Q.js +0 -210
  93. package/dist/{chunk-F35VMF5M.js → chunk-GOSFARMS.js} +1 -1
  94. package/dist/{chunk-3AZYLAJC.js → chunk-QILR6TZP.js} +1 -1
  95. package/dist/{chunk-DIB2WLBL.js → chunk-YVZJ6GKF.js} +1 -1
  96. package/dist/{chunk-SFHR45FA.js → chunk-Z42JY3LQ.js} +1 -1
  97. package/dist/{mcp-serve-cmd-TQSPFRC7.js → mcp-serve-cmd-CNRC5AL5.js} +1 -1
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveCredentials, getJson } from './chunk-FQE5RDHI.js';
4
- import './chunk-B42BIYC6.js';
5
- import './chunk-EMUNEAQK.js';
6
- import './chunk-G3IJ3N6F.js';
7
- import './chunk-EAQSOE62.js';
8
- import './chunk-F35VMF5M.js';
3
+ import { resolveCredentials, getJson } from './chunk-C64D7HR3.js';
4
+ import './chunk-ZLZ3XVPI.js';
5
+ import './chunk-GXV73IIS.js';
6
+ import './chunk-BUP5N3X6.js';
7
+ import './chunk-XSPA5ODY.js';
8
+ import './chunk-GOSFARMS.js';
9
9
  import { defaultFetch } from './chunk-QS43O4DR.js';
10
10
  import './chunk-BJ3KTMDH.js';
11
- import './chunk-AEKSX4EY.js';
12
- import './chunk-EABW6AJQ.js';
11
+ import './chunk-CBCKD6DO.js';
13
12
  import './chunk-ANPNT6PM.js';
13
+ import './chunk-EABW6AJQ.js';
14
14
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
15
15
  import './chunk-CRB3POP4.js';
16
- import './chunk-7VUK5RFS.js';
16
+ import './chunk-QZBXLLTV.js';
17
17
  import './chunk-VNVZDWO3.js';
18
18
  import './chunk-RA3O54FC.js';
19
19
  import './chunk-OW52QLK3.js';
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { itemLabel, runWorkPr, WorkPrCommandError } from './chunk-BVR6MQLS.js';
4
- import { resolveCredentials } from './chunk-FQE5RDHI.js';
5
- import './chunk-B42BIYC6.js';
6
- import './chunk-EMUNEAQK.js';
7
- import './chunk-G3IJ3N6F.js';
8
- import './chunk-EAQSOE62.js';
9
- import './chunk-F35VMF5M.js';
3
+ import { itemLabel, runWorkPr, WorkPrCommandError } from './chunk-6AOZD3LY.js';
4
+ import { resolveCredentials } from './chunk-C64D7HR3.js';
5
+ import './chunk-ZLZ3XVPI.js';
6
+ import './chunk-GXV73IIS.js';
7
+ import './chunk-BUP5N3X6.js';
8
+ import './chunk-XSPA5ODY.js';
9
+ import './chunk-GOSFARMS.js';
10
10
  import { defaultFetch } from './chunk-QS43O4DR.js';
11
11
  import './chunk-BJ3KTMDH.js';
12
- import './chunk-AEKSX4EY.js';
13
- import './chunk-EABW6AJQ.js';
12
+ import './chunk-CBCKD6DO.js';
14
13
  import { C } from './chunk-ANPNT6PM.js';
14
+ import './chunk-EABW6AJQ.js';
15
15
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
16
16
  import './chunk-WZBHBH3J.js';
17
17
  import './chunk-CRB3POP4.js';
18
- import './chunk-7VUK5RFS.js';
18
+ import './chunk-QZBXLLTV.js';
19
19
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
20
20
  import './chunk-RA3O54FC.js';
21
21
  import './chunk-OW52QLK3.js';
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { WorkPrCommandError, itemLabel, runWorkPr } from './chunk-BVR6MQLS.js';
4
- import './chunk-B42BIYC6.js';
5
- import './chunk-EMUNEAQK.js';
6
- import './chunk-G3IJ3N6F.js';
7
- import './chunk-EAQSOE62.js';
8
- import './chunk-F35VMF5M.js';
3
+ export { WorkPrCommandError, itemLabel, runWorkPr } from './chunk-6AOZD3LY.js';
4
+ import './chunk-ZLZ3XVPI.js';
5
+ import './chunk-GXV73IIS.js';
6
+ import './chunk-BUP5N3X6.js';
7
+ import './chunk-XSPA5ODY.js';
8
+ import './chunk-GOSFARMS.js';
9
9
  import './chunk-QS43O4DR.js';
10
10
  import './chunk-BJ3KTMDH.js';
11
- import './chunk-AEKSX4EY.js';
12
- import './chunk-EABW6AJQ.js';
11
+ import './chunk-CBCKD6DO.js';
13
12
  import './chunk-ANPNT6PM.js';
13
+ import './chunk-EABW6AJQ.js';
14
14
  import './chunk-T2Q7ISPE.js';
15
15
  import './chunk-WZBHBH3J.js';
16
16
  import './chunk-CRB3POP4.js';
17
- import './chunk-7VUK5RFS.js';
17
+ import './chunk-QZBXLLTV.js';
18
18
  import './chunk-VNVZDWO3.js';
19
19
  import './chunk-RA3O54FC.js';
20
20
  import './chunk-OW52QLK3.js';
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveCredentials, postJson, WorkCommandError } from './chunk-FQE5RDHI.js';
4
- import './chunk-B42BIYC6.js';
5
- import './chunk-EMUNEAQK.js';
6
- import './chunk-G3IJ3N6F.js';
7
- import './chunk-EAQSOE62.js';
8
- import './chunk-F35VMF5M.js';
3
+ import { resolveCredentials, postJson, WorkCommandError } from './chunk-C64D7HR3.js';
4
+ import './chunk-ZLZ3XVPI.js';
5
+ import './chunk-GXV73IIS.js';
6
+ import './chunk-BUP5N3X6.js';
7
+ import './chunk-XSPA5ODY.js';
8
+ import './chunk-GOSFARMS.js';
9
9
  import { defaultFetch } from './chunk-QS43O4DR.js';
10
10
  import './chunk-BJ3KTMDH.js';
11
- import './chunk-AEKSX4EY.js';
12
- import './chunk-EABW6AJQ.js';
11
+ import './chunk-CBCKD6DO.js';
13
12
  import './chunk-ANPNT6PM.js';
13
+ import './chunk-EABW6AJQ.js';
14
14
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
15
15
  import './chunk-CRB3POP4.js';
16
- import './chunk-7VUK5RFS.js';
16
+ import './chunk-QZBXLLTV.js';
17
17
  import './chunk-VNVZDWO3.js';
18
18
  import './chunk-RA3O54FC.js';
19
19
  import './chunk-OW52QLK3.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outerlayer/cli",
3
- "version": "0.22.2",
3
+ "version": "0.23.0",
4
4
  "description": "OuterLayer CLI — commands: init, claude, connect, doctor, login, logout, sync, daemon (alias: watch), emit, work, spec, runner, hooks, mcp, import, context. Capture and sync coding-agent sessions, and record proof of factory work.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Magu Studios, Inc.",
@@ -93,7 +93,13 @@ drives the real chain, from input through storage to read-back, with nothing
93
93
  mocked at the store boundary, plus one test per criterion written from the
94
94
  criterion's own words. Read every failure. Each test must fail because the
95
95
  behavior is absent, not because of a typo or a missing import. Then implement
96
- until green. When the build drafted the criteria from the issue's
96
+ until green.
97
+
98
+ A test proves a criterion only when it runs the code that produces the outcome
99
+ its Then clause states. A test that checks that the inputs to that code are
100
+ unchanged is a regression guard, not a proof. When the seam the issue names
101
+ cannot run that code, add a second citing test at a seam that can. Say so in
102
+ your report. When the build drafted the criteria from the issue's
97
103
  description, they are requirements in the same way, and tests cite their
98
104
  ids. When no criteria were recorded, write tests from the description in the
99
105
  same order.
@@ -58,6 +58,16 @@ It is not satisfied when the test only cites the id, asserts something weaker
58
58
  than the stated outcome, mocks away the very behavior the criterion is about,
59
59
  or has no assertion bearing on the outcome, even when it cites the id.
60
60
 
61
+ A test asserts something weaker when it checks a stand-in for the outcome. For
62
+ example, it checks the arguments a program starts with, but the outcome is what
63
+ that program does. Or it checks that a value is unchanged from before, but the
64
+ Then clause states the value. A test proves an outcome only when it runs the
65
+ code that produces that outcome.
66
+
67
+ Your verdict follows your reason. When your reason says that part of the Then
68
+ clause is inherited, assumed, implied or not asserted, the verdict is
69
+ `not-satisfied`.
70
+
61
71
  When unsure, record `not-satisfied` and state the doubt in the reason. A silent
62
72
  pass is worse than a wrong-looking fail a person can overrule.
63
73
 
@@ -149,6 +149,10 @@ change to production code that still passes it?
149
149
  - Assertion strength: exact shapes over permissive matchers. Error-path tests
150
150
  assert the message or status a user would see, not only that something
151
151
  threw.
152
+ - Stand-in proofs: a test that checks something next to the outcome, not the
153
+ outcome. Examples are the arguments a program starts with instead of what it
154
+ does, or "unchanged from before" instead of the stated value. Name the code
155
+ that produces the outcome, and check that the citing test runs it.
152
156
  - Mutation survivors: for each new conditional and object literal, flip or
153
157
  empty it. If no test fails, write the assertion that would.
154
158
 
@@ -92,6 +92,8 @@ tools fail, run `outerlayer login` and reconnect the server.
92
92
 
93
93
  ## Keeping this repository's context current
94
94
 
95
- `outerlayer context emit` compiles `.outerlayer/` into the files each agent
96
- tool reads, such as `.claude/skills/`. This skill is maintained: that command
97
- rewrites it from the installed CLI, so edits to it do not last.
95
+ A repository with `AGENTS.md` and `.agents/skills/` compiles nothing.
96
+ `outerlayer init --update` rewrites this skill from the installed CLI. In an
97
+ older layout, `outerlayer context emit` compiles `.outerlayer/` into the files
98
+ each agent tool reads, such as `.claude/skills/`, and rewrites this skill.
99
+ Either way, edits to this skill do not last.
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { EmitError, runEmit } from './chunk-XCRZTXRL.js';
4
- import './chunk-USWVXQIH.js';
5
- import './chunk-5OCIHFGE.js';
6
- import './chunk-ANPNT6PM.js';
7
- import './chunk-CRB3POP4.js';
8
- import './chunk-WFSUUUAN.js';
9
- import './chunk-7VUK5RFS.js';
10
- import './chunk-VNVZDWO3.js';
11
- import './chunk-RA3O54FC.js';
12
- import './chunk-Z5GEFMRW.js';
13
-
14
- createRequire(import.meta.url);
@@ -1,210 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- import { contextIsGoverned, inspectStarterFiles, readShippedManifest, skillsFolders, contentHash, canonical } from './chunk-VSUXCMMH.js';
4
- import { keepHandWritten } from './chunk-4OYKJJ2V.js';
5
- import { runEmit } from './chunk-XCRZTXRL.js';
6
- import { COMMIT_LINE } from './chunk-EMUNEAQK.js';
7
- import './chunk-G3IJ3N6F.js';
8
- import './chunk-EAQSOE62.js';
9
- import './chunk-F35VMF5M.js';
10
- import './chunk-SNVXHNU7.js';
11
- import './chunk-USWVXQIH.js';
12
- import './chunk-QS43O4DR.js';
13
- import './chunk-ZJSNLVCE.js';
14
- import { findGitDirs } from './chunk-BJ3KTMDH.js';
15
- import './chunk-AEKSX4EY.js';
16
- import { setMcpEntry } from './chunk-DIB2WLBL.js';
17
- import './chunk-EABW6AJQ.js';
18
- import './chunk-V7SAQ645.js';
19
- import { writeMaintainedFiles, maintainedFilesForExistingSkills, loadMaintainedFiles } from './chunk-5OCIHFGE.js';
20
- import { C } from './chunk-ANPNT6PM.js';
21
- import { cliInvocation } from './chunk-CRB3POP4.js';
22
- import { hasSymlinkComponent } from './chunk-W3SWJ2TD.js';
23
- import './chunk-YQR6E6OV.js';
24
- import './chunk-TUSYOL2O.js';
25
- import './chunk-WFSUUUAN.js';
26
- import './chunk-7VUK5RFS.js';
27
- import './chunk-VNVZDWO3.js';
28
- import './chunk-RA3O54FC.js';
29
- import './chunk-OW52QLK3.js';
30
- import './chunk-IHNQWF6F.js';
31
- import './chunk-URWYRAIC.js';
32
- import './chunk-GISNHSYL.js';
33
- import './chunk-Z5GEFMRW.js';
34
- import { existsSync, readFileSync, mkdirSync, writeFileSync, unlinkSync, readdirSync, rmdirSync } from 'fs';
35
- import { join, dirname } from 'path';
36
-
37
- createRequire(import.meta.url);
38
- var NOT_COMPILED = `There is no .outerlayer/config.json, so \`${cliInvocation()} context emit\` did not run.`;
39
- var errorMessage = (err) => err instanceof Error ? err.message : String(err);
40
- function actionFor(item) {
41
- if (item.state === "outdated") return "update";
42
- if (item.state === "missing") return "write";
43
- if (item.state === "current") return "none";
44
- return "keep";
45
- }
46
- var SKILLS_DIR = ".outerlayer/skills/";
47
- function removals(root, report, packRoot) {
48
- const manifest = readShippedManifest(packRoot);
49
- const planned = [];
50
- const add = (path) => planned.push({ path, state: "retired", action: "remove" });
51
- for (const file of report.retired.filter((f) => f.state === "unedited")) {
52
- add(file.path);
53
- const rel = file.path.slice(SKILLS_DIR.length);
54
- if (!manifest.ok || !/^[^/]+\/scripts\//.test(rel)) continue;
55
- for (const folder of skillsFolders().filter((f) => `${f}/` !== SKILLS_DIR)) {
56
- const native = `${folder}/${rel}`;
57
- if (hasSymlinkComponent(root, native)) continue;
58
- try {
59
- if (manifest.files.get(file.path)?.has(contentHash(readFileSync(join(root, native), "utf8"))) === true) add(native);
60
- } catch {
61
- }
62
- }
63
- }
64
- return planned;
65
- }
66
- function removeFile(root, path) {
67
- if (hasSymlinkComponent(root, path)) return false;
68
- unlinkSync(join(root, path));
69
- for (let dir = dirname(path); dir !== "."; dir = dirname(dir)) {
70
- try {
71
- if (readdirSync(join(root, dir)).length > 0) break;
72
- rmdirSync(join(root, dir));
73
- } catch {
74
- break;
75
- }
76
- }
77
- return true;
78
- }
79
- function plan(report) {
80
- return report.items.map((item) => {
81
- const planned = { path: item.path, state: item.state, action: actionFor(item) };
82
- if (item.kind === "mcp") planned.server = item.server;
83
- if (item.kind === "file" && item.state === "edited" && item.file.source !== void 0) {
84
- planned.compare = `git diff --no-index ${item.file.source} ${item.path}`;
85
- }
86
- return planned;
87
- });
88
- }
89
- function apply(root, item) {
90
- if (item.kind === "file") {
91
- const abs = join(root, item.path);
92
- mkdirSync(dirname(abs), { recursive: true });
93
- writeFileSync(abs, item.file.content);
94
- } else {
95
- setMcpEntry(root, item.server, { ...item.entry });
96
- }
97
- }
98
- var CLASHING_FLAGS = ["remove", "org", "local", "template", "factory"];
99
- function updateFlagProblem(flags) {
100
- if (flags.update !== true) return flags.dryRun === true ? "--dry-run only applies to --update." : void 0;
101
- const clash = CLASHING_FLAGS.find((name) => flags[name] !== void 0 && flags[name] !== false);
102
- return clash === void 0 ? void 0 : `--update changes only the files init wrote, so it cannot be combined with --${clash}.`;
103
- }
104
- var MCP_SOURCE = ".outerlayer/mcp.json";
105
- function sameJson(a, b) {
106
- try {
107
- return b !== void 0 && canonical(JSON.parse(a)) === canonical(JSON.parse(b));
108
- } catch {
109
- return false;
110
- }
111
- }
112
- function keepUnlessCompiled(keep, mcpSourceBefore) {
113
- return (output) => {
114
- if (output.kind === "file" && sameJson(output.existing, mcpSourceBefore)) return false;
115
- return keep(output);
116
- };
117
- }
118
- function runInitUpdate(opts) {
119
- const dryRun = opts.dryRun === true;
120
- const empty = { dryRun, items: [], emitted: [], kept: [], manifest: "ok" };
121
- const dirs = findGitDirs(opts.cwd);
122
- if (dirs === void 0) return { ...empty, status: "skipped", reason: "not a git repository" };
123
- const root = dirs.repoRoot;
124
- if (contextIsGoverned(dirs.gitCommonDir)) {
125
- return { ...empty, status: "skipped", reason: "this repository's context comes from a control plane and arrives at session start" };
126
- }
127
- const report = inspectStarterFiles(root, { packRoot: opts.packRoot });
128
- const dropped = removals(root, report, opts.packRoot);
129
- const items = [...plan(report), ...dropped];
130
- const base = { dryRun, items, emitted: [], kept: [], manifest: report.manifest };
131
- const changes = report.items.filter((i) => i.state === "outdated" || i.state === "missing");
132
- const nothing = changes.length === 0 && dropped.length === 0;
133
- if (dryRun || nothing) return { ...base, status: "done", reason: nothing ? "nothing to update" : "dry run" };
134
- const created = new Set(changes.filter((i) => i.kind === "file" && i.state === "missing").map((i) => i.path));
135
- const mcpSource = join(root, MCP_SOURCE);
136
- const mcpSourceBefore = existsSync(mcpSource) ? readFileSync(mcpSource, "utf8") : void 0;
137
- try {
138
- for (const item of changes) apply(root, item);
139
- for (const item of dropped) if (!removeFile(root, item.path)) item.action = "keep";
140
- } catch (err) {
141
- return { ...base, status: "failed", reason: `could not write the files: ${errorMessage(err)}` };
142
- }
143
- if (!existsSync(join(root, ".outerlayer", "config.json"))) {
144
- try {
145
- writeMaintainedFiles(root, maintainedFilesForExistingSkills(root, loadMaintainedFiles(opts.packRoot)));
146
- } catch (err) {
147
- return { ...base, status: "failed", reason: `could not write the files: ${errorMessage(err)}` };
148
- }
149
- return { ...base, status: "done", reason: NOT_COMPILED };
150
- }
151
- try {
152
- const keep = keepUnlessCompiled(keepHandWritten(created), mcpSourceBefore);
153
- const pending = runEmit({ cwd: root, check: true, quiet: true, keep }).drift ?? [];
154
- const emitted = runEmit({ cwd: root, quiet: true, keep });
155
- if (emitted.exitCode !== 0) throw new Error(emitted.errors.map((e) => `${e.path}: ${e.message}`).join("; "));
156
- return {
157
- ...base,
158
- status: "done",
159
- reason: "updated",
160
- emitted: pending.filter((d) => d.kind !== "orphaned").map((d) => d.path),
161
- kept: emitted.kept
162
- };
163
- } catch (err) {
164
- return { ...base, status: "failed", reason: `context emit failed: ${errorMessage(err)}` };
165
- }
166
- }
167
- var VERB = {
168
- update: { done: "updated", planned: "would update" },
169
- write: { done: "wrote", planned: "would write" },
170
- remove: { done: "removed", planned: "would remove" }
171
- };
172
- function formatInitUpdate(result) {
173
- if (result.status === "skipped") return `${C.dim}- Nothing to update: ${result.reason}${C.reset}
174
- `;
175
- const lines = [];
176
- const label = (p) => p.server === void 0 ? p.path : `${p.path} "${p.server}" server`;
177
- const changed = result.items.filter((p) => p.action === "update" || p.action === "write" || p.action === "remove");
178
- const kept = result.items.filter((p) => p.action === "keep" && p.state !== "retired");
179
- const current = result.items.filter((p) => p.action === "none");
180
- lines.push(result.dryRun ? `Plan for \`${cliInvocation()} init --update\` (nothing written):` : "Starter files:");
181
- for (const p of changed) {
182
- const verb = VERB[p.action];
183
- const why = p.action === "update" ? "outdated, unedited" : p.action === "remove" ? "no longer shipped, unedited" : "missing";
184
- lines.push(` ${result.dryRun ? verb.planned : `${C.green}${verb.done}${C.reset}`} ${label(p)} ${C.dim}(${why})${C.reset}`);
185
- }
186
- for (const p of kept) {
187
- const why = p.state === "unreadable" ? "not valid JSON" : "edited by you";
188
- lines.push(` ${C.yellow}kept${C.reset} ${label(p)} ${C.dim}(${why}, left as it is)${C.reset}`);
189
- if (p.compare !== void 0) lines.push(` ${C.dim}compare: ${p.compare}${C.reset}`);
190
- }
191
- if (current.length > 0) lines.push(` ${C.dim}${current.length} already current${C.reset}`);
192
- if (result.manifest !== "ok") {
193
- lines.push(
194
- ` ${C.yellow}!${C.reset} This CLI's record of earlier versions is ${result.manifest}, so every changed file counts as edited and is left as it is.`
195
- );
196
- }
197
- if (result.emitted.length > 0) {
198
- lines.push("", `Recompiled by \`${cliInvocation()} context emit\`:`, ...result.emitted.map((p) => ` ${p}`));
199
- }
200
- for (const p of result.kept) lines.push(` ${C.dim}kept ${p} (written by hand, not replaced)${C.reset}`);
201
- if (result.status === "failed") lines.push("", `${C.red}\u2717${C.reset} ${result.reason}`);
202
- else if (!result.dryRun && changed.length > 0) {
203
- if (result.reason === NOT_COMPILED) lines.push("", `${C.dim}${NOT_COMPILED}${C.reset}`);
204
- lines.push("", "The changes are left uncommitted.", COMMIT_LINE);
205
- } else if (changed.length === 0) lines.push("", `${C.green}\u2713${C.reset} Nothing to update.`);
206
- return `${lines.join("\n")}
207
- `;
208
- }
209
-
210
- export { formatInitUpdate, runInitUpdate, updateFlagProblem };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readCloudConfig, removeCloudConfigKeys } from './chunk-EABW6AJQ.js';
4
3
  import { C } from './chunk-ANPNT6PM.js';
4
+ import { readCloudConfig, removeCloudConfigKeys } from './chunk-EABW6AJQ.js';
5
5
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
6
6
 
7
7
  createRequire(import.meta.url);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, RecipeError, locateRecipe, readRecipe, assertBuildable, TINI_VERSION, GH_VERSION, writeSanitizedRecipe, classifyProperties, GH_SHA256, TINI_SHA256, SANITIZED_NAME } from './chunk-3W333NFO.js';
4
3
  import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-XACXXKQ5.js';
5
4
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
+ import { CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, RecipeError, locateRecipe, readRecipe, assertBuildable, TINI_VERSION, GH_VERSION, writeSanitizedRecipe, classifyProperties, GH_SHA256, TINI_SHA256, SANITIZED_NAME } from './chunk-3W333NFO.js';
6
6
  import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
7
7
  import { withGitConfig, tokenHeader, PROXY_WARNING_FLAG } from './chunk-URWYRAIC.js';
8
8
  import { RELAY_ID, RELAY_USER } from './chunk-GISNHSYL.js';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readCloudConfig } from './chunk-EABW6AJQ.js';
4
3
  import { C } from './chunk-ANPNT6PM.js';
4
+ import { readCloudConfig } from './chunk-EABW6AJQ.js';
5
5
  import { cliInvocation } from './chunk-CRB3POP4.js';
6
6
  import { existsSync, writeFileSync, readFileSync, mkdirSync } from 'fs';
7
7
  import { join, dirname } from 'path';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { BRIDGE_ADDRESS, TUNNEL_PORT, BRIDGE_CIDR } from './chunk-WXJXHZVB.js';
4
- import { EXEC_PORT } from './chunk-2Q3PZ42G.js';
5
4
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
+ import { EXEC_PORT } from './chunk-2Q3PZ42G.js';
6
6
  import { RELAY_PORT } from './chunk-URWYRAIC.js';
7
7
  import { spawn, spawnSync } from 'child_process';
8
8
  import { writeFileSync, chmodSync, mkdirSync } from 'fs';
@@ -2,8 +2,8 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { resolveGatewayCredentials, defaultFetch } from './chunk-QS43O4DR.js';
4
4
  import './chunk-BJ3KTMDH.js';
5
- import { cloudConfigPath } from './chunk-EABW6AJQ.js';
6
5
  import { C } from './chunk-ANPNT6PM.js';
6
+ import { cloudConfigPath } from './chunk-EABW6AJQ.js';
7
7
  import { cliInvocation } from './chunk-CRB3POP4.js';
8
8
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
9
9
  import './chunk-RA3O54FC.js';