@aui.io/apollo 0.1.65 → 0.1.66

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/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.d.ts +12 -0
  2. package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js +21 -0
  3. package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js.map +1 -1
  4. package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +11 -1
  5. package/node_modules/@aui.io/apollo-cli/dist/src/index.js +95 -8
  6. package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
  7. package/node_modules/@aui.io/apollo-cli/dist/src/update-refresh.d.ts +1 -0
  8. package/node_modules/@aui.io/apollo-cli/dist/src/update-refresh.js +21 -0
  9. package/node_modules/@aui.io/apollo-cli/dist/src/update-refresh.js.map +1 -0
  10. package/node_modules/@aui.io/apollo-cli/package.json +3 -3
  11. package/node_modules/@aui.io/apollo-core/dist/src/config/store.d.ts +1 -0
  12. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js +1 -1
  13. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js.map +1 -1
  14. package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +2 -1
  15. package/node_modules/@aui.io/apollo-core/dist/src/index.js +1 -0
  16. package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
  17. package/node_modules/@aui.io/apollo-core/dist/src/output/index.d.ts +27 -5
  18. package/node_modules/@aui.io/apollo-core/dist/src/output/index.js +28 -5
  19. package/node_modules/@aui.io/apollo-core/dist/src/output/index.js.map +1 -1
  20. package/node_modules/@aui.io/apollo-core/dist/src/services/update-check.d.ts +105 -0
  21. package/node_modules/@aui.io/apollo-core/dist/src/services/update-check.js +265 -0
  22. package/node_modules/@aui.io/apollo-core/dist/src/services/update-check.js.map +1 -0
  23. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.d.ts +11 -0
  24. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js +6 -2
  25. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js.map +1 -1
  26. package/node_modules/@aui.io/apollo-core/package.json +1 -1
  27. package/node_modules/@aui.io/apollo-tui/dist/src/index.d.ts +2 -0
  28. package/node_modules/@aui.io/apollo-tui/dist/src/index.js +2 -0
  29. package/node_modules/@aui.io/apollo-tui/dist/src/index.js.map +1 -1
  30. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +16 -7
  31. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
  32. package/node_modules/@aui.io/apollo-tui/dist/src/lib/update.d.ts +16 -0
  33. package/node_modules/@aui.io/apollo-tui/dist/src/lib/update.js +21 -0
  34. package/node_modules/@aui.io/apollo-tui/dist/src/lib/update.js.map +1 -0
  35. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +37 -19
  36. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
  37. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.d.ts +24 -1
  38. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +41 -4
  39. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -1
  40. package/node_modules/@aui.io/apollo-tui/dist/src/theme/glyphs.d.ts +2 -0
  41. package/node_modules/@aui.io/apollo-tui/dist/src/theme/glyphs.js +2 -0
  42. package/node_modules/@aui.io/apollo-tui/dist/src/theme/glyphs.js.map +1 -1
  43. package/node_modules/@aui.io/apollo-tui/package.json +2 -2
  44. package/package.json +4 -4
@@ -0,0 +1,105 @@
1
+ import { type NpmRunner } from "./upgrade.js";
2
+ /**
3
+ * Which package the running console upgrades from, and the bin whose
4
+ * `upgrade` verb does it. The public build is the default; a distribution
5
+ * (apollo-internal) retargets both at startup, the same way it registers
6
+ * its environments — before any command or the TUI resolves a context.
7
+ */
8
+ export interface UpdateTarget {
9
+ /** The npm package the notifier tracks (`npm view <package>@latest`). */
10
+ packageName: string;
11
+ /** The bin name the user runs — `<bin> upgrade` is the advertised fix. */
12
+ bin: string;
13
+ }
14
+ export declare const PUBLIC_UPDATE_TARGET: Readonly<UpdateTarget>;
15
+ export declare function setUpdateTarget(next: UpdateTarget): void;
16
+ export declare function updateTarget(): Readonly<UpdateTarget>;
17
+ /** The exact command a notice tells the reader to run. */
18
+ export declare function upgradeCommand(which?: Readonly<UpdateTarget>): string;
19
+ /** One npm lookup satisfies the cache for an hour before the next command
20
+ * triggers another. Releases land several times a day here, so a shorter
21
+ * window than the usual daily check is worth it; the lookup runs detached,
22
+ * so the cadence costs no command any latency. */
23
+ export declare const UPDATE_CHECK_TTL_MS: number;
24
+ export declare const UPDATE_CHECK_FILE = "update-check.json";
25
+ export interface UpdateCheckEntry {
26
+ /** The last lookup ATTEMPT (success or failure), ISO-8601. Drives the TTL,
27
+ * so an offline machine retries once per window, not on every command. */
28
+ checkedAt: string;
29
+ /** The `latest` dist-tag from the last successful lookup. */
30
+ latest?: string;
31
+ /** When `latest` was resolved, ISO-8601. */
32
+ resolvedAt?: string;
33
+ }
34
+ /** `~/.apollo/update-check.json`: one entry per tracked package. */
35
+ export type UpdateCheckFile = Record<string, UpdateCheckEntry>;
36
+ /** `APOLLO_UPDATE_CHECK=0` opts out entirely (same shape as `APOLLO_TUI=0`). */
37
+ export declare function updateCheckDisabled(env?: NodeJS.ProcessEnv): boolean;
38
+ export declare function updateCheckPath(homeDir?: string): string;
39
+ /** The whole file; anything that is not a map of well-formed entries reads
40
+ * as empty (that covers a corrupt file and any older flat layout). */
41
+ export declare function readUpdateCache(homeDir?: string): Promise<UpdateCheckFile>;
42
+ export declare function readUpdateEntry(packageName: string, homeDir?: string): Promise<UpdateCheckEntry | undefined>;
43
+ /** Merge one package's entry into the file, keeping the other packages'. */
44
+ export declare function writeUpdateEntry(packageName: string, entry: UpdateCheckEntry, homeDir?: string): Promise<void>;
45
+ export declare function isUpdateEntryStale(entry: UpdateCheckEntry | undefined, now?: number): boolean;
46
+ /**
47
+ * Compare two `x.y.z[-prerelease]` versions; > 0 when `a` is newer than
48
+ * `b`. Enough for what this project publishes — a real semver range parser
49
+ * would be a dependency for a single comparison.
50
+ */
51
+ export declare function compareVersions(a: string, b: string): number;
52
+ /**
53
+ * What every surface hands the reader. The fields are for programs
54
+ * (`run` is the command to execute verbatim); `message` is the same fact
55
+ * as one sentence, so a coding agent that has never seen this schema still
56
+ * knows what to do.
57
+ */
58
+ export interface UpdateNotice {
59
+ package: string;
60
+ current: string;
61
+ latest: string;
62
+ /** The command that installs `latest` — run it as written. */
63
+ run: string;
64
+ message: string;
65
+ }
66
+ /**
67
+ * The one line plain runs print to stderr. Starts with "Update available"
68
+ * so it can never be mistaken for the command failing, and quotes the
69
+ * command so an agent can copy it without guessing.
70
+ */
71
+ export declare function formatUpdateNotice(notice: Pick<UpdateNotice, "current" | "latest" | "run">, bin?: string): string;
72
+ /** The notice for a cache entry, or undefined unless it names a strictly
73
+ * newer version than the one running. */
74
+ export declare function updateNoticeFrom(entry: UpdateCheckEntry | undefined, currentVersion: string, which?: Readonly<UpdateTarget>): UpdateNotice | undefined;
75
+ export interface RefreshUpdateCacheOptions {
76
+ packageName: string;
77
+ homeDir?: string;
78
+ npm?: NpmRunner;
79
+ now?: () => Date;
80
+ }
81
+ /**
82
+ * Ask npm for `latest` and persist the answer. Never throws: offline or a
83
+ * registry outage keeps the previous `latest` (a stale truth beats none)
84
+ * and only moves `checkedAt`, so the next window's command retries once
85
+ * rather than every command hammering the registry.
86
+ */
87
+ export declare function refreshUpdateCache(options: RefreshUpdateCacheOptions): Promise<UpdateCheckEntry>;
88
+ /**
89
+ * Record a `latest` we just learned first-hand (`apollo upgrade`, its
90
+ * `--check`, the TUI's /upgrade) so the notice clears — or appears —
91
+ * immediately instead of after the next window.
92
+ */
93
+ export declare function recordLatestVersion(packageName: string, latest: string, homeDir?: string): Promise<void>;
94
+ /**
95
+ * The whole check for a long-lived surface (the TUI): cached verdict when
96
+ * fresh, an inline refresh when stale, and the notice — if any — for the
97
+ * version that is running. Never throws.
98
+ */
99
+ export declare function checkForUpdate(currentVersion: string, options?: {
100
+ homeDir?: string;
101
+ npm?: NpmRunner;
102
+ now?: () => Date;
103
+ env?: NodeJS.ProcessEnv;
104
+ which?: Readonly<UpdateTarget>;
105
+ }): Promise<UpdateNotice | undefined>;
@@ -0,0 +1,265 @@
1
+ /**
2
+ * The update notifier — "a newer apollo is on npm, run `apollo upgrade`".
3
+ *
4
+ * The contract every surface follows:
5
+ *
6
+ * 1. A command never waits on npm. It reads `~/.apollo/update-check.json`
7
+ * (microseconds) and, when the entry is older than the TTL, hands the
8
+ * lookup to a detached child that refreshes the file for the NEXT run.
9
+ * The long-lived TUI refreshes inline instead and re-checks on a timer.
10
+ * 2. The notice reaches humans and coding agents alike: one stderr line
11
+ * on plain runs (stdout stays the pipeable result), an additive top-level
12
+ * `update` field in every `--json` envelope (success or failure), and a
13
+ * toast + footer marker in the TUI. The text names the exact command.
14
+ * 3. The cache is disposable. A missing, corrupt, foreign-shaped or
15
+ * unwritable file degrades to "no notice" — never to a failed command.
16
+ * 4. `APOLLO_UPDATE_CHECK=0` disables everything; `CI` mutes the banner
17
+ * and the background refresh (the envelope still reports what the
18
+ * cache already knows).
19
+ *
20
+ * The file is keyed by package name because two distributions coexist on a
21
+ * staff machine (`@aui.io/apollo` and `@aui.io/apollo-internal`, separate
22
+ * bins); a flat file would have each build overwrite the other's verdict
23
+ * and re-spawn the lookup on every alternate run.
24
+ */
25
+ import { readFile } from "node:fs/promises";
26
+ import { homedir } from "node:os";
27
+ import { join } from "node:path";
28
+ import { apolloDir, writeJsonAtomic } from "../config/store.js";
29
+ import { resolvePublishedVersion } from "./upgrade.js";
30
+ export const PUBLIC_UPDATE_TARGET = Object.freeze({
31
+ packageName: "@aui.io/apollo",
32
+ bin: "apollo",
33
+ });
34
+ let target = PUBLIC_UPDATE_TARGET;
35
+ export function setUpdateTarget(next) {
36
+ target = Object.freeze({ ...next });
37
+ }
38
+ export function updateTarget() {
39
+ return target;
40
+ }
41
+ /** The exact command a notice tells the reader to run. */
42
+ export function upgradeCommand(which = target) {
43
+ return `${which.bin} upgrade`;
44
+ }
45
+ // ------------------------------------------------------------------ cache
46
+ /** One npm lookup satisfies the cache for an hour before the next command
47
+ * triggers another. Releases land several times a day here, so a shorter
48
+ * window than the usual daily check is worth it; the lookup runs detached,
49
+ * so the cadence costs no command any latency. */
50
+ export const UPDATE_CHECK_TTL_MS = 60 * 60 * 1000;
51
+ export const UPDATE_CHECK_FILE = "update-check.json";
52
+ /** `APOLLO_UPDATE_CHECK=0` opts out entirely (same shape as `APOLLO_TUI=0`). */
53
+ export function updateCheckDisabled(env = process.env) {
54
+ return env.APOLLO_UPDATE_CHECK === "0";
55
+ }
56
+ export function updateCheckPath(homeDir = homedir()) {
57
+ return join(apolloDir(homeDir), UPDATE_CHECK_FILE);
58
+ }
59
+ function isEntry(value) {
60
+ return (typeof value === "object" &&
61
+ value !== null &&
62
+ typeof value.checkedAt === "string" &&
63
+ (value.latest === undefined ||
64
+ typeof value.latest === "string"));
65
+ }
66
+ /** The whole file; anything that is not a map of well-formed entries reads
67
+ * as empty (that covers a corrupt file and any older flat layout). */
68
+ export async function readUpdateCache(homeDir = homedir()) {
69
+ try {
70
+ const parsed = JSON.parse(await readFile(updateCheckPath(homeDir), "utf8"));
71
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
72
+ return {};
73
+ }
74
+ const file = {};
75
+ for (const [name, entry] of Object.entries(parsed)) {
76
+ if (isEntry(entry))
77
+ file[name] = entry;
78
+ }
79
+ return file;
80
+ }
81
+ catch {
82
+ // Missing or unreadable — never checked, as far as the notifier knows.
83
+ return {};
84
+ }
85
+ }
86
+ export async function readUpdateEntry(packageName, homeDir = homedir()) {
87
+ return (await readUpdateCache(homeDir))[packageName];
88
+ }
89
+ /** Merge one package's entry into the file, keeping the other packages'. */
90
+ export async function writeUpdateEntry(packageName, entry, homeDir = homedir()) {
91
+ const file = await readUpdateCache(homeDir);
92
+ file[packageName] = entry;
93
+ await writeJsonAtomic(updateCheckPath(homeDir), file, 0o644);
94
+ }
95
+ export function isUpdateEntryStale(entry, now = Date.now()) {
96
+ if (entry === undefined)
97
+ return true;
98
+ const checked = Date.parse(entry.checkedAt);
99
+ if (Number.isNaN(checked))
100
+ return true;
101
+ return now - checked >= UPDATE_CHECK_TTL_MS;
102
+ }
103
+ // ---------------------------------------------------------------- versions
104
+ /**
105
+ * Compare two `x.y.z[-prerelease]` versions; > 0 when `a` is newer than
106
+ * `b`. Enough for what this project publishes — a real semver range parser
107
+ * would be a dependency for a single comparison.
108
+ */
109
+ export function compareVersions(a, b) {
110
+ const [coreA, preA] = splitPrerelease(a);
111
+ const [coreB, preB] = splitPrerelease(b);
112
+ const partsA = coreA.split(".").map(numericPart);
113
+ const partsB = coreB.split(".").map(numericPart);
114
+ for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
115
+ const valueA = partsA[i] ?? 0;
116
+ const valueB = partsB[i] ?? 0;
117
+ if (valueA !== valueB)
118
+ return valueA - valueB;
119
+ }
120
+ // Equal cores: a release outranks any prerelease of it.
121
+ if (preA === undefined && preB === undefined)
122
+ return 0;
123
+ if (preA === undefined)
124
+ return 1;
125
+ if (preB === undefined)
126
+ return -1;
127
+ return comparePrerelease(preA, preB);
128
+ }
129
+ function numericPart(part) {
130
+ const value = Number.parseInt(part, 10);
131
+ return Number.isNaN(value) ? 0 : value;
132
+ }
133
+ function splitPrerelease(version) {
134
+ const cleaned = version.trim().replace(/^v/, "");
135
+ const dash = cleaned.indexOf("-");
136
+ if (dash === -1)
137
+ return [cleaned, undefined];
138
+ return [cleaned.slice(0, dash), cleaned.slice(dash + 1)];
139
+ }
140
+ /** Dot-separated identifiers, numeric ones numerically (`beta.2 < beta.10`). */
141
+ function comparePrerelease(a, b) {
142
+ const partsA = a.split(".");
143
+ const partsB = b.split(".");
144
+ for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
145
+ const valueA = partsA[i];
146
+ const valueB = partsB[i];
147
+ if (valueA === undefined)
148
+ return -1;
149
+ if (valueB === undefined)
150
+ return 1;
151
+ const numA = /^\d+$/.test(valueA) ? Number.parseInt(valueA, 10) : undefined;
152
+ const numB = /^\d+$/.test(valueB) ? Number.parseInt(valueB, 10) : undefined;
153
+ if (numA !== undefined && numB !== undefined) {
154
+ if (numA !== numB)
155
+ return numA - numB;
156
+ }
157
+ else if (numA !== undefined) {
158
+ return -1;
159
+ }
160
+ else if (numB !== undefined) {
161
+ return 1;
162
+ }
163
+ else if (valueA !== valueB) {
164
+ return valueA < valueB ? -1 : 1;
165
+ }
166
+ }
167
+ return 0;
168
+ }
169
+ /**
170
+ * The one line plain runs print to stderr. Starts with "Update available"
171
+ * so it can never be mistaken for the command failing, and quotes the
172
+ * command so an agent can copy it without guessing.
173
+ */
174
+ export function formatUpdateNotice(notice, bin = target.bin) {
175
+ return `Update available: ${bin} ${notice.current} → ${notice.latest} — run "${notice.run}" to install it.`;
176
+ }
177
+ /** The notice for a cache entry, or undefined unless it names a strictly
178
+ * newer version than the one running. */
179
+ export function updateNoticeFrom(entry, currentVersion, which = target) {
180
+ if (entry?.latest === undefined)
181
+ return undefined;
182
+ if (compareVersions(entry.latest, currentVersion) <= 0)
183
+ return undefined;
184
+ const run = upgradeCommand(which);
185
+ const partial = { current: currentVersion, latest: entry.latest, run };
186
+ return {
187
+ package: which.packageName,
188
+ ...partial,
189
+ message: formatUpdateNotice(partial, which.bin),
190
+ };
191
+ }
192
+ /**
193
+ * Ask npm for `latest` and persist the answer. Never throws: offline or a
194
+ * registry outage keeps the previous `latest` (a stale truth beats none)
195
+ * and only moves `checkedAt`, so the next window's command retries once
196
+ * rather than every command hammering the registry.
197
+ */
198
+ export async function refreshUpdateCache(options) {
199
+ const homeDir = options.homeDir ?? homedir();
200
+ const checkedAt = (options.now?.() ?? new Date()).toISOString();
201
+ const previous = await readUpdateEntry(options.packageName, homeDir);
202
+ let entry;
203
+ try {
204
+ const latest = await resolvePublishedVersion(options.packageName, "latest", options.npm);
205
+ entry = { checkedAt, latest, resolvedAt: checkedAt };
206
+ }
207
+ catch {
208
+ entry = {
209
+ checkedAt,
210
+ ...(previous?.latest === undefined ? {} : { latest: previous.latest }),
211
+ ...(previous?.resolvedAt === undefined
212
+ ? {}
213
+ : { resolvedAt: previous.resolvedAt }),
214
+ };
215
+ }
216
+ try {
217
+ await writeUpdateEntry(options.packageName, entry, homeDir);
218
+ }
219
+ catch {
220
+ // Read-only home: the notifier stands down silently.
221
+ }
222
+ return entry;
223
+ }
224
+ /**
225
+ * Record a `latest` we just learned first-hand (`apollo upgrade`, its
226
+ * `--check`, the TUI's /upgrade) so the notice clears — or appears —
227
+ * immediately instead of after the next window.
228
+ */
229
+ export async function recordLatestVersion(packageName, latest, homeDir = homedir()) {
230
+ const now = new Date().toISOString();
231
+ try {
232
+ await writeUpdateEntry(packageName, { checkedAt: now, latest, resolvedAt: now }, homeDir);
233
+ }
234
+ catch {
235
+ // Best effort only.
236
+ }
237
+ }
238
+ /**
239
+ * The whole check for a long-lived surface (the TUI): cached verdict when
240
+ * fresh, an inline refresh when stale, and the notice — if any — for the
241
+ * version that is running. Never throws.
242
+ */
243
+ export async function checkForUpdate(currentVersion, options = {}) {
244
+ if (updateCheckDisabled(options.env))
245
+ return undefined;
246
+ const which = options.which ?? target;
247
+ try {
248
+ const homeDir = options.homeDir ?? homedir();
249
+ let entry = await readUpdateEntry(which.packageName, homeDir);
250
+ const now = options.now?.() ?? new Date();
251
+ if (isUpdateEntryStale(entry, now.getTime())) {
252
+ entry = await refreshUpdateCache({
253
+ packageName: which.packageName,
254
+ homeDir,
255
+ ...(options.npm === undefined ? {} : { npm: options.npm }),
256
+ now: () => now,
257
+ });
258
+ }
259
+ return updateNoticeFrom(entry, currentVersion, which);
260
+ }
261
+ catch {
262
+ return undefined;
263
+ }
264
+ }
265
+ //# sourceMappingURL=update-check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C;QAAE,OAAO,SAAS,CAAC;IACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;QAC1C,IAAI,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAC7C,KAAK,GAAG,MAAM,kBAAkB,CAAC;gBAC/B,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,OAAO;gBACP,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;gBAC1D,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG;aACf,CAAC,CAAC;QACL,CAAC;QACD,OAAO,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -1,4 +1,11 @@
1
1
  export type NpmRunner = (args: string[], options?: {
2
+ /**
3
+ * Stream npm's output live to the parent's **stderr** while it runs
4
+ * (an install can take a while; a silent wait reads as a hang). Never
5
+ * stdout: that is the command's result channel, and a `--json` caller
6
+ * parses it — npm's "changed 36 packages" must not land in front of the
7
+ * envelope. Off, the output is captured and returned instead.
8
+ */
2
9
  inherit?: boolean;
3
10
  }) => Promise<{
4
11
  stdout: string;
@@ -15,6 +22,10 @@ export interface UpgradeResult {
15
22
  export interface UpgradeOptions {
16
23
  check?: boolean;
17
24
  force?: boolean;
25
+ /** Capture npm's install output instead of streaming it to stderr —
26
+ * `--json` / `--quiet` runs, and the TUI, which owns the screen. A
27
+ * failure still surfaces the captured stderr in the error. */
28
+ quiet?: boolean;
18
29
  npm?: NpmRunner;
19
30
  packageName: string;
20
31
  currentVersion: string;
@@ -2,7 +2,9 @@ import { spawn } from "node:child_process";
2
2
  import { CliError } from "../errors/index.js";
3
3
  const defaultNpm = (args, options = {}) => new Promise((resolve, reject) => {
4
4
  const child = spawn("npm", args, {
5
- stdio: options.inherit === true ? "inherit" : ["ignore", "pipe", "pipe"],
5
+ stdio: options.inherit === true
6
+ ? ["ignore", process.stderr, process.stderr]
7
+ : ["ignore", "pipe", "pipe"],
6
8
  env: process.env,
7
9
  });
8
10
  let stdout = "";
@@ -55,7 +57,9 @@ export async function upgradeCli(requested = "latest", options) {
55
57
  };
56
58
  }
57
59
  const spec = `${packageName}@${requested}`;
58
- const result = await npm(["install", "--global", spec], { inherit: true });
60
+ const result = await npm(["install", "--global", spec], {
61
+ inherit: options.quiet !== true,
62
+ });
59
63
  if (result.code !== 0) {
60
64
  throw new CliError(`Failed to install ${spec}.`, {
61
65
  code: "UPGRADE_ERROR",
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../src/services/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAuB9C,MAAM,UAAU,GAAc,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CACnD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE;QAC/B,KAAK,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,E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ollo-core",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
4
4
  "description": "Shared Apollo console core — API clients, config, and services",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,6 +19,8 @@ export { defaultSessionsFile, loadSessions, saveSession, } from "./author/backen
19
19
  export { relativizeEvent, sessionCancel, sessionCreate, sessionEvent, sessionPrompt, sessionRows, unitRowOffset, wrapText, } from "./author/session.js";
20
20
  export { describeKey, matchedBindings, probeLine, rawHex, } from "./lib/keydiag.js";
21
21
  export { G, glyphSet, unicodeSupported, type GlyphSet } from "./theme/glyphs.js";
22
+ export { markerForm, updateMarker, versionStamp, type MarkerForm, } from "./shell/FooterHints.js";
23
+ export { updateToast, upgradeToast } from "./lib/update.js";
22
24
  export { MONO, RICH, palette, type Token } from "./theme/tokens.js";
23
25
  export declare function main(argv?: string[]): Promise<number>;
24
26
  /**
@@ -21,6 +21,8 @@ export { defaultSessionsFile, loadSessions, saveSession, } from "./author/backen
21
21
  export { relativizeEvent, sessionCancel, sessionCreate, sessionEvent, sessionPrompt, sessionRows, unitRowOffset, wrapText, } from "./author/session.js";
22
22
  export { describeKey, matchedBindings, probeLine, rawHex, } from "./lib/keydiag.js";
23
23
  export { G, glyphSet, unicodeSupported } from "./theme/glyphs.js";
24
+ export { markerForm, updateMarker, versionStamp, } from "./shell/FooterHints.js";
25
+ export { updateToast, upgradeToast } from "./lib/update.js";
24
26
  export { MONO, RICH, palette } from "./theme/tokens.js";
25
27
  export async function main(argv = []) {
26
28
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EACL,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B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AAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjF,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACnE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAA4B,EAAE,EAAE;YACjD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6DAA6D;oBAC3D,wEAAwE,CAC3E,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,OAAO,CAAC,CAAC,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAChC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -22,6 +22,7 @@ import { listSecrets, removeSecretByName, scopeLevelLabel, setSecret, } from "@a
22
22
  import { addFiles, addUrls, createHub, defaultExportRoot, deleteHub, describeHubExport, exportHubs, hubRefCheck, hubStatus, listHubs, programHubRefs, } from "@aui.io/apollo-core/services/knowledge.js";
23
23
  import { listProfiles, useProfile } from "@aui.io/apollo-core/services/profile.service.js";
24
24
  import { getStatus } from "@aui.io/apollo-core/services/status.service.js";
25
+ import { recordLatestVersion, updateTarget, } from "@aui.io/apollo-core/services/update-check.js";
25
26
  import { upgradeCli } from "@aui.io/apollo-core/services/upgrade.js";
26
27
  import { checkoutSchemasDir, installSchemas, } from "@aui.io/apollo-core/schemas/install.js";
27
28
  import { installAgentsPage } from "@aui.io/apollo-core/skills/agents-page.js";
@@ -30,6 +31,7 @@ import { messagesToTurns } from "../talk/data.js";
30
31
  import { consoleVersion, doctorPaneLines, doctorSummary, requestPaneLines, } from "./diagnostics.js";
31
32
  import { pickerDisplayName } from "./picker.js";
32
33
  import { detectIdes, ideTargetDir, launchIde } from "./ide.js";
34
+ import { upgradeToast } from "./update.js";
33
35
  import { enterAgentCheckout, followAccountAgent, GATE_CREATE_ID, GATE_IMPORT_ID, GATE_SKIP_ID, } from "./checkout.js";
34
36
  import { homeishPath } from "./scope.js";
35
37
  function item(id, name, detail) {
@@ -489,15 +491,22 @@ export async function runSimpleCommand(name, context, args) {
489
491
  };
490
492
  }
491
493
  case "upgrade": {
494
+ // consoleVersion(), not npm_package_version: that env var only exists
495
+ // under npm scripts, so the fallback "0.0.0" made every run look
496
+ // upgradable. The package follows the distribution (apollo-internal
497
+ // retargets it) rather than being spelled out here.
498
+ const { packageName } = updateTarget();
492
499
  const result = await upgradeCli("latest", {
493
- packageName: "@aui.io/apollo",
494
- currentVersion: process.env.npm_package_version ?? "0.0.0",
500
+ packageName,
501
+ currentVersion: consoleVersion(),
502
+ // The renderer owns the terminal: npm's install output would draw
503
+ // straight over the UI. A failure still reaches the toast.
504
+ quiet: true,
495
505
  });
496
- return {
497
- toast: result.upgraded
498
- ? `Upgraded to ${result.available}`
499
- : `Already on ${result.current} (latest ${result.available})`,
500
- };
506
+ // The notifier's cache takes the answer we just got from npm, so the
507
+ // CLI's banner and the next launch agree with this result at once.
508
+ await recordLatestVersion(packageName, result.available);
509
+ return { toast: upgradeToast(result) };
501
510
  }
502
511
  case "new": {
503
512
  // Same wiring as `apollo thread create`: the runtime wants an explicit