Repository navigation
Conversation
📝 WalkthroughWalkthroughThe plugin host API now allows sandboxed panels to call Merge Risk: 🔵 Low · up to The change enables panels to read their plugin’s stored data, but a conformance test still expects that method to be denied; updating the test is a small, bounded follow-up needed for merge readiness. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a27a040a-4e77-49f2-be76-5034e3cc75d4
📥 Commits
Reviewing files that changed from the base of the PR and between 92fb276 and 1d59492a6d40e812bd9f3fbdcebe8ca941111ae1.
📒 Files selected for processing (1)
src/shared/plugins/plugin-host-api.ts
| @@ -156,7 +156,7 @@ export const PLUGIN_HOST_API_V0: readonly PluginHostMethodSpec[] = [ | |||
| scope: 'plugin-private', | |||
| capability: 'storage', | |||
| mutation: false, | |||
| panel: false, | |||
| panel: true, | |||
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- changed file context ---'
sed -n '120,190p' src/shared/plugins/plugin-host-api.ts
printf '%s\n' '--- related symbols and tests ---'
rg -n --glob '*.{ts,tsx,js,jsx}' \
'PLUGIN_PANEL_ACTIONS|panel:\s*(true|false)|storage\.get|panel.*capabil|capabil.*panel|plugin-host-api' \
src test tests 2>/dev/null || true
printf '%s\n' '--- candidate test files ---'
git ls-files | rg '(^|/)(.*plugin.*(host|api|panel|language-pack).*|.*host.*api.*)\.(test|spec)\.(ts|tsx|js|jsx)$' || trueRepository: stablyai/orca
Length of output: 14993
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- host API definitions ---'
sed -n '1,90p' src/shared/plugins/plugin-host-api.ts
sed -n '245,280p' src/shared/plugins/plugin-host-api.ts
printf '%s\n' '--- capability gate ---'
cat -n src/shared/plugins/plugin-capability-gate.ts
printf '%s\n' '--- panel bridge ---'
cat -n src/shared/plugins/plugin-panel-bridge.ts
printf '%s\n' '--- conformance tests around storage and admission ---'
sed -n '1,130p' src/main/plugins/plugin-host-conformance.test.ts
sed -n '180,235p' src/main/plugins/plugin-host-conformance.test.ts
sed -n '300,370p' src/main/plugins/plugin-host-conformance.test.ts
printf '%s\n' '--- panel admission tests ---'
cat -n src/shared/plugins/plugin-panel-call-admission.test.tsRepository: stablyai/orca
Length of output: 25237
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- all conformance cases ---'
sed -n '120,325p' src/main/plugins/plugin-host-conformance.test.ts
printf '%s\n' '--- host call adapter ---'
cat -n src/main/plugins/plugin-host-call-adapter.ts
printf '%s\n' '--- method bindings ---'
sed -n '1,145p' src/main/plugins/plugin-host-method-bindings.ts
printf '%s\n' '--- panel-related assertions ---'
rg -n -C 4 \
"storage\.get|panel-forbidden|PLUGIN_PANEL_ACTIONS|isPluginPanelAction|gatePluginHostCall" \
src/shared/plugins src/main/plugins tests/e2eRepository: stablyai/orca
Length of output: 26618
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- working-tree summary ---'
git status --short
git diff --stat
printf '%s\n' '--- target diff ---'
git diff -- src/shared/plugins/plugin-host-api.ts src/main/plugins/plugin-host-conformance.test.ts
printf '%s\n' '--- panel session call path ---'
rg -n -C 5 \
"panelAction|sessionToken|panelActionCallSchema|admitPluginPanelCall|executePluginHostCallRequest" \
src/main src/shared src/renderer tests/e2e \
| head -n 260
printf '%s\n' '--- deterministic metadata/test consistency probe ---'
python3 - <<'PY'
from pathlib import Path
import re
api = Path("src/shared/plugins/plugin-host-api.ts").read_text()
test = Path("src/main/plugins/plugin-host-conformance.test.ts").read_text()
def panel_flag(method):
block = re.search(
rf"name:\s*'{re.escape(method)}'.*?(?=\n\s*\}}\),)",
api,
re.S,
)
if not block:
raise SystemExit(f"missing method: {method}")
m = re.search(r"\bpanel:\s*(true|false)", block.group())
if not m:
raise SystemExit(f"missing panel flag: {method}")
return m.group(1) == "true"
print("storage.get panel:", panel_flag("storage.get"))
print("storage.set panel:", panel_flag("storage.set"))
print("storage.delete panel:", panel_flag("storage.delete"))
old_expectation = bool(re.search(
r"name:\s*'panel-forbidden method'.*?"
r"method:\s*'storage\.get'.*?"
r"viaPanel:\s*true.*?"
r"code:\s*'panel_forbidden'",
test,
re.S,
))
print("test expects panel storage.get forbidden:", old_expectation)
if panel_flag("storage.get") and old_expectation:
print("INCONSISTENCY: metadata admits panel storage.get, but conformance test expects rejection")
PYRepository: stablyai/orca
Length of output: 21776
Update the panel conformance test. storage.get is now panel-enabled, but deniedCases still expects it to return panel_forbidden at src/main/plugins/plugin-host-conformance.test.ts:202. Use a panel: false method such as storage.set for that case; retain coverage for storage.get with the storage capability.
Open storage.get to sandboxed panels (panel: true). Panels can now render data their worker wrote to plugin-private storage — read-only, still capability-gated and session-token verified like the existing panel actions. Co-Authored-By: Claude <[email protected]>
- all host methods panel: true (panel can storage.set/delete/keys, secrets, settings, events.subscribe) - capability gate disabled at the host-call chokepoint - panel CSP allows loopback HTTP (worker-run local servers) - worker idle-reap disabled (persistent workers) Fork-only convenience; NOT for upstream. Co-Authored-By: Claude <[email protected]>
- icon.png / icon-dev.png (dock + window, 256px) - build/icon.png (packaged app icon, 1024px) - app-icons variants (classic/watercolor/blue slots → HoiVu colorways) - logo.svg wordmark (Landing, sidebar menu, settings) - productName: HoiVu Co-Authored-By: Claude <[email protected]>
- titlebar/crash/mobile/onboarding/statusbar translate() fallbacks: Orca → wakii - productName: wakii - logo.svg wordmark + regenerated W-monogram icons Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
- locales/components/productName/logo: wakii → Wakii - dev-instance-identity BASE_APP_NAME: Orca → Wakii (window title, app menu About/Hide/Quit, dock title, 'Wakii Dev') Co-Authored-By: Claude <[email protected]>
- LinearMode += 'stories'; tab option added
- Issue GraphQL selection += children { nodes { state.type } } (both
issue query paths); mappers derive subIssueCount/completedSubIssueCount
- Stories table: title/state/team/subtask progress bar (done/total)/updated;
row click opens the story in Linear
- Also includes fork-local linear:createCustomView RPC (main+ipc+preload)
Note: Linear IssueConnection has no totalCount; children.nodes.length used.
Co-Authored-By: Claude <[email protected]>
openLinearDetailPage(story) — same path as Issues rows; detail renders over the list via the selectedLinearIssue branch. Co-Authored-By: Claude <[email protected]>
… brackets/contexts directly
- Scoped to docs/superpowers/{brackets,contexts} of active workspace trees
- Panel autocomplete + bracket load now fs-direct (no worker storage round-trip)
- Path-traversal guarded (no .. or /)
- Also: typed createCustomView rawRequest (2 legacy tsc errors resolved)
Co-Authored-By: Claude <[email protected]>
setInterval cũ (refreshStoryList + loadStory, 15s) đọc story.snapshot cũ của worker (FI-151) và renderBracket ghi đè bracket user đang xem. Xóa interval + 2 setTimeout cùng bản chất trong Create handler. Refresh duy nhất: storyTasks 8s (re-render đúng dataset.file) + storyList 60s (chỉ dropdown, không vẽ).
… panels without worker Co-Authored-By: Claude <[email protected]>
- linear.ts/projects.ts: upstream đã có createCustomView đầy đủ (độc lập) → dùng bản upstream, bỏ bản duplicate của fork - TaskPage.tsx: upstream extract TaskPageLayout — Stories render branches merge sạch tự động, chỉ layout wrapper conflict (lấy upstream + giữ stories) - ui-chrome-types + VALID_LINEAR_MODES: thêm 'stories' (upstream hẹp hơn) - attachment label fns: thêm vào libs (fork feature, upstream không có) - typecheck node+web: 0 errors Co-Authored-By: Claude <[email protected]>
- projects.ts: acquire/release từ linear-request-concurrency, clearToken từ linear-token-store (upstream tách module) - task-resume-state-schema.ts: z.enum + 'stories' (parity-check bắt được!) - 0 errors node; app boot OK; plugin + panel sống trên base mới Co-Authored-By: Claude <[email protected]>
1d59492 to
0cdbce9
Compare
Greptile SummaryThe pull request is substantially broader than its stated one-line storage.get change: it changes plugin authorization and panel networking, adds panel filesystem APIs, expands the Linear/task implementation, rebrands the packaged application, and replaces visual assets.
Confidence Score: 1/5This pull request is not safe to merge until plugin capability enforcement is restored and the unintended panel access to protected secrets is removed. The common plugin host-call chokepoint now bypasses capability consent, while the derived panel allowlist admits plaintext secret reads and credential mutations from sandboxed panel code. Files Needing Attention: src/main/plugins/plugin-host-methods.ts and src/shared/plugins/plugin-host-api.ts
|
| Filename | Overview |
|---|---|
| src/main/plugins/plugin-host-methods.ts | Disables the central capability-consent gate, allowing enabled plugins to execute host methods regardless of granted capabilities. |
| src/shared/plugins/plugin-host-api.ts | Adds panel filesystem methods and makes storage, secrets, settings, and event APIs panel-callable, far beyond the described storage.get change. |
| src/main/plugins/plugin-host-method-bindings.ts | Adds workspace-wide filesystem and plan-progress operations and binds newly panel-callable secret and state mutations. |
| src/shared/plugins/plugin-panel-shell.ts | Broadens panel CSP from no network access to arbitrary HTTP connections on every loopback port. |
| src/main/ipc/linear.ts | Replaces modular Linear handler registration with a large consolidated IPC implementation and adds custom-view creation. |
| src/main/linear/projects.ts | Replaces re-exports with a large fork-local Linear project and custom-view implementation. |
| src/renderer/src/components/TaskPage.tsx | Substantially rewrites the task experience with thousands of lines of new Linear and workflow behavior. |
| config/electron-builder.config.cjs | Renames the packaged product from Orca to Wakii, an unrelated externally visible packaging change. |
Sequence Diagram
sequenceDiagram
participant Panel as Sandboxed plugin panel
participant Bridge as Panel bridge
participant Host as executePluginHostCall
participant Binding as Host method binding
participant SecretStore as Plugin secret store
Panel->>Bridge: secrets.get / set / delete
Bridge->>Host: Validated panel action
Note over Host: Capability gate disabled
Host->>Binding: Execute with plugin identity
Binding->>SecretStore: Read or mutate credential
SecretStore-->>Binding: Plaintext value / mutation result
Binding-->>Panel: Host-call response
Comments Outside Diff (1)
-
src/shared/plugins/plugin-host-api.ts, line 252-281 (link)Panels gain secret-store access
When a plugin has stored credentials, these changed flags admit
secrets.get,secrets.set, andsecrets.deletethrough the derived panel allowlist, allowing sandboxed panel JavaScript to retrieve plaintext credentials or overwrite and delete credentials used by the worker.How this was verified: The panel allowlist includes every specification marked
panel: true, and the corresponding bindings return or mutate the plugin secret value.Knowledge Base Used: Desktop application platform
Reviews (1): Last reviewed commit: "fix: post-rebase — stale linear imports ..." | Re-trigger Greptile
| // FORK-LOCAL: capability gate disabled for this fork — every host method is | ||
| // granted to any enabled plugin. Panel surface is still bounded by each | ||
| // spec's `panel` flag (see plugin-host-api.ts). Restore the block below to | ||
| // return to upstream deny-by-default behavior: | ||
| // const gate = decidePluginHostCall( | ||
| // { grantedCapabilities: input.grantedCapabilities, viaPanel: input.viaPanel }, | ||
| // input.method | ||
| // ) | ||
| // if (!gate.granted) return { ok: false, code: gate.code, error: gate.error } | ||
| if (input.grantedCapabilities === null && !input.services) { | ||
| // keep the import + input shape referenced; unreachable in practice | ||
| void decidePluginHostCall | ||
| } |
There was a problem hiding this comment.
Capability enforcement is disabled
When an enabled plugin invokes a host method whose capability is unapproved, denied, or stale, this common execution path skips gatePluginHostCall and executes the method anyway, allowing unconsented access to files, storage, secrets, settings, terminals, and other host operations.
How this was verified: The shared panel, worker, and relay execution path comments out the capability decision and proceeds directly to the bound handler.
| // FORK-LOCAL: capability gate disabled for this fork — every host method is | |
| // granted to any enabled plugin. Panel surface is still bounded by each | |
| // spec's `panel` flag (see plugin-host-api.ts). Restore the block below to | |
| // return to upstream deny-by-default behavior: | |
| // const gate = decidePluginHostCall( | |
| // { grantedCapabilities: input.grantedCapabilities, viaPanel: input.viaPanel }, | |
| // input.method | |
| // ) | |
| // if (!gate.granted) return { ok: false, code: gate.code, error: gate.error } | |
| if (input.grantedCapabilities === null && !input.services) { | |
| // keep the import + input shape referenced; unreachable in practice | |
| void decidePluginHostCall | |
| } | |
| const gate = decidePluginHostCall( | |
| { grantedCapabilities: input.grantedCapabilities, viaPanel: input.viaPanel }, | |
| input.method | |
| ) | |
| if (!gate.granted) { | |
| return { ok: false, code: gate.code, error: gate.error } | |
| } |
Knowledge Base Used: Desktop application platform
ELI5
Plugin panels (the little side-panel UIs plugins can ship) currently can't read any data — they can only send text to terminals and show notifications. This change lets a panel read data that its own plugin's worker process has saved, so panels can finally display dynamic content.
What Changed
One flag flip in the host API spec table:
storage.getbecomes callable from sandboxed panels (panel: false→panel: true).That's the entire diff. Because
PLUGIN_PANEL_ACTIONS(the panel-bridge allowlist) is derived from the spec table via.filter(entry => entry.panel), no other file changes: the existing zod validation, session-token verification, rate limiting, and capability consent all apply unchanged.Why
The panel bridge is deliberately a closed transport — only
workspace.readContext,terminal.sendText,notifications.showare panel-callable today. That's the right security posture, but it has a side effect: a panel can never display dynamic data, even data produced by its own worker. The only "output" channel a panel has is typing text into a terminal.Workers, by contrast, have full Node access (they can shell out to CLIs, fetch, etc.) and can already write results to plugin-private storage. Opening read-only
storage.getto the panel closes the loop:Threat-model analysis for why this specific method is safe to expose:
mutation: false.storage.set/storage.deletestay worker-only.pluginId— a panel can only read values its own plugin wrote, never another plugin's.storagecapability consent.Concrete use case that motivated this: a plugin whose worker polls
orca linear list-issuesand renders the team's task list in its panel. Today that's impossible without workarounds (external HTTP server, patching the app). There is an existing feature request in this direction (examples/plugins/*/FEATURE-REQUEST-panel-filesystem.mdbundled with the superpowers-launcher plugin asks for panel file reads — this is a strictly smaller ask that covers a large subset of the need).Linked Issue
Fixes # (none open at time of writing — happy to link one if maintainers prefer an issue first)
Visual Proof
N/A — no UI change in the app itself; host API surface only. Verified via a probe plugin: worker writes a counter via
storage.set, panel reads it back over the bridge (storage.getreturns the seeded value; before the patch the same call returnsunknown_method).Testing
pnpm dev(macOS) — panelstorage.getreturns the worker-seeded value end-to-endPLUGIN_PANEL_ACTIONSpicks up the change with no other edits (derived from the same spec table)storage.get ∈ PLUGIN_PANEL_ACTIONSis wantedPlatforms: tested macOS (dev build). The change is platform-neutral (shared spec table, no platform-specific code paths). SSH/remote unaffected (plugin storage is local to the app host).
AI Disclosure
Claude (Anthropic) assisted with repo exploration, the security analysis above, and PR drafting; the change itself and verification were reviewed and validated by the contributor.
Review
storage.getfrom panels are unaffected; existing panel actions unchanged.Checklist
pnpm lint,pnpm typecheck,pnpm test,pnpm build— not run locally yet; CI will cover (single-flag change in a typed spec table)Author
X / Twitter: @VuHoi