@useorgx/openclaw-plugin 0.4.4 → 0.4.5

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
@@ -8,7 +8,9 @@ OrgX plugin for [OpenClaw](https://openclaw.ai) — connect your AI agents to Or
8
8
  2. Open `http://127.0.0.1:18789/orgx/live`.
9
9
  3. Click **Connect OrgX**.
10
10
  4. Sign in at [useorgx.com](https://useorgx.com) and approve the connection.
11
- 5. Return to OpenClaw. The plugin stores a dedicated credential and runs first sync automatically.
11
+ 5. Return to OpenClaw. The plugin stores a dedicated credential and runs first sync automatically (no key copy/paste).
12
+
13
+ If Claude/Cursor/Codex MCP configs are detected on this machine, the pairing flow also installs a local MCP bridge entry (no OAuth) pointing at `http://127.0.0.1:18789/orgx/mcp`. To opt out, set `ORGX_DISABLE_MCP_CLIENT_AUTOCONFIG=1`.
12
14
 
13
15
  Manual API key entry is still available as a permanent fallback from the onboarding panel.
14
16
 
@@ -18,6 +20,23 @@ Manual API key entry is still available as a permanent fallback from the onboard
18
20
  openclaw plugins install @useorgx/openclaw-plugin
19
21
  ```
20
22
 
23
+ ## Local MCP Bridge (Claude/Codex/Cursor)
24
+
25
+ This plugin exposes the same `orgx_*` tools over a local MCP HTTP endpoint served by the OpenClaw gateway:
26
+
27
+ - URL: `http://127.0.0.1:18789/orgx/mcp` (port follows your OpenClaw gateway config)
28
+ - Why: avoids the separate cloud MCP OAuth flow and keeps the `oxk_...` key stored only in the plugin's credential store.
29
+
30
+ On successful browser pairing, the plugin will attempt to patch:
31
+
32
+ - `~/.claude/mcp.json` (rewire `mcpServers.orgx.url` to the local bridge)
33
+ - `~/.codex/config.toml` (rewire `[mcp_servers.orgx].url` to the local bridge)
34
+ - `~/.cursor/mcp.json` (adds `mcpServers["orgx-openclaw"]` pointing to the local bridge)
35
+
36
+ Each file is backed up first (only when a change is needed) with a `*.bak.<timestamp>-<rand>` suffix.
37
+
38
+ Disable auto-config by setting `ORGX_DISABLE_MCP_CLIENT_AUTOCONFIG=1`.
39
+
21
40
  Or manually add to your OpenClaw config:
22
41
 
23
42
  ```json
@@ -42,10 +61,17 @@ Or manually add to your OpenClaw config:
42
61
 
43
62
  | Option | Type | Default | Description |
44
63
  |--------|------|---------|-------------|
45
- | `apiKey` | string | — | Your OrgX API key (get one at [useorgx.com](https://useorgx.com)) |
64
+ | `apiKey` | string | — | Your OrgX API key (optional if you use browser pairing from `/orgx/live`) |
46
65
  | `baseUrl` | string | `https://www.useorgx.com` | OrgX API base URL |
66
+ | `syncIntervalMs` | number | `300000` | Background sync interval (ms) |
67
+ | `enabled` | boolean | `true` | Enable/disable the plugin |
47
68
  | `dashboardEnabled` | boolean | `true` | Enable the live dashboard at `/orgx/live` |
48
69
 
70
+ Environment overrides:
71
+
72
+ - `ORGX_API_KEY` overrides `apiKey`
73
+ - `ORGX_BASE_URL` overrides `baseUrl`
74
+
49
75
  ## Features
50
76
 
51
77
  ### 🛠️ MCP Tools
@@ -96,6 +122,22 @@ Returns: { allowed: true, modelTier: "sonnet" }
96
122
  Agent spawns with recommended model
97
123
  ```
98
124
 
125
+ ### 🔑 BYOK (Bring Your Own Keys)
126
+
127
+ If you use BYOK models (OpenAI, Anthropic, OpenRouter), store your provider keys in OpenClaw. The OrgX plugin reads OpenClaw settings and injects keys when it invokes OpenClaw CLI commands, so you do not need to put provider keys in the OrgX plugin config.
128
+
129
+ ### 🩺 Diagnostics
130
+
131
+ - `openclaw orgx doctor` runs local checks and can optionally probe the OrgX API.
132
+ - `openclaw gateway status --json` shows the OpenClaw gateway port and runtime state.
133
+
134
+ ### 🔁 Gateway Watchdog
135
+
136
+ The plugin starts a lightweight watchdog daemon that periodically probes the local OpenClaw gateway and restarts it if needed.
137
+
138
+ - Disable: `ORGX_DISABLE_GATEWAY_WATCHDOG=1`
139
+ - Tune: `ORGX_GATEWAY_WATCHDOG_INTERVAL_MS`, `ORGX_GATEWAY_WATCHDOG_FAILURES`, `ORGX_GATEWAY_WATCHDOG_TIMEOUT_MS`
140
+
99
141
  ## Feature Matrix
100
142
 
101
143
  | Capability | Status | Notes |
@@ -184,6 +226,7 @@ When the plugin is loaded, these HTTP endpoints are available:
184
226
  | `GET /orgx/api/live/activity` | Live activity feed |
185
227
  | `GET /orgx/api/live/stream` | Live SSE stream |
186
228
  | `GET /orgx/api/handoffs` | Handoff summaries |
229
+ | `POST /orgx/mcp` | Local MCP bridge (tools/list, tools/call) |
187
230
 
188
231
  ## Requirements
189
232
 
@@ -191,6 +234,25 @@ When the plugin is loaded, these HTTP endpoints are available:
191
234
  - Node.js 18+
192
235
  - OrgX account (browser pairing recommended, API key fallback supported)
193
236
 
237
+ ## Maintainers: Release to NPM
238
+
239
+ This repo publishes on GitHub Release via `.github/workflows/publish.yml`.
240
+
241
+ 1. Update versions
242
+ - `package.json` version (NPM version)
243
+ - `openclaw.plugin.json` version (what `openclaw plugins list` displays)
244
+ - `CHANGELOG.md`
245
+ 2. Verify
246
+ - `npm run typecheck`
247
+ - `npm run test:hooks`
248
+ - `npm run build`
249
+ - Optional: `npm run verify:clean-install`
250
+ 3. Publish
251
+ - Create a GitHub release for the tag (workflow publishes with provenance)
252
+ 4. Smoke test
253
+ - `openclaw plugins install @useorgx/openclaw-plugin@<version>`
254
+ - Verify `http://127.0.0.1:18789/orgx/live` pairing and `http://127.0.0.1:18789/orgx/mcp` MCP bridge
255
+
194
256
  ## Links
195
257
 
196
258
  - [OrgX](https://useorgx.com) — AI orchestration platform
@@ -0,0 +1 @@
1
+ import{r as o,j as e}from"./DD1jv1Hd.js";import{r as P,P as T,c as C,h as D,i as K,j as O,a as _}from"./DNjbmawF.js";import"./C-KIc3Wc.js";import"./BZZ-fiJx.js";import"./BoXlCHKa.js";const X=/^[0-9a-f-]{20,}$/i;function Y(h){if(h.runId)return h.runId;const t=h.metadata;if(!t)return null;const u=["runId","run_id","sessionId","session_id","agentRunId"];for(const p of u){const c=t[p];if(typeof c=="string"&&c.trim().length>0)return c.trim()}return null}const te=o.memo(function({session:t,activity:u,initiatives:p=[],onContinueHighestPriority:c,onDispatchSession:b,onPauseSession:g,onResumeSession:f,onCancelSession:w,onCreateCheckpoint:j,onRollbackSession:v,onStartInitiative:B,onStartWorkstream:N}){const[i,L]=o.useState(null),[y,E]=o.useState(null),[m,q]=o.useState(!1),x=o.useMemo(()=>t?u.filter(r=>Y(r)===t.runId).sort((r,l)=>Date.parse(l.timestamp)-Date.parse(r.timestamp)).slice(0,8):[],[u,t]),A=o.useMemo(()=>{var n;if(!t)return[];const r=[],l=t.initiativeId??t.groupId;if(l){const s=p.find($=>$.id===l);s?r.push({label:"Initiative",value:s.name}):t.groupLabel&&t.groupLabel.trim().length>0&&r.push({label:"Initiative",value:t.groupLabel})}if(t.workstreamId){let s=null;for(const $ of p){const U=(n=$.workstreams)==null?void 0:n.find(J=>J.id===t.workstreamId);if(U){s=U.name;break}}!s&&!X.test(t.workstreamId)&&(s=t.workstreamId),s&&r.push({label:"Workstream",value:s})}const d=t.phase??null;return d&&r.push({label:"Milestone",value:String(d)}),t.title&&r.push({label:"Task",value:t.title}),r},[p,t]),k=o.useMemo(()=>{var n,s;if(!t)return null;const r=((n=x[0])==null?void 0:n.summary)??((s=x[0])==null?void 0:s.description)??null,d=t.lastEventSummary??r??null;return d&&d.trim().length>0?d.trim():null},[x,t]),R=o.useMemo(()=>{var r;return t?P(t.agentName,t.title,t.lastEventSummary,k,(r=x[0])==null?void 0:r.metadata):P()},[x,t,k]),a=async(r,l,d)=>{if(!(!d||i)){L(r),E(null);try{await d(),E(`${l} requested.`)}catch(n){E(n instanceof Error?n.message:`${l} failed.`)}finally{L(null)}}};if(!t)return e.jsxs(T,{className:"flex h-full min-h-0 flex-col card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),e.jsx("button",{onClick:()=>q(r=>!r),className:"text-white/40 transition-colors hover:text-white/70","aria-label":m?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C("transition-transform",m?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("div",{className:C("transition-all",m?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"space-y-2 overflow-y-auto p-4 text-[12px] text-white/45",children:[e.jsx("p",{children:"Select a session to inspect summary, breadcrumbs, blockers, and recent messages."}),e.jsx("button",{onClick:()=>a("continue-priority","Continue highest priority",c),disabled:!c||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.04] px-3 py-1.5 text-[11px] text-white/70 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="continue-priority"?"Dispatching…":"Continue highest priority"}),y&&e.jsx("p",{className:"text-[11px] text-white/55",children:y})]})})]});const M=t.progress===null?null:Math.round(t.progress),I=t.status.toLowerCase(),z=["running","active","queued","pending"].includes(I),Q=["paused","blocked","queued","pending"].includes(I),V=!["completed","archived","cancelled"].includes(I),F=!["archived","cancelled"].includes(I),G=[{label:"Started",value:t.startedAt?D(t.startedAt):"—"},{label:"Updated",value:t.updatedAt?D(t.updatedAt):"—"},{label:"ETA",value:t.eta??"—"},{label:"Checkpoints",value:t.checkpointCount!==null&&t.checkpointCount!==void 0?String(t.checkpointCount):"—"}];return e.jsxs(T,{className:"flex h-full min-h-0 flex-col card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3.5",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-white",children:"Session Detail"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"chip text-[11px] uppercase",children:t.status}),e.jsx("button",{onClick:()=>q(r=>!r),className:"text-white/40 transition-colors hover:text-white/70","aria-label":m?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:C("transition-transform",m?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),e.jsx("div",{className:C("transition-all",m?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"space-y-3 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(K,{provider:R.id,size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-[13px] font-medium text-white",children:t.title}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-white/45",children:[t.agentName??"Unassigned"," · ",R.label]})]})]}),A.length>0&&e.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-2.5",children:[e.jsx("p",{className:"mb-1.5 text-[10px] uppercase tracking-[0.1em] text-white/35",children:"Breadcrumb"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:A.map((r,l)=>e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.02] px-1.5 py-0.5 text-white/65",children:r.value}),l<A.length-1&&e.jsx("span",{className:"text-[11px] text-white/40",children:"›"})]},`${r.label}-${r.value}`))})]}),k&&e.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2",children:e.jsx(O,{children:k})}),M!==null&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-[11px] text-white/55",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[M,"%"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-white/[0.08]",children:e.jsx("div",{className:"h-2 rounded-full",style:{width:`${M}%`,background:`linear-gradient(90deg, ${_.lime}, ${_.teal})`}})})]}),e.jsx("dl",{className:"grid grid-cols-1 gap-1 text-[11px] text-white/55 sm:grid-cols-2",children:G.map(r=>e.jsxs("div",{children:[e.jsx("dt",{className:"text-white/35",children:r.label}),e.jsx("dd",{className:"font-medium",children:r.value})]},r.label))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Quick actions"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>a("continue-priority","Continue highest priority",c),disabled:!c||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="continue-priority"?"Dispatching…":"Continue Priority"}),e.jsx("button",{onClick:()=>a("dispatch-session","Dispatch session",()=>b==null?void 0:b(t)),disabled:!b||!!i,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-2 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:i==="dispatch-session"?"Dispatching…":"Dispatch Session"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Session controls"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>a("pause-session","Pause session",()=>g==null?void 0:g(t)),disabled:!g||!z||!!i,className:"rounded-md border border-amber-400/30 bg-amber-400/10 px-3 py-2 text-[11px] font-semibold text-amber-300 transition-colors hover:bg-amber-400/20 disabled:opacity-45",children:i==="pause-session"?"Pausing…":"Pause"}),e.jsx("button",{onClick:()=>a("resume-session","Resume session",()=>f==null?void 0:f(t)),disabled:!f||!Q||!!i,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-2 text-[11px] font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:i==="resume-session"?"Resuming…":"Resume"}),e.jsx("button",{onClick:()=>a("checkpoint-session","Checkpoint created",()=>j==null?void 0:j(t)),disabled:!j||!!i,className:"rounded-md border border-sky-400/30 bg-sky-400/10 px-3 py-2 text-[11px] font-semibold text-sky-300 transition-colors hover:bg-sky-400/20 disabled:opacity-45",children:i==="checkpoint-session"?"Creating…":"Checkpoint"}),e.jsx("button",{onClick:()=>a("rollback-session","Rollback requested",()=>v==null?void 0:v(t)),disabled:!v||!F||!!i,className:"rounded-md border border-fuchsia-400/30 bg-fuchsia-400/10 px-3 py-2 text-[11px] font-semibold text-fuchsia-300 transition-colors hover:bg-fuchsia-400/20 disabled:opacity-45",children:i==="rollback-session"?"Rolling back…":"Rollback"}),e.jsx("button",{onClick:()=>a("cancel-session","Cancel session",()=>w==null?void 0:w(t)),disabled:!w||!V||!!i,className:"col-span-2 rounded-md border border-red-400/30 bg-red-400/10 px-3 py-2 text-[11px] font-semibold text-red-300 transition-colors hover:bg-red-400/20 disabled:opacity-45",children:i==="cancel-session"?"Cancelling…":"Cancel session"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-[0.12em] text-white/40",children:"Planning"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{onClick:()=>a("start-initiative","Start initiative",B),disabled:!B||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="start-initiative"?"Creating…":"New initiative"}),e.jsx("button",{onClick:()=>a("start-workstream","Start workstream",()=>N==null?void 0:N(t.initiativeId)),disabled:!N||!!i,className:"rounded-md border border-white/[0.12] bg-white/[0.03] px-3 py-2 text-[11px] text-white/75 transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:i==="start-workstream"?"Creating…":"New workstream"})]})]})]}),y&&e.jsx("p",{className:"rounded-md border border-white/[0.08] bg-white/[0.02] px-2.5 py-1.5 text-[11px] text-white/55",children:y}),t.blockers.length>0&&e.jsxs("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3",children:[e.jsx("h3",{className:"mb-1 text-[11px] uppercase tracking-[0.12em] text-red-200/70",children:"Blockers"}),e.jsx("ul",{className:"space-y-1 text-[12px] text-red-100/90",children:t.blockers.map(r=>e.jsxs("li",{children:["• ",r]},r))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-[11px] uppercase tracking-[0.12em] text-white/45",children:"Recent Messages"}),x.length===0&&e.jsx("p",{className:"text-[12px] text-white/45",children:"No recent messages for this run."}),e.jsx("div",{className:"space-y-2",children:x.map(r=>e.jsxs("article",{className:"rounded-lg border border-white/[0.06] bg-white/[0.02] px-2.5 py-2",children:[e.jsx("p",{className:"text-[11px] text-white/85",children:r.title}),(r.summary||r.description)&&e.jsx("p",{className:"mt-0.5 line-clamp-2 text-[11px] text-white/55",children:r.summary??r.description}),e.jsxs("p",{className:"mt-1 text-[10px] text-white/35",children:[new Date(r.timestamp).toLocaleString()," · ",D(r.timestamp)]})]},r.id))})]})]})})]})});export{te as SessionInspector};