orizu 0.5.47 → 0.5.49

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 (46) hide show
  1. package/dist/app-publish-workspace.d.ts +6 -0
  2. package/dist/app-publish-workspace.d.ts.map +1 -1
  3. package/dist/app-publish-workspace.js +54 -1
  4. package/dist/help.d.ts.map +1 -1
  5. package/dist/help.js +12 -1
  6. package/dist/hosted-boot.d.ts +7 -0
  7. package/dist/hosted-boot.d.ts.map +1 -1
  8. package/dist/hosted-boot.js +31 -2
  9. package/dist/hosted-optimization.d.ts.map +1 -1
  10. package/dist/hosted-optimization.js +40 -21
  11. package/dist/hosted-runtime-assets.d.ts +9 -0
  12. package/dist/hosted-runtime-assets.d.ts.map +1 -1
  13. package/dist/hosted-runtime-assets.js +8 -7
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +83 -68
  16. package/dist/runner-folders.d.ts +61 -0
  17. package/dist/runner-folders.d.ts.map +1 -0
  18. package/dist/runner-folders.js +222 -0
  19. package/dist/runner-version-materialization.d.ts +1 -1
  20. package/dist/runner-version-materialization.d.ts.map +1 -1
  21. package/dist/runner-version-materialization.js +20 -38
  22. package/dist/session-publish.d.ts +8 -0
  23. package/dist/session-publish.d.ts.map +1 -0
  24. package/dist/session-publish.js +118 -0
  25. package/dist/skilled-proposer-launch.d.ts +11 -1
  26. package/dist/skilled-proposer-launch.d.ts.map +1 -1
  27. package/dist/skilled-proposer-launch.js +35 -4
  28. package/dist/workbench-cli.d.ts.map +1 -1
  29. package/dist/workbench-cli.js +14 -1
  30. package/package.json +1 -1
  31. package/scripts/build-cli-dist.mjs +46 -8
  32. package/scripts/vendor-orizu-skill.mjs +52 -7
  33. package/src/app-publish-workspace.ts +57 -1
  34. package/src/help.ts +13 -1
  35. package/src/hosted-boot.ts +40 -2
  36. package/src/hosted-optimization.ts +49 -31
  37. package/src/hosted-runtime-assets.ts +10 -9
  38. package/src/index.ts +79 -87
  39. package/src/runner-folders.ts +223 -0
  40. package/src/runner-version-materialization.ts +21 -34
  41. package/src/session-publish.ts +127 -0
  42. package/src/skilled-proposer-launch.ts +41 -3
  43. package/src/workbench-cli.ts +14 -1
  44. package/vendor/skills/orizu/references/authority-map.md +1 -1
  45. package/vendor/skills/orizu/references/building-apps.md +1 -1
  46. package/vendor/skills/orizu/references/cli-reference.md +16 -0
@@ -0,0 +1,118 @@
1
+ /** ORI-2653: `orizu session publish`. In a hosted session, `git push` reaches
2
+ * only the session's own copy; this command saves the work there, then asks the
3
+ * web app to merge that commit into the team's main (the publish merge job app
4
+ * publishing already uses). It says "Published" only when the merge landed. */
5
+ import { spawnSync } from 'node:child_process';
6
+ import { isValidCloudflareArtifactsGitRemote } from './cloudflare-artifacts-git-remote.js';
7
+ import { authedFetch } from './http.js';
8
+ import { sanitizeTerminalText } from './json-response.js';
9
+ import { findWorkspaceRoot } from './workspace.js';
10
+ const DEFAULT_MESSAGE = 'Publish from session';
11
+ // The web app waits up to 100 s for the merge; leave room for the reply.
12
+ const PUBLISH_TIMEOUT_MS = 170_000;
13
+ // The codes the publish route words itself; their text already says what to do.
14
+ const PUBLISH_CODES = new Set(['publish_conflict', 'publish_race_lost', 'publish_still_running', 'publish_denied', 'publish_unavailable', 'publish_failed']);
15
+ const CHECK_AGAIN = 'It may have landed: wait a moment, then run `orizu session publish` again to check.';
16
+ function isRecord(value) {
17
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
18
+ }
19
+ function loadAppPublishWorkspace() {
20
+ return import('./app-publish-workspace.js');
21
+ }
22
+ /** Every answer that is not a confirmed merge: its text already leads with
23
+ * "Not published" or "Not confirmed" and ends with what to do. */
24
+ function refuse(io, text, code) {
25
+ const safe = sanitizeTerminalText(text);
26
+ io.print(io.json ? JSON.stringify({ error: safe, code }) : safe);
27
+ return 1;
28
+ }
29
+ /** True when `origin` is this session's own Artifacts copy. In an older
30
+ * GitHub-backed session `origin` is the team's repository itself, where a push
31
+ * of main would skip the merge and its checks. Reads the configured URL, not
32
+ * one rewritten by git's `insteadOf`. */
33
+ function originIsThisSessionCopy(root, sessionId) {
34
+ const read = spawnSync('git', ['config', '--get', 'remote.origin.url'], { cwd: root, encoding: 'utf8' });
35
+ const remote = read.status === 0 ? read.stdout.trim() : '';
36
+ return isValidCloudflareArtifactsGitRemote(remote) &&
37
+ new URL(remote).pathname.endsWith(`/hosted-session-${sessionId.replaceAll('-', '')}.git`);
38
+ }
39
+ export async function runSessionPublish(io, options = {}) {
40
+ const sessionId = process.env.ORIZU_SESSION_ID?.trim();
41
+ const root = sessionId ? findWorkspaceRoot(process.cwd()) : null;
42
+ if (!sessionId || !root) {
43
+ return refuse(io, 'Not published: orizu session publish runs inside a hosted session, from its workspace. In your own clone, push to your team repository instead.', 'publish_not_hosted');
44
+ }
45
+ if (!originIsThisSessionCopy(root, sessionId)) {
46
+ return refuse(io, "Not published: this workspace's origin is not this session's own copy, so publishing from here could write to the team's repository directly. Stop and tell the user.", 'publish_not_session_copy');
47
+ }
48
+ const { addTeamCopyRemote, pushSessionCopy } = await loadAppPublishWorkspace();
49
+ let pushed;
50
+ try {
51
+ pushed = await pushSessionCopy(root, options.message?.trim() || DEFAULT_MESSAGE);
52
+ }
53
+ catch (error) {
54
+ return refuse(io, `Not published: ${error instanceof Error ? error.message : String(error)}`, 'publish_not_sent');
55
+ }
56
+ let response;
57
+ let text;
58
+ try {
59
+ response = await authedFetch(`/api/cli/sessions/${encodeURIComponent(sessionId)}/publish`, {
60
+ method: 'POST',
61
+ headers: { 'Content-Type': 'application/json' },
62
+ body: JSON.stringify({ sessionCommitSha: pushed.sha }),
63
+ signal: AbortSignal.timeout(PUBLISH_TIMEOUT_MS),
64
+ });
65
+ }
66
+ catch (error) {
67
+ const reason = error instanceof Error ? error.message : String(error);
68
+ return refuse(io, `Not confirmed: could not reach Orizu (${reason}). Your work is saved in this session's copy. ${CHECK_AGAIN}`, 'publish_unreachable');
69
+ }
70
+ try {
71
+ text = await response.text();
72
+ }
73
+ catch (error) {
74
+ // The merge may have run before the answer was cut off.
75
+ const reason = error instanceof Error ? error.message : String(error);
76
+ return refuse(io, `Not confirmed: could not read the answer from Orizu (${reason}). Your work is saved in this session's copy. ${CHECK_AGAIN}`, 'publish_unreachable');
77
+ }
78
+ let body = null;
79
+ try {
80
+ body = JSON.parse(text);
81
+ }
82
+ catch {
83
+ // An answer that is not JSON is reported below as it came.
84
+ }
85
+ if (response.ok && isRecord(body) && (body.outcome === 'merged' || body.outcome === 'already_merged') && typeof body.sha === 'string') {
86
+ const sha = sanitizeTerminalText(body.sha);
87
+ if (io.json) {
88
+ io.print(JSON.stringify({ outcome: body.outcome, sha }));
89
+ }
90
+ else if (body.outcome === 'merged') {
91
+ const files = pushed.committed.map(file => `\n ${sanitizeTerminalText(file)}`).join('');
92
+ io.print(`Published: merged into the team's main as ${sha.slice(0, 7)}. New sessions on this project will see it.${files ? `\nCommitted first:${files}` : ''}`);
93
+ }
94
+ else {
95
+ io.print(`Already on the team's main (${sha.slice(0, 7)}). Nothing new to publish.`);
96
+ }
97
+ return 0;
98
+ }
99
+ if (isRecord(body) && typeof body.error === 'string' && typeof body.code === 'string' && PUBLISH_CODES.has(body.code)) {
100
+ const code = body.code;
101
+ let message = body.error;
102
+ if (code === 'publish_conflict') {
103
+ const remoteNote = await addTeamCopyRemote(root);
104
+ // Its own line: the recovery line above must stay a runnable command.
105
+ if (remoteNote)
106
+ message = `${message}\n${remoteNote}`;
107
+ }
108
+ return refuse(io, message, code);
109
+ }
110
+ // Any other answer is not worded for this command. A 4xx refused the request
111
+ // before any merge; a 5xx, or a 2xx that is not the route's answer, may have
112
+ // come after one.
113
+ const said = sanitizeTerminalText(isRecord(body) && typeof body.error === 'string' ? body.error : text.slice(0, 300));
114
+ if (response.status >= 400 && response.status < 500) {
115
+ return refuse(io, `Not published: Orizu refused the request (${response.status}: ${said}). Stop and tell the user.`, `http_${response.status}`);
116
+ }
117
+ return refuse(io, `Not confirmed: Orizu answered ${response.status} (${said}). ${CHECK_AGAIN}`, `http_${response.status}`);
118
+ }
@@ -23,12 +23,22 @@ export interface SkilledProposerChildOutput {
23
23
  stdout: (chunk: string) => void;
24
24
  stderr: (chunk: string) => void;
25
25
  }
26
+ export interface SkilledProposerStopOptions {
27
+ /**
28
+ * Runs once the optimizer has exited after a stop signal, just before the
29
+ * CLI ends by that signal (ORI-2429: the caller removes its runner copies).
30
+ * It gets whatever is left of CHILD_STOP_WAIT_MS since the signal; a hook
31
+ * still running then is abandoned so the stop cannot hang. A synchronous
32
+ * hook always runs to the end, even with no time left.
33
+ */
34
+ beforeSignalExit?: () => Promise<void> | void;
35
+ }
26
36
  /**
27
37
  * Run the optimizer, passing a stop signal on to it. On a stop signal the CLI
28
38
  * waits until the optimizer exits (capped at CHILD_STOP_WAIT_MS, then kills
29
39
  * it) and then ends by that same signal.
30
40
  */
31
- export declare function spawnSkilledProposerChild(command: string, args: string[], engine: GepaEngine, environment: NodeJS.ProcessEnv, onSpawn?: () => Promise<void>, output?: SkilledProposerChildOutput): Promise<{
41
+ export declare function spawnSkilledProposerChild(command: string, args: string[], engine: GepaEngine, environment: NodeJS.ProcessEnv, onSpawn?: () => Promise<void>, output?: SkilledProposerChildOutput, stopOptions?: SkilledProposerStopOptions): Promise<{
32
42
  status: number | null;
33
43
  error?: Error;
34
44
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"skilled-proposer-launch.d.ts","sourceRoot":"","sources":["../src/skilled-proposer-launch.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAO3D,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA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C,EAAE,0BAA0B,EACnC,WAAW,GAAE,0BAA+B;YAoDpB,MAAM,GAAG,IAAI;YAAU,KAAK;GAsDrD;AAwCD,UAAU,aAAa;IAAG,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE;AAQ9F,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,UAAQ,GAAG,MAAM,CAepF;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,CAAC,UAAU,GAC7B,qBAAqB,CAyBvB"}
@@ -27,16 +27,30 @@ const STOP_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT'];
27
27
  // The optimizer marks its run stopped before exiting (at most 10 s for the
28
28
  // status write); past this it is killed so nothing is left running (ORI-2402).
29
29
  const CHILD_STOP_WAIT_MS = 15_000;
30
+ // Wait for `hook` at most until `deadline`; its failure never blocks the exit.
31
+ async function runBeforeSignalExit(hook, deadline) {
32
+ if (!hook)
33
+ return;
34
+ let timer;
35
+ const expired = new Promise(resolve => { timer = setTimeout(resolve, Math.max(0, deadline - Date.now())); });
36
+ try {
37
+ await Promise.race([Promise.resolve().then(hook).catch(() => { }), expired]);
38
+ }
39
+ finally {
40
+ clearTimeout(timer);
41
+ }
42
+ }
30
43
  /**
31
44
  * Run the optimizer, passing a stop signal on to it. On a stop signal the CLI
32
45
  * waits until the optimizer exits (capped at CHILD_STOP_WAIT_MS, then kills
33
46
  * it) and then ends by that same signal.
34
47
  */
35
- export async function spawnSkilledProposerChild(command, args, engine, environment, onSpawn, output) {
48
+ export async function spawnSkilledProposerChild(command, args, engine, environment, onSpawn, output, stopOptions = {}) {
36
49
  const childEnvironment = { ...environment };
37
50
  let child;
38
51
  let cleanup = () => { };
39
52
  let stopSignal;
53
+ let stopDeadline = 0;
40
54
  // On the terminal path the optimizer leads its own process group, so a stop
41
55
  // also reaches its runners, which may run in worker threads it can't stop.
42
56
  let childGroup;
@@ -56,11 +70,18 @@ export async function spawnSkilledProposerChild(command, args, engine, environme
56
70
  let giveUp;
57
71
  const removeHandlers = () => { for (const entry of handlers)
58
72
  process.off(entry.signal, entry.handle); };
59
- const endBySignal = (signal) => {
73
+ let ending = false;
74
+ const endBySignal = async (signal) => {
75
+ if (ending)
76
+ return new Promise(() => { });
77
+ ending = true;
60
78
  if (giveUp)
61
79
  clearTimeout(giveUp);
62
- removeHandlers();
63
80
  cleanup();
81
+ // Our handlers stay installed during the caller's cleanup, so a second
82
+ // Ctrl-C then is absorbed instead of ending the CLI by default mid-cleanup.
83
+ await runBeforeSignalExit(stopOptions.beforeSignalExit, stopDeadline);
84
+ removeHandlers();
64
85
  // With our handlers gone, the signal's default action ends the process.
65
86
  process.kill(process.pid, signal);
66
87
  return new Promise(() => { });
@@ -68,6 +89,8 @@ export async function spawnSkilledProposerChild(command, args, engine, environme
68
89
  const handlers = STOP_SIGNALS.map(signal => ({
69
90
  signal,
70
91
  handle: () => {
92
+ if (!stopDeadline)
93
+ stopDeadline = Date.now() + CHILD_STOP_WAIT_MS;
71
94
  if (!child) {
72
95
  void endBySignal(signal);
73
96
  return;
@@ -87,9 +110,17 @@ export async function spawnSkilledProposerChild(command, args, engine, environme
87
110
  try {
88
111
  cleanup = materializeConfigPayload(engine, childEnvironment) ?? cleanup;
89
112
  await new Promise(resolve => setImmediate(resolve));
113
+ // A stop before the optimizer starts ends the CLI (endBySignal); never start it then.
114
+ if (stopDeadline)
115
+ return await new Promise(() => { });
90
116
  let result;
91
117
  if (output) {
92
- result = await runPipedChild(command, args, childEnvironment, async () => { await onSpawn?.(); }, output, spawnedChild => { child = spawnedChild; });
118
+ result = await runPipedChild(command, args, childEnvironment, async () => { await onSpawn?.(); }, output, spawnedChild => {
119
+ child = spawnedChild;
120
+ // Stopped while the output sinks were prepared: the CLI is ending.
121
+ if (stopDeadline && !stopSignal)
122
+ spawnedChild.kill('SIGKILL');
123
+ });
93
124
  }
94
125
  else {
95
126
  // stdin is not passed on: a process outside the terminal's foreground
@@ -1 +1 @@
1
- {"version":3,"file":"workbench-cli.d.ts","sourceRoot":"","sources":["../src/workbench-cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAA;AAI1B,MAAM,WAAW,gBAAgB;IAC/B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;CACtD;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAKD,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;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AAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,SAAqB,GACzB,OAAO,CAAC,cAAc,CAAC,CAezB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,CA2C7F;AAsPD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB9F"}
@@ -77,6 +77,7 @@ const SESSION_START_OPTIONS = new Set([
77
77
  '--session',
78
78
  '--json',
79
79
  ]);
80
+ const SESSION_PUBLISH_OPTIONS = new Set(['--message', '--json']);
80
81
  const WORKBENCH_VALUE_OPTIONS = new Set([
81
82
  '--after',
82
83
  '--interval',
@@ -846,7 +847,7 @@ function terminalStatusForCommand(command) {
846
847
  return 'cancelled';
847
848
  return null;
848
849
  }
849
- const USAGE_LINE = 'Usage: orizu session <start|status|end|finish> ... | orizu run <start|status|tail|complete|fail|cancel> ... (run tail --once drains all currently persisted events, then exits without following)';
850
+ const USAGE_LINE = 'Usage: orizu session <start|status|end|finish|publish> ... | orizu run <start|status|tail|complete|fail|cancel> ... (run tail --once drains all currently persisted events, then exits without following)';
850
851
  // In --json mode ANY command failure — bad usage, or an operational failure
851
852
  // such as a 401/403/404/409/network error surfaced by assertOk — must still
852
853
  // land as a single machine-readable document (`{"error": ...}`) on stdout,
@@ -888,6 +889,18 @@ async function dispatchWorkbenchCommand(args, io) {
888
889
  // `--workspace <dir>`: the workbench clone directory when the command is
889
890
  // not run from inside it (defaults to cwd).
890
891
  const workspaceDir = argValue(args, '--workspace') ?? undefined;
892
+ if (subcommand === 'publish') {
893
+ const unknownOption = findUnknownOption(args, SESSION_PUBLISH_OPTIONS, WORKBENCH_VALUE_OPTIONS);
894
+ if (unknownOption) {
895
+ return emitJsonError(io, `unknown option ${unknownOption}\nUsage: orizu session publish [--message <text>] [--json]`);
896
+ }
897
+ const stray = positional[2];
898
+ if (stray !== undefined) {
899
+ return emitJsonError(io, `unexpected argument ${stray}\nUsage: orizu session publish [--message <text>] [--json]`);
900
+ }
901
+ const { runSessionPublish } = await import('./session-publish.js');
902
+ return runSessionPublish(io, { message: argValue(args, '--message') });
903
+ }
891
904
  if (subcommand === 'start') {
892
905
  const unknownOption = findUnknownOption(args, SESSION_START_OPTIONS, WORKBENCH_VALUE_OPTIONS);
893
906
  if (unknownOption) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orizu",
3
- "version": "0.5.47",
3
+ "version": "0.5.49",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,5 +1,5 @@
1
1
  import { existsSync, rmSync } from 'node:fs'
2
- import { spawnSync } from 'node:child_process'
2
+ import { spawn } from 'node:child_process'
3
3
  import { dirname, resolve } from 'node:path'
4
4
  import { fileURLToPath } from 'node:url'
5
5
 
@@ -20,11 +20,49 @@ if (!isOrizuSourceCheckout(resolve(repoRoot, 'package.json'))) {
20
20
  process.exit(0)
21
21
  }
22
22
 
23
- const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'
24
- // Delete old compiler output first: npm pack must never retain a module whose
25
- // TypeScript source was renamed or removed since the previous build.
26
- rmSync(resolve(cliRoot, 'dist'), { recursive: true, force: true })
27
- const result = spawnSync(npm, ['run', 'build'], { cwd: cliRoot, stdio: 'inherit' })
28
- if (result.status !== 0) {
29
- throw new Error(`Unable to build CLI dist before packing: ${result.error?.message || 'npm run build failed'}`)
23
+ // ORI-2425: in a source checkout Effect owns the build's lifetime. The build
24
+ // runs in its own process group, so a stop of the pack (SIGTERM from a
25
+ // cancelled job or a test timeout, or Ctrl-C) ends the compiler too, and the
26
+ // script then ends by that signal. The published branch above never loads it.
27
+ const { Effect } = await import('effect')
28
+ const isWindows = process.platform === 'win32'
29
+ const npm = isWindows ? 'npm.cmd' : 'npm'
30
+ const buildFailed = message => new Error(`Unable to build CLI dist before packing: ${message}`)
31
+ const build = Effect.callback(resume => {
32
+ // stdin is not passed on: a process group outside the terminal's foreground would be stopped reading it.
33
+ // Windows has no process groups (and detached opens a console), so there it stays attached.
34
+ const child = spawn(npm, ['run', 'build'], { cwd: cliRoot, stdio: ['ignore', 'inherit', 'inherit'], detached: !isWindows })
35
+ child.once('error', error => resume(Effect.fail(buildFailed(error.message))))
36
+ child.once('close', status => resume(status === 0 ? Effect.void : Effect.fail(buildFailed('npm run build failed'))))
37
+ // Interrupted: end the whole build group; the next pack rebuilds dist anyway.
38
+ return Effect.sync(() => {
39
+ try { if (isWindows) child.kill(); else process.kill(-child.pid, 'SIGKILL') } catch { /* already gone */ }
40
+ })
41
+ })
42
+
43
+ const STOP_SIGNALS = ['SIGINT', 'SIGTERM']
44
+ const controller = new AbortController()
45
+ let stopSignal
46
+ const handlers = STOP_SIGNALS.map(signal => [signal, () => { stopSignal ??= signal; controller.abort() }])
47
+ for (const [signal, handler] of handlers) process.on(signal, handler)
48
+ // npm stops a pack by signalling only the shell running prepack; this script
49
+ // is then re-parented and gets no signal. A changed parent means the pack is
50
+ // gone, so stop the same way.
51
+ const parentAtStart = process.ppid
52
+ const parentWatch = setInterval(() => {
53
+ if (process.ppid !== parentAtStart) { stopSignal ??= 'SIGTERM'; controller.abort() }
54
+ }, 200)
55
+ let failure
56
+ try {
57
+ // Delete old compiler output first: npm pack must never retain a module whose
58
+ // TypeScript source was renamed or removed since the previous build.
59
+ rmSync(resolve(cliRoot, 'dist'), { recursive: true, force: true })
60
+ await Effect.runPromise(build, { signal: controller.signal })
61
+ } catch (error) {
62
+ failure = error
63
+ } finally {
64
+ clearInterval(parentWatch)
65
+ for (const [signal, handler] of handlers) process.off(signal, handler)
30
66
  }
67
+ if (stopSignal) process.kill(process.pid, stopSignal)
68
+ else if (failure) throw failure
@@ -1,4 +1,4 @@
1
- import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs'
1
+ import { chmodSync, cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, renameSync, rmSync } from 'node:fs'
2
2
  import { dirname, isAbsolute, relative, resolve } from 'node:path'
3
3
  import { fileURLToPath } from 'node:url'
4
4
 
@@ -32,9 +32,20 @@ function shouldCopyPath(sourcePath) {
32
32
  ) && !rel.endsWith('.pyc') && !rel.endsWith('.pyo')
33
33
  }
34
34
 
35
+ const STAGING_PREFIX = '.orizu-staging-'
36
+ // A pack killed outright leaves its staging folder next to the vendored skill.
37
+ function removeStaleStaging() {
38
+ const vendorParent = dirname(vendorRoot)
39
+ if (!existsSync(vendorParent)) return
40
+ for (const name of readdirSync(vendorParent)) {
41
+ if (name.startsWith(STAGING_PREFIX)) rmSync(resolve(vendorParent, name), { recursive: true, force: true })
42
+ }
43
+ }
44
+
35
45
  if (shouldClean) {
36
46
  if (hasSourceSkill) {
37
47
  rmSync(vendorRoot, { recursive: true, force: true })
48
+ removeStaleStaging()
38
49
  }
39
50
  process.exit(0)
40
51
  }
@@ -46,9 +57,43 @@ if (!hasSourceSkill) {
46
57
  throw new Error(`Unable to vendor orizu skill: source skill not found at ${sourceRoot}`)
47
58
  }
48
59
 
49
- rmSync(vendorRoot, { recursive: true, force: true })
50
- mkdirSync(vendorRoot, { recursive: true })
51
- cpSync(sourceRoot, vendorRoot, {
52
- recursive: true,
53
- filter: shouldCopyPath,
54
- })
60
+ // ORI-2425: in a source checkout Effect owns the vendored copy's lifetime. It
61
+ // is copied into a staging folder that the scope removes if the copy fails or
62
+ // the pack is stopped, then swapped in whole, so the CLI (which prefers this
63
+ // copy over skills/orizu) never finds a half-vendored skill.
64
+ const { Effect } = await import('effect')
65
+ const vendorParent = dirname(vendorRoot)
66
+ const vendor = Effect.scoped(Effect.gen(function* () {
67
+ mkdirSync(vendorParent, { recursive: true })
68
+ removeStaleStaging()
69
+ const staging = yield* Effect.acquireRelease(
70
+ Effect.sync(() => {
71
+ const staging = mkdtempSync(resolve(vendorParent, STAGING_PREFIX))
72
+ // mkdtemp makes 0700 folders; keep the permissions a plain mkdir gave before.
73
+ chmodSync(staging, 0o755)
74
+ return staging
75
+ }),
76
+ staging => Effect.sync(() => rmSync(staging, { recursive: true, force: true })),
77
+ )
78
+ cpSync(sourceRoot, staging, { recursive: true, filter: shouldCopyPath })
79
+ yield* Effect.uninterruptible(Effect.sync(() => {
80
+ rmSync(vendorRoot, { recursive: true, force: true })
81
+ renameSync(staging, vendorRoot)
82
+ }))
83
+ }))
84
+
85
+ const STOP_SIGNALS = ['SIGINT', 'SIGTERM']
86
+ const controller = new AbortController()
87
+ let stopSignal
88
+ const handlers = STOP_SIGNALS.map(signal => [signal, () => { stopSignal ??= signal; controller.abort() }])
89
+ for (const [signal, handler] of handlers) process.on(signal, handler)
90
+ let failure
91
+ try {
92
+ await Effect.runPromise(vendor, { signal: controller.signal })
93
+ } catch (error) {
94
+ failure = error
95
+ } finally {
96
+ for (const [signal, handler] of handlers) process.off(signal, handler)
97
+ }
98
+ if (stopSignal) process.kill(process.pid, stopSignal)
99
+ else if (failure) throw failure
@@ -5,7 +5,7 @@
5
5
  * files and the web app are services, and each way this can stop is a tagged
6
6
  * failure. It holds no key (the clone's credential helper asks for one per git
7
7
  * command) and makes no temporary folder, so it has nothing to scope. */
8
- import { spawn } from 'node:child_process'
8
+ import { spawn, spawnSync } from 'node:child_process'
9
9
  import { mkdirSync, writeFileSync } from 'node:fs'
10
10
  import { join } from 'node:path'
11
11
 
@@ -16,6 +16,7 @@ import { AppPublishFailure } from './app-publish-failure.js'
16
16
  import { inspectAppDestination } from './app-publish-paths.js'
17
17
  import { resolveAttachedWorkspaceId } from './git-credential.js'
18
18
  import { authedFetch, getBaseUrl } from './http.js'
19
+ import { hasStagedChanges, NOTHING_STAGED_ERROR, unstageOrizuSkillLinks } from './orizu-skill-links.js'
19
20
 
20
21
  /** The session copy's branch, which the publish merge reads (ORI-2279). */
21
22
  const SESSION_BRANCH_REF = 'refs/heads/main'
@@ -163,6 +164,61 @@ export async function pushAppToSessionCopy(root: string, input: { projectSlug: s
163
164
  }
164
165
  }
165
166
 
167
+ // -- A whole-session publish (ORI-2653) -------------------------------------------
168
+
169
+ /** Commits everything uncommitted by the automatic save's rules (the staged
170
+ * Orizu skill links are left out), then pushes the session copy. Answers the
171
+ * commit to publish and the files this commit added. */
172
+ const commitAllAndPush = (root: string, message: string) =>
173
+ Effect.gen(function* () {
174
+ const git = yield* WorkspaceGit
175
+ const status = yield* gitOrFail('read the workspace status', ['status', '--porcelain'])
176
+ let committed: string[] = []
177
+ if (status.stdout.trim().length > 0) {
178
+ // `git add -A` would mark conflicted files resolved and publish the markers.
179
+ const unmerged = yield* gitOrFail('read the merge state', ['diff', '--name-only', '--diff-filter=U', '-z'])
180
+ if (unmerged.stdout.split('\0').some(Boolean)) {
181
+ return yield* new GitFailed({ step: 'stage the work', detail: 'the workspace has unresolved conflicts; fix those files and commit first' })
182
+ }
183
+ yield* gitOrFail('stage the work', ['add', '-A', '--', '.'])
184
+ const syncGit = (args: readonly string[]) => {
185
+ const result = spawnSync('git', args, { cwd: root, encoding: 'utf8' })
186
+ return { exitCode: result.status ?? 1, stdout: result.stdout ?? '', stderr: result.stderr ?? result.error?.message ?? '' }
187
+ }
188
+ const unstaged = unstageOrizuSkillLinks(syncGit)
189
+ if (!unstaged.ok) return yield* new GitFailed({ step: 'leave out the Orizu skill links', detail: unstaged.error })
190
+ const staged = hasStagedChanges(syncGit)
191
+ if (typeof staged !== 'boolean') return yield* new GitFailed({ step: 'read the staged work', detail: staged.error })
192
+ if (!staged && unstaged.unstaged.length === 0) return yield* new GitFailed({ step: 'stage the work', detail: NOTHING_STAGED_ERROR })
193
+ if (staged) {
194
+ committed = (yield* gitOrFail('list the staged work', ['diff', '--cached', '--name-only', '-z'])).stdout.split('\0').filter(Boolean)
195
+ // As the automatic save does: a team's hooks or a signing setting
196
+ // must not block or rewrite the agent's commit.
197
+ yield* gitOrFail('commit the work', ['-c', 'core.hooksPath=/dev/null', '-c', 'commit.gpgsign=false', 'commit', '-q', '-m', message])
198
+ }
199
+ }
200
+ const sha = (yield* gitOrFail('read the commit', ['rev-parse', 'HEAD'])).stdout.trim()
201
+ const pushed = yield* git.run(['push', '-q', 'origin', `HEAD:${SESSION_BRANCH_REF}`])
202
+ if (pushed.code !== 0) {
203
+ if (/\[rejected\]|non-fast-forward|fetch first/.test(pushed.stderr)) return yield* new PushRejected()
204
+ return yield* new GitFailed({ step: 'push the session copy', detail: pushed.stderr.trim() })
205
+ }
206
+ return { sha, committed }
207
+ })
208
+
209
+ /** Commits all uncommitted work and pushes the session copy. Throws the
210
+ * message the agent should act on; nothing has been published then. */
211
+ export async function pushSessionCopy(root: string, message: string): Promise<{ sha: string; committed: string[] }> {
212
+ const program = commitAllAndPush(root, message).pipe(
213
+ Effect.catchTags({
214
+ PushRejected: () =>
215
+ Effect.fail(new Error('your session copy has commits this workspace does not, or is still being set up on a first turn. Run "git pull --no-rebase --no-edit" in the workspace, then run `orizu session publish` again.')),
216
+ GitFailed: (failure) => Effect.fail(new Error(`could not ${failure.step} (${failure.detail}).`)),
217
+ })
218
+ )
219
+ return Effect.runPromise(Effect.provide(program, liveLayer(root)))
220
+ }
221
+
166
222
  // -- The team copy, after a conflict ---------------------------------------------
167
223
 
168
224
  /** Adds the `orizu-team` remote so the agent can pull the team copy and fix a
package/src/help.ts CHANGED
@@ -52,7 +52,7 @@ const GROUPS: CliGroupDoc[] = [
52
52
  { name: 'Tasks', summary: 'Create review tasks, mutate task status, assign reviewers, and export labels.' },
53
53
  { name: 'Datasets', summary: 'Upload, version, split, mutate, export, lock, clone, and delete datasets.' },
54
54
  { name: 'Workspace', summary: 'Metadata-first sync of the workbench contract: inspect status, reconcile, pull, and apply.' },
55
- { name: 'Sessions', summary: 'Start, inspect, and end durable workspace sessions for agent/operator work.' },
55
+ { name: 'Sessions', summary: 'Start, inspect, publish, and end durable workspace sessions for agent/operator work.' },
56
56
  { name: 'Workbench runs', summary: 'Start, inspect, tail, and finish resumable workbench runs.' },
57
57
  { name: 'Connectors', summary: 'Inspect project connector/integration readiness (read-only; secrets redacted).' },
58
58
  { name: 'Promotion manifests', summary: 'List, inspect, approve, reject, and idempotently apply promotion manifests.' },
@@ -1138,6 +1138,18 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
1138
1138
  ],
1139
1139
  examples: ['orizu session finish --session sess_123', 'orizu session finish --session sess_123 --push --message "tune judge prompt"'],
1140
1140
  },
1141
+ {
1142
+ path: ['session', 'publish'],
1143
+ usage: 'orizu session publish [--message <text>] [--json]',
1144
+ summary:
1145
+ "Inside a hosted session: commit any uncommitted work, save it to the session's copy, and merge it into the team's main so new sessions see it. git push alone reaches only the session's copy. Prints Published only when the merge landed; a conflict or failure prints Not published and what to do.",
1146
+ group: 'Sessions',
1147
+ options: [
1148
+ { name: '--message <text>', help: 'Commit message for uncommitted work (a default is used when omitted).' },
1149
+ { name: '--json', help: 'Emit {outcome, sha} on success, or {error, code} when it was not published.' },
1150
+ ],
1151
+ examples: ['orizu session publish', 'orizu session publish --message "benchmark demo notes"'],
1152
+ },
1141
1153
  {
1142
1154
  path: ['run', 'start'],
1143
1155
  usage: 'orizu run start --session <id> --title <title> [--project <team/project>] [--json]',