@useorgx/wizard 0.1.19 → 0.1.20

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 CHANGED
@@ -4975,6 +4975,7 @@ function countPluginReportChanges(report) {
4975
4975
  // src/lib/setup-workspace.ts
4976
4976
  var CREATE_WORKSPACE_VALUE = "__create_workspace__";
4977
4977
  var SKIP_WORKSPACE_VALUE = "__skip_workspace__";
4978
+ var REAUTH_WORKSPACE_VALUE = "__reauth_workspace__";
4978
4979
  function trimDescription(value) {
4979
4980
  const trimmed = value.trim();
4980
4981
  return trimmed.length > 0 ? trimmed : void 0;
@@ -5084,24 +5085,35 @@ async function runWorkspaceSetup(client, prompts, options) {
5084
5085
  const currentWorkspace = workspaces.length > 0 ? await client.getCurrentWorkspace().catch(() => workspaces.find((workspace) => workspace.isDefault) ?? null) : null;
5085
5086
  if (workspaces.length === 0) {
5086
5087
  const action = await prompts.select({
5087
- message: "No OrgX workspaces were found. What should setup do next?",
5088
+ message: "OrgX authenticated, but returned 0 workspaces for this key. How should setup proceed?",
5088
5089
  options: [
5090
+ {
5091
+ value: REAUTH_WORKSPACE_VALUE,
5092
+ label: "Re-authenticate (recommended if you expected workspaces)",
5093
+ hint: "Run `wizard auth login` to re-link via OAuth if your API key is bound to a different user identity."
5094
+ },
5089
5095
  {
5090
5096
  value: CREATE_WORKSPACE_VALUE,
5091
5097
  label: "Create a new workspace",
5092
- hint: "Create one now and set it as the default for this machine."
5098
+ hint: "Use this only for a truly new account \u2014 this will fork data if your key is misbound."
5093
5099
  },
5094
5100
  {
5095
5101
  value: SKIP_WORKSPACE_VALUE,
5096
5102
  label: "Skip for now",
5097
- hint: "Finish surface setup without creating a workspace."
5103
+ hint: "Finish surface setup without touching workspaces."
5098
5104
  }
5099
5105
  ],
5100
- initialValue: CREATE_WORKSPACE_VALUE
5106
+ initialValue: REAUTH_WORKSPACE_VALUE
5101
5107
  });
5102
5108
  if (prompts.isCancel(action)) {
5103
5109
  return cancelResult(prompts);
5104
5110
  }
5111
+ if (action === REAUTH_WORKSPACE_VALUE) {
5112
+ return {
5113
+ message: "Re-authentication requested. Run `wizard auth login`, then rerun `wizard setup`.",
5114
+ status: "reauth_requested"
5115
+ };
5116
+ }
5105
5117
  if (action === SKIP_WORKSPACE_VALUE) {
5106
5118
  return {
5107
5119
  message: "Workspace bootstrap skipped.",
@@ -6944,7 +6956,7 @@ function printDoctorReport(report, assessment) {
6944
6956
  async function main() {
6945
6957
  const program = new Command();
6946
6958
  program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
6947
- const pkgVersion = true ? "0.1.19" : void 0;
6959
+ const pkgVersion = true ? "0.1.20" : void 0;
6948
6960
  program.version(pkgVersion ?? "unknown", "-V, --version");
6949
6961
  program.hook("preAction", () => {
6950
6962
  console.log(renderBanner(pkgVersion));
@@ -7122,6 +7134,22 @@ async function main() {
7122
7134
  if (workspaceSetup.status === "cancelled") {
7123
7135
  return;
7124
7136
  }
7137
+ if (workspaceSetup.status === "reauth_requested") {
7138
+ console.log("");
7139
+ console.log(
7140
+ ` ${ICON.warn} ${pc3.yellow("workspace")} ${pc3.dim("API key authenticated but returned 0 workspaces \u2014 likely an identity mismatch.")}`
7141
+ );
7142
+ console.log(` ${pc3.cyan(`${getCmd()} auth login`)} ${pc3.dim("\u2192 re-link via OAuth, then rerun")} ${pc3.cyan(`${getCmd()} setup`)}`);
7143
+ await safeTrackWizardTelemetry(
7144
+ "workspace_bootstrapped",
7145
+ buildWorkspaceSetupTelemetryProperties(workspaceSetup, {
7146
+ command: "setup",
7147
+ interactive,
7148
+ preset: "standard"
7149
+ })
7150
+ );
7151
+ return;
7152
+ }
7125
7153
  await safeTrackWizardTelemetry(
7126
7154
  "workspace_bootstrapped",
7127
7155
  buildWorkspaceSetupTelemetryProperties(workspaceSetup, {