@useorgx/wizard 0.1.57 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +44 -9
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
|
|
5
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
5
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="66b240e6-4f09-5817-86f1-bac0012af8cb")}catch(e){}}();
|
|
6
6
|
import * as clack from "@clack/prompts";
|
|
7
7
|
import { spawnSync as spawnSync5 } from "child_process";
|
|
8
8
|
import { readFileSync as readFileSync10 } from "fs";
|
|
@@ -32,6 +32,7 @@ import { join } from "path";
|
|
|
32
32
|
var ORGX_HOSTED_MCP_KEY = "orgx";
|
|
33
33
|
var ORGX_LOCAL_MCP_KEY = "orgx-openclaw";
|
|
34
34
|
var ORGX_HOSTED_MCP_URL = "https://mcp.useorgx.com/mcp";
|
|
35
|
+
var ORGX_CODEX_MCP_URL = `${ORGX_HOSTED_MCP_URL}?profile=commander`;
|
|
35
36
|
var ORGX_HOSTED_MCP_HEALTH_URL = "https://mcp.useorgx.com/health";
|
|
36
37
|
var ORGX_HOSTED_OAUTH_BASE_URL = "https://mcp.useorgx.com";
|
|
37
38
|
var ORGX_HOSTED_OAUTH_AUTHORIZE_URL = `${ORGX_HOSTED_OAUTH_BASE_URL}/authorize`;
|
|
@@ -2465,7 +2466,7 @@ function removeLegacyCodexEntries(servers) {
|
|
|
2465
2466
|
function patchCodexConfigToml(input, localMcpUrl) {
|
|
2466
2467
|
const current = parseTomlDocument(input);
|
|
2467
2468
|
const servers = readObject(current.mcp_servers);
|
|
2468
|
-
upsertCodexEntry(servers, ORGX_HOSTED_MCP_KEY,
|
|
2469
|
+
upsertCodexEntry(servers, ORGX_HOSTED_MCP_KEY, ORGX_CODEX_MCP_URL);
|
|
2469
2470
|
if (localMcpUrl) {
|
|
2470
2471
|
upsertCodexEntry(servers, ORGX_LOCAL_MCP_KEY, localMcpUrl);
|
|
2471
2472
|
}
|
|
@@ -2473,6 +2474,28 @@ function patchCodexConfigToml(input, localMcpUrl) {
|
|
|
2473
2474
|
current.mcp_servers = servers;
|
|
2474
2475
|
return stringifyTomlDocument(current);
|
|
2475
2476
|
}
|
|
2477
|
+
function migrateCodexHostedMcpProfile(input) {
|
|
2478
|
+
if (!input) return input;
|
|
2479
|
+
const current = parseTomlDocument(input);
|
|
2480
|
+
const servers = readObject(current.mcp_servers);
|
|
2481
|
+
const hosted = readObject(servers[ORGX_HOSTED_MCP_KEY]);
|
|
2482
|
+
if (hosted.url !== ORGX_HOSTED_MCP_URL) return input;
|
|
2483
|
+
const lines = input.match(/.*(?:\r\n|\n|$)/g)?.filter((line) => line.length > 0) ?? [];
|
|
2484
|
+
let inOrgxSection = false;
|
|
2485
|
+
let changed = false;
|
|
2486
|
+
const nextLines = lines.map((line) => {
|
|
2487
|
+
if (/^\s*\[/.test(line)) {
|
|
2488
|
+
inOrgxSection = /^\s*\[mcp_servers\.(?:orgx|"orgx")\]\s*(?:#.*)?(?:\r?\n)?$/.test(line);
|
|
2489
|
+
return line;
|
|
2490
|
+
}
|
|
2491
|
+
if (!inOrgxSection || changed) return line;
|
|
2492
|
+
const match = line.match(/^(\s*url\s*=\s*)(["'])(https:\/\/mcp\.useorgx\.com\/mcp)\2([ \t]*(?:#.*)?)(\r?\n)?$/);
|
|
2493
|
+
if (!match) return line;
|
|
2494
|
+
changed = true;
|
|
2495
|
+
return `${match[1]}${match[2]}${ORGX_CODEX_MCP_URL}${match[2]}${match[4]}${match[5] ?? ""}`;
|
|
2496
|
+
});
|
|
2497
|
+
return changed ? nextLines.join("") : input;
|
|
2498
|
+
}
|
|
2476
2499
|
function removeCodexConfigToml(input) {
|
|
2477
2500
|
const current = parseTomlDocument(input);
|
|
2478
2501
|
const servers = readObject(current.mcp_servers);
|
|
@@ -2480,7 +2503,7 @@ function removeCodexConfigToml(input) {
|
|
|
2480
2503
|
if (isRecord(servers[ORGX_LOCAL_MCP_KEY])) {
|
|
2481
2504
|
delete servers[ORGX_LOCAL_MCP_KEY];
|
|
2482
2505
|
}
|
|
2483
|
-
if (hosted.url === ORGX_HOSTED_MCP_URL) {
|
|
2506
|
+
if (hosted.url === ORGX_HOSTED_MCP_URL || hosted.url === ORGX_CODEX_MCP_URL) {
|
|
2484
2507
|
delete servers[ORGX_HOSTED_MCP_KEY];
|
|
2485
2508
|
}
|
|
2486
2509
|
removeLegacyCodexEntries(servers);
|
|
@@ -2492,7 +2515,7 @@ function inspectCodexConfigToml(input) {
|
|
|
2492
2515
|
const servers = readObject(current.mcp_servers);
|
|
2493
2516
|
const hosted = readObject(servers[ORGX_HOSTED_MCP_KEY]);
|
|
2494
2517
|
const local = readObject(servers[ORGX_LOCAL_MCP_KEY]);
|
|
2495
|
-
const hostedConfigured = hosted.url ===
|
|
2518
|
+
const hostedConfigured = hosted.url === ORGX_CODEX_MCP_URL;
|
|
2496
2519
|
const localConfigured = typeof local.url === "string";
|
|
2497
2520
|
return {
|
|
2498
2521
|
configured: hostedConfigured && localConfigured,
|
|
@@ -3585,6 +3608,7 @@ function defaultPluginPaths() {
|
|
|
3585
3608
|
claudeMarketplaceDir: CLAUDE_MANAGED_MARKETPLACE_DIR,
|
|
3586
3609
|
claudeMarketplaceManifestPath: CLAUDE_MANAGED_MARKETPLACE_MANIFEST_PATH,
|
|
3587
3610
|
claudePluginDir: CLAUDE_MANAGED_PLUGIN_DIR,
|
|
3611
|
+
codexConfigPath: CODEX_CONFIG_PATH ?? join4(CODEX_DIR, "config.toml"),
|
|
3588
3612
|
codexMarketplacePath: CODEX_MARKETPLACE_PATH,
|
|
3589
3613
|
codexPluginDir: CODEX_ORGX_PLUGIN_DIR,
|
|
3590
3614
|
cursorPluginDir: CURSOR_ORGX_PLUGIN_DIR,
|
|
@@ -4227,11 +4251,22 @@ async function installCodexPlugin(paths, fetchImpl, runner) {
|
|
|
4227
4251
|
}
|
|
4228
4252
|
const syncResult = await syncManagedRepoTree(CODEX_PLUGIN_SYNC_SPEC, paths.codexPluginDir, fetchImpl);
|
|
4229
4253
|
const marketplaceChanged = upsertCodexMarketplaceEntry(paths.codexMarketplacePath);
|
|
4230
|
-
const
|
|
4254
|
+
const previousConfig = readTextIfExists(paths.codexConfigPath);
|
|
4255
|
+
const nextConfig = migrateCodexHostedMcpProfile(previousConfig);
|
|
4256
|
+
const configChanged = nextConfig !== previousConfig;
|
|
4257
|
+
if (configChanged && nextConfig !== null) {
|
|
4258
|
+
writeTextFile(paths.codexConfigPath, nextConfig);
|
|
4259
|
+
}
|
|
4260
|
+
const changed = syncResult.changed || marketplaceChanged || configChanged;
|
|
4261
|
+
const changes = [
|
|
4262
|
+
...syncResult.changed ? [`Synced ${syncResult.fileCount} Codex plugin files.`] : [],
|
|
4263
|
+
...marketplaceChanged ? ["Updated the Codex marketplace entry."] : [],
|
|
4264
|
+
...configChanged ? ["Updated the existing OrgX MCP connection to the commander profile."] : []
|
|
4265
|
+
];
|
|
4231
4266
|
return {
|
|
4232
4267
|
target: "codex",
|
|
4233
4268
|
changed,
|
|
4234
|
-
message: changed ?
|
|
4269
|
+
message: changed ? changes.join(" ") : "Codex plugin files and marketplace entry already match the managed OrgX plugin."
|
|
4235
4270
|
};
|
|
4236
4271
|
}
|
|
4237
4272
|
async function installOpenclawPlugin(fetchImpl, runner) {
|
|
@@ -6214,7 +6249,7 @@ function initializeWizardSentry() {
|
|
|
6214
6249
|
Sentry.init({
|
|
6215
6250
|
dsn,
|
|
6216
6251
|
environment: process.env.ORGX_SENTRY_ENVIRONMENT || "production",
|
|
6217
|
-
release: "useorgx-wizard@0.1.
|
|
6252
|
+
release: "useorgx-wizard@0.1.58",
|
|
6218
6253
|
tracesSampleRate: sampleRate(process.env.ORGX_SENTRY_TRACES_SAMPLE_RATE),
|
|
6219
6254
|
enableLogs: true,
|
|
6220
6255
|
sendDefaultPii: false,
|
|
@@ -18245,7 +18280,7 @@ async function main() {
|
|
|
18245
18280
|
initializeWizardSentry();
|
|
18246
18281
|
const program = new Command();
|
|
18247
18282
|
program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
|
|
18248
|
-
const pkgVersion = true ? "0.1.
|
|
18283
|
+
const pkgVersion = true ? "0.1.58" : void 0;
|
|
18249
18284
|
program.version(pkgVersion ?? "unknown", "-V, --version");
|
|
18250
18285
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
18251
18286
|
if (Boolean(actionCommand.optsWithGlobals().json)) return;
|
|
@@ -19289,4 +19324,4 @@ main().catch(async (error) => {
|
|
|
19289
19324
|
process.exitCode = 1;
|
|
19290
19325
|
});
|
|
19291
19326
|
//# sourceMappingURL=cli.js.map
|
|
19292
|
-
//# debugId=
|
|
19327
|
+
//# debugId=66b240e6-4f09-5817-86f1-bac0012af8cb
|