@useorgx/wizard 0.1.47 → 0.1.48

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 CHANGED
@@ -1,6 +1,9 @@
1
1
  # @useorgx/wizard
2
2
 
3
- One-line CLI onboarding that adds OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.
3
+ One-line CLI onboarding and AQ profiling for local AI work. The wizard can add
4
+ OrgX MCP configs, skills/rules, and companion plugins, then scan real AI-session
5
+ receipts to show your current Agentic Quotient, reachable ceiling, and first
6
+ repair that raises execution capacity.
4
7
 
5
8
  ## Quick Start
6
9
 
@@ -23,6 +26,9 @@ The wizard modifies local tool configuration only. Depending on the command, it
23
26
  ## Commands
24
27
 
25
28
  - `setup` adds OrgX MCP configs, standalone skills/rules, and companion plugins to detected AI tools. When OrgX auth is available in an interactive shell, it guides workspace selection or creation, can create the user's first live OrgX initiative, creates a starter onboarding task under that initiative, and prints a handoff prompt for the configured AI tool of choice. The founder preset preplans plugin installs before it writes standalone skills so plugin-backed hosts do not get duplicate standalone assets in the same run.
29
+ - `work-graph profile --from all --publish --public-share` runs AQ from recent AI-work receipts, publishes a redacted profile, and prints the first AQ-lifting repair to execute next.
30
+ - `work-graph preview --from all` shows the AQ readout locally without publishing.
31
+ - `work-graph runtime-event --source codex|claude --summary "..."` lets an agent write public-safe runtime evidence that the next AQ profile can collect.
26
32
  - `surface list` shows supported surfaces and current status.
27
33
  - `surface add <name>` patches a specific surface.
28
34
  - `surface remove <name>` removes OrgX-managed config from a specific surface.
@@ -63,6 +69,7 @@ The wizard modifies local tool configuration only. Depending on the command, it
63
69
  - If the selected workspace has no remembered setup initiative, `wizard setup` offers to create a first initiative, defaulting to `Make OrgX useful on this machine`. It then creates the onboarding workstream and starter task inside that initiative so setup ends with a concrete next action instead of a blank workspace.
64
70
  - Repeated setup runs are intentionally quiet. Daily Brief can be configured with defaults, customized, or skipped; skips for Daily Brief, first initiative creation, onboarding task creation, agent roster setup, and the first intent prompt are remembered per workspace so the wizard does not ask again on every run.
65
71
  - After the first initiative is ready, setup prints the `/live/<initiative>` URL and a copyable prompt for the user's configured AI tool: continue the initiative, show the next action, and start with the onboarding task.
72
+ - The AQ loop is: run profile, claim the public Work Graph, start the selected repair quest in OrgX, attach proof, rerun the profile, and compare the AQ delta.
66
73
  - `wizard workspace current` reads the current OrgX workspace from `GET /api/v1/workspaces/current`, with a fallback to workspace listing if that route is unavailable.
67
74
  - `wizard workspace list` lists all accessible workspaces.
68
75
  - `wizard workspace create "Founders" --description "Initial OrgX workspace"` creates a new workspace through `POST /api/entities`.
package/dist/cli.js CHANGED
@@ -3163,6 +3163,9 @@ var CODEX_PLUGIN_SYNC_SPEC = {
3163
3163
  { localPath: ".codex-plugin", remotePath: ".codex-plugin" },
3164
3164
  { localPath: ".mcp.json", remotePath: ".mcp.json" },
3165
3165
  { localPath: "assets", remotePath: "assets" },
3166
+ // Deliver the runtime hooks (Work Graph reconcile + execution-graph emit)
3167
+ // so the WEG keystone actually installs for Codex, not just Cursor/Claude.
3168
+ { localPath: "hooks", remotePath: "hooks" },
3166
3169
  { localPath: "skills", remotePath: "skills" }
3167
3170
  ]
3168
3171
  };
@@ -12006,11 +12009,19 @@ function renderWorkGraphShareables(report, options) {
12006
12009
  lines.push("");
12007
12010
  const aq = report.agentic_quotient;
12008
12011
  const topQuest = aq.repair_quests[0];
12012
+ const strongestTrail = markdownPublicTrails(report)[0];
12013
+ const firstMove = topQuest ? `${topQuest.title} (+${topQuest.expected_aq_lift} AQ): ${topQuest.reason}` : "Claim the profile and turn the strongest evidence path into owner-visible work with linked proof.";
12009
12014
  lines.push("Suggested share copy:");
12010
12015
  lines.push(`- AQ ${aq.aq}. Stack ${aq.stack_score}. Durable ${aq.durability_score}. Gap ${aq.agentic_gap}. ${aq.archetype.label}. Receipts attached.`);
12011
12016
  lines.push(`- Just ran my AQ. ${topQuest ? `Next repair: ${topQuest.title} (+${topQuest.expected_aq_lift} AQ).` : "The gap is the game."}`);
12012
12017
  lines.push(`- Receipts > vibes. AQ ${aq.aq} with ${report.impact_projection.time_saved_hours_per_week}h/week recoverable.`);
12013
12018
  lines.push("");
12019
+ lines.push("First executable move:");
12020
+ lines.push(`- ${firstMove}`);
12021
+ if (strongestTrail) {
12022
+ lines.push(`- Evidence path: ${markdownPublicTitle(strongestTrail.title, "Top work loop")}`);
12023
+ }
12024
+ lines.push("");
12014
12025
  return lines;
12015
12026
  }
12016
12027
  function renderWorkGraphMarkdown(report, options = {}) {
@@ -12137,6 +12148,17 @@ function renderWorkGraphMarkdown(report, options = {}) {
12137
12148
  lines.push(report.agentic_quotient.archetype.roast);
12138
12149
  lines.push(report.agentic_quotient.archetype.truth);
12139
12150
  lines.push("");
12151
+ if (report.agentic_quotient.repair_quests[0]) {
12152
+ const quest = report.agentic_quotient.repair_quests[0];
12153
+ const primaryTrail = markdownPublicTrails(report)[0];
12154
+ lines.push("First executable move:");
12155
+ lines.push(`- ${quest.title} (+${quest.expected_aq_lift} AQ): ${quest.reason}`);
12156
+ if (primaryTrail) {
12157
+ lines.push(`- Starts from: ${markdownPublicTitle(primaryTrail.title, "Top work loop")}`);
12158
+ }
12159
+ lines.push(`- Why it matters: moves AQ ${report.agentic_quotient.aq} toward ${report.agentic_quotient.ceiling} by closing proof, source, or writeback gaps.`);
12160
+ lines.push("");
12161
+ }
12140
12162
  if (report.agentic_quotient.repair_quests.length > 0) {
12141
12163
  lines.push("Repair quests:");
12142
12164
  for (const quest of report.agentic_quotient.repair_quests) {
@@ -12760,6 +12782,7 @@ import { copyFileSync, existsSync as existsSync9, mkdirSync as mkdirSync3 } from
12760
12782
  import { homedir as homedir3 } from "os";
12761
12783
  import { dirname as dirname4, join as join7 } from "path";
12762
12784
  var HOOK_MARKER = "orgx-session-hook.mjs";
12785
+ var EMIT_HOOK_MARKER = "orgx-emit-execution-graph.mjs";
12763
12786
  var HOOK_EVENTS = ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PermissionRequest", "Stop"];
12764
12787
  var CLAUDE_HOOK_EVENTS = ["SessionStart", "UserPromptSubmit", "PreToolUse", "PostToolUse", "SubagentStop", "Stop", "SessionEnd"];
12765
12788
  function defaultPaths(options = {}) {
@@ -12769,6 +12792,7 @@ function defaultPaths(options = {}) {
12769
12792
  codexConfigPath: options.codexConfigPath ?? CODEX_CONFIG_PATH ?? join7(CODEX_DIR, "config.toml"),
12770
12793
  codexHooksPath: options.codexHooksPath ?? join7(CODEX_DIR, "hooks.json"),
12771
12794
  hookScriptPath: options.hookScriptPath ?? join7(hookDir, HOOK_MARKER),
12795
+ emitHookScriptPath: options.emitHookScriptPath ?? join7(hookDir, EMIT_HOOK_MARKER),
12772
12796
  outboxPath: options.outboxPath ?? join7(hookDir, "events.jsonl")
12773
12797
  };
12774
12798
  }
@@ -12889,6 +12913,140 @@ function buildHookCommand(params) {
12889
12913
  `--outbox=${params.outboxPath}`
12890
12914
  ].join(" ");
12891
12915
  }
12916
+ function buildExecutionGraphEmitScriptContent() {
12917
+ return `#!/usr/bin/env node
12918
+ import { readFileSync } from "node:fs";
12919
+
12920
+ function parseArgs(argv) {
12921
+ const args = {};
12922
+ for (const arg of argv) {
12923
+ if (!arg.startsWith("--")) continue;
12924
+ const i = arg.indexOf("=");
12925
+ if (i < 0) args[arg.slice(2)] = "true";
12926
+ else args[arg.slice(2, i)] = arg.slice(i + 1);
12927
+ }
12928
+ return args;
12929
+ }
12930
+ function truthy(v) {
12931
+ return typeof v === "string" && ["1", "true", "yes", "on"].includes(v.toLowerCase());
12932
+ }
12933
+ function pick() {
12934
+ for (let i = 0; i < arguments.length; i++) {
12935
+ const v = arguments[i];
12936
+ if (typeof v === "string" && v.trim()) return v.trim();
12937
+ }
12938
+ return undefined;
12939
+ }
12940
+ function clamp(s, m) {
12941
+ return typeof s === "string" ? s.slice(0, m) : undefined;
12942
+ }
12943
+ async function readStdin() {
12944
+ try {
12945
+ const c = [];
12946
+ for await (const ch of process.stdin) c.push(Buffer.from(ch));
12947
+ return Buffer.concat(c).toString("utf8");
12948
+ } catch (e) {
12949
+ return "";
12950
+ }
12951
+ }
12952
+ function jsonl(raw) {
12953
+ const out = [];
12954
+ if (typeof raw !== "string") return out;
12955
+ for (const line of raw.split(String.fromCharCode(10))) {
12956
+ const t = line.trim();
12957
+ if (!t) continue;
12958
+ try { out.push(JSON.parse(t)); } catch (e) {}
12959
+ }
12960
+ return out;
12961
+ }
12962
+ function blocks(entry) {
12963
+ const m = entry && (entry.message || entry);
12964
+ const c = m && m.content;
12965
+ return Array.isArray(c) ? c : [];
12966
+ }
12967
+ function derive(entries, max) {
12968
+ const errs = new Map();
12969
+ for (const e of entries) for (const b of blocks(e)) {
12970
+ if (b && b.type === "tool_result" && b.tool_use_id) errs.set(b.tool_use_id, !!b.is_error);
12971
+ }
12972
+ const steps = [];
12973
+ for (const e of entries) for (const b of blocks(e)) {
12974
+ if (b && b.type === "tool_use") steps.push({ id: b.id, name: typeof b.name === "string" ? b.name : "tool" });
12975
+ }
12976
+ const nodes = [{ id: "session", type: "task", title: "Claude Code session", status: "completed", requires_evidence: false }];
12977
+ const capped = steps.slice(-(max - 1));
12978
+ for (let i = 0; i < capped.length; i++) {
12979
+ const s = capped[i];
12980
+ nodes.push({ id: "step-" + (i + 1), type: "step", title: clamp(s.name, 500), status: errs.get(s.id) === true ? "failed" : "completed", requires_evidence: false });
12981
+ }
12982
+ return nodes;
12983
+ }
12984
+ function authHeaders(env) {
12985
+ if (env.ORGX_CLIENT_KEY) return { Authorization: "Bearer " + env.ORGX_CLIENT_KEY };
12986
+ if (env.ORGX_API_KEY) {
12987
+ const h = { Authorization: "Bearer " + env.ORGX_API_KEY };
12988
+ if (env.ORGX_USER_ID) h["X-Orgx-User-Id"] = env.ORGX_USER_ID;
12989
+ return h;
12990
+ }
12991
+ if (env.ORGX_SERVICE_KEY && env.ORGX_USER_ID) return { Authorization: "Bearer " + env.ORGX_SERVICE_KEY, "X-Orgx-User-Id": env.ORGX_USER_ID };
12992
+ return null;
12993
+ }
12994
+ (async () => {
12995
+ try {
12996
+ const args = parseArgs(process.argv.slice(2));
12997
+ const env = process.env;
12998
+ if (!(truthy(args.enabled) || truthy(env.ORGX_EMIT_EXECUTION_GRAPH))) return;
12999
+ const initiative = pick(env.ORGX_INITIATIVE_ID, args.initiative);
13000
+ if (!initiative) return;
13001
+ const auth = authHeaders(env);
13002
+ if (!auth) return;
13003
+ const raw = await readStdin();
13004
+ let hook = {};
13005
+ try { hook = raw && raw.trim() ? JSON.parse(raw) : {}; } catch (e) { hook = {}; }
13006
+ const tp = pick(env.ORGX_TRANSCRIPT_PATH, hook.transcript_path);
13007
+ let entries = [];
13008
+ if (tp) { try { entries = jsonl(readFileSync(tp, "utf8")); } catch (e) { entries = []; } }
13009
+ let max = parseInt(env.ORGX_EMIT_MAX_NODES || "", 10);
13010
+ if (!Number.isFinite(max)) max = 40;
13011
+ const nodes = derive(entries, max);
13012
+ const sc = pick(args.source_client, env.ORGX_SOURCE_CLIENT, "claude-code");
13013
+ const event = {
13014
+ schema_version: "1.0.0",
13015
+ initiative_id: initiative,
13016
+ source_client: sc,
13017
+ summary: clamp(env.ORGX_EMIT_SUMMARY, 2000) || (sc + " session: " + (nodes.length - 1) + " step(s)"),
13018
+ nodes: nodes,
13019
+ edges: [],
13020
+ trust_events: [],
13021
+ metadata: { emitter: "orgx-wizard-runtime-hook", via: "stop-hook" },
13022
+ };
13023
+ if (env.ORGX_RUN_ID) event.run_id = env.ORGX_RUN_ID;
13024
+ else event.correlation_id = clamp(pick(hook.session_id, env.ORGX_CORRELATION_ID) || (sc + "-" + initiative), 120);
13025
+ let base = env.ORGX_BASE_URL || "https://useorgx.com";
13026
+ while (base.endsWith("/")) base = base.slice(0, -1);
13027
+ const ctrl = new AbortController();
13028
+ const timer = setTimeout(() => ctrl.abort(), parseInt(env.ORGX_EMIT_TIMEOUT_MS || "", 10) || 4000);
13029
+ try {
13030
+ await fetch(base + "/api/client/live/execution-graph", {
13031
+ method: "POST",
13032
+ headers: Object.assign({ "Content-Type": "application/json" }, auth),
13033
+ body: JSON.stringify(event),
13034
+ signal: ctrl.signal,
13035
+ });
13036
+ } catch (e) {} finally { clearTimeout(timer); }
13037
+ } catch (e) {}
13038
+ process.exit(0);
13039
+ })();
13040
+ `;
13041
+ }
13042
+ function buildEmitHookCommand(params) {
13043
+ return [
13044
+ "node",
13045
+ JSON.stringify(params.emitHookScriptPath),
13046
+ "--enabled=true",
13047
+ `--source_client=${params.sourceClient}`
13048
+ ].join(" ");
13049
+ }
12892
13050
  function mergeCodexHooks(raw, paths) {
12893
13051
  const value = parseJsonObject(raw);
12894
13052
  const hooks = isRecord(value.hooks) ? value.hooks : {};
@@ -12940,6 +13098,20 @@ function mergeClaudeHooks(raw, paths) {
12940
13098
  rule.hooks = hooks;
12941
13099
  changed = true;
12942
13100
  }
13101
+ if (event === "Stop") {
13102
+ const emitCommand = buildEmitHookCommand({
13103
+ emitHookScriptPath: paths.emitHookScriptPath,
13104
+ sourceClient: "claude-code"
13105
+ });
13106
+ const emitAlready = hooks.some(
13107
+ (entry) => isRecord(entry) && entry.type === "command" && typeof entry.command === "string" && entry.command.includes(EMIT_HOOK_MARKER)
13108
+ );
13109
+ if (!emitAlready) {
13110
+ hooks.push({ type: "command", command: emitCommand });
13111
+ rule.hooks = hooks;
13112
+ changed = true;
13113
+ }
13114
+ }
12943
13115
  hooksRoot[event] = list;
12944
13116
  }
12945
13117
  value.hooks = hooksRoot;
@@ -12980,7 +13152,8 @@ function inspectRuntimeHooks(options = {}) {
12980
13152
  installed: {
12981
13153
  claudeCode: hasOrgxHook(claudeSettingsRaw),
12982
13154
  codex: hasOrgxHook(codexHooksRaw),
12983
- hookScript: existsSync9(paths.hookScriptPath)
13155
+ hookScript: existsSync9(paths.hookScriptPath),
13156
+ emitHookScript: existsSync9(paths.emitHookScriptPath)
12984
13157
  },
12985
13158
  codex: {
12986
13159
  configExists: Boolean(codexConfigRaw),
@@ -12999,7 +13172,8 @@ function installRuntimeHooks(targets, options = {}) {
12999
13172
  claudeCode: false,
13000
13173
  codex: false,
13001
13174
  codexConfig: false,
13002
- hookScript: false
13175
+ hookScript: false,
13176
+ emitHookScript: false
13003
13177
  };
13004
13178
  mkdirSync3(dirname4(paths.hookScriptPath), { recursive: true, mode: 448 });
13005
13179
  const scriptContent = buildRuntimeHookScriptContent();
@@ -13009,6 +13183,14 @@ function installRuntimeHooks(targets, options = {}) {
13009
13183
  writeTextFile(paths.hookScriptPath, scriptContent, { mode: 448 });
13010
13184
  changed.hookScript = true;
13011
13185
  }
13186
+ mkdirSync3(dirname4(paths.emitHookScriptPath), { recursive: true, mode: 448 });
13187
+ const emitScriptContent = buildExecutionGraphEmitScriptContent();
13188
+ if (readTextIfExists(paths.emitHookScriptPath) !== emitScriptContent) {
13189
+ const backup = backupExisting(paths.emitHookScriptPath, now);
13190
+ if (backup) backups.push(backup);
13191
+ writeTextFile(paths.emitHookScriptPath, emitScriptContent, { mode: 448 });
13192
+ changed.emitHookScript = true;
13193
+ }
13012
13194
  if (targets.includes("codex")) {
13013
13195
  const rawConfig = readTextIfExists(paths.codexConfigPath);
13014
13196
  const nextConfig = ensureCodexHooksFeature(rawConfig);
@@ -13136,6 +13318,15 @@ function printMutationResults(results) {
13136
13318
  }
13137
13319
  function printSurfaceSummary(results) {
13138
13320
  const summarized = summarizeMutationResults(results);
13321
+ if (summarized.length === 0) {
13322
+ console.log(
13323
+ ` ${ICON.skip} ${pc3.dim("No supported AI tools detected on this machine.")}`
13324
+ );
13325
+ console.log(
13326
+ ` ${pc3.dim("\u2192")} ${pc3.dim("Install Claude, Cursor, Codex, VS Code, Windsurf, or Zed, then re-run setup.")}`
13327
+ );
13328
+ return;
13329
+ }
13139
13330
  const updated = summarized.filter((r) => r.state === "updated");
13140
13331
  if (updated.length === 0) {
13141
13332
  console.log(
@@ -13683,6 +13874,11 @@ async function runWorkGraphCommand(options, defaults = {}) {
13683
13874
  console.log(` ${ICON.ok} ${pc3.green("score ")} ${pc3.dim(formatWorkGraphScoreLine(report.opportunity_score))}`);
13684
13875
  console.log(` ${ICON.ok} ${pc3.green("AQ ")} ${pc3.dim(`${report.agentic_quotient.aq}/100 \xB7 Stack ${report.agentic_quotient.stack_score}/100 \xB7 Durable ${report.agentic_quotient.durability_score}/100 \xB7 Gap ${report.agentic_quotient.agentic_gap}`)}`);
13685
13876
  console.log(` ${ICON.ok} ${pc3.green("archetype ")} ${pc3.dim(report.agentic_quotient.archetype.label)}`);
13877
+ const topQuest = report.agentic_quotient.repair_quests[0];
13878
+ if (topQuest) {
13879
+ console.log(` ${ICON.ok} ${pc3.green("first lift ")} ${pc3.bold(`+${topQuest.expected_aq_lift} AQ`)} ${pc3.dim(topQuest.title)}`);
13880
+ console.log(` ${ICON.skip} ${pc3.bold("why now ")} ${topQuest.reason}`);
13881
+ }
13686
13882
  console.log(` ${ICON.ok} ${pc3.green("audit quality ")} ${pc3.dim(`${report.execution_quality.overall}/100 \xB7 coverage ${report.source_coverage.coverage_score ?? 0}/100`)}`);
13687
13883
  console.log(` ${ICON.ok} ${pc3.green("page quality ")} ${pc3.dim(`${report.page_quality.overall}/100 \xB7 clarity ${report.page_quality.clarity}/100 \xB7 trust ${report.page_quality.trust}/100`)}`);
13688
13884
  console.log(` ${ICON.ok} ${pc3.green("impact ")} ${pc3.dim(`${report.impact_projection.time_saved_hours_per_week}h/week \xB7 +${report.impact_projection.acceleration_percent}% acceleration \xB7 ~$${report.impact_projection.estimated_monthly_value_usd.toLocaleString("en-US")}/month`)}`);
@@ -14724,11 +14920,12 @@ function printDoctorReport(report, assessment) {
14724
14920
  console.log("");
14725
14921
  const configuredCount = report.surfaces.filter((s) => s.configured).length;
14726
14922
  if (assessment.issues.length === 0) {
14727
- console.log(` ${ICON.ok} ${pc3.green("All systems ready.")}`);
14728
14923
  if (!report.auth.configured) {
14924
+ console.log(` ${ICON.warn} ${pc3.yellow("Not set up yet \u2014 pair this terminal to finish.")}`);
14729
14925
  console.log(`
14730
- ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} auth login`)} ${pc3.dim("to connect your account")}`);
14926
+ ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} setup`)} ${pc3.dim("configures your AI tools and pairs your account")}`);
14731
14927
  } else {
14928
+ console.log(` ${ICON.ok} ${pc3.green("All systems ready.")}`);
14732
14929
  console.log(` ${pc3.dim("\u2192")} ${pc3.dim(`OrgX is active across ${configuredCount} editor${configuredCount !== 1 ? "s" : ""}`)}`);
14733
14930
  }
14734
14931
  } else if (verification.transientTimeouts) {
@@ -14750,7 +14947,7 @@ function printDoctorReport(report, assessment) {
14750
14947
  async function main() {
14751
14948
  const program = new Command();
14752
14949
  program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
14753
- const pkgVersion = true ? "0.1.47" : void 0;
14950
+ const pkgVersion = true ? "0.1.48" : void 0;
14754
14951
  program.version(pkgVersion ?? "unknown", "-V, --version");
14755
14952
  program.hook("preAction", (_thisCommand, actionCommand) => {
14756
14953
  if (Boolean(actionCommand.optsWithGlobals().json)) return;
@@ -15467,7 +15664,7 @@ async function main() {
15467
15664
  });
15468
15665
  await runAuditCommand(options);
15469
15666
  });
15470
- const workGraph = program.command("work-graph").description("Build a redacted OrgX Profile from AI-client session search, Slack, MCP, or manual context.");
15667
+ const workGraph = program.command("work-graph").description("Run AQ from real AI-work receipts and surface the first repair that raises execution capacity.");
15471
15668
  workGraph.command("extraction-schema").description("Print the packaged AI-client audit skill used to search sessions, messages, tools, domains, and logs.").option("--output <path>", "write the schema prompt to a file").option("--json", "emit the protocol as JSON instead of Markdown").action(async (options) => {
15472
15669
  await safeTrackWizardTelemetry("work_graph_extraction_schema_started", {
15473
15670
  command: "work-graph extraction-schema",
@@ -15478,14 +15675,14 @@ async function main() {
15478
15675
  workGraph.command("runtime-event").description("Write a redacted Codex/Claude runtime packet into the Work Graph collector directory.").requiredOption("--source <source>", "agent source writing the packet: codex or claude").option("--summary <text>", "public-safe summary of the decision, artifact, blocker, outcome, or tool event").option("--message <text>", "alias for --summary").option("--event-kind <kind>", "event kind hint: decision, artifact, blocker, outcome, tool_call_error", "artifact").option("--role <role>", "source role: user, assistant, tool, or meta", "assistant").option("--tool-name <name>", "tool name when the packet represents a tool call").option("--cwd <path>", "workspace root that owns the collector directory").option("--output-dir <path>", "collector root relative to cwd", ".orgx/work-graph/runtime-events").option("--json", "emit a JSON summary").action((options) => {
15479
15676
  runWorkGraphRuntimeEventCommand(options);
15480
15677
  });
15481
- workGraph.command("preview").description("Preview the OrgX Profile evidence findings without writing to OrgX.").option("--input <path>", "source transcript or summary file; stdin is used when piped").option("--extraction <path>", "structured AI-client extraction JSON; repeat or comma-separate for multiple clients", collectPathOption, []).option("--from <sources>", "auto-import recent local AI sessions: claude, codex, opencode, goose, cursor, github, slack, or all").option("--session-limit <count>", "max recent sessions to import per selected source", "15").option("--session-days <days>", "lookback window for local AI-session imports", "60").option("--codex-sessions-dir <path>", "override Codex sessions directory for import").option("--claude-projects-dir <path>", "override Claude projects directory for import").option("--source-label <label>", "label for the imported manual source").option("--workspace-id <id>", "workspace id override; defaults to the current OrgX workspace when authenticated").option("--workspace-name <name>", "workspace name override for local-only previews").option("--output-dir <path>", "directory for generated Work Graph JSON and Markdown", ".orgx/work-graph").option("--json", "emit a JSON command summary").action(async (options) => {
15678
+ workGraph.command("preview").description("Preview AQ, evidence paths, and the first repair without writing to OrgX.").option("--input <path>", "source transcript or summary file; stdin is used when piped").option("--extraction <path>", "structured AI-client extraction JSON; repeat or comma-separate for multiple clients", collectPathOption, []).option("--from <sources>", "auto-import recent local AI sessions: claude, codex, opencode, goose, cursor, github, slack, or all").option("--session-limit <count>", "max recent sessions to import per selected source", "15").option("--session-days <days>", "lookback window for local AI-session imports", "60").option("--codex-sessions-dir <path>", "override Codex sessions directory for import").option("--claude-projects-dir <path>", "override Claude projects directory for import").option("--source-label <label>", "label for the imported manual source").option("--workspace-id <id>", "workspace id override; defaults to the current OrgX workspace when authenticated").option("--workspace-name <name>", "workspace name override for local-only previews").option("--output-dir <path>", "directory for generated Work Graph JSON and Markdown", ".orgx/work-graph").option("--json", "emit a JSON command summary").action(async (options) => {
15482
15679
  await safeTrackWizardTelemetry("work_graph_preview_started", {
15483
15680
  command: "work-graph preview",
15484
15681
  from: options.from ?? "manual"
15485
15682
  });
15486
15683
  await runWorkGraphCommand(options);
15487
15684
  });
15488
- workGraph.command("profile").description("Build a local OrgX Profile with evidence findings, domain coverage, source confidence, and repair recommendations.").option("--input <path>", "source transcript or summary file; stdin is used when piped").option("--extraction <path>", "structured AI-client extraction JSON; repeat or comma-separate for multiple clients", collectPathOption, []).option("--from <sources>", "auto-import recent local AI sessions: claude, codex, opencode, goose, cursor, github, slack, or all").option("--session-limit <count>", "max recent sessions to import per selected source", "25").option("--session-days <days>", "lookback window for local AI-session imports", "60").option("--codex-sessions-dir <path>", "override Codex sessions directory for import").option("--claude-projects-dir <path>", "override Claude projects directory for import").option("--source-label <label>", "label for the imported manual source").option("--workspace-id <id>", "workspace id override; defaults to the current OrgX workspace when authenticated").option("--workspace-name <name>", "workspace name override for local-only profiles").option("--output-dir <path>", "directory for generated Work Graph JSON and Markdown", ".orgx/work-graph").option("--publish", "publish the generated OrgX Profile to OrgX and return a shareable URL").option("--public-share", "create a public redacted /work-graph/<token> share when publishing").option("--attach-artifact", "attach the report as an OrgX artifact when an initiative/entity is provided").option("--attach-to-initiative <id>", "attach the report to an existing OrgX initiative").option("--entity-type <type>", "entity type for artifact attachment: project, initiative, milestone, task, decision").option("--entity-id <id>", "entity id for artifact attachment").option("--artifact-url <url>", "override the artifact URL stored in OrgX").option("--yes", "approve publish/write prompts in non-interactive mode").option("--json", "emit a JSON command summary").action(async (options) => {
15685
+ workGraph.command("profile").description("Build an AQ profile from real receipts, publish it, and return the first executable repair.").option("--input <path>", "source transcript or summary file; stdin is used when piped").option("--extraction <path>", "structured AI-client extraction JSON; repeat or comma-separate for multiple clients", collectPathOption, []).option("--from <sources>", "auto-import recent local AI sessions: claude, codex, opencode, goose, cursor, github, slack, or all").option("--session-limit <count>", "max recent sessions to import per selected source", "25").option("--session-days <days>", "lookback window for local AI-session imports", "60").option("--codex-sessions-dir <path>", "override Codex sessions directory for import").option("--claude-projects-dir <path>", "override Claude projects directory for import").option("--source-label <label>", "label for the imported manual source").option("--workspace-id <id>", "workspace id override; defaults to the current OrgX workspace when authenticated").option("--workspace-name <name>", "workspace name override for local-only profiles").option("--output-dir <path>", "directory for generated Work Graph JSON and Markdown", ".orgx/work-graph").option("--publish", "publish the generated OrgX Profile to OrgX and return a shareable URL").option("--public-share", "create a public redacted /work-graph/<token> share when publishing").option("--attach-artifact", "attach the report as an OrgX artifact when an initiative/entity is provided").option("--attach-to-initiative <id>", "attach the report to an existing OrgX initiative").option("--entity-type <type>", "entity type for artifact attachment: project, initiative, milestone, task, decision").option("--entity-id <id>", "entity id for artifact attachment").option("--artifact-url <url>", "override the artifact URL stored in OrgX").option("--yes", "approve publish/write prompts in non-interactive mode").option("--json", "emit a JSON command summary").action(async (options) => {
15489
15686
  await safeTrackWizardTelemetry("work_graph_profile_started", {
15490
15687
  command: "work-graph profile",
15491
15688
  from: options.from ?? "manual"