@oss-autopilot/core 3.27.0 → 3.28.1

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 (53) hide show
  1. package/dist/cli-pre-action.d.ts +9 -0
  2. package/dist/cli-pre-action.js +95 -0
  3. package/dist/cli-registry.js +11 -1
  4. package/dist/cli.bundle.cjs +116 -113
  5. package/dist/cli.js +4 -87
  6. package/dist/commands/comments.js +3 -1
  7. package/dist/commands/dashboard-lifecycle.d.ts +25 -2
  8. package/dist/commands/dashboard-lifecycle.js +71 -55
  9. package/dist/commands/dashboard-server.js +1 -1
  10. package/dist/commands/dashboard.d.ts +2 -2
  11. package/dist/commands/dashboard.js +13 -5
  12. package/dist/commands/overnight-push-prep.js +4 -0
  13. package/dist/commands/overnight.js +31 -1
  14. package/dist/commands/parse-list.js +77 -43
  15. package/dist/commands/startup.d.ts +3 -0
  16. package/dist/commands/startup.js +7 -3
  17. package/dist/commands/vet-list.js +4 -2
  18. package/dist/core/anti-llm-policy.js +10 -0
  19. package/dist/core/checklist-analysis.d.ts +6 -0
  20. package/dist/core/checklist-analysis.js +90 -14
  21. package/dist/core/ci-analysis.js +11 -4
  22. package/dist/core/errors.d.ts +17 -0
  23. package/dist/core/errors.js +25 -0
  24. package/dist/core/paths.d.ts +9 -1
  25. package/dist/core/paths.js +11 -1
  26. package/dist/core/pr-monitor.d.ts +2 -2
  27. package/dist/core/pr-monitor.js +9 -6
  28. package/dist/core/review-analysis.d.ts +6 -2
  29. package/dist/core/review-analysis.js +13 -4
  30. package/dist/core/types.d.ts +1 -1
  31. package/dist/dashboard/assets/chart-panel-0drzwc3-.js +3 -0
  32. package/dist/dashboard/assets/confetti.module-BYDB1iN2.js +2 -0
  33. package/dist/dashboard/assets/index-C0LCGMVi.js +50 -0
  34. package/dist/dashboard/assets/index-CTiG-vjC.css +1 -0
  35. package/dist/dashboard/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  36. package/dist/dashboard/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  37. package/dist/dashboard/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  38. package/dist/dashboard/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  39. package/dist/dashboard/assets/plus-jakarta-sans-latin-400-normal-BDKaGhyp.woff +0 -0
  40. package/dist/dashboard/assets/plus-jakarta-sans-latin-400-normal-Dhut76fR.woff2 +0 -0
  41. package/dist/dashboard/assets/plus-jakarta-sans-latin-500-normal-Bf-nb4oT.woff2 +0 -0
  42. package/dist/dashboard/assets/plus-jakarta-sans-latin-500-normal-DYtqi0QS.woff +0 -0
  43. package/dist/dashboard/assets/plus-jakarta-sans-latin-600-normal-BR_Ojra4.woff +0 -0
  44. package/dist/dashboard/assets/plus-jakarta-sans-latin-600-normal-DLTa1BUW.woff2 +0 -0
  45. package/dist/dashboard/assets/plus-jakarta-sans-latin-700-normal-CfpNZvy6.woff2 +0 -0
  46. package/dist/dashboard/assets/plus-jakarta-sans-latin-700-normal-DqEcQeE5.woff +0 -0
  47. package/dist/dashboard/assets/plus-jakarta-sans-latin-800-normal-BRNHt2w0.woff +0 -0
  48. package/dist/dashboard/assets/plus-jakarta-sans-latin-800-normal-CusIZhrK.woff2 +0 -0
  49. package/dist/dashboard/favicon.svg +83 -0
  50. package/dist/dashboard/index.html +54 -0
  51. package/dist/formatters/json.d.ts +19 -0
  52. package/dist/formatters/json.js +3 -0
  53. package/package.json +3 -2
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The CLI's preAction hook: debug flag, auth gate, and Gist persistence
3
+ * bootstrap. Lives outside cli.ts because cli.ts parses argv and may call
4
+ * process.exit at import time, so nothing in it can be imported by a test.
5
+ * Tests previously exercised a hand-copied replica of this hook, which drifted.
6
+ */
7
+ import type { Command } from 'commander';
8
+ /** Install the preAction hook. `localOnlySet` holds the registry names that skip the auth gate. */
9
+ export declare function installPreAction(program: Command, localOnlySet: ReadonlySet<string>): void;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The CLI's preAction hook: debug flag, auth gate, and Gist persistence
3
+ * bootstrap. Lives outside cli.ts because cli.ts parses argv and may call
4
+ * process.exit at import time, so nothing in it can be imported by a test.
5
+ * Tests previously exercised a hand-copied replica of this hook, which drifted.
6
+ */
7
+ import { getGitHubTokenAsync, enableDebug, debug } from './core/index.js';
8
+ /** Install the preAction hook. `localOnlySet` holds the registry names that skip the auth gate. */
9
+ export function installPreAction(program, localOnlySet) {
10
+ program.hook('preAction', async (thisCommand, actionCommand) => {
11
+ // Enable debug logging if --debug flag is set
12
+ const globalOpts = thisCommand.opts();
13
+ if (globalOpts.debug) {
14
+ enableDebug();
15
+ debug('cli', `Running command: ${actionCommand.name()}`);
16
+ }
17
+ // actionCommand is the command being executed (e.g., 'status', 'daily').
18
+ // For subcommand groups (e.g. `guidelines view`), Commander returns the
19
+ // leaf name `view` — but the registry sets `localOnly` on the parent
20
+ // entry `guidelines`. Walk the parent chain so a `localOnly` ancestor
21
+ // covers all its leaves (#1208 M2). Without this, `guidelines view` —
22
+ // which works fine in local mode (returns storageMode: 'local-unavailable')
23
+ // — would still hit the auth gate and fail.
24
+ let cmd = actionCommand;
25
+ let isLocalOnly = false;
26
+ while (cmd) {
27
+ if (localOnlySet.has(cmd.name())) {
28
+ isLocalOnly = true;
29
+ break;
30
+ }
31
+ cmd = cmd.parent;
32
+ }
33
+ if (!isLocalOnly) {
34
+ const token = await getGitHubTokenAsync();
35
+ if (!token) {
36
+ // Honor --json at the CLI boundary so machine consumers (plugins, MCP
37
+ // stdio harnesses, scripts) get a parseable envelope instead of a
38
+ // stderr blob followed by a non-zero exit. Commander has already parsed
39
+ // the action's own options, so we check both the action command and the
40
+ // raw argv as a fallback (#1056 M20).
41
+ const wantsJson = Boolean(actionCommand.opts().json) || process.argv.includes('--json');
42
+ if (wantsJson) {
43
+ const { outputJsonError } = await import('./formatters/json.js');
44
+ outputJsonError('GitHub authentication required. Install gh CLI and run `gh auth login`, or set GITHUB_TOKEN.', 'AUTH_REQUIRED');
45
+ }
46
+ else {
47
+ console.error('Error: GitHub authentication required.');
48
+ console.error('');
49
+ console.error('Option 1 (Recommended): Install and authenticate GitHub CLI');
50
+ console.error(' Install: https://cli.github.com/');
51
+ console.error(' Then run: gh auth login');
52
+ console.error('');
53
+ console.error('Option 2: Set GITHUB_TOKEN environment variable');
54
+ console.error(' export GITHUB_TOKEN="your-github-token-here"');
55
+ console.error('');
56
+ console.error('Then run your command again.');
57
+ }
58
+ process.exit(1);
59
+ }
60
+ // Activate Gist persistence if configured, before any command runs.
61
+ // Shared helper peeks at the state file and only pre-sets the singleton
62
+ // when Gist mode is the configured persistence (#1000). Hard errors
63
+ // still throw (#1202); the resolving degraded modes are surfaced in the
64
+ // JSON envelope so --json consumers see them too (#1433).
65
+ const { ensureGistPersistence, renderGistWarning } = await import('./core/index.js');
66
+ const status = await ensureGistPersistence(token);
67
+ if (status === 'degraded' || status === 'state-unreadable') {
68
+ const { setEnvelopeGistWarning } = await import('./formatters/json.js');
69
+ // Shared renderer (#1444). 'degraded' is ensureGistPersistence's
70
+ // deliberate conflation of the transient init fallback and a #1443
71
+ // degraded bootstrap — rendered as the init-fallback cause, as before.
72
+ setEnvelopeGistWarning(renderGistWarning(status === 'degraded' ? 'init-fallback' : 'state-unreadable'));
73
+ }
74
+ }
75
+ else {
76
+ // #1431: localOnly skips the AUTH GATE, not gist persistence. Mutating
77
+ // localOnly commands (shelve/move/dismiss/override/...) already call
78
+ // maybeCheckpoint, which silently no-ops when the singleton never
79
+ // bootstrapped — so a gist-configured user's CLI mutations were written
80
+ // local-only with no warning and never reached the Gist. Best-effort
81
+ // bootstrap; the warning semantics live (and are unit-tested) in
82
+ // bootstrapGistBestEffort.
83
+ const { bootstrapGistBestEffort } = await import('./core/index.js');
84
+ const localOnlyWarning = await bootstrapGistBestEffort(getGitHubTokenAsync);
85
+ if (localOnlyWarning) {
86
+ console.error(`Warning: ${localOnlyWarning}`);
87
+ // Also thread it into the JSON envelope: shelve/move/dismiss --json
88
+ // consumers (the agent harness) must see the mutation will not sync —
89
+ // stderr alone is invisible to them (#1433).
90
+ const { setEnvelopeGistWarning } = await import('./formatters/json.js');
91
+ setEnvelopeGistWarning(localOnlyWarning);
92
+ }
93
+ }
94
+ });
95
+ }
@@ -144,6 +144,10 @@ export const commands = [
144
144
  .option('--compact', 'Reduce JSON payload by omitting summary, repoGroups, and full failure details')
145
145
  .action(async (options) => {
146
146
  try {
147
+ // Stop an old-version dashboard server before it can overwrite
148
+ // this run's classifications with its own refresh (#1709).
149
+ const { stopStaleDashboardServer } = await import('./commands/dashboard-lifecycle.js');
150
+ await stopStaleDashboardServer();
147
151
  if (options.json) {
148
152
  const { runDaily } = await import('./commands/daily.js');
149
153
  const data = await runDaily();
@@ -1012,13 +1016,19 @@ export const commands = [
1012
1016
  const path = await import('node:path');
1013
1017
  const resolvedPath = path.resolve(filePath);
1014
1018
  console.log(`\n\ud83d\udccb Issue List: ${resolvedPath}\n`);
1015
- console.log(`Available: ${data.availableCount} | Completed: ${data.completedCount}\n`);
1019
+ console.log(`Available: ${data.availableCount} | Completed: ${data.completedCount} | Blocked: ${data.blockedCount}\n`);
1016
1020
  if (data.available.length > 0) {
1017
1021
  console.log('--- Available ---');
1018
1022
  for (const item of data.available) {
1019
1023
  console.log(` [${item.tier}] ${item.repo}#${item.number}: ${item.title}`);
1020
1024
  }
1021
1025
  }
1026
+ if (data.blocked.length > 0) {
1027
+ console.log('\n--- Blocked ---');
1028
+ for (const item of data.blocked) {
1029
+ console.log(` [${item.tier}] ${item.repo}#${item.number}: ${item.title}`);
1030
+ }
1031
+ }
1022
1032
  if (data.completed.length > 0) {
1023
1033
  console.log('\n--- Completed ---');
1024
1034
  for (const item of data.completed) {