@ulpi/cli 0.1.4 → 0.1.6

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 (112) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{auth-PN7TMQHV-2W4ICG64.js → auth-FWM7MM4Q-VZC3U2XZ.js} +1 -1
  3. package/dist/{auth-ECQ3IB4E.js → auth-HDK7ECJL.js} +2 -1
  4. package/dist/{chunk-3SBPZRB5.js → chunk-3BCW6ABU.js} +402 -142
  5. package/dist/{chunk-JGBXM5NC.js → chunk-3WB5CXH4.js} +180 -5
  6. package/dist/{chunk-2HEE5OKX.js → chunk-4UCJIAOU.js} +2 -2
  7. package/dist/chunk-4XTHZVDS.js +109 -0
  8. package/dist/chunk-4ZPOZULQ.js +6522 -0
  9. package/dist/{chunk-SIAQVRKG.js → chunk-5MI5GIXM.js} +48 -2
  10. package/dist/{chunk-KLEASXUR.js → chunk-6ZL6NXMV.js} +1 -1
  11. package/dist/chunk-76D3BYJD.js +221 -0
  12. package/dist/{chunk-ZLYRPD7I.js → chunk-AWOSRA5F.js} +1 -1
  13. package/dist/{chunk-PDR55ZNW.js → chunk-BFEKZZHM.js} +274 -57
  14. package/dist/chunk-C7CLUQI6.js +1286 -0
  15. package/dist/{chunk-7AL4DOEJ.js → chunk-E3B5NROU.js} +7 -7
  16. package/dist/chunk-EJ7TW77N.js +1418 -0
  17. package/dist/{chunk-5J6NLQUN.js → chunk-IV6MWETF.js} +383 -168
  18. package/dist/chunk-IZPJHSPX.js +1478 -0
  19. package/dist/chunk-JLHNLM3C.js +228 -0
  20. package/dist/{chunk-BZL5H4YQ.js → chunk-KYYI23AQ.js} +2 -2
  21. package/dist/{chunk-2CLNOKPA.js → chunk-RSFJ6QSR.js} +18 -0
  22. package/dist/chunk-S6ANCSYO.js +1271 -0
  23. package/dist/chunk-SEU7WWNQ.js +1251 -0
  24. package/dist/chunk-SNQ7NAIS.js +453 -0
  25. package/dist/{ulpi-RMMCUAGP-JCJ273T6.js → chunk-TSLDGT5O.js} +73 -35
  26. package/dist/{chunk-SPOI23SB.js → chunk-UXHCHOWQ.js} +83 -62
  27. package/dist/chunk-V2H5D6Y3.js +146 -0
  28. package/dist/{chunk-QJ5GSMEC.js → chunk-VVEDXI7E.js} +2 -1
  29. package/dist/chunk-VXH5Y4FO.js +6761 -0
  30. package/dist/chunk-WED4LM5N.js +322 -0
  31. package/dist/{chunk-74WVVWJ4.js → chunk-YOKL7RB5.js} +184 -15
  32. package/dist/chunk-Z53CAR7G.js +298 -0
  33. package/dist/ci-X3U2W4HC.js +854 -0
  34. package/dist/cloud-2F3NLVHN.js +274 -0
  35. package/dist/{codemap-RKSD4MIE.js → codemap-XNGMAF3F.js} +37 -37
  36. package/dist/codex-MB5YTMRT.js +132 -0
  37. package/dist/{config-EGAXXCGL.js → config-OOELBYTH.js} +1 -1
  38. package/dist/dist-2BJYR5EI.js +59 -0
  39. package/dist/dist-2K7IEVTA.js +43 -0
  40. package/dist/dist-3EIQTZHT.js +1380 -0
  41. package/dist/{dist-YA2BWZB2.js → dist-4U5L2X2C.js} +2 -2
  42. package/dist/{dist-UKMCJBB2.js → dist-54KAMNLO.js} +16 -15
  43. package/dist/dist-6M4MZWZW.js +58 -0
  44. package/dist/dist-6X576SU2.js +27 -0
  45. package/dist/dist-7QOEYLFX.js +103 -0
  46. package/dist/dist-AYBGHEDY.js +2541 -0
  47. package/dist/dist-EK45QNEM.js +45 -0
  48. package/dist/{dist-CS2VKNYS.js → dist-FKFEJRPX.js} +16 -15
  49. package/dist/dist-GTEJUBBT.js +66 -0
  50. package/dist/dist-HA74OKJZ.js +40 -0
  51. package/dist/dist-HU5RZAON.js +48 -0
  52. package/dist/dist-IYE3OBRB.js +374 -0
  53. package/dist/{dist-GJYT2OQV.js → dist-JLU26AB6.js} +12 -9
  54. package/dist/{dist-6G7JC2RA.js → dist-KUCI6JFE.js} +49 -9
  55. package/dist/dist-NUEMFZFL.js +33 -0
  56. package/dist/{dist-RKOGLK7R.js → dist-NUXMDXZ3.js} +31 -3
  57. package/dist/{dist-QAU3LGJN.js → dist-YCNWHSLN.js} +15 -5
  58. package/dist/{dist-CB5D5LMO.js → dist-YFFG2ZD6.js} +9 -16
  59. package/dist/dist-ZG4OKCSR.js +15 -0
  60. package/dist/doctor-SI4LLLDZ.js +345 -0
  61. package/dist/{export-import-4A5MWLIA.js → export-import-JFQH4KSJ.js} +1 -1
  62. package/dist/{history-3MOBX4MA.js → history-5NE46ZAH.js} +7 -7
  63. package/dist/hooks-installer-UN5JZLDQ.js +19 -0
  64. package/dist/index.js +395 -619
  65. package/dist/{init-6CH4HV5T.js → init-5FK3VKRT.js} +79 -13
  66. package/dist/job-HIDMAFW2.js +376 -0
  67. package/dist/jobs.memory-PLMMSFHB-VBECCTHN.js +33 -0
  68. package/dist/kiro-VMUHDFGK.js +153 -0
  69. package/dist/{launchd-LF2QMSKZ.js → launchd-6AWT54HR.js} +9 -17
  70. package/dist/mcp-PDUD7SGP.js +249 -0
  71. package/dist/mcp-installer-PQU3XOGO.js +259 -0
  72. package/dist/mcp-setup-OA7IB3H3.js +263 -0
  73. package/dist/{memory-Y6OZTXJ2.js → memory-ZNAEAK3B.js} +17 -17
  74. package/dist/{ollama-3XCUZMZT-FYKHW4TZ.js → ollama-3XCUZMZT-4JMH6B7P.js} +1 -1
  75. package/dist/{openai-E7G2YAHU-UYY4ZWON.js → openai-E7G2YAHU-T3HMBPH7.js} +2 -2
  76. package/dist/portal-JYWVHXDU.js +210 -0
  77. package/dist/prd-Q4J5NVAR.js +408 -0
  78. package/dist/repos-WWZXNN3P.js +271 -0
  79. package/dist/review-integration-5WHEJU2A.js +14 -0
  80. package/dist/{rules-E427DKYJ.js → rules-Y4VSOY5Y.js} +3 -3
  81. package/dist/run-VPNXEIBY.js +687 -0
  82. package/dist/server-COL4AXKU-P7S7NNF6.js +11 -0
  83. package/dist/server-KKSETHDV-XSSLEENT.js +20 -0
  84. package/dist/{skills-CX73O3IV.js → skills-QEYU2N27.js} +4 -2
  85. package/dist/start-JYOEL7AJ.js +303 -0
  86. package/dist/{status-4DFHDJMN.js → status-BHQYYGAL.js} +2 -2
  87. package/dist/{templates-U7T6MARD.js → templates-CBRUJ66V.js} +4 -3
  88. package/dist/tui-DP7736EX.js +61 -0
  89. package/dist/ulpi-5EN6JCAS-LFE3WSL4.js +10 -0
  90. package/dist/{uninstall-6SW35IK4.js → uninstall-ICUV6DDV.js} +3 -3
  91. package/dist/{update-M6IBJNYP.js → update-7ZMAYRBH.js} +3 -3
  92. package/dist/{version-checker-Q6YTYAGP.js → version-checker-4ZFMZA7Y.js} +2 -2
  93. package/package.json +39 -31
  94. package/dist/chunk-2MZER6ND.js +0 -415
  95. package/dist/chunk-2VYFVYJL.js +0 -4273
  96. package/dist/chunk-6OCEY7JY.js +0 -422
  97. package/dist/chunk-7LXY5UVC.js +0 -330
  98. package/dist/chunk-B55DDP24.js +0 -136
  99. package/dist/chunk-JWUUVXIV.js +0 -13694
  100. package/dist/chunk-MIAQVCFW.js +0 -39
  101. package/dist/chunk-YM2HV4IA.js +0 -505
  102. package/dist/ci-STSL2LSP.js +0 -370
  103. package/dist/mcp-installer-NQCGKQ23.js +0 -124
  104. package/dist/projects-ATHDD3D6.js +0 -271
  105. package/dist/review-ADUPV3PN.js +0 -152
  106. package/dist/server-USLHY6GH-AEOJC5ST.js +0 -18
  107. package/dist/server-X5P6WH2M-7K2RY34N.js +0 -11
  108. package/dist/skills/ulpi-generate-guardian/SKILL.md +0 -750
  109. package/dist/skills/ulpi-generate-guardian/references/framework-rules.md +0 -849
  110. package/dist/skills/ulpi-generate-guardian/references/language-rules.md +0 -591
  111. package/dist/ui-OWXZ3YSR.js +0 -167
  112. package/dist/ui.html +0 -698
@@ -0,0 +1,274 @@
1
+ import {
2
+ loadCloudGatewayConfig,
3
+ loadUlpiSettings,
4
+ removeCloudGatewayConfig,
5
+ saveCloudGatewayConfig
6
+ } from "./chunk-C7CLUQI6.js";
7
+ import "./chunk-4VNS5WPM.js";
8
+
9
+ // src/commands/cloud.ts
10
+ import * as fs from "fs";
11
+ import * as path from "path";
12
+ import * as os from "os";
13
+ import * as https from "https";
14
+ import * as http from "http";
15
+ import chalk from "chalk";
16
+ function getFlag(args, flag) {
17
+ const prefix = `--${flag}=`;
18
+ const withEq = args.find((a) => a.startsWith(prefix));
19
+ if (withEq) return withEq.slice(prefix.length);
20
+ const idx = args.indexOf(`--${flag}`);
21
+ if (idx !== -1 && args[idx + 1] && !args[idx + 1].startsWith("--")) return args[idx + 1];
22
+ return void 0;
23
+ }
24
+ function fetchJson(url, apiKey) {
25
+ return new Promise((resolve, reject) => {
26
+ const parsedUrl = new URL(url);
27
+ const mod = parsedUrl.protocol === "https:" ? https : http;
28
+ const req = mod.request(
29
+ {
30
+ hostname: parsedUrl.hostname,
31
+ port: parsedUrl.port || (parsedUrl.protocol === "https:" ? 443 : 80),
32
+ path: parsedUrl.pathname + parsedUrl.search,
33
+ method: "GET",
34
+ headers: {
35
+ "Authorization": `Bearer ${apiKey}`,
36
+ "Accept": "application/json"
37
+ },
38
+ timeout: 1e4
39
+ },
40
+ (res) => {
41
+ let data = "";
42
+ res.on("data", (chunk) => {
43
+ data += chunk;
44
+ });
45
+ res.on("end", () => {
46
+ try {
47
+ if ((res.statusCode ?? 0) >= 400) {
48
+ reject(new Error(`HTTP ${res.statusCode}: ${data}`));
49
+ } else {
50
+ resolve(JSON.parse(data));
51
+ }
52
+ } catch {
53
+ reject(new Error(`Invalid JSON response: ${data}`));
54
+ }
55
+ });
56
+ }
57
+ );
58
+ req.on("error", reject);
59
+ req.on("timeout", () => {
60
+ req.destroy();
61
+ reject(new Error("Request timed out"));
62
+ });
63
+ req.end();
64
+ });
65
+ }
66
+ function mcpJsonPath(projectDir) {
67
+ return path.join(projectDir, ".mcp.json");
68
+ }
69
+ function readMcpJson(projectDir) {
70
+ const filePath = mcpJsonPath(projectDir);
71
+ if (fs.existsSync(filePath)) {
72
+ try {
73
+ const data = JSON.parse(fs.readFileSync(filePath, "utf-8"));
74
+ return { mcpServers: data.mcpServers ?? {} };
75
+ } catch {
76
+ }
77
+ }
78
+ return { mcpServers: {} };
79
+ }
80
+ function writeMcpJson(projectDir, mcpServers) {
81
+ const filePath = mcpJsonPath(projectDir);
82
+ fs.writeFileSync(filePath, JSON.stringify({ mcpServers }, null, 2) + "\n", "utf-8");
83
+ }
84
+ var CLOUD_MCP_KEY = "ulpi-cloud";
85
+ function readJsonConfig(filePath) {
86
+ if (fs.existsSync(filePath)) {
87
+ try {
88
+ return JSON.parse(fs.readFileSync(filePath, "utf-8"));
89
+ } catch {
90
+ }
91
+ }
92
+ return {};
93
+ }
94
+ function writeJsonConfig(filePath, config) {
95
+ const dir = path.dirname(filePath);
96
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
97
+ fs.writeFileSync(filePath, JSON.stringify(config, null, 2) + "\n", "utf-8");
98
+ }
99
+ function getAgentConfigTargets() {
100
+ const home = os.homedir();
101
+ const targets = [];
102
+ const claudePath = path.join(home, ".claude", "settings.json");
103
+ targets.push({ name: "Claude Code", configPath: claudePath });
104
+ return targets;
105
+ }
106
+ function writeCloudMcpToAgentConfig(configPath, entry) {
107
+ const config = readJsonConfig(configPath);
108
+ const mcpServers = config.mcpServers ?? {};
109
+ if (mcpServers[CLOUD_MCP_KEY]) return false;
110
+ mcpServers[CLOUD_MCP_KEY] = entry;
111
+ config.mcpServers = mcpServers;
112
+ writeJsonConfig(configPath, config);
113
+ return true;
114
+ }
115
+ function removeCloudMcpFromAgentConfig(configPath) {
116
+ if (!fs.existsSync(configPath)) return false;
117
+ const config = readJsonConfig(configPath);
118
+ const mcpServers = config.mcpServers ?? {};
119
+ if (!mcpServers[CLOUD_MCP_KEY]) return false;
120
+ delete mcpServers[CLOUD_MCP_KEY];
121
+ config.mcpServers = mcpServers;
122
+ writeJsonConfig(configPath, config);
123
+ return true;
124
+ }
125
+ async function runConnect(args, projectDir) {
126
+ const settings = loadUlpiSettings();
127
+ const cloudApiUrl = getFlag(args, "url") ?? settings.ulpiUrl ?? process.env.ULPI_CLOUD_URL ?? "https://api.ulpi.io";
128
+ const apiKey = getFlag(args, "key") ?? settings.apiKeys?.ulpi ?? process.env.ULPI_API_KEY;
129
+ if (!apiKey) {
130
+ console.error(chalk.red("Error: API key required."));
131
+ console.error(chalk.dim("Provide via --key=<apiKey>, settings.json apiKeys.ulpi, or ULPI_API_KEY env var."));
132
+ console.error(chalk.dim("Run: ulpi config set apiKeys.ulpi <your-key>"));
133
+ process.exit(1);
134
+ }
135
+ const orgId = getFlag(args, "org");
136
+ if (!orgId) {
137
+ console.error(chalk.red("Error: Organization ID required."));
138
+ console.error(chalk.dim("Provide via --org=<orgId>"));
139
+ process.exit(1);
140
+ }
141
+ const connectionUrl = `${cloudApiUrl}/api/orgs/${encodeURIComponent(orgId)}/gateway/connection`;
142
+ console.log(chalk.dim(`Fetching gateway info from ${connectionUrl}...`));
143
+ let gatewayInfo;
144
+ try {
145
+ const response = await fetchJson(connectionUrl, apiKey);
146
+ const conn = response.connection;
147
+ if (!conn || typeof conn.url !== "string" || typeof conn.transport !== "string") {
148
+ console.error(chalk.red("Error: Invalid gateway response from cloud API."));
149
+ console.error(chalk.dim(`Response: ${JSON.stringify(response)}`));
150
+ process.exit(1);
151
+ }
152
+ gatewayInfo = { url: conn.url, transport: conn.transport };
153
+ } catch (err) {
154
+ const message = err instanceof Error ? err.message : String(err);
155
+ console.error(chalk.red(`Error: Failed to fetch gateway connection info.`));
156
+ console.error(chalk.dim(message));
157
+ process.exit(1);
158
+ }
159
+ const { mcpServers } = readMcpJson(projectDir);
160
+ mcpServers[CLOUD_MCP_KEY] = {
161
+ url: gatewayInfo.url,
162
+ headers: {
163
+ Authorization: `Bearer ${apiKey}`
164
+ }
165
+ };
166
+ writeMcpJson(projectDir, mcpServers);
167
+ console.log(chalk.green(" Written to .mcp.json"));
168
+ const cloudEntry = {
169
+ url: gatewayInfo.url,
170
+ headers: { Authorization: `Bearer ${apiKey}` }
171
+ };
172
+ const agentTargets = getAgentConfigTargets();
173
+ for (const target of agentTargets) {
174
+ const written = writeCloudMcpToAgentConfig(target.configPath, cloudEntry);
175
+ if (written) {
176
+ console.log(chalk.green(` Written to ${target.name} (${chalk.dim(target.configPath)})`));
177
+ } else {
178
+ console.log(chalk.dim(` ${target.name}: already configured`));
179
+ }
180
+ }
181
+ saveCloudGatewayConfig({
182
+ orgId,
183
+ url: gatewayInfo.url,
184
+ transport: gatewayInfo.transport,
185
+ cloudApiUrl,
186
+ connectedAt: (/* @__PURE__ */ new Date()).toISOString()
187
+ });
188
+ console.log("");
189
+ console.log(chalk.green("Connected to Cloud MCP Gateway."));
190
+ console.log(` Org: ${chalk.cyan(orgId)}`);
191
+ console.log(` Gateway: ${chalk.cyan(gatewayInfo.url)}`);
192
+ console.log(` Transport: ${chalk.cyan(gatewayInfo.transport)}`);
193
+ console.log("");
194
+ console.log(chalk.dim("Restart your agent session for the new MCP server to take effect."));
195
+ }
196
+ function runStatus() {
197
+ const config = loadCloudGatewayConfig();
198
+ if (!config) {
199
+ console.log(chalk.yellow("Not connected to any Cloud MCP Gateway."));
200
+ console.log(chalk.dim("Run: ulpi cloud connect --org=<orgId> --key=<apiKey>"));
201
+ return;
202
+ }
203
+ console.log(chalk.bold("Cloud MCP Gateway Status\n"));
204
+ console.log(` Org: ${chalk.cyan(config.orgId)}`);
205
+ console.log(` Gateway URL: ${chalk.cyan(config.url)}`);
206
+ console.log(` Transport: ${chalk.cyan(config.transport)}`);
207
+ console.log(` Cloud API: ${chalk.dim(config.cloudApiUrl)}`);
208
+ console.log(` Connected: ${chalk.dim(config.connectedAt)}`);
209
+ }
210
+ function runDisconnect(projectDir) {
211
+ let removed = false;
212
+ const { mcpServers } = readMcpJson(projectDir);
213
+ if (mcpServers[CLOUD_MCP_KEY]) {
214
+ delete mcpServers[CLOUD_MCP_KEY];
215
+ writeMcpJson(projectDir, mcpServers);
216
+ console.log(chalk.green(" Removed from .mcp.json"));
217
+ removed = true;
218
+ }
219
+ const agentTargets = getAgentConfigTargets();
220
+ for (const target of agentTargets) {
221
+ const wasRemoved = removeCloudMcpFromAgentConfig(target.configPath);
222
+ if (wasRemoved) {
223
+ console.log(chalk.green(` Removed from ${target.name} (${chalk.dim(target.configPath)})`));
224
+ removed = true;
225
+ }
226
+ }
227
+ const configRemoved = removeCloudGatewayConfig();
228
+ if (configRemoved) {
229
+ removed = true;
230
+ }
231
+ if (removed) {
232
+ console.log("");
233
+ console.log(chalk.green("Disconnected from Cloud MCP Gateway."));
234
+ console.log(chalk.dim("Restart your agent session for changes to take effect."));
235
+ } else {
236
+ console.log(chalk.yellow("No cloud gateway connection found."));
237
+ }
238
+ }
239
+ function printUsage() {
240
+ console.log(`
241
+ Usage: ulpi cloud <subcommand> [options]
242
+
243
+ Subcommands:
244
+ connect Connect local agent to cloud MCP gateway
245
+ status Show current cloud connection status
246
+ disconnect Remove cloud gateway from agent configs
247
+
248
+ Connect Options:
249
+ --url=<url> Cloud API URL (default: https://api.ulpi.io)
250
+ --org=<orgId> Organization ID (required)
251
+ --key=<key> API key (or set via ULPI_API_KEY env / ulpi config)
252
+
253
+ Examples:
254
+ ulpi cloud connect --org=org-abc123 --key=sk-...
255
+ ulpi cloud status
256
+ ulpi cloud disconnect
257
+ `.trim());
258
+ }
259
+ async function runCloud(args, projectDir) {
260
+ const sub = args[0];
261
+ switch (sub) {
262
+ case "connect":
263
+ return runConnect(args.slice(1), projectDir);
264
+ case "status":
265
+ return runStatus();
266
+ case "disconnect":
267
+ return runDisconnect(projectDir);
268
+ default:
269
+ printUsage();
270
+ }
271
+ }
272
+ export {
273
+ runCloud
274
+ };
@@ -67,12 +67,12 @@ Subcommands:
67
67
  }
68
68
  async function initSubcommand(projectDir) {
69
69
  console.log(chalk.bold("\nCodeMap \u2014 Index Project\n"));
70
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
70
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
71
71
  const branch = getCurrentBranch(projectDir);
72
- const { runInitPipeline, loadCodemapConfig } = await import("./dist-CB5D5LMO.js");
72
+ const { runInitPipeline, loadCodemapConfig } = await import("./dist-YFFG2ZD6.js");
73
73
  const config = loadCodemapConfig(projectDir);
74
74
  if (config.embedding.provider === "openai") {
75
- const { resolveApiKey } = await import("./dist-RKOGLK7R.js");
75
+ const { resolveApiKey } = await import("./dist-NUXMDXZ3.js");
76
76
  if (!resolveApiKey("openai")) {
77
77
  console.error(chalk.red("Error: OpenAI API key not found.\n"));
78
78
  console.error(chalk.dim(" Set it: ulpi config set openai-key <your-key>"));
@@ -80,7 +80,7 @@ async function initSubcommand(projectDir) {
80
80
  process.exit(1);
81
81
  }
82
82
  } else if (config.embedding.provider === "ulpi") {
83
- const { resolveApiKey } = await import("./dist-RKOGLK7R.js");
83
+ const { resolveApiKey } = await import("./dist-NUXMDXZ3.js");
84
84
  if (!resolveApiKey("ulpi")) {
85
85
  console.error(chalk.red("Error: ULPI API key not found.\n"));
86
86
  console.error(chalk.dim(" Set it: ulpi config set ulpi-key <your-key>"));
@@ -99,7 +99,7 @@ async function initSubcommand(projectDir) {
99
99
  console.log(chalk.dim(` Provider: ${result.embeddingProvider} (${result.embeddingModel})`));
100
100
  console.log(chalk.dim(` Duration: ${(result.durationMs / 1e3).toFixed(1)}s`));
101
101
  console.log(chalk.dim(` Branch: ${branch}`));
102
- const { installMcpServer } = await import("./mcp-installer-NQCGKQ23.js");
102
+ const { installMcpServer } = await import("./mcp-installer-PQU3XOGO.js");
103
103
  const mcp = installMcpServer(projectDir);
104
104
  if (mcp.installed) {
105
105
  console.log(chalk.green("\u2713 MCP server registered"));
@@ -129,9 +129,9 @@ async function searchSubcommand(args, projectDir) {
129
129
  }
130
130
  const noTests = args.includes("--no-tests");
131
131
  const noDocs = args.includes("--no-docs");
132
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
132
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
133
133
  const branch = getCurrentBranch(projectDir);
134
- const { searchCode, getCodemapStatus } = await import("./dist-CB5D5LMO.js");
134
+ const { searchCode, getCodemapStatus } = await import("./dist-YFFG2ZD6.js");
135
135
  const status = getCodemapStatus(projectDir, branch);
136
136
  if (!status.initialized) {
137
137
  console.log(chalk.red("Error: CodeMap index not initialized."));
@@ -175,9 +175,9 @@ CodeMap Search \u2014 "${query}"
175
175
  }
176
176
  }
177
177
  async function statusSubcommand(projectDir) {
178
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
178
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
179
179
  const branch = getCurrentBranch(projectDir);
180
- const { getCodemapStatus } = await import("./dist-CB5D5LMO.js");
180
+ const { getCodemapStatus } = await import("./dist-YFFG2ZD6.js");
181
181
  const status = getCodemapStatus(projectDir, branch);
182
182
  console.log(chalk.bold("\nCodeMap Status\n"));
183
183
  if (!status.initialized) {
@@ -206,9 +206,9 @@ async function statusSubcommand(projectDir) {
206
206
  }
207
207
  async function reindexSubcommand(projectDir) {
208
208
  console.log(chalk.bold("\nCodeMap \u2014 Re-index Project\n"));
209
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
209
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
210
210
  const branch = getCurrentBranch(projectDir);
211
- const { getCodemapStatus } = await import("./dist-CB5D5LMO.js");
211
+ const { getCodemapStatus } = await import("./dist-YFFG2ZD6.js");
212
212
  const status = getCodemapStatus(projectDir, branch);
213
213
  if (!status.initialized) {
214
214
  console.log(chalk.yellow("Index not initialized. Running init instead..."));
@@ -217,9 +217,9 @@ async function reindexSubcommand(projectDir) {
217
217
  }
218
218
  async function depgraphSubcommand(projectDir) {
219
219
  console.log(chalk.bold("\nCodeMap \u2014 Rebuild Dependency Graph\n"));
220
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
220
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
221
221
  const branch = getCurrentBranch(projectDir);
222
- const { getCodemapStatus, rebuildDepgraph } = await import("./dist-CB5D5LMO.js");
222
+ const { getCodemapStatus, rebuildDepgraph } = await import("./dist-YFFG2ZD6.js");
223
223
  const status = getCodemapStatus(projectDir, branch);
224
224
  if (!status.initialized) {
225
225
  console.log(chalk.red("Error: CodeMap index not initialized. Run 'ulpi codemap init' first."));
@@ -245,7 +245,7 @@ async function depgraphSubcommand(projectDir) {
245
245
  }
246
246
  }
247
247
  async function configSubcommand(args, projectDir) {
248
- const { loadCodemapConfig, saveCodemapConfig } = await import("./dist-CB5D5LMO.js");
248
+ const { loadCodemapConfig, saveCodemapConfig } = await import("./dist-YFFG2ZD6.js");
249
249
  const config = loadCodemapConfig(projectDir);
250
250
  if (args.length === 0) {
251
251
  console.log(chalk.bold("\nCodeMap Configuration\n"));
@@ -265,7 +265,7 @@ async function configSubcommand(args, projectDir) {
265
265
  return;
266
266
  }
267
267
  try {
268
- const { CodemapConfigSchema } = await import("./dist-6G7JC2RA.js");
268
+ const { CodemapConfigSchema } = await import("./dist-KUCI6JFE.js");
269
269
  const updated = setNestedValue(config, key, value);
270
270
  const validated = CodemapConfigSchema.parse(updated);
271
271
  saveCodemapConfig(projectDir, validated);
@@ -316,9 +316,9 @@ function setNestedValue(obj, path, value) {
316
316
  }
317
317
  async function watchSubcommand(projectDir) {
318
318
  console.log(chalk.bold("\nCodeMap \u2014 Watch Mode\n"));
319
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
319
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
320
320
  const branch = getCurrentBranch(projectDir);
321
- const { getCodemapStatus, CodemapWatcher } = await import("./dist-CB5D5LMO.js");
321
+ const { getCodemapStatus, CodemapWatcher } = await import("./dist-YFFG2ZD6.js");
322
322
  const status = getCodemapStatus(projectDir, branch);
323
323
  if (!status.initialized) {
324
324
  console.log(chalk.yellow("Index not initialized. Running init first..."));
@@ -347,9 +347,9 @@ async function watchSubcommand(projectDir) {
347
347
  }
348
348
  async function exportSubcommand(projectDir) {
349
349
  console.log(chalk.bold("\nCodeMap \u2014 Export Index\n"));
350
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
350
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
351
351
  const branch = getCurrentBranch(projectDir);
352
- const { exportIndex } = await import("./dist-CB5D5LMO.js");
352
+ const { exportIndex } = await import("./dist-YFFG2ZD6.js");
353
353
  try {
354
354
  const result = await exportIndex(projectDir, branch);
355
355
  console.log(chalk.green("\u2713 Export complete"));
@@ -366,9 +366,9 @@ async function exportSubcommand(projectDir) {
366
366
  }
367
367
  async function importSubcommand(projectDir) {
368
368
  console.log(chalk.bold("\nCodeMap \u2014 Import Index\n"));
369
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
369
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
370
370
  const branch = getCurrentBranch(projectDir);
371
- const { importIndex } = await import("./dist-CB5D5LMO.js");
371
+ const { importIndex } = await import("./dist-YFFG2ZD6.js");
372
372
  try {
373
373
  const result = await importIndex(projectDir, branch);
374
374
  if (!result.success) {
@@ -390,9 +390,9 @@ async function importSubcommand(projectDir) {
390
390
  }
391
391
  }
392
392
  async function serveSubcommand(projectDir) {
393
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
393
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
394
394
  const branch = getCurrentBranch(projectDir);
395
- const { getCodemapStatus } = await import("./dist-CB5D5LMO.js");
395
+ const { getCodemapStatus } = await import("./dist-YFFG2ZD6.js");
396
396
  const status = getCodemapStatus(projectDir, branch);
397
397
  if (!status.initialized) {
398
398
  console.error(chalk.red("Error: CodeMap index not initialized. Run 'ulpi codemap init' first."));
@@ -401,18 +401,18 @@ async function serveSubcommand(projectDir) {
401
401
  console.error(chalk.dim("[codemap-mcp] Starting MCP server..."));
402
402
  console.error(chalk.dim(`[codemap-mcp] Project: ${projectDir}`));
403
403
  console.error(chalk.dim(`[codemap-mcp] Index: ${status.totalFiles} files, ${status.totalChunks} chunks`));
404
- const { startMcpServer } = await import("./dist-UKMCJBB2.js");
404
+ const { startMcpServer } = await import("./dist-54KAMNLO.js");
405
405
  await startMcpServer({ projectDir, branch });
406
406
  }
407
407
  async function evalSubcommand(args, projectDir) {
408
- const { runEvalHarness } = await import("./dist-CB5D5LMO.js");
408
+ const { runEvalHarness } = await import("./dist-YFFG2ZD6.js");
409
409
  const path = await import("path");
410
410
  const datasetIdx = args.indexOf("--dataset");
411
411
  let datasetPath;
412
412
  if (datasetIdx !== -1 && args[datasetIdx + 1]) {
413
413
  datasetPath = path.resolve(args[datasetIdx + 1]);
414
414
  } else {
415
- const { projectCodemapDir } = await import("./dist-RKOGLK7R.js");
415
+ const { projectCodemapDir } = await import("./dist-NUXMDXZ3.js");
416
416
  datasetPath = path.join(projectCodemapDir(projectDir), "eval", "queries.json");
417
417
  }
418
418
  const jsonOutput = args.includes("--json");
@@ -448,7 +448,7 @@ async function evalSubcommand(args, projectDir) {
448
448
  }
449
449
  async function migrateIndexSubcommand(projectDir) {
450
450
  console.log(chalk.bold("\nCodeMap \u2014 Migrate Legacy Index\n"));
451
- const { migrateFromLegacy } = await import("./dist-CB5D5LMO.js");
451
+ const { migrateFromLegacy } = await import("./dist-YFFG2ZD6.js");
452
452
  try {
453
453
  const result = await migrateFromLegacy(projectDir);
454
454
  if (!result.migrated) {
@@ -474,9 +474,9 @@ async function depsSubcommand(args, projectDir) {
474
474
  const transitive = args.includes("--transitive") || args.includes("-t");
475
475
  const depthIdx = args.indexOf("--depth");
476
476
  const maxDepth = depthIdx >= 0 ? parseInt(args[depthIdx + 1], 10) || 5 : 5;
477
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
477
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
478
478
  const branch = getCurrentBranch(projectDir);
479
- const { loadGraph, getOutgoingEdges, getTransitiveDeps } = await import("./dist-YA2BWZB2.js");
479
+ const { loadGraph, getOutgoingEdges, getTransitiveDeps } = await import("./dist-4U5L2X2C.js");
480
480
  const graph = loadGraph(projectDir, branch);
481
481
  if (!graph) {
482
482
  console.log(chalk.yellow("No dependency graph found. Run 'ulpi codemap init' first."));
@@ -525,9 +525,9 @@ async function dependentsSubcommand(args, projectDir) {
525
525
  const transitive = args.includes("--transitive") || args.includes("-t");
526
526
  const depthIdx = args.indexOf("--depth");
527
527
  const maxDepth = depthIdx >= 0 ? parseInt(args[depthIdx + 1], 10) || 5 : 5;
528
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
528
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
529
529
  const branch = getCurrentBranch(projectDir);
530
- const { loadGraph, getIncomingEdges, getTransitiveRdeps } = await import("./dist-YA2BWZB2.js");
530
+ const { loadGraph, getIncomingEdges, getTransitiveRdeps } = await import("./dist-4U5L2X2C.js");
531
531
  const graph = loadGraph(projectDir, branch);
532
532
  if (!graph) {
533
533
  console.log(chalk.yellow("No dependency graph found. Run 'ulpi codemap init' first."));
@@ -570,9 +570,9 @@ Direct dependents of ${filePath}:
570
570
  async function rankSubcommand(args, projectDir) {
571
571
  const limitIdx = args.indexOf("--limit");
572
572
  const limit = limitIdx >= 0 ? parseInt(args[limitIdx + 1], 10) || 20 : 20;
573
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
573
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
574
574
  const branch = getCurrentBranch(projectDir);
575
- const { loadPageRank, loadGraph } = await import("./dist-YA2BWZB2.js");
575
+ const { loadPageRank, loadGraph } = await import("./dist-4U5L2X2C.js");
576
576
  const result = loadPageRank(projectDir, branch);
577
577
  if (!result) {
578
578
  console.log(chalk.yellow("No PageRank data found. Run 'ulpi codemap init' first."));
@@ -602,9 +602,9 @@ Top ${sorted.length} files by PageRank
602
602
  ${Object.keys(result.ranks).length} total files`));
603
603
  }
604
604
  async function cyclesSubcommand(projectDir) {
605
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
605
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
606
606
  const branch = getCurrentBranch(projectDir);
607
- const { loadMetrics, loadGraph, detectCycles } = await import("./dist-YA2BWZB2.js");
607
+ const { loadMetrics, loadGraph, detectCycles } = await import("./dist-4U5L2X2C.js");
608
608
  let cycles;
609
609
  const metrics = loadMetrics(projectDir, branch);
610
610
  if (metrics) {
@@ -635,9 +635,9 @@ Found ${cycles.length} circular dependency cycle${cycles.length === 1 ? "" : "s"
635
635
  }
636
636
  async function couplingSubcommand(args, projectDir) {
637
637
  const modulePath = args.filter((a) => !a.startsWith("--"))[0] || "";
638
- const { getCurrentBranch } = await import("./dist-RKOGLK7R.js");
638
+ const { getCurrentBranch } = await import("./dist-NUXMDXZ3.js");
639
639
  const branch = getCurrentBranch(projectDir);
640
- const { loadGraph, computeCoupling } = await import("./dist-YA2BWZB2.js");
640
+ const { loadGraph, computeCoupling } = await import("./dist-4U5L2X2C.js");
641
641
  const graph = loadGraph(projectDir, branch);
642
642
  if (!graph) {
643
643
  console.log(chalk.yellow("No dependency graph found. Run 'ulpi codemap init' first."));
@@ -0,0 +1,132 @@
1
+ import {
2
+ getCodexStatus,
3
+ installCodexMcpServers,
4
+ uninstallCodex
5
+ } from "./chunk-WED4LM5N.js";
6
+ import "./chunk-IZPJHSPX.js";
7
+ import {
8
+ convertClaudeAgentsToCodex,
9
+ convertClaudeSkillsToCodex
10
+ } from "./chunk-SNQ7NAIS.js";
11
+ import "./chunk-4ZPOZULQ.js";
12
+ import "./chunk-5MI5GIXM.js";
13
+ import "./chunk-C7CLUQI6.js";
14
+ import "./chunk-YOKL7RB5.js";
15
+ import "./chunk-KIKPIH6N.js";
16
+ import "./chunk-4VNS5WPM.js";
17
+
18
+ // src/commands/codex.ts
19
+ import chalk from "chalk";
20
+ function runCodex(args, projectDir) {
21
+ const subcommand = args[0];
22
+ switch (subcommand) {
23
+ case "install":
24
+ return handleInstall(args.slice(1), projectDir);
25
+ case "convert":
26
+ return handleConvert(args.slice(1), projectDir);
27
+ case "uninstall":
28
+ return handleUninstall(projectDir);
29
+ case "status":
30
+ return handleStatus(projectDir);
31
+ default:
32
+ printUsage();
33
+ }
34
+ }
35
+ function handleInstall(args, projectDir) {
36
+ const skipConvert = args.includes("--no-convert");
37
+ console.log(chalk.bold("\nInstalling ULPI for Codex CLI\n"));
38
+ const mcpCount = installCodexMcpServers(projectDir);
39
+ if (mcpCount > 0) {
40
+ console.log(chalk.green(`\u2713 Configured ${mcpCount} MCP server(s) in .codex/config.toml`));
41
+ } else {
42
+ console.log(chalk.dim(" MCP servers already configured"));
43
+ }
44
+ if (!skipConvert) {
45
+ const skillCount = convertClaudeSkillsToCodex(projectDir);
46
+ if (skillCount > 0) {
47
+ console.log(chalk.green(`\u2713 Converted ${skillCount} Claude Code skill(s) to .codex/skills/`));
48
+ } else {
49
+ console.log(chalk.dim(" No new Claude Code skills to convert"));
50
+ }
51
+ const agentCount = convertClaudeAgentsToCodex(projectDir);
52
+ if (agentCount > 0) {
53
+ console.log(chalk.green(`\u2713 Converted ${agentCount} Claude Code agent(s) to .codex/agents/`));
54
+ } else {
55
+ console.log(chalk.dim(" No new Claude Code agents to convert"));
56
+ }
57
+ }
58
+ console.log();
59
+ }
60
+ function handleConvert(args, projectDir) {
61
+ const skipAgents = args.includes("--no-agents");
62
+ const skipSkills = args.includes("--no-skills");
63
+ console.log(chalk.bold("\nConverting Claude Code assets to Codex format\n"));
64
+ if (!skipSkills) {
65
+ const skillCount = convertClaudeSkillsToCodex(projectDir);
66
+ if (skillCount > 0) {
67
+ console.log(chalk.green(`\u2713 Converted ${skillCount} Claude Code skill(s) to .codex/skills/`));
68
+ } else {
69
+ console.log(chalk.dim(" No new Claude Code skills to convert"));
70
+ }
71
+ }
72
+ if (!skipAgents) {
73
+ const agentCount = convertClaudeAgentsToCodex(projectDir);
74
+ if (agentCount > 0) {
75
+ console.log(chalk.green(`\u2713 Converted ${agentCount} Claude Code agent(s) to .codex/agents/`));
76
+ } else {
77
+ console.log(chalk.dim(" No new Claude Code agents to convert"));
78
+ }
79
+ }
80
+ console.log();
81
+ }
82
+ function handleUninstall(projectDir) {
83
+ console.log(chalk.bold("\nUninstalling ULPI from Codex CLI\n"));
84
+ const { agentsRemoved, skillsRemoved, mcpRemoved } = uninstallCodex(projectDir);
85
+ if (agentsRemoved > 0) {
86
+ console.log(chalk.green(`\u2713 Removed ${agentsRemoved} converted agent(s) from .codex/agents/`));
87
+ } else {
88
+ console.log(chalk.dim(" No converted agents found"));
89
+ }
90
+ if (skillsRemoved > 0) {
91
+ console.log(chalk.green(`\u2713 Removed ${skillsRemoved} converted skill(s) from .codex/skills/`));
92
+ } else {
93
+ console.log(chalk.dim(" No converted skills found"));
94
+ }
95
+ if (mcpRemoved) {
96
+ console.log(chalk.green("\u2713 Cleaned MCP entries from .codex/config.toml"));
97
+ } else {
98
+ console.log(chalk.dim(" No MCP entries to clean"));
99
+ }
100
+ console.log();
101
+ }
102
+ function handleStatus(projectDir) {
103
+ const status = getCodexStatus(projectDir);
104
+ console.log(chalk.bold("\nCodex CLI Integration Status\n"));
105
+ const agentsLabel = status.convertedAgentCount > 0 ? chalk.green(`${status.convertedAgentCount} converted`) : chalk.dim("0 converted");
106
+ console.log(` Agents: ${agentsLabel}`);
107
+ const skillsLabel = status.convertedSkillCount > 0 ? chalk.green(`${status.convertedSkillCount} converted`) : chalk.dim("0 converted");
108
+ console.log(` Skills: ${skillsLabel}`);
109
+ console.log(` MCP: ${status.mcpConfigured ? chalk.green("configured") : chalk.dim("not configured")}`);
110
+ console.log();
111
+ }
112
+ function printUsage() {
113
+ console.log(`
114
+ Usage: ulpi codex <subcommand> [options]
115
+
116
+ Subcommands:
117
+ install Configure MCP servers and convert Claude Code skills + agents
118
+ convert Convert Claude Code skills and agents to Codex format (no MCP setup)
119
+ uninstall Remove converted assets and MCP config
120
+ status Show Codex integration status
121
+
122
+ Install options:
123
+ --no-convert Skip converting Claude Code skills and agents
124
+
125
+ Convert options:
126
+ --no-agents Skip agent conversion
127
+ --no-skills Skip skill conversion
128
+ `.trim());
129
+ }
130
+ export {
131
+ runCodex
132
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadUlpiSettings,
3
3
  saveUlpiSettings
4
- } from "./chunk-7LXY5UVC.js";
4
+ } from "./chunk-C7CLUQI6.js";
5
5
  import "./chunk-4VNS5WPM.js";
6
6
 
7
7
  // src/commands/config.ts