74 Commits
Author SHA1 Message Date
Rafael Bodill ef072113a9 fix(plugins): make OMP removal previews deterministic (#949)
Apply rejected its own preview with "plugin state changed since preview"
when an OMP removal ran while other OMP plugins were registered: their
package files were fingerprinted in map iteration order.
2026-11-18 10:16:27 +08:00
Rusty ShacklefordandWillie 43059a1428 fix(opencode): preserve v2 hook and plugin directory packages (#915)
* fix(opencode): preserve v2 directory packages

Stage the reviewed issue 913 source for isolated fork validation. Preserve
package directories and manifests without executing managed packages or
installing their dependencies, and include receipt and localized UI fixes.

Reviewed local source: 15ac88e2f266571b8a6dc8d777302db0f4dcae44
Exact source tree: 45ebabfe2b

Static checks and independent inspection completed. Go, integration,
dashboard, rendering, and hosted runtime validation remain pending.
This fork staging commit is not an upstream publication or merge.

* test(opencode): align schema and snapshot assertions

Check the version-aware binding schema and verify native unregister retains the unchanged managed snapshot.

* fix(opencode): resolve Windows npm native launchers

Probe recognized native Opencode executables without invoking a batch shell; exercise the default version probe on hosted Windows.

* test(opencode): normalize Windows fixture line endings

Avoid doubling carriage returns when Git checks out the npm fixture with CRLF.

* fix(opencode): keep an undetected OpenCode version from blocking other agents

Review of the v2 directory package change found that one failed
`opencode --version` probe failed the whole hooks plan, so a machine
without the binary (a second machine sharing the config, CI, a
devcontainer) could no longer sync hooks to any agent, and doctor and
the dashboard preview failed with it.

Hooks:
- A probe that fails or reports an unknown major now skips only the
  OpenCode bindings with one warning per target. Outputs already owned
  there are parked, so they are neither rewritten nor removed while the
  layout is unknown. The probe runs once per plan, list and import.
- A `package` binding on OpenCode v1 is skipped with a warning instead
  of failing the plan.
- The v2 dependency warning is reported once, and only when a package
  file is written, so a synced hook no longer keeps doctor yellow.
- `hooks import` reports an unreadable file such as a symlink as that
  package's problem; other packages and flat files stay importable.
  The package validation problem is reported once instead of twice.
- Directories under `plugins/` are listed as unmanaged only on v2.

Plugins:
- The inventory leaves `plugins/skillshare-NAME` registrations to
  hooks, so a synced v2 hook is not offered as an importable plugin.

Dashboard: the new warnings are translated in every locale, a
`hook NAME:` prefix no longer defeats translation, the native preview
translates its per-file error, and the YAML editor documents `package`.

Docs: the English pages and the built-in skill describe the behavior
above; the ja, ko, zh-Hans and zh-Hant pages now carry the same
content as the English ones. The runbook drives the CLI with mdproof
assertions instead of prose expectations.

Refs #913.

---------

Co-authored-by: Willie <egg358358@gmail.com>
2026-11-16 01:50:14 +08:00
Willie 0939eb9ad9 fix(plugin): verify native support only for changes that run a command (#873)
* fix(plugin): verify native support only for changes that run a command

prepareChange probed native command support before applying the
intentional skip rules. When the probe failed under update --all, the
change was marked as a failed target, so the later skip never applied.
An imported Grok plugin always hit this: Grok updates require native
trust, so every update --all exited nonzero even though Grok plugins are
documented as updated natively. #853 patched the same ordering for
imported OMP plugins only.

Run the probe after the skip rules instead, so a skipped change is never
verified, and drop the OMP-specific exemption it made redundant. Host
errors and changes that do run a native command still fail as before.

* docs(plugin): align OMP removal wording and runbook pass criteria

The translated plugin references said OMP removal requires a
scope-matching native registration. English, and the code, only require
that a registration match when one is present; a retry after native
uninstall proceeds from the retained cache. The runbook's Pass Criteria
also did not cover the two scenarios #853 added as steps 4 and 5.
2026-11-12 14:09:10 +08:00
Rusty ShacklefordandWillie caa107b880 fix(plugin): refresh stale OMP catalog and report blocked OMP updates (#853)
* fix(plugin): recover OMP stale catalog installations

Refresh owned marketplace catalogs before reuse and validate the native cache identity when removing an installation. Preserve that identity through interrupted cleanup and report blocked batch updates as failures so retries remain safe and visible.

* fix(plugin): preserve reviewed versions during OMP recovery

Keep native removal identity separate from reviewed receipts so interrupted cleanup can retry safely. Expose isolated failures in previews and dry-run exit status while allowing healthy targets to proceed.

* fix(plugin): resume interrupted OMP update cleanup

Retry matching pending removals before reinstalling after registry-first interruption, and clarify isolated failure reporting. Strengthen recovery fixtures and restore accurate installation guidance.

* test(plugin): model OMP cached catalog installs

Use the cached marketplace entry for native install version and source so the stale catalog regression exercises the real version-to-cache relationship.

* test(plugin): align OMP batch expectations with safety checks

Require catalog refresh before reinstalling from an owned marketplace and assert isolated failures when native OMP ownership cannot be verified, while healthy targets update.

* fix(plugin): skip native upgrade checks for OMP imports

Imported plugins have no reviewed source to upgrade, so requiring native upgrade capability makes a safe batch skip fail unnecessarily. Cover that case and OMP dry-run failures, and align translations and native verification runbook with the failure and removal behavior.

---------

Co-authored-by: Willie <egg358358@gmail.com>
2026-11-12 13:45:55 +08:00
Willie 828ba93f27 fix(git): keep a caller's GIT_DIR out of skillshare's git commands (#854)
* fix(git): keep a caller's GIT_DIR out of skillshare's git commands

Git exports GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE and related variables
to hooks that run in a linked worktree. Every git process skillshare
started inherited them, and those variables override the directory the
command runs in. Run from a post-checkout or post-merge hook, skillshare
therefore acted on the hook's repository instead of its own: install's
sparse clone turned on sparse checkout there (a later merge removed every
file outside the skill's path), the remote tree check's `git init --bare`
made it a bare repository, install's reconcile recorded its origin and
branch, and push staged and committed into it.

internal/gitenv builds git commands without the variables that
`git rev-parse --local-env-vars` lists for choosing a repository, work
tree, index, object store or config file. GIT_CONFIG_COUNT and
GIT_CONFIG_PARAMETERS stay, because users pass credentials through them
and install's token auth appends to the existing count. Every git call in
cmd/skillshare, internal/install, internal/git, internal/check and
internal/config now goes through it, and plugin runCommand starts native
CLIs from the same environment because they run git as well. The hooks
service keeps its own stricter filter.

Closes #852

* test(gitenv): fail on new git commands that bypass gitenv

Each git call site converted for #852 is safe only because it goes
through gitenv.Command, and about half have no test of their own. A
future exec.Command("git", ...) would silently bring the bug back, so a
syntactic guard now rejects one outside gitenv, hooks and testutil,
mirroring the sourcefs and sourcewalk ratchets.

The Environ test also checks a lowercase name, since Windows environment
names are case-insensitive, and compares against literal keys so that
removing one from repoVars fails it. The wiki records the rule.
2026-11-11 21:08:47 +08:00
Willie 4556438575 fix(plugin): let OMP and Pi plugin updates through without uninstalling (#833) (#837)
* fix(plugin): let OMP and Pi plugin updates through without uninstalling (#833)

Every OMP update was blocked, because OMP's native upgrade replaces cache
folders that projects outside its inventory may still use. The only way to
move an OMP binding to a new commit was to uninstall first. An update now
runs the same pair a source change already uses: the scoped removal
adapter (cache kept), then an install under a fresh marketplace and cache
identity. A refresh always takes a new identity, because OMP installs from
the catalog it cached when the marketplace was added, and that catalog
still names the old version. If the removal cannot be verified, the
update is blocked; update --all still skips it with the reason.

Pi was blocked whenever the catalog plugin name differed from its
package.json name. That happens after an upstream npm rename, for example
when npm refused the original name. Pi installs by path, and Skillshare
keys the binding by the catalog name, so the npm name never reaches
either, and the check only stopped working installs.

Updating one package across several Agents stopped every Agent as soon as
one was blocked. Each failing Agent is now reported with its reason while
the others update, and the command exits non-zero. A single --target, or
a package with no other Agent to update, stays blocked as before, so a
dry-run still fails when nothing would update.

* fix(plugin): let one update --all refresh several OMP packages

Every OMP removal proves itself against a fingerprint of the whole native
registry and lock. In a single update --all plan, the first package's
removal and reinstall rewrite those shared files. The second package's
removal therefore saw "OMP native files changed", so only one OMP
package could update per run. The same applied to a sync that replaced
the sources of several OMP packages.

A removal now also fingerprints only its own installation: its registry
entry, its lock entry, its package manifest and its runtime link. After
an earlier change in the same apply has written to that OMP target, the
removal re-reads the files and runs every ownership check again. It goes
ahead only if that own fingerprint still matches the preview. A change
outside Skillshare to the package's own entries still blocks it. Without
an earlier write in the apply, the full-file check is unchanged.

The fake OMP in the tests now merges installs into the registry and lock
and lists them in a stable order, as the real one keeps other plugins.
2026-11-10 21:46:42 +08:00
Willie 2bc791ed19 perf(plugin): check every plugin at once and skip sources that did not move (#812)
* perf(plugin): check every plugin at once and skip sources that did not move

The Plugins page's update check read every Agent CLI, cloned and hashed
every source, and asked npm about every package one after another, so it
grew with each plugin added. A single Agent CLI that stopped answering
held the whole page at "Checking for updates" with no way to tell which
plugin was stuck.

The check now asks every Agent and checks every plugin at the same time.
Plugins share one read of each Agent and each source, so an Agent with
many plugins is still asked once, and a plugin waits only on its own
Agents, including when proving its own leftover installs. Before downloading a remote source with no pinned ref, the
check asks the remote which commit its default branch points at with
`git ls-remote` and reports no update when that is the installed commit.
A check of three unchanged GitHub plugins on two Agents went from 4.3s
with three clones to 0.6s with none.

The dashboard reads the check from a new stream, GET
/api/plugins/check/stream, that sends each plugin as soon as it is
checked. The page marks rows as they arrive and counts progress in the
header. The stream stops waiting after 60 seconds: a plugin bound to an
Agent that has not answered by then shows "Check failed" with the
reason, and plugins on other Agents are unaffected. There is no limit on
how many plugins run together, because plugins waiting on a hung Agent
would otherwise hold every slot and starve the rest.

A cancelled command did not return when the Agent CLI was a shim that
starts the real client, such as an npm, mise or volta wrapper: killing
the shim left the child holding its output, so the command waited until
the child exited and no timeout took effect. Commands now stop waiting
for output two seconds after they are cancelled; a command that exits on
its own while a helper keeps its output open still counts as answered.

* fix(ui): offer every update the Plugins page shows in the update dialog

The header counted updates from the per-plugin marks, but the update
dialog offered only the targets in the last completed check's plan. Two
cases left the header saying Update N with nothing to tick in the dialog:
a first check that broke off after finding an update never set the plan,
and a recheck that could not reach an Agent kept that Agent's earlier
update while the plan said blocked.

The dialog's plan is now derived from each plugin's last answer together
with the kept updates, so a kept update stands in for the blocked or
missing answer and both always agree. A broken-off check also keeps the
answers it did receive.
2026-11-09 15:06:55 +08:00
Willie bfbc06a664 fix(plugin): keep Codex off packages and folders it cannot use (#808)
The Claude manifest fallback from #806 offered Codex more than it can
install:

- A Claude package whose only parts are ones Codex does not read, such
  as agents, was offered to Codex with no components, so Codex would
  install an empty plugin.
- When Codex's own catalog pointed at a folder it rejects, the whole
  candidate could be replaced by the Claude catalog's folder, which now
  carries a Codex fallback. Codex reads only its own catalog, so it
  would never install from that folder.

#806 also stopped every Agent from using a later catalog's folder when
the first one was rejected. Only Codex needs that, since only Codex
reads one catalog exclusively, so other Agents get the old behaviour
back.
2026-11-09 10:04:33 +08:00
Nathan Vale 6e1fc67d71 fix(plugin): discover Codex-compatible Claude manifests (#806)
Codex accepts Claude plugin manifests natively, but discovery omitted
Codex for packages such as Matt Pocock's skills. Select that supported
fallback without rewriting package resources or invocation policies.

Match native root and manifest precedence, retain rejected own-catalog
packages, and add discovery and snapshot regression coverage.

Refs #805
2026-11-09 09:54:01 +08:00
Willie af80327315 test(plugins): stop the fake Pi CLI from rewriting settings on read-only commands (#762)
fakePiNpm is the Run fake for every target in a test Service, and it
rewrote Pi's settings.json after any command other than --version and
--help. Inventory queries all targets concurrently, so another target's
read-only CLI call could truncate the file while the pi host read it.
The pi host then saw no packages, and
TestPluginHostStateProducerLegacyProjection/local failed with "local
proof rejected". It failed three times on the v0.28.3 release run and
on PR #745.

Only install and remove change Pi settings, so only they write now.
2026-11-04 11:35:00 +08:00
Willie 40319f77fb test(plugins): replace OMP ownership property tests with table tests (#761)
* test(plugins): replace OMP ownership property tests with table tests

#758 added Hegel property tests for ompPreviewRuntime, which pulled in
hegel.dev/go/hegel and an alpha pseudo-version of ebitengine/purego as
the repo's only property-testing dependency. The logic under test is a
few booleans and a module name, so explicit cases cover it, and a plain
test runs on every platform instead of the ones Hegel bundles an engine
for.

The table keeps each dimension the properties drew: present or absent
link, exact or other path, same or other target, relative target,
scoped module names, linked ancestors at several depths, and a link
replaced by a directory or a file. It adds the no-proof case.

* test(plugins): name linked-ancestor subtests by depth

A subtest named nested/pkg contains a slash, so go test -run could not select it exactly.
2026-11-04 00:17:32 +08:00
Rusty Shackleford 8153025beb fix(plugins): reconcile OMP source replacements in one sync (#758)
A returning machine can retain an old runtime link after shared plugin intent changes source. Review its verified scoped cleanup together with replacement, then remove the old link before installing the new source while retaining shared cache and settings.

Preserve the original recipe identity when cleanup of a pending-only installation fails, so retries still reconcile the replacement. Add filesystem-backed regressions, Hegel ownership properties and a two-machine native CLI runbook.
2026-11-04 00:08:22 +08:00
Rusty Shackleford da3383ed5f fix(plugins): separate shared intent from local installation state (#660)
* fix(plugins): separate shared intent from machine-local receipts

Shared configs currently carry native paths, reviewed snapshots and pending
failures, so one host can publish local progress over another host's target
selection. Persist versioned declarations separately from local applied and
pending receipts, and reconcile reviewed installs, imports and cleanup against
this machine's native inventory without rewriting intent during sync/update.

Keep snapshot names and adapter safeguards, move the operation lock locally,
validate legacy adoption with local evidence, and invalidate approval on local
state or native-context changes. Preserve source recipes after native adoption,
require local import for absent native-only targets, and document the shared
writer upgrade boundary in schemas and translated references.

Cover two-host behavior, generated legacy fixtures, failure/recovery, stale
intent, cleanup, npm recipes and the existing CLI/API/UI consumers with focused
resource-capped tests. Fixes #651.

* fix(plugins): preserve intent and ownership across host transitions

Repeat-add must retain shared target selection, and update previews must resolve
the requested ref before reviewing fresh or replacement installs. Keep disabled
targets on the uninstall path and reject refs unsupported by native-only/npm
intent before they can produce invalid shared declarations.

Block changed-context add/import before Pi registration preparation so a new
account cannot overwrite the old receipt. Preserve unresolved legacy bindings
as passive private proof candidates before rewriting shared YAML, retaining
original intent/store for later verified adoption and cleanup. Never compose
these hints as executable state, and persist their explicit resolution.

Cover the five review classes, native/private failure boundaries, requested-ref
retry, and original-context hint proofs with isolated focused regressions.
Keep local format v1 and baseline account validation unchanged. Refs #651.

* fix(plugins): allow receipt-only orphan cleanup to complete

An installation already removed on this host can retain a local receipt when
another host removes or replaces shared intent. Sync correctly plans forget,
but native command verification rejects that metadata-only action and blocks
all targets before the receipt can be cleared.

Exclude forget from native command verification while retaining host inventory
checks and OMP scoped cleanup preparation. The existing completion path then
persists receipt deletion, including pending work and passive legacy hints.

Cover the cross-host disable/re-enable/remove walk, five native adapters,
failed work with a legacy hint, and absent source replacement alongside a
healthy target. Assert Apply completion, unchanged shared bytes/mtime, and a
quiet second sync. Refs #651.

* fix(plugin): reconcile ref intent across inventory consumers

Validate explicit ref changes before disabled targets can save them and reuse
one reviewed discovery throughout a preview. Surface shared ref changes as local
reconciliation work while preserving the applied native identity and receipts.

Reuse scoped legacy proofs for Pi extension ownership and make full inventory
the dashboard's authoritative package/host pair. Cover invalid and replacement
refs, read-only ownership, and shared-state properties without new persisted
state or dependencies.

* test(plugin): repair and consolidate host-state fixtures

Create source intent and a pending imported Claude update through supported
operations so direct and batch updates exercise the intended fixture. Keep the
marketplace-loss case locally owned before testing its skipped reinstall.

Consolidate cross-host repeat-add and requested-ref replacement/orphan retries
at their existing owners, retaining failure recovery and shared-byte checks.
Trim duplicate HTTP and translated-text assertions from consumer tests.

* fix(plugin): reconcile legacy snapshot reads and native imports

Resolve legacy snapshot ownership through existing scoped proofs before listing,
reading or discovering cached source files. Keep adoption read-only and limit
proof work to the requested package and targets; current receipts need no CLI.

Only preserve reviewed source metadata on reimport when intent remains source
managed. Native-only intent must not resurrect an older Git source after a
same-ID local import. Retain identity mismatch and reviewed-source safeguards.

Remove the unused source-folding helper left by the old shared runtime writer.

* Preserve reviewed package versions locally

* Fix reviewed package version lifecycle

* fix(plugin): report missing local imports in doctor

Show the local-import instruction instead of claiming a skipped imported
plugin is healthy. Preserve the missing-CLI warning and shared config bytes.

Keep fixture native settings inside scratch XDG directories and serialize
the fake CLI calls used by concurrent inventories. Update assertions to
separate shared declarations from local versions and native IDs, and align
the raw-write audit with private plugin state and operation locks.

* test(plugin): use declarations for doctor source fixture

The missing-CLI case has no native ID, so encode it with the version 2
declaration schema. Keep the native-only import case in legacy syntax.

* fix(plugin): install shared sources from reviewed snapshots

When a source target is already declared, first sync must install its
reviewed local snapshot even if the native client has a package from the
same marketplace. Keep explicit add adoption and native-only import intact.

Extend the existing two-host adoption check to cover an independent native
installation on the second host and verify a quiet subsequent sync.

* fix(plugin): preserve reviewed retries and native collision boundaries

Retry a pending source update through the existing reviewed update path,
so a rolled-back native failure cannot clear progress at the old snapshot.
Record default-source versions for add, sync, and update while retaining
the recipe fingerprint and generic-version checks for target overrides.

Keep explicit native adoption, but block shared Claude sources when an
independent same-name native plugin could shadow their hooks. Extract the
existing adoption decision so the preview function becomes smaller.

* test(plugin): respect OMP update safety in version control

Check generic and target versions during review, then confirm the existing
OMP upgrade guard preserves the installed and default-source versions.

* fix(plugin): declare first local native imports explicitly

A first local import into a shared source target now changes that target
to native-only intent while preserving its sync selection. Verified source
reimports retain their reviewed source and the preview discloses conversion.

Cover the explicit import, local sync, and other-host cleanup flow, and
remove the unconsumed internal observation assertion from the OMP test.

* docs(plugin): explain first local import intent changes

Describe the shared native-only target conversion and its effect on other
machines, while distinguishing verified source reimports.

* fix(plugin): verify checked sources before native reinstalls

A checked update that becomes an install after native removal must still
match the source digest the user approved. Reject moved or unchecked
sources before native work, and allow a stable approved reinstall.

Clear completed reinstalls from dashboard update availability while keeping
failed targets available for retry. Cover both native presence states in
the existing checked-update tests and the dashboard outcome rule.

* fix(plugin): guard replacement before cleanup

* fix(plugin): refresh discovery for each manager action

A later Add action must review the current source even when the manager
previously observed that source. Keep discovery sharing across one action
while ending its cache before the next wizard invocation.

Exercise a fresh source version after an earlier Add preview without TTY
input or native writes, using an unavailable client to stop at review.

* test(plugin): cover desired checks and final update outcomes

Consolidate checked batch approval and dashboard completion tests while
retaining removed-native, digest, version and approval controls. Reproduce
stale shared recipes and failed or unfinished replacement installs.

* test(plugin): make stale source discovery observable

Remove the old repository before native-only and npm desired checks so
those existing cases cannot pass by reading the applied source.

* fix(plugin): check desired source and final outcome

* test(plugin): bind checked updates to the observed recipe

Reproduce a shared candidate change with equal version, commit and digest,
and preserve a freshly checked replacement whose native ID differs. Use
actual check observations in approval and native update controls, reject
missing source identity, and verify the UI carries the observation through.

* fix(plugin): bind checked update to source recipe

* fix(ui): classify npm recipes as Pi packages

* fix(plugin): retain legacy removal intent during migration

Omit pending removals from shared declarations while retaining original local ownership proof so sync retries cleanup.

Verification: focused regression passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): keep imports local to an existing shared recipe

Adopt a native installation into its local receipt without converting the shared source target or removing other machines installations.

Verification: focused import regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): capture legacy evidence on first read

Persist passive hints before another machine writes v2 and save verified adoption on reads. Apply reuses preview receipts instead of querying every legacy binding again. Document the per-machine pre-migration read.

Verification: migration regressions passed in isolated Linux Codex container runs, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): target named declarations in interactive imports

Offer unresolved package names in dashboard and TUI imports and pass the selected name in single and batch requests. Drop display-only rendered assertions.

Verification: 47 UI tests passed with at most four workers in an isolated Linux Codex container, not the devcontainer.

* fix(plugin): localize shared intent plan guidance

Add message keys for local imports, account changes, cleanup and native collisions across all dashboard locales. Localized guidance contains no CLI flags.

Verification: failing localization regression now passes in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* refactor(plugin): reuse preview inventory and guard apply boundaries

Capture hints on first load without persisting in-memory adoption during preview, keeping approval revisions stable. Apply reuses preview inventory. Reuse accountEnv and guard applyChange plus native write boundaries without inspecting argv.

Verification: migration, receipt, account and sync regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* test(plugin): organize host state coverage around lifecycle scenarios

Group migration, ref drift, account context and cleanup tests behind shared host fixtures and public Preview/Apply assertions. Cover Codex, Cursor, Antigravity and project scopes; add second-machine doctor coverage and the two-machine runbook. Consolidate package-version tests and remove the unused private-record fixture.

Verification: focused plugin regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* docs(plugin): explain local imports and per-machine migration

Document local receipts, per-machine review and commit pinning, config-path state identity and the required legacy read on every machine. Align sharing, doctor, troubleshooting, file-layout and four translated plugin references; restore schema editing guidance.

Verification: context-router check passed. Runtime verification uses an isolated Linux Codex container, not the devcontainer.

* refactor(plugin): separate unrelated review scope

Move project OMP configuration, plugin list ordering, and npm Pi classification to independent local branches based on upstream/main. Keep the shared intent change focused and cover named import selection in the pure flow helper.

The three local branches have passing builds in a Linux Codex container, not the devcontainer, with isolated test homes and capped parallelism.

* perf(plugin): avoid recapturing v2 state on reads

Only compare and persist passive migration hints when legacy bindings exist. Native v2 reads need no state serialization for migration.

Verification: pending removal and first-read/import regressions passed in a Linux Codex container, not the devcontainer, with isolated HOME/XDG/TMPDIR and GOMAXPROCS=4 GOFLAGS=-p=4.

* docs(plugin): clarify native marketplace repair after import

A local import receipt is not a reviewed reinstall source. Correct the remaining troubleshooting instruction and its four translations to require native-client repair, and align the nearby code comment.

Validation: checked against prepareChange, context-router check and git diff --check passed. Verification for this review ran in a Linux Codex container, not the devcontainer.

* fix(plugins): preserve local ownership across shared intent changes

Retain completed legacy migration markers so unchanged v1 YAML cannot
uninstall a later manual reinstall. Serialize read-side hint persistence
with native operations and keep local imports when shared recipes change.
Require explicit dashboard import names and validate recipe identities.

Correct schema descriptions, messages, CLI ref status, translated migration
guidance and runbooks. Add failing-first Preview/Apply regressions and a
real two-ssenv CLI lifecycle script.

* fix(plugins): preserve migration history and show retained import guidance

Mark existing legacy hints and receipts as captured before cleanup so state
from the previous serializer cannot re-adopt a later manual installation.
Keep recipe-change guidance in unchanged sync outcomes and visible dashboard
rows, and resolve nested OpenCode entries through their package manifest.

Cover public migration, ref, account, import and message contracts across
adapters. Correct the real two-host Cursor assertions, explicit dashboard
selection flow, and remaining localized guidance.

* fix(plugins): retain explicit OpenCode entry during import matching

Standalone OpenCode packages can rely on a reviewed explicit entry rather
than an SDK dependency. Preserve that entry when reading native package
identity so matching nested imports remain supported.

* fix(plugins): preserve migrated imports and verify native entry identity

Recognize older native-only receipts by their existing declaration
fingerprint so remote source recipe edits cannot replace migrated imports.
Keep managed npm receipts distinct through their source fingerprints.

Only borrow an ancestor OpenCode package identity when its resolved entry
is the actual registered file. Retain nested and explicit entry support.
Add public two-host migration and mismatching-entry regressions.

* fix(plugins): retain imported ownership through repeated adds

Persist inferred imported ownership when a matching add refreshes the
receipt intent, so later shared recipe changes still preserve local
native installations. Keep the legacy replacement regression aligned
with that ownership contract while retaining removed-intent cleanup.

Reject missing or unstatable absolute OpenCode entries before identity
matching rather than falling back to the file name. Cover both paths
through public Preview and Apply regressions.

* test(plugins): isolate OpenCode adapter fixtures from host config

Keep native registration fixtures inside their fake agent home by setting
XDG_CONFIG_HOME and clearing inherited OpenCode overrides. Ambient config
writes can otherwise leak into config-discovery tests in other packages.

Cover the XDG, file, directory and inline override cases with temporary
config sentinels, while retaining the existing MCP listing expectation.

* fix(plugin): let local imports return to the shared source

Add a local unimport action that removes only this machine’s installation and receipt while preserving the shared source declaration. Keep retained-import guidance visible across matching adds, list, doctor and dashboard consumers.

Avoid idle OMP guidance and unchanged legacy-read locks, preserve localized errors, keep import identity checks offline, and normalize OpenCode drive URLs. Cover the A/B transition and align translations, runbooks and environment cleanup.

* fix(plugin): complete unimport validation and guidance

Reject missing targets before planning local unimports and share per-target eligibility with the wizard. Make native uninstall effects explicit in help and translated docs, preserve structured update guidance, and cover error paths and shell completion.
2026-10-31 04:23:20 +08:00
Krishnaswamy Subramanian eb9b2b28f9 feat(plugin): add --all flag to plugin update and enable antigravity-cli updates (#656)
* Add --all flag to plugin update and enable agy

Add -a/--all to skillshare plugin update so users can update all
tracked plugins in a single command without tying slow target CLI runs
to skillshare update --all or sync --all.

- Reject --all outside plugin update or when combined with a plugin
  name or --source-ref
- Share source repository discoveries and discovery errors across the
  Preview and Apply lifecycle via Service.WithDiscoveryCache so multi-
  plugin marketplaces are cloned at most once per command
- Isolate source, manifest, and target failures per binding when --all
  is active so healthy plugins update while partial failures exit
  non-zero and leave failed bindings unchanged in config.yaml
- Skip unfiltered OMP bindings during --all updates so sibling targets
  on the same package still update without failing the batch
- Enable plugin update for antigravity-cli while skipping disabled
  plugins when agy extensions list reports an entry as disabled

Closes #653

* Add plugin update --all to docs and completions

Advertise -a/--all for skillshare plugin across all five shell
completion scripts and document the bulk update workflow and
antigravity-cli update support in the user and built-in skill docs.

- Add --all and -a to plugin completions in bash, zsh, fish,
  PowerShell, and Nushell with TestPluginCompletionsIncludeAllFlag
- Document update [NAME | --all], -a/--all, and antigravity-cli source
  updates in website/docs/reference/commands/plugin.md (and its
  zh-Hans, zh-Hant, ja, and ko translations), sharing-plugins.md, and
  quick-reference.md
- Document plugin update --all and antigravity-cli enablement checks in
  skills/skillshare/references/plugins.md

* Require known enabled state for native updates

Require a matching EnabledKnown && Enabled inventory entry before
updating copilot or antigravity-cli bindings, and align the localized
plugin workflow pages with the English docs.

- Skip copilot and antigravity-cli updates in Service.Preview and
  refuse reinstallation in applyNativeTarget when the binding is absent
  from native inventory or not known to be enabled
- Cover absent native inventory in
  TestAntigravityCLIUpdateRespectsEnablement
- Synchronize plugin update [name | --all] and Antigravity CLI update
  guidance across the ja, ko, zh-Hans, and zh-Hant copies of
  quick-reference.md and sharing-plugins.md
2026-10-27 20:57:43 +08:00
Willie 3cb1fa4984 test(plugins): require JSON flag in native lifecycle inventory
Match the complete plugin list --json command so dropping the JSON flag no longer passes the native lifecycle test.
2026-10-25 22:32:33 +08:00
Krishnaswamy Subramanian fad3305060 fix(plugins): support native JSON array for Antigravity CLI inventory (#640)
Pass --json to agy plugin list and parse the top-level JSON array returned by the Antigravity CLI. Keep fallback handling for empty text output and legacy wrapped envelopes.

Closes #639
2026-10-25 22:27:49 +08:00
Krishnaswamy SubramanianandWillie dabe06a297 feat(targets): support OpenCode config directory accounts (#594)
* feat(targets): support OpenCode config directory accounts

OpenCode v2 introduces support for custom configuration directories
via OPENCODE_CONFIG_DIR, storing opencode.json and agent directories.

Previously, skillshare rejected OpenCode accounts configured with a
custom config directory because OpenCode was missing config_dir and
was excluded from accountAgents in hooks and MCP services.

- Define default config_dir (~/.config/opencode) in targets.yaml
- Add OpenCode to account agents and register OPENCODE_CONFIG_DIR
  across hooks and MCP service handlers
- Route OpenCode account MCP configuration to opencode.json inside
  the account config directory

Resolves #593.

* fix(targets): add OpenCode to schemas, completions and docs

Add opencode to the targetConfig.agent enum and config_dir description
in schemas/config.schema.json so configurations containing OpenCode
account targets pass schema validation.

Include opencode in the target --agent completion scripts for Bash,
Zsh, Fish, PowerShell, and Nushell.

Update website documentation and built-in skill references to describe
OpenCode accounts and OPENCODE_CONFIG_DIR management alongside other
account agents.

* fix(targets): support plugin accounts and overlap

Add OpenCode account recognition and OPENCODE_CONFIG_DIR resolution to
the plugin service so plugin sync works for OpenCode account targets.

Introduce TargetScanPaths to resolve cross-runtime scan paths using
TargetConfig.Agent for account targets while retaining the account's
own primary directory. Update path overlap detection, doctor checks,
and LeakedSkills to warn about leaked skills for account targets.

Update localized docs (zh-Hans, zh-Hant, ja, ko) and plugin references
to document OpenCode account targets and OPENCODE_CONFIG_DIR. Update
the available targets handler test to expect OpenCode's configDir.

* fix(targets): isolate OpenCode accounts and scan paths

Reject OPENCODE_CONFIG overrides when operating on OpenCode accounts
and clear OPENCODE_CONFIG in the account execution environment so
plugin operations target the account directory.

In TargetScanPaths, remap config-root paths to the account directory
while preserving external scan paths like Codex's ~/.agents/skills.

* fix(plugins): use account target in OpenCode update probe

Pass c.Target instead of a hardcoded "opencode" when probing whether
OpenCode supports plugin updates, ensuring account-configured CLI
binaries and account environment variables are used during preview.

* test(mcp): isolate XDG_CONFIG_HOME in account test service

Isolate XDG_CONFIG_HOME to the temporary test directory in
agentAccountService to prevent runner environment variables from leaking
into TestAccountEnvOverrideDoesNotPruneDefaultHome when testing OpenCode
account shell overrides.

---------

Co-authored-by: Willie <egg358358@gmail.com>
2026-10-22 21:50:06 +08:00
Willie 829cbb176d fix(plugins): honor native OMP marketplace builds (#588)
* fix(plugins): honor native OMP marketplace builds

Resolve OMP entries from their native marketplace when present and inspect package.json extension-only plugins. Keep target-specific source paths, marketplace identities and components so Claude adoption and hybrid manifests remain valid.\n\nShow separate builds in text discovery without changing logical JSON selection, and cover native precedence, invalid catalogs, manifestless and hybrid packages, global/project materialization and CLI output with regression tests. Update the plugin docs and existing translations.\n\nFixes #587

* fix(plugins): preserve native build metadata across consumers

Keep OMP catalog versions in target discovery metadata and materialized marketplace entries so previews, cache guards, and native installs use the same version, including legacy catalog fallback. Cover catalog versions that differ from package manifests.

Show each dashboard discovery target's own version, components, and source path instead of presenting a merged candidate as one build.

* fix(plugins): avoid ambiguous shared build versions

Derive candidate versions from agreement across supported targets and recompute after catalog overrides. No-Agent records and lists no longer inherit an arbitrary native build version; equal versions remain available and unknown versions stay unknown.

Keep Cursor and Antigravity inventory target-specific when manifests disagree. Cover no-Agent preview and persistence, equal and unknown versions, catalog overrides, and mixed-manifest local inventories. Align English and translated plugin references.

* fix(plugins): accept Pi extension manifests for OMP catalogs

Reuse the existing OMP extension detector instead of requiring an OMP-specific manifest key. Native OMP accepts Pi extension manifests too, so the extra gate rejected supported native catalog entries.

Cover Pi-only discovery with scoped package names and global/project materialization. Align the English plugin references and all existing translations.
2026-10-20 12:22:05 +08:00
Willie ffdf9e57ab fix(plugin): stop evaluating Pi rules whose meaning depends on the Pi version (#549)
Pi 1.2.0 (earendil-works/pi#10765) runs normalizePath on resource-filter
patterns before matching, so `~`, `~/`, `file://` and, on Windows, `~\`
and Git Bash/MSYS/Cygwin/WSL drive paths now match files that older Pi
never matched. Skillshare supports Pi 0.99.2 and later without knowing
which one evaluates the rules, so it reported a definite selection that
could be wrong and let the write guard reason from it. Such rules now
evaluate as unknown, and the dashboard names the rule instead of a
generic message.

Exact rules also missed Pi's normalizeExactPattern in every version: a
leading ".\" is dropped on all platforms and backslashes become slashes
on Windows. Skillshare only dropped "./", so `-.\extensions\a.ts`
looked unmatched and produced a duplicate missing row.
2026-10-13 09:50:39 +08:00
Willie fd18cda655 fix(plugin): read plugin sources through their real path on macOS (#544)
Adding a plugin from a Git URL to Oh My Pi on macOS was always blocked
with "linked or non-directory OMP path component", which the dashboard
shows as "The reviewed OMP runtime destination must be verified empty".
The source is cloned into os.MkdirTemp, which lives under /var/folders,
and /var links to /private/var. The OMP install check reads the source's
package.json through ompSafePath, which rejects any linked component, so
Skillshare's own temp clone failed it. A local source under a linked
parent failed the same way.

acquireRef now hands callers the resolved root of the temp clone and of
a local directory, while the recorded source stays as given. Links inside
the source are still handled as before; cleanup still removes the
original temp directory.
2026-10-13 03:33:28 +08:00
Willie 12dd041288 fix(plugin): accept OMP 18.6.1 and later instead of exactly 18.6.1 (#543)
* fix(plugin): accept OMP 18.6.1 and later instead of exactly 18.6.1

The OMP adapter pinned the native version to exactly 18.6.1, so every
newer release was refused: the dashboard reported "Installation requires
OMP 18.6.1" for a user on 18.8.7, and removal and standalone extension
selection were blocked the same way.

The sources the adapter depends on (marketplace cache/manager/types,
plugin-cli output, the project anchor in discovery/helpers.ts, extension
loading and the pi-natives file lock) are unchanged from v18.6.1 through
v18.10.2, so the pin is now a minimum. The install, removal and selection
gates share one check built on the existing plainVersion helper;
unparsable, prerelease and older versions stay blocked.

Messages, all dashboard locales, the plugin reference docs and the
built-in skill now state 18.6.1+. A test keeps the English guidance text
in en.json equal to the Go strings the dashboard matches on.

* fix(docs): record the OMP 18.6.1+ boundary in the cache safety report

The safety report still said installation is allowed only for OMP 18.6.1
and that an unknown version blocks it, which no longer matches the gate.
It now states the minimum, which versions stay blocked, and the source
comparison and native 18.8.7 run that justify replacing the pin. The two
OMP runbooks no longer require exactly 18.6.1.
2026-10-13 02:50:17 +08:00
Willie f540daf601 fix(mcp): turn off a global server in OpenCode 2 projects (#541)
* fix(mcp): turn off a global server in OpenCode 2 projects

OpenCode 2 replaces a global server with the project entry of the same
name, and silently drops an entry without its type and command or url.
The project switch Skillshare wrote, {"enabled": false}, therefore left
the server on in OpenCode 2, while OpenCode 1 merged it by field.

Checked against OpenCode 2.0.27 and 1.19.0: OpenCode 2 still reads the
flat mcp.<name> shape and turns enabled: false into disabled: true, and
both read an entry with type and command or url. So no version detection
is needed. When the global config under mcp.projects defines the server,
the OpenCode switch now carries its type and executable, or its url
without the query, next to enabled: false. Args, env, headers and the
query stay out of a project file that may be committed, as the Pi switch
once did. A switch that already carries the endpoint keeps it when the
global server later leaves the config, unless it was edited since sync.

In project mode, or when the global config lacks the server, only the
bare switch can be written; the plan now says OpenCode 2 ignores it, in
the CLI and the dashboard.

Import also reads OpenCode 2's mcp.servers section, which its own
`mcp add` writes, instead of reporting it as one broken server.

Refs #538

* fix(mcp): keep secrets in a URL path out of the OpenCode switch

The OpenCode switch dropped only the query of the global server's URL.
Some MCP services put the key in the path instead, and an absolute
executable path names the user's home directory; both then reached a
project file that may be committed. A disabled server never starts, and
OpenCode 2 accepts any type with a command or url, so the switch now
carries only the executable's name or the URL's scheme and host.

Refs #538

* fix(mcp): skip OpenCode 2's timeout defaults when importing

OpenCode 2 keeps server defaults in mcp.timeout next to mcp.servers, so
import listed timeout as a broken server. It is dropped only together
with a recognized servers section, where it cannot be a v1 server.

Refs #538

* fix(mcp): read an empty OpenCode 2 servers section

An empty mcp.servers object was not recognized as OpenCode 2's section,
so import listed servers and timeout as broken servers instead of
finding no entries. The dashboard help for disabled also still said only
the switch is written, which is no longer true for opencode.

Refs #538

* fix(mcp): keep an OpenCode endpoint switch next to its own fields

The kept switch was matched by the whole native entry, so a field only
OpenCode reads, such as a per-server timeout, made the next sync drop the
type and command or url once the global server left the config, and
OpenCode 2 then ignored the switch. Match the fields Skillshare manages.

Refs #538

* fix(mcp): show the OpenCode endpoint switch in the dashboard preview

The dashboard renders a project's server alone, so the preview never saw
the same-named global server and showed the bare switch that OpenCode 2
ignores, while sync wrote the switch with the endpoint. Resolve the
global server the way sync does.

Refs #538

* fix(plugin): read OpenCode 2's version output

OpenCode 2 prints "opencode v2.0.27" for --version, while OpenCode 1
prints only "1.19.0". The adapter trimmed a leading "v" only, so plugin
sync to OpenCode 2 failed as an unrecognized version and imported
updates were skipped as if OpenCode 1 had no update command. Read the
last field, and decide the update check with the same parser.

Refs #538
2026-10-12 23:57:40 +08:00
Willie 19cdc1c72e fix(plugin): let an imported Claude plugin update to what its marketplace holds (#536)
An imported plugin's native marketplace decides the version an update installs, so the update check now applies only to bindings with a reviewed source and an import records the version installed. Importing an imported plugin again also records the installed version; a source binding keeps the version Skillshare reviewed.

Refs #535
2026-10-12 17:04:52 +08:00
Willie 99c7911bf3 feat(plugins): update a batch of plugins over one stream (#534)
Updating several plugins from the dashboard was slow: each plugin took a
preview and an apply round trip, apply previewed again, every plugin cloned
its source on its own, and config reloaded after each one.

The dashboard now sends the picks to POST /api/plugins/update/stream. The
server holds the plugin lock once, previews each plugin once and applies that
plan, lets plugins from one source share a single read of it, and reloads
config once at the end. POST /api/plugins/update/stop lets the plugin under
way finish and starts no other; a closed page does not cut an install short.

The check-to-update safety moves to the server: an Agent whose source moved
since the check, or that no check showed, installs nothing. npm packages in
Pi are exempt, since Pi installs whatever npm names latest; the old
client-side comparison flagged them as moved on every update.

The update dialog follows the Skills update page, shows per-Agent old -> new
versions, fails rows a broken stream never finished, and lists every plugin
with its Agent and version when all are current.

Release-As: 0.25.6
2026-10-12 16:09:12 +08:00
Willie 5338d6a4c1 feat(ui): check plugin updates on load and update them in one batch (#527)
* feat(ui): check plugin updates on load and update them in one batch

Updating plugins took four steps each: press Check updates, press Update
on one row, review a second preview, apply, then check again because the
list did not know the update had happened. Six plugins meant six rounds.

The page now checks once in the background when it opens, so rows show
their new version without a click. The header's Check updates button
becomes "Update N" when something is behind and opens one dialog: every
plugin with an update is ticked, a plugin on several Agents is one row
whose Agents can be left out, and imported installs Skillshare cannot
update sit apart. One button runs them in turn through the existing
preview and apply, so no new API is needed. Progress, results, errors
and per-Agent retry stay in the same dialog, and the applied results
update the page state, so nothing has to be checked again.

The count and the dialog both come from what is still behind after the
last check, limited to Agents that can be updated from here, so a
partial batch is not offered again and Agents with check but no update
(OMP, Antigravity CLI, Grok) do not inflate the count.

* fix(ui): keep batch plugin updates to what the user reviewed

Codex review of #527 found four ways the batch update could act on
something other than what the dialog showed:

- A source that moved between the background check and the click was
  installed straight from the fresh preview, so a newer version or new
  components went in unreviewed. The batch now compares each fresh plan
  with the version and commit the check showed, applies nothing when
  they differ, says so on the row, and runs a quiet check so the next
  dialog shows the new version for review.
- A retry of the failed Agents that failed again lost that subset, so a
  third try re-sent Agents that had already updated. A failed row now
  always keeps the Agents it failed on.
- An update the server skipped (its marketplace gone, say) counted as
  done: the row said updated and the plugin left the update count.
  Skipped outcomes now keep the Agent pending and show as skipped.
- A plugin removed after the check stayed in the update count and
  failed with "not found" when picked. Pending updates now drop any
  plugin or Agent binding the inventory no longer has.

* fix(ui): show a manual check's result and each Agent's own version move

Codex's second review of #527 found two gaps:

- A check the user pressed that found nothing to update from here (only
  imported installs, or everything current) opened nothing, so the
  "update inside the Agent" guidance and the up-to-date result never
  showed. The check now reports whether it came back, and a check the
  user asked for opens the dialog; the background check on load stays
  quiet.
- A plugin on several Agents showed one version move built from the
  first Agent's installed version and the first new version found, which
  can mix Agents that come from different sources. The row now shows one
  move only when every Agent makes the same one, and each Agent's own
  move otherwise.

* fix(plugin): carry the source digest on a check so a batch update can tell it moved

Codex's third review of #527: a local-directory plugin has no commit,
so when its files changed again after the check while the manifest
version stayed the same, the batch's version and commit comparison
passed and the fresh preview was applied without the user seeing it.

The check copied the installed binding, so its digest was the one
already installed, not the source's. It now sets the discovered digest
alongside the version and commit, as the update preview already does.
The dashboard keeps that digest with each update it found and refuses
to apply when the fresh preview's digest differs, marking the row as
changed since the check. An npm package has no digest and is unaffected.

* fix(ui): list blocked check results and drop unticked Agents from the batch

Codex's fourth review of #527:

- A check can mark an Agent blocked when the updated source no longer
  offers a compatible plugin for it. The update dialog listed only
  updatable, native-check and up-to-date results, so it hid the block
  and could say everything was current. Blocked results now get their
  own section with the reason, and the empty state says nothing can be
  updated from here rather than that everything is up to date.
- An Agent unticked after the check stayed in the pending updates;
  picking it produced a no-op that the batch reported as updated.
  Pending updates now skip bindings with sync off, as the row's own
  behind count already does.

* fix(ui): count partly skipped plugins as updated and surface a failed re-check

Codex's fifth review of #527:

- When one Agent of a plugin updated and another came back skipped, the
  row was marked skipped, the summary counted no update, and the Agent
  that did update was not shown. A row now names which Agents updated
  and which were skipped, and the summary counts any plugin with an
  updated Agent.
- After a source moved since the check, the follow-up check ran quietly,
  so if it failed the stale update stayed offered and every retry hit
  the same skip. The moved plugin now leaves the found updates, and the
  follow-up check reports its failure like any check the user started.
2026-10-11 22:19:14 +08:00
Willie f4c77d53c3 fix(config): refuse project config writes that leave the project
Saves follow a symlinked config.yaml to its target so dotfile links
survive. For a project config that also lets a cloned repository point
.skillshare/config.yaml at any file the user can write, including one
that does not exist yet, and every project save, plugin change, hooks
change, MCP change, or legacy migration would then rewrite or create it.

All five writers now resolve the destination through one helper,
utils.ConfigWritePath. A global config keeps writing through its link.
A project config must resolve inside its project; otherwise the save
fails and names the link so the user can replace it with a regular
file. The one-time legacy migration skips persisting instead, and the
next save reports the link.
2026-10-07 10:19:12 +08:00
Willie f1c7c5d184 fix(plugin): expand every folded tilde form and keep dangling config links
FoldHomePathWith writes ~\plug on Windows and a bare ~ for the home
directory itself, but canonicalSource only expanded ~/, so with
preserve_tilde_on_save those sources came back relative on the next
load and update or sync could not resolve them.

When config.yaml is a symlink whose target does not exist yet, as a
dotfiles manager may create before first use, EvalSymlinks fails and
the save renamed over the link again. Follow the link to its intended
target so the first save creates that file, as Config.Save already does.

Refs #460
2026-10-07 10:02:56 +08:00
Willie 49b43b228c fix(plugin): keep symlinked config.yaml and normalize plugin sources
Plugin saves wrote a temp file next to config.yaml and renamed it over
the path. When config.yaml is a symlink into a dotfiles folder, the
rename replaced the link with a regular file, so the shared config
never received the change and the machine silently forked. The plugin
writer also skipped preserve_tilde_on_save, saving sources as absolute
home paths. The one-time legacy target migrations for global and
project configs used the same temp+rename and replaced links as well.

Plugin sources were compared as raw strings. The snapshot owner marker
records the absolute path from add, so a config that spells the same
folder as ~/... failed every update with "snapshot ownership conflict".
For Agents whose snapshot location hashes the source, the new spelling
silently created a second snapshot instead.

Resolve the symlink before writing, normalize sources once where the
plugin section is decoded so owner checks and snapshot paths agree,
and fold sources back to ~ on save when preserve_tilde_on_save is set.

Refs #460
Refs #461
2026-10-07 09:56:48 +08:00
Willie e40c634d2b test(i18n): close the gaps review found in the key checks
Review showed three ways a missing key still passed:

- t('sync.changes') passed because the counted base was accepted for
  any string; a string passed straight to t() must now be a key itself.
- plural('typo.key', n) was only seen when its first word was a known
  namespace; strings passed straight to plural() are now checked for
  both forms.
- The Go test listed the values that complete "plugins.problem." by
  hand, so a new case in automationProblem passed; the values now come
  from that function's switch.

The files of config paths were also skipped by every check; they are
now skipped only where config paths look like keys, so their t() calls
are checked again.

Refs #448
2026-10-07 00:23:02 +08:00
Willie f0270c371b refactor(ui): let i18n own key validity and plural selection
The i18n module guaranteed parity between locales and left the rest to
callers. `t` takes any string, so a mistyped key rendered as the key and
nothing caught it; internal/plugin sends translation keys that nothing
compared with en.json; and about 130 call sites chose between `.one` and
`.other` by hand.

- keys.test.ts reads the dashboard source and fails on a key that is not
  in en.json. A key built at run time is checked by its fixed head, and a
  string that only looks like a key is named in a short documented list.
- internal/plugin/i18n_keys_test.go fails when a "plugins." literal the
  package emits is missing from en.json; the one key completed at run
  time lists its values.
- plural(key, count) in the i18n module picks the form, with the same
  "exactly 1" split the call sites used, so every rendered string is
  unchanged. No locale file changed.

Refs #448
2026-10-07 00:12:35 +08:00
Willie 147b509e5f fix(plugins): show the commit when a source changes without a new version
Update checks compare the source digest, not the version, so a repo that
pushes commits without bumping its manifest (ponytail ships dozens a day)
showed "4.12.0" with an Update button and looked like a stuck update.

Check now returns the source commit, and the version tag adds
"old → new" commits when the version itself did not move.
2026-10-05 23:03:03 +08:00
Willie 97446744ff feat(omp): add native Oh My Pi support (#423)
* feat(omp): add native Oh My Pi support

Support OMP skills, instructions, MCP, code hooks and guarded extension selection using its verified native contracts rather than Pi aliases.

Add reviewed marketplace plugin installation, cache-preserving scoped removal and fresh-cache reinstall. Align Pi/OMP extension cards and localize inventory guidance while keeping native ownership and read-only constraints.

Include regression coverage, isolated E2E runbooks, documentation and verification policies. Native plugin updates and unverified runtime platforms remain guarded.

Refs #409

* fix(omp): guard runtime ownership and localize inventory guidance

Native install recursively replaces its runtime destination, and a missing cache manifest could leave the real runtime link installed after removal. Bind and recheck an absent reviewed destination, and recover removal names only from verified scope-local links.

Localize fixed backend reasons and warnings across dashboard locales while preserving paths and external diagnostics. Restore the reviewed source in the existing reinstall fixture and record real native verification.

* fix(omp): allow forgetting natively removed plugins

A different plugin can retain node_modules after native uninstall deletes this installation. When its cache, registration and known runtime state are absent, forget only the stale Skillshare binding instead of demanding runtime-name proof for unrelated files.

Extend the existing removal recovery test with a failing-before-fix case that verifies the binding is dropped and unrelated native lock bytes and plugin files are preserved. make check passes.
2026-10-05 20:36:39 +08:00
Willie 116feb6d16 fix(plugin): ask npm which registry it uses, and keep updates that never ran
Codex review on #400:

- The private-registry check read npm's config by hand, and each round
  found another place npm reads it from: the lowercase environment, the
  global npmrc, and now a globalconfig or prefix set in the user .npmrc.
  Rather than chase npm's rules, the check now asks npm itself:
  `npm config get registry @scope:registry` in the folder Pi runs npm in.
  Any registry other than npmjs, or npm not answering, leaves the package
  to Pi. The hand-written .npmrc reading is gone.

- When an apply stopped before any Agent ran, such as on a stale preview,
  the result had no outcomes, and the page took every planned update off
  its list, hiding the row's Update action. Only an Agent the result
  reports done comes off now.
2026-10-05 00:32:56 +08:00
Willie be661c593f fix(plugin): keep row updates without a new version, read npm's global config, keep odd manifests
Codex review on #400:

- The Plugins page kept only one version per plugin from a check, and
  only when the change had one, then hid the row's Update button when an
  Agent already had that version. A source plugin whose content changed
  without a version bump, or whose manifest has no version, so lost its
  Update action once the check dialog closed. The page now keeps what the
  check found per plugin and Agent, with or without a version, and an
  applied update takes those Agents off; the version only shows what the
  update brings.

- The private-registry check did not read npm's global config, so a
  registry set only in $PREFIX/etc/npmrc still sent the package name to
  npmjs. It now reads the file npm_config_globalconfig names, else
  $PREFIX/etc/npmrc with the prefix from the environment or the npm on
  PATH, and leaves the package to Pi when it can't tell where that file
  is.

- Reading the package version made a package.json whose version is not a
  string fail to decode as a whole, which dropped its pi manifest and the
  extensions it declares. The version is decoded on its own now, so an
  odd one is only skipped.
2026-10-05 00:22:30 +08:00
Willie c5571a8cae fix(plugin): leave npm ranges and tags to Pi, and read a lowercase userconfig
Codex review on #400:

- A package added with a range such as npm:demo@^1.2.0 was compared with
  npm's unrestricted latest. With latest at 2.0.0 and the newest matching
  release at 1.9.0, check kept offering 2.0.0, which Pi never installs
  because it keeps the configured range. Only a package added without a
  version follows latest now; one with a range or a tag is left to Pi, as
  a pinned one already was.

- The private-registry check read the user .npmrc path only from
  NPM_CONFIG_USERCONFIG. npm reads its environment case-insensitively, so
  a lowercase npm_config_userconfig pointing at an .npmrc with a private
  registry was ignored, and the package name went to npmjs. Both
  spellings are read now.

The plugin reference, its translations and the built-in skill say which
packages the check leaves to Pi.
2026-10-05 00:12:29 +08:00
Willie cc249c1498 fix(plugin): leave private npm registries to Pi, and keep updates for Agents still behind
Codex review on #400:

- The update check asked the public npm registry about every unpinned Pi
  package, even when the environment or an .npmrc sends the package, or
  its scope, to another registry. A public package with the same name
  could then hide a real update or offer an unrelated version. The check
  now reads the npm registry settings for the package and its scope from
  the environment, Pi's npm folder and the user .npmrc, and falls back to
  checking in Pi when any of them names another registry.

- The row's Update button disappeared as soon as any Agent had the
  version the check found, so with one Pi target behind and another up to
  date, the one behind lost it. The row now compares each selected Agent
  with that version on its own, and updates only the ones behind.
2026-10-05 00:05:07 +08:00
Willie 0f2ce354fc feat(plugin): check Pi npm packages for updates and show their versions
The Plugins page listed every binding a run touched, one row each, so a
single failure sat among a dozen "unchanged" rows, and the preview did
the same. Failures now come first, Agents that ended the same way share
a row, and what stayed the same folds into one Unchanged line that opens
to one row per plugin, with Pi packages apart. Logos stay only on the
rows that need a look.

An npm package in Pi recorded no version and no source, so it showed no
version and Check updates could only say to check in Pi. The installed
package.json now gives its version, on the Plugins page and in a Pi
target's Extensions tab, and check compares that version with npm's
latest. A newer version gets an Update button on the row and in the
check's result; it updates that one package with pi update <source>,
not pi update --extensions, which would also update packages the
preview never listed. update leaves a package already at npm's latest
alone, and records no version, so the dashboard keeps reading what Pi
installed. The two check messages that were English in every locale now
have keys.

Release-As: 0.24.5
2026-10-04 23:55:11 +08:00
Willie eb58dec1f0 fix(plugin): keep the global owner of a Pi project override
Codex review on #399: switching an extension of a global package in a
project writes a project override, which the project view reads in its
project-entry loop. In project mode that loop looked only at the
project's config, so the override lost the global plugin's name.

A project entry now falls back to the global config's owners when the
project config has none.
2026-10-04 23:14:07 +08:00
Willie 56b4f79ac4 fix(plugin): find global owners of inherited Pi packages in project mode
Codex review on #399: a dashboard started in project mode gives the
plugin service the project's config, so a global Pi package that
Skillshare installed, inherited by the project, found no owner and its
card fell back to the state path again. The earlier test kept
ConfigPath on the global config and missed this.

The service now takes the global config path in project mode, and the
project view looks up inherited global entries there.
2026-10-04 23:08:33 +08:00
Willie a510d2a089 fix(plugin): name the managed plugin of a Pi entry with a problem
Codex review on #399: an entry with a readable source but a value
Skillshare can't edit, such as "extensions": null, returned early in
both the global and project views before ManagedBy was set. Its card
then fell back to the plugin's local state path again.

The lookup now runs for every entry whose source can be read, before
the early return.
2026-10-04 23:02:03 +08:00
Willie c31dffc450 fix(plugin): name Skillshare-installed packages in Pi project views
Codex review on #399: piProjectState never set ManagedBy, unlike
piGlobalState. A project's Extensions tab (<project>@pi, or pi in
project mode) therefore titled a plugin Skillshare installed by its
state path and dropped the "Managed by Skillshare" tag, for both the
project's own entries and the global entries it inherits.

The lookup by source, then by resolved local path, moves into
piManagedBy and runs for every package of both views.
2026-10-04 22:56:12 +08:00
Willie f0e3ee22b3 test(plugin): keep Codex finder tests off the machine's own installs
The macOS finder tests stub PATH, but the candidate list still checked
/opt/homebrew/bin/codex, /usr/local/bin/codex and /Applications on the
real filesystem. In the devcontainer /usr/local/bin/codex exists, so it
won over the app bundle each test set up and make check failed there.

The finder now joins those absolute paths onto a root field, "" on a
real machine, and the tests point it at an empty temp dir.
2026-10-04 22:56:12 +08:00
Willie f5a2470276 fix(plugin): keep the Codex logo under a portable manifest
Adopting the portable root plugin.json replaced the whole Codex target
info, dropping the interface.logo read from .codex-plugin/plugin.json.
Codex still overlays that native manifest, and the portable one rarely
names a logo, so the add/list UI fell back to a generic icon.

Refs Codex review on #396.
2026-10-04 22:24:12 +08:00
Willie 04c4c95cba fix(plugin): keep version check for versionless portable manifests
A portable root plugin.json without a version left the Codex binding's
version empty, which skips the post-update version check, so an update
could advance the snapshot while Codex still ran an older copy. Codex
reports 1.0.0 for such a manifest, so expect that instead.

Refs Codex review on #396.
2026-10-04 22:18:57 +08:00
Willie 021e0037b6 fix(plugin): expect the version Codex reads from a portable manifest
Codex 0.159 installs from a portable root plugin.json (agent-plugins.org
schema) ahead of .codex-plugin/plugin.json, and reports 1.0.0 when that
manifest has no version. Skillshare preferred .codex-plugin/plugin.json,
so updating a package that ships both (ponytail 4.10.3) failed with
"native update returned version 1.0.0; expected 4.10.3" on every sync.
2026-10-04 22:14:28 +08:00
Willie 70cb287672 fix(plugin): find the Codex CLI the desktop app ships (#383)
* fix(plugin): find the Codex CLI the desktop app ships

Plugin commands ran the bare name `codex` from PATH, so a machine with only
the Codex desktop app, or a scheduled job started with a minimal PATH,
reported the CLI as missing. The account-only `cli` override did not help:
the default codex target cannot set it, and an absolute path in a config
shared between macOS and Windows is wrong on one of them.

When `codex` is not on PATH, look in Homebrew's folders and the CLI the app
installs (Codex.app on macOS, %LOCALAPPDATA%\OpenAI\Codex\bin on Windows).
SKILLSHARE_CODEX_CLI overrides the search on one machine without touching
the synced config. The missing-CLI error now lists every place searched, in
the CLI and the dashboard.

Refs #338

* docs(plugin): note where Skillshare finds the Codex CLI

The plugin reference and the sharing guide still said every native CLI must
be on PATH, and the built-in skill told agents a missing CLI has no
fallback. Codex now has one, plus a machine-local override that agents
should prefer over a path in a shared config.

Refs #338

* fix(plugin): look for the Codex CLI inside ChatGPT.app

Since the Codex desktop app merged with ChatGPT, macOS installs it as
ChatGPT.app, so an app-only Mac with a minimal PATH still reported Codex as
missing. Try ChatGPT.app before Codex.app in /Applications and
~/Applications, the order Codex's own desktop-app finder uses.

Refs #338

* fix(plugin): run the packaged CLI entrypoint of the ChatGPT app

ChatGPT Desktop 26.924 removed Contents/Resources/codex and ships the CLI
at the entrypoint its package manifest declares, codex-cli/bin/codex, so a
current app-only Mac still reported Codex as missing. Try that entrypoint
first in each app bundle and keep the old path for earlier builds.

Refs #338

* fix(plugin): find the Codex CLI from the Windows installer

The official PowerShell installer puts codex.exe in
%LOCALAPPDATA%\Programs\OpenAI\Codex\bin and adds it to the user PATH. A job
started without that PATH missed it, the same gap Homebrew's folders cover
on macOS. Try it before the desktop app's copy.

Refs #338

* fix(plugin): keep an account's cli even when it is codex

The Codex search ran whenever the executable was the bare name codex, so an
account that set cli: codex could get SKILLSHARE_CODEX_CLI or the app's CLI
instead, against the documented rule that an account's own cli is kept.
Search only when no account cli is set.

Refs #338
2026-10-04 15:16:14 +08:00
Willie 3c7e48e239 fix(ui): let a Pi extension switch remove a rule instead of adding its opposite
Turning on a file that only a "-path" rule kept off wrote "+path", so the
row ended with a rule pinning it on and a separate Remove rule button that
did nearly the same thing. When removing the row's own rule gives the state
the switch wants, the view now says so (unruled) and the switch removes the
rule. Remove rule stays only where the rule is redundant. The prediction
uses the same rule edit, evaluation and guard as the write, so the preview
and the result agree.
2026-10-04 05:02:04 +08:00
Willie ca11f63a09 fix(plugin): trust symlinked ancestors of the Agent config root (#368)
* fix(plugin): trust symlinked ancestors of the Agent config root (#365)

noSymlink walked every ancestor up to / and refused the write if any was a
link, so macOS /var, a home on a linked volume, a dotfiles-linked ~/.pi, or a
PI_CODING_AGENT_DIR / CLAUDE_CONFIG_DIR / CODEX_HOME behind a link failed with
"refusing to modify symlinked native path".

noSymlink now takes the root the user chose (the Agent folder, the project,
or Skillshare's state dir) and checks only the path and the folders between
it and that root, refusing paths outside it. The root is compared lexically
because every checked path is built by joining onto it, so no EvalSymlinks
call is needed. A linked config file or a linked folder inside the root is
still refused, and Windows junctions are still detected via IsLinkMode.

* fix(plugin): bound the noSymlink ancestor walk by its relative depth

The walk stopped when p equalled root, but on Windows Dir spells a UNC
share root with a trailing separator (\\server\share\) while Clean keeps
the root without it, so the loop never ended for a PI_CODING_AGENT_DIR,
project root or StateDir on a share root. Walk up exactly as many levels
as the relative path has instead.
2026-10-04 02:50:00 +08:00
Willie 9788d486f7 feat(pi): edit extensions on any Pi at or above the verified minimum (#367)
* feat(pi): edit extensions on any Pi at or above the verified minimum

Pi 1.0.1 was released and every user who updated found the Extensions
tab read-only, because the gate matched an exact list of versions. The
package contract has not changed between patch releases, so the gate now
accepts any plain X.Y.Z at or above PiMinVersion (0.99.2), the oldest
version with executed evidence. Older, prerelease or unparsable versions
stay read-only.

The version matrix now also records Pi 1.0.1, which passes every check.
The evidence test requires PiMinVersion to be recorded and every recorded
version to pass, instead of matching an exact list.

The read-only reason is renamed to unsupportedVersion and the API returns
minVersion, so the dashboard says which version is needed.

The Pi MCP project switch keeps writing the global command or url: from
1.0.1 Pi accepts a switch-only entry, but it is skipped by older Pi and
warns at every start where the global config lacks the server. Its
rationale in comments and docs is updated to say so.

* fix(docs): update Pi extensions design records for the minimum gate

Codex review on #367: the design records still described the exact
version list (PiVerifiedVersions, unverifiedVersion, "exact versions
only"), so a contributor relying on them would implement or validate the
old contract. implementation-report.md now states the current gate and
evidence, and phase-0.md gains a dated minimum-version update that the
older paragraphs point to, keeping the history intact.
2026-10-04 02:26:59 +08:00
Willie 3ba95ef49e feat(plugin): add npm packages from pi.dev through Pi (#363)
* chore(design): export dashboard tokens for design tools

Mockup tools read a design system's tokens.json rather than our CSS, so
designs drifted from the dashboard's Clean theme. The script derives the
tokens from components.css, and CI runs its test so a new color
variable without a usage note fails instead of silently going missing.

* feat(plugin): add npm packages from pi.dev through Pi

Pi packages on pi.dev are npm packages, which Plugins could not add:
it only took local or Git sources, so users had to install them with Pi
and import them. `plugin add npm:<package>` now hands them to
`pi install` for Pi targets and records the binding like an import.

Skillshare can't fetch or review an npm package, and Pi runs its install
scripts, so the preview says so, discover refuses npm sources, and only
targets that run pi itself take them. Pi keeps one entry per package
name, so another version replaces it in place and keeps its extension
filters; Skillshare records the new entry so a reinstall restores them,
and refuses a package another Skillshare package already manages, since
removing one would remove both. Pinned versions are skipped on update
because pi update keeps them.

The dashboard accepts npm sources, a pasted `pi install` command or a
pi.dev address, lists only Pi targets, and the Pi Extensions tab links
to adding a package with that target selected. Pi packages show Pi's
mark in the plugin list.

A blocked change now keeps its own reason when the Agent's CLI is also
missing, and the message key always matches the message the CLI prints.

* fix(plugin): keep npm package names and accept pi by path

The default name of an npm package went through the file-path rule, which
cut its last dot segment as an extension: npm:foo.bar was recorded as foo,
and adding npm:foo.bar@1.2.3 later derived foo.bar and was refused as
another package managing the same Pi entry. npm names are now taken from
the package spec.

A Pi account whose CLI is an absolute path to pi was treated as running
another executable, so it could not take npm packages. It now uses the
same path- and platform-aware check as the Pi Extensions tab.

* docs(wiki): add a pull-requests topic for Codex review rounds

Handling Codex's review was only known from practice: confirm each
finding, fix it with a failing test first, reply in its thread, ask for
another review, and follow up until it answers. Writing it down keeps
agents from resolving threads, amending pushed commits, or stopping at
the 👀 that only means the review is still running.

* feat(ui): give the Extras AGENTS.md and Memory tabs one layout

The two tabs shared a page but looked like different products: the header
shifted between them, notes sat in a joined box with an icon toolbar, and
agents showed as an icon strip in a side card. Switching tabs felt jarring.

Memory now follows the AGENTS.md layout: a sticky list column with search,
the note's name with Edit and a More actions menu, the same preview box,
and Use with agents as one row per tool under the note. Long notes open
collapsed like shared files do. The AGENTS.md list gains a search box and
the same sticky column. The Memory tab label stays English in every locale,
like AGENTS.md. Docs and screenshots follow the new layout.

* chore(docs): add a script that serves the Memory screenshot homes

The Memory how-to screenshots came from demo homes that were never
recorded, so reshooting them meant rebuilding the data by hand. The script
rebuilds the fresh and the populated home inside the devcontainer, serves
each behind the Vite dev server, and hands the port back to air afterwards.

* fix(plugin): refuse npm sources Pi can't resolve

validNpmSource accepted specs such as npm:foo/bar, npm:foo@ and names
containing "..", which Pi's own parser rejects. They passed preview, and
Apply recorded a pending binding before pi install failed, leaving an
entry every later sync retried. Validate with the same grammar the Pi
settings reader uses, which also covers a scope without a package name.

* fix(ui): show the default name when adding an npm package to Pi

The name field for an npm source was blank, so it looked like a name was
missing. Leaving it empty records the package name without its version or
scope, as the git flow already shows; the field now shows that name as its
placeholder.
2026-10-04 00:43:43 +08:00