@oss-autopilot/core 3.1.0 → 3.3.0

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 (66) hide show
  1. package/dist/cli-registry.js +113 -3
  2. package/dist/cli.bundle.cjs +96 -92
  3. package/dist/commands/check-integration.js +8 -8
  4. package/dist/commands/comments.js +3 -0
  5. package/dist/commands/config.js +14 -7
  6. package/dist/commands/daily-render.js +10 -5
  7. package/dist/commands/daily.js +6 -1
  8. package/dist/commands/dashboard-lifecycle.js +1 -1
  9. package/dist/commands/dashboard-process.js +4 -4
  10. package/dist/commands/dashboard-server.js +7 -6
  11. package/dist/commands/dashboard.js +2 -2
  12. package/dist/commands/detect-formatters.js +3 -3
  13. package/dist/commands/doctor.js +5 -5
  14. package/dist/commands/guidelines.d.ts +67 -0
  15. package/dist/commands/guidelines.js +159 -0
  16. package/dist/commands/index.d.ts +9 -0
  17. package/dist/commands/index.js +9 -0
  18. package/dist/commands/list-move-tier.js +5 -5
  19. package/dist/commands/local-repos.js +9 -9
  20. package/dist/commands/parse-list.js +10 -10
  21. package/dist/commands/scout-bridge.js +2 -2
  22. package/dist/commands/setup.js +24 -13
  23. package/dist/commands/skip-add.js +6 -3
  24. package/dist/commands/skip-file-parser.js +3 -3
  25. package/dist/commands/startup.js +11 -8
  26. package/dist/commands/state-cmd.js +1 -1
  27. package/dist/commands/status.js +7 -0
  28. package/dist/commands/validation.js +3 -3
  29. package/dist/commands/vet-list.js +12 -8
  30. package/dist/commands/vet.js +1 -2
  31. package/dist/core/__fixtures__/prompt-injection-payloads.d.ts +22 -0
  32. package/dist/core/__fixtures__/prompt-injection-payloads.js +109 -0
  33. package/dist/core/anti-llm-policy.js +5 -5
  34. package/dist/core/auth.js +5 -5
  35. package/dist/core/daily-logic.js +8 -4
  36. package/dist/core/dates.js +3 -3
  37. package/dist/core/errors.d.ts +29 -0
  38. package/dist/core/errors.js +63 -0
  39. package/dist/core/formatter-detection.js +9 -9
  40. package/dist/core/gist-state-store.d.ts +19 -3
  41. package/dist/core/gist-state-store.js +81 -15
  42. package/dist/core/guidelines-store.d.ts +74 -0
  43. package/dist/core/guidelines-store.js +130 -0
  44. package/dist/core/http-cache.js +6 -6
  45. package/dist/core/index.d.ts +2 -0
  46. package/dist/core/index.js +2 -0
  47. package/dist/core/issue-conversation.js +3 -1
  48. package/dist/core/paths.js +4 -4
  49. package/dist/core/pr-comments-fetcher.d.ts +67 -0
  50. package/dist/core/pr-comments-fetcher.js +125 -0
  51. package/dist/core/pr-monitor.js +1 -2
  52. package/dist/core/pr-template.js +1 -1
  53. package/dist/core/state-persistence.d.ts +6 -0
  54. package/dist/core/state-persistence.js +27 -9
  55. package/dist/core/state-schema.d.ts +5 -1
  56. package/dist/core/state-schema.js +7 -1
  57. package/dist/core/state.d.ts +60 -0
  58. package/dist/core/state.js +136 -13
  59. package/dist/core/types.d.ts +1 -1
  60. package/dist/core/types.js +2 -2
  61. package/dist/core/untrusted-content.d.ts +48 -0
  62. package/dist/core/untrusted-content.js +106 -0
  63. package/dist/core/urls.js +2 -2
  64. package/dist/formatters/json.d.ts +53 -3
  65. package/dist/formatters/json.js +49 -14
  66. package/package.json +1 -1
@@ -3,6 +3,18 @@
3
3
  * Provides structured output that can be consumed by scripts and plugins
4
4
  */
5
5
  import { z } from 'zod';
6
+ export function buildStalenessWarning(info) {
7
+ return {
8
+ phase: 'gist-staleness',
9
+ operation: 'state refresh',
10
+ message: `Operating on ${info.source} state — Gist refresh failed: ${info.reason}`,
11
+ timestamp: info.detectedAt,
12
+ details: {
13
+ source: info.source,
14
+ lastSuccessfulRefresh: info.lastSuccessfulRefresh,
15
+ },
16
+ };
17
+ }
6
18
  /**
7
19
  * Strip a full DailyOutput down to the compact subset (#763).
8
20
  * Omits summary, repoGroups, and full failures array. Retains a failureCount
@@ -61,6 +73,27 @@ export function compactRepoGroups(groups) {
61
73
  prUrls: group.prs.map((pr) => pr.url),
62
74
  }));
63
75
  }
76
+ // DailyWarning schema lives here (rather than further down with the rest of
77
+ // the daily schemas) so StatusOutputSchema below can reference it directly
78
+ // without `z.lazy()`. The runtime shape is shared across daily / status /
79
+ // comments warnings — see `DailyWarning` interface above.
80
+ const DailyWarningPhaseSchema = z.enum([
81
+ 'fetch',
82
+ 'repo-scores',
83
+ 'analytics',
84
+ 'scout-sync',
85
+ 'partition',
86
+ 'dismiss-filter',
87
+ 'gist-checkpoint',
88
+ 'gist-staleness',
89
+ ]);
90
+ const DailyWarningSchema = z.object({
91
+ phase: DailyWarningPhaseSchema,
92
+ operation: z.string(),
93
+ message: z.string(),
94
+ timestamp: z.string().optional(),
95
+ details: z.record(z.string(), z.unknown()).optional(),
96
+ });
64
97
  export const StatusOutputSchema = z.object({
65
98
  stats: z.object({
66
99
  mergedPRs: z.number().int().nonnegative(),
@@ -73,6 +106,7 @@ export const StatusOutputSchema = z.object({
73
106
  lastRunAt: z.string(),
74
107
  offline: z.boolean().optional(),
75
108
  lastUpdated: z.string().optional(),
109
+ warnings: z.array(DailyWarningSchema).optional(),
76
110
  });
77
111
  // ── Daily output schemas (#1146) ─────────────────────────────────────
78
112
  //
@@ -162,20 +196,8 @@ const CompactRepoGroupSchema = z.object({
162
196
  repo: z.string(),
163
197
  prUrls: z.array(z.string()),
164
198
  });
165
- const DailyWarningPhaseSchema = z.enum([
166
- 'fetch',
167
- 'repo-scores',
168
- 'analytics',
169
- 'scout-sync',
170
- 'partition',
171
- 'dismiss-filter',
172
- 'gist-checkpoint',
173
- ]);
174
- const DailyWarningSchema = z.object({
175
- phase: DailyWarningPhaseSchema,
176
- operation: z.string(),
177
- message: z.string(),
178
- });
199
+ // DailyWarning schemas were hoisted above StatusOutputSchema (#1193) so the
200
+ // status output can reference them without `z.lazy()`.
179
201
  export const DailyOutputSchema = z.object({
180
202
  digest: DailyDigestCompactSchema,
181
203
  capacity: CapacityAssessmentSchema,
@@ -278,6 +300,19 @@ export const InitOutputSchema = z.object({
278
300
  username: z.string(),
279
301
  message: z.string(),
280
302
  });
303
+ // ── #1190: plugin → CLI contract ─────────────────────────────────────
304
+ //
305
+ // Pinned shape lets the plugin's session-start hook verify that the bundled
306
+ // CLI exposes the subcommands the markdown layer expects. Bumping
307
+ // `schemaVersion` is a breaking change to that contract.
308
+ export const ManifestOutputSchema = z.object({
309
+ schemaVersion: z.literal(1),
310
+ cliVersion: z.string().regex(/^\d+\.\d+\.\d+/),
311
+ commands: z.array(z.object({
312
+ name: z.string(),
313
+ localOnly: z.boolean(),
314
+ })),
315
+ });
281
316
  export const CheckSetupOutputSchema = z.object({
282
317
  setupComplete: z.boolean(),
283
318
  username: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {