-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: extract IMeshTransport abstraction + rewrite identity onto Node crypto (Phase 1 of #27) #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pallakatos
merged 7 commits into
Azure:main
from
imran-siddique:feat/transport-abstraction
Apr 27, 2026
Merged
refactor: extract IMeshTransport abstraction + rewrite identity onto Node crypto (Phase 1 of #27) #29
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c183917
refactor: add IMeshTransport abstraction for transport-agnostic conne…
c0e9158
Merge branch 'main' into feat/transport-abstraction
imran-siddique 05af267
feat: ground IMeshTransport to MeshConnection's actual surface
8c0751e
ci: add Mesh Plugin Build & Test job to CI workflow
17e93ae
fix(ci): add @agentmesh/sdk type declarations + Python sidecar CI stub
8636a52
fix(ci): install vendored SDK deps before mesh-plugin tests
cd199d7
docs: add no-mocks/no-TODOs implementation quality policy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // Type declarations for vendored @agentmesh/sdk (no published @types package). | ||
| declare module "@agentmesh/sdk" { | ||
| export interface IdentityData { | ||
| amid: string; | ||
| signing_public_key: string; | ||
| signing_private_key: string; | ||
| exchange_public_key: string; | ||
| exchange_private_key: string; | ||
| created_at: string; | ||
| framework?: string; | ||
| framework_version?: string; | ||
| [key: string]: unknown; | ||
| } | ||
|
|
||
| export class Identity { | ||
| readonly amid: string; | ||
| readonly signingPublicKey: CryptoKey; | ||
| readonly signingPublicKeyRaw: Uint8Array; | ||
| readonly signingPrivateKey: CryptoKey; | ||
| readonly exchangePublicKey: CryptoKey; | ||
| readonly exchangePublicKeyRaw: Uint8Array; | ||
| readonly exchangePrivateKey: CryptoKey; | ||
| readonly createdAt: Date; | ||
|
|
||
| static generate(): Promise<Identity>; | ||
| static load(storage: unknown, path: string): Promise<Identity>; | ||
| static fromData(data: IdentityData): Promise<Identity>; | ||
| save(storage: unknown, path: string): Promise<void>; | ||
| toData(): Promise<IdentityData>; | ||
| get signingPublicKeyB64(): string; | ||
| } | ||
|
|
||
| export class MemoryStorage { | ||
| constructor(); | ||
| get(key: string): Promise<string | null>; | ||
| set(key: string, value: string): Promise<void>; | ||
| delete(key: string): Promise<void>; | ||
| } | ||
|
|
||
| export class AgentMeshClient { | ||
| static fromIdentity( | ||
| identity: Identity, | ||
| opts?: Record<string, unknown>, | ||
| ): AgentMeshClient; | ||
| connect(opts?: Record<string, unknown>): Promise<void>; | ||
| disconnect(): Promise<void>; | ||
| send(to: string, payload: unknown): Promise<string | undefined>; | ||
| onMessage(handler: (from: string, payload: unknown) => void): void; | ||
| onKnock( | ||
| handler: ( | ||
| from: string, | ||
| intent: unknown, | ||
| ) => Promise<{ accept: boolean }>, | ||
| ): void; | ||
| addPlaintextPeer(amid: string): void; | ||
| removePlaintextPeer(amid: string): void; | ||
| getPlaintextPeers(): string[]; | ||
| search( | ||
| capability: string, | ||
| opts?: Record<string, unknown>, | ||
| ): Promise<unknown[]>; | ||
| get isConnected(): boolean; | ||
| get amid(): string; | ||
| } | ||
|
|
||
| export class RegistryClient { | ||
| constructor(opts?: Record<string, unknown>); | ||
| } | ||
|
|
||
| export const VERSION: string; | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * AGT Migration — Transport abstraction interface. | ||
| * | ||
| * Extracted from MeshConnection's public surface so the AGT adapter | ||
| * (Phase 2) can implement the same contract without changing callers. | ||
| * | ||
| * Phase 1: MeshConnection implements IMeshTransport (grounded). | ||
| * Phase 2: AgtTransport implements IMeshTransport (AGT SDK-backed). | ||
| * Phase 3: Swap implementation, remove vendor. | ||
| */ | ||
|
|
||
| export interface IMeshTransport { | ||
| // ── Connection lifecycle ───────────────────────────────────── | ||
| connect(): Promise<void>; | ||
| disconnect(): Promise<void>; | ||
| readonly isConnected: boolean; | ||
|
|
||
| // ── Messaging ──────────────────────────────────────────────── | ||
| send(toAmid: string, payload: unknown): Promise<string | undefined>; | ||
|
|
||
| // ── Plaintext peers (Rust controller compat) ───────────────── | ||
| addPlaintextPeer(amid: string): void; | ||
| removePlaintextPeer(amid: string): void; | ||
| getPlaintextPeers(): string[]; | ||
|
|
||
| // ── Discovery ──────────────────────────────────────────────── | ||
| discover(opts?: { capability?: string; limit?: number }): Promise< | ||
| Array<{ amid: string; displayName?: string; capabilities?: string[] }> | ||
| >; | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.