@useorgx/wizard 0.1.11 → 0.1.13
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/README.md +14 -10
- package/dist/cli.js +289 -76
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -82,6 +82,8 @@ var CLAUDE_ORGX_SKILL_DIR = join(CLAUDE_SKILLS_DIR, "orgx");
|
|
|
82
82
|
var CLAUDE_ORGX_SKILL_PATH = join(CLAUDE_ORGX_SKILL_DIR, "SKILL.md");
|
|
83
83
|
var CURSOR_RULES_DIR = join(CURSOR_DIR, "rules");
|
|
84
84
|
var CURSOR_ORGX_RULE_PATH = join(CURSOR_RULES_DIR, "orgx.md");
|
|
85
|
+
var CURSOR_PLUGINS_DIR = join(CURSOR_DIR, "plugins", "local");
|
|
86
|
+
var CURSOR_ORGX_PLUGIN_DIR = join(CURSOR_PLUGINS_DIR, "cursor-plugin");
|
|
85
87
|
var CODEX_PLUGINS_DIR = join(CODEX_DIR, "plugins");
|
|
86
88
|
var CODEX_ORGX_PLUGIN_DIR = join(CODEX_PLUGINS_DIR, "orgx-codex-plugin");
|
|
87
89
|
var CODEX_MARKETPLACE_DIR = join(AGENTS_DIR, "plugins");
|
|
@@ -517,9 +519,6 @@ function normalizeOrgxBaseUrl(raw) {
|
|
|
517
519
|
}
|
|
518
520
|
function buildOrgxApiUrl(path, baseUrl) {
|
|
519
521
|
const parsedBase = new URL(normalizeOrgxBaseUrl(baseUrl));
|
|
520
|
-
if (parsedBase.protocol === "https:" && normalizeHost(parsedBase.hostname) === "useorgx.com") {
|
|
521
|
-
parsedBase.hostname = "www.useorgx.com";
|
|
522
|
-
}
|
|
523
522
|
const normalizedBase = parsedBase.toString().replace(/\/+$/, "");
|
|
524
523
|
const apiBase = normalizedBase.endsWith("/api") ? normalizedBase : `${normalizedBase}/api`;
|
|
525
524
|
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -928,6 +927,24 @@ function parseDemoInitiative(value) {
|
|
|
928
927
|
...isNonEmptyString2(record.workspaceName) ? { workspaceName: record.workspaceName.trim() } : {}
|
|
929
928
|
};
|
|
930
929
|
}
|
|
930
|
+
function parseFirstValueInitiative(value) {
|
|
931
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
932
|
+
return void 0;
|
|
933
|
+
}
|
|
934
|
+
const record = value;
|
|
935
|
+
if (!isNonEmptyString2(record.id) || !isNonEmptyString2(record.title) || !isNonEmptyString2(record.liveUrl) || !isNonEmptyString2(record.createdAt)) {
|
|
936
|
+
return void 0;
|
|
937
|
+
}
|
|
938
|
+
return {
|
|
939
|
+
createdAt: record.createdAt.trim(),
|
|
940
|
+
id: record.id.trim(),
|
|
941
|
+
liveUrl: record.liveUrl.trim(),
|
|
942
|
+
...isNonEmptyString2(record.summary) ? { summary: record.summary.trim() } : {},
|
|
943
|
+
title: record.title.trim(),
|
|
944
|
+
...isNonEmptyString2(record.workspaceId) ? { workspaceId: record.workspaceId.trim() } : {},
|
|
945
|
+
...isNonEmptyString2(record.workspaceName) ? { workspaceName: record.workspaceName.trim() } : {}
|
|
946
|
+
};
|
|
947
|
+
}
|
|
931
948
|
function parseOnboardingTask(value) {
|
|
932
949
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
933
950
|
return void 0;
|
|
@@ -1024,6 +1041,7 @@ function sanitizeWizardStateRecord(record) {
|
|
|
1024
1041
|
const continuity = parseContinuityDefaults(record.continuity);
|
|
1025
1042
|
const agentRoster = parseAgentRoster(record.agentRoster);
|
|
1026
1043
|
const demoInitiative = parseDemoInitiative(record.demoInitiative);
|
|
1044
|
+
const firstValueInitiative = parseFirstValueInitiative(record.firstValueInitiative);
|
|
1027
1045
|
const onboardingTask = parseOnboardingTask(record.onboardingTask);
|
|
1028
1046
|
const skillFiles = parseSkillFiles(record.skillFiles);
|
|
1029
1047
|
return {
|
|
@@ -1033,6 +1051,7 @@ function sanitizeWizardStateRecord(record) {
|
|
|
1033
1051
|
...continuity ? { continuity } : {},
|
|
1034
1052
|
...agentRoster ? { agentRoster } : {},
|
|
1035
1053
|
...demoInitiative ? { demoInitiative } : {},
|
|
1054
|
+
...firstValueInitiative ? { firstValueInitiative } : {},
|
|
1036
1055
|
...onboardingTask ? { onboardingTask } : {},
|
|
1037
1056
|
...skillFiles ? { skillFiles } : {}
|
|
1038
1057
|
};
|
|
@@ -1053,6 +1072,10 @@ function readWizardState(statePath = ORGX_WIZARD_STATE_PATH) {
|
|
|
1053
1072
|
if (agentRoster !== void 0) state.agentRoster = agentRoster;
|
|
1054
1073
|
const demoInitiative = parseDemoInitiative(parsed.demoInitiative);
|
|
1055
1074
|
if (demoInitiative !== void 0) state.demoInitiative = demoInitiative;
|
|
1075
|
+
const firstValueInitiative = parseFirstValueInitiative(parsed.firstValueInitiative);
|
|
1076
|
+
if (firstValueInitiative !== void 0) {
|
|
1077
|
+
state.firstValueInitiative = firstValueInitiative;
|
|
1078
|
+
}
|
|
1056
1079
|
const onboardingTask = parseOnboardingTask(parsed.onboardingTask);
|
|
1057
1080
|
if (onboardingTask !== void 0) state.onboardingTask = onboardingTask;
|
|
1058
1081
|
const skillFiles = parseSkillFiles(parsed.skillFiles);
|
|
@@ -2704,6 +2727,8 @@ var ONBOARDING_TASK_TITLE = "Complete OrgX onboarding";
|
|
|
2704
2727
|
var ONBOARDING_TASK_SUMMARY = "Starter onboarding task created by @useorgx/wizard so the first workspace has a clear follow-up after setup.";
|
|
2705
2728
|
var ONBOARDING_WORKSTREAM_TITLE = "OrgX onboarding";
|
|
2706
2729
|
var ONBOARDING_WORKSTREAM_SUMMARY = "Starter onboarding workstream created by @useorgx/wizard so the first workspace has a home for setup follow-up tasks.";
|
|
2730
|
+
var FIRST_VALUE_INITIATIVE_TITLE = "Make OrgX useful on this machine";
|
|
2731
|
+
var FIRST_VALUE_INITIATIVE_SUMMARY = "First initiative created by @useorgx/wizard so setup ends with a live workspace, an onboarding workstream, and a clean handoff into the user's configured AI tools.";
|
|
2707
2732
|
function parseResponseBody3(text2) {
|
|
2708
2733
|
if (!text2) {
|
|
2709
2734
|
return null;
|
|
@@ -2825,6 +2850,17 @@ function toOnboardingTaskRecord(task, workspace, options = {}) {
|
|
|
2825
2850
|
workspaceName: workspace.name
|
|
2826
2851
|
};
|
|
2827
2852
|
}
|
|
2853
|
+
function toFirstValueInitiativeRecord(initiative, liveUrl, workspace) {
|
|
2854
|
+
return {
|
|
2855
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2856
|
+
id: initiative.id,
|
|
2857
|
+
liveUrl,
|
|
2858
|
+
...initiative.summary ? { summary: initiative.summary } : {},
|
|
2859
|
+
title: initiative.title,
|
|
2860
|
+
workspaceId: workspace.id,
|
|
2861
|
+
workspaceName: workspace.name
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2828
2864
|
async function requireOrgxAuth2(options = {}) {
|
|
2829
2865
|
const auth = await resolveOrgxAuth(options);
|
|
2830
2866
|
if (!auth) {
|
|
@@ -2877,9 +2913,6 @@ async function updateEntity(type, id, body, parse2, options = {}) {
|
|
|
2877
2913
|
}
|
|
2878
2914
|
function buildLiveUrl(baseUrl, initiativeId) {
|
|
2879
2915
|
const parsed = new URL(normalizeOrgxBaseUrl(baseUrl));
|
|
2880
|
-
if (parsed.protocol === "https:" && parsed.hostname === "useorgx.com") {
|
|
2881
|
-
parsed.hostname = "www.useorgx.com";
|
|
2882
|
-
}
|
|
2883
2916
|
parsed.pathname = `/live/${initiativeId}`;
|
|
2884
2917
|
parsed.search = "";
|
|
2885
2918
|
parsed.hash = "";
|
|
@@ -2990,6 +3023,43 @@ async function ensureFounderDemoInitiative(workspace, options = {}) {
|
|
|
2990
3023
|
liveUrl
|
|
2991
3024
|
};
|
|
2992
3025
|
}
|
|
3026
|
+
async function ensureFirstValueInitiative(workspace, options = {}) {
|
|
3027
|
+
const existingRecord = readWizardState(options.statePath)?.firstValueInitiative;
|
|
3028
|
+
const matchingRecord = existingRecord?.workspaceId === workspace.id ? existingRecord : void 0;
|
|
3029
|
+
const auth = await requireOrgxAuth2(options);
|
|
3030
|
+
if (matchingRecord) {
|
|
3031
|
+
return {
|
|
3032
|
+
created: false,
|
|
3033
|
+
initiative: {
|
|
3034
|
+
id: matchingRecord.id,
|
|
3035
|
+
title: matchingRecord.title,
|
|
3036
|
+
...matchingRecord.summary ? { summary: matchingRecord.summary } : {}
|
|
3037
|
+
},
|
|
3038
|
+
liveUrl: matchingRecord.liveUrl || buildLiveUrl(auth.baseUrl, matchingRecord.id)
|
|
3039
|
+
};
|
|
3040
|
+
}
|
|
3041
|
+
const initiative = await createInitiative(
|
|
3042
|
+
{
|
|
3043
|
+
title: options.title?.trim() || FIRST_VALUE_INITIATIVE_TITLE,
|
|
3044
|
+
summary: options.summary?.trim() || FIRST_VALUE_INITIATIVE_SUMMARY,
|
|
3045
|
+
workspaceId: workspace.id
|
|
3046
|
+
},
|
|
3047
|
+
options
|
|
3048
|
+
);
|
|
3049
|
+
const liveUrl = buildLiveUrl(auth.baseUrl, initiative.id);
|
|
3050
|
+
updateWizardState(
|
|
3051
|
+
(current) => ({
|
|
3052
|
+
...current,
|
|
3053
|
+
firstValueInitiative: toFirstValueInitiativeRecord(initiative, liveUrl, workspace)
|
|
3054
|
+
}),
|
|
3055
|
+
options.statePath
|
|
3056
|
+
);
|
|
3057
|
+
return {
|
|
3058
|
+
created: true,
|
|
3059
|
+
initiative,
|
|
3060
|
+
liveUrl
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
2993
3063
|
async function ensureOnboardingTask(workspace, options = {}) {
|
|
2994
3064
|
const existingRecord = readWizardState(options.statePath)?.onboardingTask;
|
|
2995
3065
|
if (existingRecord?.workspaceId === workspace.id) {
|
|
@@ -3652,6 +3722,7 @@ var ORGX_PLUGIN_GITHUB_REF = "main";
|
|
|
3652
3722
|
var ORGX_CLAUDE_PLUGIN_NAME = "orgx-claude-code-plugin";
|
|
3653
3723
|
var ORGX_CLAUDE_MARKETPLACE_NAME = "orgx-local";
|
|
3654
3724
|
var ORGX_CODEX_PLUGIN_NAME = "orgx-codex-plugin";
|
|
3725
|
+
var ORGX_CURSOR_PLUGIN_NAME = "cursor-plugin";
|
|
3655
3726
|
var ORGX_OPENCLAW_PLUGIN_ID = "orgx";
|
|
3656
3727
|
var ORGX_OPENCLAW_PLUGIN_PACKAGE_NAME = "@useorgx/openclaw-plugin";
|
|
3657
3728
|
var CLAUDE_PLUGIN_SYNC_SPEC = {
|
|
@@ -3679,6 +3750,22 @@ var CODEX_PLUGIN_SYNC_SPEC = {
|
|
|
3679
3750
|
{ localPath: "skills", remotePath: "skills" }
|
|
3680
3751
|
]
|
|
3681
3752
|
};
|
|
3753
|
+
var CURSOR_PLUGIN_SYNC_SPEC = {
|
|
3754
|
+
owner: ORGX_PLUGIN_GITHUB_OWNER,
|
|
3755
|
+
repo: ORGX_CURSOR_PLUGIN_NAME,
|
|
3756
|
+
ref: ORGX_PLUGIN_GITHUB_REF,
|
|
3757
|
+
include: [
|
|
3758
|
+
{ localPath: ".cursor-plugin", remotePath: ".cursor-plugin" },
|
|
3759
|
+
{ localPath: ".mcp.json", remotePath: ".mcp.json" },
|
|
3760
|
+
{ localPath: "agents", remotePath: "agents" },
|
|
3761
|
+
{ localPath: "assets", remotePath: "assets" },
|
|
3762
|
+
{ localPath: "commands", remotePath: "commands" },
|
|
3763
|
+
{ localPath: "hooks", remotePath: "hooks" },
|
|
3764
|
+
{ localPath: "rules", remotePath: "rules" },
|
|
3765
|
+
{ localPath: "scripts", remotePath: "scripts" },
|
|
3766
|
+
{ localPath: "skills", remotePath: "skills" }
|
|
3767
|
+
]
|
|
3768
|
+
};
|
|
3682
3769
|
function defaultPluginPaths() {
|
|
3683
3770
|
return {
|
|
3684
3771
|
claudeMarketplaceDir: CLAUDE_MANAGED_MARKETPLACE_DIR,
|
|
@@ -3686,6 +3773,7 @@ function defaultPluginPaths() {
|
|
|
3686
3773
|
claudePluginDir: CLAUDE_MANAGED_PLUGIN_DIR,
|
|
3687
3774
|
codexMarketplacePath: CODEX_MARKETPLACE_PATH,
|
|
3688
3775
|
codexPluginDir: CODEX_ORGX_PLUGIN_DIR,
|
|
3776
|
+
cursorPluginDir: CURSOR_ORGX_PLUGIN_DIR,
|
|
3689
3777
|
cursorRulePath: CURSOR_ORGX_RULE_PATH
|
|
3690
3778
|
};
|
|
3691
3779
|
}
|
|
@@ -4106,15 +4194,36 @@ async function getOpenclawInstallState(runner) {
|
|
|
4106
4194
|
installed: extractOpenclawPluginIds(result.stdout).includes(ORGX_OPENCLAW_PLUGIN_ID)
|
|
4107
4195
|
};
|
|
4108
4196
|
}
|
|
4197
|
+
function cursorPluginManifestPath(paths) {
|
|
4198
|
+
return join3(paths.cursorPluginDir, ".cursor-plugin", "plugin.json");
|
|
4199
|
+
}
|
|
4200
|
+
function cursorPluginMcpPath(paths) {
|
|
4201
|
+
return join3(paths.cursorPluginDir, ".mcp.json");
|
|
4202
|
+
}
|
|
4203
|
+
function isCursorPluginInstalled(paths) {
|
|
4204
|
+
return existsSync4(cursorPluginManifestPath(paths)) && existsSync4(cursorPluginMcpPath(paths));
|
|
4205
|
+
}
|
|
4206
|
+
function isCursorPluginAvailable(paths) {
|
|
4207
|
+
return detectSurface("cursor").detected || existsSync4(paths.cursorPluginDir) || existsSync4(dirname3(paths.cursorPluginDir)) || readTextIfExists(paths.cursorRulePath) !== null;
|
|
4208
|
+
}
|
|
4109
4209
|
function buildCursorStatus(paths) {
|
|
4110
4210
|
const existingRules = readTextIfExists(paths.cursorRulePath);
|
|
4111
|
-
const available =
|
|
4112
|
-
|
|
4211
|
+
const available = isCursorPluginAvailable(paths);
|
|
4212
|
+
const installed = isCursorPluginInstalled(paths);
|
|
4213
|
+
if (installed) {
|
|
4113
4214
|
return {
|
|
4114
4215
|
target: "cursor",
|
|
4115
4216
|
available: true,
|
|
4116
4217
|
installed: true,
|
|
4117
|
-
message: "Cursor OrgX
|
|
4218
|
+
message: "Cursor OrgX plugin bundle is installed."
|
|
4219
|
+
};
|
|
4220
|
+
}
|
|
4221
|
+
if (existingRules === CURSOR_RULES_CONTENT) {
|
|
4222
|
+
return {
|
|
4223
|
+
target: "cursor",
|
|
4224
|
+
available: true,
|
|
4225
|
+
installed: false,
|
|
4226
|
+
message: "Legacy Cursor OrgX rules are installed; run plugins add cursor to install the full plugin bundle."
|
|
4118
4227
|
};
|
|
4119
4228
|
}
|
|
4120
4229
|
if (existingRules !== null) {
|
|
@@ -4122,14 +4231,14 @@ function buildCursorStatus(paths) {
|
|
|
4122
4231
|
target: "cursor",
|
|
4123
4232
|
available: true,
|
|
4124
4233
|
installed: false,
|
|
4125
|
-
message: "Cursor
|
|
4234
|
+
message: "Cursor rules file exists, but the OrgX plugin bundle is missing."
|
|
4126
4235
|
};
|
|
4127
4236
|
}
|
|
4128
4237
|
return {
|
|
4129
4238
|
target: "cursor",
|
|
4130
4239
|
available,
|
|
4131
4240
|
installed: false,
|
|
4132
|
-
message: available ? "Cursor is available and ready for OrgX
|
|
4241
|
+
message: available ? "Cursor is available and ready for OrgX plugin install." : "Cursor was not detected."
|
|
4133
4242
|
};
|
|
4134
4243
|
}
|
|
4135
4244
|
async function buildClaudeStatus(paths, runner) {
|
|
@@ -4247,28 +4356,19 @@ async function resolveOpenclawTarball(fetchImpl) {
|
|
|
4247
4356
|
version: latestVersion
|
|
4248
4357
|
};
|
|
4249
4358
|
}
|
|
4250
|
-
function installCursorPlugin(paths) {
|
|
4251
|
-
|
|
4252
|
-
const available = detectSurface("cursor").detected || existingRules !== null;
|
|
4253
|
-
if (!available) {
|
|
4359
|
+
async function installCursorPlugin(paths, fetchImpl) {
|
|
4360
|
+
if (!isCursorPluginAvailable(paths)) {
|
|
4254
4361
|
return {
|
|
4255
4362
|
target: "cursor",
|
|
4256
4363
|
changed: false,
|
|
4257
4364
|
message: "Cursor is not available on this machine."
|
|
4258
4365
|
};
|
|
4259
4366
|
}
|
|
4260
|
-
|
|
4261
|
-
return {
|
|
4262
|
-
target: "cursor",
|
|
4263
|
-
changed: false,
|
|
4264
|
-
message: "Cursor OrgX rules are already installed."
|
|
4265
|
-
};
|
|
4266
|
-
}
|
|
4267
|
-
writeTextFile(paths.cursorRulePath, CURSOR_RULES_CONTENT);
|
|
4367
|
+
const syncResult = await syncManagedRepoTree(CURSOR_PLUGIN_SYNC_SPEC, paths.cursorPluginDir, fetchImpl);
|
|
4268
4368
|
return {
|
|
4269
4369
|
target: "cursor",
|
|
4270
|
-
changed:
|
|
4271
|
-
message:
|
|
4370
|
+
changed: syncResult.changed,
|
|
4371
|
+
message: syncResult.changed ? `Synced ${syncResult.fileCount} Cursor plugin files into ${paths.cursorPluginDir}. Reload Cursor to finish loading the plugin.` : "Cursor plugin bundle is already installed and up to date."
|
|
4272
4372
|
};
|
|
4273
4373
|
}
|
|
4274
4374
|
async function installClaudePlugin(paths, fetchImpl, runner) {
|
|
@@ -4379,25 +4479,13 @@ async function installOpenclawPlugin(fetchImpl, runner) {
|
|
|
4379
4479
|
}
|
|
4380
4480
|
function uninstallCursorPlugin(paths) {
|
|
4381
4481
|
const existingRules = readTextIfExists(paths.cursorRulePath);
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
changed: false,
|
|
4386
|
-
message: "Cursor OrgX rules were not installed."
|
|
4387
|
-
};
|
|
4388
|
-
}
|
|
4389
|
-
if (existingRules !== CURSOR_RULES_CONTENT) {
|
|
4390
|
-
return {
|
|
4391
|
-
target: "cursor",
|
|
4392
|
-
changed: false,
|
|
4393
|
-
message: "Cursor rules file differs from the managed OrgX rules, so it was left in place."
|
|
4394
|
-
};
|
|
4395
|
-
}
|
|
4396
|
-
const changed = deleteFileIfExists(paths.cursorRulePath);
|
|
4482
|
+
const removedPluginDir = removePathIfExists(paths.cursorPluginDir);
|
|
4483
|
+
const removedLegacyRules = existingRules === CURSOR_RULES_CONTENT ? deleteFileIfExists(paths.cursorRulePath) : false;
|
|
4484
|
+
const changed = removedPluginDir || removedLegacyRules;
|
|
4397
4485
|
return {
|
|
4398
4486
|
target: "cursor",
|
|
4399
4487
|
changed,
|
|
4400
|
-
message: changed ? "Removed the managed Cursor OrgX rules." : "Cursor OrgX rules were not installed."
|
|
4488
|
+
message: changed ? existingRules !== null && existingRules !== CURSOR_RULES_CONTENT ? "Removed the managed Cursor OrgX plugin bundle. Existing Cursor rules differ from managed OrgX rules, so they were left in place." : "Removed the managed Cursor OrgX plugin bundle and legacy managed Cursor rules." : existingRules !== null && existingRules !== CURSOR_RULES_CONTENT ? "Cursor plugin was not installed. Existing Cursor rules differ from managed OrgX rules, so they were left in place." : "Cursor plugin was not installed."
|
|
4401
4489
|
};
|
|
4402
4490
|
}
|
|
4403
4491
|
async function uninstallClaudePlugin(paths, runner) {
|
|
@@ -4513,7 +4601,7 @@ async function installOrgxPlugins(options = {}) {
|
|
|
4513
4601
|
for (const target of targets) {
|
|
4514
4602
|
switch (target) {
|
|
4515
4603
|
case "cursor":
|
|
4516
|
-
results.push(installCursorPlugin(paths));
|
|
4604
|
+
results.push(await installCursorPlugin(paths, fetchImpl));
|
|
4517
4605
|
break;
|
|
4518
4606
|
case "claude":
|
|
4519
4607
|
results.push(await installClaudePlugin(paths, fetchImpl, runner));
|
|
@@ -4869,6 +4957,15 @@ function buildFounderDemoTelemetryProperties(result, base = {}) {
|
|
|
4869
4957
|
base
|
|
4870
4958
|
);
|
|
4871
4959
|
}
|
|
4960
|
+
function buildFirstValueInitiativeTelemetryProperties(result, base = {}) {
|
|
4961
|
+
return withBaseProperties(
|
|
4962
|
+
{
|
|
4963
|
+
created: result.created,
|
|
4964
|
+
has_live_url: Boolean(result.liveUrl)
|
|
4965
|
+
},
|
|
4966
|
+
base
|
|
4967
|
+
);
|
|
4968
|
+
}
|
|
4872
4969
|
function buildDoctorTelemetryProperties(report, assessment, verification, base = {}) {
|
|
4873
4970
|
const errorCount = assessment.issues.filter((issue) => issue.level === "error").length;
|
|
4874
4971
|
const warningCount = assessment.issues.filter((issue) => issue.level === "warning").length;
|
|
@@ -5005,7 +5102,7 @@ function formatAuthSource(source) {
|
|
|
5005
5102
|
function formatPluginTargetLabel(target) {
|
|
5006
5103
|
switch (target) {
|
|
5007
5104
|
case "cursor":
|
|
5008
|
-
return "Cursor
|
|
5105
|
+
return "Cursor plugin";
|
|
5009
5106
|
case "claude":
|
|
5010
5107
|
return "Claude Code";
|
|
5011
5108
|
case "codex":
|
|
@@ -5051,10 +5148,10 @@ function printPluginMutationReport(report) {
|
|
|
5051
5148
|
}
|
|
5052
5149
|
}
|
|
5053
5150
|
async function printPluginStatusSection() {
|
|
5054
|
-
const spinner = createOrgxSpinner("Checking OrgX plugin
|
|
5151
|
+
const spinner = createOrgxSpinner("Checking OrgX companion plugin status");
|
|
5055
5152
|
spinner.start();
|
|
5056
5153
|
const statuses = await listOrgxPluginStatuses();
|
|
5057
|
-
spinner.succeed("OrgX plugin
|
|
5154
|
+
spinner.succeed("OrgX companion plugin status checked");
|
|
5058
5155
|
console.log("");
|
|
5059
5156
|
console.log(pc3.dim(" plugins"));
|
|
5060
5157
|
printPluginStatusReport(statuses);
|
|
@@ -5161,6 +5258,41 @@ function printWorkspaceSetupResult(result) {
|
|
|
5161
5258
|
console.log(` ${ICON.skip} ${pc3.dim(result.message)}`);
|
|
5162
5259
|
}
|
|
5163
5260
|
}
|
|
5261
|
+
function printSetupScopeNote() {
|
|
5262
|
+
console.log(pc3.dim(" setup updates your AI tools with:"));
|
|
5263
|
+
console.log(` ${ICON.skip} ${pc3.dim("MCP configs for local and cloud OrgX access")}`);
|
|
5264
|
+
console.log(` ${ICON.skip} ${pc3.dim("OrgX agent skills, rules, prompts, commands, and hooks")}`);
|
|
5265
|
+
console.log(` ${ICON.skip} ${pc3.dim("companion plugins where your editor supports them")}`);
|
|
5266
|
+
}
|
|
5267
|
+
function printFirstValueHandoff(input) {
|
|
5268
|
+
const cmd = getCmd();
|
|
5269
|
+
console.log("");
|
|
5270
|
+
console.log(pc3.bold("first OrgX handoff"));
|
|
5271
|
+
console.log(
|
|
5272
|
+
` ${input.initiative.created ? pc3.green("created") : pc3.yellow("ready")} ${pc3.bold(input.initiative.initiative.title)}`
|
|
5273
|
+
);
|
|
5274
|
+
console.log(` live: ${input.initiative.liveUrl}`);
|
|
5275
|
+
console.log(
|
|
5276
|
+
` ${pc3.dim("ask your AI tool:")} ${pc3.cyan(
|
|
5277
|
+
`Use OrgX to continue "${input.initiative.initiative.title}" in ${input.workspace.name}. Show the next action, then start with the onboarding task.`
|
|
5278
|
+
)}`
|
|
5279
|
+
);
|
|
5280
|
+
console.log(` ${pc3.dim("later:")} ${pc3.cyan(`${cmd} doctor`)} ${pc3.dim("checks tool wiring")}`);
|
|
5281
|
+
}
|
|
5282
|
+
function firstValueRecordToResult(record) {
|
|
5283
|
+
if (!record) {
|
|
5284
|
+
return null;
|
|
5285
|
+
}
|
|
5286
|
+
return {
|
|
5287
|
+
created: false,
|
|
5288
|
+
initiative: {
|
|
5289
|
+
id: record.id,
|
|
5290
|
+
title: record.title,
|
|
5291
|
+
...record.summary ? { summary: record.summary } : {}
|
|
5292
|
+
},
|
|
5293
|
+
liveUrl: record.liveUrl
|
|
5294
|
+
};
|
|
5295
|
+
}
|
|
5164
5296
|
function printFounderPresetResult(result) {
|
|
5165
5297
|
printMutationResults(result.surfaceResults);
|
|
5166
5298
|
console.log("");
|
|
@@ -5201,7 +5333,7 @@ async function textPrompt(input) {
|
|
|
5201
5333
|
}
|
|
5202
5334
|
async function multiselectPrompt(input) {
|
|
5203
5335
|
const promptInput = {
|
|
5204
|
-
message: `${input.message} ${pc3.dim("Space
|
|
5336
|
+
message: `${input.message} ${pc3.dim("Space to select, Enter to continue. Defaults are preselected.")}`,
|
|
5205
5337
|
options: input.options,
|
|
5206
5338
|
...input.initialValues ? { initialValues: input.initialValues } : {},
|
|
5207
5339
|
...input.required !== void 0 ? { required: input.required } : {}
|
|
@@ -5308,25 +5440,96 @@ async function maybeConfigureOptionalWorkspaceAddOns(input) {
|
|
|
5308
5440
|
return "skipped";
|
|
5309
5441
|
}
|
|
5310
5442
|
const existingState = readWizardState();
|
|
5311
|
-
const
|
|
5312
|
-
const
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5443
|
+
const providedInitiativeId = input.initiativeId?.trim();
|
|
5444
|
+
const storedDemoInitiative = existingState?.demoInitiative?.workspaceId === input.workspace.id ? existingState.demoInitiative : void 0;
|
|
5445
|
+
const storedFirstValueInitiative = existingState?.firstValueInitiative?.workspaceId === input.workspace.id ? existingState.firstValueInitiative : void 0;
|
|
5446
|
+
let effectiveInitiativeId = providedInitiativeId || storedDemoInitiative?.id || storedFirstValueInitiative?.id;
|
|
5447
|
+
let firstValueInitiative = providedInitiativeId || storedDemoInitiative ? null : firstValueRecordToResult(storedFirstValueInitiative);
|
|
5448
|
+
if (!effectiveInitiativeId) {
|
|
5449
|
+
const firstInitiativeChoice = await selectPrompt({
|
|
5450
|
+
initialValue: "yes",
|
|
5451
|
+
message: `Create your first OrgX initiative in ${input.workspace.name}?`,
|
|
5316
5452
|
options: [
|
|
5317
|
-
{
|
|
5318
|
-
|
|
5453
|
+
{
|
|
5454
|
+
value: "yes",
|
|
5455
|
+
label: "Create first initiative",
|
|
5456
|
+
hint: "recommended; gives setup a live next step"
|
|
5457
|
+
},
|
|
5458
|
+
{ value: "no", label: "Skip initiative creation" }
|
|
5319
5459
|
]
|
|
5320
5460
|
});
|
|
5321
|
-
if (clack.isCancel(
|
|
5461
|
+
if (clack.isCancel(firstInitiativeChoice)) {
|
|
5322
5462
|
clack.cancel("Setup cancelled.");
|
|
5323
5463
|
return "cancelled";
|
|
5324
5464
|
}
|
|
5325
|
-
if (
|
|
5465
|
+
if (firstInitiativeChoice === "yes") {
|
|
5466
|
+
const title = await textPrompt({
|
|
5467
|
+
initialValue: FIRST_VALUE_INITIATIVE_TITLE,
|
|
5468
|
+
message: "What should OrgX help you move forward first?",
|
|
5469
|
+
validate: (value) => {
|
|
5470
|
+
if (!value || value.trim().length === 0) {
|
|
5471
|
+
return "Enter an initiative title.";
|
|
5472
|
+
}
|
|
5473
|
+
return void 0;
|
|
5474
|
+
}
|
|
5475
|
+
});
|
|
5476
|
+
if (clack.isCancel(title)) {
|
|
5477
|
+
clack.cancel("Setup cancelled.");
|
|
5478
|
+
return "cancelled";
|
|
5479
|
+
}
|
|
5480
|
+
const spinner = createOrgxSpinner("Creating your first OrgX initiative and live handoff");
|
|
5481
|
+
spinner.start();
|
|
5482
|
+
try {
|
|
5483
|
+
firstValueInitiative = await ensureFirstValueInitiative(input.workspace, {
|
|
5484
|
+
title: String(title)
|
|
5485
|
+
});
|
|
5486
|
+
spinner.succeed(
|
|
5487
|
+
firstValueInitiative.created ? "First OrgX initiative created" : "First OrgX initiative ready"
|
|
5488
|
+
);
|
|
5489
|
+
effectiveInitiativeId = firstValueInitiative.initiative.id;
|
|
5490
|
+
await safeTrackWizardTelemetry(
|
|
5491
|
+
"first_value_initiative_ready",
|
|
5492
|
+
buildFirstValueInitiativeTelemetryProperties(
|
|
5493
|
+
firstValueInitiative,
|
|
5494
|
+
{
|
|
5495
|
+
command: input.telemetry?.command ?? "setup",
|
|
5496
|
+
...input.telemetry?.preset ? { preset: input.telemetry.preset } : {}
|
|
5497
|
+
}
|
|
5498
|
+
)
|
|
5499
|
+
);
|
|
5500
|
+
} catch (error) {
|
|
5501
|
+
spinner.fail("First OrgX initiative was not created");
|
|
5502
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
5503
|
+
console.log(` ${ICON.warn} ${pc3.yellow("initiative")} ${pc3.dim(message)}`);
|
|
5504
|
+
}
|
|
5505
|
+
}
|
|
5506
|
+
}
|
|
5507
|
+
const hasOnboardingTask = existingState?.onboardingTask?.workspaceId === input.workspace.id;
|
|
5508
|
+
if (!hasOnboardingTask && effectiveInitiativeId) {
|
|
5509
|
+
let shouldCreateOnboardingTask = firstValueInitiative !== null;
|
|
5510
|
+
if (!shouldCreateOnboardingTask) {
|
|
5511
|
+
const onboardingChoice = await selectPrompt({
|
|
5512
|
+
initialValue: "yes",
|
|
5513
|
+
message: `Create a starter onboarding task for ${input.workspace.name}?`,
|
|
5514
|
+
options: [
|
|
5515
|
+
{ value: "yes", label: "Create onboarding task", hint: "recommended" },
|
|
5516
|
+
{ value: "no", label: "Skip task creation" }
|
|
5517
|
+
]
|
|
5518
|
+
});
|
|
5519
|
+
if (clack.isCancel(onboardingChoice)) {
|
|
5520
|
+
clack.cancel("Setup cancelled.");
|
|
5521
|
+
return "cancelled";
|
|
5522
|
+
}
|
|
5523
|
+
shouldCreateOnboardingTask = onboardingChoice === "yes";
|
|
5524
|
+
}
|
|
5525
|
+
if (shouldCreateOnboardingTask) {
|
|
5526
|
+
const spinner = createOrgxSpinner("Creating onboarding workstream and starter task");
|
|
5527
|
+
spinner.start();
|
|
5326
5528
|
try {
|
|
5327
5529
|
const task = await ensureOnboardingTask(input.workspace, {
|
|
5328
5530
|
initiativeId: effectiveInitiativeId
|
|
5329
5531
|
});
|
|
5532
|
+
spinner.succeed("Onboarding workstream and starter task ready");
|
|
5330
5533
|
console.log(` ${ICON.ok} ${pc3.green("onboarding")} ${pc3.bold(task.title)}`);
|
|
5331
5534
|
await safeTrackWizardTelemetry(
|
|
5332
5535
|
"onboarding_task_created",
|
|
@@ -5343,11 +5546,18 @@ async function maybeConfigureOptionalWorkspaceAddOns(input) {
|
|
|
5343
5546
|
)
|
|
5344
5547
|
);
|
|
5345
5548
|
} catch (error) {
|
|
5549
|
+
spinner.fail("Onboarding task was not created");
|
|
5346
5550
|
const message = error instanceof Error ? error.message : String(error);
|
|
5347
5551
|
console.log(` ${ICON.warn} ${pc3.yellow("onboarding")} ${pc3.dim(message)}`);
|
|
5348
5552
|
}
|
|
5349
5553
|
}
|
|
5350
5554
|
}
|
|
5555
|
+
if (firstValueInitiative) {
|
|
5556
|
+
printFirstValueHandoff({
|
|
5557
|
+
initiative: firstValueInitiative,
|
|
5558
|
+
workspace: input.workspace
|
|
5559
|
+
});
|
|
5560
|
+
}
|
|
5351
5561
|
const refreshedState = readWizardState();
|
|
5352
5562
|
const hasAgentRoster = refreshedState?.agentRoster?.workspaceId === input.workspace.id;
|
|
5353
5563
|
if (!hasAgentRoster) {
|
|
@@ -5413,17 +5623,18 @@ async function promptOptionalCompanionPluginTargets(input) {
|
|
|
5413
5623
|
}
|
|
5414
5624
|
let statuses = input.statuses;
|
|
5415
5625
|
if (!statuses) {
|
|
5416
|
-
const spinner = createOrgxSpinner("Checking optional OrgX plugin
|
|
5626
|
+
const spinner = createOrgxSpinner("Checking optional OrgX companion plugin status");
|
|
5417
5627
|
spinner.start();
|
|
5418
5628
|
statuses = await listOrgxPluginStatuses();
|
|
5419
|
-
spinner.succeed("Optional OrgX plugin
|
|
5629
|
+
spinner.succeed("Optional OrgX companion plugin status checked");
|
|
5420
5630
|
}
|
|
5421
5631
|
const installable = statuses.filter((status) => status.available && !status.installed);
|
|
5422
5632
|
if (installable.length === 0) {
|
|
5423
5633
|
return [];
|
|
5424
5634
|
}
|
|
5425
5635
|
const selection = await multiselectPrompt({
|
|
5426
|
-
|
|
5636
|
+
initialValues: installable.map((status) => status.target),
|
|
5637
|
+
message: "Install OrgX companion plugins into your detected AI tools?",
|
|
5427
5638
|
options: installable.map((status) => ({
|
|
5428
5639
|
value: status.target,
|
|
5429
5640
|
label: `Install ${formatPluginTargetLabel(status.target)}`,
|
|
@@ -5438,12 +5649,12 @@ async function promptOptionalCompanionPluginTargets(input) {
|
|
|
5438
5649
|
return selection;
|
|
5439
5650
|
}
|
|
5440
5651
|
function printPluginSkillOwnershipNote(targets) {
|
|
5441
|
-
if (!targets.some((target) => target === "claude" || target === "codex")) {
|
|
5652
|
+
if (!targets.some((target) => target === "cursor" || target === "claude" || target === "codex")) {
|
|
5442
5653
|
return;
|
|
5443
5654
|
}
|
|
5444
5655
|
console.log(
|
|
5445
5656
|
` ${ICON.skip} ${pc3.dim(
|
|
5446
|
-
"Claude Code and Codex companion plugins carry their own OrgX skills. Use 'wizard skills add' for
|
|
5657
|
+
"Cursor, Claude Code, and Codex companion plugins carry their own OrgX skills, rules, MCP config, commands, hooks, and agent prompts. Use 'wizard skills add' only for standalone rules or skills when those plugins are not in play."
|
|
5447
5658
|
)}`
|
|
5448
5659
|
);
|
|
5449
5660
|
}
|
|
@@ -5451,10 +5662,10 @@ async function installSelectedCompanionPlugins(input) {
|
|
|
5451
5662
|
if (input.targets.length === 0) {
|
|
5452
5663
|
return "skipped";
|
|
5453
5664
|
}
|
|
5454
|
-
const spinner = createOrgxSpinner("Installing OrgX companion plugins
|
|
5665
|
+
const spinner = createOrgxSpinner("Installing OrgX companion plugins");
|
|
5455
5666
|
spinner.start();
|
|
5456
5667
|
const report = await installOrgxPlugins({ targets: input.targets });
|
|
5457
|
-
spinner.succeed("OrgX companion plugins
|
|
5668
|
+
spinner.succeed("OrgX companion plugins processed");
|
|
5458
5669
|
printPluginMutationReport(report);
|
|
5459
5670
|
printPluginSkillOwnershipNote(input.targets);
|
|
5460
5671
|
await safeTrackWizardTelemetry("plugins_installed", {
|
|
@@ -5557,7 +5768,7 @@ function printDoctorReport(report, assessment) {
|
|
|
5557
5768
|
async function main() {
|
|
5558
5769
|
const program = new Command();
|
|
5559
5770
|
program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
|
|
5560
|
-
const pkgVersion = true ? "0.1.
|
|
5771
|
+
const pkgVersion = true ? "0.1.13" : void 0;
|
|
5561
5772
|
program.version(pkgVersion ?? "unknown", "-V, --version");
|
|
5562
5773
|
program.hook("preAction", () => {
|
|
5563
5774
|
console.log(renderBanner(pkgVersion));
|
|
@@ -5569,6 +5780,8 @@ async function main() {
|
|
|
5569
5780
|
interactive,
|
|
5570
5781
|
preset: options.preset ?? "standard"
|
|
5571
5782
|
});
|
|
5783
|
+
printSetupScopeNote();
|
|
5784
|
+
console.log("");
|
|
5572
5785
|
if (options.preset) {
|
|
5573
5786
|
if (options.preset !== "founder") {
|
|
5574
5787
|
throw new Error(`Unknown setup preset '${options.preset}'. Supported presets: founder.`);
|
|
@@ -5928,7 +6141,7 @@ async function main() {
|
|
|
5928
6141
|
);
|
|
5929
6142
|
}
|
|
5930
6143
|
});
|
|
5931
|
-
program.command("uninstall").description("Remove OrgX-managed MCP tool configs, companion plugins
|
|
6144
|
+
program.command("uninstall").description("Remove OrgX-managed MCP tool configs, companion plugins, auth, and wizard state from this machine.").option("--keep-auth", "Keep the wizard-local saved OrgX API key.").option("--keep-state", "Keep wizard-local setup state.").option("--skip-plugins", "Skip companion plugin and legacy Cursor rules removal.").option("--skip-surfaces", "Skip MCP tool config removal.").action(async (options) => {
|
|
5932
6145
|
await safeTrackWizardTelemetry("wizard_uninstalled", {
|
|
5933
6146
|
keep_auth: Boolean(options.keepAuth),
|
|
5934
6147
|
keep_state: Boolean(options.keepState),
|
|
@@ -5949,10 +6162,10 @@ async function main() {
|
|
|
5949
6162
|
} else {
|
|
5950
6163
|
console.log("");
|
|
5951
6164
|
console.log(pc3.dim(" plugins"));
|
|
5952
|
-
const spinner = createOrgxSpinner("Removing OrgX companion plugins and rules");
|
|
6165
|
+
const spinner = createOrgxSpinner("Removing OrgX companion plugins and legacy Cursor rules");
|
|
5953
6166
|
spinner.start();
|
|
5954
6167
|
const pluginReport = await uninstallOrgxPlugins({ targets: ["all"] });
|
|
5955
|
-
spinner.succeed("OrgX companion plugins and rules processed");
|
|
6168
|
+
spinner.succeed("OrgX companion plugins and legacy Cursor rules processed");
|
|
5956
6169
|
printPluginMutationReport(pluginReport);
|
|
5957
6170
|
}
|
|
5958
6171
|
console.log("");
|
|
@@ -5994,19 +6207,19 @@ async function main() {
|
|
|
5994
6207
|
const results = removeMcpSurface(names);
|
|
5995
6208
|
printMutationResults(results);
|
|
5996
6209
|
});
|
|
5997
|
-
const plugins = program.command("plugins").description("Install or remove OrgX companion plugins
|
|
5998
|
-
plugins.command("list").description("Show companion plugin
|
|
5999
|
-
const spinner = createOrgxSpinner("Checking OrgX plugin
|
|
6210
|
+
const plugins = program.command("plugins").description("Install or remove OrgX companion plugins in Cursor, Claude Code, Codex, and OpenClaw.");
|
|
6211
|
+
plugins.command("list").description("Show companion plugin availability and install status in your tools.").action(async () => {
|
|
6212
|
+
const spinner = createOrgxSpinner("Checking OrgX companion plugin status");
|
|
6000
6213
|
spinner.start();
|
|
6001
6214
|
const statuses = await listOrgxPluginStatuses();
|
|
6002
|
-
spinner.succeed("OrgX plugin
|
|
6215
|
+
spinner.succeed("OrgX companion plugin status checked");
|
|
6003
6216
|
printPluginStatusReport(statuses);
|
|
6004
6217
|
});
|
|
6005
|
-
plugins.command("add").description("Install OrgX companion plugins
|
|
6006
|
-
const spinner = createOrgxSpinner("Installing OrgX companion plugins
|
|
6218
|
+
plugins.command("add").description("Install OrgX companion plugins into Cursor, Claude Code, Codex, and OpenClaw.").argument("[targets...]", "cursor, claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
|
|
6219
|
+
const spinner = createOrgxSpinner("Installing OrgX companion plugins");
|
|
6007
6220
|
spinner.start();
|
|
6008
6221
|
const report = await installOrgxPlugins({ targets });
|
|
6009
|
-
spinner.succeed("OrgX companion plugins
|
|
6222
|
+
spinner.succeed("OrgX companion plugins processed");
|
|
6010
6223
|
printPluginMutationReport(report);
|
|
6011
6224
|
printPluginSkillOwnershipNote(report.results.map((result) => result.target));
|
|
6012
6225
|
await safeTrackWizardTelemetry("plugins_installed", {
|
|
@@ -6016,11 +6229,11 @@ async function main() {
|
|
|
6016
6229
|
target_count: report.results.length
|
|
6017
6230
|
});
|
|
6018
6231
|
});
|
|
6019
|
-
plugins.command("remove").description("Uninstall managed OrgX companion plugins
|
|
6020
|
-
const spinner = createOrgxSpinner("Removing OrgX companion plugins
|
|
6232
|
+
plugins.command("remove").description("Uninstall managed OrgX companion plugins and legacy managed Cursor rules from Cursor, Claude Code, Codex, and OpenClaw.").argument("[targets...]", "cursor, claude, codex, openclaw, or all", ["all"]).action(async (targets) => {
|
|
6233
|
+
const spinner = createOrgxSpinner("Removing OrgX companion plugins and legacy Cursor rules");
|
|
6021
6234
|
spinner.start();
|
|
6022
6235
|
const report = await uninstallOrgxPlugins({ targets });
|
|
6023
|
-
spinner.succeed("OrgX companion plugins
|
|
6236
|
+
spinner.succeed("OrgX companion plugins and legacy Cursor rules processed");
|
|
6024
6237
|
printPluginMutationReport(report);
|
|
6025
6238
|
await safeTrackWizardTelemetry("plugins_removed", {
|
|
6026
6239
|
changed_count: countPluginReportChanges(report),
|