Repository navigation
feat(sdk): store + sources + lockfile + trust + bridge ops - #73
Merged
Merged
Conversation
FsPort/ExecPort/McpPort contracts, pinned bridge+lockfile+trust types, pure-TS sha256 (SRI), path/semver/glob/toml/frontmatter helpers. Ambient cross-runtime globals declared in ports.ts; zero node builtins.
…ty, policy, audit, mcp merge, manifest Sibling-tmp+rename atomic writes, O_EXCL advisory lock with stale-break, extensions.lock read/write (corrupt-aside, sorted 2-space), §4 SRI tree digest, config.toml trust policy eval, JSONL audit log, mcp.json merge-only writer, Agent Plugins manifest parse+inspect.
resolveSource (git/github/local/registry spellings, refs, monorepo subpaths) and createStore over ~/.agents/: install (local copy / git clone+pin, staging, collisions, SRI, mcp merge, setup policy), remove, setEnabled, materialize (shared skills default §5.1 + inline), verify, doctor.
capabilities.negotiate handshake (-32001/-32002/-32602 paths), per-store default session + createBridgeSession for daemons, kind/slot capability narrowing, extensions.list/get, hooks.invoke (policy+exec gating, streaming notifications), commands.resolve, skills.materialize, tools.call (mcp port), events.notify notifications.
testing.ts memfs/memexec (symlinks, createExclusive, exec handlers) and the pinned export surface incl. ./testing subpath.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Approved. Cursor Bugbot was not present after the first check poll, so that signal was skipped; no approval-policy files apply, and there are no existing review findings that require human attention. This is a non-blocking approval from the Cursor Approval Agent.
Sent by Cursor Approval Agent: Pull Request Router and Approver
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Implements
packages/sdk— the isomorphic core of the AnyHarness store / trust / bridge layer (workstream W8 of.agents/plans/2026-10-07-v2-foundation.md, Wave 2). Everything goes through injectedStorePorts; the package has zeronode:*imports and zero runtime deps, so the same code ships in theharnessbinary, browser bundles, and worker runtimes.Changes
Ports & types —
FsPort/ExecPort/McpPortcontracts (O_EXCLcreateExclusive, atomicrename, lstatstat,symlink?fallback contract) and the pinned bridge/lockfile/trust types verbatim fromspec/bridge/operations.md+spec/lockfile.md+spec/trust.md.Store —
createStore(root, ports)over~/.agents/:install(source, opts?)—resolveSourcespellings (git/github/local/registry,#reffragments, monorepo subpaths), local copy orgit clone→fetch→checkout→rev-parsepin, staging throughharness/tmp/under the.lockmutex, manifest inspect, collision checks (incl. refusing to shadow foreignskills/<name>), SRI integrity, capability grant,dev.anyharness/setupgated by trust policy +approveExeccallback,mcp.jsonmergeremove/setEnabled/list/get— lockfile-driven,enabledflag persistedmaterialize— skill components to shared~/.agents/skills/(§5.1 default) or inlinefiles[].content|contentBase64for storage-less hosts; integrity-verified firstverify— §4 SRI tree digest recomputation;doctor— lockfile-vs-filesystem/audit/mcp reconciliation findingsextensions.lock(sorted 2-space JSON, corrupt→preserve aside +lockfile.corruptaudit,version>1refuse) +audit.logclosed-enum JSONLTrust —
config.toml[policy]eval with spec §4.1 defaults (exec.*=ask,nonInteractive=deny, empty source lists), deny-first source globs, agentask→denyunless allowlisted, audit events for every trust-relevant action.Bridge —
handleBridgeRequest(store, req[, session])dispatching all 8 ops over JSON-RPC 2.0:capabilities.negotiate(once-per-session latch,-32002gate, version intersection),extensions.list/get,hooks.invoke(hook-event +slots.exec+ policy gating, streamedhook.progress/hook.deltanotifications),commands.resolve,skills.materialize,tools.call(via optionalMcpPort),events.notify. Full-32001..-32012/-32800error-kind mapping.Testing —
@any-harness/sdk/testingsubpath: in-memoryFsPort/ExecPortfakes (symlinks, exclusive create, exec handlers) used by the 59-test vitest suite.Test plan
pnpm -F @any-harness/sdk test— 59 tests, 10 files, all greenpnpm -F @any-harness/sdk exec tsc --noEmit— cleanrg 'node:' packages/sdk/src— empty (isomorphic rule verified literally)Notes
Storealso exposes additive helpers beyond the pinned method set (get,policy,auditLog,subscribe,readLock) — pinned names verbatim, additions documented in the session report.LockEntry.enabledis a new additive field: the bridge'sExtension.enabledneeded a persisted home the lockfile schema doesn't declare.tools.callneeds a real MCP transport; the sdk answers-32003/-32010until a host injectsMcpPort(v0 grantsmcp: external|none, nevermanaged).Link to Devin session: https://app.devin.ai/sessions/7f3725978b804442ace5bd12ed349a99
Open in Devin Desktop: https://app.devin.ai/desktop/session/7f3725978b804442ace5bd12ed349a99?variant=devin
Requested by: @espetro