@outerlayer/cli 0.10.2 → 0.11.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 (44) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/build-info.json +1 -1
  3. package/dist/{builder-EVO6F2NO.js → builder-PP436VGZ.js} +2 -2
  4. package/dist/{check-NQYQHITZ.js → check-YDXOLVJ5.js} +16 -15
  5. package/dist/{chunk-VVIRHTH4.js → chunk-2GBCTEN4.js} +1 -1
  6. package/dist/{chunk-ERHJETKP.js → chunk-3YFCWYBU.js} +128 -30
  7. package/dist/{chunk-M6G7TJVF.js → chunk-4Q7OMKAT.js} +44 -4
  8. package/dist/{chunk-MC6J453K.js → chunk-7C4T5BGN.js} +2 -2
  9. package/dist/{chunk-472KC6JV.js → chunk-BEZSECPA.js} +1 -1
  10. package/dist/{chunk-KZ5M4QOB.js → chunk-BHOBM3IZ.js} +32 -14
  11. package/dist/{chunk-JSUUXA5W.js → chunk-CJGQQZWB.js} +1 -1
  12. package/dist/{chunk-BREEX2Z7.js → chunk-E5DC4VZL.js} +115 -58
  13. package/dist/{chunk-R2UYH4QV.js → chunk-EOWWTFUU.js} +3 -3
  14. package/dist/{chunk-PDTSUOVT.js → chunk-FI5UYJMQ.js} +1 -1
  15. package/dist/{chunk-V42JY4F6.js → chunk-HYZRY4KZ.js} +2 -2
  16. package/dist/chunk-O765JR4W.js +35 -0
  17. package/dist/{chunk-6CXYORUS.js → chunk-QKFB4K7X.js} +1 -1
  18. package/dist/{chunk-ESZJ5QIC.js → chunk-R7BJYFD2.js} +4 -4
  19. package/dist/{chunk-S6IUUNCD.js → chunk-RSNSZ2LJ.js} +1 -1
  20. package/dist/{chunk-NTLGWCWK.js → chunk-TFIOXPZT.js} +1 -1
  21. package/dist/{chunk-M2PBLRB7.js → chunk-XR3BJN33.js} +23 -3
  22. package/dist/{cli-ZCWMJCEK.js → cli-RQZXTOEI.js} +39 -35
  23. package/dist/{command-LNEFKIVC.js → command-U6UGIBVT.js} +9 -9
  24. package/dist/config-MKBX2ZQD.js +11 -0
  25. package/dist/{docker-GM526LGX.js → docker-WVRRMK6R.js} +3 -3
  26. package/dist/{doctor-QSV4DYT2.js → doctor-ZF4PYWVN.js} +10 -10
  27. package/dist/{exec-client-QTUO6TZT.js → exec-client-CQV746UF.js} +3 -3
  28. package/dist/{guest-init-4UW4HM6N.js → guest-init-LJP5GPZF.js} +3 -3
  29. package/dist/index.js +1 -1
  30. package/dist/{init-MJ2PO2VQ.js → init-M5IBAGVE.js} +9 -9
  31. package/dist/{init-OKCDXEOG.js → init-PUY2BUHH.js} +8 -8
  32. package/dist/{init-cmd-5TEM2QNH.js → init-cmd-NPNR23UL.js} +1 -1
  33. package/dist/{install-PYNCWSTV.js → install-HKOVISUP.js} +3 -3
  34. package/dist/{loop-DBF3UJAD.js → loop-3FNROLW7.js} +16 -15
  35. package/dist/{machine-TBJKZ6TN.js → machine-RWDDJRWB.js} +7 -7
  36. package/dist/pending-MXLSRYMO.js +7 -0
  37. package/dist/{status-KPDVZMJ6.js → status-2OW5AKWL.js} +17 -9
  38. package/dist/{work-claim-cmd-DYD6II56.js → work-claim-cmd-LXXSNEGF.js} +3 -3
  39. package/dist/{work-open-pr-cmd-N2RBDKZ4.js → work-open-pr-cmd-YZAENDP6.js} +5 -4
  40. package/package.json +1 -1
  41. package/skill-pack/maintained/amend/SKILL.md +10 -1
  42. package/skill-pack/maintained/outerlayer/SKILL.md +19 -3
  43. package/skill-pack/maintained/outerlayer/references/open-pull-request.md +11 -0
  44. package/dist/config-X45X7AS4.js +0 -11
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LEASE_SECONDS, ALREADY_RELEASED, RENEW_INTERVAL_SECONDS } from './chunk-KZ5M4QOB.js';
3
+ import { LEASE_SECONDS, ALREADY_RELEASED, RENEW_INTERVAL_SECONDS } from './chunk-BHOBM3IZ.js';
4
4
  import './chunk-T6OIJQRT.js';
5
5
  import './chunk-HKUH5AR2.js';
6
- import './chunk-V42JY4F6.js';
6
+ import './chunk-HYZRY4KZ.js';
7
7
  import './chunk-Y6P5XX2B.js';
8
8
  import './chunk-HHJDN6AU.js';
9
9
  import { formatBytes } from './chunk-YYYRBYWG.js';
10
10
  import './chunk-TBT347UY.js';
11
- import { formatDuration, formatClock, relativeToRunner } from './chunk-BREEX2Z7.js';
11
+ import { formatDuration, formatClock, relativeToRunner } from './chunk-E5DC4VZL.js';
12
12
  import './chunk-3FMPZPJQ.js';
13
13
  import './chunk-N5FOE5PS.js';
14
14
  import './chunk-OGFGZQA3.js';
15
- import './chunk-VVIRHTH4.js';
15
+ import './chunk-2GBCTEN4.js';
16
16
  import './chunk-QOZKPLVJ.js';
17
- import './chunk-JSUUXA5W.js';
17
+ import './chunk-CJGQQZWB.js';
18
18
  import './chunk-CX22S5BA.js';
19
- import './chunk-6CXYORUS.js';
20
- import './chunk-S6IUUNCD.js';
19
+ import './chunk-QKFB4K7X.js';
20
+ import './chunk-RSNSZ2LJ.js';
21
21
  import './chunk-F7CU5ABH.js';
22
22
  import './chunk-BKO6JEZI.js';
23
23
  import './chunk-DTDZXDQ3.js';
@@ -29,10 +29,10 @@ import './chunk-IU4NZROR.js';
29
29
  import './chunk-USO2DKBD.js';
30
30
  import './chunk-N6LURUEF.js';
31
31
  import './chunk-YRYMNBGQ.js';
32
- import './chunk-M2PBLRB7.js';
32
+ import './chunk-XR3BJN33.js';
33
33
  import './chunk-UXYLWVTQ.js';
34
34
  import './chunk-7RQ73DLO.js';
35
- import './chunk-M6G7TJVF.js';
35
+ import './chunk-4Q7OMKAT.js';
36
36
  import './chunk-GQD22KKN.js';
37
37
  import './chunk-WZBHBH3J.js';
38
38
  import './chunk-5QRP3MVS.js';
@@ -94,6 +94,13 @@ function housekeepingLines(input) {
94
94
  }
95
95
  return lines;
96
96
  }
97
+ function pendingUpdateLines(input) {
98
+ const pending = input.pendingUpdate;
99
+ if (pending === void 0 || input.process.state !== "running") return [];
100
+ if (pending.holding === void 0) return [`update to ${pending.version} pending \xB7 updating when no build is running`];
101
+ const builds = pending.holding.builds.length === 0 ? "the running builds" : pending.holding.builds.map((n) => `#${n}`).join(", ");
102
+ return [`update to ${pending.version} pending \xB7 claiming nothing: waiting for ${builds} to finish`];
103
+ }
97
104
  function renderStatus(input) {
98
105
  const lines = [];
99
106
  const running = input.jobs.filter(({ job }) => isUnfinished(job));
@@ -104,6 +111,7 @@ function renderStatus(input) {
104
111
  const { unit, running: running2, delegated } = input.service;
105
112
  lines.push(`service ${unit} ${running2 ? "running" : "stopped"}${delegated === false ? " \xB7 not delegated: microVM builds have no memory limit of their own" : ""}`);
106
113
  }
114
+ lines.push(...pendingUpdateLines(input));
107
115
  lines.push(...housekeepingLines(input));
108
116
  lines.push("");
109
117
  if (running.length === 0) {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_PROTOCOL } from './chunk-PDTSUOVT.js';
3
+ import { RUNNER_PROTOCOL } from './chunk-FI5UYJMQ.js';
4
4
  import { resolveCredentials, WorkCommandError, parsePositiveInt, postJson, environmentFacts, resolveRepository, findLiveItem } from './chunk-DTDZXDQ3.js';
5
5
  export { WorkCommandError } from './chunk-DTDZXDQ3.js';
6
6
  import './chunk-ZQ5JGHUO.js';
@@ -11,10 +11,10 @@ import './chunk-IU4NZROR.js';
11
11
  import './chunk-USO2DKBD.js';
12
12
  import './chunk-N6LURUEF.js';
13
13
  import './chunk-YRYMNBGQ.js';
14
- import { defaultRunnerConfigPath } from './chunk-M2PBLRB7.js';
14
+ import { defaultRunnerConfigPath } from './chunk-XR3BJN33.js';
15
15
  import './chunk-UXYLWVTQ.js';
16
16
  import './chunk-7RQ73DLO.js';
17
- import './chunk-M6G7TJVF.js';
17
+ import './chunk-4Q7OMKAT.js';
18
18
  import './chunk-WZBHBH3J.js';
19
19
  import { defaultFetch } from './chunk-YO4PSLVB.js';
20
20
  import './chunk-PLMTLGYH.js';
@@ -48,7 +48,7 @@ function readBody(path) {
48
48
  throw new WorkOpenPrCommandError(`cannot read --body-file ${path}: ${err instanceof Error ? err.message : String(err)}`);
49
49
  }
50
50
  }
51
- async function openThroughGateway(creds, workItem, title, body, fetchImpl) {
51
+ async function openThroughGateway(creds, workItem, title, body, fetchImpl, repository) {
52
52
  const endpoint = new URL(`/v1/work-items/${encodeURIComponent(workItem)}/pull-request`, creds.url).toString();
53
53
  let response;
54
54
  try {
@@ -59,7 +59,8 @@ async function openThroughGateway(creds, workItem, title, body, fetchImpl) {
59
59
  authorization: `Bearer ${creds.apiKey}`,
60
60
  "x-outerlayer-app-id": creds.appId
61
61
  },
62
- body: JSON.stringify({ title, body })
62
+ // JSON drops an undefined `repository`, which leaves the gateway to pick the claim's primary.
63
+ body: JSON.stringify({ title, body, repository })
63
64
  });
64
65
  } catch (err) {
65
66
  throw new WorkOpenPrCommandError(`network error reaching ${endpoint}: ${String(err)}`);
@@ -112,7 +113,7 @@ async function openWithGh(opts, title, bodyFile, cwd) {
112
113
  try {
113
114
  declared = await runWorkPr({
114
115
  number,
115
- repo: opts.repo,
116
+ repo: opts.repo ?? opts.repository,
116
117
  sessionId: opts.sessionId,
117
118
  cwd,
118
119
  home: opts.home,
@@ -158,7 +159,7 @@ async function runWorkOpenPr(opts) {
158
159
  if (workItem === void 0 || workItem === "") {
159
160
  throw new WorkOpenPrCommandError("an item key names its work item through OUTERLAYER_WORK, which is not set");
160
161
  }
161
- data = await openThroughGateway(creds, workItem, opts.title, body, opts.fetchImpl ?? defaultFetch);
162
+ data = await openThroughGateway(creds, workItem, opts.title, body, opts.fetchImpl ?? defaultFetch, opts.repository ?? opts.repo);
162
163
  } else {
163
164
  data = await openWithGh({ ...opts, env }, opts.title, opts.bodyFile, cwd);
164
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outerlayer/cli",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "description": "OuterLayer CLI — commands: init, connect, doctor, login, logout, sync, daemon (alias: watch), emit, work, 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.",
@@ -37,6 +37,14 @@ runner's own build environments, git pushes go through the runner, not
37
37
  straight to the git host. A local session uses the person's own git remote and
38
38
  `gh` login.
39
39
 
40
+ ## Several repositories
41
+
42
+ A build can hold several repositories. `OUTERLAYER_REPOSITORIES` lists them,
43
+ each with its `path`, `branch` and whether it is `primary`. The item can have a
44
+ pull request in more than one of them. Make each fix in the checkout of the
45
+ repository whose pull request the thread is about, and commit and push in each
46
+ checkout you change. A push goes only to that checkout's own branch.
47
+
40
48
  ## Steps
41
49
 
42
50
  1. **Read the threads.**
@@ -124,7 +132,8 @@ straight to the git host. A local session uses the person's own git remote and
124
132
  - **A person decides.** Never pass `--pass` or `--fail`, never mark a check as
125
133
  a person, and never edit the issue's criteria.
126
134
  - **Stay on the branch.** Push to the pull request's own branch. Never open a
127
- second pull request, and never force-push over someone else's commits.
135
+ second pull request in a repository that has one, and never force-push over
136
+ someone else's commits.
128
137
  - **Write for a reader who was not here.** Every comment, commit and reply
129
138
  follows the repository's writing rule: outcome first, short sentences, plain
130
139
  words.
@@ -38,14 +38,30 @@ from the output of `outerlayer work build`.
38
38
  skill says what to capture.
39
39
  5. `/amend` answers the review threads a person handed to an agent.
40
40
 
41
+ ## Several repositories
42
+
43
+ A build checks out every repository connected to the factory, side by side,
44
+ each on the item's branch. `OUTERLAYER_REPOSITORIES` is a JSON list that gives
45
+ each repository's path, branch and whether it is the primary. Its entries have
46
+ the fields `repository`, `path`, `branch` and `primary`. The primary is the
47
+ repository the item lives in. It is at `/build/work/checkout`, and the others
48
+ are at `/build/work/repos/<owner>/<repo>`.
49
+
50
+ Decide from the issue which repositories the build needs to change. Read the
51
+ issue, then work in each path `OUTERLAYER_REPOSITORIES` lists for the
52
+ repositories it touches, and leave the others as they are. Commit and push in
53
+ each repository you changed. A push goes only to that repository's branch.
54
+ `gh` reads the primary only, so it cannot see the others.
55
+
41
56
  ## Opening the pull request
42
57
 
43
58
  A runner build opens its pull request with `outerlayer work open-pr`, never
44
59
  with `gh pr create`. A session is a runner build when `OUTERLAYER_WORK` is set
45
60
  and `OUTERLAYER_API_KEY` holds an item key, which starts with `olitem_`. A
46
- local session uses `gh pr create` and then `outerlayer work pr <number>`. The
47
- full steps are in
48
- [references/open-pull-request.md](references/open-pull-request.md).
61
+ local session uses `gh pr create` and then `outerlayer work pr <number>`. A
62
+ build that changed several repositories opens one pull request per changed
63
+ repository with `outerlayer work open-pr --repository <owner/name>`. The full
64
+ steps are in [references/open-pull-request.md](references/open-pull-request.md).
49
65
 
50
66
  Launching recorded work needs Claude Code. It is the one agent whose sessions
51
67
  OuterLayer can start with `OUTERLAYER_WORK` set and record. Other agents can
@@ -18,6 +18,17 @@ GitHub login of its own, and it does not run `gh pr create`. The command also
18
18
  links the pull request to the work item, so no `outerlayer work pr` follows.
19
19
  Run it again to edit the pull request that is already open.
20
20
 
21
+ A build that changed several repositories opens one pull request per changed
22
+ repository. It names each with `--repository`, using a `repository` from
23
+ `OUTERLAYER_REPOSITORIES`, and runs the command once for each:
24
+
25
+ outerlayer work open-pr --repository <owner/name> --title "<title>" --body-file <path>
26
+
27
+ The gateway opens each pull request from the branch the claim named in that
28
+ repository. Without `--repository` the pull request opens in the primary
29
+ repository. Each pull request is linked to the same work item. A repository
30
+ the build did not change gets no pull request.
31
+
21
32
  A runner build whose command exits 0 while its item has no pull request is
22
33
  released `incomplete`, not `ok`. Open the pull request before the build ends.
23
34
 
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- export { DEFAULT_CHECK_TIME_LIMIT_MINUTES, RunnerConfigError, builtinKind, checkHooks, defaultRunnerConfigPath, hasRunnerBlock, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, loadRunnerConfig, resolveBuild, resolveHousekeeping, runnerVmOf } from './chunk-M2PBLRB7.js';
4
- import './chunk-UXYLWVTQ.js';
5
- import './chunk-7RQ73DLO.js';
6
- import './chunk-M6G7TJVF.js';
7
- import './chunk-BYT5O5RV.js';
8
- import './chunk-VNVZDWO3.js';
9
- import './chunk-Z5GEFMRW.js';
10
-
11
- createRequire(import.meta.url);