@stigmer/cli 3.41.0 → 3.41.1-dev.20261003094357.g39d6aa748646

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 (64) hide show
  1. package/commands/config/context.js +3 -3
  2. package/commands/config/context.js.map +1 -1
  3. package/commands/resume.d.ts.map +1 -1
  4. package/commands/resume.js +12 -13
  5. package/commands/resume.js.map +1 -1
  6. package/commands/run.js +2 -2
  7. package/commands/run.js.map +1 -1
  8. package/config/config.d.ts +1 -1
  9. package/config/config.d.ts.map +1 -1
  10. package/config/keys.js +3 -3
  11. package/config/keys.js.map +1 -1
  12. package/config/resolve.d.ts +1 -1
  13. package/config/resolve.js +5 -5
  14. package/config/resolve.js.map +1 -1
  15. package/local/artifact.d.ts +28 -6
  16. package/local/artifact.d.ts.map +1 -1
  17. package/local/artifact.js +88 -13
  18. package/local/artifact.js.map +1 -1
  19. package/local/bootstrap.js +1 -1
  20. package/local/bootstrap.js.map +1 -1
  21. package/local/daemon/components.js +1 -1
  22. package/local/daemon/components.js.map +1 -1
  23. package/local/net/tcp.js +1 -1
  24. package/local/net/tcp.js.map +1 -1
  25. package/local/temporal/download.d.ts +12 -2
  26. package/local/temporal/download.d.ts.map +1 -1
  27. package/local/temporal/download.js +6 -2
  28. package/local/temporal/download.js.map +1 -1
  29. package/package.json +7 -7
  30. package/resources/run/prepare.d.ts +1 -1
  31. package/resources/run/prepare.js +4 -4
  32. package/resources/run/prepare.js.map +1 -1
  33. package/resources/run/resume.d.ts +0 -1
  34. package/resources/run/resume.d.ts.map +1 -1
  35. package/resources/run/resume.js +7 -4
  36. package/resources/run/resume.js.map +1 -1
  37. package/resources/run/workflow-stream.d.ts +9 -0
  38. package/resources/run/workflow-stream.d.ts.map +1 -1
  39. package/resources/run/workflow-stream.js +24 -4
  40. package/resources/run/workflow-stream.js.map +1 -1
  41. package/resources/stream/headless.d.ts +16 -0
  42. package/resources/stream/headless.d.ts.map +1 -1
  43. package/resources/stream/headless.js +33 -5
  44. package/resources/stream/headless.js.map +1 -1
  45. package/resources/usage.d.ts +2 -2
  46. package/resources/usage.d.ts.map +1 -1
  47. package/resources/usage.js +4 -4
  48. package/resources/usage.js.map +1 -1
  49. package/src/commands/config/context.ts +3 -3
  50. package/src/commands/resume.ts +11 -17
  51. package/src/commands/run.ts +2 -2
  52. package/src/config/config.ts +1 -1
  53. package/src/config/keys.ts +3 -3
  54. package/src/config/resolve.ts +5 -5
  55. package/src/local/artifact.ts +120 -15
  56. package/src/local/bootstrap.ts +1 -1
  57. package/src/local/daemon/components.ts +1 -1
  58. package/src/local/net/tcp.ts +1 -1
  59. package/src/local/temporal/download.ts +14 -4
  60. package/src/resources/run/prepare.ts +4 -4
  61. package/src/resources/run/resume.ts +7 -4
  62. package/src/resources/run/workflow-stream.ts +23 -3
  63. package/src/resources/stream/headless.ts +31 -4
  64. package/src/resources/usage.ts +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,mDAAmD;AACnD,EAAE;AACF,iFAAiF;AACjF,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EAChC,iCAAiC,GAIlC,MAAM,4DAA4D,CAAC;AAIpE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOnF,gBAAgB;AAEhB,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAe,EAAE,SAAiB;IAC5E,OAAO,MAAM,CAAC,cAAc,CAAC,qBAA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MAAM,CAAC,EAAE,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,QAAQ,CAAC,EAAE,CAAC;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;AACxB,CAAC;AAED,wEAAwE;AACxE,SAAS,oBAAoB,CAAC,IAAY,EAAE,EAAU;IACpD,IAAI,IAAI,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IACxC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,MAAM,EAAE,EAAE,CAAC;IACnC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,QAAQ,IAAI,EAAE,CAAC;IACrC,OAAO,GAAG,IAAI,OAAO,EAAE,EAAE,CAAC;AAC5B,CAAC;AAED,+EAA+E;AAC/E,SAAS,gBAAgB,CAAC,KAAqB;IAC7C,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,cAAc,CAAC,iBAAiB;YACnC,OAAO,SAAS,CAAC;QACnB,KAAK,cAAc,CAAC,qBAAqB;YACvC,OAAO,aAAa,CAAC;QACvB,KAAK,cAAc,CAAC,mBAAmB;YACrC,OAAO,WAAW,CAAC;QACrB,KAAK,cAAc,CAAC,gBAAgB;YAClC,OAAO,QAAQ,CAAC;QAClB,KAAK,cAAc,CAAC,mBAAmB;YACrC,OAAO,WAAW,CAAC;QACrB,KAAK,cAAc,CAAC,8BAA8B;YAChD,OAAO,sBAAsB,CAAC;QAChC,KAAK,cAAc,CAAC,oBAAoB;YACtC,OAAO,YAAY,CAAC;QACtB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -1,13 +1,13 @@
1
1
  // `stigmer config context show|set` — the active CLI context: the
2
2
  // organization every command targets when neither `--org` nor
3
- // STIGMER_ORG_ID names one.
3
+ // STIGMER_ORG names one.
4
4
  //
5
5
  // `set --org <slug>` checks the slug against the active backend before it
6
6
  // persists: the organization must be one the caller belongs to there
7
7
  // (findMyOrganizations), so a typo or a stranger's slug is refused at the
8
8
  // moment it is typed, not on the next command. An empty slug clears the
9
9
  // context without asking the backend, and the resolver falls back to its
10
- // default again. The raw `config set context.organization` stays the
10
+ // default again. The raw `config set context.org` stays the
11
11
  // unchecked escape hatch.
12
12
 
13
13
  import type { Command } from "commander";
@@ -51,7 +51,7 @@ async function runSet(flags: OutputFlags & { org?: string }): Promise<void> {
51
51
  const config = load();
52
52
  if (org !== "") await assertMembership(config, org);
53
53
 
54
- (config.context ??= {}).organization = org;
54
+ (config.context ??= {}).org = org;
55
55
  save(config);
56
56
  const message = org === "" ? "Context organization cleared" : `Context organization set to '${org}'`;
57
57
  renderResult(CommandResult.success(message), resultFormat(flags));
@@ -4,10 +4,9 @@
4
4
  // text/0-arg would open the session picker (a separate, not-yet-wired task).
5
5
 
6
6
  import type { Command } from "commander";
7
- import { ensureAuthenticated, resolveOrganization } from "../config/index.js";
7
+ import { ensureAuthenticated } from "../config/index.js";
8
8
  import { UsageError } from "../errors/index.js";
9
9
  import { interactiveBrowseEnabled } from "../resources/picker/tty.js";
10
- import { globalOrg } from "./shared.js";
11
10
 
12
11
  interface ResumeFlags {
13
12
  verbose?: boolean;
@@ -22,12 +21,10 @@ export function registerResume(program: Command): void {
22
21
  .option("-v, --verbose", "show all execution events")
23
22
  .option("--mode <mode>", 'follow-up interaction mode: "agent" (default) or "plan" (read-only)')
24
23
  .option("--json", "stream events as newline-delimited JSON")
25
- .action((reference: string | undefined, options: ResumeFlags, command: Command) =>
26
- runResume(reference, options, command),
27
- );
24
+ .action((reference: string | undefined, options: ResumeFlags) => runResume(reference, options));
28
25
  }
29
26
 
30
- async function runResume(reference: string | undefined, options: ResumeFlags, command: Command): Promise<void> {
27
+ async function runResume(reference: string | undefined, options: ResumeFlags): Promise<void> {
31
28
  const { validateMode } = await import("../resources/run/prepare.js");
32
29
  // Call through a plain signature: TS forbids assertion functions reached via a
33
30
  // destructured dynamic-import binding (TS2775); we only need the throw-on-invalid
@@ -37,19 +34,17 @@ async function runResume(reference: string | undefined, options: ResumeFlags, co
37
34
  const { connectBackend } = await import("../backend.js");
38
35
  const client = connectBackend();
39
36
  ensureAuthenticated(client.config);
40
- const org = resolveOrganization(client.config, globalOrg(command));
41
- if (org === "") {
42
- throw new UsageError(
43
- "organization not set\n\nSet it with:\n stigmer config context set --org <org>\n stigmer resume --org <org> ...",
44
- );
45
- }
37
+ // No organization is resolved here: a session names its own, and every
38
+ // turn resumed in it is filed there (stigmer/stigmer#1580), whatever the
39
+ // context organization is. The picker lists the caller's sessions across
40
+ // organizations.
46
41
 
47
42
  const outputMode = options.json === true ? "json" : "inline";
48
43
  const mode = (options.mode ?? "") as import("../resources/run/prepare.js").RunMode;
49
44
 
50
45
  if (reference === undefined) {
51
46
  if (interactiveBrowseEnabled(outputMode)) {
52
- await browseAndResumeSession("", client, org, mode, outputMode);
47
+ await browseAndResumeSession("", client, mode, outputMode);
53
48
  return;
54
49
  }
55
50
  throw browseUnavailableError();
@@ -78,7 +73,7 @@ async function runResume(reference: string | undefined, options: ResumeFlags, co
78
73
  );
79
74
  }
80
75
  const { openSession } = await import("../resources/run/resume.js");
81
- await openSession({ client, sessionId: reference, org, mode, outputMode });
76
+ await openSession({ client, sessionId: reference, mode, outputMode });
82
77
  return;
83
78
  }
84
79
 
@@ -94,7 +89,7 @@ async function runResume(reference: string | undefined, options: ResumeFlags, co
94
89
  // Bare text → interactive session picker (pre-filtered by the text) on a TTY;
95
90
  // otherwise actionable guidance.
96
91
  if (interactiveBrowseEnabled(outputMode)) {
97
- await browseAndResumeSession(reference, client, org, mode, outputMode);
92
+ await browseAndResumeSession(reference, client, mode, outputMode);
98
93
  return;
99
94
  }
100
95
  throw browseUnavailableError(reference);
@@ -106,7 +101,6 @@ async function runResume(reference: string | undefined, options: ResumeFlags, co
106
101
  async function browseAndResumeSession(
107
102
  initialQuery: string,
108
103
  client: import("../client/index.js").BackendClient,
109
- org: string,
110
104
  mode: import("../resources/run/prepare.js").RunMode,
111
105
  outputMode: "inline" | "json",
112
106
  ): Promise<void> {
@@ -116,7 +110,7 @@ async function browseAndResumeSession(
116
110
  const sessionId = selected.metadata?.id ?? "";
117
111
  if (sessionId === "") return;
118
112
  const { openSession } = await import("../resources/run/resume.js");
119
- await openSession({ client, sessionId, org, mode, outputMode });
113
+ await openSession({ client, sessionId, mode, outputMode });
120
114
  }
121
115
 
122
116
  function browseUnavailableError(query?: string): UsageError {
@@ -254,8 +254,8 @@ async function runWorkflow(
254
254
  envFiles: options.envFile,
255
255
  secretFiles: options.secretFile,
256
256
  });
257
- if (runtimeEnv.STIGMER_ORG_ID === undefined && org !== "") {
258
- runtimeEnv.STIGMER_ORG_ID = { value: org, isSecret: false };
257
+ if (runtimeEnv.STIGMER_ORG === undefined && org !== "") {
258
+ runtimeEnv.STIGMER_ORG = { value: org, isSecret: false };
259
259
  }
260
260
 
261
261
  const execution = await createWorkflowExecution(
@@ -80,7 +80,7 @@ export interface BackendConfig {
80
80
  }
81
81
 
82
82
  export interface ContextConfig {
83
- organization?: string;
83
+ org?: string;
84
84
  }
85
85
 
86
86
  /**
@@ -67,10 +67,10 @@ const KEYS: Record<string, ConfigKey> = {
67
67
  (backends[CLOUD_BACKEND_NAME] ??= { type: "cloud" }).org_id = value;
68
68
  },
69
69
  },
70
- "context.organization": {
71
- get: (config) => config.context?.organization ?? "",
70
+ "context.org": {
71
+ get: (config) => config.context?.org ?? "",
72
72
  set: (config, value) => {
73
- (config.context ??= {}).organization = value;
73
+ (config.context ??= {}).org = value;
74
74
  },
75
75
  },
76
76
  };
@@ -80,14 +80,14 @@ export function resolveToken(config: Config): string {
80
80
 
81
81
  /**
82
82
  * Resolve the active organization.
83
- * --org flag override > STIGMER_ORG_ID env > context.organization
83
+ * --org flag override > STIGMER_ORG env > context.org
84
84
  * > the active entry's org_id (legacy fallback)
85
85
  */
86
86
  export function resolveOrganization(config: Config, flagOrg?: string): string {
87
87
  if (flagOrg !== undefined && flagOrg !== "") {
88
88
  return flagOrg;
89
89
  }
90
- const env = process.env.STIGMER_ORG_ID;
90
+ const env = process.env.STIGMER_ORG;
91
91
  if (env !== undefined && env !== "") {
92
92
  return env;
93
93
  }
@@ -140,10 +140,10 @@ export function resolveConsoleURL(
140
140
  */
141
141
  export function resolveContextOrganization(config: Config): string {
142
142
  if (
143
- config.context?.organization !== undefined &&
144
- config.context.organization !== ""
143
+ config.context?.org !== undefined &&
144
+ config.context.org !== ""
145
145
  ) {
146
- return config.context.organization;
146
+ return config.context.org;
147
147
  }
148
148
  return activeBackend(config).entry?.org_id ?? "";
149
149
  }
@@ -14,10 +14,19 @@
14
14
  // so a network blip does not fail a first `stigmer up`, a CI lane or an image
15
15
  // build. Any other HTTP status and a checksum mismatch are answers: they fail at
16
16
  // once.
17
+ //
18
+ // A caller may also name a cache directory, where a verified archive is kept
19
+ // beside the checksum file it was verified against. The cache is read before the
20
+ // network and must pass the same digest comparison a download does; a pair that
21
+ // is absent or does not match is downloaded again, as if there were no cache. A
22
+ // retry covers seconds, and a release host can be down for minutes: the cache is
23
+ // what lets a CI lane install through such an outage. It is an option, not a
24
+ // default: a user's machine already keeps the binary it installed, so
25
+ // `stigmer up` and the image staging pass none.
17
26
 
18
27
  import { createHash } from "node:crypto";
19
- import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
20
- import { dirname } from "node:path";
28
+ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
29
+ import { dirname, join } from "node:path";
21
30
  import { setTimeout as delay } from "node:timers/promises";
22
31
  import { gunzipSync } from "fflate";
23
32
  import { CliExitError } from "../errors/cli-exit-error.js";
@@ -64,12 +73,29 @@ export interface TarballBinarySource {
64
73
  binPath: string;
65
74
  /** Human label used in error messages (e.g. "Temporal CLI", "stigmer-server"). */
66
75
  label: string;
76
+ /**
77
+ * A directory that keeps the verified archive and its checksum file between
78
+ * installs (see the module header). Used only with {@link checksumUrl}: an
79
+ * archive nothing verified is never cached. Created when missing; a failure to
80
+ * write it fails the install.
81
+ */
82
+ cacheDir?: string;
67
83
  /** Override the fetch implementation (tests). */
68
84
  fetchImpl?: typeof fetch;
69
85
  /** Override the wait between download attempts (tests). */
70
86
  sleep?: (ms: number) => Promise<void>;
71
87
  }
72
88
 
89
+ /**
90
+ * Why the cache did not serve an install that went to the network: no cache
91
+ * directory was in use, it held no copy of this archive, or its copy did not
92
+ * match its checksum line.
93
+ */
94
+ export type CacheMiss = "unused" | "absent" | "mismatch";
95
+
96
+ /** Where the installed binary came from. */
97
+ export type TarballInstall = { source: "cache" } | { source: "network"; cache: CacheMiss };
98
+
73
99
  /** Attempts per download before a transient failure is reported. */
74
100
  export const DOWNLOAD_ATTEMPTS = 4;
75
101
 
@@ -77,21 +103,41 @@ export const DOWNLOAD_ATTEMPTS = 4;
77
103
  export const DOWNLOAD_RETRY_BASE_DELAY_MS = 1_000;
78
104
 
79
105
  /**
80
- * Download a `.tar.gz`, optionally verify its sha256, extract the named entry,
81
- * and write it to `binPath` with executable permissions. Transient network
82
- * failures are retried (see the module header). Throws a {@link CliExitError}
83
- * with the URL on a persistent network failure, a non-transient HTTP status, a
84
- * checksum mismatch, or an extraction failure.
106
+ * Install the named entry of a `.tar.gz` at `binPath` with executable
107
+ * permissions: from the cache directory when it holds a copy that matches its
108
+ * checksum line, otherwise downloaded, verified when a checksum URL is given,
109
+ * and then written to the cache. Transient network failures are retried (see
110
+ * the module header). Throws a {@link CliExitError} with the URL on a persistent
111
+ * network failure, a non-transient HTTP status, a checksum mismatch or an
112
+ * extraction failure, and with the path when the cache cannot be read or written.
85
113
  */
86
- export async function fetchTarballBinary(src: TarballBinarySource): Promise<void> {
114
+ export async function fetchTarballBinary(src: TarballBinarySource): Promise<TarballInstall> {
115
+ const archiveName = archiveBasename(src.url);
116
+ const cache =
117
+ src.checksumUrl === undefined || src.cacheDir === undefined
118
+ ? undefined
119
+ : cachePaths(src.cacheDir, archiveName, archiveBasename(src.checksumUrl));
120
+
121
+ let miss: CacheMiss = "unused";
122
+ if (cache !== undefined) {
123
+ const cached = readCachedPair(cache, src.label);
124
+ if (cached === null) {
125
+ miss = "absent";
126
+ } else if (compareDigest(cached.archive, cached.checksums, archiveName).matches) {
127
+ installEntry(cached.archive, src, cache.archive);
128
+ return { source: "cache" };
129
+ } else {
130
+ miss = "mismatch";
131
+ }
132
+ }
133
+
87
134
  const net: Download = { doFetch: src.fetchImpl ?? fetch, sleep: src.sleep ?? delay };
88
135
  const archive = await fetchBytes(net, src.url, src.label);
89
-
136
+ let checksums: string | undefined;
90
137
  if (src.checksumUrl !== undefined) {
91
- const archiveName = archiveBasename(src.url);
92
- const expected = parseShasum(await fetchText(net, src.checksumUrl, `${src.label} checksum`), archiveName);
93
- const actual = sha256Hex(archive);
94
- if (expected === "" || expected !== actual) {
138
+ checksums = await fetchText(net, src.checksumUrl, `${src.label} checksum`);
139
+ const { matches, expected, actual } = compareDigest(archive, checksums, archiveName);
140
+ if (!matches) {
95
141
  throw new CliExitError(`${src.label} checksum mismatch — refusing to use the download`, ExitCode.General, [
96
142
  `expected: ${expected || `(no entry for ${archiveName} in ${src.checksumUrl})`}`,
97
143
  `actual: ${actual}`,
@@ -100,11 +146,33 @@ export async function fetchTarballBinary(src: TarballBinarySource): Promise<void
100
146
  }
101
147
  }
102
148
 
149
+ installEntry(archive, src, src.url);
150
+ if (cache !== undefined && checksums !== undefined) writeCachedPair(cache, archive, checksums, src.label);
151
+ return { source: "network", cache: miss };
152
+ }
153
+
154
+ // The one comparison a downloaded archive and a cached one both pass: the
155
+ // archive's sha256 against the line its checksum file keeps for its name. A file
156
+ // with no line for the archive never matches.
157
+ function compareDigest(
158
+ archive: Uint8Array,
159
+ checksums: string,
160
+ archiveName: string,
161
+ ): { matches: boolean; expected: string; actual: string } {
162
+ const expected = parseShasum(checksums, archiveName);
163
+ const actual = sha256Hex(archive);
164
+ return { matches: expected !== "" && expected === actual, expected, actual };
165
+ }
166
+
167
+ // Extract the entry from verified archive bytes and write it executable.
168
+ // `origin` is where the bytes came from (the URL, or the cached file), so an
169
+ // archive without the entry is reported against the copy that lacked it.
170
+ function installEntry(archive: Uint8Array, src: TarballBinarySource, origin: string): void {
103
171
  const tarBytes = gunzipSync(archive);
104
172
  const binary = extractTarEntry(tarBytes, src.entryName);
105
173
  if (binary === null) {
106
- throw new CliExitError(`${src.entryName} not found in the downloaded ${src.label} archive`, ExitCode.General, [
107
- `archive: ${src.url}`,
174
+ throw new CliExitError(`${src.entryName} not found in the ${src.label} archive`, ExitCode.General, [
175
+ `archive: ${origin}`,
108
176
  ]);
109
177
  }
110
178
 
@@ -113,6 +181,43 @@ export async function fetchTarballBinary(src: TarballBinarySource): Promise<void
113
181
  chmodSync(src.binPath, 0o755);
114
182
  }
115
183
 
184
+ // A cached pair is named by the archive, which carries the version, so an entry
185
+ // left by another version is simply absent: `<archive>` and
186
+ // `<archive>.<checksum file>` (for Temporal, `…tar.gz.checksums.txt`).
187
+ interface CachePaths {
188
+ archive: string;
189
+ checksums: string;
190
+ }
191
+
192
+ function cachePaths(dir: string, archiveName: string, checksumName: string): CachePaths {
193
+ return { archive: join(dir, archiveName), checksums: join(dir, `${archiveName}.${checksumName}`) };
194
+ }
195
+
196
+ function readCachedPair(paths: CachePaths, label: string): { archive: Uint8Array; checksums: string } | null {
197
+ if (!existsSync(paths.archive) || !existsSync(paths.checksums)) return null;
198
+ try {
199
+ return { archive: new Uint8Array(readFileSync(paths.archive)), checksums: readFileSync(paths.checksums, "utf8") };
200
+ } catch (err) {
201
+ throw new CliExitError(`could not read the cached ${label}`, ExitCode.General, [
202
+ `path: ${dirname(paths.archive)}`,
203
+ `cause: ${describeFailure(err)}`,
204
+ ]);
205
+ }
206
+ }
207
+
208
+ function writeCachedPair(paths: CachePaths, archive: Uint8Array, checksums: string, label: string): void {
209
+ try {
210
+ mkdirSync(dirname(paths.archive), { recursive: true });
211
+ writeFileSync(paths.archive, archive);
212
+ writeFileSync(paths.checksums, checksums);
213
+ } catch (err) {
214
+ throw new CliExitError(`could not write the ${label} cache`, ExitCode.General, [
215
+ `path: ${dirname(paths.archive)}`,
216
+ `cause: ${describeFailure(err)}`,
217
+ ]);
218
+ }
219
+ }
220
+
116
221
  /** Lowercase hex sha256 of `bytes`. */
117
222
  export function sha256Hex(bytes: Uint8Array): string {
118
223
  return createHash("sha256").update(bytes).digest("hex");
@@ -59,7 +59,7 @@ export const RESERVED_DEFAULT_ORG_MESSAGE = `The '${DEFAULT_LOCAL_ORG}' organiza
59
59
  export const RESERVED_DEFAULT_ORG_HINTS: readonly string[] = [
60
60
  "Name the organization to use, in any of these ways:",
61
61
  " --org <slug> on a command",
62
- " STIGMER_ORG_ID=<slug> in the environment",
62
+ " STIGMER_ORG=<slug> in the environment",
63
63
  " stigmer config context set --org <slug>",
64
64
  ];
65
65
 
@@ -5,7 +5,7 @@
5
5
  // both from the same constant, so the two can never drift. Setting the server's
6
6
  // load-bearing env explicitly (ports, queues, db/storage paths) rather than
7
7
  // relying on its compiled defaults makes the launch deterministic and the pin
8
- // enforceable — mirroring test/e2e/fixtures/server-manager.ts.
8
+ // enforceable.
9
9
 
10
10
  import { dirname, join } from "node:path";
11
11
  import { RUNNER_TASK_QUEUE, RUNNER_READY_MARKER, SERVER_PID_FILE, RUNNER_PID_FILE, SERVER_PORT, TEMPORAL_NAMESPACE } from "../constants.js";
@@ -4,7 +4,7 @@
4
4
  // A single short-lived connection attempt tells us whether something is
5
5
  // listening; waitForTcp loops that probe until a deadline, failing fast (with a
6
6
  // log tail) if the process under watch exits first. This mirrors
7
- // `test/conformance/src/harness/temporal.ts` so the CLI and the harnesses share
7
+ // `test/support/src/temporal.ts` so the CLI and the harnesses share
8
8
  // one readiness model.
9
9
 
10
10
  import { connect } from "node:net";
@@ -12,11 +12,12 @@
12
12
  // all-in-one image bakes, so one pin and one verification serve every channel.
13
13
 
14
14
  import { existsSync } from "node:fs";
15
- import { fetchTarballBinary, mapReleaseArch, mapReleaseOs } from "../artifact.js";
15
+ import { fetchTarballBinary, mapReleaseArch, mapReleaseOs, type TarballInstall } from "../artifact.js";
16
16
 
17
17
  // Re-exported so existing consumers (temporal/index.ts, download.test.ts) keep
18
18
  // importing the tar reader from here.
19
19
  export { extractTarEntry } from "../artifact.js";
20
+ export type { CacheMiss, TarballInstall } from "../artifact.js";
20
21
 
21
22
  /**
22
23
  * The Temporal CLI version every channel runs: `stigmer up`, the all-in-one
@@ -37,6 +38,11 @@ export interface TemporalDownloadTarget {
37
38
  platform?: NodeJS.Platform;
38
39
  /** Node arch (defaults to process.arch). */
39
40
  arch?: string;
41
+ /**
42
+ * A directory that keeps the verified archive and its `checksums.txt` between
43
+ * installs, so a CI lane installs without the release host (`artifact.ts`).
44
+ */
45
+ cacheDir?: string;
40
46
  /** Override the fetch implementation (tests). */
41
47
  fetchImpl?: typeof fetch;
42
48
  /** Override the wait between download attempts (tests). */
@@ -53,16 +59,20 @@ export function temporalReleaseAssetUrl(version: string, asset: string): string
53
59
  return `https://github.com/temporalio/cli/releases/download/v${version}/${asset}`;
54
60
  }
55
61
 
56
- /** Download, verify and install the Temporal CLI binary to `binPath`. */
57
- export async function downloadTemporalCli(target: TemporalDownloadTarget): Promise<void> {
62
+ /**
63
+ * Install the verified Temporal CLI binary to `binPath`, from `cacheDir` when it
64
+ * holds a matching copy, otherwise downloaded; says which.
65
+ */
66
+ export async function downloadTemporalCli(target: TemporalDownloadTarget): Promise<TarballInstall> {
58
67
  const archive = temporalArchiveName(target.version, target.platform ?? process.platform, target.arch ?? process.arch);
59
68
 
60
- await fetchTarballBinary({
69
+ return fetchTarballBinary({
61
70
  url: temporalReleaseAssetUrl(target.version, archive),
62
71
  checksumUrl: temporalReleaseAssetUrl(target.version, TEMPORAL_CHECKSUMS_FILE),
63
72
  entryName: "temporal",
64
73
  binPath: target.binPath,
65
74
  label: "Temporal CLI",
75
+ cacheDir: target.cacheDir,
66
76
  fetchImpl: target.fetchImpl,
67
77
  sleep: target.sleep,
68
78
  });
@@ -4,7 +4,7 @@
4
4
  // Order matters and mirrors Go: validate cheap flags first (mode, approve
5
5
  // default), then parse workspaces, then merge env, then process attachments
6
6
  // (the only step that hits the network). A failure short-circuits before any
7
- // upload. STIGMER_ORG_ID is injected into the runtime env when absent so agents
7
+ // upload. STIGMER_ORG is injected into the runtime env when absent so agents
8
8
  // can address the caller's org without the user wiring it manually.
9
9
 
10
10
  import type { Attachment } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
@@ -108,7 +108,7 @@ export interface PrepareAgentExecOptions {
108
108
 
109
109
  /**
110
110
  * Validate flags and resolve all execution inputs. The `org` is used to inject
111
- * STIGMER_ORG_ID and the `client` to upload non-workspace attachments.
111
+ * STIGMER_ORG and the `client` to upload non-workspace attachments.
112
112
  */
113
113
  export async function prepareAgentExec(
114
114
  flags: AgentExecFlags,
@@ -162,8 +162,8 @@ export async function prepareAgentExec(
162
162
  envFiles: flags.envFile,
163
163
  secretFiles: flags.secretFile,
164
164
  });
165
- if (runtimeEnv.STIGMER_ORG_ID === undefined && org !== "") {
166
- runtimeEnv.STIGMER_ORG_ID = { value: org, isSecret: false };
165
+ if (runtimeEnv.STIGMER_ORG === undefined && org !== "") {
166
+ runtimeEnv.STIGMER_ORG = { value: org, isSecret: false };
167
167
  }
168
168
 
169
169
  const { attachments, workspaceFileRefs } = await processAttachments(
@@ -32,7 +32,6 @@ const ACTIVE_PHASES: ReadonlySet<ExecutionPhase> = new Set([
32
32
  export interface OpenSessionDeps {
33
33
  readonly client: BackendClient;
34
34
  readonly sessionId: string;
35
- readonly org: string;
36
35
  /** Explicit --mode override; "" means infer from the latest execution. */
37
36
  readonly mode: RunMode;
38
37
  readonly outputMode: RunOutputMode;
@@ -41,6 +40,9 @@ export interface OpenSessionDeps {
41
40
  export async function openSession(deps: OpenSessionDeps): Promise<void> {
42
41
  const stigmer = deps.client.stigmer;
43
42
  const session = await getSessionById(stigmer, deps.sessionId);
43
+ // Every turn in the session is filed under the session's own organization
44
+ // (stigmer/stigmer#1580), never the CLI's context organization.
45
+ const org = session.metadata?.org ?? "";
44
46
  const entries = await listExecutionsBySession(stigmer, deps.sessionId);
45
47
  if (entries.length === 0) {
46
48
  process.stderr.write(`Session ${deps.sessionId} has no executions\n`);
@@ -66,7 +68,7 @@ export async function openSession(deps: OpenSessionDeps): Promise<void> {
66
68
  client: stigmer,
67
69
  sessionId: deps.sessionId,
68
70
  executionId: latest.metadata?.id ?? "",
69
- org: deps.org,
71
+ org,
70
72
  mode: effectiveMode,
71
73
  defaultAction: ApprovalAction.UNSPECIFIED,
72
74
  outputMode: deps.outputMode,
@@ -75,13 +77,14 @@ export async function openSession(deps: OpenSessionDeps): Promise<void> {
75
77
  return;
76
78
  }
77
79
 
78
- await replaySession(deps, entries, header);
80
+ await replaySession(deps, org, entries, header);
79
81
  }
80
82
 
81
83
  // Completed session: render the stored history. TTY → Ink (history + composer);
82
84
  // headless → snapshot events through the matching renderer.
83
85
  async function replaySession(
84
86
  deps: OpenSessionDeps,
87
+ org: string,
85
88
  entries: readonly AgentExecution[],
86
89
  header: SessionHeaderInfo,
87
90
  ): Promise<void> {
@@ -90,7 +93,7 @@ async function replaySession(
90
93
  await runInkSession({
91
94
  client: deps.client.stigmer,
92
95
  sessionId: deps.sessionId,
93
- org: deps.org,
96
+ org,
94
97
  mode: header.mode === "plan" ? "plan" : "agent",
95
98
  });
96
99
  return;
@@ -29,6 +29,7 @@ import type { Stigmer } from "@stigmer/sdk";
29
29
  import { shouldColorize, type Styler, styler } from "../../output/style.js";
30
30
  import { calculateDuration } from "../execution-format.js";
31
31
  import { formatWorkflowPhase } from "../execution.js";
32
+ import { SUBSCRIPTION_DRAIN_GRACE_MS } from "../stream/headless.js";
32
33
  import { APPROVAL_RETRY_BASE_DELAY_MS, APPROVAL_RETRY_MAX_ATTEMPTS, retryWithBackoff } from "../stream/submit.js";
33
34
  import { toWorkflowEventView } from "../stream/workflow-event-view.js";
34
35
  import { renderWorkflowEventPlaintext } from "../stream/workflow-render-plaintext.js";
@@ -56,6 +57,15 @@ export interface WorkflowStreamStreams {
56
57
  * Stream a workflow execution to a terminal state, then print a summary. Returns
57
58
  * the authoritative final execution (a final Get), mirroring the agent path's
58
59
  * return for symmetry. Ctrl-C aborts the subscription cleanly.
60
+ *
61
+ * The subscription never outlives the stream, as on the agent path
62
+ * (resources/stream/headless.ts, #1522): after the terminal event the loop
63
+ * keeps reading, rendering nothing more, until the server ends the
64
+ * subscription, which it does on a terminal phase. Leaving the loop early
65
+ * leaves the HTTP/2 stream's remaining frames unread, so the stream is never
66
+ * destroyed and holds the process alive after the run has finished (#1625).
67
+ * A server that does not end it within SUBSCRIPTION_DRAIN_GRACE_MS is
68
+ * cancelled, and the subscription's own signal is aborted on every way out.
59
69
  */
60
70
  export async function streamWorkflowExecution(
61
71
  deps: WorkflowStreamDeps,
@@ -66,20 +76,30 @@ export async function streamWorkflowExecution(
66
76
  process.once("SIGINT", onSignal);
67
77
  process.once("SIGTERM", onSignal);
68
78
 
79
+ const subscription = new AbortController();
69
80
  const resolved = new Set<string>();
81
+ let ended = false;
82
+ let grace: ReturnType<typeof setTimeout> | undefined;
70
83
  try {
71
84
  const stream = deps.client.workflowExecution.subscribeEvents(
72
85
  create(SubscribeEventsRequestSchema, { executionId: deps.executionId }),
73
- controller.signal,
86
+ AbortSignal.any([controller.signal, subscription.signal]),
74
87
  );
75
88
  for await (const event of stream) {
89
+ if (ended) continue;
76
90
  renderEvent(event, deps.outputMode, streams);
77
91
  await maybeResolveApproval(event, deps, streams, resolved, controller.signal);
78
- if (toWorkflowEventView(event).terminal) break;
92
+ if (toWorkflowEventView(event).terminal) {
93
+ ended = true;
94
+ grace = setTimeout(() => subscription.abort(), SUBSCRIPTION_DRAIN_GRACE_MS);
95
+ }
79
96
  }
80
97
  } catch (error) {
81
- if (!controller.signal.aborted) throw error;
98
+ // After the terminal event the only error is the grace period's own cancel.
99
+ if (!ended && !controller.signal.aborted) throw error;
82
100
  } finally {
101
+ clearTimeout(grace);
102
+ subscription.abort();
83
103
  process.removeListener("SIGINT", onSignal);
84
104
  process.removeListener("SIGTERM", onSignal);
85
105
  }