@vibesdotdev/plugins 0.0.0-stage → 1.0.0-rc.1
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/LICENSE +18 -0
- package/README.md +54 -2
- package/VIBES.md +165 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +3 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/plugin.impl.cloud.d.ts +4 -0
- package/dist/ai/plugin.impl.cloud.d.ts.map +1 -0
- package/dist/ai/plugin.impl.cloud.js +32 -0
- package/dist/ai/plugin.impl.cloud.js.map +1 -0
- package/dist/ai/plugin.impl.consumer.d.ts +7 -0
- package/dist/ai/plugin.impl.consumer.d.ts.map +1 -0
- package/dist/ai/plugin.impl.consumer.js +222 -0
- package/dist/ai/plugin.impl.consumer.js.map +1 -0
- package/dist/auth/consumer.plugin.d.ts +3 -0
- package/dist/auth/consumer.plugin.d.ts.map +1 -0
- package/dist/auth/consumer.plugin.js +105 -0
- package/dist/auth/consumer.plugin.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/plugin.d.ts +4 -0
- package/dist/auth/plugin.d.ts.map +1 -0
- package/dist/auth/plugin.js +33 -0
- package/dist/auth/plugin.js.map +1 -0
- package/dist/automation/consumer.plugin.d.ts +3 -0
- package/dist/automation/consumer.plugin.d.ts.map +1 -0
- package/dist/automation/consumer.plugin.js +92 -0
- package/dist/automation/consumer.plugin.js.map +1 -0
- package/dist/automation/index.d.ts +2 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +2 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/plugin.d.ts +4 -0
- package/dist/automation/plugin.d.ts.map +1 -0
- package/dist/automation/plugin.js +30 -0
- package/dist/automation/plugin.js.map +1 -0
- package/dist/bun/host.d.ts +44 -0
- package/dist/bun/host.d.ts.map +1 -0
- package/dist/bun/host.js +71 -0
- package/dist/bun/host.js.map +1 -0
- package/dist/cli/child-failure.d.ts +37 -0
- package/dist/cli/child-failure.d.ts.map +1 -0
- package/dist/cli/child-failure.js +86 -0
- package/dist/cli/child-failure.js.map +1 -0
- package/dist/cli/context.d.ts +12 -0
- package/dist/cli/context.d.ts.map +1 -0
- package/dist/cli/context.js +11 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/execution.d.ts +10 -0
- package/dist/cli/execution.d.ts.map +1 -0
- package/dist/cli/execution.js +20 -0
- package/dist/cli/execution.js.map +1 -0
- package/dist/cli/failure-facts.d.ts +16 -0
- package/dist/cli/failure-facts.d.ts.map +1 -0
- package/dist/cli/failure-facts.js +39 -0
- package/dist/cli/failure-facts.js.map +1 -0
- package/dist/cli/package-manager.consumer.d.ts +106 -0
- package/dist/cli/package-manager.consumer.d.ts.map +1 -0
- package/dist/cli/package-manager.consumer.js +258 -0
- package/dist/cli/package-manager.consumer.js.map +1 -0
- package/dist/cli/plugin.d.ts +9 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +34 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/plugins.add.cli-command.descriptor.d.ts +36 -0
- package/dist/cli/plugins.add.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.add.cli-command.descriptor.js +31 -0
- package/dist/cli/plugins.add.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.d.ts +63 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.js +206 -0
- package/dist/cli/plugins.add.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.cli-group.descriptor.d.ts +4 -0
- package/dist/cli/plugins.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.cli-group.descriptor.js +10 -0
- package/dist/cli/plugins.cli-group.descriptor.js.map +1 -0
- package/dist/cli/plugins.host.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.host.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.host.cli-command.descriptor.js +37 -0
- package/dist/cli/plugins.host.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.d.ts +29 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.js +109 -0
- package/dist/cli/plugins.host.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.link.cli-command.descriptor.d.ts +35 -0
- package/dist/cli/plugins.link.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.link.cli-command.descriptor.js +32 -0
- package/dist/cli/plugins.link.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.d.ts +31 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.js +104 -0
- package/dist/cli/plugins.link.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.list.cli-command.descriptor.d.ts +26 -0
- package/dist/cli/plugins.list.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.list.cli-command.descriptor.js +22 -0
- package/dist/cli/plugins.list.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.d.ts +116 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.js +343 -0
- package/dist/cli/plugins.list.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.js +26 -0
- package/dist/cli/plugins.remove.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.d.ts +30 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.js +80 -0
- package/dist/cli/plugins.remove.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.d.ts +31 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.js +21 -0
- package/dist/cli/plugins.unlink.cli-command.descriptor.js.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.d.ts +76 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.js +190 -0
- package/dist/cli/plugins.unlink.cli-command.impl.consumer.js.map +1 -0
- package/dist/cli/registry-sign-in.consumer.d.ts +80 -0
- package/dist/cli/registry-sign-in.consumer.d.ts.map +1 -0
- package/dist/cli/registry-sign-in.consumer.js +199 -0
- package/dist/cli/registry-sign-in.consumer.js.map +1 -0
- package/dist/cli/roll.d.ts +230 -0
- package/dist/cli/roll.d.ts.map +1 -0
- package/dist/cli/roll.js +569 -0
- package/dist/cli/roll.js.map +1 -0
- package/dist/cli/schemas/context.d.ts +10 -0
- package/dist/cli/schemas/context.d.ts.map +1 -0
- package/dist/cli/schemas/context.js +3 -0
- package/dist/cli/schemas/context.js.map +1 -0
- package/dist/cli/schemas/scopes.d.ts +37 -0
- package/dist/cli/schemas/scopes.d.ts.map +1 -0
- package/dist/cli/schemas/scopes.js +11 -0
- package/dist/cli/schemas/scopes.js.map +1 -0
- package/dist/cli/schemas/unlink.d.ts +18 -0
- package/dist/cli/schemas/unlink.d.ts.map +1 -0
- package/dist/cli/schemas/unlink.js +3 -0
- package/dist/cli/schemas/unlink.js.map +1 -0
- package/dist/cli/schemas/update.d.ts +77 -0
- package/dist/cli/schemas/update.d.ts.map +1 -0
- package/dist/cli/schemas/update.js +3 -0
- package/dist/cli/schemas/update.js.map +1 -0
- package/dist/cli/scopes.d.ts +50 -0
- package/dist/cli/scopes.d.ts.map +1 -0
- package/dist/cli/scopes.js +90 -0
- package/dist/cli/scopes.js.map +1 -0
- package/dist/cli/seed.d.ts +232 -0
- package/dist/cli/seed.d.ts.map +1 -0
- package/dist/cli/seed.js +590 -0
- package/dist/cli/seed.js.map +1 -0
- package/dist/cli/self-update.d.ts +120 -0
- package/dist/cli/self-update.d.ts.map +1 -0
- package/dist/cli/self-update.js +274 -0
- package/dist/cli/self-update.js.map +1 -0
- package/dist/cli/update.cli-command.descriptor.d.ts +62 -0
- package/dist/cli/update.cli-command.descriptor.d.ts.map +1 -0
- package/dist/cli/update.cli-command.descriptor.js +49 -0
- package/dist/cli/update.cli-command.descriptor.js.map +1 -0
- package/dist/cli/update.cli-command.impl.consumer.d.ts +178 -0
- package/dist/cli/update.cli-command.impl.consumer.d.ts.map +1 -0
- package/dist/cli/update.cli-command.impl.consumer.js +750 -0
- package/dist/cli/update.cli-command.impl.consumer.js.map +1 -0
- package/dist/comms/consumer.plugin.d.ts +3 -0
- package/dist/comms/consumer.plugin.d.ts.map +1 -0
- package/dist/comms/consumer.plugin.js +108 -0
- package/dist/comms/consumer.plugin.js.map +1 -0
- package/dist/comms/index.d.ts +2 -0
- package/dist/comms/index.d.ts.map +1 -0
- package/dist/comms/index.js +2 -0
- package/dist/comms/index.js.map +1 -0
- package/dist/comms/plugin.d.ts +4 -0
- package/dist/comms/plugin.d.ts.map +1 -0
- package/dist/comms/plugin.js +30 -0
- package/dist/comms/plugin.js.map +1 -0
- package/dist/consumer.d.ts +3 -0
- package/dist/consumer.d.ts.map +1 -0
- package/dist/consumer.js +3 -0
- package/dist/consumer.js.map +1 -0
- package/dist/consumer.plugin.d.ts +63 -0
- package/dist/consumer.plugin.d.ts.map +1 -0
- package/dist/consumer.plugin.js +89 -0
- package/dist/consumer.plugin.js.map +1 -0
- package/dist/core/consumer.plugin.d.ts +4 -0
- package/dist/core/consumer.plugin.d.ts.map +1 -0
- package/dist/core/consumer.plugin.js +364 -0
- package/dist/core/consumer.plugin.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/optional-member.d.ts +11 -0
- package/dist/core/optional-member.d.ts.map +1 -0
- package/dist/core/optional-member.js +68 -0
- package/dist/core/optional-member.js.map +1 -0
- package/dist/core/optional-plugin.d.ts +40 -0
- package/dist/core/optional-plugin.d.ts.map +1 -0
- package/dist/core/optional-plugin.js +107 -0
- package/dist/core/optional-plugin.js.map +1 -0
- package/dist/core/plugin.d.ts +10 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +64 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/setup-requirements.descriptors.d.ts +7 -0
- package/dist/core/setup-requirements.descriptors.d.ts.map +1 -0
- package/dist/core/setup-requirements.descriptors.js +117 -0
- package/dist/core/setup-requirements.descriptors.js.map +1 -0
- package/dist/data/consumer.plugin.d.ts +3 -0
- package/dist/data/consumer.plugin.d.ts.map +1 -0
- package/dist/data/consumer.plugin.js +99 -0
- package/dist/data/consumer.plugin.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/plugin.d.ts +4 -0
- package/dist/data/plugin.d.ts.map +1 -0
- package/dist/data/plugin.js +37 -0
- package/dist/data/plugin.js.map +1 -0
- package/dist/devtools/consumer.plugin.d.ts +3 -0
- package/dist/devtools/consumer.plugin.d.ts.map +1 -0
- package/dist/devtools/consumer.plugin.js +323 -0
- package/dist/devtools/consumer.plugin.js.map +1 -0
- package/dist/devtools/index.d.ts +2 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/devtools/plugin.d.ts +4 -0
- package/dist/devtools/plugin.d.ts.map +1 -0
- package/dist/devtools/plugin.js +34 -0
- package/dist/devtools/plugin.js.map +1 -0
- package/dist/filesystem/index.d.ts +2 -0
- package/dist/filesystem/index.d.ts.map +1 -0
- package/dist/filesystem/index.js +2 -0
- package/dist/filesystem/index.js.map +1 -0
- package/dist/filesystem/plugin.d.ts +4 -0
- package/dist/filesystem/plugin.d.ts.map +1 -0
- package/dist/filesystem/plugin.js +21 -0
- package/dist/filesystem/plugin.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +16 -0
- package/dist/plugin.js.map +1 -0
- package/dist/schemas/ai.d.ts +119 -0
- package/dist/schemas/ai.d.ts.map +1 -0
- package/dist/schemas/ai.js +84 -0
- package/dist/schemas/ai.js.map +1 -0
- package/dist/schemas/auth.d.ts +15 -0
- package/dist/schemas/auth.d.ts.map +1 -0
- package/dist/schemas/auth.js +19 -0
- package/dist/schemas/auth.js.map +1 -0
- package/dist/schemas/automation.d.ts +66 -0
- package/dist/schemas/automation.d.ts.map +1 -0
- package/dist/schemas/automation.js +36 -0
- package/dist/schemas/automation.js.map +1 -0
- package/dist/schemas/comms.d.ts +13 -0
- package/dist/schemas/comms.d.ts.map +1 -0
- package/dist/schemas/comms.js +27 -0
- package/dist/schemas/comms.js.map +1 -0
- package/dist/schemas/core.d.ts +102 -0
- package/dist/schemas/core.d.ts.map +1 -0
- package/dist/schemas/core.js +124 -0
- package/dist/schemas/core.js.map +1 -0
- package/dist/schemas/data.d.ts +13 -0
- package/dist/schemas/data.d.ts.map +1 -0
- package/dist/schemas/data.js +25 -0
- package/dist/schemas/data.js.map +1 -0
- package/dist/schemas/devtools.d.ts +33 -0
- package/dist/schemas/devtools.d.ts.map +1 -0
- package/dist/schemas/devtools.js +56 -0
- package/dist/schemas/devtools.js.map +1 -0
- package/dist/schemas/family.d.ts +11 -0
- package/dist/schemas/family.d.ts.map +1 -0
- package/dist/schemas/family.js +21 -0
- package/dist/schemas/family.js.map +1 -0
- package/dist/schemas/filesystem.d.ts +25 -0
- package/dist/schemas/filesystem.d.ts.map +1 -0
- package/dist/schemas/filesystem.js +24 -0
- package/dist/schemas/filesystem.js.map +1 -0
- package/dist/schemas/host.d.ts +10 -0
- package/dist/schemas/host.d.ts.map +1 -0
- package/dist/schemas/host.js +2 -0
- package/dist/schemas/host.js.map +1 -0
- package/dist/schemas/optional-member.d.ts +67 -0
- package/dist/schemas/optional-member.d.ts.map +1 -0
- package/dist/schemas/optional-member.js +31 -0
- package/dist/schemas/optional-member.js.map +1 -0
- package/dist/schemas/roll.d.ts +47 -0
- package/dist/schemas/roll.d.ts.map +1 -0
- package/dist/schemas/roll.js +18 -0
- package/dist/schemas/roll.js.map +1 -0
- package/dist/schemas/tui.d.ts +33 -0
- package/dist/schemas/tui.d.ts.map +1 -0
- package/dist/schemas/tui.js +95 -0
- package/dist/schemas/tui.js.map +1 -0
- package/dist/schemas/ui.d.ts +15 -0
- package/dist/schemas/ui.d.ts.map +1 -0
- package/dist/schemas/ui.js +45 -0
- package/dist/schemas/ui.js.map +1 -0
- package/dist/tui/code-sessions-tui-plugin-shim.d.ts +7 -0
- package/dist/tui/code-sessions-tui-plugin-shim.d.ts.map +1 -0
- package/dist/tui/code-sessions-tui-plugin-shim.js +2 -0
- package/dist/tui/code-sessions-tui-plugin-shim.js.map +1 -0
- package/dist/tui/index.d.ts +8 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/plugin.d.ts +53 -0
- package/dist/tui/plugin.d.ts.map +1 -0
- package/dist/tui/plugin.js +350 -0
- package/dist/tui/plugin.js.map +1 -0
- package/dist/ui/consumer.plugin.d.ts +3 -0
- package/dist/ui/consumer.plugin.d.ts.map +1 -0
- package/dist/ui/consumer.plugin.js +75 -0
- package/dist/ui/consumer.plugin.js.map +1 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/plugin.d.ts +4 -0
- package/dist/ui/plugin.d.ts.map +1 -0
- package/dist/ui/plugin.js +35 -0
- package/dist/ui/plugin.js.map +1 -0
- package/host-start.mjs +39 -0
- package/host.mjs +24 -0
- package/package.json +437 -4
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The roll census for `vibes update` (plan §5.1).
|
|
3
|
+
*
|
|
4
|
+
* `vibes update` replaces the module graph under running bodies. A body that
|
|
5
|
+
* keeps executing the previous graph answers plausibly and is wrong — that is
|
|
6
|
+
* the stale-body failure class this whole program exists to end. So the update
|
|
7
|
+
* does not merely restart what it can reach; it ENUMERATES every body it knows
|
|
8
|
+
* how to find and prints one line per body, including the ones it could not
|
|
9
|
+
* roll and why.
|
|
10
|
+
*
|
|
11
|
+
* ### Where the census comes from, and why it is three sources, not one
|
|
12
|
+
*
|
|
13
|
+
* 1. **The OS agent directory** — `~/Library/LaunchAgents/*.plist` (darwin) or
|
|
14
|
+
* `~/.config/systemd/user/*.service` (linux). This is the ONLY source that
|
|
15
|
+
* sees the `dev.vibes.bignet.*` bodies: they invoke `vibes fleet daemon
|
|
16
|
+
* --host-id …` directly and are **not** `hq/os-service` descriptors, so a
|
|
17
|
+
* census built from the hq registry alone reports them as absent when they
|
|
18
|
+
* are in fact running the old graph.
|
|
19
|
+
* 2. **The hq service registry** — `hq/os-service` descriptors, read from THIS
|
|
20
|
+
* runtime. No manifest edge: if the host composed hq, the kind is there; if
|
|
21
|
+
* it did not, the census says so instead of pretending.
|
|
22
|
+
* 3. **PM and stdio MCP** — the PM daemon rolls through its own supervised
|
|
23
|
+
* handoff; an stdio MCP body is owned by its client (Claude Code, Cursor,
|
|
24
|
+
* …) and CANNOT be restarted from here. It is reported `NOT ROLLED` with
|
|
25
|
+
* `/mcp` as the remedy rather than silently omitted.
|
|
26
|
+
*
|
|
27
|
+
* Each body is classified by what its command line actually is, because the
|
|
28
|
+
* three shapes roll differently: an installed-binary body picks up the new
|
|
29
|
+
* graph on restart; a **source-mode** body (`bun …/vibes.ts`) already reads the
|
|
30
|
+
* files that just changed and needs a restart only for module cache; a
|
|
31
|
+
* **hostWorkspace-delegated** body resolves its graph through
|
|
32
|
+
* `$VIBES_HOME/package.json#vibes.hostWorkspace`, so it is rolled by the same
|
|
33
|
+
* restart but its graph root is not `$VIBES_HOME`.
|
|
34
|
+
*
|
|
35
|
+
* Rolling happens IN-PROCESS through the owner of each body, never by
|
|
36
|
+
* re-entering the CLI: an hq-registered OS service through hq's service
|
|
37
|
+
* registry (`restartService`, whose receipt says whether the main pid was
|
|
38
|
+
* replaced), the PM daemon through PM's own `pm.daemon.restart` command
|
|
39
|
+
* resolved from this runtime and verified by reading the daemon pid again.
|
|
40
|
+
* A body whose owner is not composed into this host is reported `NOT ROLLED`
|
|
41
|
+
* with that reason, never omitted and never counted as success.
|
|
42
|
+
*
|
|
43
|
+
* Every host fact comes from the handed runtime: files through its filesystem
|
|
44
|
+
* adapter, the platform from its host facts, process-table reads and the
|
|
45
|
+
* executable-replacement verdict from `runtime/host-identity`, and the
|
|
46
|
+
* service-manager census (`launchctl list`, `systemctl --user show`) through
|
|
47
|
+
* `runtime/execution` in argv form with a declared deadline.
|
|
48
|
+
*/
|
|
49
|
+
import { type CaughtFailure, type ChildEnvRuntime, type RuntimeHostIdentity, type VibesRuntime } from '@vibesdotdev/kernel';
|
|
50
|
+
import type { RollBody, RollBodyMode } from '../schemas/roll.ts';
|
|
51
|
+
export type { RollBody, RollBodyKind, RollBodyMode, RollBodyShape } from '../schemas/roll.ts';
|
|
52
|
+
export interface RollOutcome {
|
|
53
|
+
/** Original restart failure retained for programmatic callers; human output is redacted. */
|
|
54
|
+
cause?: CaughtFailure;
|
|
55
|
+
body: RollBody;
|
|
56
|
+
rolled: boolean;
|
|
57
|
+
previousPid?: number;
|
|
58
|
+
pid?: number;
|
|
59
|
+
/** Human line: `rolled (pid a→b)` or `NOT ROLLED: <id> — <reason>`. */
|
|
60
|
+
line: string;
|
|
61
|
+
reason?: string;
|
|
62
|
+
}
|
|
63
|
+
/** The deadline on one service-manager census command. */
|
|
64
|
+
export declare const SERVICE_MANAGER_TIMEOUT_MS = 5000;
|
|
65
|
+
/** Classify a supervised program path into the three graph shapes. */
|
|
66
|
+
export declare function classifyProgram(program: string | undefined): RollBodyMode;
|
|
67
|
+
/**
|
|
68
|
+
* Every `com.vibes.*` / `dev.vibes.*` LaunchAgent on disk. Deliberately reads
|
|
69
|
+
* the DIRECTORY, not a registry: the `dev.vibes.bignet.*` bodies are real,
|
|
70
|
+
* running, and unknown to hq.
|
|
71
|
+
*/
|
|
72
|
+
export declare function censusLaunchAgents(runtime: VibesRuntime, userHome: string): Promise<RollBody[]>;
|
|
73
|
+
/** systemd user units named for vibes. Same contract as the launchd census. */
|
|
74
|
+
export declare function censusSystemdUserUnits(runtime: VibesRuntime, userHome: string): Promise<RollBody[]>;
|
|
75
|
+
/**
|
|
76
|
+
* `hq/os-service` descriptors composed into THIS runtime. Returns `[]` when hq
|
|
77
|
+
* is not part of the host — the absence is reported by the caller as a
|
|
78
|
+
* denominator note, never as "no services".
|
|
79
|
+
*/
|
|
80
|
+
export declare function censusHqServices(runtime: VibesRuntime, userHome: string): Promise<RollBody[]>;
|
|
81
|
+
/** stdio MCP bodies, which no command can restart — their client owns them. */
|
|
82
|
+
export declare function censusStdioMcpBodies(runtime: VibesRuntime, vibesHome: string): Promise<RollBody[]>;
|
|
83
|
+
/** What the whole census reads. */
|
|
84
|
+
export interface CensusInput {
|
|
85
|
+
runtime: VibesRuntime;
|
|
86
|
+
userHome: string;
|
|
87
|
+
vibesHome: string;
|
|
88
|
+
includePmDaemon: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The whole census, deduplicated by `<kind>:<id>`. An hq-registered label seen
|
|
92
|
+
* in the agent directory keeps the hq row (it carries the restart capability)
|
|
93
|
+
* but inherits the on-disk program, so the shape is what is actually running.
|
|
94
|
+
* The OS agent source follows the platform the host declared.
|
|
95
|
+
*/
|
|
96
|
+
export declare function censusBodies(input: CensusInput): Promise<RollBody[]>;
|
|
97
|
+
/**
|
|
98
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
99
|
+
* Is this body running a REPLACED executable? (plan §7)
|
|
100
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
101
|
+
*
|
|
102
|
+
* `vibes update` used to roll only when the module graph moved or `--self`
|
|
103
|
+
* downloaded a release. A local `bun run build:install` replaces
|
|
104
|
+
* `~/.local/bin/vibes` by atomic rename and changes NEITHER, so the command
|
|
105
|
+
* printed "nothing changed, so no body was rolled" at the same moment
|
|
106
|
+
* `vibes pm status` printed "⚠ PM daemon (pid …) runs a replaced vibes
|
|
107
|
+
* executable" — two shipping surfaces disagreeing about one fact, with the
|
|
108
|
+
* weaker predicate winning the decision that matters.
|
|
109
|
+
*
|
|
110
|
+
* The verdict reads `runtime/host-identity` (`readProcessExecutablePath` →
|
|
111
|
+
* `readProcessStartMs` → `executableReplacedSince`), the same nerve `pm status`
|
|
112
|
+
* and the PM daemon's `ExecutableFreshnessReconciler` read.
|
|
113
|
+
*/
|
|
114
|
+
export interface BodyExecutableVerdict {
|
|
115
|
+
/**
|
|
116
|
+
* true — the file this body executes was written after the body started;
|
|
117
|
+
* false — it predates the body;
|
|
118
|
+
* null — unanswerable (no pid, `ps` unavailable, path unreadable). NEVER
|
|
119
|
+
* collapsed into `false`: "we could not read it" and "it is fresh"
|
|
120
|
+
* are different facts and only the first must not trigger a roll.
|
|
121
|
+
*/
|
|
122
|
+
replaced: boolean | null;
|
|
123
|
+
reason: string;
|
|
124
|
+
}
|
|
125
|
+
/** The three host-identity reads a body verdict makes. */
|
|
126
|
+
export type BodyProcessReaders = Pick<RuntimeHostIdentity, 'readProcessExecutablePath' | 'readProcessStartMs' | 'executableReplacedSince'>;
|
|
127
|
+
/** The production readers: the host's own process-table and executable-identity capability. */
|
|
128
|
+
export declare function bodyProcessReaders(runtime: VibesRuntime): Promise<BodyProcessReaders>;
|
|
129
|
+
/** One body to judge: its live pid and its plist program, when known. */
|
|
130
|
+
export interface JudgedBody {
|
|
131
|
+
pid?: number;
|
|
132
|
+
program?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The shared predicate, applied to one body.
|
|
136
|
+
*
|
|
137
|
+
* `program` (argv[0] from the plist/unit) is only a FALLBACK: the OS is asked
|
|
138
|
+
* first, because a plist may name a symlink or a `PATH`-resolved word while the
|
|
139
|
+
* kernel knows the actual file. A relative `program` is refused rather than
|
|
140
|
+
* guessed against `PATH`.
|
|
141
|
+
*/
|
|
142
|
+
export declare function judgeBodyExecutable(body: JudgedBody, readers: BodyProcessReaders): BodyExecutableVerdict;
|
|
143
|
+
/**
|
|
144
|
+
* The service managers' environment: the kernel's host set plus the user
|
|
145
|
+
* session keys `systemctl --user` reaches its manager through.
|
|
146
|
+
*/
|
|
147
|
+
export declare function serviceManagerEnv(runtime: ChildEnvRuntime): Record<string, string>;
|
|
148
|
+
/**
|
|
149
|
+
* Live pids for every loaded LaunchAgent, in ONE `launchctl list` call
|
|
150
|
+
* (`PID\tStatus\tLabel`). A label with `-` for a pid is loaded but not running,
|
|
151
|
+
* and is deliberately absent from the map — there is no body to be stale.
|
|
152
|
+
*/
|
|
153
|
+
export declare function launchdPids(runtime: VibesRuntime, env: Record<string, string>): Promise<Map<string, number>>;
|
|
154
|
+
/** `MainPID` of one systemd user unit; 0/absent means not running. */
|
|
155
|
+
export declare function systemdMainPid(runtime: VibesRuntime, unit: string, env: Record<string, string>): Promise<number | undefined>;
|
|
156
|
+
/** What the PM pid census reads from the runtime it is handed. */
|
|
157
|
+
export type PmPidRuntime = VibesRuntime;
|
|
158
|
+
/**
|
|
159
|
+
* The PM daemon's pid, read from PM's own PID file for `runtime`'s admitted
|
|
160
|
+
* workspace (the runtime the caller was handed).
|
|
161
|
+
*
|
|
162
|
+
* Deliberately NOT `runtime.context('pm/client')`: resolving that context
|
|
163
|
+
* SPAWNS a daemon as a side effect (`pm.context.impl.consumer.ts` fires
|
|
164
|
+
* `ensureDaemonRunning()` on consumer hardware), and a census that starts the
|
|
165
|
+
* body it is measuring is not a census. The path itself has one owner —
|
|
166
|
+
* `@vibesdotdev/pm/daemon-pid` — imported dynamically because `pm` is an
|
|
167
|
+
* OPTIONAL peer here. `undefined` ("unanswerable", not "fresh") has exactly
|
|
168
|
+
* two causes: a host composed without PM (the module is not installed), and a
|
|
169
|
+
* workspace PM never admitted (so no PM daemon of it exists). Every other
|
|
170
|
+
* failure propagates.
|
|
171
|
+
*/
|
|
172
|
+
export declare function pmDaemonPid(runtime: PmPidRuntime): Promise<number | undefined>;
|
|
173
|
+
/**
|
|
174
|
+
* Attach a pid and the executable verdict to every body in a census.
|
|
175
|
+
*
|
|
176
|
+
* Pure of side effects on the bodies themselves: it starts nothing, restarts
|
|
177
|
+
* nothing, and returns new rows. stdio-MCP bodies are skipped — their client
|
|
178
|
+
* owns them, nothing here can roll them, so asking costs a `ps` for no decision.
|
|
179
|
+
*/
|
|
180
|
+
export declare function markReplacedExecutables(bodies: ReadonlyArray<RollBody>, runtime: VibesRuntime, readers?: BodyProcessReaders): Promise<RollBody[]>;
|
|
181
|
+
/** The bodies that MUST be rolled: they execute a file that was replaced. */
|
|
182
|
+
export declare function bodiesRunningReplacedExecutable(bodies: ReadonlyArray<RollBody>): RollBody[];
|
|
183
|
+
/** Parse a restart receipt line into the pids it reported. */
|
|
184
|
+
export declare function parseRestartPids(output: string): {
|
|
185
|
+
previousPid: number;
|
|
186
|
+
pid: number;
|
|
187
|
+
} | {
|
|
188
|
+
pid: number;
|
|
189
|
+
previousPid?: undefined;
|
|
190
|
+
} | {
|
|
191
|
+
previousPid?: undefined;
|
|
192
|
+
pid?: undefined;
|
|
193
|
+
};
|
|
194
|
+
/** Who restarts one body in-process: PM's command, hq's service registry, or nobody. */
|
|
195
|
+
export type RollRoute = {
|
|
196
|
+
owner: 'pm';
|
|
197
|
+
commandId: 'pm.daemon.restart';
|
|
198
|
+
} | {
|
|
199
|
+
owner: 'hq';
|
|
200
|
+
serviceId: string;
|
|
201
|
+
};
|
|
202
|
+
/** The in-process route that rolls one body, or `null` when no owner can. */
|
|
203
|
+
export declare function rollRouteFor(body: RollBody): RollRoute | null;
|
|
204
|
+
/** The pids a restart receipt carried; the restart itself reported whether the main pid was replaced. */
|
|
205
|
+
interface RestartReceipt {
|
|
206
|
+
replaced: boolean;
|
|
207
|
+
previousPid?: number;
|
|
208
|
+
pid?: number;
|
|
209
|
+
}
|
|
210
|
+
/** What rolls a body: the two owners, injectable so a test fakes only the far boundary. */
|
|
211
|
+
export interface BodyRestarters {
|
|
212
|
+
restartPmDaemon(runtime: VibesRuntime, previousPid: number | undefined): Promise<RestartReceipt>;
|
|
213
|
+
restartHqService(runtime: VibesRuntime, serviceId: string): Promise<RestartReceipt>;
|
|
214
|
+
}
|
|
215
|
+
/** The production restarters: PM's own restart command and hq's service registry, both in this process. */
|
|
216
|
+
export declare const defaultRestarters: BodyRestarters;
|
|
217
|
+
/** What one roll pass reads. */
|
|
218
|
+
export interface RollInput {
|
|
219
|
+
runtime: VibesRuntime;
|
|
220
|
+
bodies: ReadonlyArray<RollBody>;
|
|
221
|
+
dryRun?: boolean;
|
|
222
|
+
restarters?: BodyRestarters;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Roll every body in the census, in order, and return one verified outcome per
|
|
226
|
+
* body. A body this host cannot roll produces a `NOT ROLLED` line naming the
|
|
227
|
+
* remedy; it is never omitted, and it never reads as success.
|
|
228
|
+
*/
|
|
229
|
+
export declare function rollBodies(input: RollInput): Promise<RollOutcome[]>;
|
|
230
|
+
//# sourceMappingURL=roll.d.ts.map
|
|
@@ -0,0 +1 @@
|
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