@productbrain/cli 0.1.0-beta.40 → 0.1.0-beta.42
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/commands/admin/index.d.ts +17 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +62 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/admin/inspect.d.ts +12 -0
- package/dist/commands/admin/inspect.d.ts.map +1 -0
- package/dist/commands/admin/inspect.js +415 -0
- package/dist/commands/admin/inspect.js.map +1 -0
- package/dist/commands/admin/inspect.test.d.ts +5 -0
- package/dist/commands/admin/inspect.test.d.ts.map +1 -0
- package/dist/commands/admin/inspect.test.js +40 -0
- package/dist/commands/admin/inspect.test.js.map +1 -0
- package/dist/commands/admin/seed.d.ts +32 -0
- package/dist/commands/admin/seed.d.ts.map +1 -0
- package/dist/commands/admin/seed.js +400 -0
- package/dist/commands/admin/seed.js.map +1 -0
- package/dist/commands/admin/seed.test.d.ts +6 -0
- package/dist/commands/admin/seed.test.d.ts.map +1 -0
- package/dist/commands/admin/seed.test.js +65 -0
- package/dist/commands/admin/seed.test.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/client.d.ts +8 -0
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +29 -0
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/style.d.ts +22 -0
- package/dist/lib/style.d.ts.map +1 -1
- package/dist/lib/style.js +52 -0
- package/dist/lib/style.js.map +1 -1
- package/dist/lib/style.test.js +57 -1
- package/dist/lib/style.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb admin seed — workspace and platform seed operations (WP-312 S3, FEAT-970).
|
|
3
|
+
*
|
|
4
|
+
* Seed metadata is duplicated from `convex/admin/commandManifest.ts` for CLI help
|
|
5
|
+
* and ordering only — behavior is enforced server-side (STD-101).
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export type SeedCommandMeta = {
|
|
9
|
+
/** Manifest name, e.g. seed:knowledge */
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
requiresWorkspaceId: boolean;
|
|
13
|
+
dryRunSupported: boolean;
|
|
14
|
+
/** When true, require explicit acknowledgment in production */
|
|
15
|
+
dangerous?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Order matches `ADMIN_COMMANDS` seed block in commandManifest.ts — dependency order for `seed all`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SEED_COMMAND_ENTRIES: readonly SeedCommandMeta[];
|
|
21
|
+
/** Manifest order for `pb admin seed all`. */
|
|
22
|
+
export declare const SEED_MANIFEST_ORDER: readonly string[];
|
|
23
|
+
/** Accept `knowledge` or `seed:knowledge`. */
|
|
24
|
+
export declare function normalizeSeedCommandName(input: string): string;
|
|
25
|
+
export declare function buildSeedArgs(manifestName: string, opts: {
|
|
26
|
+
workspaceId?: string;
|
|
27
|
+
dryRun?: boolean;
|
|
28
|
+
presetId?: string;
|
|
29
|
+
}): Record<string, unknown>;
|
|
30
|
+
/** Attach seed subcommands to the `seed` Commander node. */
|
|
31
|
+
export declare function attachSeedCommands(seed: Command): void;
|
|
32
|
+
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/commands/admin/seed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBpC,MAAM,MAAM,eAAe,GAAG;IAC5B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,eAAe,EAqFjD,CAAC;AAIX,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAA4C,CAAC;AAe9F,8CAA8C;AAC9C,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB9D;AAkBD,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAClE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmCzB;AA2FD,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAuLtD"}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb admin seed — workspace and platform seed operations (WP-312 S3, FEAT-970).
|
|
3
|
+
*
|
|
4
|
+
* Seed metadata is duplicated from `convex/admin/commandManifest.ts` for CLI help
|
|
5
|
+
* and ordering only — behavior is enforced server-side (STD-101).
|
|
6
|
+
*/
|
|
7
|
+
import { adminCall } from '../../lib/client.js';
|
|
8
|
+
import { getConfig } from '../../lib/config.js';
|
|
9
|
+
import { CLIError, ErrorCode } from '../../lib/errors.js';
|
|
10
|
+
import { readSession } from '../../lib/session.js';
|
|
11
|
+
import { isJsonMode } from '../../lib/runner.js';
|
|
12
|
+
import { withSpinner } from '../../lib/spinner.js';
|
|
13
|
+
import { adminBanner, bold, confirmProdAction, cyan, dim, green, heading, hint, icons, red, } from '../../lib/style.js';
|
|
14
|
+
/**
|
|
15
|
+
* Order matches `ADMIN_COMMANDS` seed block in commandManifest.ts — dependency order for `seed all`.
|
|
16
|
+
*/
|
|
17
|
+
export const SEED_COMMAND_ENTRIES = [
|
|
18
|
+
{
|
|
19
|
+
name: 'seed:artifacts',
|
|
20
|
+
description: 'Seed Artifacts collection and related glossary entries (chainId, format, audience)',
|
|
21
|
+
requiresWorkspaceId: true,
|
|
22
|
+
dryRunSupported: false,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'seed:chain-native-bet-constellation',
|
|
26
|
+
description: 'Seed the chain-native bet constellation for a workspace',
|
|
27
|
+
requiresWorkspaceId: false,
|
|
28
|
+
dryRunSupported: false,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'seed:definitions-chain',
|
|
32
|
+
description: 'Seed the definitions chain collection',
|
|
33
|
+
requiresWorkspaceId: true,
|
|
34
|
+
dryRunSupported: false,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'seed:domain-teams',
|
|
38
|
+
description: 'Seed domain teams collection entries',
|
|
39
|
+
requiresWorkspaceId: true,
|
|
40
|
+
dryRunSupported: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'seed:features',
|
|
44
|
+
description: 'Seed Features collection and initial trust-audit entries',
|
|
45
|
+
requiresWorkspaceId: true,
|
|
46
|
+
dryRunSupported: false,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'seed:hierarchy-tier1',
|
|
50
|
+
description: 'Apply Tier 1 hierarchy migrations (landscape thinkingLayer, key-results fields)',
|
|
51
|
+
requiresWorkspaceId: false,
|
|
52
|
+
dryRunSupported: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'seed:id-prefixes',
|
|
56
|
+
description: 'Seed collection ID prefixes for a workspace',
|
|
57
|
+
requiresWorkspaceId: true,
|
|
58
|
+
dryRunSupported: false,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'seed:knowledge',
|
|
62
|
+
description: 'Seed initial knowledge base (Standards, Features collections + labels)',
|
|
63
|
+
requiresWorkspaceId: true,
|
|
64
|
+
dryRunSupported: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'seed:methodology-preset',
|
|
68
|
+
description: 'Install a methodology preset (e.g. cagan-tt) into a workspace — requires --preset-id',
|
|
69
|
+
requiresWorkspaceId: true,
|
|
70
|
+
dryRunSupported: false,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'seed:process-templates',
|
|
74
|
+
description: 'Seed process templates collection for a workspace',
|
|
75
|
+
requiresWorkspaceId: true,
|
|
76
|
+
dryRunSupported: false,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'seed:proposals',
|
|
80
|
+
description: 'Seed governance proposals collection',
|
|
81
|
+
requiresWorkspaceId: true,
|
|
82
|
+
dryRunSupported: false,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'seed:readiness-config',
|
|
86
|
+
description: 'Migrate readiness config (readinessFloor, readinessWeight, readinessLayer) on all collections',
|
|
87
|
+
requiresWorkspaceId: false,
|
|
88
|
+
dryRunSupported: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'seed:semantic-types-all',
|
|
92
|
+
description: 'Seed semantic types into all workspaces (cross-workspace action)',
|
|
93
|
+
requiresWorkspaceId: false,
|
|
94
|
+
dryRunSupported: false,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'seed:writing-guidance',
|
|
98
|
+
description: 'Seed writing guidance entries for a workspace',
|
|
99
|
+
requiresWorkspaceId: true,
|
|
100
|
+
dryRunSupported: true,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
const SEED_BY_NAME = new Map(SEED_COMMAND_ENTRIES.map((e) => [e.name, e]));
|
|
104
|
+
/** Manifest order for `pb admin seed all`. */
|
|
105
|
+
export const SEED_MANIFEST_ORDER = SEED_COMMAND_ENTRIES.map((e) => e.name);
|
|
106
|
+
function isProductionSite(siteUrl) {
|
|
107
|
+
try {
|
|
108
|
+
const host = new URL(siteUrl).hostname;
|
|
109
|
+
return host !== 'localhost' && host !== '127.0.0.1' && host !== '[::1]';
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function shortLabel(manifestName) {
|
|
116
|
+
return manifestName.startsWith('seed:') ? manifestName.slice('seed:'.length) : manifestName;
|
|
117
|
+
}
|
|
118
|
+
/** Accept `knowledge` or `seed:knowledge`. */
|
|
119
|
+
export function normalizeSeedCommandName(input) {
|
|
120
|
+
const t = input.trim();
|
|
121
|
+
if (!t) {
|
|
122
|
+
throw new CLIError('Seed operation name is required.', {
|
|
123
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
124
|
+
category: 'validation',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const full = t.startsWith('seed:') ? t : `seed:${t}`;
|
|
128
|
+
if (!SEED_BY_NAME.has(full)) {
|
|
129
|
+
const known = SEED_MANIFEST_ORDER.map((n) => shortLabel(n)).join(', ');
|
|
130
|
+
throw new CLIError(`Unknown seed operation "${input}". Known short names: ${known}`, {
|
|
131
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
132
|
+
category: 'validation',
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return full;
|
|
136
|
+
}
|
|
137
|
+
function resolveWorkspaceId(explicit) {
|
|
138
|
+
if (explicit)
|
|
139
|
+
return explicit;
|
|
140
|
+
return readSession()?.workspaceId;
|
|
141
|
+
}
|
|
142
|
+
function requireWorkspaceId(explicit) {
|
|
143
|
+
const id = resolveWorkspaceId(explicit);
|
|
144
|
+
if (!id) {
|
|
145
|
+
throw new CLIError('Workspace id required — pass --workspace-id or run `pb session start` in this project.', { code: ErrorCode.VALIDATION_FAILED, category: 'validation' });
|
|
146
|
+
}
|
|
147
|
+
return id;
|
|
148
|
+
}
|
|
149
|
+
export function buildSeedArgs(manifestName, opts) {
|
|
150
|
+
const def = SEED_BY_NAME.get(manifestName);
|
|
151
|
+
if (!def) {
|
|
152
|
+
throw new CLIError(`Unknown seed command: ${manifestName}`, {
|
|
153
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
154
|
+
category: 'validation',
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const args = {};
|
|
158
|
+
if (manifestName === 'seed:methodology-preset') {
|
|
159
|
+
const ws = requireWorkspaceId(opts.workspaceId);
|
|
160
|
+
if (!opts.presetId) {
|
|
161
|
+
throw new CLIError('seed:methodology-preset requires --preset-id <id>.', {
|
|
162
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
163
|
+
category: 'validation',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
args.workspaceId = ws;
|
|
167
|
+
args.presetId = opts.presetId;
|
|
168
|
+
return args;
|
|
169
|
+
}
|
|
170
|
+
if (def.requiresWorkspaceId) {
|
|
171
|
+
args.workspaceId = requireWorkspaceId(opts.workspaceId);
|
|
172
|
+
}
|
|
173
|
+
else if (opts.workspaceId && manifestName === 'seed:chain-native-bet-constellation') {
|
|
174
|
+
args.workspaceId = opts.workspaceId;
|
|
175
|
+
}
|
|
176
|
+
if (def.dryRunSupported && opts.dryRun) {
|
|
177
|
+
args.dryRun = true;
|
|
178
|
+
}
|
|
179
|
+
return args;
|
|
180
|
+
}
|
|
181
|
+
function printSeedList() {
|
|
182
|
+
const rows = SEED_COMMAND_ENTRIES.map((e) => ({
|
|
183
|
+
name: shortLabel(e.name),
|
|
184
|
+
description: e.description,
|
|
185
|
+
workspace: e.requiresWorkspaceId ? 'yes' : 'no',
|
|
186
|
+
dryRun: e.dryRunSupported ? 'yes' : '—',
|
|
187
|
+
}));
|
|
188
|
+
if (isJsonMode()) {
|
|
189
|
+
process.stdout.write(JSON.stringify({ commands: rows }, null, 2) + '\n');
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
adminBanner(getConfig().siteUrl);
|
|
194
|
+
}
|
|
195
|
+
catch { /* not configured */ }
|
|
196
|
+
const wName = Math.max(8, ...rows.map((r) => r.name.length));
|
|
197
|
+
const wWs = 9;
|
|
198
|
+
const wDr = 7;
|
|
199
|
+
process.stdout.write(`${bold('Name'.padEnd(wName))} ${bold('Workspace'.padEnd(wWs))} ${bold('Dry-run'.padEnd(wDr))} ${bold('Description')}\n`);
|
|
200
|
+
process.stdout.write(dim('─'.repeat(wName + wWs + wDr + 40)) + '\n');
|
|
201
|
+
for (const r of rows) {
|
|
202
|
+
const dryRunStr = r.dryRun === 'yes' ? green(r.dryRun.padEnd(wDr)) : dim(r.dryRun.padEnd(wDr));
|
|
203
|
+
process.stdout.write(`${cyan(r.name.padEnd(wName))} ${r.workspace.padEnd(wWs)} ${dryRunStr} ${dim(r.description)}\n`);
|
|
204
|
+
}
|
|
205
|
+
process.stdout.write('\n');
|
|
206
|
+
hint(`${SEED_COMMAND_ENTRIES.length} operations — behavior enforced server-side (commandManifest.ts)`);
|
|
207
|
+
hint('pb admin seed run <name> Run one operation');
|
|
208
|
+
hint('pb admin seed all Run all in manifest order');
|
|
209
|
+
}
|
|
210
|
+
async function printSeedStatus(workspaceIdOpt) {
|
|
211
|
+
const readiness = await adminCall('inspect:readiness-config', {});
|
|
212
|
+
let collection = null;
|
|
213
|
+
const wsId = resolveWorkspaceId(workspaceIdOpt);
|
|
214
|
+
if (wsId) {
|
|
215
|
+
collection = await adminCall('inspect:collection', { workspaceId: wsId });
|
|
216
|
+
}
|
|
217
|
+
const note = 'Per-seed run history is not tracked server-side yet — use workspace totals and readiness diagnose as signals.';
|
|
218
|
+
if (isJsonMode()) {
|
|
219
|
+
process.stdout.write(JSON.stringify({
|
|
220
|
+
note,
|
|
221
|
+
readinessConfig: readiness,
|
|
222
|
+
workspaceCollections: collection,
|
|
223
|
+
workspaceId: wsId ?? null,
|
|
224
|
+
}, null, 2) + '\n');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
process.stdout.write(`${bold('Seed status')}\n\n`);
|
|
228
|
+
process.stdout.write(` ${dim(note)}\n\n`);
|
|
229
|
+
process.stdout.write(`${bold('Readiness config migration (inspect:readiness-config)')}\n`);
|
|
230
|
+
process.stdout.write(` ${dim(JSON.stringify(readiness, null, 2).split('\n').join('\n '))}\n\n`);
|
|
231
|
+
if (collection && typeof collection === 'object' && collection !== null && 'workspace' in collection) {
|
|
232
|
+
const c = collection;
|
|
233
|
+
process.stdout.write(`${bold('Workspace')}\n`);
|
|
234
|
+
process.stdout.write(` ${c.workspace.name} (${c.workspace.slug})\n`);
|
|
235
|
+
process.stdout.write(` Collections: ${c.totalCollections} — Entries: ${c.totalEntries}\n\n`);
|
|
236
|
+
}
|
|
237
|
+
else if (!wsId) {
|
|
238
|
+
process.stdout.write(`${dim('No workspace id — pass --workspace-id or use an active session for collection breakdown.')}\n\n`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
async function runSeedOperation(manifestName, opts) {
|
|
242
|
+
const args = buildSeedArgs(manifestName, opts);
|
|
243
|
+
return adminCall(manifestName, args);
|
|
244
|
+
}
|
|
245
|
+
/** Attach seed subcommands to the `seed` Commander node. */
|
|
246
|
+
export function attachSeedCommands(seed) {
|
|
247
|
+
// Default action when `pb admin seed` is invoked with no subcommand.
|
|
248
|
+
seed.action(() => {
|
|
249
|
+
let siteUrl = '';
|
|
250
|
+
try {
|
|
251
|
+
siteUrl = getConfig().siteUrl;
|
|
252
|
+
}
|
|
253
|
+
catch { /* not configured */ }
|
|
254
|
+
if (siteUrl)
|
|
255
|
+
adminBanner(siteUrl);
|
|
256
|
+
process.stdout.write(`${heading('Seed operations')} ${dim(`(${SEED_COMMAND_ENTRIES.length})`)}\n\n`);
|
|
257
|
+
// Show first 6 entries as a preview
|
|
258
|
+
const preview = SEED_COMMAND_ENTRIES.slice(0, 6);
|
|
259
|
+
const wName = Math.max(...preview.map((e) => shortLabel(e.name).length));
|
|
260
|
+
for (const e of preview) {
|
|
261
|
+
const label = shortLabel(e.name);
|
|
262
|
+
const flags = e.dryRunSupported ? dim(' dry-run ✓') : '';
|
|
263
|
+
process.stdout.write(` ${cyan(label.padEnd(wName))} ${dim(e.description)}${flags}\n`);
|
|
264
|
+
}
|
|
265
|
+
if (SEED_COMMAND_ENTRIES.length > 6) {
|
|
266
|
+
process.stdout.write(` ${dim(`... ${SEED_COMMAND_ENTRIES.length - 6} more — run pb admin seed list`)}\n`);
|
|
267
|
+
}
|
|
268
|
+
process.stdout.write('\n');
|
|
269
|
+
hint('pb admin seed list Full list with workspace + dry-run flags');
|
|
270
|
+
hint('pb admin seed run <name> Run one operation');
|
|
271
|
+
hint('pb admin seed all Run all in manifest order');
|
|
272
|
+
hint('pb admin seed status Workspace readiness signals');
|
|
273
|
+
process.stdout.write('\n');
|
|
274
|
+
});
|
|
275
|
+
seed
|
|
276
|
+
.command('list')
|
|
277
|
+
.description('List registered seed operations (names match server manifest)')
|
|
278
|
+
.action(() => {
|
|
279
|
+
printSeedList();
|
|
280
|
+
});
|
|
281
|
+
seed
|
|
282
|
+
.command('status')
|
|
283
|
+
.description('Readiness + workspace collection signals (no per-seed run log yet)')
|
|
284
|
+
.option('--workspace-id <id>', 'Workspace id (defaults to session workspace when set)')
|
|
285
|
+
.action(async (options) => {
|
|
286
|
+
await printSeedStatus(options.workspaceId);
|
|
287
|
+
});
|
|
288
|
+
seed
|
|
289
|
+
.command('run')
|
|
290
|
+
.description('Run one seed operation by short or full manifest name')
|
|
291
|
+
.argument('<name>', 'e.g. knowledge or seed:knowledge')
|
|
292
|
+
.option('--dry-run', 'Pass dryRun when supported', false)
|
|
293
|
+
.option('--workspace-id <id>', 'Workspace id for workspace-scoped seeds')
|
|
294
|
+
.option('--preset-id <id>', 'Required for methodology-preset')
|
|
295
|
+
.option('--confirm', 'Non-interactive prod acknowledgment for dangerous ops', false)
|
|
296
|
+
.action(async (name, options) => {
|
|
297
|
+
const { siteUrl } = getConfig();
|
|
298
|
+
const manifestName = normalizeSeedCommandName(name);
|
|
299
|
+
const meta = SEED_BY_NAME.get(manifestName);
|
|
300
|
+
const isProd = isProductionSite(siteUrl);
|
|
301
|
+
// All seed ops on prod require confirmation — same policy as `seed all`.
|
|
302
|
+
if (isProd) {
|
|
303
|
+
const ok = await confirmProdAction({
|
|
304
|
+
confirm: options.confirm,
|
|
305
|
+
isProduction: true,
|
|
306
|
+
message: `Run ${manifestName} on production?`,
|
|
307
|
+
});
|
|
308
|
+
if (!ok) {
|
|
309
|
+
process.stderr.write('Cancelled.\n');
|
|
310
|
+
process.exitCode = 1;
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
adminBanner(siteUrl);
|
|
315
|
+
const label = `Running ${manifestName}`;
|
|
316
|
+
const data = await withSpinner(label, () => runSeedOperation(manifestName, {
|
|
317
|
+
workspaceId: options.workspaceId,
|
|
318
|
+
dryRun: options.dryRun,
|
|
319
|
+
presetId: options.presetId,
|
|
320
|
+
}));
|
|
321
|
+
if (isJsonMode()) {
|
|
322
|
+
process.stdout.write(JSON.stringify({ command: manifestName, data }, null, 2) + '\n');
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
process.stdout.write(`\n${green(icons.pass)} ${bold(manifestName)} complete.\n`);
|
|
326
|
+
process.stdout.write(dim(JSON.stringify(data, null, 2)) + '\n');
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
seed
|
|
330
|
+
.command('all')
|
|
331
|
+
.description('Run all seed operations in manifest order (skips methodology-preset unless --preset-id)')
|
|
332
|
+
.option('--workspace-id <id>', 'Workspace id for workspace-scoped seeds')
|
|
333
|
+
.option('--preset-id <id>', 'If set, runs seed:methodology-preset with this preset')
|
|
334
|
+
.option('--dry-run', 'Pass dryRun to operations that support it', false)
|
|
335
|
+
.option('--confirm', 'Required in production (non-interactive)', false)
|
|
336
|
+
.action(async (options) => {
|
|
337
|
+
const { siteUrl } = getConfig();
|
|
338
|
+
const isProd = isProductionSite(siteUrl);
|
|
339
|
+
if (isProd) {
|
|
340
|
+
const ok = await confirmProdAction({
|
|
341
|
+
confirm: options.confirm,
|
|
342
|
+
isProduction: true,
|
|
343
|
+
message: 'Run ALL seed operations on production?',
|
|
344
|
+
});
|
|
345
|
+
if (!ok) {
|
|
346
|
+
process.stderr.write('Cancelled.\n');
|
|
347
|
+
process.exitCode = 1;
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
adminBanner(siteUrl);
|
|
352
|
+
const results = [];
|
|
353
|
+
for (const cmd of SEED_MANIFEST_ORDER) {
|
|
354
|
+
if (cmd === 'seed:methodology-preset' && !options.presetId) {
|
|
355
|
+
results.push({
|
|
356
|
+
command: cmd,
|
|
357
|
+
ok: true,
|
|
358
|
+
skipped: true,
|
|
359
|
+
note: 'pass --preset-id to include methodology preset',
|
|
360
|
+
});
|
|
361
|
+
if (!isJsonMode()) {
|
|
362
|
+
process.stdout.write(`${dim(icons.dot)} ${cmd} skipped (no --preset-id)\n`);
|
|
363
|
+
}
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
try {
|
|
367
|
+
await withSpinner(`Running ${cmd}`, async () => {
|
|
368
|
+
const args = buildSeedArgs(cmd, {
|
|
369
|
+
workspaceId: options.workspaceId,
|
|
370
|
+
dryRun: options.dryRun,
|
|
371
|
+
presetId: options.presetId,
|
|
372
|
+
});
|
|
373
|
+
await adminCall(cmd, args);
|
|
374
|
+
});
|
|
375
|
+
results.push({ command: cmd, ok: true });
|
|
376
|
+
if (!isJsonMode()) {
|
|
377
|
+
process.stdout.write(`${green(icons.pass)} ${cmd}\n`);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
catch (e) {
|
|
381
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
382
|
+
results.push({ command: cmd, ok: false, error: msg });
|
|
383
|
+
if (!isJsonMode()) {
|
|
384
|
+
process.stdout.write(`${red(icons.fail)} ${cmd} — ${msg}\n`);
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (results.some((r) => !r.ok)) {
|
|
390
|
+
process.exitCode = 1;
|
|
391
|
+
}
|
|
392
|
+
if (isJsonMode()) {
|
|
393
|
+
process.stdout.write(JSON.stringify({ results }, null, 2) + '\n');
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
hint('seed all stops on first failure. Fix the error and re-run, or run individual `pb admin seed run` commands.');
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
//# sourceMappingURL=seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../../src/commands/admin/seed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,IAAI,EACJ,GAAG,EACH,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,GAAG,GACJ,MAAM,oBAAoB,CAAC;AAc5B;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA+B;IAC9D;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,oFAAoF;QACjG,mBAAmB,EAAE,IAAI;QACzB,eAAe,EAAE,KAAK;KACvB;IACD;QACE,IAAI,EAAE,qCAAqC;QAC3C,WAAW,EAAE,yDAAyD;QACtE,mBAAmB,EAAE,KAAK;QAC1B,eAAe,EAAE,KAAK;KACvB;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,uCAAuC;QACpD,mBAAmB,EA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E,GAAG,EAAE,CAAC,CAAC;gBACtD,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;oBAClB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;gBAC/D,CAAC;gBACD,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAED,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,4GAA4G,CAAC,CAAC;QACrH,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.test.d.ts","sourceRoot":"","sources":["../../../src/commands/admin/seed.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for pb admin seed helpers — normalizeSeedCommandName and buildSeedArgs.
|
|
3
|
+
* These gate prod operations so they need coverage (WP-312 S3, FEAT-970).
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
6
|
+
import { normalizeSeedCommandName, buildSeedArgs, SEED_MANIFEST_ORDER } from './seed.js';
|
|
7
|
+
// Mock readSession so workspace resolution is predictable in tests
|
|
8
|
+
vi.mock('../../lib/session.js', () => ({
|
|
9
|
+
readSession: vi.fn(() => null),
|
|
10
|
+
}));
|
|
11
|
+
describe('normalizeSeedCommandName', () => {
|
|
12
|
+
it('accepts short form and expands to seed: prefix', () => {
|
|
13
|
+
expect(normalizeSeedCommandName('knowledge')).toBe('seed:knowledge');
|
|
14
|
+
});
|
|
15
|
+
it('accepts fully qualified form as-is', () => {
|
|
16
|
+
expect(normalizeSeedCommandName('seed:knowledge')).toBe('seed:knowledge');
|
|
17
|
+
});
|
|
18
|
+
it('accepts all 14 known short names', () => {
|
|
19
|
+
const shortNames = SEED_MANIFEST_ORDER.map((n) => n.replace('seed:', ''));
|
|
20
|
+
for (const name of shortNames) {
|
|
21
|
+
expect(() => normalizeSeedCommandName(name)).not.toThrow();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
it('throws on unknown name', () => {
|
|
25
|
+
expect(() => normalizeSeedCommandName('nonexistent')).toThrow('Unknown seed operation');
|
|
26
|
+
});
|
|
27
|
+
it('throws on empty string', () => {
|
|
28
|
+
expect(() => normalizeSeedCommandName('')).toThrow('required');
|
|
29
|
+
});
|
|
30
|
+
it('trims whitespace before checking', () => {
|
|
31
|
+
expect(normalizeSeedCommandName(' knowledge ')).toBe('seed:knowledge');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe('buildSeedArgs', () => {
|
|
35
|
+
it('returns empty args for a non-workspace command with no options', () => {
|
|
36
|
+
// seed:hierarchy-tier1 does not requiresWorkspaceId and no dryRun
|
|
37
|
+
const args = buildSeedArgs('seed:hierarchy-tier1', {});
|
|
38
|
+
expect(args).toEqual({});
|
|
39
|
+
});
|
|
40
|
+
it('adds workspaceId for workspace-required commands when explicitly provided', () => {
|
|
41
|
+
const args = buildSeedArgs('seed:knowledge', { workspaceId: 'ws-123' });
|
|
42
|
+
expect(args).toMatchObject({ workspaceId: 'ws-123' });
|
|
43
|
+
});
|
|
44
|
+
it('throws when workspace-required command has no workspaceId and no session', () => {
|
|
45
|
+
// session is mocked to return null above
|
|
46
|
+
expect(() => buildSeedArgs('seed:knowledge', {})).toThrow();
|
|
47
|
+
});
|
|
48
|
+
it('adds dryRun flag when supported and requested', () => {
|
|
49
|
+
// seed:hierarchy-tier1 has dryRunSupported: true and no workspace requirement
|
|
50
|
+
const args = buildSeedArgs('seed:hierarchy-tier1', { dryRun: true });
|
|
51
|
+
expect(args).toMatchObject({ dryRun: true });
|
|
52
|
+
});
|
|
53
|
+
it('does not add dryRun when command does not support it', () => {
|
|
54
|
+
// seed:chain-native-bet-constellation has dryRunSupported: false
|
|
55
|
+
const args = buildSeedArgs('seed:chain-native-bet-constellation', { dryRun: true });
|
|
56
|
+
expect(args).not.toHaveProperty('dryRun');
|
|
57
|
+
});
|
|
58
|
+
it('throws for methodology-preset without presetId', () => {
|
|
59
|
+
expect(() => buildSeedArgs('seed:methodology-preset', { workspaceId: 'ws-123' })).toThrow('preset-id');
|
|
60
|
+
});
|
|
61
|
+
it('throws for unknown manifest name', () => {
|
|
62
|
+
expect(() => buildSeedArgs('seed:does-not-exist', {})).toThrow('Unknown seed command');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=seed.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.test.js","sourceRoot":"","sources":["../../../src/commands/admin/seed.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEzF,mEAAmE;AACnE,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;CAC/B,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,C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AC,GAAG,EAAE,CAAC,aAAa,CAAC,yBAAyB,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACzG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ import { runWorkspaceVerify, runWorkspaceRepair, runDefinitionsDiff } from './co
|
|
|
44
44
|
import { runDoctor } from './commands/doctor.js';
|
|
45
45
|
import { runProfileList, runProfileCreate, runProfileUse, runProfileDelete } from './commands/profile.js';
|
|
46
46
|
import { runInit } from './commands/init.js';
|
|
47
|
+
import { createAdminCommand } from './commands/admin/index.js';
|
|
47
48
|
import { GLOSSARY, formatGlossary } from './lib/glossary.js';
|
|
48
49
|
import { hint, heading, bold, dim, green, icons } from './lib/style.js';
|
|
49
50
|
import { readSession } from './lib/session.js';
|
|
@@ -684,6 +685,8 @@ program
|
|
|
684
685
|
];
|
|
685
686
|
process.stdout.write(lines.join('\n') + '\n');
|
|
686
687
|
});
|
|
688
|
+
// --- Admin command group (WP-312 S2, FEAT-969) ---
|
|
689
|
+
program.addCommand(createAdminCommand());
|
|
687
690
|
// Parse with global error handler — all uncaught errors route through handleError
|
|
688
691
|
program.parseAsync().catch(handleError);
|
|
689
692
|
//# sourceMappingURL=index.js.map
|