@oss-autopilot/core 1.9.0 → 1.11.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 +64 -0
- package/dist/cli.bundle.cjs +78 -76
- package/dist/cli.js +17 -0
- package/dist/commands/comments.js +11 -0
- package/dist/commands/config.js +10 -7
- package/dist/commands/daily.js +25 -2
- package/dist/commands/dashboard-server.js +28 -6
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.js +7 -0
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +29 -27
- package/dist/commands/state-cmd.d.ts +22 -0
- package/dist/commands/state-cmd.js +64 -0
- package/dist/core/errors.d.ts +6 -0
- package/dist/core/errors.js +12 -0
- package/dist/core/gist-state-store.d.ts +181 -0
- package/dist/core/gist-state-store.js +473 -0
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +3 -2
- package/dist/core/state-persistence.d.ts +14 -2
- package/dist/core/state-persistence.js +46 -12
- package/dist/core/state-schema.d.ts +45 -41
- package/dist/core/state-schema.js +14 -19
- package/dist/core/state.d.ts +43 -29
- package/dist/core/state.js +151 -54
- package/dist/core/types.d.ts +4 -3
- package/dist/core/types.js +4 -3
- package/dist/core/utils.d.ts +30 -0
- package/dist/core/utils.js +36 -0
- package/package.json +1 -1
package/dist/cli-registry.js
CHANGED
|
@@ -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',
|