vite-plugin-agentation-vue 0.0.10 → 0.0.12

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 (61) hide show
  1. package/README.md +29 -9
  2. package/dist/ensure-server/health.d.ts +8 -0
  3. package/dist/ensure-server/health.d.ts.map +1 -0
  4. package/dist/ensure-server/health.js +55 -0
  5. package/dist/ensure-server/health.js.map +1 -0
  6. package/dist/ensure-server/index.d.ts +30 -0
  7. package/dist/ensure-server/index.d.ts.map +1 -0
  8. package/dist/ensure-server/index.js +466 -0
  9. package/dist/ensure-server/index.js.map +1 -0
  10. package/dist/ensure-server/index.test.d.ts +2 -0
  11. package/dist/ensure-server/index.test.d.ts.map +1 -0
  12. package/dist/ensure-server/index.test.js +172 -0
  13. package/dist/ensure-server/index.test.js.map +1 -0
  14. package/dist/ensure-server/spawn.d.ts +4 -0
  15. package/dist/ensure-server/spawn.d.ts.map +1 -0
  16. package/dist/ensure-server/spawn.js +30 -0
  17. package/dist/ensure-server/spawn.js.map +1 -0
  18. package/dist/plugin.d.ts.map +1 -1
  19. package/dist/plugin.js +80 -112
  20. package/dist/plugin.js.map +1 -1
  21. package/dist/plugin.test.js +123 -45
  22. package/dist/plugin.test.js.map +1 -1
  23. package/dist/runtime/agent.d.ts +6 -0
  24. package/dist/runtime/agent.d.ts.map +1 -0
  25. package/dist/runtime/agent.js +353 -0
  26. package/dist/runtime/agent.js.map +1 -0
  27. package/dist/runtime/agent.test.d.ts +2 -0
  28. package/dist/runtime/agent.test.d.ts.map +1 -0
  29. package/dist/runtime/agent.test.js +299 -0
  30. package/dist/runtime/agent.test.js.map +1 -0
  31. package/dist/runtime/bootstrap.d.ts +1 -1
  32. package/dist/runtime/bootstrap.d.ts.map +1 -1
  33. package/dist/runtime/bootstrap.js +14 -4
  34. package/dist/runtime/bootstrap.js.map +1 -1
  35. package/dist/runtime/bootstrap.test.js +17 -0
  36. package/dist/runtime/bootstrap.test.js.map +1 -1
  37. package/dist/runtime/entry.d.ts.map +1 -1
  38. package/dist/runtime/entry.js +11 -2
  39. package/dist/runtime/entry.js.map +1 -1
  40. package/dist/runtime/sync.d.ts +1 -1
  41. package/dist/runtime/sync.d.ts.map +1 -1
  42. package/dist/runtime/sync.js +175 -9
  43. package/dist/runtime/sync.js.map +1 -1
  44. package/dist/runtime/sync.test.d.ts +2 -0
  45. package/dist/runtime/sync.test.d.ts.map +1 -0
  46. package/dist/runtime/sync.test.js +374 -0
  47. package/dist/runtime/sync.test.js.map +1 -0
  48. package/dist/shared-server.d.ts +1 -1
  49. package/dist/shared-server.d.ts.map +1 -1
  50. package/dist/shared-server.js +2 -4
  51. package/dist/shared-server.js.map +1 -1
  52. package/dist/shared-server.test.js +2 -4
  53. package/dist/shared-server.test.js.map +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/dist/types.d.ts +17 -3
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/types.js +26 -20
  58. package/dist/types.js.map +1 -1
  59. package/dist/types.test.js +44 -1
  60. package/dist/types.test.js.map +1 -1
  61. package/package.json +4 -4
package/README.md CHANGED
@@ -37,7 +37,8 @@ The plugin automatically injects the annotation overlay in dev mode. It's disabl
37
37
  | `locale` | `"en" \| "zh-CN"` | `"en"` | Default UI locale |
38
38
  | `storagePrefix` | `string` | `"agentation-vue-"` | localStorage key prefix |
39
39
  | `outputDetail` | `"compact" \| "standard" \| "detailed" \| "forensic"` | `"standard"` | Level of detail in export output |
40
- | `sync` | `{ endpoint?: string, mcpEndpoint?: string, projectId?: string, autoSync?: boolean, debounceMs?: number, ensureServer?: boolean } \| false` | enabled in dev | Shared Agentation V2 sync + MCP workflow configuration |
40
+ | `sync` | `{ endpoint?: string, mcpEndpoint?: string, projectId?: string, autoSync?: boolean, debounceMs?: number, ensureServer?: boolean } \| false` | enabled in dev | Unified Agentation companion sync configuration |
41
+ | `agent` | `{ enabled?: boolean, autoSend?: boolean } \| false` | enabled in dev, `autoSend` off | Local ACP companion bridge and auto-dispatch defaults |
41
42
  | `inspector` | `"tracer"` | `"tracer"` | Source resolution strategy |
42
43
 
43
44
  ## Sync Configuration
@@ -55,9 +56,8 @@ To customize the shared Agentation server endpoints:
55
56
  ```ts
56
57
  agentation({
57
58
  sync: {
58
- endpoint: "http://localhost:4747",
59
- mcpEndpoint: "http://localhost:4748",
60
- projectId: "demo-app",
59
+ endpoint: "http://localhost:4748",
60
+ projectId: "demo-app", // defaults to the Vite root folder name
61
61
  autoSync: true, // default
62
62
  debounceMs: 400, // default
63
63
  ensureServer: true, // default
@@ -65,11 +65,31 @@ agentation({
65
65
  })
66
66
  ```
67
67
 
68
- When `ensureServer` is enabled, the plugin health-checks the configured ports,
69
- reuses an existing Agentation server if one is already running, and otherwise
70
- launches the bundled `agentation-vue-mcp` CLI with the current Node runtime
71
- during `vite dev`. If auto-start is unavailable, the plugin logs a warning and
72
- continues so you can start the server manually.
68
+ When `ensureServer` is enabled, the plugin health-checks the configured
69
+ companion endpoint, reuses an existing Agentation server if one is already
70
+ running, and otherwise launches the bundled `agentation-vue-mcp` CLI with the
71
+ current Node runtime during `vite dev`. If auto-start is unavailable, the
72
+ plugin logs a warning and continues so you can start the server manually.
73
+
74
+ ## Local Agent Bridge
75
+
76
+ The local agent bridge is enabled by default in dev and uses the shared
77
+ Agentation API as a companion process. Configure the UI default like this:
78
+
79
+ ```ts
80
+ agentation({
81
+ agent: {
82
+ enabled: true,
83
+ autoSend: false,
84
+ },
85
+ })
86
+ ```
87
+
88
+ Then initialize local ACP-compatible agents on your machine:
89
+
90
+ ```bash
91
+ agentation-vue-mcp agents init
92
+ ```
73
93
 
74
94
  ## Nuxt Setup
75
95
 
@@ -0,0 +1,8 @@
1
+ import type { AgentationVueSyncOptions } from "../types.ts";
2
+ export declare function normalizeUrl(input: string): string;
3
+ export declare function parsePort(input: string): number | null;
4
+ export declare function isServerHealthy(baseUrl: string): Promise<boolean>;
5
+ export declare function hasSessionEventsCapability(baseUrl: string): Promise<boolean>;
6
+ export declare function waitForSharedServer(endpoint: string, timeoutMs?: number): Promise<boolean>;
7
+ export declare function getEnsureServerKey(sync: AgentationVueSyncOptions): string;
8
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/ensure-server/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAE3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAStD;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CASvE;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBlF;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAO,GACf,OAAO,CAAC,OAAO,CAAC,CAWlB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,CAEzE"}
@@ -0,0 +1,55 @@
1
+ export function normalizeUrl(input) {
2
+ return input.replace(/\/+$/, "");
3
+ }
4
+ export function parsePort(input) {
5
+ try {
6
+ const url = new URL(input);
7
+ const fallback = url.protocol === "https:" ? 443 : 80;
8
+ const port = parseInt(url.port || String(fallback), 10);
9
+ return Number.isFinite(port) ? port : null;
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ }
15
+ export async function isServerHealthy(baseUrl) {
16
+ try {
17
+ const response = await fetch(`${normalizeUrl(baseUrl)}/health`, {
18
+ signal: AbortSignal.timeout(800),
19
+ });
20
+ return response.ok;
21
+ }
22
+ catch {
23
+ return false;
24
+ }
25
+ }
26
+ export async function hasSessionEventsCapability(baseUrl) {
27
+ try {
28
+ const response = await fetch(`${normalizeUrl(baseUrl)}/v2/sessions/__agentation_probe__/events`, { signal: AbortSignal.timeout(800) });
29
+ if (response.ok) {
30
+ return true;
31
+ }
32
+ if (response.status !== 404) {
33
+ return false;
34
+ }
35
+ const body = await response.text();
36
+ return body.includes("Session not found");
37
+ }
38
+ catch {
39
+ return false;
40
+ }
41
+ }
42
+ export async function waitForSharedServer(endpoint, timeoutMs = 8000) {
43
+ const startedAt = Date.now();
44
+ while (Date.now() - startedAt < timeoutMs) {
45
+ if (await isServerHealthy(endpoint)) {
46
+ return true;
47
+ }
48
+ await new Promise((resolve) => setTimeout(resolve, 350));
49
+ }
50
+ return false;
51
+ }
52
+ export function getEnsureServerKey(sync) {
53
+ return normalizeUrl(sync.endpoint);
54
+ }
55
+ //# sourceMappingURL=health.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/ensure-server/health.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAA;QACvD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CA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,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAA8B;IAC/D,OAAO,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACpC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { AgentationVueSyncOptions } from "../types.ts";
2
+ import { hasSessionEventsCapability, isServerHealthy, waitForSharedServer } from "./health.ts";
3
+ interface SharedCompanionInstanceMeta {
4
+ projectId?: string;
5
+ projectRoot?: string;
6
+ }
7
+ export interface SharedCompanionRegistration {
8
+ dispose(): Promise<void>;
9
+ }
10
+ interface SharedCompanionChildHandle {
11
+ pid?: number;
12
+ kill?(signal?: NodeJS.Signals | number): boolean;
13
+ once?(event: "error" | "exit", listener: (...args: any[]) => void): void;
14
+ }
15
+ interface EnsureSharedServerDeps {
16
+ registryRootDir: string;
17
+ createInstanceId(): string;
18
+ now(): number;
19
+ setInterval: typeof globalThis.setInterval;
20
+ clearInterval: typeof globalThis.clearInterval;
21
+ isServerHealthy: typeof isServerHealthy;
22
+ hasSessionEventsCapability: typeof hasSessionEventsCapability;
23
+ waitForSharedServer: typeof waitForSharedServer;
24
+ spawnSharedServer(port: number): SharedCompanionChildHandle | null;
25
+ isProcessAlive(pid: number): boolean;
26
+ killProcess(pid: number, signal?: NodeJS.Signals): boolean;
27
+ }
28
+ export declare function ensureSharedCompanionServer(sync: AgentationVueSyncOptions, log: (message: string, detail?: string) => void, meta?: SharedCompanionInstanceMeta, depsOverride?: Partial<EnsureSharedServerDeps>): Promise<SharedCompanionRegistration>;
29
+ export {};
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ensure-server/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO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AAI,EAC/C,IAAI,GAAE,2BAAgC,EACtC,YAAY,GAAE,OAAO,CAAC,sBAAsB,CAAM,GACjD,OAAO,CAAC,2BAA2B,CAAC,CAiBtC"}
@@ -0,0 +1,466 @@
1
+ import { randomUUID, createHash } from "node:crypto";
2
+ import { mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { dirname, join } from "node:path";
5
+ import { hasSessionEventsCapability, isServerHealthy, normalizeUrl, parsePort, waitForSharedServer, } from "./health.js";
6
+ import { spawnSharedServer } from "./spawn.js";
7
+ const COORDINATOR_VERSION = 1;
8
+ const LOCK_RETRY_MS = 60;
9
+ const LOCK_TIMEOUT_MS = 5000;
10
+ const STALE_LOCK_MS = 5000;
11
+ const WATCHDOG_INTERVAL_MS = 1500;
12
+ const defaultDeps = {
13
+ registryRootDir: join(tmpdir(), "agentation-vue", "shared-companion"),
14
+ createInstanceId: () => randomUUID(),
15
+ now: () => Date.now(),
16
+ setInterval: globalThis.setInterval.bind(globalThis),
17
+ clearInterval: globalThis.clearInterval.bind(globalThis),
18
+ isServerHealthy,
19
+ hasSessionEventsCapability,
20
+ waitForSharedServer,
21
+ spawnSharedServer,
22
+ isProcessAlive: (pid) => {
23
+ try {
24
+ process.kill(pid, 0);
25
+ return true;
26
+ }
27
+ catch {
28
+ return false;
29
+ }
30
+ },
31
+ killProcess: (pid, signal = "SIGTERM") => {
32
+ try {
33
+ process.kill(pid, signal);
34
+ return true;
35
+ }
36
+ catch {
37
+ return false;
38
+ }
39
+ },
40
+ };
41
+ export async function ensureSharedCompanionServer(sync, log, meta = {}, depsOverride = {}) {
42
+ if (sync.ensureServer === false) {
43
+ return { dispose: async () => { } };
44
+ }
45
+ const registration = new SharedCompanionCoordinator(sync, log, meta, {
46
+ ...defaultDeps,
47
+ ...depsOverride,
48
+ });
49
+ await registration.start();
50
+ return registration;
51
+ }
52
+ class SharedCompanionCoordinator {
53
+ endpoint;
54
+ instance;
55
+ registryPaths;
56
+ instanceLabel;
57
+ sync;
58
+ log;
59
+ deps;
60
+ disposed = false;
61
+ child = null;
62
+ watchdog = null;
63
+ reconcilePromise = null;
64
+ lastStateKey = null;
65
+ constructor(sync, log, meta, deps) {
66
+ this.sync = sync;
67
+ this.log = log;
68
+ this.deps = deps;
69
+ this.endpoint = normalizeUrl(sync.endpoint);
70
+ this.instanceLabel = formatInstanceLabel({
71
+ pid: process.pid,
72
+ projectId: meta.projectId?.trim() || undefined,
73
+ projectRoot: meta.projectRoot?.trim() || undefined,
74
+ });
75
+ const timestamp = this.toIso(this.deps.now());
76
+ this.instance = {
77
+ id: this.deps.createInstanceId(),
78
+ pid: process.pid,
79
+ projectId: meta.projectId?.trim() || undefined,
80
+ projectRoot: meta.projectRoot?.trim() || undefined,
81
+ createdAt: timestamp,
82
+ updatedAt: timestamp,
83
+ };
84
+ this.registryPaths = createRegistryPaths(this.endpoint, this.deps.registryRootDir);
85
+ }
86
+ async start() {
87
+ await this.updateRegistry((registry) => {
88
+ registry.instances[this.instance.id] = this.snapshotInstance();
89
+ });
90
+ await this.reconcile("initial");
91
+ this.watchdog = this.deps.setInterval(() => {
92
+ void this.reconcile("watchdog");
93
+ }, WATCHDOG_INTERVAL_MS);
94
+ if (typeof this.watchdog !== "number") {
95
+ this.watchdog.unref?.();
96
+ }
97
+ }
98
+ async dispose() {
99
+ if (this.disposed) {
100
+ return;
101
+ }
102
+ this.disposed = true;
103
+ if (this.watchdog) {
104
+ this.deps.clearInterval(this.watchdog);
105
+ this.watchdog = null;
106
+ }
107
+ const unregisterResult = await this.updateRegistry((registry) => {
108
+ const wasOwner = registry.ownerInstanceId === this.instance.id;
109
+ const childPid = wasOwner ? registry.childPid : undefined;
110
+ delete registry.instances[this.instance.id];
111
+ if (wasOwner) {
112
+ clearOwner(registry);
113
+ }
114
+ return {
115
+ wasOwner,
116
+ childPid,
117
+ remainingInstances: Object.keys(registry.instances).length,
118
+ };
119
+ });
120
+ if (unregisterResult.wasOwner) {
121
+ this.stopOwnedChild(unregisterResult.childPid);
122
+ this.report("shared companion owner stopped 🛑", `${this.endpoint} stoppedBy=${this.instanceLabel}`, `dispose:owner:${this.endpoint}`, true);
123
+ return;
124
+ }
125
+ this.report("shared companion detached ♻️", `${this.endpoint} detached=${this.instanceLabel}`, `dispose:shared:${this.endpoint}`, true);
126
+ }
127
+ async reconcile(trigger) {
128
+ if (this.disposed) {
129
+ return;
130
+ }
131
+ if (this.reconcilePromise) {
132
+ return this.reconcilePromise;
133
+ }
134
+ const reconcilePromise = this.reconcileOnce(trigger)
135
+ .catch((error) => {
136
+ this.report("shared companion coordinator failed ⚠️", error instanceof Error ? error.message : String(error), `error:${this.endpoint}`, true);
137
+ })
138
+ .finally(() => {
139
+ this.reconcilePromise = null;
140
+ });
141
+ this.reconcilePromise = reconcilePromise;
142
+ return reconcilePromise;
143
+ }
144
+ async reconcileOnce(trigger) {
145
+ await this.updateRegistry((registry) => {
146
+ registry.instances[this.instance.id] = this.snapshotInstance();
147
+ });
148
+ if (this.disposed) {
149
+ return;
150
+ }
151
+ const healthy = await this.deps.isServerHealthy(this.endpoint);
152
+ const compatible = healthy ? await this.deps.hasSessionEventsCapability(this.endpoint) : false;
153
+ if (this.disposed) {
154
+ return;
155
+ }
156
+ const registry = await this.readRegistry();
157
+ const owner = resolveOwner(registry);
158
+ if (healthy && compatible) {
159
+ if (owner?.id === this.instance.id) {
160
+ if (trigger === "child-exit") {
161
+ this.report("shared companion restarted ✅", `${this.endpoint} startedBy=${this.instanceLabel}`, `healthy:owner:${this.endpoint}`, true);
162
+ return;
163
+ }
164
+ this.report("shared companion running ✅", `${this.endpoint} startedBy=${this.instanceLabel}`, `healthy:owner:${this.endpoint}`);
165
+ return;
166
+ }
167
+ if (owner) {
168
+ this.report("shared companion reused ♻️", `${this.endpoint} owner=${formatInstanceLabel(owner)} requestedBy=${this.instanceLabel}`, `healthy:shared:${owner.id}`);
169
+ return;
170
+ }
171
+ this.report("shared companion reused ♻️", `${this.endpoint} owner=external-service (not tracked by agentation-vue) requestedBy=${this.instanceLabel}`, `healthy:external:${this.endpoint}`);
172
+ return;
173
+ }
174
+ if (healthy && !compatible) {
175
+ if (owner?.id === this.instance.id) {
176
+ this.stopOwnedChild();
177
+ await this.releaseOwnership();
178
+ }
179
+ this.report("shared companion incompatible ⚠️", `${this.endpoint} answered /health but is missing the required /v2 session event API`, `incompatible:${this.endpoint}`);
180
+ return;
181
+ }
182
+ const port = parsePort(this.endpoint);
183
+ if (port == null) {
184
+ this.report("shared companion auto-start skipped ⚠️", "sync.endpoint must include an explicit port", `invalid-port:${this.endpoint}`);
185
+ return;
186
+ }
187
+ const claim = await this.updateRegistry((current) => {
188
+ current.instances[this.instance.id] = this.snapshotInstance();
189
+ const activeOwner = resolveOwner(current);
190
+ if (activeOwner && activeOwner.id !== this.instance.id) {
191
+ return {
192
+ claimed: false,
193
+ owner: activeOwner,
194
+ };
195
+ }
196
+ current.ownerInstanceId = this.instance.id;
197
+ current.ownerPid = this.instance.pid;
198
+ current.ownerProjectId = this.instance.projectId;
199
+ current.ownerProjectRoot = this.instance.projectRoot;
200
+ current.childPid = undefined;
201
+ return {
202
+ claimed: true,
203
+ owner: this.snapshotInstance(),
204
+ };
205
+ });
206
+ if (!claim.claimed) {
207
+ this.report("shared companion startup deferred ♻️", `${this.endpoint} waitingFor=${formatInstanceLabel(claim.owner)} requestedBy=${this.instanceLabel}`, `deferred:${claim.owner.id}`);
208
+ return;
209
+ }
210
+ if (this.disposed) {
211
+ await this.releaseOwnership();
212
+ return;
213
+ }
214
+ const child = this.deps.spawnSharedServer(port);
215
+ if (!child) {
216
+ await this.releaseOwnership();
217
+ this.report("shared companion auto-start skipped ⚠️", "agentation-vue-mcp CLI not found; install the dependency or start the server manually", `cli-missing:${this.endpoint}`);
218
+ return;
219
+ }
220
+ this.attachChild(child);
221
+ await this.updateRegistry((registry) => {
222
+ if (registry.ownerInstanceId === this.instance.id) {
223
+ registry.childPid = child.pid;
224
+ }
225
+ });
226
+ const ready = await this.deps.waitForSharedServer(this.endpoint);
227
+ const compatibleAfterWait = ready
228
+ ? await this.deps.hasSessionEventsCapability(this.endpoint)
229
+ : false;
230
+ if (this.disposed) {
231
+ this.stopOwnedChild(child.pid);
232
+ await this.releaseOwnership();
233
+ return;
234
+ }
235
+ if (!ready || !compatibleAfterWait) {
236
+ this.stopOwnedChild(child.pid);
237
+ await this.releaseOwnership();
238
+ if (!ready) {
239
+ this.report("shared companion still starting ⏳", "health checks not ready yet; if this persists, start agentation-vue-mcp server manually", `starting:${this.endpoint}`);
240
+ return;
241
+ }
242
+ this.report("shared companion incompatible ⚠️", `${this.endpoint} answered /health but is missing the required /v2 session event API`, `incompatible:${this.endpoint}`);
243
+ return;
244
+ }
245
+ this.report(trigger === "initial" ? "shared companion started ✅" : "shared companion restarted ✅", `${this.endpoint} startedBy=${this.instanceLabel}`, `healthy:owner:${this.endpoint}`, true);
246
+ }
247
+ attachChild(child) {
248
+ this.child = child;
249
+ child.once?.("error", (error) => {
250
+ this.report("shared companion child error ⚠️", error instanceof Error ? error.message : String(error), `child-error:${this.endpoint}`, true);
251
+ });
252
+ child.once?.("exit", (_code, signal) => {
253
+ if (this.child === child) {
254
+ this.child = null;
255
+ }
256
+ if (this.disposed) {
257
+ return;
258
+ }
259
+ this.report("shared companion exited ⚠️", `${this.endpoint} startedBy=${this.instanceLabel}${signal ? ` signal=${String(signal)}` : ""}`, `child-exit:${this.endpoint}`, true);
260
+ void this.reconcile("child-exit");
261
+ });
262
+ }
263
+ stopOwnedChild(fallbackPid) {
264
+ const child = this.child;
265
+ this.child = null;
266
+ if (child?.kill) {
267
+ try {
268
+ child.kill("SIGTERM");
269
+ return;
270
+ }
271
+ catch {
272
+ // Fall through to a PID kill if available.
273
+ }
274
+ }
275
+ const pid = child?.pid ?? fallbackPid;
276
+ if (pid) {
277
+ this.deps.killProcess(pid, "SIGTERM");
278
+ }
279
+ }
280
+ async releaseOwnership() {
281
+ await this.updateRegistry((registry) => {
282
+ if (registry.ownerInstanceId === this.instance.id) {
283
+ clearOwner(registry);
284
+ }
285
+ });
286
+ }
287
+ async readRegistry() {
288
+ return this.updateRegistry((registry) => cloneRegistry(registry));
289
+ }
290
+ async updateRegistry(mutate) {
291
+ return withRegistryLock(this.registryPaths, async () => {
292
+ const registry = pruneRegistry(readRegistryFile(this.registryPaths.file, this.endpoint), this.deps.isProcessAlive);
293
+ const result = mutate(registry);
294
+ persistRegistry(this.registryPaths.file, registry);
295
+ return result;
296
+ });
297
+ }
298
+ snapshotInstance() {
299
+ return {
300
+ ...this.instance,
301
+ updatedAt: this.toIso(this.deps.now()),
302
+ };
303
+ }
304
+ report(message, detail, stateKey, force = false) {
305
+ if (!force && this.lastStateKey === stateKey) {
306
+ return;
307
+ }
308
+ this.lastStateKey = stateKey;
309
+ this.log(message, detail);
310
+ }
311
+ toIso(value) {
312
+ return new Date(value).toISOString();
313
+ }
314
+ }
315
+ function createRegistryPaths(endpoint, rootDir) {
316
+ const key = createHash("sha1").update(endpoint).digest("hex");
317
+ return {
318
+ file: join(rootDir, `${key}.json`),
319
+ lock: join(rootDir, `${key}.lock`),
320
+ };
321
+ }
322
+ function formatInstanceLabel(instance) {
323
+ const primary = instance.projectId
324
+ || instance.projectRoot
325
+ || `pid=${instance.pid}`;
326
+ const details = [`pid=${instance.pid}`];
327
+ if (instance.projectRoot && instance.projectRoot !== instance.projectId) {
328
+ details.push(`root=${instance.projectRoot}`);
329
+ }
330
+ if (primary === `pid=${instance.pid}`) {
331
+ return primary;
332
+ }
333
+ return `${primary} (${details.join(", ")})`;
334
+ }
335
+ function createEmptyRegistry(endpoint) {
336
+ return {
337
+ version: COORDINATOR_VERSION,
338
+ endpoint,
339
+ instances: {},
340
+ };
341
+ }
342
+ function clearOwner(registry) {
343
+ delete registry.ownerInstanceId;
344
+ delete registry.ownerPid;
345
+ delete registry.ownerProjectId;
346
+ delete registry.ownerProjectRoot;
347
+ delete registry.childPid;
348
+ }
349
+ function resolveOwner(registry) {
350
+ if (!registry.ownerInstanceId) {
351
+ return null;
352
+ }
353
+ return registry.instances[registry.ownerInstanceId] ?? null;
354
+ }
355
+ function readRegistryFile(file, endpoint) {
356
+ try {
357
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
358
+ return normalizeRegistry(parsed, endpoint);
359
+ }
360
+ catch {
361
+ return createEmptyRegistry(endpoint);
362
+ }
363
+ }
364
+ function normalizeRegistry(raw, endpoint) {
365
+ const instances = {};
366
+ for (const [id, instance] of Object.entries(raw.instances ?? {})) {
367
+ const typed = instance;
368
+ if (!typed || typeof typed.pid !== "number") {
369
+ continue;
370
+ }
371
+ instances[id] = {
372
+ id,
373
+ pid: typed.pid,
374
+ projectId: typed.projectId?.trim() || undefined,
375
+ projectRoot: typed.projectRoot?.trim() || undefined,
376
+ createdAt: typed.createdAt || new Date(0).toISOString(),
377
+ updatedAt: typed.updatedAt || new Date(0).toISOString(),
378
+ };
379
+ }
380
+ const normalized = {
381
+ version: COORDINATOR_VERSION,
382
+ endpoint,
383
+ instances,
384
+ };
385
+ if (typeof raw.ownerInstanceId === "string") {
386
+ normalized.ownerInstanceId = raw.ownerInstanceId;
387
+ }
388
+ if (typeof raw.ownerPid === "number") {
389
+ normalized.ownerPid = raw.ownerPid;
390
+ }
391
+ if (typeof raw.ownerProjectId === "string" && raw.ownerProjectId.trim()) {
392
+ normalized.ownerProjectId = raw.ownerProjectId.trim();
393
+ }
394
+ if (typeof raw.ownerProjectRoot === "string" && raw.ownerProjectRoot.trim()) {
395
+ normalized.ownerProjectRoot = raw.ownerProjectRoot.trim();
396
+ }
397
+ if (typeof raw.childPid === "number") {
398
+ normalized.childPid = raw.childPid;
399
+ }
400
+ return normalized;
401
+ }
402
+ function pruneRegistry(registry, isProcessAlive) {
403
+ for (const [id, instance] of Object.entries(registry.instances)) {
404
+ if (!isProcessAlive(instance.pid)) {
405
+ delete registry.instances[id];
406
+ }
407
+ }
408
+ if (registry.ownerInstanceId && !registry.instances[registry.ownerInstanceId]) {
409
+ clearOwner(registry);
410
+ }
411
+ return registry;
412
+ }
413
+ function cloneRegistry(registry) {
414
+ return {
415
+ ...registry,
416
+ instances: Object.fromEntries(Object.entries(registry.instances).map(([id, instance]) => [id, { ...instance }])),
417
+ };
418
+ }
419
+ function persistRegistry(file, registry) {
420
+ mkdirSync(dirname(file), { recursive: true });
421
+ if (!registry.ownerInstanceId && Object.keys(registry.instances).length === 0) {
422
+ rmSync(file, { force: true });
423
+ return;
424
+ }
425
+ writeFileSync(file, JSON.stringify(registry, null, 2));
426
+ }
427
+ async function withRegistryLock(paths, task) {
428
+ mkdirSync(dirname(paths.file), { recursive: true });
429
+ const startedAt = Date.now();
430
+ while (true) {
431
+ try {
432
+ mkdirSync(paths.lock);
433
+ break;
434
+ }
435
+ catch (error) {
436
+ const err = error;
437
+ if (err.code !== "EEXIST") {
438
+ throw error;
439
+ }
440
+ try {
441
+ const age = Date.now() - statSync(paths.lock).mtimeMs;
442
+ if (age > STALE_LOCK_MS) {
443
+ rmSync(paths.lock, { recursive: true, force: true });
444
+ continue;
445
+ }
446
+ }
447
+ catch {
448
+ // Ignore transient stat/unlink races and retry.
449
+ }
450
+ if (Date.now() - startedAt >= LOCK_TIMEOUT_MS) {
451
+ throw new Error(`Timed out waiting for the shared companion lock at ${paths.lock}`);
452
+ }
453
+ await wait(LOCK_RETRY_MS);
454
+ }
455
+ }
456
+ try {
457
+ return await task();
458
+ }
459
+ finally {
460
+ rmSync(paths.lock, { recursive: true, force: true });
461
+ }
462
+ }
463
+ function wait(ms) {
464
+ return new Promise((resolve) => setTimeout(resolve, ms));
465
+ }
466
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ensure-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EA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