@useorgx/wizard 0.1.37 → 0.1.38

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
@@ -2569,10 +2569,10 @@ var EXTENSION_FRONTMATTER_DELIMITER = "---";
2569
2569
  var CURSOR_RULES_CONTENT = `# OrgX Rules
2570
2570
 
2571
2571
  - Prefer \`workspace_id\` on OrgX tool calls. \`command_center_id\` is a deprecated alias and should only be used for backwards compatibility. If both are present, they must match.
2572
- - Treat \`entity_action\` with \`force: true\` as an escape hatch. It bypasses hierarchy and proof checks, so only use it when the user explicitly wants that behavior and say why.
2573
- - Treat \`scaffold_initiative continue_on_error\` as best-effort creation. Use it only when partial scaffolds are acceptable, and follow up on any failed children.
2572
+ - Treat \`orgx_act\` with \`force: true\` as an escape hatch. It bypasses hierarchy and proof checks, so only use it when the user explicitly wants that behavior and say why.
2573
+ - Treat \`orgx_write continue_on_error\` as best-effort creation. Use it only when partial scaffolds are acceptable, and follow up on any failed children.
2574
2574
  - Preserve \`_context\` when widget or app-rendering flows depend on client, conversation, session, or user metadata. Do not strip or rename it.
2575
- - Prefer \`list_entities\` for pending approvals and state inspection before reaching for legacy aliases.
2575
+ - Prefer \`orgx_search\` for pending approvals and state inspection before reaching for legacy aliases.
2576
2576
  - Keep hosted OrgX MCP calls distinct from local OpenClaw/plugin surfaces before mutating config or entity state.
2577
2577
  - Artifact proof must use durable sources: GitHub PR/commit/blob permalinks, published/public URLs, or absolute file paths / \`file://...\`.
2578
2578
  - Never use OrgX wrapper pages like \`/live/...\`, \`/artifacts/...\`, or \`/console/...\` as proof links. \`preview_markdown\` is supplemental, not proof.
@@ -2597,10 +2597,10 @@ This skill is for the hosted OrgX tool surface, not the local OpenClaw plugin. K
2597
2597
  ## Operating Rules
2598
2598
 
2599
2599
  - Prefer \`workspace_id\` on OrgX tools. \`command_center_id\` is a deprecated alias kept for compatibility.
2600
- - Treat \`entity_action\` with \`force: true\` as a deliberate override only. It bypasses hierarchy and proof-chain checks.
2601
- - Treat \`scaffold_initiative continue_on_error\` as best-effort scaffolding. Use it only when partial creation is acceptable and inspect failures afterward.
2600
+ - Treat \`orgx_act\` with \`force: true\` as a deliberate override only. It bypasses hierarchy and proof-chain checks.
2601
+ - Treat \`orgx_write continue_on_error\` as best-effort scaffolding. Use it only when partial creation is acceptable and inspect failures afterward.
2602
2602
  - Preserve \`_context\` when widget or app rendering depends on client, conversation, session, or user metadata.
2603
- - Prefer \`list_entities\` over older aliases when you need pending decisions, blockers, or entity state.
2603
+ - Prefer \`orgx_search\` over older aliases when you need pending decisions, blockers, or entity state.
2604
2604
  - Artifact proof must use durable sources: GitHub PR/commit/blob permalinks, published/public URLs, or absolute file paths / \`file://...\`.
2605
2605
  - Never use OrgX wrapper pages like \`/live/...\`, \`/artifacts/...\`, or \`/console/...\` as proof links. \`preview_markdown\` is supporting context only.
2606
2606
 
@@ -2615,7 +2615,7 @@ Install and use these packs alongside this base skill:
2615
2615
 
2616
2616
  ## Suggested Workflow
2617
2617
 
2618
- 1. Inspect state with \`mcp__orgx__list_entities\`, \`mcp__orgx__get_initiative_pulse\`, or the relevant workspace-scoped read tool.
2618
+ 1. Inspect state with \`mcp__orgx__orgx_search\`, \`mcp__orgx__get_initiative_pulse\`, or the relevant workspace-scoped read tool.
2619
2619
  2. Mutate state with the narrowest tool that matches the task.
2620
2620
  3. When you need a hard override, explain why before using \`force: true\`.
2621
2621
  4. When you scaffold, decide up front whether \`continue_on_error\` is acceptable.
@@ -6228,9 +6228,9 @@ var AI_SESSION_SOURCES = ["codex", "claude"];
6228
6228
  var DEFAULT_LIMIT_PER_SOURCE = 3;
6229
6229
  var DEFAULT_SINCE_DAYS = 30;
6230
6230
  var DEFAULT_MAX_BYTES_PER_FILE = 1e6;
6231
- var AUDIT_RELEVANT_LINE_PATTERN = /\b(decision|decided|artifact|receipt|proof|commitment|committed|next action|follow[- ]?up|outcome|result|impact|roi|economics|token|cost|saved|open loop|gap|blocker|risk|owner|dri|writeback|rollback|quality score|mcp|tool call|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative|mcp__orgx__)\b/i;
6231
+ var AUDIT_RELEVANT_LINE_PATTERN = /\b(decision|decided|artifact|receipt|proof|commitment|committed|next action|follow[- ]?up|outcome|result|impact|roi|economics|token|cost|saved|open loop|gap|blocker|risk|owner|dri|writeback|rollback|quality score|mcp|tool call|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write|mcp__orgx__)\b/i;
6232
6232
  var STRONG_AUDIT_LINE_PATTERN = /^(?:[-*]\s*)?(?:decision|artifact|receipt|proof|commitment|next action|follow[- ]?up|outcome|result|impact|roi|economics|open loop|gap|blocker|risk|owner|dri|rollback|quality score)\s*:/i;
6233
- var ORGX_TOOL_SIGNAL_PATTERN = /\b(?:mcp__orgx__|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative|get_task_with_context|ship_batch|record_outcome|orgx_free_audit)\b/i;
6233
+ var ORGX_TOOL_SIGNAL_PATTERN = /\b(?:mcp__orgx__|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write|orgx_inspect|ship_batch|record_outcome|orgx_free_audit)\b/i;
6234
6234
  var INSTRUCTION_BOILERPLATE_PATTERN = /^(?:#{1,6}\s*)?(?:agents\.md|instructions?|codex guardrails|precedence|read before you write|use exactly what was specified|don'?t confuse technologies|repo \+ scope hygiene|initiative \/ mcp discipline|ui quality bar|verification standards|secrets \+ safety|patch\/editing rules|commit \/ pr \/ merge protocol|output style|mcp integration|agent domains|skills|conventions)\b/i;
6235
6235
  var IMPERATIVE_BOILERPLATE_PATTERN = /^[-*]\s+(?:if the user|when the user|if mcp|when agents|never|always|do not|don'?t|default to|treat|produce|pick|verify|avoid|match|use exactly|keep system boundaries|quote bracketed|for orgx|when capture tooling|if no meaningful|do \*\*not\*\*)\b/i;
6236
6236
  var CODE_OR_DOC_NOISE_PATTERN = /^(?:[-*]\s*)?(?:https?:\/\/|\/|\.{0,2}\/|[A-Za-z]:\/|`{1,3}|"{1,2}[A-Za-z0-9:_-]+":|\d+\s*$|\d+\t|import\s|export\s|const\s|let\s|var\s|function\s|type\s|interface\s|CREATE\s+TABLE|ALTER\s+TABLE|SELECT\s+|INSERT\s+|UPDATE\s+|DELETE\s+)/i;
@@ -6238,15 +6238,15 @@ var EMPTY_AUDIT_LABEL_PATTERN = /^(?:[-*]\s*)?(?:decision|artifact|receipt|proof
6238
6238
  var LABEL_VALUE_NOISE_PATTERN = /^(?:[-*]\s*)?(?:decision|artifact|receipt|proof|commitment|next action|follow[- ]?up|outcome|result|impact|roi|economics|open loop|gap|blocker|risk|owner|dri|rollback|quality score)\s*:\s*(?:["']?[\w-]+["']?\s*\|\s*["']?[\w-]+["']?|[\d\s.,%$]+)[,;)]*$/i;
6239
6239
  var TYPE_SIGNATURE_NOISE_PATTERN = /^(?:[-*]\s*)?(?:decision|artifact|receipt|proof|commitment|next action|follow[- ]?up|outcome|result|impact|roi|economics|open loop|gap|blocker|risk|owner|dri|rollback|quality score)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>]+>)?[\s,;)]*$/i;
6240
6240
  var TOOL_CATALOG_NOISE_PATTERN = /^(?:[-*]\s*)?(?:[a-z][\w.:-]*\s*\([^)]+\),?\s*){2,}$/i;
6241
- var BARE_TOOL_SIGNAL_PATTERN = /^(?:\d+\.\s*|[-*]\s*)?(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative|get_task_with_context|ship_batch|record_outcome|orgx_free_audit)\s*$/i;
6242
- var TOOL_QUESTION_NOISE_PATTERN = /^(?:\d+\.\s*)?\*\*[^*]+\*\*.*\?\s*(?:\([^)]*\b(?:mcp|scaffold_initiative|start_plan_session)\b[^)]*\)\.?)?$/i;
6241
+ var BARE_TOOL_SIGNAL_PATTERN = /^(?:\d+\.\s*|[-*]\s*)?(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write|orgx_inspect|ship_batch|record_outcome|orgx_free_audit)\s*$/i;
6242
+ var TOOL_QUESTION_NOISE_PATTERN = /^(?:\d+\.\s*)?\*\*[^*]+\*\*.*\?\s*(?:\([^)]*\b(?:mcp|orgx_write|start_plan_session)\b[^)]*\)\.?)?$/i;
6243
6243
  var SOURCE_REFERENCE_NOISE_PATTERN = /(?:^|\s)(?:\.{0,2}\/)?(?:orgx|src|lib|workers|public|scripts|tests|apps|packages)\/[\w./-]+\.(?:ts|tsx|js|jsx|json|md|txt|sql|py)(?::\d+)?\b/i;
6244
6244
  var FILE_REFERENCE_NOISE_PATTERN = /\b[\w.-]+\.(?:ts|tsx|js|jsx|json|md|txt|sql|py)(?::\d+(?:[–-]\d+)?)?\b/i;
6245
6245
  var LOCAL_ASSET_REFERENCE_PATTERN = /(?:<BlogImage\b|source:\s*\/Users\/|\/blog\/[\w./-]+\.(?:png|jpg|jpeg|webp|gif))/i;
6246
6246
  var LINE_NUMBER_SOURCE_NOISE_PATTERN = /^\d+(?::|\s+)\s*/i;
6247
- var TOOL_WORKFLOW_NOISE_PATTERN = /(?:→|->).*\b(?:scaffold_initiative|spawn_agent_task|record_outcome|submit_learning|get_outcome_attribution|mcp__orgx__)\b/i;
6248
- var TOOL_FAILURE_PATTERN = /^(?:\d+\.\s*)?(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative|get_task_with_context|ship_batch|record_outcome|orgx_free_audit)\b.*\b(?:rejected|requires|failed|fails|error|invalid|unavailable|timeout|timed out|not\s+(?:called|dispatched|wired|created|available)|missing|broken)\b/i;
6249
- var RUNTIME_FAILURE_PATTERN = /\b(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative|get_task_with_context|ship_batch|record_outcome|submit_learning|spawn_agent_task|agent run)\b.*\b(?:rejected|requires|failed|fails|error|invalid|unavailable|timeout|timed out|never|no\s+\w+|not\s+(?:called|dispatched|wired|created|available|append)|missing|broken|only\s+in\s+agent\s+skill\s+prompts)\b/i;
6247
+ var TOOL_WORKFLOW_NOISE_PATTERN = /(?:→|->).*\b(?:orgx_write|orgx_spawn|record_outcome|submit_learning|orgx_recommend|mcp__orgx__)\b/i;
6248
+ var TOOL_FAILURE_PATTERN = /^(?:\d+\.\s*)?(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write|orgx_inspect|ship_batch|record_outcome|orgx_free_audit)\b.*\b(?:rejected|requires|failed|fails|error|invalid|unavailable|timeout|timed out|not\s+(?:called|dispatched|wired|created|available)|missing|broken)\b/i;
6249
+ var RUNTIME_FAILURE_PATTERN = /\b(?:mcp__orgx__[\w-]*|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write|orgx_inspect|ship_batch|record_outcome|submit_learning|orgx_spawn|agent run)\b.*\b(?:rejected|requires|failed|fails|error|invalid|unavailable|timeout|timed out|never|no\s+\w+|not\s+(?:called|dispatched|wired|created|available|append)|missing|broken|only\s+in\s+agent\s+skill\s+prompts)\b/i;
6250
6250
  var PROCESS_NARRATION_NOISE_PATTERN = /^(?:now i\b|let me\b|i (?:have|need|will|can)\b|i['’]ll\b|i['’]m\b|so\b.*\b(?:confirm|check|verify|fetches)\b)/i;
6251
6251
  function parseAiSessionSources(value) {
6252
6252
  if (!value?.trim()) return [];
@@ -7085,7 +7085,7 @@ function sourceClientFromText(value) {
7085
7085
  if (/\bcalendar\b|\bmeeting\b/.test(normalized)) return "calendar";
7086
7086
  if (/\bnotion\b/.test(normalized)) return "notion";
7087
7087
  if (/\bdocs?\b|google drive/.test(normalized)) return "docs";
7088
- if (/\bmcp\b|mcp__|orgx_emit|scaffold_initiative|ship_batch/.test(normalized)) return "mcp";
7088
+ if (/\bmcp\b|mcp__|orgx_emit|orgx_write|ship_batch/.test(normalized)) return "mcp";
7089
7089
  if (/\borgx api\b|\bapi\b/.test(normalized)) return "api";
7090
7090
  return "unknown";
7091
7091
  }
@@ -7116,11 +7116,11 @@ function normalizeConfidence(value, fallback = 0.72) {
7116
7116
  }
7117
7117
  function titleFromText(text2, fallback) {
7118
7118
  const lower = text2.toLowerCase();
7119
- if (lower.includes("mcp__orgx__list_entities") && lower.includes("zod")) {
7120
- return "OrgX MCP list_entities is failing schema validation";
7119
+ if (lower.includes("mcp__orgx__orgx_search") && lower.includes("zod")) {
7120
+ return "OrgX MCP orgx_search is failing schema validation";
7121
7121
  }
7122
- if (lower.includes("scaffold_initiative") && lower.includes("auto_continue") && lower.includes("dispatch")) {
7123
- return "scaffold_initiative creates ready streams without dispatching agent runs";
7122
+ if (lower.includes("orgx_write") && lower.includes("auto_continue") && lower.includes("dispatch")) {
7123
+ return "orgx_write creates ready streams without dispatching agent runs";
7124
7124
  }
7125
7125
  if (lower.includes("operation qa loop") && lower.includes("0/") && lower.includes("entities")) {
7126
7126
  return "OrgX scaffold fails to create Operation QA Loop entities";
@@ -7336,7 +7336,7 @@ function buildCoverage(imports, connectedSources, missingSources, clientExtracti
7336
7336
  ${extractionText}`.toLowerCase();
7337
7337
  const orgxObserved = /\borgx\b|useorgx|mcp__orgx__|orgx_/i.test(allText);
7338
7338
  const mcpObserved = /\bmcp\b|mcp__|tool call|tools\/call|call_tool|orgx_emit_activity/i.test(allText);
7339
- const orgxMcpCalled = /mcp__orgx__|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|scaffold_initiative/i.test(allText);
7339
+ const orgxMcpCalled = /mcp__orgx__|orgx_emit_activity|orgx_apply_changeset|complete_with_proof|orgx_write/i.test(allText);
7340
7340
  const skillOnlySignal = orgxObserved && !orgxMcpCalled && /\bskill|instructions|agent|workflow\b/i.test(allText);
7341
7341
  const normalizedConnectedSources = sortedUnique(
7342
7342
  connectedSources.map((source) => {
@@ -7658,7 +7658,7 @@ function nativeEpisodeType(line) {
7658
7658
  function nativeFindingConfidence(type, line) {
7659
7659
  let confidence = type === "decision" || type === "artifact" || type === "outcome" ? 0.78 : 0.72;
7660
7660
  if (/^\s*(?:decision|artifact|blocker|outcome|proof|result|next action|open loop|risk|gap)\s*:/i.test(line)) confidence += 0.08;
7661
- if (/\b(?:mcp__orgx__|scaffold_initiative|orgx_emit_activity|complete_with_proof|github|codex|claude)\b/i.test(line)) confidence += 0.05;
7661
+ if (/\b(?:mcp__orgx__|orgx_write|orgx_emit_activity|complete_with_proof|github|codex|claude)\b/i.test(line)) confidence += 0.05;
7662
7662
  if (line.length < 32) confidence -= 0.1;
7663
7663
  return normalizeConfidence(confidence, 0.72);
7664
7664
  }
@@ -7875,8 +7875,8 @@ var SKILL_TOOL_RULES = [
7875
7875
  { id: "agent:design", kind: "agent", label: "design-agent", pattern: /\bdesign-agent\b|design agent/i },
7876
7876
  { id: "agent:product", kind: "agent", label: "product-agent", pattern: /\bproduct-agent\b|product agent/i },
7877
7877
  { id: "agent:orchestrator", kind: "agent", label: "orchestrator-agent", pattern: /\borchestrator-agent\b|orchestrator agent/i },
7878
- { id: "tool:orgx-list-entities", kind: "mcp_tool", label: "mcp__orgx__list_entities", pattern: /\bmcp__orgx__list_entities\b/i },
7879
- { id: "tool:scaffold", kind: "mcp_tool", label: "scaffold_initiative", pattern: /\bscaffold_initiative\b/i },
7878
+ { id: "tool:orgx-list-entities", kind: "mcp_tool", label: "mcp__orgx__orgx_search", pattern: /\bmcp__orgx__orgx_search\b/i },
7879
+ { id: "tool:scaffold", kind: "mcp_tool", label: "orgx_write", pattern: /\bscaffold_initiative\b/i },
7880
7880
  { id: "tool:complete-proof", kind: "mcp_tool", label: "complete_with_proof", pattern: /\bcomplete_with_proof\b/i },
7881
7881
  { id: "tool:ship-batch", kind: "mcp_tool", label: "ship_batch", pattern: /\bship_batch\b/i },
7882
7882
  { id: "client:codex", kind: "client_tool", label: "Codex", pattern: /\bcodex\b/i },
@@ -8674,7 +8674,7 @@ function publicTrailRank(trail) {
8674
8674
  let score = trail.impact_score;
8675
8675
  if (trail.events.length > 1) score += 10;
8676
8676
  if (trail.subject_entity_type === "blocker") score += 6;
8677
- if (/\b(?:scaffold|ship_batch|mcp__orgx__list_entities|list entities|schema validation|route behavior|dispatching agent runs|operation qa loop)\b/i.test(title)) {
8677
+ if (/\b(?:scaffold|ship_batch|mcp__orgx__orgx_search|list entities|schema validation|route behavior|dispatching agent runs|operation qa loop)\b/i.test(title)) {
8678
8678
  score += 14;
8679
8679
  }
8680
8680
  if (/^(?:[-*✓{`'"]|\d+[,.]?$)/.test(title)) score -= 32;
@@ -9538,6 +9538,29 @@ function renderWorkGraphMarkdown(report) {
9538
9538
  }
9539
9539
 
9540
9540
  // src/lib/work-graph-publish.ts
9541
+ import { gzipSync } from "zlib";
9542
+ var WORK_GRAPH_REPORT_GZIP_THRESHOLD_BYTES = 96e3;
9543
+ function encodeWorkGraphReportPostBody(payload, thresholdBytes = WORK_GRAPH_REPORT_GZIP_THRESHOLD_BYTES) {
9544
+ const json = JSON.stringify(payload);
9545
+ const byteLength = Buffer.byteLength(json);
9546
+ if (byteLength < thresholdBytes) {
9547
+ return {
9548
+ body: json,
9549
+ headers: { "Content-Type": "application/json" },
9550
+ byteLength,
9551
+ compressed: false
9552
+ };
9553
+ }
9554
+ return {
9555
+ body: gzipSync(json),
9556
+ headers: {
9557
+ "Content-Encoding": "gzip",
9558
+ "Content-Type": "application/json"
9559
+ },
9560
+ byteLength,
9561
+ compressed: true
9562
+ };
9563
+ }
9541
9564
  async function parseResponse(response) {
9542
9565
  const text2 = await response.text();
9543
9566
  if (!text2) return null;
@@ -9553,22 +9576,23 @@ async function publishWorkGraphReport(report, options = {}) {
9553
9576
  throw new Error("OrgX auth is required to publish a Work Graph. Run `orgx-wizard auth login` or set ORGX_API_KEY.");
9554
9577
  }
9555
9578
  const url = buildOrgxApiUrl("/client/work-graph/reports", auth.baseUrl);
9579
+ const encoded = encodeWorkGraphReportPostBody({
9580
+ report,
9581
+ ...options.workspaceId ? { workspace_id: options.workspaceId } : {},
9582
+ ...options.initiativeId ? { initiative_id: options.initiativeId } : {},
9583
+ ...options.entityType ? { entity_type: options.entityType } : {},
9584
+ ...options.entityId ? { entity_id: options.entityId } : {},
9585
+ ...options.artifactUrl ? { artifact_url: options.artifactUrl } : {},
9586
+ attach_artifact: Boolean(options.attachArtifact),
9587
+ public_share: Boolean(options.publicShare)
9588
+ });
9556
9589
  const response = await fetch(url, {
9557
9590
  method: "POST",
9558
9591
  headers: {
9559
9592
  Authorization: `Bearer ${auth.apiKey}`,
9560
- "Content-Type": "application/json"
9593
+ ...encoded.headers
9561
9594
  },
9562
- body: JSON.stringify({
9563
- report,
9564
- ...options.workspaceId ? { workspace_id: options.workspaceId } : {},
9565
- ...options.initiativeId ? { initiative_id: options.initiativeId } : {},
9566
- ...options.entityType ? { entity_type: options.entityType } : {},
9567
- ...options.entityId ? { entity_id: options.entityId } : {},
9568
- ...options.artifactUrl ? { artifact_url: options.artifactUrl } : {},
9569
- attach_artifact: Boolean(options.attachArtifact),
9570
- public_share: Boolean(options.publicShare)
9571
- }),
9595
+ body: encoded.body,
9572
9596
  signal: options.signal ?? AbortSignal.timeout(15e3)
9573
9597
  });
9574
9598
  return {
@@ -11677,7 +11701,7 @@ function printDoctorReport(report, assessment) {
11677
11701
  async function main() {
11678
11702
  const program = new Command();
11679
11703
  program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
11680
- const pkgVersion = true ? "0.1.37" : void 0;
11704
+ const pkgVersion = true ? "0.1.38" : void 0;
11681
11705
  program.version(pkgVersion ?? "unknown", "-V, --version");
11682
11706
  program.hook("preAction", (_thisCommand, actionCommand) => {
11683
11707
  if (Boolean(actionCommand.optsWithGlobals().json)) return;