@outerlayer/cli 0.6.0 → 0.8.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 (92) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +15 -5
  3. package/dist/{agent-setup-USZ2SAXC.js → agent-setup-C7PLRXZO.js} +7 -6
  4. package/dist/{build-PAEKVYVK.js → build-MS34XEGN.js} +3 -1
  5. package/dist/build-info.json +1 -1
  6. package/dist/builder-G52A6GW2.js +13 -0
  7. package/dist/{check-CCVPBN7A.js → check-FOF3PUKI.js} +35 -26
  8. package/dist/{chunk-ZILGTTY6.js → chunk-3S4P55NE.js} +3 -3
  9. package/dist/{chunk-MIGEDH5P.js → chunk-4A5E2G4E.js} +9 -9
  10. package/dist/chunk-4ACZCY4I.js +39 -0
  11. package/dist/{chunk-OIRNH6UO.js → chunk-5FWNEQNZ.js} +3 -3
  12. package/dist/{chunk-BNMCXPG7.js → chunk-5QLNZGAQ.js} +12 -3
  13. package/dist/chunk-5TNS3PL7.js +263 -0
  14. package/dist/chunk-7RQ73DLO.js +23 -0
  15. package/dist/{chunk-VMJ3MMBX.js → chunk-7VNURP6M.js} +538 -46
  16. package/dist/{chunk-EMY4I27X.js → chunk-7ZR5UPMB.js} +555 -5
  17. package/dist/{chunk-UMFWVGJO.js → chunk-AIL2R4SI.js} +4 -3
  18. package/dist/{chunk-NQXFAGHU.js → chunk-AX23QKHS.js} +7 -3
  19. package/dist/{chunk-RZSF5B46.js → chunk-CM5QTKM4.js} +152 -158
  20. package/dist/chunk-CX22S5BA.js +45 -0
  21. package/dist/{chunk-H5NCNVDA.js → chunk-EV3M3EH7.js} +2 -2
  22. package/dist/{chunk-ANK2B36Y.js → chunk-GAYWY4GI.js} +6190 -28615
  23. package/dist/chunk-HKMPVPO7.js +55 -0
  24. package/dist/{chunk-43J3M6KB.js → chunk-IJBVPLZZ.js} +91 -39
  25. package/dist/{chunk-PMAMOSTP.js → chunk-ILEA3YHM.js} +85 -25
  26. package/dist/{chunk-MXB5VB4Y.js → chunk-IRCBTGWF.js} +6 -6
  27. package/dist/{chunk-OUUINEYB.js → chunk-JKIWMRFH.js} +1 -1
  28. package/dist/{chunk-FA2BOX4O.js → chunk-JPR2WHHF.js} +1 -1
  29. package/dist/{chunk-IASWYRVG.js → chunk-K35RW5HP.js} +4 -1
  30. package/dist/{chunk-ZMYPLFG3.js → chunk-M3SQ4YGD.js} +1 -1
  31. package/dist/{chunk-4NLKY4WR.js → chunk-NALVDFIS.js} +2 -2
  32. package/dist/{chunk-AUFG23AA.js → chunk-OD2VTIHN.js} +19 -47
  33. package/dist/{chunk-JWOQNNN2.js → chunk-OEK4JEB3.js} +33 -4
  34. package/dist/chunk-PTW6W5NR.js +127 -0
  35. package/dist/{chunk-3DD6AOWC.js → chunk-PWBILI5P.js} +28 -3
  36. package/dist/{chunk-B2G7JHHB.js → chunk-R7STSBLC.js} +1 -1
  37. package/dist/{chunk-YYYXRJUW.js → chunk-TI7B7UEO.js} +1 -1
  38. package/dist/{chunk-Z62HNKEJ.js → chunk-TTNFGMHO.js} +72 -54
  39. package/dist/{chunk-RBOMWNOG.js → chunk-TUUMW4TC.js} +2 -2
  40. package/dist/{chunk-774HEQL6.js → chunk-U3GOI2B4.js} +91 -8
  41. package/dist/{chunk-F6GFZXZ3.js → chunk-UXYLWVTQ.js} +1 -18
  42. package/dist/{chunk-WO2BXCTQ.js → chunk-VXLJORHL.js} +1 -1
  43. package/dist/{chunk-CBPPJSAR.js → chunk-WVGSB3Z2.js} +2 -2
  44. package/dist/chunk-YNJEOGDL.js +22434 -0
  45. package/dist/{chunk-W4SQCOZU.js → chunk-ZOAEPWGL.js} +1 -1
  46. package/dist/{chunk-3DEVYTNQ.js → chunk-ZYHKJKSU.js} +1 -1
  47. package/dist/{chunk-WIOZAJ2W.js → chunk-ZZXLM64C.js} +1 -1
  48. package/dist/{cli-7WCNPBYC.js → cli-AOJPAVFX.js} +109 -81
  49. package/dist/{command-ARFK3OYF.js → command-SY3SVLAI.js} +67 -27
  50. package/dist/config-Z3USDBLU.js +11 -0
  51. package/dist/{connect-cmd-PCESZLTR.js → connect-cmd-PNZ6IJLJ.js} +4 -4
  52. package/dist/{context-adopt-G5JAELE7.js → context-adopt-CE4KDXS3.js} +5 -4
  53. package/dist/{context-materialize-3HLPZAF6.js → context-materialize-QL33HDJN.js} +5 -4
  54. package/dist/{dist-RDLP4GGJ.js → dist-3ZTZF2TP.js} +2 -1
  55. package/dist/docker-676FD3CQ.js +15 -0
  56. package/dist/{doctor-VOMYOHQU.js → doctor-WR6TRPSU.js} +49 -19
  57. package/dist/{emit-artifact-cmd-TBF46VXZ.js → emit-artifact-cmd-AVM4YXMQ.js} +11 -4
  58. package/dist/{emit-cmd-DCERAU27.js → emit-cmd-2QRMYPYO.js} +4 -3
  59. package/dist/{emit-criteria-cmd-3427XKFW.js → emit-criteria-cmd-LDBE4YDS.js} +10 -1
  60. package/dist/{emit-finding-cmd-GSI75K36.js → emit-finding-cmd-6R5WBPCH.js} +12 -1
  61. package/dist/{emit-result-cmd-3PRQKB55.js → emit-result-cmd-2DMN6O6U.js} +13 -6
  62. package/dist/{exec-client-4XGXV3XN.js → exec-client-NPYNUAF3.js} +4 -3
  63. package/dist/{guest-init-GENRHNP7.js → guest-init-JWNNAH2H.js} +4 -3
  64. package/dist/{hook-fast-NJBBZQ5Q.js → hook-fast-XBOZ3N6L.js} +1 -1
  65. package/dist/{import-capture-cmd-AVZ4VIVJ.js → import-capture-cmd-T4556ELW.js} +3 -2
  66. package/dist/{import-ruler-cmd-GUHL6IY5.js → import-ruler-cmd-SG3UVGI7.js} +2 -1
  67. package/dist/index.js +3 -3
  68. package/dist/init-KDK5QLQZ.js +46 -0
  69. package/dist/{init-OHYFIKZD.js → init-R2FJ5KNS.js} +35 -21
  70. package/dist/{init-cmd-HMFNIFPI.js → init-cmd-BYZYAJ5P.js} +10 -9
  71. package/dist/{install-DSUZE2TJ.js → install-FHTVJZS6.js} +7 -5
  72. package/dist/{install-cmd-453C7IZT.js → install-cmd-DCF7TVXD.js} +3 -2
  73. package/dist/{logs-7RYUH5A6.js → logs-H55NWW4H.js} +1 -0
  74. package/dist/{loop-UAJB34KA.js → loop-AG3PLXPO.js} +35 -26
  75. package/dist/machine-LV6WBRRK.js +45 -0
  76. package/dist/{session-sender-ED26V45B.js → session-sender-Q5HAMOL2.js} +6 -5
  77. package/dist/{starter-pack-LIZYMKYQ.js → starter-pack-MUXMAU4S.js} +4 -3
  78. package/dist/{status-6WNXX2O7.js → status-HH4OSOHR.js} +29 -20
  79. package/dist/{sync-cmd-YONVGUYS.js → sync-cmd-CAEPJR7B.js} +5 -4
  80. package/dist/{watch-HHKAF26L.js → watch-LAAZFBHH.js} +5 -4
  81. package/dist/{work-claim-cmd-LXBZTMJA.js → work-claim-cmd-ARIYZARE.js} +15 -7
  82. package/dist/{work-cmd-OVNF44FY.js → work-cmd-B3FOXZAL.js} +9 -3
  83. package/dist/{work-comment-cmd-6DGQNTAH.js → work-comment-cmd-O5WGRI6K.js} +9 -3
  84. package/dist/{work-open-pr-cmd-FCZHFHZS.js → work-open-pr-cmd-M6CQW7KW.js} +10 -4
  85. package/dist/{work-pr-cmd-QJJVHZDC.js → work-pr-cmd-C4YEGKD6.js} +9 -2
  86. package/package.json +1 -1
  87. package/skill-pack/template/build/scripts/record-criteria.mjs +2 -1
  88. package/dist/chunk-7DBI6SNT.js +0 -55
  89. package/dist/config-HL2AIR3K.js +0 -9
  90. package/dist/docker-NEGDLU6D.js +0 -7
  91. package/dist/init-WVR4BZQ4.js +0 -36
  92. package/dist/machine-2JOWGRSZ.js +0 -35
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @outerlayer/cli
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8da1a39: The runner now builds every image in a Buildx builder of its own, whose container has a memory limit of `runner.build.memory`. A recipe step that uses more memory is stopped, and the build is released failed at provision with a reason that names the limit. Hosts need Docker's Buildx plugin (`docker-buildx-plugin`, version 0.18 or later); a host without it claims no work, and `outerlayer doctor` fails an "Image build limit" check that names the package. Housekeeping now trims the runner's builder cache, not Docker's default builder.
8
+
9
+ `outerlayer runner install`, `runner install --service` and `runner init` also write `~/.local/bin/outerlayer`, a launcher that runs the CLI in the runner's `current` link, so the command on PATH follows a self-update. `runner install --replace` replaces a launcher file the runner did not write.
10
+
11
+ ### Patch Changes
12
+
13
+ - 983c221: A build whose clone fails now says why: the release reason ends with the fatal or error line git printed, not only its exit status.
14
+ - 5a7ca29: The README now says the `OuterLayer evidence` check on GitHub completes once the automated checks pass, without waiting for a person's review in OuterLayer. It also gives the `review` policy key's default correctly as `required`.
15
+ - 628c6c9: A `builtin:vm` build's host checks now run in a new microVM booted from the build's image, where they used to always fail.
16
+ - c2a0315: `outerlayer runner init --vm` sizes the VM's disk with room for the free-disk minimum and the Docker build cache, so the runner in the VM keeps claiming work once its disk fills. With the default limits the disk is 90 GiB, allocated as it is used.
17
+ - 983c221: On WSL2, `outerlayer runner install --service` makes no scheduled task when `WSL_DISTRO_NAME` is unset, as under `sudo`, and prints the `schtasks` command to run instead. It no longer guesses `Ubuntu`, which made a task that started nothing.
18
+
19
+ ## 0.7.0
20
+
21
+ ### Minor Changes
22
+
23
+ - b4fdd73: The runner now runs a repository's `where: host` validators itself after a build, in a new container from the build's image, and records each result under the host's own key. A check that cannot run is recorded as a fail with a reason. `runner.checks.timeLimitMinutes` (default 10, 1 to 240) bounds the environment setup and each check command. The runner CLI is not updated for you on a host with `runner.autoUpdate` off: refresh it by hand on each host to get host checks.
24
+
25
+ ### Patch Changes
26
+
27
+ - 35b0fed: Fixes found by running the runner service on real machines:
28
+
29
+ - A repository fetch with a claim's read token keeps the git settings the host passes in `GIT_CONFIG_*`, such as one in `runner.env`. It added the token over them.
30
+ - `runner install --service --user <account>` refuses when that account cannot execute the Node the install runs on, or read the runner's CLI, instead of installing a service that cannot start.
31
+ - A microVM the kernel kills at its memory limit while it is still starting is released with a reason saying the build ran out of memory, not that the microVM did not start.
32
+ - A microVM build's cgroup reclaims above `build.memory` plus 256 MiB and kills above `build.memory` plus 1 GiB. A real build was killed at plus 256 MiB, because the page cache of its disks' writes is charged to the same cgroup.
33
+
34
+ - f633a70: The template build skill's `record-criteria.mjs` now records a criterion that declares `(proof: test)` with proof `test`. Test results for that criterion now count toward it.
35
+ - 735d939: `work` and `emit` commands now connect the repository themselves when you are logged in, the repository has no saved connection, and exactly one factory fits. They print one line naming the factory and why, save the connection, and carry on. When several factories fit, they refuse and list the `--factory` value for each.
36
+
3
37
  ## 0.6.0
4
38
 
5
39
  ### Minor Changes
package/README.md CHANGED
@@ -101,6 +101,12 @@ content:
101
101
  work — success, or the error code and message the platform returned.
102
102
  When a build's command exits 0, it reads that work item once more, for its
103
103
  evidence verdict, before releasing it: it sends nothing but the request.
104
+ Just before that read, the runner runs the repository's host checks. A host
105
+ check is a command the repository's `where: host` validators declare. The
106
+ runner reads the definitions with the host's own git credentials, runs each
107
+ command in a new container, and sends one `POST /v1/emitted-results` for
108
+ each: the check's name, pass or fail, and for a fail the exit status and the
109
+ last line of its output, scrubbed.
104
110
  Before a build's command starts, the runner also runs `git ls-remote` and
105
111
  `git fetch` in the job's workdir, with the host's own git credentials, to
106
112
  put it on the branch the claim named. Nothing about the job leaves the host
@@ -133,6 +139,10 @@ content:
133
139
  never printed. If this machine held a token from an earlier login, login
134
140
  asks the dashboard to revoke it. A key piped on stdin makes no network
135
141
  call.
142
+ - **`outerlayer work`** and **`outerlayer emit`**, in the subcommands named below, with a login and no saved
143
+ connection for the repository send the same `GET /v1/me/factories?repository=<host/owner/name>`
144
+ request before their own, to connect the repository when exactly one factory
145
+ fits. They send nothing extra with a factory key, `--app-id` or `OUTERLAYER_APP_ID`. The subcommands are `work build`, `list`, `status`, `remove` and `pr`, and `emit artifact`, `result`, `criteria`, `finding` and `findings`. Other `work` subcommands never connect.
136
146
  - **`outerlayer connect`**, and the first step of `outerlayer init`, send a
137
147
  request with your login's token: `GET /v1/me/factories?repository=<host/owner/name>`,
138
148
  naming this checkout's remote. The gateway answers with the factories you can
@@ -403,11 +413,11 @@ pass or fail on an item that is closed or shipped, has no evaluation yet,
403
413
  or whose evaluation is still waiting on a session link, with the code
404
414
  `not_reviewable`. A recorded pass on the general thread carries the head
405
415
  commit of every pull request the item had at the time; once one of them
406
- moves, that pass stops counting and a fresh review is needed. A repository
407
- can require a current pass before the evidence check completes by setting
408
- the base branch's `review` policy key to `required` (default `optional`,
409
- alongside `merge_gate`) — the check then stays in progress, not failed,
410
- until a current pass exists.
416
+ moves, that pass stops counting and a fresh review is needed. The base
417
+ branch's `review` policy key (default `required`, beside `merge_gate`)
418
+ holds the item at "Awaiting a person's review" until a current pass
419
+ exists. The evidence check on GitHub does not wait for that review: it
420
+ completes once the automated checks pass and says the review is pending.
411
421
 
412
422
  A criterion thread is scoped to one acceptance criterion rather than the
413
423
  whole item: an agent attaches proof with `outerlayer work comment
@@ -1,16 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { installStarterPack } from './chunk-ZMYPLFG3.js';
4
- import { runEmit } from './chunk-H5NCNVDA.js';
5
3
  import { addStdioMcpEntryIfAbsent } from './chunk-MQ3IPHIZ.js';
4
+ import { installStarterPack } from './chunk-M3SQ4YGD.js';
5
+ import { runEmit } from './chunk-EV3M3EH7.js';
6
6
  import { C } from './chunk-YRYMNBGQ.js';
7
- import { resolveGitCommonDir, defaultGitRunner } from './chunk-OIRNH6UO.js';
7
+ import { resolveGitCommonDir, defaultGitRunner } from './chunk-5FWNEQNZ.js';
8
8
  import './chunk-ZJSNLVCE.js';
9
- import { pinExists, readContextManifest } from './chunk-WIOZAJ2W.js';
10
- import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-WO2BXCTQ.js';
11
- import { generatedHeaderSource } from './chunk-EMY4I27X.js';
9
+ import { pinExists, readContextManifest } from './chunk-ZZXLM64C.js';
10
+ import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-VXLJORHL.js';
11
+ import { generatedHeaderSource } from './chunk-7ZR5UPMB.js';
12
12
  import './chunk-BCLJSQCV.js';
13
13
  import './chunk-BOLTI6LR.js';
14
+ import './chunk-YNJEOGDL.js';
14
15
  import './chunk-EABW6AJQ.js';
15
16
  import './chunk-RA3O54FC.js';
16
17
  import './chunk-M5POMKKW.js';
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { buildRepositoryImage } from './chunk-Z62HNKEJ.js';
3
+ export { buildRepositoryImage } from './chunk-TTNFGMHO.js';
4
4
  import './chunk-N5FOE5PS.js';
5
5
  export { RecipeError } from './chunk-QOZKPLVJ.js';
6
+ import './chunk-CX22S5BA.js';
7
+ import './chunk-HKMPVPO7.js';
6
8
  import './chunk-ZM2IMMYN.js';
7
9
  import './chunk-Z5GEFMRW.js';
8
10
 
@@ -1 +1 @@
1
- {"id":"2026-10-04T12:35:01.048Z+a19ef31","root":"/home/runner/_work/outerlayer/outerlayer","pkg":"outerlayer"}
1
+ {"id":"2026-10-05T12:31:55.812Z+ff35a38","root":"/home/runner/_work/outerlayer/outerlayer","pkg":"outerlayer"}
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ export { MIN_BUILDX_VERSION, builderName, builderSpec, buildxState, ensureBuilder, ensureFailureCount, isOutOfMemory, proxyEnvironment, trackImageBuild } from './chunk-5TNS3PL7.js';
4
+ import './chunk-CX22S5BA.js';
5
+ import './chunk-GAYWY4GI.js';
6
+ import './chunk-7RQ73DLO.js';
7
+ import './chunk-OD2VTIHN.js';
8
+ import './chunk-HKMPVPO7.js';
9
+ import './chunk-YNJEOGDL.js';
10
+ import './chunk-ZM2IMMYN.js';
11
+ import './chunk-Z5GEFMRW.js';
12
+
13
+ createRequire(import.meta.url);
@@ -1,55 +1,64 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { probeCredentials } from './chunk-43J3M6KB.js';
3
+ import { probeCredentials } from './chunk-IJBVPLZZ.js';
4
4
  import './chunk-ABIWDUMS.js';
5
- import './chunk-YYYXRJUW.js';
6
- import './chunk-VMJ3MMBX.js';
5
+ import './chunk-7VNURP6M.js';
7
6
  import './chunk-T6OIJQRT.js';
8
7
  import './chunk-AIW6GLET.js';
9
8
  import './chunk-UGP76IZ5.js';
10
- import './chunk-ZILGTTY6.js';
11
- import './chunk-CBPPJSAR.js';
12
- import './chunk-UMFWVGJO.js';
9
+ import './chunk-3S4P55NE.js';
10
+ import './chunk-WVGSB3Z2.js';
11
+ import './chunk-AIL2R4SI.js';
13
12
  import './chunk-HHJDN6AU.js';
14
- import { placeholderQueues, placeholderProblem, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem } from './chunk-MXB5VB4Y.js';
13
+ import { placeholderQueues, placeholderProblem, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem } from './chunk-IRCBTGWF.js';
14
+ import './chunk-TI7B7UEO.js';
15
15
  import './chunk-YYYRBYWG.js';
16
16
  import './chunk-TBT347UY.js';
17
- import './chunk-OUUINEYB.js';
18
- import './chunk-4NLKY4WR.js';
19
- import './chunk-RBOMWNOG.js';
20
- import './chunk-RZSF5B46.js';
21
- import './chunk-Z62HNKEJ.js';
17
+ import './chunk-NALVDFIS.js';
18
+ import './chunk-TUUMW4TC.js';
19
+ import './chunk-CM5QTKM4.js';
20
+ import './chunk-JKIWMRFH.js';
21
+ import './chunk-TTNFGMHO.js';
22
22
  import './chunk-N5FOE5PS.js';
23
23
  import './chunk-OGFGZQA3.js';
24
- import './chunk-774HEQL6.js';
24
+ import './chunk-U3GOI2B4.js';
25
25
  import './chunk-QOZKPLVJ.js';
26
- import './chunk-W4SQCOZU.js';
27
- import './chunk-B2G7JHHB.js';
26
+ import './chunk-5TNS3PL7.js';
27
+ import './chunk-CX22S5BA.js';
28
+ import './chunk-ZOAEPWGL.js';
29
+ import './chunk-R7STSBLC.js';
28
30
  import './chunk-F7CU5ABH.js';
29
31
  import './chunk-BKO6JEZI.js';
30
- import './chunk-BNMCXPG7.js';
32
+ import './chunk-5QLNZGAQ.js';
33
+ import './chunk-4ACZCY4I.js';
31
34
  import './chunk-BFESLKPP.js';
32
- import './chunk-3DEVYTNQ.js';
33
- import './chunk-ANK2B36Y.js';
35
+ import './chunk-ILEA3YHM.js';
36
+ import './chunk-ZYHKJKSU.js';
37
+ import './chunk-GAYWY4GI.js';
38
+ import './chunk-USO2DKBD.js';
39
+ import './chunk-N6LURUEF.js';
34
40
  import './chunk-YRYMNBGQ.js';
35
- import { loadRunnerConfig, RunnerConfigError, checkHooks } from './chunk-3DD6AOWC.js';
36
- import './chunk-F6GFZXZ3.js';
37
- import './chunk-AUFG23AA.js';
41
+ import { loadRunnerConfig, RunnerConfigError, checkHooks } from './chunk-PWBILI5P.js';
42
+ import './chunk-UXYLWVTQ.js';
43
+ import './chunk-7RQ73DLO.js';
44
+ import './chunk-OD2VTIHN.js';
45
+ import './chunk-HKMPVPO7.js';
38
46
  import './chunk-GQD22KKN.js';
39
47
  import './chunk-WZBHBH3J.js';
40
48
  import './chunk-5QRP3MVS.js';
41
- import './chunk-OIRNH6UO.js';
49
+ import './chunk-5FWNEQNZ.js';
42
50
  import './chunk-ZJSNLVCE.js';
43
- import './chunk-WIOZAJ2W.js';
44
- import './chunk-WO2BXCTQ.js';
45
- import './chunk-EMY4I27X.js';
51
+ import './chunk-ZZXLM64C.js';
52
+ import './chunk-VXLJORHL.js';
53
+ import './chunk-7ZR5UPMB.js';
46
54
  import './chunk-BCLJSQCV.js';
47
55
  import './chunk-BOLTI6LR.js';
56
+ import './chunk-YNJEOGDL.js';
48
57
  import './chunk-EABW6AJQ.js';
49
58
  import './chunk-RA3O54FC.js';
50
59
  import './chunk-M5POMKKW.js';
51
60
  import './chunk-ZM2IMMYN.js';
52
- import './chunk-FA2BOX4O.js';
61
+ import './chunk-JPR2WHHF.js';
53
62
  import './chunk-XCCLFVXM.js';
54
63
  import './chunk-BJ3KTMDH.js';
55
64
  import './chunk-VNVZDWO3.js';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LiveUploader } from './chunk-UMFWVGJO.js';
4
- import { CaptureDaemon } from './chunk-ANK2B36Y.js';
3
+ import { LiveUploader } from './chunk-AIL2R4SI.js';
4
+ import { CaptureDaemon } from './chunk-GAYWY4GI.js';
5
5
  import { parseWorkItemEnv } from './chunk-GQD22KKN.js';
6
- import { spoolDir } from './chunk-FA2BOX4O.js';
6
+ import { spoolDir } from './chunk-JPR2WHHF.js';
7
7
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
8
  import { mkdirSync, writeFileSync, rmSync } from 'fs';
9
9
  import { join } from 'path';
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { isLinkedRepository } from './chunk-7DBI6SNT.js';
4
3
  import { readStatuslineState, STATE_FRESH_MS } from './chunk-F47JBIAW.js';
5
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-BNMCXPG7.js';
6
- import { sanitizeTerminal } from './chunk-3DEVYTNQ.js';
7
- import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-ANK2B36Y.js';
4
+ import { resolveCredentials, getJson, WorkCommandError } from './chunk-5QLNZGAQ.js';
5
+ import { isLinkedRepository } from './chunk-ILEA3YHM.js';
6
+ import { sanitizeTerminal } from './chunk-ZYHKJKSU.js';
7
+ import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-GAYWY4GI.js';
8
8
  import { C } from './chunk-YRYMNBGQ.js';
9
9
  import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-5QRP3MVS.js';
10
- import { readPin, readContextManifest, readDegraded, readSourceCache } from './chunk-WIOZAJ2W.js';
10
+ import { readPin, readContextManifest, readDegraded, readSourceCache } from './chunk-ZZXLM64C.js';
11
11
  import { defaultFetch } from './chunk-BCLJSQCV.js';
12
12
  import { resolveGatewayCredentials } from './chunk-BOLTI6LR.js';
13
13
  import { readCloudConfig } from './chunk-EABW6AJQ.js';
14
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-FA2BOX4O.js';
14
+ import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-JPR2WHHF.js';
15
15
  import { deadHooksState, preparePackageManagerCommand, contextExcludesPresent } from './chunk-XCCLFVXM.js';
16
16
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
17
17
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -1004,7 +1004,7 @@ function doctorExitCode(checks) {
1004
1004
 
1005
1005
  // src/doctor-report.ts
1006
1006
  async function gatherDoctorChecks() {
1007
- const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-HL2AIR3K.js');
1007
+ const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-Z3USDBLU.js');
1008
1008
  const configPath = defaultRunnerConfigPath();
1009
1009
  const checks = runDoctor({ runnerHost: hasRunnerBlock(configPath) });
1010
1010
  const credential = await credentialChecks();
@@ -1016,7 +1016,7 @@ async function gatherDoctorChecks() {
1016
1016
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1017
1017
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1018
1018
  } else if (hasRunnerBlock(configPath)) {
1019
- const { runnerHostChecks } = await import('./doctor-VOMYOHQU.js');
1019
+ const { runnerHostChecks } = await import('./doctor-WR6TRPSU.js');
1020
1020
  const hooks = (() => {
1021
1021
  try {
1022
1022
  return loadRunnerConfig(configPath).hooks;
@@ -1051,7 +1051,7 @@ async function gatherDoctorChecks() {
1051
1051
  const { existsSync: existsSync2 } = await import('fs');
1052
1052
  if (process.platform !== "linux" || !existsSync2("/run/systemd/system")) return void 0;
1053
1053
  const { inspectService, realInspectProbes } = await import('./inspect-XAUSB7L3.js');
1054
- const { DEFAULT_UNIT_NAME } = await import('./install-DSUZE2TJ.js');
1054
+ const { DEFAULT_UNIT_NAME } = await import('./install-FHTVJZS6.js');
1055
1055
  const { dirname: dirname2 } = await import('path');
1056
1056
  return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
1057
1057
  })();
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { fetchFactories, selectFactory, saveFactoryConnection, connectedLine } from './chunk-ILEA3YHM.js';
4
+ import { resolveRepoIdentity } from './chunk-GAYWY4GI.js';
5
+ import { resolveGatewayCredentials } from './chunk-BOLTI6LR.js';
6
+ import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
7
+ import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
+
9
+ createRequire(import.meta.url);
10
+
11
+ // src/auto-connect.ts
12
+ async function autoConnect(opts) {
13
+ const env = opts.env ?? process.env;
14
+ const home = opts.home ?? homeFromEnv(env);
15
+ const cwd = opts.cwd ?? process.cwd();
16
+ const resolved = resolveGatewayCredentials({ url: opts.url, apiKey: opts.apiKey, appId: opts.appId, home, env, cwd });
17
+ if (resolved.ok || resolved.kind !== "login" || !resolved.credential || !resolved.url) return void 0;
18
+ const dirs = findGitDirs(cwd);
19
+ const repository = resolveRepoIdentity(cwd).gitRepo;
20
+ if (dirs === void 0 || repository === void 0) return void 0;
21
+ const listed = await fetchFactories(opts.fetchImpl ?? fetch, resolved.url, resolved.credential, repository);
22
+ if (!listed.ok || listed.factories.length === 0) return void 0;
23
+ const chosen = selectFactory(listed.factories, readRepoConnection(cwd), repository);
24
+ if (chosen.factory === void 0) {
25
+ return `you are logged in, but no factory is chosen for this repository, and more than one fits. Run \`outerlayer connect --factory <org>/<factory>\` with one of:
26
+ ${chosen.text}
27
+ Or pass --app-id / set OUTERLAYER_APP_ID.`;
28
+ }
29
+ try {
30
+ saveFactoryConnection(dirs.gitCommonDir, void 0, chosen.factory, /* @__PURE__ */ new Date());
31
+ } catch {
32
+ return void 0;
33
+ }
34
+ process.stderr.write(`${connectedLine(repository, chosen.factory, chosen.reason)}
35
+ `);
36
+ return void 0;
37
+ }
38
+
39
+ export { autoConnect };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
4
- import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, SOURCE_CACHE_TTL_SUCCESS_MS, isLastCheckFresh, readDegraded, touchLastCheck, clearDegraded, writeContextManifest, writePinIfChanged, readSourceCache, isSourceCacheFresh } from './chunk-WIOZAJ2W.js';
5
- import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-WO2BXCTQ.js';
6
- import { parseGoverns, normalizeRepoName, CONTEXT_SOURCE_CONFIG_PATH, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-EMY4I27X.js';
4
+ import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, SOURCE_CACHE_TTL_SUCCESS_MS, isLastCheckFresh, readDegraded, touchLastCheck, clearDegraded, writeContextManifest, writePinIfChanged, readSourceCache, isSourceCacheFresh } from './chunk-ZZXLM64C.js';
5
+ import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-VXLJORHL.js';
6
+ import { parseGoverns, normalizeRepoName, CONTEXT_SOURCE_CONFIG_PATH, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-7ZR5UPMB.js';
7
7
  import { defaultFetch } from './chunk-BCLJSQCV.js';
8
8
  import { resolveGatewayCredentials } from './chunk-BOLTI6LR.js';
9
9
  import { ensureContextExcludes, ensurePreCommitGuardHook } from './chunk-XCCLFVXM.js';
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
+ import { autoConnect } from './chunk-4ACZCY4I.js';
3
4
  import { detectActiveSession } from './chunk-BFESLKPP.js';
4
- import { sanitizeTerminal } from './chunk-3DEVYTNQ.js';
5
- import { resolveRepoIdentity } from './chunk-ANK2B36Y.js';
5
+ import { sanitizeTerminal } from './chunk-ZYHKJKSU.js';
6
+ import { resolveRepoIdentity } from './chunk-GAYWY4GI.js';
6
7
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
7
8
  import { defaultFetch } from './chunk-BCLJSQCV.js';
8
9
  import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-BOLTI6LR.js';
@@ -79,6 +80,10 @@ function resolveCredentials(opts) {
79
80
  if (!resolved.ok) throw new WorkCommandError(resolved.message);
80
81
  return { url: resolved.url, apiKey: resolved.credential, appId: resolved.appId };
81
82
  }
83
+ async function connectIfOneFits(opts) {
84
+ const refusal = await autoConnect(opts);
85
+ if (refusal !== void 0) throw new WorkCommandError(refusal);
86
+ }
82
87
  function resolveRepository(repoFlag, cwd) {
83
88
  if (repoFlag) return repoFlag;
84
89
  const identity = resolveRepoIdentity(cwd);
@@ -299,6 +304,7 @@ async function runWorkBuild(opts) {
299
304
  const cwd = opts.cwd ?? process.cwd();
300
305
  const env = opts.env ?? process.env;
301
306
  const home = opts.home ?? homeFromEnv(env);
307
+ await connectIfOneFits(opts);
302
308
  const { url, apiKey, appId } = resolveCredentials(opts);
303
309
  const fetchImpl = opts.fetchImpl ?? defaultFetch;
304
310
  const facts = environmentFacts({ cwd, env, home, sessionIdOverride: opts.sessionId });
@@ -341,7 +347,7 @@ async function runWorkLinkSession(opts) {
341
347
  return await linkSession(opts);
342
348
  } catch (err) {
343
349
  if (opts.logFailures) {
344
- const { logHookError } = await import('./hook-fast-NJBBZQ5Q.js');
350
+ const { logHookError } = await import('./hook-fast-XBOZ3N6L.js');
345
351
  const reason = err instanceof Error ? err.message : String(err);
346
352
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
347
353
  }
@@ -389,6 +395,7 @@ async function runWorkRemove(opts) {
389
395
  const cwd = opts.cwd ?? process.cwd();
390
396
  const env = opts.env ?? process.env;
391
397
  const home = opts.home ?? homeFromEnv(env);
398
+ await connectIfOneFits(opts);
392
399
  const creds = resolveCredentials(opts);
393
400
  if (!opts.reason) {
394
401
  throw new WorkCommandError("--reason is required \u2014 a removal records why");
@@ -432,6 +439,7 @@ async function runWorkRemove(opts) {
432
439
  }
433
440
  async function runWorkStatus(opts) {
434
441
  const cwd = opts.cwd ?? process.cwd();
442
+ await connectIfOneFits(opts);
435
443
  const creds = resolveCredentials(opts);
436
444
  const fetchByItem = opts.item !== void 0 ? parsePositiveInt(opts.item, "--item") : void 0;
437
445
  if (fetchByItem !== void 0) {
@@ -461,6 +469,7 @@ async function runWorkStatus(opts) {
461
469
  }
462
470
  async function runWorkList(opts) {
463
471
  const cwd = opts.cwd ?? process.cwd();
472
+ await connectIfOneFits(opts);
464
473
  const { url, apiKey, appId } = resolveCredentials(opts);
465
474
  const fetchImpl = opts.fetchImpl ?? defaultFetch;
466
475
  const repository = opts.repo ?? resolveRepoIdentity(cwd).gitRepo;