@aui.io/apollo 0.1.21 → 0.1.25

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 (110) hide show
  1. package/README.md +183 -0
  2. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +34 -9
  3. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
  4. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.d.ts +10 -0
  5. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js +63 -0
  6. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js.map +1 -0
  7. package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.d.ts +13 -0
  8. package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.js +89 -0
  9. package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.js.map +1 -0
  10. package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js +24 -7
  11. package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js.map +1 -1
  12. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.d.ts +10 -0
  13. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.js +116 -0
  14. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.js.map +1 -0
  15. package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js +3 -3
  16. package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js.map +1 -1
  17. package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js +1 -0
  18. package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js.map +1 -1
  19. package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +1 -0
  20. package/node_modules/@aui.io/apollo-cli/dist/src/index.js +26 -1
  21. package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
  22. package/node_modules/@aui.io/apollo-cli/package.json +3 -3
  23. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +166 -26
  24. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +106 -20
  25. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -1
  26. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.d.ts +22 -0
  27. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js +75 -0
  28. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js.map +1 -0
  29. package/node_modules/@aui.io/apollo-core/dist/src/api/management.d.ts +0 -1
  30. package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +0 -6
  31. package/node_modules/@aui.io/apollo-core/dist/src/api/management.js.map +1 -1
  32. package/node_modules/@aui.io/apollo-core/dist/src/api/network.d.ts +19 -0
  33. package/node_modules/@aui.io/apollo-core/dist/src/api/network.js +53 -0
  34. package/node_modules/@aui.io/apollo-core/dist/src/api/network.js.map +1 -0
  35. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +14 -2
  36. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +15 -28
  37. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
  38. package/node_modules/@aui.io/apollo-core/dist/src/config/index.d.ts +1 -1
  39. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +16 -1
  40. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -1
  41. package/node_modules/@aui.io/apollo-core/dist/src/config/store.d.ts +10 -0
  42. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js +24 -0
  43. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js.map +1 -1
  44. package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +18 -1
  45. package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +10 -5
  46. package/node_modules/@aui.io/apollo-core/dist/src/index.js +9 -4
  47. package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
  48. package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.d.ts +72 -0
  49. package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js +114 -0
  50. package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js.map +1 -0
  51. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +47 -1
  52. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +60 -6
  53. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -1
  54. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +4 -1
  55. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +19 -0
  56. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -1
  57. package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.d.ts +39 -0
  58. package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.js +586 -0
  59. package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.js.map +1 -0
  60. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +78 -2
  61. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +177 -17
  62. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -1
  63. package/node_modules/@aui.io/apollo-core/dist/src/services/requests.d.ts +22 -0
  64. package/node_modules/@aui.io/apollo-core/dist/src/services/requests.js +73 -0
  65. package/node_modules/@aui.io/apollo-core/dist/src/services/requests.js.map +1 -0
  66. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.d.ts +15 -8
  67. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js +80 -58
  68. package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js.map +1 -1
  69. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.d.ts +2 -0
  70. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js +10 -2
  71. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js.map +1 -1
  72. package/node_modules/@aui.io/apollo-core/package.json +1 -1
  73. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +16 -2
  74. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
  75. package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js +31 -16
  76. package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js.map +1 -1
  77. package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.d.ts +19 -0
  78. package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.js +29 -0
  79. package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.js.map +1 -0
  80. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +3 -1
  81. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +6 -18
  82. package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -1
  83. package/node_modules/@aui.io/apollo-tui/dist/src/author/ResourcesView.js +26 -4
  84. package/node_modules/@aui.io/apollo-tui/dist/src/author/ResourcesView.js.map +1 -1
  85. package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js +6 -2
  86. package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js.map +1 -1
  87. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +95 -16
  88. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
  89. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +1 -1
  90. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +20 -0
  91. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
  92. package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.d.ts +8 -0
  93. package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js +109 -0
  94. package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js.map +1 -0
  95. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.d.ts +2 -0
  96. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js +1 -0
  97. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js.map +1 -1
  98. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +2 -2
  99. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
  100. package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.d.ts +4 -2
  101. package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js +5 -3
  102. package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js.map +1 -1
  103. package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.d.ts +5 -0
  104. package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.js +56 -0
  105. package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.js.map +1 -0
  106. package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.d.ts +73 -0
  107. package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.js +488 -0
  108. package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.js.map +1 -0
  109. package/node_modules/@aui.io/apollo-tui/package.json +2 -2
  110. package/package.json +4 -4
@@ -0,0 +1,586 @@
1
+ /**
2
+ * `apollo doctor` — environment/setup diagnosis (flutter-doctor style).
3
+ *
4
+ * Doctor verifies everything commands DEPEND on — runtimes, install shape,
5
+ * terminal capabilities, config/credentials, the current checkout, service
6
+ * reachability, and local-state hygiene — it never exercises product
7
+ * features end-to-end (that is CI's job). Every check is read-only: doctor
8
+ * must be safe to run on a broken machine, so it never writes, prunes, or
9
+ * refreshes anything.
10
+ *
11
+ * Checks return structure, not prose: the CLI renders sections, `--json`
12
+ * comes free through the Output envelope, and the TUI can reuse the same
13
+ * report later. Every non-ok finding carries the fix as a suggestion —
14
+ * the whole point is "paste this in a support thread and the next step is
15
+ * already written down".
16
+ *
17
+ * Grown from real failures (keep adding: every support incident should
18
+ * become a check): empty `bundle/src` after a TUI-created agent, expired
19
+ * tokens, forgotten `APOLLO_*_URL` overrides pointing at localhost, missing
20
+ * Bun making the TUI "disappear", loose credential file permissions.
21
+ */
22
+ import { readdir, readFile, realpath, stat } from "node:fs/promises";
23
+ import { execFile } from "node:child_process";
24
+ import { homedir } from "node:os";
25
+ import path from "node:path";
26
+ import { apolloDir } from "../config/store.js";
27
+ import { checkoutAlive, registryFile, } from "../checkouts/registry.js";
28
+ import { getStatus } from "./status.service.js";
29
+ import { resolvePublishedVersion } from "./upgrade.js";
30
+ const MIN_NODE_MAJOR = 20;
31
+ /** Warn when the token dies within this window — mid-push expiry hurts. */
32
+ const TOKEN_EXPIRY_SOON_MS = 60 * 60 * 1000;
33
+ const SHELL_INIT_MARKER = "apollo shell-init";
34
+ /** Env vars that silently change behavior — doctor surfaces every one set. */
35
+ const OVERRIDE_VARS = [
36
+ "APOLLO_ENV",
37
+ "APOLLO_PROFILE",
38
+ "APOLLO_TOKEN",
39
+ "APOLLO_ORG_ID",
40
+ "APOLLO_PROJECT_ID",
41
+ "APOLLO_TIMEOUT_MS",
42
+ "APOLLO_IDENTITY_URL",
43
+ "APOLLO_MANAGEMENT_URL",
44
+ "APOLLO_RUNTIME_URL",
45
+ "APOLLO_MOCKDB_URL",
46
+ "APOLLO_VAULT_URL",
47
+ "APOLLO_KBM_URL",
48
+ "APOLLO_AGENT_SETTINGS_URL",
49
+ "APOLLO_TUI",
50
+ ];
51
+ const defaultRunCommand = (command, args) => new Promise((resolve, reject) => {
52
+ execFile(command, args, { timeout: 2000 }, (error, stdout) => {
53
+ if (error) {
54
+ reject(new Error(error.message || `${command} failed`));
55
+ }
56
+ else {
57
+ resolve(stdout.toString().trim());
58
+ }
59
+ });
60
+ });
61
+ export async function runDoctor(context, options) {
62
+ const env = options.env ?? process.env;
63
+ const home = options.homeDir ?? homedir();
64
+ const runCommand = options.runCommand ?? defaultRunCommand;
65
+ const offline = options.offline === true;
66
+ const checks = [];
67
+ const add = (check) => {
68
+ checks.push(check);
69
+ };
70
+ await installationChecks(add, { ...options, env, runCommand, offline });
71
+ environmentChecks(add, env);
72
+ const status = await getStatus(context, {
73
+ check: !offline,
74
+ ...(options.fetch ? { fetch: options.fetch } : {}),
75
+ });
76
+ await authChecks(add, { env, home, status });
77
+ await checkoutChecks(add, context, home);
78
+ serviceChecks(add, status.checks, offline);
79
+ await hygieneChecks(add, home);
80
+ const problems = checks.filter((item) => item.status === "fail").length;
81
+ const warnings = checks.filter((item) => item.status === "warn").length;
82
+ return { checks, problems, warnings, healthy: problems === 0 };
83
+ }
84
+ // ------------------------------------------------------------ installation
85
+ async function installationChecks(add, options) {
86
+ const nodeVersion = options.nodeVersion ?? process.versions.node;
87
+ const major = Number.parseInt(nodeVersion.split(".")[0] ?? "0", 10);
88
+ add({
89
+ id: "node-version",
90
+ section: "installation",
91
+ status: major >= MIN_NODE_MAJOR ? "ok" : "fail",
92
+ label: `node v${nodeVersion}`,
93
+ ...(major >= MIN_NODE_MAJOR
94
+ ? {}
95
+ : {
96
+ note: `apollo requires Node ${MIN_NODE_MAJOR}+`,
97
+ suggestion: `Install Node ${MIN_NODE_MAJOR} or newer (e.g. via nvm).`,
98
+ }),
99
+ });
100
+ try {
101
+ const bunVersion = await options.runCommand("bun", ["--version"]);
102
+ add({
103
+ id: "bun",
104
+ section: "installation",
105
+ status: "ok",
106
+ label: `bun v${bunVersion}`,
107
+ note: "interactive TUI available",
108
+ });
109
+ }
110
+ catch {
111
+ add({
112
+ id: "bun",
113
+ section: "installation",
114
+ status: "warn",
115
+ label: "bun not found",
116
+ note: "the interactive TUI is unavailable; the CLI is unaffected",
117
+ suggestion: "curl -fsSL https://bun.sh/install | bash",
118
+ });
119
+ }
120
+ const entry = options.entryPath ?? process.argv[1];
121
+ let origin = "unknown install";
122
+ if (entry) {
123
+ try {
124
+ const resolved = await realpath(entry);
125
+ origin = resolved.includes(`node_modules${path.sep}@aui.io${path.sep}`)
126
+ ? "npm global install"
127
+ : `development build (${resolved})`;
128
+ }
129
+ catch {
130
+ origin = `unresolvable entry point (${entry})`;
131
+ }
132
+ }
133
+ add({
134
+ id: "install-origin",
135
+ section: "installation",
136
+ status: "ok",
137
+ label: `apollo ${options.cliVersion}`,
138
+ note: origin,
139
+ });
140
+ if (!options.offline) {
141
+ try {
142
+ const latest = await resolvePublishedVersion(options.packageName, "latest", options.npm);
143
+ add({
144
+ id: "latest-version",
145
+ section: "installation",
146
+ status: latest === options.cliVersion ? "ok" : "warn",
147
+ label: latest === options.cliVersion
148
+ ? "up to date with npm"
149
+ : `npm has ${latest} (running ${options.cliVersion})`,
150
+ ...(latest === options.cliVersion
151
+ ? {}
152
+ : { suggestion: "apollo upgrade" }),
153
+ });
154
+ }
155
+ catch {
156
+ add({
157
+ id: "latest-version",
158
+ section: "installation",
159
+ status: "warn",
160
+ label: "could not check npm for the latest version",
161
+ note: "registry.npmjs.org unreachable from this machine",
162
+ });
163
+ }
164
+ }
165
+ await shellIntegrationCheck(add, options.env, options);
166
+ }
167
+ async function shellIntegrationCheck(add, env, options) {
168
+ const home = options.homeDir ?? homedir();
169
+ const platform = options.platform ?? process.platform;
170
+ const loginShell = path.basename(env.SHELL ?? "");
171
+ const rcFile = loginShell === "zsh"
172
+ ? path.join(home, ".zshrc")
173
+ : loginShell === "bash"
174
+ ? path.join(home, platform === "darwin" ? ".bash_profile" : ".bashrc")
175
+ : undefined;
176
+ if (rcFile === undefined) {
177
+ add({
178
+ id: "shell-integration",
179
+ section: "installation",
180
+ status: "ok",
181
+ label: `shell integration n/a (${loginShell || "unknown shell"})`,
182
+ note: "auto-cd hooks support zsh/bash only",
183
+ });
184
+ return;
185
+ }
186
+ let contents = "";
187
+ try {
188
+ contents = await readFile(rcFile, "utf8");
189
+ }
190
+ catch {
191
+ // Missing rc file — same outcome as a missing marker.
192
+ }
193
+ const installed = contents.includes(SHELL_INIT_MARKER);
194
+ add({
195
+ id: "shell-integration",
196
+ section: "installation",
197
+ status: installed ? "ok" : "warn",
198
+ label: installed
199
+ ? `shell integration installed (${path.basename(rcFile)})`
200
+ : "shell integration not installed",
201
+ ...(installed
202
+ ? {}
203
+ : {
204
+ note: "agent use/import/create will not auto-cd",
205
+ suggestion: `Add to ${path.basename(rcFile)}: eval "$(apollo shell-init)"`,
206
+ }),
207
+ });
208
+ }
209
+ // ------------------------------------------------------------- environment
210
+ function environmentChecks(add, env) {
211
+ const overrides = OVERRIDE_VARS.filter((name) => env[name] !== undefined && env[name] !== "").map((name) => name === "APOLLO_TOKEN" ? "APOLLO_TOKEN=(set)" : `${name}=${env[name]}`);
212
+ add({
213
+ id: "env-overrides",
214
+ section: "environment",
215
+ status: overrides.length === 0 ? "ok" : "warn",
216
+ label: overrides.length === 0
217
+ ? "no APOLLO_* environment overrides"
218
+ : `${overrides.length} environment override(s) active`,
219
+ ...(overrides.length === 0
220
+ ? {}
221
+ : {
222
+ note: overrides.join(" · "),
223
+ suggestion: "Overrides silently redirect the CLI — unset any you do not expect.",
224
+ }),
225
+ });
226
+ const issues = [];
227
+ if (env.NO_COLOR !== undefined)
228
+ issues.push("NO_COLOR is set (monochrome UI)");
229
+ if (env.TERM === "dumb")
230
+ issues.push("TERM=dumb (no interactive rendering)");
231
+ const locale = env.LC_ALL || env.LANG || "";
232
+ if (!/utf-?8/i.test(locale)) {
233
+ issues.push(`locale is not UTF-8 (${locale || "unset"}) — glyphs degrade`);
234
+ }
235
+ add({
236
+ id: "terminal",
237
+ section: "environment",
238
+ status: issues.length === 0 ? "ok" : "warn",
239
+ label: issues.length === 0
240
+ ? "terminal supports color + unicode"
241
+ : "terminal capabilities reduced",
242
+ ...(issues.length === 0 ? {} : { note: issues.join(" · ") }),
243
+ });
244
+ }
245
+ // -------------------------------------------------------------------- auth
246
+ async function authChecks(add, input) {
247
+ const { env, home, status } = input;
248
+ add({
249
+ id: "context",
250
+ section: "auth",
251
+ status: "ok",
252
+ label: `${status.profile}@${status.environment}`,
253
+ note: status.agentRoot ? `checkout ${status.agentRoot}` : "no checkout",
254
+ });
255
+ const credentialsPath = path.join(apolloDir(home), "credentials.json");
256
+ try {
257
+ const info = await stat(credentialsPath);
258
+ const mode = info.mode & 0o777;
259
+ const loose = (mode & 0o077) !== 0;
260
+ add({
261
+ id: "credentials-permissions",
262
+ section: "auth",
263
+ status: loose ? "fail" : "ok",
264
+ label: loose
265
+ ? `credentials.json permissions too open (0${mode.toString(8)})`
266
+ : "credentials.json permissions 0600",
267
+ ...(loose
268
+ ? { suggestion: `chmod 600 ${credentialsPath}` }
269
+ : {}),
270
+ });
271
+ }
272
+ catch {
273
+ add({
274
+ id: "credentials-permissions",
275
+ section: "auth",
276
+ status: env.APOLLO_TOKEN ? "ok" : "warn",
277
+ label: "no credentials file",
278
+ note: env.APOLLO_TOKEN
279
+ ? "APOLLO_TOKEN provides the session"
280
+ : "no stored login for this machine",
281
+ ...(env.APOLLO_TOKEN ? {} : { suggestion: "apollo login" }),
282
+ });
283
+ }
284
+ if (!status.authenticated) {
285
+ add({
286
+ id: "token",
287
+ section: "auth",
288
+ status: "warn",
289
+ label: "not logged in",
290
+ note: "commands that talk to the API will fail",
291
+ suggestion: "apollo login",
292
+ });
293
+ }
294
+ else if (status.tokenExpiresAt === null) {
295
+ add({
296
+ id: "token",
297
+ section: "auth",
298
+ status: "ok",
299
+ label: "token present (no readable expiry)",
300
+ });
301
+ }
302
+ else {
303
+ const remaining = Date.parse(status.tokenExpiresAt) - Date.now();
304
+ if (remaining <= 0) {
305
+ add({
306
+ id: "token",
307
+ section: "auth",
308
+ status: "fail",
309
+ label: `token expired ${formatAgo(-remaining)} ago`,
310
+ suggestion: "apollo login",
311
+ });
312
+ }
313
+ else if (remaining < TOKEN_EXPIRY_SOON_MS) {
314
+ add({
315
+ id: "token",
316
+ section: "auth",
317
+ status: "warn",
318
+ label: `token expires in ${formatAgo(remaining)}`,
319
+ note: "long pushes/chats may fail mid-command",
320
+ suggestion: "apollo login",
321
+ });
322
+ }
323
+ else {
324
+ add({
325
+ id: "token",
326
+ section: "auth",
327
+ status: "ok",
328
+ label: `token valid (expires ${status.tokenExpiresAt})`,
329
+ });
330
+ }
331
+ }
332
+ if (status.orgId !== null &&
333
+ status.tokenOrgId !== null &&
334
+ status.orgId !== status.tokenOrgId) {
335
+ add({
336
+ id: "org-scope",
337
+ section: "auth",
338
+ status: "warn",
339
+ label: "organization mismatch",
340
+ note: `selected ${status.orgId}, token is scoped to ${status.tokenOrgId}`,
341
+ suggestion: `apollo org use ${status.orgId}`,
342
+ });
343
+ }
344
+ else {
345
+ add({
346
+ id: "org-scope",
347
+ section: "auth",
348
+ status: "ok",
349
+ label: status.orgId
350
+ ? `organization ${status.orgId}`
351
+ : "no organization selected",
352
+ });
353
+ }
354
+ }
355
+ // ---------------------------------------------------------------- checkout
356
+ async function checkoutChecks(add, context, home) {
357
+ if (!context.agentRoot) {
358
+ add({
359
+ id: "checkout",
360
+ section: "checkout",
361
+ status: "ok",
362
+ label: "no agent checkout here",
363
+ note: "cd into a checkout (or apollo agent use) for checkout checks",
364
+ });
365
+ return;
366
+ }
367
+ add({
368
+ id: "binding",
369
+ section: "checkout",
370
+ status: context.versionTag ? "ok" : "warn",
371
+ label: context.versionTag
372
+ ? `.apollorc pins ${context.versionTag} (agent ${context.agentId ?? "?"})`
373
+ : ".apollorc has no version_tag",
374
+ ...(context.versionTag
375
+ ? {}
376
+ : {
377
+ note: "pull/push will resolve a version implicitly",
378
+ suggestion: "apollo version use <tag>",
379
+ }),
380
+ });
381
+ const bundleSrc = path.join(context.agentRoot, "bundle", "src");
382
+ const programOk = await exists(path.join(bundleSrc, "program.yaml"));
383
+ if (programOk) {
384
+ add({
385
+ id: "program-files",
386
+ section: "checkout",
387
+ status: "ok",
388
+ label: "bundle/src has program.yaml",
389
+ });
390
+ }
391
+ else {
392
+ const hasBundleDir = await exists(bundleSrc);
393
+ add({
394
+ id: "program-files",
395
+ section: "checkout",
396
+ status: "fail",
397
+ label: hasBundleDir
398
+ ? "bundle/src has no program.yaml"
399
+ : "checkout has no bundle/src",
400
+ note: "chat/validate against this agent will fail with missing program files",
401
+ suggestion: "apollo pull",
402
+ });
403
+ }
404
+ const schemasDir = path.join(context.agentRoot, "schemas");
405
+ let schemaCount = 0;
406
+ try {
407
+ schemaCount = (await readdir(schemasDir)).filter((name) => !name.startsWith(".")).length;
408
+ }
409
+ catch {
410
+ // Missing directory — same as empty.
411
+ }
412
+ add({
413
+ id: "schemas",
414
+ section: "checkout",
415
+ status: schemaCount > 0 ? "ok" : "warn",
416
+ label: schemaCount > 0
417
+ ? `authoring schemas present (${schemaCount})`
418
+ : "no authoring schemas",
419
+ ...(schemaCount > 0
420
+ ? {}
421
+ : {
422
+ note: "editor validation for program files is off",
423
+ suggestion: "apollo schema pull",
424
+ }),
425
+ });
426
+ if (programOk && context.agentId) {
427
+ const baseline = path.join(apolloDir(home), "baselines", context.agentId, "baseline.json");
428
+ const baselineOk = await exists(baseline);
429
+ add({
430
+ id: "baseline",
431
+ section: "checkout",
432
+ status: baselineOk ? "ok" : "warn",
433
+ label: baselineOk ? "sync baseline present" : "no sync baseline",
434
+ ...(baselineOk
435
+ ? {}
436
+ : {
437
+ note: "diff/push will treat every file as new until the next pull or push records one",
438
+ }),
439
+ });
440
+ }
441
+ }
442
+ // ---------------------------------------------------------------- services
443
+ function serviceChecks(add, serviceResults, offline) {
444
+ if (offline || serviceResults === undefined) {
445
+ add({
446
+ id: "services",
447
+ section: "services",
448
+ status: "ok",
449
+ label: "service probes skipped (--offline)",
450
+ });
451
+ return;
452
+ }
453
+ for (const result of serviceResults) {
454
+ const authNote = result.authenticated === null
455
+ ? "auth unknown"
456
+ : result.authenticated
457
+ ? "authorized"
458
+ : "unauthorized";
459
+ if (!result.reachable) {
460
+ add({
461
+ id: `service-${result.service}`,
462
+ section: "services",
463
+ status: "fail",
464
+ label: `${result.service} unreachable`,
465
+ ...(result.detail ? { note: result.detail } : {}),
466
+ suggestion: "Check connectivity/VPN — or APOLLO_*_URL overrides pointing at a dead host.",
467
+ });
468
+ }
469
+ else if (result.authenticated === false) {
470
+ add({
471
+ id: `service-${result.service}`,
472
+ section: "services",
473
+ status: "fail",
474
+ label: `${result.service} reachable, unauthorized`,
475
+ ...(result.detail ? { note: result.detail } : {}),
476
+ suggestion: "apollo login",
477
+ });
478
+ }
479
+ else {
480
+ add({
481
+ id: `service-${result.service}`,
482
+ section: "services",
483
+ status: "ok",
484
+ label: `${result.service} reachable, ${authNote}`,
485
+ });
486
+ }
487
+ }
488
+ }
489
+ // ----------------------------------------------------------------- hygiene
490
+ async function hygieneChecks(add, home) {
491
+ // Read the registry file directly: readCheckoutRegistry() runs a legacy
492
+ // migration that WRITES an empty registry on first read, and doctor is
493
+ // strictly read-only.
494
+ let registryRaw;
495
+ try {
496
+ registryRaw = await readFile(registryFile(home), "utf8");
497
+ }
498
+ catch {
499
+ registryRaw = undefined; // no registry yet — nothing to check
500
+ }
501
+ if (registryRaw === undefined) {
502
+ add({
503
+ id: "checkout-registry",
504
+ section: "hygiene",
505
+ status: "ok",
506
+ label: "checkout registry clean (0 entries)",
507
+ });
508
+ }
509
+ else {
510
+ try {
511
+ const parsed = JSON.parse(registryRaw);
512
+ const entries = (parsed.checkouts ?? []).filter((entry) => typeof entry.path === "string" &&
513
+ typeof entry.agent_id === "string");
514
+ let dead = 0;
515
+ for (const entry of entries) {
516
+ if (!(await checkoutAlive(entry)))
517
+ dead += 1;
518
+ }
519
+ add({
520
+ id: "checkout-registry",
521
+ section: "hygiene",
522
+ status: dead === 0 ? "ok" : "warn",
523
+ label: dead === 0
524
+ ? `checkout registry clean (${entries.length} entr${entries.length === 1 ? "y" : "ies"})`
525
+ : `${dead} stale checkout registry entr${dead === 1 ? "y" : "ies"}`,
526
+ ...(dead === 0
527
+ ? {}
528
+ : {
529
+ note: "entries point at moved or deleted checkouts; pickers prune them on next use",
530
+ }),
531
+ });
532
+ }
533
+ catch {
534
+ add({
535
+ id: "checkout-registry",
536
+ section: "hygiene",
537
+ status: "warn",
538
+ label: "checkout registry unreadable",
539
+ note: "~/.apollo/checkouts.json is corrupt; it rebuilds as checkouts are used",
540
+ });
541
+ }
542
+ }
543
+ const capturePath = path.join(apolloDir(home), "last-requests.json");
544
+ try {
545
+ const raw = await readFile(capturePath, "utf8");
546
+ const parsed = JSON.parse(raw);
547
+ add({
548
+ id: "request-capture",
549
+ section: "hygiene",
550
+ status: "ok",
551
+ label: `request capture readable (${Array.isArray(parsed) ? parsed.length : 0} entries)`,
552
+ });
553
+ }
554
+ catch (error) {
555
+ const missing = error.code === "ENOENT";
556
+ add({
557
+ id: "request-capture",
558
+ section: "hygiene",
559
+ status: missing ? "ok" : "warn",
560
+ label: missing
561
+ ? "no request captures yet"
562
+ : "request capture file unreadable",
563
+ ...(missing
564
+ ? {}
565
+ : { note: "it is overwritten by the next command that calls the API" }),
566
+ });
567
+ }
568
+ }
569
+ // ------------------------------------------------------------------ shared
570
+ async function exists(target) {
571
+ try {
572
+ await stat(target);
573
+ return true;
574
+ }
575
+ catch {
576
+ return false;
577
+ }
578
+ }
579
+ function formatAgo(ms) {
580
+ const minutes = Math.round(ms / 60_000);
581
+ if (minutes < 60)
582
+ return `${minutes}m`;
583
+ const hours = Math.floor(minutes / 60);
584
+ return `${hours}h ${String(minutes % 60).padStart(2, "0")}m`;
585
+ }
586
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/services/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EACL,aAAa,EACb,YAAY,GAEb,MAAM,0BA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