@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.
- package/dist/cli-registry.js +113 -3
- package/dist/cli.bundle.cjs +96 -92
- package/dist/commands/check-integration.js +8 -8
- package/dist/commands/comments.js +3 -0
- package/dist/commands/config.js +14 -7
- package/dist/commands/daily-render.js +10 -5
- package/dist/commands/daily.js +6 -1
- package/dist/commands/dashboard-lifecycle.js +1 -1
- package/dist/commands/dashboard-process.js +4 -4
- package/dist/commands/dashboard-server.js +7 -6
- package/dist/commands/dashboard.js +2 -2
- package/dist/commands/detect-formatters.js +3 -3
- package/dist/commands/doctor.js +5 -5
- package/dist/commands/guidelines.d.ts +67 -0
- package/dist/commands/guidelines.js +159 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/list-move-tier.js +5 -5
- package/dist/commands/local-repos.js +9 -9
- package/dist/commands/parse-list.js +10 -10
- package/dist/commands/scout-bridge.js +2 -2
- package/dist/commands/setup.js +24 -13
- package/dist/commands/skip-add.js +6 -3
- package/dist/commands/skip-file-parser.js +3 -3
- package/dist/commands/startup.js +11 -8
- package/dist/commands/state-cmd.js +1 -1
- package/dist/commands/status.js +7 -0
- package/dist/commands/validation.js +3 -3
- package/dist/commands/vet-list.js +12 -8
- package/dist/commands/vet.js +1 -2
- package/dist/core/__fixtures__/prompt-injection-payloads.d.ts +22 -0
- package/dist/core/__fixtures__/prompt-injection-payloads.js +109 -0
- package/dist/core/anti-llm-policy.js +5 -5
- package/dist/core/auth.js +5 -5
- package/dist/core/daily-logic.js +8 -4
- package/dist/core/dates.js +3 -3
- package/dist/core/errors.d.ts +29 -0
- package/dist/core/errors.js +63 -0
- package/dist/core/formatter-detection.js +9 -9
- package/dist/core/gist-state-store.d.ts +19 -3
- package/dist/core/gist-state-store.js +81 -15
- package/dist/core/guidelines-store.d.ts +74 -0
- package/dist/core/guidelines-store.js +130 -0
- package/dist/core/http-cache.js +6 -6
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/issue-conversation.js +3 -1
- package/dist/core/paths.js +4 -4
- package/dist/core/pr-comments-fetcher.d.ts +67 -0
- package/dist/core/pr-comments-fetcher.js +125 -0
- package/dist/core/pr-monitor.js +1 -2
- package/dist/core/pr-template.js +1 -1
- package/dist/core/state-persistence.d.ts +6 -0
- package/dist/core/state-persistence.js +27 -9
- package/dist/core/state-schema.d.ts +5 -1
- package/dist/core/state-schema.js +7 -1
- package/dist/core/state.d.ts +60 -0
- package/dist/core/state.js +136 -13
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +2 -2
- package/dist/core/untrusted-content.d.ts +48 -0
- package/dist/core/untrusted-content.js +106 -0
- package/dist/core/urls.js +2 -2
- package/dist/formatters/json.d.ts +53 -3
- package/dist/formatters/json.js +49 -14
- package/package.json +1 -1
package/dist/formatters/json.js
CHANGED
|
@@ -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
|
-
|
|
166
|
-
|
|
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(),
|