@cotal-ai/cli 0.172.2 → 0.173.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 (107) hide show
  1. package/dist/command.d.ts.map +1 -1
  2. package/dist/command.js +15 -7
  3. package/dist/command.js.map +1 -1
  4. package/dist/commands/backup.d.ts.map +1 -1
  5. package/dist/commands/backup.js +15 -10
  6. package/dist/commands/backup.js.map +1 -1
  7. package/dist/commands/channels.d.ts.map +1 -1
  8. package/dist/commands/channels.js +8 -2
  9. package/dist/commands/channels.js.map +1 -1
  10. package/dist/commands/clean.d.ts.map +1 -1
  11. package/dist/commands/clean.js +1 -2
  12. package/dist/commands/clean.js.map +1 -1
  13. package/dist/commands/doctor.js +5 -2
  14. package/dist/commands/doctor.js.map +1 -1
  15. package/dist/commands/down-preserve.d.ts +74 -0
  16. package/dist/commands/down-preserve.d.ts.map +1 -0
  17. package/dist/commands/down-preserve.js +626 -0
  18. package/dist/commands/down-preserve.js.map +1 -0
  19. package/dist/commands/down.d.ts +2 -61
  20. package/dist/commands/down.d.ts.map +1 -1
  21. package/dist/commands/down.js +10 -621
  22. package/dist/commands/down.js.map +1 -1
  23. package/dist/commands/meshes-add.d.ts +2 -3
  24. package/dist/commands/meshes-add.d.ts.map +1 -1
  25. package/dist/commands/meshes-add.js +3 -19
  26. package/dist/commands/meshes-add.js.map +1 -1
  27. package/dist/commands/space-registration.d.ts.map +1 -1
  28. package/dist/commands/space-registration.js +8 -8
  29. package/dist/commands/space-registration.js.map +1 -1
  30. package/dist/commands/space.d.ts.map +1 -1
  31. package/dist/commands/space.js +15 -5
  32. package/dist/commands/space.js.map +1 -1
  33. package/dist/commands/spawn-preview.d.ts.map +1 -1
  34. package/dist/commands/spawn-preview.js +5 -5
  35. package/dist/commands/spawn-preview.js.map +1 -1
  36. package/dist/commands/spawn.d.ts.map +1 -1
  37. package/dist/commands/spawn.js +3 -3
  38. package/dist/commands/spawn.js.map +1 -1
  39. package/dist/commands/stack-up.d.ts +3 -1
  40. package/dist/commands/stack-up.d.ts.map +1 -1
  41. package/dist/commands/stack-up.js +37 -10
  42. package/dist/commands/stack-up.js.map +1 -1
  43. package/dist/commands/status-delivery.d.ts +9 -0
  44. package/dist/commands/status-delivery.d.ts.map +1 -0
  45. package/dist/commands/status-delivery.js +19 -0
  46. package/dist/commands/status-delivery.js.map +1 -0
  47. package/dist/commands/status-legacy.d.ts +7 -0
  48. package/dist/commands/status-legacy.d.ts.map +1 -0
  49. package/dist/commands/status-legacy.js +35 -0
  50. package/dist/commands/status-legacy.js.map +1 -0
  51. package/dist/commands/status.d.ts.map +1 -1
  52. package/dist/commands/status.js +29 -65
  53. package/dist/commands/status.js.map +1 -1
  54. package/dist/commands/team-agent-apply.js +11 -11
  55. package/dist/commands/team-agent-apply.js.map +1 -1
  56. package/dist/commands/team-deploy-apply.js +2 -2
  57. package/dist/commands/team-deploy-apply.js.map +1 -1
  58. package/dist/commands/team.js +12 -19
  59. package/dist/commands/team.js.map +1 -1
  60. package/dist/commands/up.d.ts +2 -0
  61. package/dist/commands/up.d.ts.map +1 -1
  62. package/dist/commands/up.js +11 -30
  63. package/dist/commands/up.js.map +1 -1
  64. package/dist/commands/update.js +6 -6
  65. package/dist/commands/update.js.map +1 -1
  66. package/dist/commands/watch.d.ts.map +1 -1
  67. package/dist/commands/watch.js +5 -2
  68. package/dist/commands/watch.js.map +1 -1
  69. package/dist/commands/whoami.d.ts.map +1 -1
  70. package/dist/commands/whoami.js +3 -2
  71. package/dist/commands/whoami.js.map +1 -1
  72. package/dist/help.d.ts +1 -1
  73. package/dist/help.d.ts.map +1 -1
  74. package/dist/help.js +3 -1
  75. package/dist/help.js.map +1 -1
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +3 -2
  78. package/dist/index.js.map +1 -1
  79. package/dist/lib/choose-target.d.ts.map +1 -1
  80. package/dist/lib/choose-target.js +12 -9
  81. package/dist/lib/choose-target.js.map +1 -1
  82. package/dist/lib/endpoint-errors.d.ts.map +1 -1
  83. package/dist/lib/endpoint-errors.js +9 -2
  84. package/dist/lib/endpoint-errors.js.map +1 -1
  85. package/dist/lib/persona-files.d.ts.map +1 -1
  86. package/dist/lib/persona-files.js +2 -3
  87. package/dist/lib/persona-files.js.map +1 -1
  88. package/dist/lib/spawn-defaults.d.ts +2 -0
  89. package/dist/lib/spawn-defaults.d.ts.map +1 -1
  90. package/dist/lib/spawn-defaults.js +11 -0
  91. package/dist/lib/spawn-defaults.js.map +1 -1
  92. package/dist/lib/stack-journal.d.ts.map +1 -1
  93. package/dist/lib/stack-journal.js +10 -1
  94. package/dist/lib/stack-journal.js.map +1 -1
  95. package/dist/lib/store-dir.d.ts +3 -1
  96. package/dist/lib/store-dir.d.ts.map +1 -1
  97. package/dist/lib/store-dir.js +20 -4
  98. package/dist/lib/store-dir.js.map +1 -1
  99. package/dist/lib/team-deploy-inspection.d.ts +2 -1
  100. package/dist/lib/team-deploy-inspection.d.ts.map +1 -1
  101. package/dist/lib/team-deploy-inspection.js +6 -1
  102. package/dist/lib/team-deploy-inspection.js.map +1 -1
  103. package/dist/seed/launch.d.ts +1 -1
  104. package/dist/seed/launch.d.ts.map +1 -1
  105. package/dist/seed/launch.js +3 -3
  106. package/dist/seed/launch.js.map +1 -1
  107. package/package.json +4 -4
@@ -0,0 +1,74 @@
1
+ import { type Presence } from "@cotal-ai/core";
2
+ import { type LocalProcess, type LocalProcessContext, type MaintenanceResumeDescriptor, type SeatCheckpoint } from "@cotal-ai/workspace";
3
+ /** How a live unmanaged endpoint is named in the preserve refusal. A missing or whitespace-only name is the id. */
4
+ export declare function unmanagedEndpointLabel(name: string, id: string): string;
5
+ export declare const sleep: (ms: number) => Promise<unknown>;
6
+ /** Whether a component's pidfile names a process the `@cotal-ai/workspace` pid-attribution contract
7
+ * (`parsePid` + `probeLiveness`) reports alive. */
8
+ export declare function processAlive(component: LocalProcess, context: LocalProcessContext): boolean;
9
+ /** Whether a component MIGHT still be running. It fails CLOSED on uncertainty. A component with NO
10
+ * pidfile, an EMPTY husk, or a valid pid PROVEN dead (ESRCH) is not running. ANY other state - an
11
+ * unparsable/unattributable record, or a valid pid that is alive or whose liveness cannot be
12
+ * confirmed (`unknown`) - MIGHT be running. `down --preserve-state` asks it to fence an uncertain
13
+ * delivery daemon, to treat an uncertain manager as alive, and to refuse to call a cut complete.
14
+ * `processAlive` collapses unparsable and `unknown` to "not alive", which is fine for "is it worth
15
+ * stopping" but WRONG for those questions: it would count a live auth signer behind a torn pidfile
16
+ * as stopped. Only an ESRCH-confirmed death (or no record) clears a component. */
17
+ export declare function mayBeRunning(component: LocalProcess, context: LocalProcessContext): boolean;
18
+ /** The principal keys of every retained agent in a preservation inventory — the dot-form ids that
19
+ * appear in the presence roster, so a caller can tell which retained agents are still live. */
20
+ export declare function retainedPrincipalKeys(inventory: unknown): Set<string>;
21
+ /**
22
+ * The operator's `--session-store` paths, resolved and proven to be directories.
23
+ *
24
+ * There is no default and nothing is inferred from a connector name: this repository does not know
25
+ * where a harness keeps its transcript, and a guess recorded as a fact would produce a checkpoint
26
+ * promising `exact` over bytes nobody chose. A path that does not exist or is not a directory is
27
+ * refused HERE, before a single process is stopped, because a cut that discovers it after the stack
28
+ * is down costs the operator the whole cut.
29
+ */
30
+ export declare function assertSessionStores(paths: readonly string[]): string[];
31
+ export declare function preserveStateDown(storeOverride?: string, sessionStores?: readonly string[]): Promise<void>;
32
+ /**
33
+ * Refuse any seat the cut could not checkpoint, from the prepared inventory alone.
34
+ *
35
+ * Called at prepare time, before a single child is stopped. The capture itself must wait until the
36
+ * stack is proven down, but the DECISION about whether a capture is possible reads only the
37
+ * inventory, so it belongs where the operator still has a running mesh.
38
+ *
39
+ * A seat the manager would refuse to resume is refused here too, with the manager's own wording:
40
+ * `Manager.inventoryReferenceError` says `imperative launch options have no non-secret durable
41
+ * source`, and a checkpoint inherits that refusal rather than writing something that will not
42
+ * reproduce the seat.
43
+ */
44
+ export declare function assertSeatsCheckpointable(inventory: unknown): void;
45
+ /** Capture one checkpoint per retained seat, after the cut has proven the whole stack down. */
46
+ export declare function captureSeatCheckpoints(root: string, space: string, resume: MaintenanceResumeDescriptor, destination: string, sessionStores: readonly string[]): Promise<SeatCheckpoint[]>;
47
+ /** Wire-truth control-plane quiescence: a live manager/delivery daemon renews its lease
48
+ * continuously, so the cut publishes `ready` only once BOTH lease buckets hold no live value —
49
+ * a dead daemon's lease expires by TTL, a pidless live one keeps renewing and is refused here.
50
+ * Pidfiles are hints; leases are proof. */
51
+ export declare function assertControlPlaneQuiesced(space: string, server: string): Promise<void>;
52
+ /** Read current KV subjects by Direct Get so the cut check leaves no ephemeral/native consumer.
53
+ *
54
+ * Exported for the gated tombstone cell. A regression test for the lease walk has to run through
55
+ * THIS function, not a transcription of it: a copy carries its own `allowEmpty` parameter, so it
56
+ * stays green when the argument at the real call site is removed and proves nothing about the fix. */
57
+ export declare function readPresenceWithoutConsumer(space: string, server: string): Promise<{
58
+ roster: Presence[];
59
+ managerId: string;
60
+ }>;
61
+ /** `liveness` keeps `probeLiveness`'s three states so each caller picks its direction: a presence
62
+ * reader requires `"alive"`, a destructive guard proceeds only on `"dead"`. No record and an empty
63
+ * husk are `"dead"`; unattributable content and a removal reservation are `"unknown"`, because
64
+ * `cotal down` refuses them as possibly fronting a live process. */
65
+ export type PidfileState = {
66
+ pid?: number;
67
+ liveness: "alive" | "dead" | "unknown";
68
+ note?: string;
69
+ };
70
+ /** The one classifier of a pidfile, read through `readPidfile`, `parsePid` and `probeLiveness` in
71
+ * `@cotal-ai/workspace`: positive integers only, and `EPERM` means the process exists.
72
+ * `processAlive` and `mayBeRunning` are its two directions. */
73
+ export declare function pidfileState(path: string): PidfileState;
74
+ //# sourceMappingURL=down-preserve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"down-preserve.d.ts","sourceRoot":"","sources":["../../src/commands/down-preserve.ts"],"names":[],"mappings":"AACA,OAAO,EAiBL,KAAK,QAAQ,EACd,MAAM,gBAA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