feat: Cross-Language SDK — Phases 2-4 + gRPC debt fix + dogfooding#39
Open
feat: Cross-Language SDK — Phases 2-4 + gRPC debt fix + dogfooding#39
Conversation
a4f0190 to
3d98428
Compare
TypeScript/Napi-RS bindings (Phase 2): - 4 kernel classes: AmplifierSession, Coordinator, HookRegistry, CancellationToken - JsToolBridge for TypeScript module authoring - 64 Vitest tests, CI split into separate node-tests job gRPC Phase 2 debt fix: - 5 proto optional fields, full bidirectional conversions - All 9 KernelService RPCs implemented (was 1 of 9) - Session holds Arc<Coordinator> with coordinator_shared() WASM module loading (Phase 3): - 6 WASM bridges via Component Model (Tool, Hook, Context, Approval, Provider, Orchestrator) - amplifier-guest crate with export macros - WIT interface definitions for all 6 module types - 6 test fixture .wasm binaries Cross-language module resolver (Phase 4): - Auto-detect transport: .wasm → WASM, amplifier.toml → gRPC, __init__.py → Python - WASM component metadata parsing for module type detection - PyO3 + Napi-RS bindings for resolver - loader_dispatch.py wired to Rust Dogfooding: - _session_init.py routes through loader_dispatch - Mixed-transport E2E: native + WASM modules in same session - Python and TypeScript WASM session examples Security fixes: - pyo3 0.28.1 → 0.28.2 (HIGH severity) - wasmtime 29 → 42 (8 alerts cleared) 🤖 Generated with Amplifier Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
3d98428 to
38ba778
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
Single squash of all Cross-Language SDK work (Phases 2-4), gRPC Phase 2 debt resolution, and integration dogfooding. 124 files changed, ~32,800 additions.
Phase 2: TypeScript/Napi-RS Bindings
bindings/node/— 4 kernel classes (AmplifierSession,Coordinator,HookRegistry,CancellationToken)JsToolBridgefor TypeScript module authoring.d.tsauto-generationnode-testsjob withactions/setup-node@v4gRPC Phase 2 Debt Fix
optionalfield additions (backward-compatible wire change)Arc<Coordinator>withcoordinator_shared()for KernelServiceTODO(grpc-v2)markers remain in sourcePhase 3: WASM Module Loading
wit/amplifier-modules.wit— WIT interfaces for all 6 module types + kernel-service host importscrates/amplifier-guest/— Rust guest SDK with traits, types,export_*!macrosWasmEnginewithArc<wasmtime::Engine>.wasmtest fixtures (echo-tool, deny-hook, memory-context, auto-approve, echo-provider, passthrough-orchestrator)load_wasm_*for all 6 module typesPhase 4: Cross-Language Module Resolver
module_resolver.rs(1,036 lines) — auto-detect transport from filesystem pathamplifier.toml→.wasmscan + component metadata → Python package → errorresolve_module()+load_wasm_from_path()resolveModule()+loadWasmFromPath()loader_dispatch.pyWASM/gRPC branches wired to RustDogfooding / Integration
_session_init.pyroutes throughloader_dispatch.load_module()(backward compat preserved)load_and_mount_wasm+PyWasmToolfor real coordinator WASM mountingpython-wasm-session.py,node-wasm-session.ts,calculator-toolWASM moduleDesign docs (in
docs/plans/)Test Plan
Notes
dev/cross-language-sdkintegration branch onto a clean branch from current main#[cfg(feature = "wasm")]— zero impact when feature is off