feat(sdk): complete local application integration - #2462
Open
limityan wants to merge 2 commits into
Open
Conversation
limityan
force-pushed
the
yanzhn/sdk-package-local-host
branch
from
August 24, 2026 15:08
edc265e to
ed4a7c0
Compare
limityan
force-pushed
the
yanzhn/sdk-package-local-host
branch
from
August 24, 2026 15:33
ed4a7c0 to
a59e8a5
Compare
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
Query.respondPermission(...)forallow_once,allow_always, andreject, while keeping the existing RuntimePermissionRequestManageras the sole permission authoritynpm pack -> local tarball install -> package-name import -> package-local Host initialize/closeDesign boundary
The design follows the established SDK shape used by Codex SDK, Codex App Server, Claude Agent SDK permissions, Copilot SDK streaming events, and OpenCode V2 SDK: one ordered Query stream, an explicit permission response operation, capability negotiation, and a managed local runtime boundary.
This PR deliberately reuses the existing Agent Runtime, Tool events, permission manager, Query lifecycle, Rust wire contract, and managed Host. It does not add a second Runtime, generic reverse JSON-RPC callbacks, a Tool registry, or another transport layer.
Tool events expose only
toolCallId,toolName, lifecycle status, progress, and duration. Raw Tool inputs, results, progress messages, errors, and cancellation reasons are not exposed by this boundary.Public capability in this PR
AgentClient.start(...)with package-local Host resolutionallow_once/allow_always/rejectIntentionally deferred
Verification
cargo check --workspace- passed after preparing the repository-required mobile-web artifact and reusing the machine's existing sherpa-onnx archive cachecargo test -p bitfun-sdk-host -p bitfun-sdk-host-app -q- passed, 72 testspnpm --dir sdk/typescript run type-check- passedpnpm --dir sdk/typescript test- passed, 64 passed and 1 platform-specific skippnpm --dir sdk/typescript run smoke:node- passed against the real package-local Host and fixture model serverpnpm --dir sdk/typescript run smoke:consumer- passed in an isolated external project installed from a local tarballgit diff --check gcwing/main...HEAD- passedcargo test --workspace -j 1completed the full test build and then stopped on the existingbitfun-app-servertestlightweight_client_negotiates_with_the_production_server: the production capability response omittedsession/reloadContext. The failing test and capability implementation are byte-identical to currentgcwing/main, and this PR does not modifyapp-server.Bun is not available in the current shell, so the protocol v3 Bun smoke was not run. The SDK uses the same ESM build for Node and Bun, but Bun remains an explicit release-verification target rather than an unverified claim here.
Change control
gcwing/mainata10728f8e