@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/cli-registry.js
CHANGED
|
@@ -69,6 +69,36 @@ function printRepos(repos) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
export const commands = [
|
|
72
|
+
// ── Manifest (#1190) ───────────────────────────────────────────────────
|
|
73
|
+
// Lets the plugin's session-start hook verify CLI/plugin contract drift —
|
|
74
|
+
// it diffs the registered commands against `.claude-plugin/expected-cli-contract.json`
|
|
75
|
+
// and warns when the markdown layer references commands the CLI no longer
|
|
76
|
+
// exposes. Local-only: no GitHub access needed.
|
|
77
|
+
{
|
|
78
|
+
name: 'manifest',
|
|
79
|
+
localOnly: true,
|
|
80
|
+
register(program) {
|
|
81
|
+
program
|
|
82
|
+
.command('manifest')
|
|
83
|
+
.description('Print the CLI contract (registered commands + version) for plugin/MCP introspection (#1190)')
|
|
84
|
+
.option('--json', 'Output as JSON')
|
|
85
|
+
.action(async (options) => {
|
|
86
|
+
const { ManifestOutputSchema } = await import('./formatters/json.js');
|
|
87
|
+
await executeAction(options, async () => {
|
|
88
|
+
const { getCLIVersion } = await import('./core/index.js');
|
|
89
|
+
return {
|
|
90
|
+
schemaVersion: 1,
|
|
91
|
+
cliVersion: getCLIVersion(),
|
|
92
|
+
commands: commands
|
|
93
|
+
.map((c) => ({ name: c.name, localOnly: !!c.localOnly }))
|
|
94
|
+
.sort((a, b) => a.name.localeCompare(b.name)),
|
|
95
|
+
};
|
|
96
|
+
}, (data) => {
|
|
97
|
+
console.log(`oss-autopilot v${data.cliVersion} (${data.commands.length} commands)`);
|
|
98
|
+
}, ManifestOutputSchema);
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
},
|
|
72
102
|
// ── Daily ──────────────────────────────────────────────────────────────
|
|
73
103
|
{
|
|
74
104
|
name: 'daily',
|
|
@@ -473,7 +503,7 @@ export const commands = [
|
|
|
473
503
|
for await (const chunk of process.stdin) {
|
|
474
504
|
chunks.push(chunk);
|
|
475
505
|
}
|
|
476
|
-
message = Buffer.concat(chunks).toString('
|
|
506
|
+
message = Buffer.concat(chunks).toString('utf8').trim();
|
|
477
507
|
}
|
|
478
508
|
else {
|
|
479
509
|
message = messageParts.join(' ');
|
|
@@ -663,7 +693,7 @@ export const commands = [
|
|
|
663
693
|
.action(async (options) => {
|
|
664
694
|
try {
|
|
665
695
|
const port = parseInt(options.port, 10);
|
|
666
|
-
if (isNaN(port) || port < 1 || port >
|
|
696
|
+
if (isNaN(port) || port < 1 || port > 65_535) {
|
|
667
697
|
console.error(`Invalid port number: "${options.port}". Must be an integer between 1 and 65535.`);
|
|
668
698
|
process.exit(1);
|
|
669
699
|
}
|
|
@@ -688,7 +718,7 @@ export const commands = [
|
|
|
688
718
|
.action(async (filePath, options) => {
|
|
689
719
|
const { ParseIssueListOutputSchema } = await import('./formatters/json.js');
|
|
690
720
|
await executeAction(options, async () => (await import('./commands/parse-list.js')).runParseList({ filePath }), async (data) => {
|
|
691
|
-
const path = await import('path');
|
|
721
|
+
const path = await import('node:path');
|
|
692
722
|
const resolvedPath = path.resolve(filePath);
|
|
693
723
|
console.log(`\n\ud83d\udccb Issue List: ${resolvedPath}\n`);
|
|
694
724
|
console.log(`Available: ${data.availableCount} | Completed: ${data.completedCount}\n`);
|
|
@@ -1090,4 +1120,84 @@ export const commands = [
|
|
|
1090
1120
|
});
|
|
1091
1121
|
},
|
|
1092
1122
|
},
|
|
1123
|
+
// ── Guidelines (#867) ──────────────────────────────────────────────────
|
|
1124
|
+
{
|
|
1125
|
+
name: 'guidelines',
|
|
1126
|
+
register(program) {
|
|
1127
|
+
const group = program
|
|
1128
|
+
.command('guidelines')
|
|
1129
|
+
.description('Manage per-repo learning guidelines extracted from PR feedback (#867)');
|
|
1130
|
+
group
|
|
1131
|
+
.command('view')
|
|
1132
|
+
.description('Read the per-repo guidelines file (returns null when none exists or in local mode)')
|
|
1133
|
+
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
1134
|
+
.option('--json', 'Output as JSON')
|
|
1135
|
+
.action(async (options) => {
|
|
1136
|
+
await executeAction(options, async () => (await import('./commands/guidelines.js')).runGuidelinesView({ repo: options.repo }), (data) => {
|
|
1137
|
+
if (data.content === null) {
|
|
1138
|
+
console.log(`No guidelines stored for ${data.repo} (storage: ${data.storageMode}).`);
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
console.log(`# Guidelines for ${data.repo} (${data.byteSize} bytes)\n`);
|
|
1142
|
+
console.log(data.content);
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
});
|
|
1146
|
+
group
|
|
1147
|
+
.command('store')
|
|
1148
|
+
.description('Persist per-repo guidelines (overwrites). Reads markdown content from --content or stdin.')
|
|
1149
|
+
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
1150
|
+
.option('--content <markdown>', 'Markdown content. If omitted, reads from stdin.')
|
|
1151
|
+
.option('--json', 'Output as JSON')
|
|
1152
|
+
.action(async (options) => {
|
|
1153
|
+
await executeAction(options, async () => {
|
|
1154
|
+
const content = options.content ?? (await readStdin());
|
|
1155
|
+
return (await import('./commands/guidelines.js')).runGuidelinesStore({ repo: options.repo, content });
|
|
1156
|
+
}, (data) => {
|
|
1157
|
+
console.log(`Stored ${data.byteSize} bytes of guidelines for ${data.repo}.`);
|
|
1158
|
+
});
|
|
1159
|
+
});
|
|
1160
|
+
group
|
|
1161
|
+
.command('reset')
|
|
1162
|
+
.description('Tombstone the guidelines file for a repo (subsequent reads return null)')
|
|
1163
|
+
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
1164
|
+
.option('--json', 'Output as JSON')
|
|
1165
|
+
.action(async (options) => {
|
|
1166
|
+
await executeAction(options, async () => (await import('./commands/guidelines.js')).runGuidelinesReset({ repo: options.repo }), (data) => {
|
|
1167
|
+
console.log(data.deleted
|
|
1168
|
+
? `Reset guidelines for ${data.repo}.`
|
|
1169
|
+
: `No guidelines existed for ${data.repo}; nothing to reset.`);
|
|
1170
|
+
});
|
|
1171
|
+
});
|
|
1172
|
+
group
|
|
1173
|
+
.command('fetch-corpus')
|
|
1174
|
+
.description('Fetch raw PR comment bundles for the host extract-learnings prompt to consume')
|
|
1175
|
+
.requiredOption('--repo <owner/repo>', 'Repository identifier')
|
|
1176
|
+
.option('--limit <n>', 'Max PRs to process (1-10, default 5)', (v) => parseInt(v, 10))
|
|
1177
|
+
.option('--force', 'Re-fetch even when commentsFetchedAt is already set')
|
|
1178
|
+
.option('--json', 'Output as JSON')
|
|
1179
|
+
.action(async (options) => {
|
|
1180
|
+
await executeAction(options, async () => (await import('./commands/guidelines.js')).runFetchCorpus({
|
|
1181
|
+
repo: options.repo,
|
|
1182
|
+
limit: options.limit,
|
|
1183
|
+
forceRefetch: options.force,
|
|
1184
|
+
}), (data) => {
|
|
1185
|
+
console.log(`Fetched ${data.prCount} PR comment bundle(s) for ${data.repo}.`);
|
|
1186
|
+
if (data.skipped > 0) {
|
|
1187
|
+
console.log(` Skipped ${data.skipped} PR(s) already processed (use --force to re-fetch).`);
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
});
|
|
1191
|
+
},
|
|
1192
|
+
},
|
|
1093
1193
|
];
|
|
1194
|
+
/** Read full stdin content. Used when `guidelines store` content isn't passed inline. */
|
|
1195
|
+
async function readStdin() {
|
|
1196
|
+
if (process.stdin.isTTY) {
|
|
1197
|
+
throw new Error('No --content provided and stdin is a TTY. Pipe content or pass --content "...".');
|
|
1198
|
+
}
|
|
1199
|
+
let data = '';
|
|
1200
|
+
for await (const chunk of process.stdin)
|
|
1201
|
+
data += chunk;
|
|
1202
|
+
return data;
|
|
1203
|
+
}
|