@oss-autopilot/core 1.10.0 → 1.12.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 (52) hide show
  1. package/README.md +8 -5
  2. package/dist/cli-registry.js +64 -0
  3. package/dist/cli.bundle.cjs +78 -117
  4. package/dist/cli.js +17 -0
  5. package/dist/commands/config.js +13 -1
  6. package/dist/commands/daily.js +17 -0
  7. package/dist/commands/dashboard-server.js +28 -6
  8. package/dist/commands/index.d.ts +10 -1
  9. package/dist/commands/index.js +9 -0
  10. package/dist/commands/scout-bridge.d.ts +15 -0
  11. package/dist/commands/scout-bridge.js +60 -0
  12. package/dist/commands/search.d.ts +1 -1
  13. package/dist/commands/search.js +10 -13
  14. package/dist/commands/setup.d.ts +1 -0
  15. package/dist/commands/setup.js +29 -1
  16. package/dist/commands/state-cmd.d.ts +22 -0
  17. package/dist/commands/state-cmd.js +64 -0
  18. package/dist/commands/vet-list.d.ts +1 -1
  19. package/dist/commands/vet-list.js +4 -5
  20. package/dist/commands/vet.d.ts +1 -1
  21. package/dist/commands/vet.js +4 -5
  22. package/dist/core/errors.d.ts +6 -0
  23. package/dist/core/errors.js +12 -0
  24. package/dist/core/gist-state-store.d.ts +12 -0
  25. package/dist/core/gist-state-store.js +49 -0
  26. package/dist/core/index.d.ts +1 -3
  27. package/dist/core/index.js +2 -3
  28. package/dist/core/state-schema.d.ts +29 -0
  29. package/dist/core/state-schema.js +4 -0
  30. package/dist/core/state.d.ts +5 -0
  31. package/dist/core/state.js +32 -3
  32. package/dist/core/types.d.ts +3 -2
  33. package/dist/core/types.js +2 -1
  34. package/package.json +2 -1
  35. package/dist/core/category-mapping.d.ts +0 -19
  36. package/dist/core/category-mapping.js +0 -58
  37. package/dist/core/issue-discovery.d.ts +0 -94
  38. package/dist/core/issue-discovery.js +0 -591
  39. package/dist/core/issue-eligibility.d.ts +0 -38
  40. package/dist/core/issue-eligibility.js +0 -151
  41. package/dist/core/issue-filtering.d.ts +0 -51
  42. package/dist/core/issue-filtering.js +0 -103
  43. package/dist/core/issue-scoring.d.ts +0 -43
  44. package/dist/core/issue-scoring.js +0 -97
  45. package/dist/core/issue-vetting.d.ts +0 -33
  46. package/dist/core/issue-vetting.js +0 -306
  47. package/dist/core/repo-health.d.ts +0 -24
  48. package/dist/core/repo-health.js +0 -194
  49. package/dist/core/search-budget.d.ts +0 -62
  50. package/dist/core/search-budget.js +0 -129
  51. package/dist/core/search-phases.d.ts +0 -83
  52. package/dist/core/search-phases.js +0 -238
package/README.md CHANGED
@@ -53,7 +53,8 @@ All commands support `--json` for structured output:
53
53
  ## Library Usage
54
54
 
55
55
  ```typescript
56
- import { PRMonitor, StateManager, IssueDiscovery } from '@oss-autopilot/core';
56
+ import { PRMonitor, getStateManager } from '@oss-autopilot/core';
57
+ import { runSearch, runVet } from '@oss-autopilot/core/commands';
57
58
 
58
59
  const token = process.env.GITHUB_TOKEN!;
59
60
 
@@ -62,12 +63,14 @@ const monitor = new PRMonitor(token);
62
63
  const result = await monitor.fetchUserOpenPRs();
63
64
 
64
65
  // Manage state
65
- const state = StateManager.getInstance();
66
+ const state = getStateManager();
66
67
  const currentState = state.getState();
67
68
 
68
- // Discover contributable issues
69
- const discovery = new IssueDiscovery(token);
70
- const issues = await discovery.searchIssues({ languages: ['typescript'], maxResults: 5 });
69
+ // Search for contributable issues (delegates to @oss-scout/core)
70
+ const searchResult = await runSearch({ maxResults: 10 });
71
+
72
+ // Vet a specific issue
73
+ const vetResult = await runVet({ issueUrl: 'https://github.com/owner/repo/issues/123' });
71
74
  ```
72
75
 
73
76
  ## Claude Code Plugin
@@ -104,6 +104,70 @@ export const commands = [
104
104
  });
105
105
  },
106
106
  },
107
+ // ── State ──────────────────────────────────────────────────────────────
108
+ {
109
+ name: 'state',
110
+ register(program) {
111
+ program
112
+ .command('state')
113
+ .description('Manage state persistence (local/gist)')
114
+ .option('--show', 'Display current persistence mode and Gist ID')
115
+ .option('--sync', 'Force push state to Gist (no-op if not in Gist mode)')
116
+ .option('--unlink', 'Switch from Gist back to local persistence')
117
+ .option('--json', 'Output as JSON')
118
+ .action(async (options) => {
119
+ try {
120
+ if (options.unlink) {
121
+ const { runStateUnlink } = await import('./commands/state-cmd.js');
122
+ const data = await runStateUnlink();
123
+ if (options.json) {
124
+ outputJson(data);
125
+ }
126
+ else {
127
+ console.log(`State written to ${data.localStatePath}`);
128
+ console.log('Persistence switched to local mode.');
129
+ if (data.previousGistId) {
130
+ console.log(`Previous Gist (${data.previousGistId}) was NOT deleted.`);
131
+ }
132
+ console.log('Restart any running processes (e.g. dashboard server) to pick up the change.');
133
+ }
134
+ }
135
+ else if (options.sync) {
136
+ const { runStateSync } = await import('./commands/state-cmd.js');
137
+ const data = await runStateSync();
138
+ if (options.json) {
139
+ outputJson(data);
140
+ }
141
+ else if (data.pushed) {
142
+ console.log(`State pushed to Gist ${data.gistId}`);
143
+ }
144
+ else {
145
+ console.log('Not in Gist mode. Nothing to sync.');
146
+ }
147
+ }
148
+ else {
149
+ // Default: --show
150
+ const { runStateShow } = await import('./commands/state-cmd.js');
151
+ const data = await runStateShow();
152
+ if (options.json) {
153
+ outputJson(data);
154
+ }
155
+ else {
156
+ console.log(`\nPersistence: ${data.persistence}`);
157
+ if (data.gistId)
158
+ console.log(`Gist ID: ${data.gistId}`);
159
+ if (data.gistDegraded)
160
+ console.log('Status: DEGRADED (using local cache)');
161
+ console.log(`Last run: ${data.lastRunAt ?? 'Never'}\n`);
162
+ }
163
+ }
164
+ }
165
+ catch (err) {
166
+ handleCommandError(err, options.json);
167
+ }
168
+ });
169
+ },
170
+ },
107
171
  // ── Search ─────────────────────────────────────────────────────────────
108
172
  {
109
173
  name: 'search',