codiedev 0.10.0-beta.1 → 0.10.0-beta.11

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 (155) hide show
  1. package/README.md +11 -5
  2. package/assets/opencode-plugin.mjs +6 -0
  3. package/assets/session-key.mjs +48 -0
  4. package/assets/tui-brand-plugin.tsx +73 -0
  5. package/dist/backup/cache.js +1 -5
  6. package/dist/backup/match.js +0 -6
  7. package/dist/backup/run.js +3 -35
  8. package/dist/captureExclusions.js +0 -12
  9. package/dist/captureLog.js +0 -28
  10. package/dist/captureReadiness.js +0 -58
  11. package/dist/captureSignals.js +184 -0
  12. package/dist/cli.js +135 -72
  13. package/dist/cliSession.js +456 -0
  14. package/dist/codexHookTrust.js +125 -6
  15. package/dist/codexLimitScan.js +359 -0
  16. package/dist/codie.js +77 -130
  17. package/dist/codieBrandInstall.js +80 -0
  18. package/dist/codieLauncher.js +76 -79
  19. package/dist/codieRuntime.js +19 -23
  20. package/dist/codieRuntimeInstall.js +108 -23
  21. package/dist/codieUsage.js +181 -0
  22. package/dist/commands/agentTemplates.generated.js +136 -0
  23. package/dist/commands/agents.js +1101 -0
  24. package/dist/commands/agentsSdk.generated.js +7 -0
  25. package/dist/commands/ask.js +0 -3
  26. package/dist/commands/capture.js +0 -2
  27. package/dist/commands/createTicket.js +0 -10
  28. package/dist/commands/doctor.js +53 -120
  29. package/dist/commands/evals.js +187 -0
  30. package/dist/commands/inbox.js +0 -2
  31. package/dist/commands/library.js +0 -3
  32. package/dist/commands/pack.js +573 -0
  33. package/dist/commands/ping.js +0 -2
  34. package/dist/commands/pull.js +6 -10
  35. package/dist/commands/push.js +2 -12
  36. package/dist/commands/search.js +0 -4
  37. package/dist/commands/send.js +0 -5
  38. package/dist/commands/share.js +0 -4
  39. package/dist/commands/shared.js +0 -35
  40. package/dist/commands/traces.js +344 -0
  41. package/dist/commands/tracesLabel.js +348 -0
  42. package/dist/configDir.js +18 -11
  43. package/dist/connect.js +55 -118
  44. package/dist/connectFlow.js +35 -9
  45. package/dist/copilotHooks.js +391 -0
  46. package/dist/copilotInstallation.js +64 -0
  47. package/dist/cursorHooks.js +38 -30
  48. package/dist/cursorLifecycle.js +109 -0
  49. package/dist/detection.js +0 -30
  50. package/dist/harnessDirs.js +77 -0
  51. package/dist/hook.js +256 -445
  52. package/dist/inboxFormat.js +0 -24
  53. package/dist/launchContext.js +150 -0
  54. package/dist/launcher.js +168 -0
  55. package/dist/limitEvent.js +44 -13
  56. package/dist/limitEventReporter.js +1 -1
  57. package/dist/managedPi.js +256 -0
  58. package/dist/mcp.js +5 -384
  59. package/dist/nativeSteering.js +24 -0
  60. package/dist/packs/codie.js +182 -0
  61. package/dist/packs/harnesses.js +411 -0
  62. package/dist/packs/hookGate.js +256 -0
  63. package/dist/packs/install.js +286 -0
  64. package/dist/packs/manifest.js +126 -0
  65. package/dist/packs/paths.js +81 -0
  66. package/dist/packs/shim.js +214 -0
  67. package/dist/packs/store.js +155 -0
  68. package/dist/packs/sync.js +170 -0
  69. package/dist/piHooks.js +216 -0
  70. package/dist/piRuntime.js +120 -0
  71. package/dist/repoResolver.js +0 -19
  72. package/dist/secret.js +0 -3
  73. package/dist/selfUpdate.js +376 -0
  74. package/dist/skillMarker.js +23 -0
  75. package/dist/subagents.js +135 -0
  76. package/dist/teamSkillContext.js +10 -0
  77. package/dist/transcriptModels.js +205 -0
  78. package/dist/upgradeNudge.js +0 -30
  79. package/dist/utils.js +502 -828
  80. package/dist/version.js +0 -10
  81. package/dist/versionCheck.js +0 -33
  82. package/package.json +8 -9
  83. package/dist/backup/cache.d.ts +0 -14
  84. package/dist/backup/match.d.ts +0 -2
  85. package/dist/backup/run.d.ts +0 -25
  86. package/dist/captureExclusions.d.ts +0 -30
  87. package/dist/captureLog.d.ts +0 -20
  88. package/dist/captureReadiness.d.ts +0 -65
  89. package/dist/cli.d.ts +0 -16
  90. package/dist/codexHookTrust.d.ts +0 -34
  91. package/dist/codie.d.ts +0 -2
  92. package/dist/codieLauncher.d.ts +0 -53
  93. package/dist/codieRuntime.d.ts +0 -29
  94. package/dist/codieRuntimeInstall.d.ts +0 -28
  95. package/dist/codieStartup.d.ts +0 -26
  96. package/dist/codieStartup.js +0 -30
  97. package/dist/commands/ask.d.ts +0 -1
  98. package/dist/commands/capture.d.ts +0 -14
  99. package/dist/commands/createTicket.d.ts +0 -27
  100. package/dist/commands/delete.d.ts +0 -1
  101. package/dist/commands/doctor.d.ts +0 -1
  102. package/dist/commands/inbox.d.ts +0 -3
  103. package/dist/commands/library.d.ts +0 -2
  104. package/dist/commands/note.d.ts +0 -1
  105. package/dist/commands/ping.d.ts +0 -1
  106. package/dist/commands/promote.d.ts +0 -1
  107. package/dist/commands/promote.js +0 -53
  108. package/dist/commands/pull.d.ts +0 -2
  109. package/dist/commands/push.d.ts +0 -33
  110. package/dist/commands/react.d.ts +0 -2
  111. package/dist/commands/react.js +0 -40
  112. package/dist/commands/reverseTicket.d.ts +0 -2
  113. package/dist/commands/reverseTicket.js +0 -477
  114. package/dist/commands/search.d.ts +0 -2
  115. package/dist/commands/security.d.ts +0 -1
  116. package/dist/commands/security.js +0 -156
  117. package/dist/commands/send.d.ts +0 -2
  118. package/dist/commands/share.d.ts +0 -2
  119. package/dist/commands/shared.d.ts +0 -64
  120. package/dist/configDir.d.ts +0 -1
  121. package/dist/connect.d.ts +0 -1
  122. package/dist/connectFlow.d.ts +0 -13
  123. package/dist/cursorHooks.d.ts +0 -23
  124. package/dist/detection.d.ts +0 -30
  125. package/dist/hook.d.ts +0 -6
  126. package/dist/inboxFormat.d.ts +0 -38
  127. package/dist/limitEvent.d.ts +0 -16
  128. package/dist/limitEventReporter.d.ts +0 -21
  129. package/dist/mcp.d.ts +0 -12
  130. package/dist/prUrl.d.ts +0 -9
  131. package/dist/prUrl.js +0 -33
  132. package/dist/repoResolver.d.ts +0 -17
  133. package/dist/secret.d.ts +0 -1
  134. package/dist/security.d.ts +0 -102
  135. package/dist/security.js +0 -437
  136. package/dist/securityDeepScan.d.ts +0 -41
  137. package/dist/securityDeepScan.js +0 -248
  138. package/dist/securityDoctor.d.ts +0 -32
  139. package/dist/securityDoctor.js +0 -63
  140. package/dist/securityFeature.d.ts +0 -5
  141. package/dist/securityFeature.js +0 -7
  142. package/dist/securityInstall.d.ts +0 -63
  143. package/dist/securityInstall.js +0 -239
  144. package/dist/securityInventory.d.ts +0 -54
  145. package/dist/securityInventory.js +0 -556
  146. package/dist/securityPilot.d.ts +0 -19
  147. package/dist/securityPilot.js +0 -61
  148. package/dist/securityPolicy.d.ts +0 -33
  149. package/dist/securityPolicy.js +0 -188
  150. package/dist/securitySession.d.ts +0 -6
  151. package/dist/securitySession.js +0 -72
  152. package/dist/upgradeNudge.d.ts +0 -25
  153. package/dist/utils.d.ts +0 -342
  154. package/dist/version.d.ts +0 -1
  155. package/dist/versionCheck.d.ts +0 -68
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ManagedPiArgError = exports.GUARD_SOURCE = exports.BLOCKED_BASE_URL = exports.CAPTURE_FILE = exports.GUARD_FILE = exports.PI_PROVIDER_ENV = exports.PI_PROVIDER_ID = void 0;
37
+ exports.managedPiAgentDir = managedPiAgentDir;
38
+ exports.piProviderConfig = piProviderConfig;
39
+ exports.prepareManagedPiDir = prepareManagedPiDir;
40
+ exports.managedPiEnv = managedPiEnv;
41
+ exports.managedPiArgs = managedPiArgs;
42
+ exports.runManagedPi = runManagedPi;
43
+ const child_process_1 = require("child_process");
44
+ const fs = __importStar(require("fs"));
45
+ const path = __importStar(require("path"));
46
+ const codieLauncher_1 = require("./codieLauncher");
47
+ const piRuntime_1 = require("./piRuntime");
48
+ const utils_1 = require("./utils");
49
+ exports.PI_PROVIDER_ID = "codiedev";
50
+ exports.PI_PROVIDER_ENV = [
51
+ "ANTHROPIC_API_KEY", "ANTHROPIC_OAUTH_TOKEN", "OPENAI_API_KEY", "AZURE_OPENAI_API_KEY",
52
+ "AZURE_OPENAI_BASE_URL", "AZURE_OPENAI_RESOURCE_NAME", "DEEPSEEK_API_KEY", "GEMINI_API_KEY",
53
+ "GROQ_API_KEY", "CEREBRAS_API_KEY", "XAI_API_KEY", "FIREWORKS_API_KEY", "OPENROUTER_API_KEY",
54
+ "AI_GATEWAY_API_KEY", "ZAI_API_KEY", "MISTRAL_API_KEY", "MINIMAX_API_KEY", "MOONSHOT_API_KEY",
55
+ "OPENCODE_API_KEY", "KIMI_API_KEY", "CLOUDFLARE_API_KEY", "XIAOMI_API_KEY",
56
+ "XIAOMI_TOKEN_PLAN_CN_API_KEY", "XIAOMI_TOKEN_PLAN_AMS_API_KEY", "XIAOMI_TOKEN_PLAN_SGP_API_KEY",
57
+ "AWS_PROFILE", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN",
58
+ "AWS_BEARER_TOKEN_BEDROCK", "GOOGLE_APPLICATION_CREDENTIALS", "GOOGLE_CLOUD_API_KEY",
59
+ "COPILOT_GITHUB_TOKEN",
60
+ ];
61
+ const BLOCKED_SUBCOMMANDS = new Set(["install", "remove", "uninstall", "config"]);
62
+ exports.GUARD_FILE = "codie-guard.ts";
63
+ exports.CAPTURE_FILE = "codiedev-capture.ts";
64
+ exports.BLOCKED_BASE_URL = "http://127.0.0.1:9/blocked-by-codiedev";
65
+ exports.GUARD_SOURCE = `// Written by Codiedev on every \`codie --pi\` launch. Edits are overwritten.
66
+ import { execFile, execFileSync } from "node:child_process";
67
+ import { readFileSync } from "node:fs";
68
+ import { getProviders } from "@mariozechner/pi-ai";
69
+
70
+ const PROVIDER = ${JSON.stringify(exports.PI_PROVIDER_ID)};
71
+ const BLOCKED = ${JSON.stringify(exports.BLOCKED_BASE_URL)};
72
+ const ours = (m) => Boolean(m && m.provider === PROVIDER);
73
+ const label = (m) => (m ? m.provider + "/" + m.id : "that model");
74
+ // pi runs a header value starting with "!" as a shell command, so no value
75
+ // may start with one; branch and skill names are user-controlled.
76
+ const clean = (v, max) => String(v ?? "").replace(/[\\r\\n]/g, "").trim().replace(/^!+/, "").slice(0, max);
77
+ const git = (cwd, args) => { try { return execFileSync("git", args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 1500 }).trim(); } catch { return ""; } };
78
+
79
+ export default function (pi) {
80
+ for (const p of getProviders()) if (p !== PROVIDER) pi.registerProvider(p, { baseUrl: BLOCKED });
81
+
82
+ let last;
83
+ const skills = new Set();
84
+ const fallback = (ctx) => last ?? ctx.modelRegistry.getAll().find(ours);
85
+ const pin = async (model, ctx) => {
86
+ const back = fallback(ctx);
87
+ if (back) await pi.setModel(back);
88
+ if (ctx.hasUI) ctx.ui.notify("codie: " + label(model) + " isn't a Codiedev-approved model" + (back ? "; using " + back.id : "") + ".", "warning");
89
+ };
90
+ const tag = (ctx) => {
91
+ const headers = {};
92
+ const session = clean(ctx.sessionManager?.getSessionId?.(), 200);
93
+ if (session) headers["X-Codiedev-Session-Id"] = session;
94
+ const repo = clean(git(ctx.cwd, ["remote", "get-url", "origin"]).replace(/\\/\\/[^/@]*@/, "//"), 2048);
95
+ if (repo) headers["X-Codiedev-Repo-Url"] = repo;
96
+ const branch = clean(git(ctx.cwd, ["branch", "--show-current"]), 200);
97
+ if (branch) headers["X-Codiedev-Branch"] = branch;
98
+ const sha = clean(git(ctx.cwd, ["rev-parse", "HEAD"]), 40);
99
+ if (/^[0-9a-f]{7,40}$/i.test(sha)) headers["X-Codiedev-Head-Sha"] = sha;
100
+ const list = clean([...skills].join(","), 4096);
101
+ if (list) headers["X-Codiedev-Skills-Used"] = list;
102
+ // pi replaces the provider's whole request config here, so the key name
103
+ // goes with the headers every time.
104
+ pi.registerProvider(PROVIDER, { apiKey: "CODIEDEV_GATEWAY_KEY", headers });
105
+ };
106
+
107
+ pi.on("session_start", async (_event, ctx) => {
108
+ skills.clear();
109
+ for (const m of ctx.modelRegistry.getAll()) if (!ours(m)) pi.registerProvider(m.provider, { baseUrl: BLOCKED });
110
+ if (ours(ctx.model)) last = ctx.model;
111
+ else await pin(ctx.model, ctx);
112
+ tag(ctx);
113
+ });
114
+ pi.on("model_select", async (event, ctx) => {
115
+ if (ours(event.model)) last = event.model;
116
+ else await pin(event.model, ctx);
117
+ });
118
+ pi.on("input", async (event) => {
119
+ const m = String(event?.text ?? "").match(/^\\/skill:([a-z0-9][a-z0-9_.:-]{0,119})(?:\\s|$)/i);
120
+ if (m && skills.size < 50) skills.add(m[1]);
121
+ });
122
+ pi.on("tool_result", async (event) => {
123
+ const p = String(event?.input?.path ?? "").replace(/\\\\/g, "/").match(/\\/([a-z0-9][a-z0-9_.:-]{0,119})\\/SKILL\\.md$/i);
124
+ if (event?.toolName === "read" && !event.isError && p && skills.size < 50) skills.add(p[1]);
125
+ });
126
+ // Browser sign-in: pi reads CODIEDEV_GATEWAY_KEY at request time, so put
127
+ // the current token there, refreshing it as it nears expiry (same logic as
128
+ // assets/session-key.mjs). Pasted API tokens: no variables, nothing changes.
129
+ const freshKey = async () => {
130
+ const env = process.env;
131
+ if (!env.CODIEDEV_SESSION_CONFIG || !env.CODIEDEV_CLI_JS || !env.CODIEDEV_NODE) return;
132
+ const read = () => { try { const c = JSON.parse(readFileSync(env.CODIEDEV_SESSION_CONFIG, "utf8")); return c && c.auth && c.token ? c : null; } catch { return null; } };
133
+ let s = read();
134
+ if (!s) return;
135
+ if (!(Number(s.auth.accessTokenExpiresAt) - Date.now() > 30 * 60000)) {
136
+ await new Promise((r) => execFile(env.CODIEDEV_NODE, [env.CODIEDEV_CLI_JS, "session-refresh"], { timeout: 30000 }, () => r()));
137
+ s = read() ?? s;
138
+ }
139
+ env.CODIEDEV_GATEWAY_KEY = s.token;
140
+ };
141
+ // Before every model call in the turn: the agent may have switched branch.
142
+ pi.on("turn_start", async (_event, ctx) => { await freshKey(); tag(ctx); });
143
+ pi.on("before_provider_request", (_event, ctx) => {
144
+ // Belt and braces: the request is already headed for BLOCKED.
145
+ if (!ours(ctx.model)) ctx.abort();
146
+ });
147
+ }
148
+ `;
149
+ function managedPiAgentDir(stateDir) {
150
+ return path.join(stateDir, "managed", "pi", "agent");
151
+ }
152
+ function piProviderConfig(gatewayUrl, catalog) {
153
+ return {
154
+ baseUrl: gatewayUrl.replace(/\/+$/, ""),
155
+ api: "openai-completions",
156
+ apiKey: "CODIEDEV_GATEWAY_KEY",
157
+ compat: { supportsDeveloperRole: false, supportsReasoningEffort: false },
158
+ models: catalog.map((model) => ({
159
+ id: (0, codieLauncher_1.bareModel)(model.id),
160
+ name: model.name || (0, codieLauncher_1.bareModel)(model.id),
161
+ ...(model.limit ? { contextWindow: model.limit.context, maxTokens: model.limit.output } : {}),
162
+ ...(model.cost ? { cost: { input: model.cost.input, output: model.cost.output, cacheRead: 0, cacheWrite: 0 } } : {}),
163
+ })),
164
+ };
165
+ }
166
+ function writeJsonAtomic(file, value) {
167
+ const tmp = `${file}.${process.pid}.tmp`;
168
+ fs.writeFileSync(tmp, JSON.stringify(value, null, 2) + "\n", { mode: 0o600 });
169
+ fs.renameSync(tmp, file);
170
+ }
171
+ function prepareManagedPiDir(opts) {
172
+ const { agentDir, gatewayUrl, catalog } = opts;
173
+ if (!catalog.length)
174
+ throw new Error("No company-approved models were returned by Codiedev");
175
+ const ids = catalog.map((model) => (0, codieLauncher_1.bareModel)(model.id));
176
+ const requested = (0, codieLauncher_1.bareModel)(opts.model ?? "");
177
+ if (requested && !ids.includes(requested)) {
178
+ throw new Error(`Primary agent model is not approved for this Codiedev account: ${requested}`);
179
+ }
180
+ fs.mkdirSync(agentDir, { recursive: true, mode: 0o700 });
181
+ writeJsonAtomic(path.join(agentDir, "models.json"), { providers: { [exports.PI_PROVIDER_ID]: piProviderConfig(gatewayUrl, catalog) } });
182
+ writeJsonAtomic(path.join(agentDir, "settings.json"), {
183
+ defaultProvider: exports.PI_PROVIDER_ID,
184
+ defaultModel: requested || ids[0],
185
+ enabledModels: ids.map((id) => `${exports.PI_PROVIDER_ID}/${id}`),
186
+ packages: [],
187
+ extensions: [],
188
+ skills: opts.skillPaths ?? [],
189
+ enableInstallTelemetry: false,
190
+ });
191
+ fs.rmSync(path.join(agentDir, "auth.json"), { force: true });
192
+ fs.rmSync(path.join(agentDir, "extensions"), { recursive: true, force: true });
193
+ const guard = path.join(agentDir, exports.GUARD_FILE);
194
+ fs.writeFileSync(guard, exports.GUARD_SOURCE, { mode: 0o600 });
195
+ const capture = path.join(agentDir, exports.CAPTURE_FILE);
196
+ fs.writeFileSync(capture, (0, utils_1.piExtensionSource)(), { mode: 0o600 });
197
+ return [guard, capture];
198
+ }
199
+ function managedPiEnv(env, agentDir, key, platform = process.platform) {
200
+ const blocked = new Set([...exports.PI_PROVIDER_ENV, "PI_CODING_AGENT_DIR"]);
201
+ const out = {};
202
+ for (const [k, v] of Object.entries(env)) {
203
+ if (blocked.has(platform === "win32" ? k.toUpperCase() : k))
204
+ continue;
205
+ out[k] = v;
206
+ }
207
+ out.PI_CODING_AGENT_DIR = agentDir;
208
+ out.PI_TELEMETRY = "0";
209
+ out.CODIEDEV_GATEWAY_KEY = key;
210
+ return out;
211
+ }
212
+ class ManagedPiArgError extends Error {
213
+ }
214
+ exports.ManagedPiArgError = ManagedPiArgError;
215
+ function managedPiArgs(args, extensions) {
216
+ if (args.length && BLOCKED_SUBCOMMANDS.has(args[0])) {
217
+ throw new ManagedPiArgError(`\`pi ${args[0]}\` changes extension sources, which codie --pi manages. Ask your Codiedev admin to approve a package instead.`);
218
+ }
219
+ for (let i = 0; i < args.length; i++) {
220
+ const a = args[i];
221
+ if (a === "--")
222
+ break;
223
+ const [flag, inline] = a.startsWith("--") && a.includes("=") ? [a.slice(0, a.indexOf("=")), a.slice(a.indexOf("=") + 1)] : [a, undefined];
224
+ if (flag === "--api-key")
225
+ throw new ManagedPiArgError("--api-key isn't allowed in codie --pi: models come from Codiedev.");
226
+ if (flag === "-e" || flag === "--extension")
227
+ throw new ManagedPiArgError(`${flag} isn't allowed in codie --pi: extensions are managed by Codiedev.`);
228
+ if (flag === "--provider") {
229
+ const value = inline ?? args[i + 1];
230
+ if (value !== exports.PI_PROVIDER_ID)
231
+ throw new ManagedPiArgError(`--provider ${value ?? "(none)"} isn't allowed in codie --pi: only Codiedev-approved models are available.`);
232
+ }
233
+ }
234
+ return ["--no-extensions", ...extensions.flatMap((file) => ["-e", file]), ...args];
235
+ }
236
+ function runManagedPi(opts) {
237
+ const env = opts.env ?? process.env;
238
+ const agentDir = managedPiAgentDir(opts.stateDir);
239
+ const extensions = prepareManagedPiDir({
240
+ agentDir, gatewayUrl: opts.gatewayUrl, catalog: opts.catalog, model: env.CODIEDEV_MODEL,
241
+ skillPaths: opts.skillPaths,
242
+ });
243
+ const args = managedPiArgs(opts.args, extensions);
244
+ const bin = env.CODIEDEV_PI_BIN?.trim();
245
+ const [command, commandArgs] = bin
246
+ ? [bin, args]
247
+ : [process.execPath, [(opts.resolvePi ?? (() => (0, piRuntime_1.ensurePiRuntime)({ stateDir: opts.stateDir })))(), ...args]];
248
+ const result = (0, child_process_1.spawnSync)(command, commandArgs, {
249
+ stdio: "inherit",
250
+ env: managedPiEnv(env, agentDir, opts.key),
251
+ shell: Boolean(bin) && process.platform === "win32",
252
+ });
253
+ if (result.error)
254
+ throw result.error;
255
+ return result.status === null ? 1 : result.status;
256
+ }