@celilo/core 0.1.0 → 0.2.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/package.json +1 -1
- package/src/command-registry.ts +308 -1
- package/src/protocol.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celilo/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Lightweight shared core for Celilo CLI tools — command registry, NDJSON API protocol, and remote SSH client. No Ink/React/drizzle/aws-sdk transitive deps, so an MCP server can reach the transport without installing the full CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/src/command-registry.ts
CHANGED
|
@@ -402,6 +402,94 @@ export const COMMANDS: CommandDef[] = [
|
|
|
402
402
|
},
|
|
403
403
|
],
|
|
404
404
|
},
|
|
405
|
+
{
|
|
406
|
+
name: 'registry',
|
|
407
|
+
description: 'Administer the module registry (append-safe publish-token management)',
|
|
408
|
+
subcommands: [
|
|
409
|
+
{
|
|
410
|
+
name: 'token',
|
|
411
|
+
description: 'Manage the celilo-registry publish_tokens list (append-safe)',
|
|
412
|
+
subcommands: [
|
|
413
|
+
{
|
|
414
|
+
name: 'add',
|
|
415
|
+
description: 'Append a publish token without clobbering existing holders',
|
|
416
|
+
args: [{ name: 'token', description: 'Publish token to append' }],
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'rm',
|
|
420
|
+
description: 'Remove one publish token, leaving the rest intact',
|
|
421
|
+
args: [{ name: 'token', description: 'Publish token to remove' }],
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'owner',
|
|
427
|
+
description: 'Administer the module-owner table (who may publish which module names)',
|
|
428
|
+
subcommands: [
|
|
429
|
+
{
|
|
430
|
+
name: 'list',
|
|
431
|
+
description: 'List the whole module-owner table',
|
|
432
|
+
flags: [{ name: 'registry', description: 'Registry URL', takesValue: true }],
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: 'show',
|
|
436
|
+
description: 'Show the owner of one module name',
|
|
437
|
+
args: [{ name: 'module', description: 'Module name to look up' }],
|
|
438
|
+
flags: [{ name: 'registry', description: 'Registry URL', takesValue: true }],
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'set',
|
|
442
|
+
description: 'Reassign a module name to a new owner (admin)',
|
|
443
|
+
args: [
|
|
444
|
+
{ name: 'module', description: 'Module name to reassign' },
|
|
445
|
+
{ name: 'owner-sub', description: 'New owner subject (idp sub)' },
|
|
446
|
+
],
|
|
447
|
+
flags: [{ name: 'registry', description: 'Registry URL', takesValue: true }],
|
|
448
|
+
},
|
|
449
|
+
],
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: 'token',
|
|
455
|
+
description: 'Manage contributor identity tokens (idp-issued per-user publish tokens)',
|
|
456
|
+
subcommands: [
|
|
457
|
+
{
|
|
458
|
+
name: 'obtain',
|
|
459
|
+
description: 'Mint (or return) a per-user API token bound to an idp identity',
|
|
460
|
+
args: [{ name: 'username', description: 'The idp user the token is bound to' }],
|
|
461
|
+
flags: [
|
|
462
|
+
{ name: 'user', description: 'The idp user the token is bound to', takesValue: true },
|
|
463
|
+
{
|
|
464
|
+
name: 'identifier',
|
|
465
|
+
description: 'Token identifier (default: celilo-publish-<user>)',
|
|
466
|
+
takesValue: true,
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: 'description',
|
|
470
|
+
description: 'Human-readable description shown in the idp',
|
|
471
|
+
takesValue: true,
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: 'list',
|
|
477
|
+
description: "List a user's API tokens (metadata only, never the secret)",
|
|
478
|
+
args: [{ name: 'username', description: 'The idp user whose tokens to list' }],
|
|
479
|
+
flags: [
|
|
480
|
+
{ name: 'user', description: 'The idp user whose tokens to list', takesValue: true },
|
|
481
|
+
],
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: 'revoke',
|
|
485
|
+
description: 'Revoke a token by identifier; the next publish with it is denied',
|
|
486
|
+
args: [{ name: 'identifier', description: 'Token identifier to revoke' }],
|
|
487
|
+
flags: [
|
|
488
|
+
{ name: 'identifier', description: 'Token identifier to revoke', takesValue: true },
|
|
489
|
+
],
|
|
490
|
+
},
|
|
491
|
+
],
|
|
492
|
+
},
|
|
405
493
|
{
|
|
406
494
|
name: 'module',
|
|
407
495
|
description: 'Manage modules (import, generate, configure)',
|
|
@@ -493,7 +581,7 @@ export const COMMANDS: CommandDef[] = [
|
|
|
493
581
|
{
|
|
494
582
|
name: 'upgrade',
|
|
495
583
|
description:
|
|
496
|
-
'Upgrade a module to its latest registry version: update → backup (posture-gated) → deploy → verify. No id = the CD poll: upgrade every auto_upgrade module with a newer version.',
|
|
584
|
+
'Upgrade a module to its latest registry version: update → backup (posture-gated) → deploy → verify. No id (or --poll) = the CD poll: upgrade every auto_upgrade module with a newer version.',
|
|
497
585
|
args: [
|
|
498
586
|
{
|
|
499
587
|
name: 'id',
|
|
@@ -502,6 +590,12 @@ export const COMMANDS: CommandDef[] = [
|
|
|
502
590
|
},
|
|
503
591
|
],
|
|
504
592
|
flags: [
|
|
593
|
+
{
|
|
594
|
+
name: 'poll',
|
|
595
|
+
description:
|
|
596
|
+
'Run the CD poll regardless of positional args — required when wired as an event-bus handler (the dispatcher appends the event id)',
|
|
597
|
+
takesValue: false,
|
|
598
|
+
},
|
|
505
599
|
{
|
|
506
600
|
name: 'registry',
|
|
507
601
|
description: 'Registry URL (defaults to configured registry)',
|
|
@@ -627,6 +721,44 @@ export const COMMANDS: CommandDef[] = [
|
|
|
627
721
|
description: 'Show detailed module status',
|
|
628
722
|
args: [{ name: 'id', description: 'Module ID', completion: 'module_ids' }],
|
|
629
723
|
},
|
|
724
|
+
{
|
|
725
|
+
name: 'where',
|
|
726
|
+
description: 'Show which host(s) serve a module (host discovery)',
|
|
727
|
+
args: [{ name: 'id', description: 'Module ID', completion: 'module_ids' }],
|
|
728
|
+
flags: [
|
|
729
|
+
{
|
|
730
|
+
name: 'json',
|
|
731
|
+
description: 'Output host discovery as stable JSON',
|
|
732
|
+
takesValue: false,
|
|
733
|
+
},
|
|
734
|
+
],
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: 'operations',
|
|
738
|
+
description: 'Show or release in-flight module operations (the backup/restore lock)',
|
|
739
|
+
args: [{ name: 'action', description: 'list (default) or clear' }],
|
|
740
|
+
flags: [
|
|
741
|
+
{
|
|
742
|
+
name: 'all',
|
|
743
|
+
description: 'With clear: also release operations that still look alive',
|
|
744
|
+
takesValue: false,
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
subcommands: [
|
|
748
|
+
{ name: 'list', description: 'Show operations currently holding the lock' },
|
|
749
|
+
{
|
|
750
|
+
name: 'clear',
|
|
751
|
+
description: 'Release abandoned operations so backups can run again',
|
|
752
|
+
flags: [
|
|
753
|
+
{
|
|
754
|
+
name: 'all',
|
|
755
|
+
description: 'Also release operations that still look alive',
|
|
756
|
+
takesValue: false,
|
|
757
|
+
},
|
|
758
|
+
],
|
|
759
|
+
},
|
|
760
|
+
],
|
|
761
|
+
},
|
|
630
762
|
{
|
|
631
763
|
name: 'logs',
|
|
632
764
|
description: 'Show deploy logs for a module',
|
|
@@ -1303,6 +1435,176 @@ export const COMMANDS: CommandDef[] = [
|
|
|
1303
1435
|
},
|
|
1304
1436
|
],
|
|
1305
1437
|
},
|
|
1438
|
+
{
|
|
1439
|
+
name: 'person',
|
|
1440
|
+
description: 'Manage people celilo can reach',
|
|
1441
|
+
subcommands: [
|
|
1442
|
+
{ name: 'list', description: 'List configured people' },
|
|
1443
|
+
{
|
|
1444
|
+
name: 'add',
|
|
1445
|
+
description: 'Add a person',
|
|
1446
|
+
args: [{ name: 'name', description: 'Human-readable name, kebab-case' }],
|
|
1447
|
+
flags: [
|
|
1448
|
+
{
|
|
1449
|
+
name: 'timezone',
|
|
1450
|
+
description: 'IANA timezone, e.g. America/Los_Angeles',
|
|
1451
|
+
takesValue: true,
|
|
1452
|
+
},
|
|
1453
|
+
{ name: 'quiet-hours', description: 'Local window, e.g. 22:00-07:00', takesValue: true },
|
|
1454
|
+
],
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
name: 'remove',
|
|
1458
|
+
description: 'Remove a person and their routes',
|
|
1459
|
+
args: [{ name: 'name', description: 'Person name' }],
|
|
1460
|
+
},
|
|
1461
|
+
],
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
name: 'route',
|
|
1465
|
+
description: 'Manage how each person is reached (transport + address)',
|
|
1466
|
+
subcommands: [
|
|
1467
|
+
{ name: 'list', description: 'List configured routes' },
|
|
1468
|
+
{
|
|
1469
|
+
name: 'add',
|
|
1470
|
+
description: 'Reach a person over a transport',
|
|
1471
|
+
args: [
|
|
1472
|
+
{ name: 'person', description: 'Person name' },
|
|
1473
|
+
{ name: 'transport', description: 'Module providing the notification capability' },
|
|
1474
|
+
],
|
|
1475
|
+
flags: [
|
|
1476
|
+
{ name: 'address', description: 'Transport-specific address', takesValue: true },
|
|
1477
|
+
{ name: 'severity-floor', description: 'warning | critical', takesValue: true },
|
|
1478
|
+
{
|
|
1479
|
+
name: 'can-ack',
|
|
1480
|
+
description: 'Replies can arrive over this transport',
|
|
1481
|
+
takesValue: false,
|
|
1482
|
+
},
|
|
1483
|
+
],
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: 'remove',
|
|
1487
|
+
description: 'Remove a route',
|
|
1488
|
+
args: [
|
|
1489
|
+
{ name: 'person', description: 'Person name' },
|
|
1490
|
+
{ name: 'transport', description: 'Transport module id' },
|
|
1491
|
+
],
|
|
1492
|
+
},
|
|
1493
|
+
],
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: 'escalation-policy',
|
|
1497
|
+
description: 'Manage who gets paged, and in what order',
|
|
1498
|
+
subcommands: [
|
|
1499
|
+
{ name: 'list', description: 'List policies and their steps' },
|
|
1500
|
+
{
|
|
1501
|
+
name: 'add',
|
|
1502
|
+
description: 'Create a named policy',
|
|
1503
|
+
args: [{ name: 'name', description: 'Policy name' }],
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
name: 'step',
|
|
1507
|
+
description: 'Append a step to a policy',
|
|
1508
|
+
args: [
|
|
1509
|
+
{ name: 'policy', description: 'Policy name' },
|
|
1510
|
+
{ name: 'person', description: 'Person name' },
|
|
1511
|
+
{ name: 'transport', description: 'Transport module id' },
|
|
1512
|
+
],
|
|
1513
|
+
flags: [
|
|
1514
|
+
{
|
|
1515
|
+
name: 'after',
|
|
1516
|
+
description: 'Delay in minutes from escalation start',
|
|
1517
|
+
takesValue: true,
|
|
1518
|
+
},
|
|
1519
|
+
],
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
name: 'assign',
|
|
1523
|
+
description: 'Use a policy for a monitor',
|
|
1524
|
+
args: [
|
|
1525
|
+
{ name: 'policy', description: 'Policy name' },
|
|
1526
|
+
{ name: 'monitor', description: 'Monitor target' },
|
|
1527
|
+
],
|
|
1528
|
+
},
|
|
1529
|
+
{
|
|
1530
|
+
name: 'remove',
|
|
1531
|
+
description: 'Remove a policy',
|
|
1532
|
+
args: [{ name: 'name', description: 'Policy name' }],
|
|
1533
|
+
},
|
|
1534
|
+
],
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
name: 'monitor',
|
|
1538
|
+
description: 'Manage what celilo watches (health checks on a schedule)',
|
|
1539
|
+
subcommands: [
|
|
1540
|
+
{ name: 'list', description: 'List configured monitors' },
|
|
1541
|
+
{
|
|
1542
|
+
name: 'add',
|
|
1543
|
+
description: 'Watch a module or built-in check',
|
|
1544
|
+
args: [{ name: 'target', description: 'Module id or built-in check name' }],
|
|
1545
|
+
flags: [{ name: 'interval', description: 'Cadence, e.g. 15m, 1h, 1d', takesValue: true }],
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: 'run',
|
|
1549
|
+
description: 'Run a monitor now',
|
|
1550
|
+
args: [{ name: 'target', description: 'Module id or built-in check name' }],
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
name: 'enable',
|
|
1554
|
+
description: 'Enable a monitor',
|
|
1555
|
+
args: [{ name: 'target', description: 'Module id or built-in check name' }],
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
name: 'disable',
|
|
1559
|
+
description: 'Disable a monitor and resolve its alerts',
|
|
1560
|
+
args: [{ name: 'target', description: 'Module id or built-in check name' }],
|
|
1561
|
+
},
|
|
1562
|
+
],
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
name: 'alerts',
|
|
1566
|
+
description: 'View and manage alerts raised by monitors',
|
|
1567
|
+
subcommands: [
|
|
1568
|
+
{
|
|
1569
|
+
name: 'list',
|
|
1570
|
+
description: 'List current alerts',
|
|
1571
|
+
flags: [{ name: 'json', description: 'Machine-readable output', takesValue: false }],
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
name: 'ack',
|
|
1575
|
+
description: 'Acknowledge an alert — stops escalation, does not resolve it',
|
|
1576
|
+
args: [{ name: 'key', description: 'Alert key from `celilo alerts list`' }],
|
|
1577
|
+
flags: [{ name: 'as', description: 'Person acknowledging', takesValue: true }],
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: 'silence',
|
|
1581
|
+
description: 'Silence an alert for a while — deliberate and expiring',
|
|
1582
|
+
args: [{ name: 'key', description: 'Alert key' }],
|
|
1583
|
+
flags: [{ name: 'for', description: 'Duration, e.g. 2h, 30m, 1d', takesValue: true }],
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: 'resolve',
|
|
1587
|
+
description: 'Manually resolve an alert (it re-fires if the check still fails)',
|
|
1588
|
+
args: [{ name: 'key', description: 'Alert key' }],
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
name: 'sweep',
|
|
1592
|
+
description: 'Run one alerting pass (invoked by the dispatcher on timer.tick.5m)',
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
name: 'poll',
|
|
1596
|
+
description: 'Read replies off every bidirectional transport once',
|
|
1597
|
+
flags: [
|
|
1598
|
+
{
|
|
1599
|
+
name: 'ask-after',
|
|
1600
|
+
description:
|
|
1601
|
+
'Seconds a deploy question must go unanswered before it is sent to a phone (default 90). A responder attached to the deploy answers in seconds; this grace stops the two racing.',
|
|
1602
|
+
takesValue: true,
|
|
1603
|
+
},
|
|
1604
|
+
],
|
|
1605
|
+
},
|
|
1606
|
+
],
|
|
1607
|
+
},
|
|
1306
1608
|
{
|
|
1307
1609
|
name: 'storage',
|
|
1308
1610
|
description: 'Manage backup storage destinations',
|
|
@@ -1393,6 +1695,11 @@ export const COMMANDS: CommandDef[] = [
|
|
|
1393
1695
|
},
|
|
1394
1696
|
],
|
|
1395
1697
|
},
|
|
1698
|
+
{
|
|
1699
|
+
name: 'sweep',
|
|
1700
|
+
description:
|
|
1701
|
+
'Back up every module whose declared schedule is due (run by the event bus on timer.tick.1h)',
|
|
1702
|
+
},
|
|
1396
1703
|
{
|
|
1397
1704
|
name: 'list',
|
|
1398
1705
|
description: 'List available backups',
|
package/src/protocol.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A versioned, Zod-validated tagged union carried as NDJSON. This is the
|
|
5
5
|
* transport-neutral message layer for driving the CLI over the wire — see
|
|
6
|
-
* `
|
|
6
|
+
* `openspec/changes/replace-ssh-cli-api/proposal.md`. Slice 1 covers non-interactive command execution
|
|
7
7
|
* + streamed output; `interview` / `answer` / `cancel` arrive in Slice 3.
|
|
8
8
|
*
|
|
9
9
|
* The command crosses the wire as a *structured, validated* `argv` array —
|