@selleragent/sa-admin 0.1.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/help.js ADDED
@@ -0,0 +1,469 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderHelpPage = renderHelpPage;
4
+ const contextDefaults = [
5
+ 'Defaults are inferred from the current business-profile repo when possible.',
6
+ 'sa-admin walks upward from the current working directory until it finds sa.profile.yaml or the git root.',
7
+ 'Base URL defaults come from --base-url, SA_API_BASE_URL / API_BASE_URL, then sa.profile.yaml defaults.',
8
+ 'Environment files are loaded from .env, manifest-declared env files, then .env.local unless you override them with --env-file.'
9
+ ];
10
+ const helpPages = [
11
+ {
12
+ path: [],
13
+ summary: 'Selleragent admin CLI for business-profile upload, Telegram ops, runtime diagnostics, and repair workflows.',
14
+ usage: [
15
+ 'sa-admin <family> <command> [options]',
16
+ 'sa-admin help <family> [command]',
17
+ 'sa-admin <family> --help'
18
+ ],
19
+ subcommands: [
20
+ { name: 'profile', description: 'Validate, upload, activate, download, and inspect a business profile.' },
21
+ { name: 'db', description: 'Inspect migrations, create backup artifacts, and run restore drills.' },
22
+ { name: 'backup', description: 'Create and inspect governed backup artifacts through the canonical backup family.' },
23
+ { name: 'restore', description: 'Run and inspect restore drills through the canonical restore family.' },
24
+ { name: 'telegram', description: 'Manage Telegram integrations, business accounts, and employee bindings.' },
25
+ { name: 'runtime', description: 'Inspect runtime providers, routing, usage, and fallback history.' },
26
+ { name: 'diagnostics', description: 'Read readiness state and raw operations snapshots.' },
27
+ { name: 'reconcile', description: 'Run typed repair or reconciliation flows for one business or entity.' },
28
+ { name: 'rollout', description: 'Run governed rollout preflight, promotion, inspect, and stop-handoff surfaces.' },
29
+ { name: 'auth', description: 'Login and inspect the current employee-backed admin session.' }
30
+ ],
31
+ notes: [
32
+ ...contextDefaults,
33
+ 'Legacy aliases still work: telegram-bots -> telegram integrations, telegram-business-accounts -> telegram business-accounts, emp telegram -> telegram employees.',
34
+ 'Canonical mutate flows are now `backup`, `restore`, and `rollout`; `db backups` and `db restore-drills` remain compatibility shapes.'
35
+ ],
36
+ examples: [
37
+ 'sa-admin profile status',
38
+ 'sa-admin db migrations status',
39
+ 'sa-admin backup create --backup-kind pre_release',
40
+ 'sa-admin telegram integrations status',
41
+ 'sa-admin rollout preflight',
42
+ 'sa-admin diagnostics readiness',
43
+ 'sa-admin reconcile business'
44
+ ]
45
+ },
46
+ {
47
+ path: ['db'],
48
+ summary: 'Database schema lifecycle commands.',
49
+ usage: [
50
+ 'sa-admin db migrations <status|apply> [options]',
51
+ 'sa-admin db backups <create|list|inspect> [options]',
52
+ 'sa-admin db restore-drills <run|list|inspect> [options]'
53
+ ],
54
+ subcommands: [
55
+ { name: 'migrations', description: 'Inspect migration status or apply pending migrations.' },
56
+ { name: 'backups', description: 'Create and inspect governed backup artifact manifests.' },
57
+ { name: 'restore-drills', description: 'Run isolated restore drills and inspect recovery evidence.' }
58
+ ],
59
+ notes: [
60
+ ...contextDefaults,
61
+ 'Migration commands target the current resolved environment. In production, apply only through the governed rollout path.',
62
+ 'Canonical aliases: `sa-admin backup ...` mirrors `sa-admin db backups ...`, and `sa-admin restore ...` mirrors `sa-admin db restore-drills ...`.'
63
+ ],
64
+ examples: [
65
+ 'sa-admin db migrations status',
66
+ 'sa-admin db backups create --backup-kind pre_release',
67
+ 'sa-admin db restore-drills run --backup-id <uuid>'
68
+ ]
69
+ },
70
+ {
71
+ path: ['db', 'migrations'],
72
+ summary: 'Schema migration status and apply commands.',
73
+ usage: ['sa-admin db migrations <status|apply> [options]'],
74
+ subcommands: [
75
+ { name: 'status', description: 'Read the current schema migration ledger and pending migration state.' },
76
+ { name: 'apply', description: 'Apply pending schema migrations for the active environment.' }
77
+ ],
78
+ notes: [
79
+ ...contextDefaults,
80
+ 'Readiness may stay degraded until the migration ledger is adopted.',
81
+ 'apply records the current authenticated operator as appliedBy when available.',
82
+ 'In production, apply only through the governed rollout path.'
83
+ ],
84
+ examples: ['sa-admin db migrations status', 'sa-admin db migrations apply --json']
85
+ },
86
+ {
87
+ path: ['db', 'backups'],
88
+ summary: 'Governed backup artifact commands.',
89
+ usage: ['sa-admin db backups <create|list|inspect> [options]'],
90
+ subcommands: [
91
+ { name: 'create', description: 'Create an encrypted logical backup artifact and return its manifest.' },
92
+ { name: 'list', description: 'List recent backup artifact manifests for the current environment.' },
93
+ { name: 'inspect', description: 'Inspect one backup artifact manifest by id.' }
94
+ ],
95
+ notes: [
96
+ ...contextDefaults,
97
+ 'In beta and production, backup encryption must be configured through BACKUP_ARTIFACT_MASTER_KEY and BACKUP_ARTIFACT_KEY_ID.',
98
+ 'create defaults to a manual_emergency backup in the resolved environment unless you override it.'
99
+ ],
100
+ examples: [
101
+ 'sa-admin db backups create --backup-kind pre_release',
102
+ 'sa-admin db backups list',
103
+ 'sa-admin db backups inspect --backup-id 00000000-0000-0000-0000-000000000000'
104
+ ]
105
+ },
106
+ {
107
+ path: ['db', 'restore-drills'],
108
+ summary: 'Isolated restore-drill and recovery-evidence commands.',
109
+ usage: ['sa-admin db restore-drills <run|list|inspect> [options]'],
110
+ subcommands: [
111
+ { name: 'run', description: 'Restore one governed backup artifact into an isolated in-memory target and record validation evidence.' },
112
+ { name: 'list', description: 'List restore-drill records.' },
113
+ { name: 'inspect', description: 'Inspect one restore-drill record by id.' }
114
+ ],
115
+ notes: [
116
+ ...contextDefaults,
117
+ 'Restore drills are intentionally isolated and do not write back into the live environment.',
118
+ 'run requires --backup-id and uses an isolated_in_memory target in the first wave.'
119
+ ],
120
+ examples: [
121
+ 'sa-admin db restore-drills run --backup-id 00000000-0000-0000-0000-000000000000',
122
+ 'sa-admin db restore-drills list',
123
+ 'sa-admin db restore-drills inspect --restore-drill-id 00000000-0000-0000-0000-000000000000'
124
+ ]
125
+ },
126
+ {
127
+ path: ['backup'],
128
+ summary: 'Canonical backup artifact commands.',
129
+ usage: ['sa-admin backup <create|list|inspect> [options]'],
130
+ subcommands: [
131
+ { name: 'create', description: 'Create an encrypted logical backup artifact and return its manifest.' },
132
+ { name: 'list', description: 'List recent backup artifact manifests for the resolved environment.' },
133
+ { name: 'inspect', description: 'Inspect one governed backup artifact manifest by id.' }
134
+ ],
135
+ notes: [
136
+ ...contextDefaults,
137
+ 'This is the canonical family for backup operations. `sa-admin db backups ...` remains available as a compatibility alias.',
138
+ 'Before risky rollout work, prefer `sa-admin rollout promote`, which creates a pre-release backup automatically.'
139
+ ],
140
+ examples: [
141
+ 'sa-admin backup create --backup-kind pre_release',
142
+ 'sa-admin backup list',
143
+ 'sa-admin backup inspect --backup-id 00000000-0000-0000-0000-000000000000'
144
+ ],
145
+ aliases: ['Compatibility alias: sa-admin db backups <...>']
146
+ },
147
+ {
148
+ path: ['restore'],
149
+ summary: 'Canonical restore-drill and recovery-evidence commands.',
150
+ usage: ['sa-admin restore <run|list|inspect> [options]'],
151
+ subcommands: [
152
+ { name: 'run', description: 'Run an isolated restore drill from one governed backup artifact.' },
153
+ { name: 'list', description: 'List restore-drill records.' },
154
+ { name: 'inspect', description: 'Inspect one restore-drill record by id.' }
155
+ ],
156
+ notes: [
157
+ ...contextDefaults,
158
+ 'This is the canonical family for restore drills. `sa-admin db restore-drills ...` remains available as a compatibility alias.',
159
+ 'Restore drills never target the live environment in the first implementation wave.'
160
+ ],
161
+ examples: [
162
+ 'sa-admin restore run --backup-id 00000000-0000-0000-0000-000000000000',
163
+ 'sa-admin restore list',
164
+ 'sa-admin restore inspect --restore-drill-id 00000000-0000-0000-0000-000000000000'
165
+ ],
166
+ aliases: ['Compatibility alias: sa-admin db restore-drills <...>']
167
+ },
168
+ {
169
+ path: ['profile'],
170
+ summary: 'Governed business-profile project actions.',
171
+ usage: ['sa-admin profile <validate|upload|download|activate|status|versions> [options]'],
172
+ subcommands: [
173
+ { name: 'validate', description: 'Validate the local repo, manifest, and secret refs without changing the server.' },
174
+ { name: 'upload', description: 'Upload the resolved profile bundle and optional secrets to the server.' },
175
+ { name: 'download', description: 'Download the active or selected profile version back into files.' },
176
+ { name: 'activate', description: 'Activate a specific uploaded version.' },
177
+ { name: 'status', description: 'Show the current business profile, active version, and member counts.' },
178
+ { name: 'versions', description: 'List uploaded profile versions for this business.' }
179
+ ],
180
+ notes: contextDefaults,
181
+ examples: ['sa-admin profile validate', 'sa-admin profile upload --activate', 'sa-admin profile download --output-dir ./tmp/readback']
182
+ },
183
+ {
184
+ path: ['rollout'],
185
+ summary: 'Governed rollout commands for preflight, ordered promotion, and rollout evidence inspection.',
186
+ usage: ['sa-admin rollout <preflight|migrate|promote-profile|finalize-telegram|promote|verify|verdict|evidence|list|inspect> [options]'],
187
+ subcommands: [
188
+ { name: 'preflight', description: 'Inspect auth, deploy-pair reachability, migration status, profile validity, and Telegram targets before mutation.' },
189
+ { name: 'migrate', description: 'Apply schema migrations through the rollout-aware mutation path.' },
190
+ { name: 'promote-profile', description: 'Upload and activate the current business-profile bundle for the resolved environment.' },
191
+ { name: 'finalize-telegram', description: 'Verify, sync webhook, sync commands, and reconcile all environment-compatible Telegram integrations.' },
192
+ { name: 'promote', description: 'Run the full governed rollout sequence and persist rollout evidence.' },
193
+ { name: 'verify', description: 'Run the post-release smoke pack and persist a release verification verdict.' },
194
+ { name: 'verdict', description: 'Inspect the compact verdict for one persisted release verification.' },
195
+ { name: 'evidence', description: 'Inspect the full persisted release verification evidence pack.' },
196
+ { name: 'list', description: 'List recorded rollout executions for the resolved environment and business.' },
197
+ { name: 'inspect', description: 'Inspect one recorded rollout execution by rollout id.' }
198
+ ],
199
+ notes: [
200
+ ...contextDefaults,
201
+ 'Use `rollout preflight` before any production mutation. It surfaces blockers and warnings without changing server state.',
202
+ 'Use `rollout promote` for governed mutation. It creates a pre-release backup, applies migrations, uploads the profile, finalizes Telegram, then records rollout evidence.',
203
+ 'Use `rollout verify` immediately after rollout completion to persist the post-release smoke verdict and rollback evidence.',
204
+ 'Individual stage commands exist for controlled repair and rehearsal, but production should normally flow through the full `rollout promote` path.'
205
+ ],
206
+ examples: [
207
+ 'sa-admin rollout preflight',
208
+ 'sa-admin rollout promote --notes "Promote develop to production"',
209
+ 'sa-admin rollout verify --rollout-id 00000000-0000-0000-0000-000000000000',
210
+ 'sa-admin rollout verdict --verification-id 00000000-0000-0000-0000-000000000000',
211
+ 'sa-admin rollout list',
212
+ 'sa-admin rollout inspect --rollout-id 00000000-0000-0000-0000-000000000000'
213
+ ]
214
+ },
215
+ {
216
+ path: ['telegram'],
217
+ summary: 'Telegram operational surface grouped by integrations, business accounts, and employees.',
218
+ usage: ['sa-admin telegram <integrations|business-accounts|employees> <command> [options]'],
219
+ subcommands: [
220
+ { name: 'integrations', description: 'Inspect, verify, sync, or reconcile Telegram bot integrations.' },
221
+ { name: 'business-accounts', description: 'Govern observed Telegram business connections.' },
222
+ { name: 'employees', description: 'Inspect or repair employee bindings and direct-chat command projections.' }
223
+ ],
224
+ notes: [
225
+ ...contextDefaults,
226
+ 'If the current profile repo declares exactly one Telegram integration, commands that need --integration-key can infer it automatically.'
227
+ ],
228
+ examples: ['sa-admin telegram integrations status', 'sa-admin telegram business-accounts status', 'sa-admin telegram employees bindings']
229
+ },
230
+ {
231
+ path: ['telegram', 'integrations'],
232
+ summary: 'Telegram integration lifecycle and verification commands.',
233
+ usage: ['sa-admin telegram integrations <upload|status|download|verify|sync-webhook|sync-commands|reconcile|migrate-legacy-default> [options]'],
234
+ subcommands: [
235
+ { name: 'upload', description: 'Upload Telegram integration declarations from the current business-profile repo.' },
236
+ { name: 'status', description: 'List Telegram integrations and their stored state.' },
237
+ { name: 'download', description: 'Export Telegram integration state as YAML.' },
238
+ { name: 'verify', description: 'Run live verification for one integration and refresh its snapshot.' },
239
+ { name: 'sync-webhook', description: 'Push the desired webhook configuration for one integration.' },
240
+ { name: 'sync-commands', description: 'Recompute and sync default Telegram command menus for one integration.' },
241
+ { name: 'reconcile', description: 'Verify, repair, and refresh one integration in a single operation.' },
242
+ {
243
+ name: 'migrate-legacy-default',
244
+ description: 'Rename a legacy telegram-default integration to a named integration key and migrate linked conversations, snapshots, and registries.'
245
+ }
246
+ ],
247
+ notes: [
248
+ ...contextDefaults,
249
+ 'When multiple integrations exist in the repo, --integration-key can still be inferred if exactly one declaration matches the current environment.',
250
+ 'Use migrate-legacy-default during the controlled FT-015-14 cutover from telegram-default to a named integration key.'
251
+ ],
252
+ examples: [
253
+ 'sa-admin telegram integrations status',
254
+ 'sa-admin telegram integrations verify --integration-key personabook-beta-main',
255
+ 'sa-admin telegram integrations reconcile',
256
+ 'sa-admin telegram integrations migrate-legacy-default --new-integration-key personabook-beta-main --webhook-path /webhooks/telegram/personabook-beta-main'
257
+ ]
258
+ },
259
+ {
260
+ path: ['telegram', 'business-accounts'],
261
+ summary: 'Observed Telegram business-account registry commands.',
262
+ usage: ['sa-admin telegram business-accounts <status|download|approve|block|refresh> [options]'],
263
+ subcommands: [
264
+ { name: 'status', description: 'List observed business accounts for the current business profile.' },
265
+ { name: 'download', description: 'Export observed business-account state as YAML.' },
266
+ { name: 'approve', description: 'Mark one business connection as active/approved.' },
267
+ { name: 'block', description: 'Block one business connection from the business registry.' },
268
+ { name: 'refresh', description: 'Refresh observed state for one business connection.' }
269
+ ],
270
+ notes: contextDefaults,
271
+ examples: [
272
+ 'sa-admin telegram business-accounts status',
273
+ 'sa-admin telegram business-accounts approve --business-connection-id <id>',
274
+ 'sa-admin telegram business-accounts refresh --business-connection-id <id>'
275
+ ]
276
+ },
277
+ {
278
+ path: ['telegram', 'employees'],
279
+ summary: 'Employee binding and direct-chat command projection commands.',
280
+ usage: ['sa-admin telegram employees <observed|bindings|verify|bind|revoke|status|resync> [options]'],
281
+ subcommands: [
282
+ { name: 'observed', description: 'List direct-chat Telegram users that have already written to the bot.' },
283
+ { name: 'bindings', description: 'List verified Telegram employee bindings.' },
284
+ { name: 'verify', description: 'Find an observed Telegram user by username and bind it to an employee.' },
285
+ { name: 'bind', description: 'Bind an employee directly by Telegram user id.' },
286
+ { name: 'revoke', description: 'Revoke an employee binding.' },
287
+ { name: 'status', description: 'Show binding plus current command projection state for one Telegram user.' },
288
+ { name: 'resync', description: 'Recompute direct-chat command projection for one Telegram user.' }
289
+ ],
290
+ notes: contextDefaults,
291
+ examples: [
292
+ 'sa-admin telegram employees observed --username deksden',
293
+ 'sa-admin telegram employees verify --email deksden@selleragent.pro --username deksden',
294
+ 'sa-admin telegram employees status --telegram-user-id 938806'
295
+ ],
296
+ aliases: ['Legacy alias: sa-admin emp telegram <...>']
297
+ },
298
+ {
299
+ path: ['runtime'],
300
+ summary: 'Runtime provider, routing, usage, and fallback inspection commands.',
301
+ usage: ['sa-admin runtime <providers|routing|usage|fallbacks> <command> [options]'],
302
+ subcommands: [
303
+ { name: 'providers', description: 'Inspect, refresh, or reconcile runtime provider readiness.' },
304
+ { name: 'routing', description: 'Inspect or reconcile effective runtime routing visibility.' },
305
+ { name: 'usage', description: 'Read runtime usage rollups.' },
306
+ { name: 'fallbacks', description: 'Read recorded fallback events.' }
307
+ ],
308
+ notes: [
309
+ ...contextDefaults,
310
+ 'Business-scoped runtime commands default to the current repo business slug unless you pass --global or --business-profile-slug.'
311
+ ],
312
+ examples: ['sa-admin runtime providers status', 'sa-admin runtime routing reconcile --stage reply', 'sa-admin runtime usage summary']
313
+ },
314
+ {
315
+ path: ['runtime', 'providers'],
316
+ summary: 'Runtime provider readiness commands.',
317
+ usage: ['sa-admin runtime providers <status|refresh|reconcile> [options]'],
318
+ subcommands: [
319
+ { name: 'status', description: 'List known runtime providers for the current business or global scope.' },
320
+ { name: 'refresh', description: 'Run one live provider probe and refresh its snapshot.' },
321
+ { name: 'reconcile', description: 'Refresh multiple provider snapshots and readiness together.' }
322
+ ],
323
+ notes: [
324
+ ...contextDefaults,
325
+ 'Use --provider-key to target one provider or --global to operate only on global scope.'
326
+ ],
327
+ examples: [
328
+ 'sa-admin runtime providers status',
329
+ 'sa-admin runtime providers refresh --provider-key anthropic',
330
+ 'sa-admin runtime providers reconcile'
331
+ ]
332
+ },
333
+ {
334
+ path: ['runtime', 'routing'],
335
+ summary: 'Effective routing visibility and repair commands.',
336
+ usage: ['sa-admin runtime routing <status|reconcile> [options]'],
337
+ subcommands: [
338
+ { name: 'status', description: 'Show configured routing profiles plus effective routing visibility for one or all stages.' },
339
+ { name: 'reconcile', description: 'Refresh runtime routing snapshots and effective visibility.' }
340
+ ],
341
+ notes: [...contextDefaults],
342
+ examples: ['sa-admin runtime routing status', 'sa-admin runtime routing reconcile --stage analysis']
343
+ },
344
+ {
345
+ path: ['runtime', 'usage'],
346
+ summary: 'Runtime usage rollup commands.',
347
+ usage: ['sa-admin runtime usage summary [options]'],
348
+ notes: [...contextDefaults],
349
+ examples: ['sa-admin runtime usage summary', 'sa-admin runtime usage summary --stage reply']
350
+ },
351
+ {
352
+ path: ['runtime', 'fallbacks'],
353
+ summary: 'Runtime fallback event commands.',
354
+ usage: ['sa-admin runtime fallbacks list [options]'],
355
+ notes: [...contextDefaults],
356
+ examples: ['sa-admin runtime fallbacks list', 'sa-admin runtime fallbacks list --stage reply']
357
+ },
358
+ {
359
+ path: ['diagnostics'],
360
+ summary: 'Readiness and raw operations snapshot diagnostics.',
361
+ usage: ['sa-admin diagnostics <readiness|snapshots> [options]'],
362
+ subcommands: [
363
+ { name: 'readiness', description: 'Read aggregate readiness for the current business.' },
364
+ { name: 'snapshots', description: 'List raw operations snapshots, optionally filtered by entity kind or id.' }
365
+ ],
366
+ notes: [...contextDefaults],
367
+ examples: ['sa-admin diagnostics readiness', 'sa-admin diagnostics snapshots --entity-kind telegram_integration']
368
+ },
369
+ {
370
+ path: ['reconcile'],
371
+ summary: 'Typed repair commands that recompute desired-vs-observed state.',
372
+ usage: ['sa-admin reconcile <business|integration|provider|routing|employee> [options]'],
373
+ subcommands: [
374
+ { name: 'business', description: 'Run the full business-level reconciliation bundle.' },
375
+ { name: 'integration', description: 'Reconcile one Telegram integration.' },
376
+ { name: 'provider', description: 'Reconcile runtime provider readiness.' },
377
+ { name: 'routing', description: 'Reconcile runtime routing visibility.' },
378
+ { name: 'employee', description: 'Resync one Telegram employee command projection.' }
379
+ ],
380
+ notes: [
381
+ ...contextDefaults,
382
+ 'Repair commands are thin wrappers over typed server operations. They do not invent state locally.'
383
+ ],
384
+ examples: [
385
+ 'sa-admin reconcile business',
386
+ 'sa-admin reconcile integration --integration-key personabook-beta-main',
387
+ 'sa-admin reconcile employee --telegram-user-id 938806'
388
+ ]
389
+ },
390
+ {
391
+ path: ['auth'],
392
+ summary: 'Login, inspect, and safely manage employee-backed sa-admin auth state.',
393
+ usage: ['sa-admin auth <login|logout|session|whoami|preflight|seed-policy> [options]'],
394
+ subcommands: [
395
+ { name: 'login', description: 'Acquire a normal employee-backed sa-admin session and store it locally.' },
396
+ { name: 'logout', description: 'Remove the local sa-admin session file.' },
397
+ { name: 'session', description: 'Inspect the stored session file and stale-session state.' },
398
+ { name: 'preflight', description: 'Inspect auth prerequisites, Supabase contract hints, and provisioning policy.' },
399
+ { name: 'seed-policy', description: 'Show which provisioning classes are allowed in the current environment.' },
400
+ { name: 'whoami', description: 'Inspect the current session and access context.' }
401
+ ],
402
+ options: [
403
+ { flag: '--email <email>', description: 'Required for `auth login`; identifies the invited work account.' },
404
+ { flag: '--no-browser', description: 'Do not auto-open the device verification URL in a browser.' },
405
+ { flag: '--timeout-seconds <n>', description: 'How long `auth login` should wait for browser/device approval.' }
406
+ ],
407
+ notes: [
408
+ ...contextDefaults,
409
+ 'login is the normal day-to-day path for employee access and is the only supported auth acquisition flow in the publishable CLI.',
410
+ 'Hosted login now uses browser/device approval: sa-admin prints a user code and verification URL, and attempts to open the browser automatically unless you pass --no-browser.',
411
+ 'Bootstrap, first-admin provisioning, and system-admin recovery live in the internal `sales-agent-cli` surface.',
412
+ 'Production rollout commands expect an employee-backed session from `sa-admin auth login`.'
413
+ ],
414
+ examples: [
415
+ 'sa-admin auth login --email employee@company.example',
416
+ 'sa-admin auth login --email employee@company.example --no-browser',
417
+ 'sa-admin auth session',
418
+ 'sa-admin auth preflight',
419
+ 'sa-admin auth seed-policy',
420
+ 'sa-admin auth whoami'
421
+ ]
422
+ }
423
+ ];
424
+ function normalizePath(path) {
425
+ return path.join(' ').trim();
426
+ }
427
+ function findPage(path) {
428
+ const normalized = normalizePath(path);
429
+ const exact = helpPages.find((page) => normalizePath(page.path) === normalized);
430
+ if (exact) {
431
+ return exact;
432
+ }
433
+ for (let length = path.length - 1; length >= 0; length -= 1) {
434
+ const partial = normalizePath(path.slice(0, length));
435
+ const match = helpPages.find((page) => normalizePath(page.path) === partial);
436
+ if (match) {
437
+ return match;
438
+ }
439
+ }
440
+ return helpPages[0];
441
+ }
442
+ function renderHelpPage(path) {
443
+ const page = findPage(path);
444
+ const lines = [];
445
+ lines.push(page.summary, '', 'Usage:');
446
+ lines.push(...page.usage.map((entry) => ` ${entry}`));
447
+ if (page.subcommands?.length) {
448
+ lines.push('', 'Commands:');
449
+ lines.push(...page.subcommands.map((entry) => ` ${entry.name.padEnd(18)} ${entry.description}`));
450
+ }
451
+ if (page.options?.length) {
452
+ lines.push('', 'Options:');
453
+ lines.push(...page.options.map((entry) => ` ${entry.flag.padEnd(22)} ${entry.description}`));
454
+ }
455
+ if (page.notes?.length) {
456
+ lines.push('', 'Notes:');
457
+ lines.push(...page.notes.map((entry) => ` - ${entry}`));
458
+ }
459
+ if (page.aliases?.length) {
460
+ lines.push('', 'Aliases:');
461
+ lines.push(...page.aliases.map((entry) => ` - ${entry}`));
462
+ }
463
+ if (page.examples?.length) {
464
+ lines.push('', 'Examples:');
465
+ lines.push(...page.examples.map((entry) => ` ${entry}`));
466
+ }
467
+ return `${lines.join('\n')}\n`;
468
+ }
469
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;AA0cA,wCAiCC;AAheD,MAAM,eAAe,GAAG;IACtB,6EAA6E;IAC7E,0GAA0G;IAC1G,wGAAwG;IACxG,gIAAgI;CACjI,CAAC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;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './auth';
2
+ export * from './context';
3
+ export * from './project';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./context"), exports);
19
+ __exportStar(require("./project"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B"}
@@ -0,0 +1,120 @@
1
+ import type { BusinessProfileProjectBundle } from '@selleragent/api-contract';
2
+ import type { SaAdminContext } from './context';
3
+ export declare function validateProfileProject(context: SaAdminContext): Promise<{
4
+ rootDir: string;
5
+ manifestPath: string;
6
+ gitRoot: string | null;
7
+ gitCommitSha: string | null;
8
+ gitRepositoryUrl: string | null;
9
+ businessSlug: string;
10
+ environment: string;
11
+ baseUrl: string;
12
+ fileCount: number;
13
+ files: string[];
14
+ secretRefs: {
15
+ integrationKey: string;
16
+ field: "botToken" | "webhookSecret";
17
+ ref: string;
18
+ }[];
19
+ envFiles: string[];
20
+ }>;
21
+ export declare function buildProfileBundleForUpload(context: SaAdminContext): Promise<{
22
+ sourceRepositoryUrl: string;
23
+ sourceCommitSha: string;
24
+ bundle: {
25
+ manifest: {
26
+ schema_version: number;
27
+ kind: "sa_business_profile";
28
+ business_slug: string;
29
+ display_name: string;
30
+ default_environment: string;
31
+ defaults: {
32
+ api_base_url?: string | undefined;
33
+ web_base_url?: string | undefined;
34
+ transcript_output_dir?: string | undefined;
35
+ judge_output_dir?: string | undefined;
36
+ };
37
+ paths: {
38
+ business: string;
39
+ team: string;
40
+ catalog_products: string;
41
+ catalog_relations: string;
42
+ telegram_bots: string;
43
+ telegram_business_accounts: string;
44
+ strategies_root: string;
45
+ policies_root: string;
46
+ prompt_overrides: string;
47
+ expectation_blocks_root: string;
48
+ expectation_profiles_root: string;
49
+ seeds_root: string;
50
+ judge_rules_root?: string | undefined;
51
+ judge_scorecards_root?: string | undefined;
52
+ judge_transcripts_root?: string | undefined;
53
+ };
54
+ secret_refs: {
55
+ env_files: string[];
56
+ allowed_prefixes: string[];
57
+ };
58
+ };
59
+ files: {
60
+ relativePath: string;
61
+ content: string;
62
+ }[];
63
+ secretRefs: {
64
+ integrationKey: string;
65
+ field: "botToken" | "webhookSecret";
66
+ ref: string;
67
+ }[];
68
+ secretStatuses: {
69
+ integrationKey: string;
70
+ field: "botToken" | "webhookSecret";
71
+ ref: string | null;
72
+ status: "skipped" | "resolved" | "missing" | "stored";
73
+ keyId: string | null;
74
+ }[];
75
+ };
76
+ resolvedSecrets: {
77
+ integrationKey: string;
78
+ botToken?: string | null;
79
+ webhookSecret?: string | null;
80
+ }[];
81
+ declarations: {
82
+ integrationKey: string;
83
+ environments: string[];
84
+ environmentMatches: boolean;
85
+ label: string;
86
+ mode: "standard" | "business" | "hybrid";
87
+ enabled: boolean;
88
+ webhookPath?: string;
89
+ allowDirectCommands?: boolean;
90
+ allowDebugCommands?: boolean;
91
+ channelAccountId?: string | null;
92
+ botUsername?: string | null;
93
+ telegramBotId?: string | null;
94
+ }[];
95
+ }>;
96
+ export declare function loadTelegramBotDeclarations(context: SaAdminContext): Promise<{
97
+ integrationKey: string;
98
+ environments: string[];
99
+ environmentMatches: boolean;
100
+ label: string;
101
+ mode: "standard" | "business" | "hybrid";
102
+ enabled: boolean;
103
+ webhookPath?: string;
104
+ allowDirectCommands?: boolean;
105
+ allowDebugCommands?: boolean;
106
+ channelAccountId?: string | null;
107
+ botUsername?: string | null;
108
+ telegramBotId?: string | null;
109
+ }[]>;
110
+ export declare function writeDownloadedProfileBundle(input: {
111
+ rootDir: string;
112
+ bundle: BusinessProfileProjectBundle;
113
+ }): Promise<void>;
114
+ export declare function buildTelegramBotSnapshotYaml(input: {
115
+ integrations: Array<Record<string, unknown>>;
116
+ }): string;
117
+ export declare function buildTelegramBusinessAccountSnapshotYaml(input: {
118
+ items: Array<Record<string, unknown>>;
119
+ }): string;
120
+ //# sourceMappingURL=project.d.ts.map