@outerlayer/cli 0.18.0 → 0.19.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 (102) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +21 -2
  3. package/dist/{agent-setup-RBTEACYU.js → agent-setup-AM42SA2D.js} +15 -16
  4. package/dist/{artifact-link-cmd-AVM2EKTV.js → artifact-link-cmd-OWRI5AJX.js} +2 -2
  5. package/dist/build-info.json +1 -1
  6. package/dist/{builder-DUI2ZH2H.js → builder-C4QNTYMS.js} +3 -3
  7. package/dist/{check-5C4YDZYV.js → check-W2JGXN3B.js} +44 -43
  8. package/dist/{chunk-S26M3YBJ.js → chunk-3UZTIRLF.js} +1 -1
  9. package/dist/{chunk-Y5MXET4M.js → chunk-3ZR7Y23Y.js} +11 -10
  10. package/dist/{chunk-47TTLEDX.js → chunk-5VML45HH.js} +35 -13
  11. package/dist/{chunk-F4XSVQJ4.js → chunk-6X4SQ5MY.js} +2 -2
  12. package/dist/{chunk-T4Y6SCG3.js → chunk-7UWVLZXD.js} +2 -2
  13. package/dist/{chunk-N3CUDFCW.js → chunk-7VUK5RFS.js} +15 -2
  14. package/dist/{chunk-SWCTGCSC.js → chunk-7YP7T6GV.js} +1 -1
  15. package/dist/{chunk-3OFZM4X6.js → chunk-B6SCN5NY.js} +151 -20
  16. package/dist/{chunk-KDVIU23F.js → chunk-BWSUPRDK.js} +1 -1
  17. package/dist/{chunk-S76AYB4M.js → chunk-CG36IONK.js} +5 -5
  18. package/dist/{chunk-RAZTWYZN.js → chunk-CGGPS7SI.js} +7 -8
  19. package/dist/chunk-CJJDJ7AT.js +56 -0
  20. package/dist/{chunk-W5VPCONO.js → chunk-EAEELQVQ.js} +33 -227
  21. package/dist/{chunk-QQM2UJ6T.js → chunk-F2KXHIFI.js} +182 -28
  22. package/dist/{chunk-KK4VBOH6.js → chunk-FBTGMSQF.js} +10 -11
  23. package/dist/{chunk-MQJSXHV7.js → chunk-G3IJ3N6F.js} +5 -3
  24. package/dist/{chunk-FUB7LRUE.js → chunk-GEMQLBMW.js} +5 -5
  25. package/dist/{chunk-Y5GE76XC.js → chunk-HOKXGFDR.js} +33 -81
  26. package/dist/{chunk-IP7BIBXJ.js → chunk-IF2OSI5T.js} +35 -1
  27. package/dist/{chunk-UYOYTKE2.js → chunk-JHGEBPLE.js} +3 -3
  28. package/dist/chunk-KYS3TQAG.js +296 -0
  29. package/dist/chunk-LLM3I5YU.js +89 -0
  30. package/dist/{chunk-B3UKB46N.js → chunk-LRG3ZMZD.js} +4 -5
  31. package/dist/{chunk-NL4XPC7W.js → chunk-LW7G5TJB.js} +1 -1
  32. package/dist/{chunk-MNTSH4CL.js → chunk-NNLA7LLQ.js} +1 -1
  33. package/dist/{chunk-GOBOJMOJ.js → chunk-PIZRPNKR.js} +4 -4
  34. package/dist/{chunk-ULSIJGLS.js → chunk-PSN33ERW.js} +56 -14
  35. package/dist/{chunk-WGAUY5LE.js → chunk-QEFKA2QD.js} +1 -1
  36. package/dist/{chunk-BMYGAGBJ.js → chunk-QNLX477Q.js} +155 -23
  37. package/dist/{chunk-JF42URPU.js → chunk-R22NZSGA.js} +33 -9
  38. package/dist/chunk-TUSYOL2O.js +113 -0
  39. package/dist/{chunk-ESC6UR76.js → chunk-TWF3RICI.js} +6 -6
  40. package/dist/{chunk-L2USZT6T.js → chunk-VMJPFQNE.js} +1 -1
  41. package/dist/{chunk-X5N6KC6V.js → chunk-WFSUUUAN.js} +2 -3
  42. package/dist/{chunk-6CHIYEZZ.js → chunk-XZ4H4X5F.js} +9 -83
  43. package/dist/{chunk-LXAY4A2G.js → chunk-YQR6E6OV.js} +34 -49
  44. package/dist/chunk-Z7K3L4FC.js +174 -0
  45. package/dist/{claude-launcher-YVXI76NX.js → claude-launcher-J5M44PFS.js} +20 -7
  46. package/dist/{cli-C77H54BV.js → cli-EXX2R73G.js} +206 -230
  47. package/dist/{command-H5CILO4S.js → command-ZQNEPDS6.js} +29 -30
  48. package/dist/{config-FXDG4NPJ.js → config-CLSGABD5.js} +2 -2
  49. package/dist/{connect-cmd-ZW5FV3ZW.js → connect-cmd-UNYKGDAL.js} +7 -7
  50. package/dist/context-cleanup-CHEWNYU6.js +11 -0
  51. package/dist/control-plane-launch-34LNRJWR.js +216 -0
  52. package/dist/{dist-QTX4RSCL.js → dist-WO7NOJNG.js} +2 -2
  53. package/dist/{docker-RC3PRX3Q.js → docker-BFU3AQGY.js} +4 -4
  54. package/dist/{doctor-2NQQML6P.js → doctor-DHUM5DBB.js} +32 -33
  55. package/dist/{emit-artifact-cmd-7MP63KXU.js → emit-artifact-cmd-XBHM647X.js} +17 -17
  56. package/dist/{emit-cmd-PPN4QQF2.js → emit-cmd-W55AEBCA.js} +6 -6
  57. package/dist/{emit-criteria-cmd-3RXPDLNK.js → emit-criteria-cmd-CRTYEF7D.js} +11 -12
  58. package/dist/{emit-finding-cmd-OL7JB6H3.js → emit-finding-cmd-7JHVRYOP.js} +12 -13
  59. package/dist/{emit-result-cmd-UZVMOCF4.js → emit-result-cmd-5NZMLCJK.js} +17 -17
  60. package/dist/emit-step-cmd-347XNGPQ.js +26 -0
  61. package/dist/{governing-source-BUU4IABS.js → governing-source-HAA4OW57.js} +21 -22
  62. package/dist/{hook-fast-W5MKHMJT.js → hook-fast-RL5E5OXE.js} +3 -3
  63. package/dist/{import-capture-cmd-ZO6KGHI2.js → import-capture-cmd-TK4XY7RD.js} +4 -4
  64. package/dist/{import-ruler-cmd-KJMWL5V6.js → import-ruler-cmd-T6LLO6Q7.js} +2 -2
  65. package/dist/index.js +4 -4
  66. package/dist/{init-WNXXYMO7.js → init-V6FOMD2V.js} +30 -31
  67. package/dist/{init-VWXIZEAN.js → init-XG47KCI4.js} +30 -31
  68. package/dist/{init-cmd-WS6TIRYT.js → init-cmd-Z4O4PPLZ.js} +70 -27
  69. package/dist/{init-update-E3J6TVIN.js → init-update-7DVAKWW3.js} +21 -22
  70. package/dist/{install-CBWIEF3R.js → install-4SEFIIW2.js} +3 -3
  71. package/dist/{login-browser-O63QZN7D.js → login-browser-DX35MARZ.js} +2 -2
  72. package/dist/{loop-UGI2BJOT.js → loop-TPUYUMSY.js} +44 -43
  73. package/dist/{machine-JOW4RNZ7.js → machine-TRHBT5NE.js} +26 -27
  74. package/dist/{mcp-serve-cmd-DOTY5FKY.js → mcp-serve-cmd-N3UTY6EE.js} +5 -5
  75. package/dist/{runner-env-4NB2GA7O.js → runner-env-FRZFFHDF.js} +4 -4
  76. package/dist/{runner-key-TC3NFWFV.js → runner-key-5FOWCW7J.js} +30 -31
  77. package/dist/{session-sender-NNVPSPY7.js → session-sender-U2BBUWNO.js} +19 -15
  78. package/dist/shell-function-NRD4KVUK.js +6 -0
  79. package/dist/{spec-cmd-OWVTBB4J.js → spec-cmd-FVLJOFGC.js} +12 -13
  80. package/dist/{starter-pack-OPWUDOWX.js → starter-pack-6LQVLBIA.js} +5 -5
  81. package/dist/{status-TKCLLKFG.js → status-BINH7MBG.js} +33 -32
  82. package/dist/{sync-cmd-Q6VYNPWG.js → sync-cmd-VXOUFS4I.js} +18 -14
  83. package/dist/{watch-ARAGADTF.js → watch-OH645CV2.js} +18 -14
  84. package/dist/{work-claim-cmd-34FERLYX.js → work-claim-cmd-ZRPSHMPT.js} +16 -17
  85. package/dist/{work-cmd-7S5B2H2P.js → work-cmd-5I3J2XQQ.js} +12 -13
  86. package/dist/{work-comment-cmd-SZJSPM5S.js → work-comment-cmd-UCCPWUSR.js} +12 -13
  87. package/dist/work-logs-cmd-7352CJPG.js +60 -0
  88. package/dist/{work-open-pr-cmd-RPXKCBWS.js → work-open-pr-cmd-LSH4VHJM.js} +13 -14
  89. package/dist/{work-pr-cmd-5LGANL32.js → work-pr-cmd-H4OQR26N.js} +12 -13
  90. package/package.json +2 -2
  91. package/skill-pack/maintained/outerlayer-cli/SKILL.md +9 -2
  92. package/skill-pack/maintained/outerlayer-cli/references/find-out-why-a-build-ended.md +76 -0
  93. package/skill-pack/shipped.json +1 -0
  94. package/skill-pack/template/build/references/release.md +3 -1
  95. package/dist/chunk-WBT5X3NH.js +0 -40
  96. package/dist/chunk-XCCLFVXM.js +0 -401
  97. package/dist/context-adopt-O5OFXMKI.js +0 -109
  98. package/dist/context-materialize-Y5IJ4MQT.js +0 -23
  99. package/dist/{chunk-NACDBXUG.js → chunk-BM63HB2M.js} +1 -1
  100. package/dist/{chunk-ZRL6HKBY.js → chunk-FVMYKL6L.js} +1 -1
  101. package/dist/{chunk-52NC2FIU.js → chunk-NTRCK4NH.js} +1 -1
  102. package/dist/{chunk-XGP3VYOG.js → chunk-P53VEAOF.js} +1 -1
@@ -1,30 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_PROTOCOL } from './chunk-KDVIU23F.js';
4
- import { resolveCredentials, WorkCommandError, parsePositiveInt, postJson, environmentFacts, findLiveItemForIssue } from './chunk-KK4VBOH6.js';
5
- export { WorkCommandError } from './chunk-KK4VBOH6.js';
6
- import './chunk-WBT5X3NH.js';
7
- import './chunk-IP7BIBXJ.js';
8
- import './chunk-S76AYB4M.js';
9
- import './chunk-MQJSXHV7.js';
10
- import { defaultRunnerConfigPath } from './chunk-XGP3VYOG.js';
3
+ import { RUNNER_PROTOCOL } from './chunk-BWSUPRDK.js';
4
+ import { resolveCredentials, WorkCommandError, parsePositiveInt, postJson, environmentFacts, findLiveItemForIssue } from './chunk-FBTGMSQF.js';
5
+ export { WorkCommandError } from './chunk-FBTGMSQF.js';
6
+ import './chunk-IF2OSI5T.js';
7
+ import './chunk-CG36IONK.js';
8
+ import './chunk-G3IJ3N6F.js';
9
+ import './chunk-BM63HB2M.js';
10
+ import { defaultRunnerConfigPath } from './chunk-P53VEAOF.js';
11
11
  import './chunk-UXYLWVTQ.js';
12
12
  import './chunk-7RQ73DLO.js';
13
- import './chunk-BMYGAGBJ.js';
14
- import './chunk-NACDBXUG.js';
13
+ import './chunk-QNLX477Q.js';
15
14
  import './chunk-GOSFARMS.js';
16
15
  import './chunk-ANPNT6PM.js';
17
16
  import './chunk-WZBHBH3J.js';
18
- import { defaultFetch } from './chunk-ZRL6HKBY.js';
19
- import './chunk-52NC2FIU.js';
20
- import './chunk-N3CUDFCW.js';
17
+ import { defaultFetch } from './chunk-FVMYKL6L.js';
18
+ import './chunk-NTRCK4NH.js';
19
+ import './chunk-BJ3KTMDH.js';
21
20
  import './chunk-EABW6AJQ.js';
21
+ import './chunk-CRB3POP4.js';
22
+ import './chunk-7VUK5RFS.js';
23
+ import { homeFromEnv } from './chunk-VNVZDWO3.js';
22
24
  import { ensureHostKey } from './chunk-M2ZWWTWZ.js';
23
25
  import './chunk-N2PXGQRL.js';
24
26
  import './chunk-BQXFBI7T.js';
25
- import './chunk-BJ3KTMDH.js';
26
- import './chunk-CRB3POP4.js';
27
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
28
27
  import './chunk-Z5GEFMRW.js';
29
28
  import { hostname } from 'os';
30
29
 
@@ -116,7 +115,7 @@ async function runWorkRelease(opts) {
116
115
  { sessionId, ended: true },
117
116
  fetchImpl
118
117
  );
119
- const { markWorkLeaseRenewed } = await import('./hook-fast-W5MKHMJT.js');
118
+ const { markWorkLeaseRenewed } = await import('./hook-fast-RL5E5OXE.js');
120
119
  markWorkLeaseRenewed(sessionId, opts.home ?? homeFromEnv(env));
121
120
  const output2 = opts.json ? JSON.stringify(data2) : `released session ${sessionId}'s lease on #${itemId}, if it held one`;
122
121
  if (!opts.quiet) process.stdout.write(output2 + "\n");
@@ -1,25 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { WorkCommandError, environmentFacts, findLiveItemForIssue, getJson, parsePositiveInt, patchJson, postJson, resolveCredentials, runWorkBuild, runWorkLinkSession, runWorkList, runWorkRemove, runWorkStatus } from './chunk-KK4VBOH6.js';
4
- import './chunk-WBT5X3NH.js';
5
- import './chunk-IP7BIBXJ.js';
6
- import './chunk-S76AYB4M.js';
7
- import './chunk-MQJSXHV7.js';
8
- import './chunk-BMYGAGBJ.js';
9
- import './chunk-NACDBXUG.js';
3
+ export { WorkCommandError, environmentFacts, findLiveItemForIssue, getJson, parsePositiveInt, patchJson, postJson, resolveCredentials, runWorkBuild, runWorkLinkSession, runWorkList, runWorkRemove, runWorkStatus } from './chunk-FBTGMSQF.js';
4
+ import './chunk-IF2OSI5T.js';
5
+ import './chunk-CG36IONK.js';
6
+ import './chunk-G3IJ3N6F.js';
7
+ import './chunk-BM63HB2M.js';
8
+ import './chunk-QNLX477Q.js';
10
9
  import './chunk-GOSFARMS.js';
11
10
  import './chunk-ANPNT6PM.js';
12
11
  import './chunk-WZBHBH3J.js';
13
- import './chunk-ZRL6HKBY.js';
14
- import './chunk-52NC2FIU.js';
15
- import './chunk-N3CUDFCW.js';
12
+ import './chunk-FVMYKL6L.js';
13
+ import './chunk-NTRCK4NH.js';
14
+ import './chunk-BJ3KTMDH.js';
16
15
  import './chunk-EABW6AJQ.js';
16
+ import './chunk-CRB3POP4.js';
17
+ import './chunk-7VUK5RFS.js';
18
+ import './chunk-VNVZDWO3.js';
17
19
  import './chunk-M2ZWWTWZ.js';
18
20
  import './chunk-N2PXGQRL.js';
19
21
  import './chunk-BQXFBI7T.js';
20
- import './chunk-BJ3KTMDH.js';
21
- import './chunk-CRB3POP4.js';
22
- import './chunk-VNVZDWO3.js';
23
22
  import './chunk-Z5GEFMRW.js';
24
23
 
25
24
  createRequire(import.meta.url);
@@ -1,25 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveCredentials, postJson, getJson } from './chunk-KK4VBOH6.js';
4
- import './chunk-WBT5X3NH.js';
5
- import { detectActiveSession } from './chunk-IP7BIBXJ.js';
6
- import './chunk-S76AYB4M.js';
7
- import { sanitizeTerminal } from './chunk-MQJSXHV7.js';
8
- import { resolveRepoIdentity } from './chunk-BMYGAGBJ.js';
9
- import './chunk-NACDBXUG.js';
3
+ import { resolveCredentials, postJson, getJson } from './chunk-FBTGMSQF.js';
4
+ import { detectActiveSession } from './chunk-IF2OSI5T.js';
5
+ import './chunk-CG36IONK.js';
6
+ import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
7
+ import './chunk-BM63HB2M.js';
8
+ import { resolveRepoIdentity } from './chunk-QNLX477Q.js';
10
9
  import './chunk-GOSFARMS.js';
11
10
  import { C } from './chunk-ANPNT6PM.js';
12
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
13
- import { defaultFetch } from './chunk-ZRL6HKBY.js';
14
- import './chunk-52NC2FIU.js';
15
- import './chunk-N3CUDFCW.js';
12
+ import { defaultFetch } from './chunk-FVMYKL6L.js';
13
+ import './chunk-NTRCK4NH.js';
14
+ import './chunk-BJ3KTMDH.js';
16
15
  import './chunk-EABW6AJQ.js';
16
+ import './chunk-CRB3POP4.js';
17
+ import './chunk-7VUK5RFS.js';
18
+ import { homeFromEnv } from './chunk-VNVZDWO3.js';
17
19
  import './chunk-M2ZWWTWZ.js';
18
20
  import './chunk-N2PXGQRL.js';
19
21
  import './chunk-BQXFBI7T.js';
20
- import './chunk-BJ3KTMDH.js';
21
- import './chunk-CRB3POP4.js';
22
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
23
22
  import './chunk-Z5GEFMRW.js';
24
23
  import { randomUUID } from 'crypto';
25
24
 
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { resolveCredentials, getJson } from './chunk-FBTGMSQF.js';
4
+ import './chunk-IF2OSI5T.js';
5
+ import './chunk-CG36IONK.js';
6
+ import './chunk-G3IJ3N6F.js';
7
+ import './chunk-BM63HB2M.js';
8
+ import './chunk-QNLX477Q.js';
9
+ import './chunk-GOSFARMS.js';
10
+ import './chunk-ANPNT6PM.js';
11
+ import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
+ import { defaultFetch } from './chunk-FVMYKL6L.js';
13
+ import './chunk-NTRCK4NH.js';
14
+ import './chunk-BJ3KTMDH.js';
15
+ import './chunk-EABW6AJQ.js';
16
+ import './chunk-CRB3POP4.js';
17
+ import './chunk-7VUK5RFS.js';
18
+ import './chunk-VNVZDWO3.js';
19
+ import './chunk-M2ZWWTWZ.js';
20
+ import './chunk-N2PXGQRL.js';
21
+ import './chunk-BQXFBI7T.js';
22
+ import './chunk-Z5GEFMRW.js';
23
+
24
+ createRequire(import.meta.url);
25
+
26
+ // src/work-logs-cmd.ts
27
+ var WorkLogsCommandError = class extends Error {
28
+ };
29
+ async function runWorkLogs(opts) {
30
+ const itemNumber = parseTrackerNumber(opts.item);
31
+ if (itemNumber === void 0) {
32
+ throw new WorkLogsCommandError(trackerNumberError("--item", opts.item ?? ""));
33
+ }
34
+ const creds = resolveCredentials(opts);
35
+ const fetchImpl = opts.fetchImpl ?? defaultFetch;
36
+ const attempt = opts.attempt ?? "newest";
37
+ const { data } = await getJson(
38
+ creds.url,
39
+ `/v1/work-items/${itemNumber}/claims/${encodeURIComponent(attempt)}/log`,
40
+ creds.apiKey,
41
+ creds.appId,
42
+ fetchImpl
43
+ );
44
+ const body = data;
45
+ if (opts.json) {
46
+ const output2 = JSON.stringify(data);
47
+ if (!opts.quiet) process.stdout.write(output2 + "\n");
48
+ if (body.log === null) throw new WorkLogsCommandError(unavailable(body));
49
+ return { data, output: output2 };
50
+ }
51
+ if (body.log === null) throw new WorkLogsCommandError(unavailable(body));
52
+ const output = body.log;
53
+ if (!opts.quiet) process.stdout.write(output);
54
+ return { data, output };
55
+ }
56
+ function unavailable(body) {
57
+ return body.releasedAt === null ? `attempt ${body.claimId} is still running; the runner sends its log when it releases the attempt` : `attempt ${body.claimId} was released by a runner too old to upload its log`;
58
+ }
59
+
60
+ export { WorkLogsCommandError, runWorkLogs };
@@ -1,27 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { itemLabel, runWorkPr, WorkPrCommandError } from './chunk-B3UKB46N.js';
4
- import { resolveCredentials } from './chunk-KK4VBOH6.js';
5
- import './chunk-WBT5X3NH.js';
6
- import './chunk-IP7BIBXJ.js';
7
- import './chunk-S76AYB4M.js';
8
- import './chunk-MQJSXHV7.js';
9
- import './chunk-BMYGAGBJ.js';
10
- import './chunk-NACDBXUG.js';
3
+ import { itemLabel, runWorkPr, WorkPrCommandError } from './chunk-LRG3ZMZD.js';
4
+ import { resolveCredentials } from './chunk-FBTGMSQF.js';
5
+ import './chunk-IF2OSI5T.js';
6
+ import './chunk-CG36IONK.js';
7
+ import './chunk-G3IJ3N6F.js';
8
+ import './chunk-BM63HB2M.js';
9
+ import './chunk-QNLX477Q.js';
11
10
  import './chunk-GOSFARMS.js';
12
11
  import { C } from './chunk-ANPNT6PM.js';
13
12
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
14
13
  import './chunk-WZBHBH3J.js';
15
- import { defaultFetch } from './chunk-ZRL6HKBY.js';
16
- import './chunk-52NC2FIU.js';
17
- import './chunk-N3CUDFCW.js';
14
+ import { defaultFetch } from './chunk-FVMYKL6L.js';
15
+ import './chunk-NTRCK4NH.js';
16
+ import './chunk-BJ3KTMDH.js';
18
17
  import './chunk-EABW6AJQ.js';
18
+ import './chunk-CRB3POP4.js';
19
+ import './chunk-7VUK5RFS.js';
20
+ import { homeFromEnv } from './chunk-VNVZDWO3.js';
19
21
  import './chunk-M2ZWWTWZ.js';
20
22
  import './chunk-N2PXGQRL.js';
21
23
  import './chunk-BQXFBI7T.js';
22
- import './chunk-BJ3KTMDH.js';
23
- import './chunk-CRB3POP4.js';
24
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
25
24
  import './chunk-Z5GEFMRW.js';
26
25
  import { spawnSync } from 'child_process';
27
26
  import { readFileSync } from 'fs';
@@ -1,26 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { WorkPrCommandError, itemLabel, runWorkPr } from './chunk-B3UKB46N.js';
4
- import './chunk-WBT5X3NH.js';
5
- import './chunk-IP7BIBXJ.js';
6
- import './chunk-S76AYB4M.js';
7
- import './chunk-MQJSXHV7.js';
8
- import './chunk-BMYGAGBJ.js';
9
- import './chunk-NACDBXUG.js';
3
+ export { WorkPrCommandError, itemLabel, runWorkPr } from './chunk-LRG3ZMZD.js';
4
+ import './chunk-IF2OSI5T.js';
5
+ import './chunk-CG36IONK.js';
6
+ import './chunk-G3IJ3N6F.js';
7
+ import './chunk-BM63HB2M.js';
8
+ import './chunk-QNLX477Q.js';
10
9
  import './chunk-GOSFARMS.js';
11
10
  import './chunk-ANPNT6PM.js';
12
11
  import './chunk-T2Q7ISPE.js';
13
12
  import './chunk-WZBHBH3J.js';
14
- import './chunk-ZRL6HKBY.js';
15
- import './chunk-52NC2FIU.js';
16
- import './chunk-N3CUDFCW.js';
13
+ import './chunk-FVMYKL6L.js';
14
+ import './chunk-NTRCK4NH.js';
15
+ import './chunk-BJ3KTMDH.js';
17
16
  import './chunk-EABW6AJQ.js';
17
+ import './chunk-CRB3POP4.js';
18
+ import './chunk-7VUK5RFS.js';
19
+ import './chunk-VNVZDWO3.js';
18
20
  import './chunk-M2ZWWTWZ.js';
19
21
  import './chunk-N2PXGQRL.js';
20
22
  import './chunk-BQXFBI7T.js';
21
- import './chunk-BJ3KTMDH.js';
22
- import './chunk-CRB3POP4.js';
23
- import './chunk-VNVZDWO3.js';
24
23
  import './chunk-Z5GEFMRW.js';
25
24
 
26
25
  createRequire(import.meta.url);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outerlayer/cli",
3
- "version": "0.18.0",
4
- "description": "OuterLayer CLI — commands: init, 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.",
3
+ "version": "0.19.1",
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.",
7
7
  "repository": {
@@ -5,8 +5,8 @@ description: >
5
5
  OUTERLAYER_WORK variable, the factory, and building an issue or specifying one.
6
6
  Use when asked about OuterLayer, a work item, OUTERLAYER_WORK, "build issue
7
7
  42", how an issue becomes a pull request, how a build opens its pull request
8
- (a runner build or a local session), or how to attach evidence or answer a
9
- review.
8
+ (a runner build or a local session), why a build failed or ended, or how to
9
+ attach evidence or answer a review.
10
10
  ---
11
11
 
12
12
  Run the CLI as `outerlayer`. If that command is not on PATH, run `npx -y @outerlayer/cli` with the same arguments. Every `outerlayer ...` command below follows this rule.
@@ -69,6 +69,13 @@ Launching recorded work needs Claude Code. It is the one agent whose sessions
69
69
  OuterLayer can start with `OUTERLAYER_WORK` set and record. Other agents can
70
70
  read the files this repository emits, but they cannot be launched as work.
71
71
 
72
+ ## When a build failed or ended
73
+
74
+ Start from OuterLayer, not from the host. The work item says how an attempt
75
+ ended, which session ran in it, and what the runner did around the agent. The
76
+ steps, and what each outcome and reason means, are in
77
+ [references/find-out-why-a-build-ended.md](references/find-out-why-a-build-ended.md).
78
+
72
79
  ## Reading work items
73
80
 
74
81
  When the OuterLayer MCP server is configured in this repository, its
@@ -0,0 +1,76 @@
1
+ # Find out why a build ended
2
+
3
+ A host build that ends badly leaves a record on its work item. Read it in this
4
+ order, and go to the host only when OuterLayer cannot answer. Each step names
5
+ the CLI command and the MCP tool that read the same data.
6
+
7
+ ## 1. Read the item
8
+
9
+ `outerlayer work status --item <number> --json`, or the MCP tool
10
+ `get_work_item`. The item lists every attempt in `claims`, newest first. Each
11
+ attempt has an `id`, its `outcome`, the `stage` it ended in, the `exitCode` of
12
+ that stage's process, a `reason`, and when it started and was released.
13
+
14
+ ## 2. Read the claim
15
+
16
+ Take the newest claim whose `holderKind` is `host`. Classify how it ended from
17
+ `outcome`, `stage`, `exitCode` and `reason`.
18
+
19
+ | Outcome | Meaning |
20
+ | --- | --- |
21
+ | `ok` | The command exited 0 and the item's checks passed. |
22
+ | `incomplete` | The command exited 0, but the item's checks failed or had no result. The `reason` names what is not done. |
23
+ | `failed` | The command exited non-zero, or a stage failed. Read `stage` and `reason`. |
24
+ | `timed_out` | The runner ended the command at its time limit. |
25
+ | `idle` | The runner ended the command because it wrote nothing for the idle limit. |
26
+ | `lease_lost` | The runner could not renew its lease, so it ended the build. |
27
+ | `interrupted` | The runner stopped or crashed and found the build unfinished. |
28
+ | `stopped` | An operator stopped the runner with `runner stop --now`. |
29
+
30
+ Two reasons say the command ended without the runner's doing:
31
+
32
+ - `the command exited <status>, the status of a process killed by <SIGNAL>; the runner did not end it`.
33
+ The status is 128 plus the signal number. A process killed by a signal
34
+ reports that status, and so does a program that exits with it on its own.
35
+ The runner cannot tell them apart. `137` is the status a process killed by
36
+ SIGKILL returns, which the kernel's out-of-memory killer also uses.
37
+ - `the command was killed by <SIGNAL> on the host; the runner did not end it`.
38
+ The command's process on the host died of a signal the runner did not send,
39
+ and there is no exit code.
40
+
41
+ Either one means something outside the runner ended the command: a person or
42
+ a script on the host, a supervisor, or the kernel. A build the kernel killed
43
+ for memory says so in its own reason, which comes first.
44
+
45
+ ## 3. Read the session
46
+
47
+ Each session on the item has a `claimId`. The session whose `claimId` matches
48
+ the attempt is the one that ran in it. Read it with the MCP tool `get_session`
49
+ and the session's `traceId`. It shows what the agent was doing when the attempt
50
+ ended, including a turn that ended while work was still running. A session
51
+ linked by a person or a pull request has a `claimId` of null.
52
+
53
+ ## 4. Read the runner log
54
+
55
+ `outerlayer work logs --item <number>`, or the MCP tool `get_runner_log`. Add
56
+ `--attempt <claim id>`, or pass `claimId`, for an attempt that is not the
57
+ newest. The log is what the runner did around the agent: claiming,
58
+ provisioning, starting and ending the command, syncing, cleaning up and
59
+ releasing. When the attempt ended in provision, sync, cleanup or report, it ends
60
+ with the last 200 lines of that stage's log.
61
+
62
+ The command exits 1 when the attempt is still running, or when a runner too old
63
+ to upload its log released it. The runner log never holds the command's
64
+ output. The session does.
65
+
66
+ ## 5. Read the threads
67
+
68
+ `outerlayer work threads --item <number> --json`, or the MCP tool
69
+ `get_work_item_threads`. A person's request that asked an agent to amend the
70
+ work is a comment on a thread that is `waitingOn` the agent.
71
+
72
+ ## 6. Log in to the host
73
+
74
+ Only now, and say which question OuterLayer could not answer. Never signal a
75
+ build's processes by hand on a runner host. A build ended that way is lost, and
76
+ nothing on the item can show who did it.
@@ -46,6 +46,7 @@
46
46
  "4153d69f6882ba72db97c236134dc24ae4ad7f46a30e13ac075bac4567a6cfd0",
47
47
  "4687f56bcec766f1926d58a208418f800a1727c073b5e6047b40e3aaac2bd6c9",
48
48
  "4cfc10bc9d380e67b0ec5c243eb5f2c63f03ee3348d7956a45467620acc656fc",
49
+ "6adbc4b2f4d90deb1aa7541f09239723de8ee19af68dd20330c81ad16a3c0aa1",
49
50
  "7ba5273d911f6830a2d7575d446ea997d4b8c99a6826137c555990dd7dd54f3b",
50
51
  "81a764eb317fcb4672bedd35e7b9aa68d1c0b73f82fc2dfa03e5a78758db8f14",
51
52
  "85069e15aa3fdfeb8a0d1b8d1a450fb6a574bcf933246a7b7f7864be1c39faa3",
@@ -16,7 +16,9 @@ already cleared, run one check round on the rebased diff before going on.
16
16
 
17
17
  ## Open the pull request
18
18
 
19
- Open a scoped pull request that closes the issue. The body carries the
19
+ Open a scoped pull request. For a GitHub issue, the body closes the issue.
20
+ For a Linear or Jira issue, the body links the issue instead, and a person
21
+ completes it in that tracker after merge. The body carries the
20
22
  problem, the change, how to verify it, and, when the change alters what a user
21
23
  sees or does, a link to each documentation file added or changed. It carries
22
24
  no telemetry, round tables or reviewer roles. Those go in the final report.
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-S76AYB4M.js';
4
- import { resolveRepoIdentity } from './chunk-BMYGAGBJ.js';
5
- import { resolveGatewayCredentials } from './chunk-52NC2FIU.js';
6
- import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
7
- import { cliInvocation } from './chunk-CRB3POP4.js';
8
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
9
-
10
- createRequire(import.meta.url);
11
-
12
- // src/auto-connect.ts
13
- async function autoConnect(opts) {
14
- const env = opts.env ?? process.env;
15
- const home = opts.home ?? homeFromEnv(env);
16
- const cwd = opts.cwd ?? process.cwd();
17
- const resolved = resolveGatewayCredentials({ url: opts.url, apiKey: opts.apiKey, appId: opts.appId, home, env, cwd });
18
- if (resolved.ok || resolved.kind !== "login" || !resolved.credential || !resolved.url) return void 0;
19
- const dirs = findGitDirs(cwd);
20
- const repository = opts.repository ?? resolveRepoIdentity(cwd).gitRepo;
21
- if (dirs === void 0 || repository === void 0) return void 0;
22
- const listed = await fetchFactories(opts.fetchImpl ?? fetch, resolved.url, resolved.credential, repository);
23
- if (!listed.ok || listed.factories.length === 0) return void 0;
24
- const chosen = selectFactory(listed.factories, readRepoConnection(cwd), repository);
25
- if (chosen.factory === void 0) {
26
- return `you are logged in, but no factory is chosen for this repository, and more than one fits. Run \`${cliInvocation()} connect --factory <org>/<factory>\` with one of:
27
- ${chosen.text}
28
- Or pass --app-id / set OUTERLAYER_APP_ID.`;
29
- }
30
- try {
31
- saveFactoryConnection(dirs.gitCommonDir, void 0, chosen.factory, /* @__PURE__ */ new Date());
32
- } catch {
33
- return void 0;
34
- }
35
- process.stderr.write(`${autoConnectedLine(repository, chosen.factory, chosen.reason)}
36
- `);
37
- return void 0;
38
- }
39
-
40
- export { autoConnect };