@w3kits-com/plugin-opendesign 0.1.10 → 0.1.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 (125) hide show
  1. package/dist/404/index.html +1 -1
  2. package/dist/404.html +1 -1
  3. package/dist/__next.$oc$slug.__PAGE__.txt +1 -1
  4. package/dist/__next.$oc$slug.txt +1 -1
  5. package/dist/__next._full.txt +1 -1
  6. package/dist/__next._head.txt +1 -1
  7. package/dist/__next._index.txt +1 -1
  8. package/dist/__next._tree.txt +1 -1
  9. package/dist/__w3kits/webcontainer-runtime/package.json +6 -1
  10. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/browser-vfs/dist/index.d.ts +108 -0
  11. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/browser-vfs/dist/index.d.ts.map +1 -0
  12. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/browser-vfs/dist/index.mjs +413 -0
  13. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/browser-vfs/package.json +12 -0
  14. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/artifact-id.d.ts +5 -0
  15. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/artifact-id.d.ts.map +1 -0
  16. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/events.d.ts +250 -0
  17. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/events.d.ts.map +1 -0
  18. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/index.d.ts +4 -0
  19. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/index.d.ts.map +1 -0
  20. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/index.mjs +186 -0
  21. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/public-params.d.ts +26 -0
  22. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/analytics/public-params.d.ts.map +1 -0
  23. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/app-config.d.ts +44 -0
  24. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/app-config.d.ts.map +1 -0
  25. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/artifacts.d.ts +34 -0
  26. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/artifacts.d.ts.map +1 -0
  27. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/chat.d.ts +158 -0
  28. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/chat.d.ts.map +1 -0
  29. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/comments.d.ts +65 -0
  30. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/comments.d.ts.map +1 -0
  31. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/connectionTest.d.ts +49 -0
  32. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/connectionTest.d.ts.map +1 -0
  33. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/connectionTest.mjs +83 -0
  34. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/connectors.d.ts +133 -0
  35. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/connectors.d.ts.map +1 -0
  36. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/files.d.ts +43 -0
  37. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/files.d.ts.map +1 -0
  38. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/finalize.d.ts +50 -0
  39. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/finalize.d.ts.map +1 -0
  40. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/finalize.mjs +5 -0
  41. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/live-artifacts.d.ts +151 -0
  42. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/live-artifacts.d.ts.map +1 -0
  43. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/mcp.d.ts +117 -0
  44. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/mcp.d.ts.map +1 -0
  45. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/memory.d.ts +233 -0
  46. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/memory.d.ts.map +1 -0
  47. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/orbit.d.ts +22 -0
  48. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/orbit.d.ts.map +1 -0
  49. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/orbit.mjs +0 -0
  50. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/projects.d.ts +286 -0
  51. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/projects.d.ts.map +1 -0
  52. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/providerModels.d.ts +19 -0
  53. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/providerModels.d.ts.map +1 -0
  54. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/providerModels.mjs +0 -0
  55. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/proxy.d.ts +24 -0
  56. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/proxy.d.ts.map +1 -0
  57. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/registry.d.ts +156 -0
  58. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/registry.d.ts.map +1 -0
  59. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/research.d.ts +35 -0
  60. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/research.d.ts.map +1 -0
  61. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/research.mjs +9 -0
  62. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/routines.d.ts +104 -0
  63. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/routines.d.ts.map +1 -0
  64. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/version.d.ts +11 -0
  65. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/api/version.d.ts.map +1 -0
  66. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/common.d.ts +33 -0
  67. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/common.d.ts.map +1 -0
  68. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/critique.d.ts +344 -0
  69. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/critique.d.ts.map +1 -0
  70. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/critique.mjs +182 -0
  71. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/errors.d.ts +40 -0
  72. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/errors.d.ts.map +1 -0
  73. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/examples.d.ts +20 -0
  74. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/examples.d.ts.map +1 -0
  75. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/index.d.ts +31 -0
  76. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/index.d.ts.map +1 -0
  77. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/index.mjs +2072 -0
  78. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/deck-framework.d.ts +39 -0
  79. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/deck-framework.d.ts.map +1 -0
  80. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/directions.d.ts +69 -0
  81. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/directions.d.ts.map +1 -0
  82. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/discovery.d.ts +2 -0
  83. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/discovery.d.ts.map +1 -0
  84. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/media-contract.d.ts +2 -0
  85. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/media-contract.d.ts.map +1 -0
  86. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/official-system.d.ts +12 -0
  87. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/official-system.d.ts.map +1 -0
  88. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/system.d.ts +58 -0
  89. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/prompts/system.d.ts.map +1 -0
  90. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/chat.d.ts +96 -0
  91. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/chat.d.ts.map +1 -0
  92. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/common.d.ts +8 -0
  93. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/common.d.ts.map +1 -0
  94. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/proxy.d.ts +6 -0
  95. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/sse/proxy.d.ts.map +1 -0
  96. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/tasks.d.ts +12 -0
  97. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/dist/tasks.d.ts.map +1 -0
  98. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/contracts/package.json +40 -0
  99. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/platform/dist/index.d.ts +68 -0
  100. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/platform/dist/index.d.ts.map +1 -0
  101. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/platform/dist/index.mjs +397 -0
  102. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/platform/package.json +12 -0
  103. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar/dist/index.d.ts +144 -0
  104. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar/dist/index.d.ts.map +1 -0
  105. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar/dist/index.mjs +412 -0
  106. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar/package.json +12 -0
  107. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar-proto/dist/index.d.ts +291 -0
  108. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar-proto/dist/index.d.ts.map +1 -0
  109. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar-proto/dist/index.mjs +315 -0
  110. package/dist/__w3kits/webcontainer-runtime/workspace-packages/@open-design/sidecar-proto/package.json +12 -0
  111. package/dist/_not-found/__next._full.txt +1 -1
  112. package/dist/_not-found/__next._head.txt +1 -1
  113. package/dist/_not-found/__next._index.txt +1 -1
  114. package/dist/_not-found/__next._not-found.__PAGE__.txt +1 -1
  115. package/dist/_not-found/__next._not-found.txt +1 -1
  116. package/dist/_not-found/__next._tree.txt +1 -1
  117. package/dist/_not-found/index.html +1 -1
  118. package/dist/_not-found/index.txt +1 -1
  119. package/dist/browser-daemon.js +20 -0
  120. package/dist/index.html +1 -1
  121. package/dist/index.txt +1 -1
  122. package/package.json +1 -1
  123. /package/dist/_next/static/{zDhAhlvmD2uhNsdWY6CQB → 5BA5jEbmoqCfBPFzdjNtN}/_buildManifest.js +0 -0
  124. /package/dist/_next/static/{zDhAhlvmD2uhNsdWY6CQB → 5BA5jEbmoqCfBPFzdjNtN}/_clientMiddlewareManifest.js +0 -0
  125. /package/dist/_next/static/{zDhAhlvmD2uhNsdWY6CQB → 5BA5jEbmoqCfBPFzdjNtN}/_ssgManifest.js +0 -0
@@ -0,0 +1,397 @@
1
+ // src/index.ts
2
+ import { execFile, spawn } from "node:child_process";
3
+ import { existsSync, readdirSync } from "node:fs";
4
+ import { readFile } from "node:fs/promises";
5
+ import { homedir } from "node:os";
6
+ import { isAbsolute, join } from "node:path";
7
+ import { setTimeout as sleep } from "node:timers/promises";
8
+ function createProcessStampArgs(stamp, contract) {
9
+ const normalized = contract.normalizeStamp(stamp);
10
+ return contract.stampFields.map((field) => {
11
+ const value = normalized[field];
12
+ if (typeof value !== "string") {
13
+ throw new Error(`process stamp field ${field} must normalize to a string`);
14
+ }
15
+ return `${contract.stampFlags[field]}=${value}`;
16
+ });
17
+ }
18
+ function commandArgs(command) {
19
+ return command.trim().split(/\s+/).filter((part) => part.length > 0);
20
+ }
21
+ function readFlagValue(args, flagName) {
22
+ const inlinePrefix = `${flagName}=`;
23
+ for (let index = 0; index < args.length; index += 1) {
24
+ const argument = args[index];
25
+ if (argument === flagName) return args[index + 1] ?? null;
26
+ if (typeof argument === "string" && argument.startsWith(inlinePrefix)) {
27
+ return argument.slice(inlinePrefix.length);
28
+ }
29
+ }
30
+ return null;
31
+ }
32
+ function readProcessStamp(args, contract) {
33
+ try {
34
+ const input = Object.fromEntries(
35
+ contract.stampFields.map((field) => [field, readFlagValue(args, contract.stampFlags[field])])
36
+ );
37
+ return contract.normalizeStamp(input);
38
+ } catch {
39
+ return null;
40
+ }
41
+ }
42
+ function readProcessStampFromCommand(command, contract) {
43
+ return readProcessStamp(commandArgs(command), contract);
44
+ }
45
+ function matchesProcessStamp(stamp, criteria, contract) {
46
+ const normalizedStamp = contract.normalizeStamp(stamp);
47
+ const normalizedCriteria = contract.normalizeStampCriteria(criteria ?? {});
48
+ return contract.stampFields.every((field) => {
49
+ const expected = normalizedCriteria[field];
50
+ return expected == null || normalizedStamp[field] === expected;
51
+ });
52
+ }
53
+ function matchesStampedProcess(processInfo, criteria, contract) {
54
+ const stamp = readProcessStampFromCommand(processInfo.command, contract);
55
+ return stamp != null && matchesProcessStamp(stamp, criteria, contract);
56
+ }
57
+ function errorCode(error) {
58
+ if (typeof error !== "object" || error == null || !("code" in error)) return null;
59
+ const code = error.code;
60
+ return code == null ? null : String(code);
61
+ }
62
+ function errorMessage(error) {
63
+ return error instanceof Error ? error.message : String(error);
64
+ }
65
+ function quoteWindowsCommandArg(value) {
66
+ if (!/[\s"&<>|^%]/.test(value)) return value;
67
+ const escaped = value.replace(/"/g, '""').replace(/%/g, '"^%"');
68
+ return `"${escaped}"`;
69
+ }
70
+ function buildCmdShimInvocation(command, args, env) {
71
+ const inner = [command, ...args].map(quoteWindowsCommandArg).join(" ");
72
+ return {
73
+ args: ["/d", "/s", "/c", `"${inner}"`],
74
+ command: env.ComSpec ?? process.env.ComSpec ?? "cmd.exe",
75
+ windowsVerbatimArguments: true
76
+ };
77
+ }
78
+ function createCommandInvocation({ args = [], command, env = process.env }) {
79
+ if (process.platform === "win32" && /\.(bat|cmd)$/i.test(command)) {
80
+ return buildCmdShimInvocation(command, args, env);
81
+ }
82
+ return { args, command };
83
+ }
84
+ function createPackageManagerInvocation(args, env = process.env) {
85
+ const execPath = env.npm_execpath;
86
+ if (execPath) return { args: [execPath, ...args], command: process.execPath };
87
+ if (process.platform === "win32") {
88
+ return buildCmdShimInvocation("pnpm", args, env);
89
+ }
90
+ return { args, command: "pnpm" };
91
+ }
92
+ function createLoggedStdio(logFd) {
93
+ return logFd == null ? ["ignore", "ignore", "ignore"] : ["ignore", logFd, logFd];
94
+ }
95
+ async function waitForChildSpawn(child) {
96
+ await new Promise((resolveSpawn, rejectSpawn) => {
97
+ child.once("error", rejectSpawn);
98
+ child.once("spawn", resolveSpawn);
99
+ });
100
+ }
101
+ async function spawnBackgroundProcess(request) {
102
+ const invocation = createCommandInvocation(request);
103
+ const child = spawn(invocation.command, invocation.args, {
104
+ cwd: request.cwd,
105
+ detached: request.detached ?? true,
106
+ env: request.env,
107
+ stdio: createLoggedStdio(request.logFd),
108
+ windowsHide: process.platform === "win32",
109
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments
110
+ });
111
+ await waitForChildSpawn(child);
112
+ if (child.pid == null) throw new Error(`failed to spawn background process: ${invocation.command}`);
113
+ child.unref();
114
+ return { pid: child.pid };
115
+ }
116
+ async function spawnLoggedProcess(request) {
117
+ const invocation = createCommandInvocation(request);
118
+ const child = spawn(invocation.command, invocation.args, {
119
+ cwd: request.cwd,
120
+ detached: request.detached ?? false,
121
+ env: request.env,
122
+ stdio: createLoggedStdio(request.logFd),
123
+ windowsHide: process.platform === "win32",
124
+ windowsVerbatimArguments: invocation.windowsVerbatimArguments
125
+ });
126
+ await waitForChildSpawn(child);
127
+ if (child.pid == null) throw new Error(`failed to spawn process: ${invocation.command}`);
128
+ return child;
129
+ }
130
+ function isProcessAlive(pid) {
131
+ if (typeof pid !== "number") return false;
132
+ try {
133
+ process.kill(pid, 0);
134
+ return true;
135
+ } catch (error) {
136
+ if (errorCode(error) === "ESRCH") return false;
137
+ return true;
138
+ }
139
+ }
140
+ async function waitForProcessExit(pid, timeoutMs = 5e3) {
141
+ const startedAt = Date.now();
142
+ while (Date.now() - startedAt < timeoutMs) {
143
+ if (!isProcessAlive(pid)) return true;
144
+ await sleep(100);
145
+ }
146
+ return !isProcessAlive(pid);
147
+ }
148
+ function parsePsOutput(stdout) {
149
+ return stdout.split(/\r?\n/).map((line) => {
150
+ const match = line.match(/^\s*(\d+)\s+(\d+)\s+(.+)$/);
151
+ if (!match) return null;
152
+ return { pid: Number(match[1]), ppid: Number(match[2]), command: match[3] };
153
+ }).filter((snapshot) => snapshot != null);
154
+ }
155
+ async function listPosixProcessSnapshots() {
156
+ const stdout = await new Promise((resolveList, rejectList) => {
157
+ execFile("ps", ["-axo", "pid=,ppid=,command="], { encoding: "utf8", maxBuffer: 8 * 1024 * 1024 }, (error, out) => {
158
+ if (error) rejectList(error);
159
+ else resolveList(out);
160
+ });
161
+ });
162
+ return parsePsOutput(stdout);
163
+ }
164
+ async function listWindowsProcessSnapshots() {
165
+ const command = [
166
+ "$ErrorActionPreference = 'Stop'",
167
+ "Get-CimInstance Win32_Process | Select-Object ProcessId, ParentProcessId, CommandLine | ConvertTo-Json -Compress"
168
+ ].join("; ");
169
+ const stdout = await new Promise((resolveList, rejectList) => {
170
+ execFile("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", command], { encoding: "utf8", maxBuffer: 8 * 1024 * 1024 }, (error, out) => {
171
+ if (error) rejectList(error);
172
+ else resolveList(out);
173
+ });
174
+ });
175
+ const payload = stdout.trim();
176
+ if (!payload) return [];
177
+ const records = JSON.parse(payload);
178
+ return (Array.isArray(records) ? records : [records]).map((record) => {
179
+ const pid = Number(record.ProcessId);
180
+ const ppid = Number(record.ParentProcessId);
181
+ const commandLine = record.CommandLine?.trim();
182
+ if (!commandLine || Number.isNaN(pid) || Number.isNaN(ppid)) return null;
183
+ return { command: commandLine, pid, ppid };
184
+ }).filter((snapshot) => snapshot != null);
185
+ }
186
+ async function listProcessSnapshots() {
187
+ try {
188
+ return process.platform === "win32" ? await listWindowsProcessSnapshots() : await listPosixProcessSnapshots();
189
+ } catch {
190
+ return [];
191
+ }
192
+ }
193
+ function collectProcessTreePids(processes, rootPids) {
194
+ const queue = [...new Set(rootPids.filter((pid) => typeof pid === "number"))];
195
+ const visited = /* @__PURE__ */ new Set();
196
+ const childrenByParent = /* @__PURE__ */ new Map();
197
+ for (const processInfo of processes) {
198
+ const children = childrenByParent.get(processInfo.ppid) ?? [];
199
+ children.push(processInfo.pid);
200
+ childrenByParent.set(processInfo.ppid, children);
201
+ }
202
+ while (queue.length > 0) {
203
+ const pid = queue.shift();
204
+ if (pid == null || visited.has(pid)) continue;
205
+ visited.add(pid);
206
+ for (const childPid of childrenByParent.get(pid) ?? []) {
207
+ if (!visited.has(childPid)) queue.push(childPid);
208
+ }
209
+ }
210
+ return [...visited].sort((left, right) => right - left);
211
+ }
212
+ function signalProcesses(pids, signal) {
213
+ for (const pid of pids) {
214
+ try {
215
+ process.kill(pid, signal);
216
+ } catch (error) {
217
+ if (errorCode(error) !== "ESRCH") throw error;
218
+ }
219
+ }
220
+ }
221
+ async function waitForProcessesToExit(pids, timeoutMs = 5e3) {
222
+ const startedAt = Date.now();
223
+ while (Date.now() - startedAt < timeoutMs) {
224
+ const remaining = pids.filter(isProcessAlive);
225
+ if (remaining.length === 0) return [];
226
+ await sleep(100);
227
+ }
228
+ return pids.filter(isProcessAlive);
229
+ }
230
+ async function stopProcesses(pids) {
231
+ const uniquePids = [...new Set(pids)].filter((pid) => typeof pid === "number" && pid !== process.pid).sort((left, right) => right - left);
232
+ if (uniquePids.length === 0) {
233
+ return { alreadyStopped: true, forcedPids: [], matchedPids: [], remainingPids: [], stoppedPids: [] };
234
+ }
235
+ signalProcesses(uniquePids, "SIGTERM");
236
+ const remainingAfterTerm = await waitForProcessesToExit(uniquePids);
237
+ if (remainingAfterTerm.length === 0) {
238
+ return { alreadyStopped: false, forcedPids: [], matchedPids: uniquePids, remainingPids: [], stoppedPids: uniquePids };
239
+ }
240
+ signalProcesses(remainingAfterTerm, "SIGKILL");
241
+ const remainingAfterKill = await waitForProcessesToExit(remainingAfterTerm);
242
+ const stoppedPids = uniquePids.filter((pid) => !remainingAfterKill.includes(pid));
243
+ return { alreadyStopped: false, forcedPids: remainingAfterTerm, matchedPids: uniquePids, remainingPids: remainingAfterKill, stoppedPids };
244
+ }
245
+ async function waitForHttpOk(url, { timeoutMs = 2e4 } = {}) {
246
+ const startedAt = Date.now();
247
+ let lastError = null;
248
+ while (Date.now() - startedAt < timeoutMs) {
249
+ try {
250
+ const response = await fetch(url, { cache: "no-store" });
251
+ if (response.ok) return true;
252
+ lastError = new Error(`HTTP ${response.status} from ${url}`);
253
+ } catch (error) {
254
+ lastError = new Error(errorMessage(error));
255
+ }
256
+ await sleep(150);
257
+ }
258
+ throw new Error(`timed out waiting for ${url}${lastError ? ` (${lastError.message})` : ""}`);
259
+ }
260
+ async function readLogTail(filePath, maxLines = 80) {
261
+ try {
262
+ const payload = await readFile(filePath, "utf8");
263
+ return payload.split(/\r?\n/).filter((line) => line.length > 0).slice(-maxLines);
264
+ } catch {
265
+ return [];
266
+ }
267
+ }
268
+ function resolveUserScopedHome(raw, home) {
269
+ if (typeof raw !== "string") return null;
270
+ const value = raw.trim();
271
+ if (value.length === 0) return null;
272
+ if (value === "~") return home;
273
+ if (value.startsWith("~/") || value.startsWith("~\\")) {
274
+ return join(home, value.slice(2));
275
+ }
276
+ return isAbsolute(value) ? value : null;
277
+ }
278
+ function wellKnownUserToolchainBins(options = {}) {
279
+ const home = options.home ?? homedir();
280
+ const includeSystemBins = options.includeSystemBins ?? process.platform !== "win32";
281
+ const env = options.env ?? process.env;
282
+ const dirs = [];
283
+ const vpHome = resolveUserScopedHome(env.VP_HOME, home);
284
+ if (vpHome) {
285
+ dirs.push(join(vpHome, "bin"));
286
+ }
287
+ const npmPrefixRaw = env.NPM_CONFIG_PREFIX ?? env.npm_config_prefix;
288
+ if (typeof npmPrefixRaw === "string") {
289
+ const npmPrefix = npmPrefixRaw.trim();
290
+ if (npmPrefix.length > 0) {
291
+ dirs.push(join(npmPrefix, "bin"));
292
+ }
293
+ }
294
+ dirs.push(
295
+ join(home, ".local", "bin"),
296
+ join(home, ".vite-plus", "bin"),
297
+ join(home, ".opencode", "bin"),
298
+ join(home, ".bun", "bin"),
299
+ join(home, ".volta", "bin"),
300
+ join(home, ".asdf", "shims"),
301
+ join(home, "Library", "pnpm"),
302
+ join(home, ".cargo", "bin"),
303
+ // Common user-level npm prefixes for sudo-free global installs.
304
+ // ~/.npm-global is the dominant non-canonical convention shipped
305
+ // in most third-party "fix npm EACCES" tutorials, and
306
+ // ~/.npm-packages is the second-most common variant. Without
307
+ // these, GUI-launched daemons miss `npm i -g`'d CLIs even though
308
+ // they resolve cleanly from the user's shell. See open-design
309
+ // issue #442.
310
+ join(home, ".npm-global", "bin"),
311
+ join(home, ".npm-packages", "bin")
312
+ );
313
+ if (includeSystemBins) {
314
+ dirs.push("/opt/homebrew/bin", "/usr/local/bin");
315
+ }
316
+ for (const installRoot of [
317
+ {
318
+ root: join(home, ".local", "share", "mise", "installs", "node"),
319
+ segments: ["bin"]
320
+ },
321
+ {
322
+ root: join(home, ".nvm", "versions", "node"),
323
+ segments: ["bin"]
324
+ },
325
+ {
326
+ root: join(home, ".local", "share", "fnm", "node-versions"),
327
+ segments: ["installation", "bin"]
328
+ },
329
+ {
330
+ root: join(home, ".fnm", "node-versions"),
331
+ segments: ["installation", "bin"]
332
+ }
333
+ ]) {
334
+ for (const dir of existingChildBinDirs(installRoot.root, installRoot.segments)) {
335
+ dirs.push(dir);
336
+ }
337
+ }
338
+ return dirs;
339
+ }
340
+ function existingChildBinDirs(root, segments) {
341
+ const out = [];
342
+ let entries;
343
+ try {
344
+ entries = readdirSync(root, { encoding: "utf8", withFileTypes: true });
345
+ } catch {
346
+ return out;
347
+ }
348
+ for (const entry of sortVersionedDirEntries(entries)) {
349
+ if (!entry.isDirectory()) continue;
350
+ const candidate = join(root, entry.name, ...segments);
351
+ if (existsSync(candidate)) out.push(candidate);
352
+ }
353
+ return out;
354
+ }
355
+ function sortVersionedDirEntries(entries) {
356
+ return [...entries].sort((left, right) => compareVersionLikeDirNames(left.name, right.name));
357
+ }
358
+ function compareVersionLikeDirNames(left, right) {
359
+ const leftSemver = parseVersionLikeDirName(left);
360
+ const rightSemver = parseVersionLikeDirName(right);
361
+ if (leftSemver && rightSemver) {
362
+ for (let index = 0; index < leftSemver.length; index += 1) {
363
+ const difference = rightSemver[index] - leftSemver[index];
364
+ if (difference !== 0) return difference;
365
+ }
366
+ } else if (leftSemver) {
367
+ return -1;
368
+ } else if (rightSemver) {
369
+ return 1;
370
+ }
371
+ return left.localeCompare(right);
372
+ }
373
+ function parseVersionLikeDirName(name) {
374
+ const match = /^v?(\d+)\.(\d+)\.(\d+)$/.exec(name);
375
+ if (!match) return null;
376
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
377
+ }
378
+ export {
379
+ collectProcessTreePids,
380
+ createCommandInvocation,
381
+ createPackageManagerInvocation,
382
+ createProcessStampArgs,
383
+ isProcessAlive,
384
+ listProcessSnapshots,
385
+ matchesProcessStamp,
386
+ matchesStampedProcess,
387
+ readFlagValue,
388
+ readLogTail,
389
+ readProcessStamp,
390
+ readProcessStampFromCommand,
391
+ spawnBackgroundProcess,
392
+ spawnLoggedProcess,
393
+ stopProcesses,
394
+ waitForHttpOk,
395
+ waitForProcessExit,
396
+ wellKnownUserToolchainBins
397
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@open-design/platform",
3
+ "version": "0.7.0",
4
+ "type": "module",
5
+ "main": "./dist/index.mjs",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "default": "./dist/index.mjs"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,144 @@
1
+ export type SidecarStampShape = {
2
+ app: string;
3
+ ipc: string;
4
+ mode: string;
5
+ namespace: string;
6
+ source: string;
7
+ };
8
+ export type SidecarContractDescriptor<TStamp extends SidecarStampShape = SidecarStampShape> = {
9
+ defaults: {
10
+ host: string;
11
+ ipcBase: string;
12
+ namespace: string;
13
+ projectTmpDirName: string;
14
+ windowsPipePrefix: string;
15
+ };
16
+ env: {
17
+ base: string;
18
+ ipcBase: string;
19
+ ipcPath: string;
20
+ namespace: string;
21
+ source: string;
22
+ };
23
+ normalizeApp(app: unknown): TStamp["app"];
24
+ normalizeNamespace(namespace: unknown): string;
25
+ normalizeSource(source: unknown): TStamp["source"];
26
+ normalizeStamp(input: unknown): TStamp;
27
+ };
28
+ export type NamespaceResolutionOptions<TStamp extends SidecarStampShape = SidecarStampShape> = {
29
+ contract: SidecarContractDescriptor<TStamp>;
30
+ env?: NodeJS.ProcessEnv;
31
+ namespace?: string | null;
32
+ };
33
+ export type ProjectRuntimePathRequest<TStamp extends SidecarStampShape = SidecarStampShape> = {
34
+ contract: SidecarContractDescriptor<TStamp>;
35
+ projectRoot: string;
36
+ source: TStamp["source"] | string;
37
+ };
38
+ export type BaseResolutionOptions<TStamp extends SidecarStampShape = SidecarStampShape> = {
39
+ base?: string | null;
40
+ contract: SidecarContractDescriptor<TStamp>;
41
+ env?: NodeJS.ProcessEnv;
42
+ projectRoot?: string;
43
+ source: TStamp["source"] | string;
44
+ };
45
+ export type RuntimePathRequest<TStamp extends SidecarStampShape = SidecarStampShape> = {
46
+ base: string;
47
+ contract: SidecarContractDescriptor<TStamp>;
48
+ namespace: string;
49
+ };
50
+ export type RuntimeRootRequest<TStamp extends SidecarStampShape = SidecarStampShape> = RuntimePathRequest<TStamp> & {
51
+ runId: string;
52
+ };
53
+ export type AppIpcPathRequest<TStamp extends SidecarStampShape = SidecarStampShape> = {
54
+ app: TStamp["app"] | string;
55
+ contract: SidecarContractDescriptor<TStamp>;
56
+ env?: NodeJS.ProcessEnv;
57
+ namespace: string;
58
+ };
59
+ export type AppRuntimePathRequest<TStamp extends SidecarStampShape = SidecarStampShape> = {
60
+ app: TStamp["app"] | string;
61
+ contract: SidecarContractDescriptor<TStamp>;
62
+ namespaceRoot: string;
63
+ };
64
+ export type SidecarRuntimeContext<TStamp extends SidecarStampShape = SidecarStampShape> = {
65
+ app: TStamp["app"];
66
+ base: string;
67
+ ipc: string;
68
+ mode: TStamp["mode"];
69
+ namespace: string;
70
+ source: TStamp["source"];
71
+ };
72
+ export type SidecarLaunchEnvRequest<TStamp extends SidecarStampShape = SidecarStampShape> = {
73
+ base: string;
74
+ contract: SidecarContractDescriptor<TStamp>;
75
+ extraEnv?: NodeJS.ProcessEnv;
76
+ stamp: TStamp;
77
+ };
78
+ export type BootstrapSidecarRuntimeOptions<TStamp extends SidecarStampShape = SidecarStampShape> = {
79
+ app: TStamp["app"] | string;
80
+ base?: string | null;
81
+ contract: SidecarContractDescriptor<TStamp>;
82
+ projectRoot?: string;
83
+ };
84
+ export type PortAllocation = {
85
+ port: number;
86
+ source: "dynamic" | "forced";
87
+ };
88
+ export type PortRequest = {
89
+ host?: string;
90
+ label?: string;
91
+ port?: number | string | null;
92
+ reserved?: Set<number>;
93
+ };
94
+ export type JsonIpcHandler = (message: any) => unknown | Promise<unknown>;
95
+ export type JsonIpcServerHandle = {
96
+ close(): Promise<void>;
97
+ };
98
+ export declare function isWindowsNamedPipePath(value: unknown): boolean;
99
+ export declare function normalizeIpcPath(ipc: unknown): string;
100
+ export declare function resolveNamespace<TStamp extends SidecarStampShape>(options: NamespaceResolutionOptions<TStamp>): string;
101
+ export declare function resolveProjectRoot(projectRoot: string): string;
102
+ export declare function resolveProjectTmpRoot<TStamp extends SidecarStampShape>({ contract, projectRoot, }: {
103
+ contract: SidecarContractDescriptor<TStamp>;
104
+ projectRoot: string;
105
+ }): string;
106
+ export declare function resolveSourceRuntimeRoot<TStamp extends SidecarStampShape>({ contract, projectRoot, source, }: ProjectRuntimePathRequest<TStamp>): string;
107
+ export declare function resolveSidecarBase<TStamp extends SidecarStampShape>({ base, contract, env, projectRoot, source, }: BaseResolutionOptions<TStamp>): string;
108
+ export declare function resolveNamespaceRoot<TStamp extends SidecarStampShape>({ base, contract, namespace, }: RuntimePathRequest<TStamp>): string;
109
+ export declare function resolveRuntimeRoot<TStamp extends SidecarStampShape>({ base, contract, namespace, runId, }: RuntimeRootRequest<TStamp>): string;
110
+ export declare function resolvePointerPath<TStamp extends SidecarStampShape>({ base, contract, namespace }: RuntimePathRequest<TStamp>): string;
111
+ export declare function resolveManifestPath({ runtimeRoot }: {
112
+ runtimeRoot: string;
113
+ }): string;
114
+ export declare function resolveLogsDir<TStamp extends SidecarStampShape>({ app, contract, runtimeRoot, }: {
115
+ app: TStamp["app"] | string;
116
+ contract: SidecarContractDescriptor<TStamp>;
117
+ runtimeRoot: string;
118
+ }): string;
119
+ export declare function resolveLogFilePath<TStamp extends SidecarStampShape>({ app, contract, fileName, runtimeRoot, }: {
120
+ app: TStamp["app"] | string;
121
+ contract: SidecarContractDescriptor<TStamp>;
122
+ fileName?: string;
123
+ runtimeRoot: string;
124
+ }): string;
125
+ export declare function resolveAppRuntimeDir<TStamp extends SidecarStampShape>({ app, contract, namespaceRoot, }: AppRuntimePathRequest<TStamp>): string;
126
+ export declare function resolveAppRuntimePath<TStamp extends SidecarStampShape>({ app, contract, fileName, namespaceRoot, }: AppRuntimePathRequest<TStamp> & {
127
+ fileName: string;
128
+ }): string;
129
+ export declare function resolveAppIpcPath<TStamp extends SidecarStampShape>({ app, contract, env, namespace, }: AppIpcPathRequest<TStamp>): string;
130
+ export declare function createSidecarLaunchEnv<TStamp extends SidecarStampShape>({ base, contract, extraEnv, stamp, }: SidecarLaunchEnvRequest<TStamp>): NodeJS.ProcessEnv;
131
+ export declare function bootstrapSidecarRuntime<TStamp extends SidecarStampShape>(stampInput: unknown, env: NodeJS.ProcessEnv, options: BootstrapSidecarRuntimeOptions<TStamp>): SidecarRuntimeContext<TStamp>;
132
+ export declare function allocatePort({ host, label, port, reserved, }?: PortRequest): Promise<PortAllocation>;
133
+ export declare function readJsonFile<T = any>(filePath: string): Promise<T | null>;
134
+ export declare function writeJsonFile(filePath: string, payload: unknown): Promise<void>;
135
+ export declare function removeFile(filePath: string): Promise<void>;
136
+ export declare function removePointerIfCurrent(pointerPath: string, runId: string): Promise<void>;
137
+ export declare function createJsonIpcServer({ handler, socketPath, }: {
138
+ handler: JsonIpcHandler;
139
+ socketPath: string;
140
+ }): Promise<JsonIpcServerHandle>;
141
+ export declare function requestJsonIpc<T = any>(socketPath: string, payload: unknown, { timeoutMs }?: {
142
+ timeoutMs?: number;
143
+ }): Promise<T>;
144
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,iBAAiB,GAAG,iBAAiB,IAAI;IAC5F,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,YAAY,CAAC,GAAG,EAAE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