@oobe-protocol-labs/synapse-sap-sdk 0.8.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/client.js +31 -0
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/registries/index.js +3 -1
- package/dist/cjs/registries/index.js.map +1 -1
- package/dist/cjs/registries/metaplex-bridge.js +513 -0
- package/dist/cjs/registries/metaplex-bridge.js.map +1 -0
- package/dist/esm/core/client.js +31 -0
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/registries/index.js +1 -0
- package/dist/esm/registries/index.js.map +1 -1
- package/dist/esm/registries/metaplex-bridge.js +476 -0
- package/dist/esm/registries/metaplex-bridge.js.map +1 -0
- package/dist/types/core/client.d.ts +28 -0
- package/dist/types/core/client.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/registries/index.d.ts +2 -0
- package/dist/types/registries/index.d.ts.map +1 -1
- package/dist/types/registries/metaplex-bridge.d.ts +265 -0
- package/dist/types/registries/metaplex-bridge.d.ts.map +1 -0
- package/package.json +25 -5
- package/src/core/client.ts +32 -0
- package/src/index.ts +8 -0
- package/src/registries/index.ts +11 -0
- package/src/registries/metaplex-bridge.ts +740 -0
|
@@ -43,6 +43,7 @@ import { DiscoveryRegistry } from "../registries/discovery";
|
|
|
43
43
|
import { X402Registry } from "../registries/x402";
|
|
44
44
|
import { SessionManager } from "../registries/session";
|
|
45
45
|
import { AgentBuilder } from "../registries/builder";
|
|
46
|
+
import { MetaplexBridge } from "../registries/metaplex-bridge";
|
|
46
47
|
/** Re-usable Anchor program type (untyped — SDK provides its own types). */
|
|
47
48
|
type SapProgram = Program<any>;
|
|
48
49
|
/**
|
|
@@ -380,6 +381,33 @@ export declare class SapClient {
|
|
|
380
381
|
* ```
|
|
381
382
|
*/
|
|
382
383
|
get builder(): AgentBuilder;
|
|
384
|
+
/**
|
|
385
|
+
* @name metaplex
|
|
386
|
+
* @description Bridge between SAP and the Metaplex Agent Kit
|
|
387
|
+
* (MPL Core Asset + AgentIdentity plugin). Read-side merges SAP
|
|
388
|
+
* `AgentAccount` with MPL Core asset metadata; write-side composes
|
|
389
|
+
* atomic dual-protocol delegation instructions.
|
|
390
|
+
*
|
|
391
|
+
* Requires the optional peer dependencies
|
|
392
|
+
* `@metaplex-foundation/mpl-core` and
|
|
393
|
+
* `@metaplex-foundation/umi-bundle-defaults`. They are imported lazily
|
|
394
|
+
* the first time a method that needs them is called, so consumers that
|
|
395
|
+
* do not use the bridge incur zero overhead.
|
|
396
|
+
*
|
|
397
|
+
* @returns {MetaplexBridge} The lazily-instantiated `MetaplexBridge` singleton.
|
|
398
|
+
* @category Registries
|
|
399
|
+
* @since v0.9.0
|
|
400
|
+
* @see {@link MetaplexBridge}
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* ```ts
|
|
404
|
+
* const profile = await client.metaplex.getUnifiedProfile({
|
|
405
|
+
* wallet: agentWallet,
|
|
406
|
+
* rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
407
|
+
* });
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
get metaplex(): MetaplexBridge;
|
|
383
411
|
}
|
|
384
412
|
export {};
|
|
385
413
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,WAAW,E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1B;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,QAAQ,IAAI,cAAc,CAE7B;CACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -79,6 +79,6 @@ export { SapPostgres, SapSyncEngine, SAP_TABLE_MAP } from "./postgres";
|
|
|
79
79
|
export type { PgClient, SyncAllResult, SapAccountType, SyncMeta, AgentRow, EscrowRow, ToolRow, LedgerRow, EventRow, SyncCursorRow, SyncOptions, } from "./postgres";
|
|
80
80
|
export { parseSapInstructionsFromTransaction, parseSapInstructionNamesFromTransaction, parseSapInstructionsFromList, parseSapInstructionNamesFromList, containsSapInstruction, parseSapTransactionComplete, parseSapTransactionBatch, decodeInnerInstructions, filterSapInnerInstructions, extractAccountKeys, TransactionParser, } from "./parser";
|
|
81
81
|
export type { DecodedSapInstruction, DecodedInnerInstruction, ParsedSapTransaction, ParseFilterOptions, SapInstructionCoder, CompiledInner, InnerInstructionGroup, } from "./parser";
|
|
82
|
-
export { DiscoveryRegistry, X402Registry, SessionManager, AgentBuilder, } from "./registries/index";
|
|
83
|
-
export type { DiscoveredAgent, AgentProfile, DiscoveredTool, NetworkOverview, ToolCategoryName, CostEstimate, PaymentContext, PreparePaymentOptions, X402Headers, EscrowBalance, SettlementResult, BatchSettlementResult, SettleOptions, SessionContext, WriteResult, SealResult, RingBufferEntry, SessionStatus, CapabilityInput, PricingTierInput, ToolInput, RegisterResult, RegisterWithToolsResult, } from "./registries/index";
|
|
82
|
+
export { DiscoveryRegistry, X402Registry, SessionManager, AgentBuilder, MetaplexBridge, } from "./registries/index";
|
|
83
|
+
export type { DiscoveredAgent, AgentProfile, DiscoveredTool, NetworkOverview, ToolCategoryName, CostEstimate, PaymentContext, PreparePaymentOptions, X402Headers, EscrowBalance, SettlementResult, BatchSettlementResult, SettleOptions, SessionContext, WriteResult, SealResult, RingBufferEntry, SessionStatus, CapabilityInput, PricingTierInput, ToolInput, RegisterResult, RegisterWithToolsResult, UnifiedProfile, AgentIdentifierResolution, MplAgentSnapshot, Eip8004Registration, Eip8004Service, AttachAgentIdentityOpts, UpdateAgentIdentityUriOpts, } from "./registries/index";
|
|
84
84
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGzE,YAAY,EAEV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,UAAU,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EAEd,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EAEb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EAEtB,kBAAkB,EAClB,sBAAsB,EAEtB,kBAAkB,EAClB,qBAA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C;AAGlB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGzE,YAAY,EAEV,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,UAAU,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EAEd,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EAEb,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EAEtB,kBAAkB,EAClB,sBAAsB,EAEtB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAC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AM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC"}
|
|
@@ -45,4 +45,6 @@ export { SessionManager } from "./session";
|
|
|
45
45
|
export type { SessionContext, WriteResult, SealResult, RingBufferEntry, SessionStatus, } from "./session";
|
|
46
46
|
export { AgentBuilder } from "./builder";
|
|
47
47
|
export type { CapabilityInput, PricingTierInput, ToolInput, RegisterResult, RegisterWithToolsResult, } from "./builder";
|
|
48
|
+
export { MetaplexBridge } from "./metaplex-bridge";
|
|
49
|
+
export type { UnifiedProfile, AgentIdentifierResolution, MplAgentSnapshot, Eip8004Registration, Eip8004Service, AttachAgentIdentityOpts, UpdateAgentIdentityUriOpts, } from "./metaplex-bridge";
|
|
48
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registries/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EACV,cAAc,EACd,WAAW,EACX,UAAU,EACV,eAAe,EACf,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,uBAAuB,GACxB,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registries/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EACV,cAAc,EACd,WAAW,EACX,UAAU,EACV,eAAe,EACf,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,uBAAuB,GACxB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module registries/metaplex-bridge
|
|
3
|
+
* @description Bridge between Synapse Agent Protocol (SAP) and Metaplex
|
|
4
|
+
* Core's `AgentIdentity` external plugin adapter (mpl-core ≥ 1.9.0).
|
|
5
|
+
*
|
|
6
|
+
* ## Why this design (verified against mpl-core PR #258, v1.9.0)
|
|
7
|
+
*
|
|
8
|
+
* The MPL Core `AgentIdentity` plugin has exactly one field:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* type AgentIdentity = { uri: string };
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The URI must point to an **EIP-8004** agent registration JSON. There is
|
|
15
|
+
* no on-chain executive list, no `addExecutive` / `delegateExecutionV1`
|
|
16
|
+
* instruction. Capabilities, services, executives, and reputation live
|
|
17
|
+
* off-chain in that JSON. The plugin only hooks the `Execute` lifecycle
|
|
18
|
+
* event, allowing the URI's authority to gate execution.
|
|
19
|
+
*
|
|
20
|
+
* The most efficient SAP × MPL integration therefore is:
|
|
21
|
+
*
|
|
22
|
+
* 1. SAP serves a **live EIP-8004 JSON** at a deterministic URL derived
|
|
23
|
+
* from the SAP `AgentAccount` PDA (e.g.
|
|
24
|
+
* `https://explorer.oobeprotocol.ai/agents/<sapAgentPda>/eip-8004.json`).
|
|
25
|
+
* 2. The MPL Core asset attaches an `AgentIdentity` adapter whose `uri`
|
|
26
|
+
* points to that URL.
|
|
27
|
+
* 3. Every SAP write (capability change, vault delegate add/revoke, x402
|
|
28
|
+
* tier update) is reflected in the JSON automatically — **no second
|
|
29
|
+
* transaction required, on either chain or for any wallet.**
|
|
30
|
+
*
|
|
31
|
+
* One SAP transaction = both protocols updated. That is the efficiency
|
|
32
|
+
* win that motivated the Phase 1 redesign on 2026-04-22.
|
|
33
|
+
*
|
|
34
|
+
* @category Registries
|
|
35
|
+
* @since v0.9.0
|
|
36
|
+
* @see https://github.com/metaplex-foundation/mpl-core/pull/258
|
|
37
|
+
* @see https://eips.ethereum.org/EIPS/eip-8004
|
|
38
|
+
*/
|
|
39
|
+
import { PublicKey, type TransactionInstruction } from "@solana/web3.js";
|
|
40
|
+
import type { SapProgram } from "../modules/base";
|
|
41
|
+
import type { AgentAccountData, AgentStatsData } from "../types";
|
|
42
|
+
/**
|
|
43
|
+
* @interface Eip8004Service
|
|
44
|
+
* @description One service entry in an EIP-8004 registration document.
|
|
45
|
+
* @category Registries
|
|
46
|
+
* @since v0.9.0
|
|
47
|
+
*/
|
|
48
|
+
export interface Eip8004Service {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly type: string;
|
|
51
|
+
readonly url: string;
|
|
52
|
+
readonly priceLamports?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @interface Eip8004Registration
|
|
56
|
+
* @description Subset of an EIP-8004 registration document used by the
|
|
57
|
+
* bridge. Hosts may include additional fields; they are passed through
|
|
58
|
+
* via `extra`.
|
|
59
|
+
* @category Registries
|
|
60
|
+
* @since v0.9.0
|
|
61
|
+
*/
|
|
62
|
+
export interface Eip8004Registration {
|
|
63
|
+
readonly version: string;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly description?: string;
|
|
66
|
+
readonly synapseAgent: string;
|
|
67
|
+
readonly authority: string;
|
|
68
|
+
readonly capabilities: readonly string[];
|
|
69
|
+
readonly services: readonly Eip8004Service[];
|
|
70
|
+
readonly executives: readonly {
|
|
71
|
+
wallet: string;
|
|
72
|
+
expiresAt: string | null;
|
|
73
|
+
}[];
|
|
74
|
+
readonly updatedAt: string;
|
|
75
|
+
readonly extra?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @interface AttachAgentIdentityOpts
|
|
79
|
+
* @description Parameters for {@link MetaplexBridge.buildAttachAgentIdentityIx}.
|
|
80
|
+
* @category Registries
|
|
81
|
+
* @since v0.9.0
|
|
82
|
+
*/
|
|
83
|
+
export interface AttachAgentIdentityOpts {
|
|
84
|
+
readonly asset: PublicKey;
|
|
85
|
+
readonly authority: PublicKey;
|
|
86
|
+
readonly payer?: PublicKey;
|
|
87
|
+
readonly sapAgentOwner: PublicKey;
|
|
88
|
+
readonly registrationBaseUrl: string;
|
|
89
|
+
readonly rpcUrl: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @interface UpdateAgentIdentityUriOpts
|
|
93
|
+
* @description Parameters for {@link MetaplexBridge.buildUpdateAgentIdentityUriIx}.
|
|
94
|
+
* @category Registries
|
|
95
|
+
* @since v0.9.0
|
|
96
|
+
*/
|
|
97
|
+
export interface UpdateAgentIdentityUriOpts {
|
|
98
|
+
readonly asset: PublicKey;
|
|
99
|
+
readonly authority: PublicKey;
|
|
100
|
+
readonly payer?: PublicKey;
|
|
101
|
+
readonly newUri: string;
|
|
102
|
+
readonly rpcUrl: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @interface MplAgentSnapshot
|
|
106
|
+
* @description Subset of an MPL Core Asset relevant to the bridge.
|
|
107
|
+
* @category Registries
|
|
108
|
+
* @since v0.9.0
|
|
109
|
+
*/
|
|
110
|
+
export interface MplAgentSnapshot {
|
|
111
|
+
readonly asset: PublicKey;
|
|
112
|
+
readonly owner: PublicKey;
|
|
113
|
+
readonly name: string | null;
|
|
114
|
+
readonly agentIdentityUri: string | null;
|
|
115
|
+
readonly registration: Eip8004Registration | null;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @interface UnifiedProfile
|
|
119
|
+
* @description Merged read-only profile combining SAP identity and an
|
|
120
|
+
* (optional) MPL Core asset side. The `linked` flag is `true` when the
|
|
121
|
+
* MPL asset's `AgentIdentity.uri` references the SAP agent PDA both in
|
|
122
|
+
* the URL path and in the `synapseAgent` JSON field.
|
|
123
|
+
* @category Registries
|
|
124
|
+
* @since v0.9.0
|
|
125
|
+
*/
|
|
126
|
+
export interface UnifiedProfile {
|
|
127
|
+
readonly sap: {
|
|
128
|
+
readonly pda: PublicKey;
|
|
129
|
+
readonly identity: AgentAccountData | null;
|
|
130
|
+
readonly stats: AgentStatsData | null;
|
|
131
|
+
};
|
|
132
|
+
readonly mpl: MplAgentSnapshot | null;
|
|
133
|
+
readonly linked: boolean;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @interface AgentIdentifierResolution
|
|
137
|
+
* @description Resolution result for an agent identifier that may be either
|
|
138
|
+
* an SAP owner wallet or an MPL Core asset address.
|
|
139
|
+
*
|
|
140
|
+
* - `kind = "wallet"`: input is treated as owner wallet.
|
|
141
|
+
* - `kind = "core-asset"`: input is an MPL Core asset; `wallet` is asset owner.
|
|
142
|
+
* - `kind = "unknown"`: input is invalid or cannot be resolved.
|
|
143
|
+
*
|
|
144
|
+
* @category Registries
|
|
145
|
+
* @since v0.9.2
|
|
146
|
+
*/
|
|
147
|
+
export interface AgentIdentifierResolution {
|
|
148
|
+
readonly input: string;
|
|
149
|
+
readonly kind: "wallet" | "core-asset" | "unknown";
|
|
150
|
+
readonly wallet: PublicKey | null;
|
|
151
|
+
readonly sapAgentPda: PublicKey | null;
|
|
152
|
+
readonly asset: PublicKey | null;
|
|
153
|
+
readonly hasSapAgent: boolean;
|
|
154
|
+
readonly error: string | null;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* @name MetaplexBridge
|
|
158
|
+
* @description Read-side merger and write-side instruction composer for
|
|
159
|
+
* SAP × Metaplex Core `AgentIdentity` integration.
|
|
160
|
+
*
|
|
161
|
+
* Linking is **single-transaction**: the MPL `addExternalPluginAdapterV1`
|
|
162
|
+
* instruction sets a URI that points at SAP's live registration host.
|
|
163
|
+
* Subsequent SAP state changes propagate automatically — no extra MPL
|
|
164
|
+
* transaction required.
|
|
165
|
+
*
|
|
166
|
+
* @category Registries
|
|
167
|
+
* @since v0.9.0
|
|
168
|
+
*/
|
|
169
|
+
export declare class MetaplexBridge {
|
|
170
|
+
private readonly program;
|
|
171
|
+
constructor(program: SapProgram);
|
|
172
|
+
/**
|
|
173
|
+
* @name deriveRegistrationUrl
|
|
174
|
+
* @description Compute the deterministic EIP-8004 registration URL for
|
|
175
|
+
* a SAP agent. Hosts MUST serve the JSON at exactly this path so that
|
|
176
|
+
* {@link MetaplexBridge.verifyLink} validates without external config.
|
|
177
|
+
*
|
|
178
|
+
* @since v0.9.0
|
|
179
|
+
*/
|
|
180
|
+
deriveRegistrationUrl(sapAgentPda: PublicKey, baseUrl: string): string;
|
|
181
|
+
/**
|
|
182
|
+
* @name buildEip8004Registration
|
|
183
|
+
* @description Build a canonical EIP-8004 JSON document for a SAP agent.
|
|
184
|
+
* Designed to be called server-side by a registry host.
|
|
185
|
+
*
|
|
186
|
+
* @since v0.9.0
|
|
187
|
+
*/
|
|
188
|
+
buildEip8004Registration(args: {
|
|
189
|
+
sapAgentOwner: PublicKey;
|
|
190
|
+
services?: readonly Eip8004Service[];
|
|
191
|
+
extra?: Record<string, unknown>;
|
|
192
|
+
}): Promise<Eip8004Registration>;
|
|
193
|
+
/**
|
|
194
|
+
* @name buildAttachAgentIdentityIx
|
|
195
|
+
* @description Build the MPL Core `addExternalPluginAdapterV1`
|
|
196
|
+
* `TransactionInstruction` that attaches an `AgentIdentity` plugin
|
|
197
|
+
* pointing at SAP's live EIP-8004 registration URL.
|
|
198
|
+
*
|
|
199
|
+
* @since v0.9.0
|
|
200
|
+
*/
|
|
201
|
+
buildAttachAgentIdentityIx(opts: AttachAgentIdentityOpts): Promise<TransactionInstruction>;
|
|
202
|
+
/**
|
|
203
|
+
* @name buildUpdateAgentIdentityUriIx
|
|
204
|
+
* @description Build the MPL Core `updateExternalPluginAdapterV1`
|
|
205
|
+
* instruction that re-points an existing `AgentIdentity` plugin.
|
|
206
|
+
*
|
|
207
|
+
* @since v0.9.0
|
|
208
|
+
*/
|
|
209
|
+
buildUpdateAgentIdentityUriIx(opts: UpdateAgentIdentityUriOpts): Promise<TransactionInstruction>;
|
|
210
|
+
/**
|
|
211
|
+
* @name getUnifiedProfile
|
|
212
|
+
* @description Fetch a merged view of an agent across SAP and Metaplex.
|
|
213
|
+
* Provide `wallet` (SAP-first) or `asset` (MPL-first), or both.
|
|
214
|
+
*
|
|
215
|
+
* @since v0.9.0
|
|
216
|
+
*/
|
|
217
|
+
getUnifiedProfile(input: {
|
|
218
|
+
wallet?: PublicKey;
|
|
219
|
+
asset?: PublicKey;
|
|
220
|
+
rpcUrl: string;
|
|
221
|
+
}): Promise<UnifiedProfile>;
|
|
222
|
+
/**
|
|
223
|
+
* @name resolveAgentIdentifier
|
|
224
|
+
* @description Resolve a generic agent identifier to canonical SAP routing
|
|
225
|
+
* keys. Useful when callers may receive either owner wallets or Metaplex
|
|
226
|
+
* Core asset IDs (e.g. metaplex.com/agents/<core-asset-id>).
|
|
227
|
+
*
|
|
228
|
+
* Resolution order:
|
|
229
|
+
* 1) Treat input as wallet and check if a SAP agent exists.
|
|
230
|
+
* 2) If not found, treat input as MPL Core asset and resolve owner wallet.
|
|
231
|
+
*
|
|
232
|
+
* @since v0.9.2
|
|
233
|
+
*/
|
|
234
|
+
resolveAgentIdentifier(input: {
|
|
235
|
+
identifier: string;
|
|
236
|
+
rpcUrl: string;
|
|
237
|
+
}): Promise<AgentIdentifierResolution>;
|
|
238
|
+
/**
|
|
239
|
+
* @name verifyLink
|
|
240
|
+
* @description Verify the bidirectional link between an MPL Core asset
|
|
241
|
+
* and a SAP agent. Returns `true` only when both URL and JSON sides
|
|
242
|
+
* reference the SAP agent PDA.
|
|
243
|
+
*
|
|
244
|
+
* @since v0.9.0
|
|
245
|
+
*/
|
|
246
|
+
verifyLink(args: {
|
|
247
|
+
asset: PublicKey;
|
|
248
|
+
sapAgentPda: PublicKey;
|
|
249
|
+
rpcUrl: string;
|
|
250
|
+
}): Promise<boolean>;
|
|
251
|
+
private get accounts();
|
|
252
|
+
private fetchAgentNullable;
|
|
253
|
+
private fetchStatsNullable;
|
|
254
|
+
private fetchActiveVaultDelegates;
|
|
255
|
+
private fetchMplSnapshot;
|
|
256
|
+
private extractAgentIdentityUri;
|
|
257
|
+
private fetchEip8004Safe;
|
|
258
|
+
private buildAddExternalPluginIx;
|
|
259
|
+
private firstWeb3Ix;
|
|
260
|
+
private umiIxToWeb3;
|
|
261
|
+
private detectLink;
|
|
262
|
+
private readString;
|
|
263
|
+
private readCapabilities;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=metaplex-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaplex-bridge.d.ts","sourceRoot":"","sources":["../../../src/registries/metaplex-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,EAC5B,MAAM,iBAAiB,CAAC;AAYzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EAGf,MAAM,UAAU,CAAC;AAoBlB;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,C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,mBAAmB,CAAC;IA2BhC;;;;;;;OAOG;IACG,0BAA0B,CAC9B,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAYlC;;;;;;OAMG;IACG,6BAA6B,CACjC,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAkClC;;;;;;OAMG;IACG,iBAAiB,CAAC,KAAK,EAAE;QAC7B,MAAM,CAAC,EAAE,SAAS,CAAC;QACnB,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,cAAc,CAAC;IAwC3B;;;;;;;;;;;OAWG;IACG,sBAAsB,CAAC,KAAK,EAAE;QAClC,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA0DtC;;;;;;;OAOG;IACG,UAAU,CAAC,IAAI,EAAE;QACrB,KAAK,EAAE,SAAS,CAAC;QACjB,WAAW,EAAE,SAAS,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,OAAO,CAAC;IAYpB,OAAO,KAAK,QAAQ,GAEnB;YAEa,kBAAkB;YAUlB,kBAAkB;YAWlB,yBAAyB;YA2BzB,gBAAgB;IA0B9B,OAAO,CAAC,uBAAuB;YAQjB,gBAAgB;YAkChB,wBAAwB;YAmCxB,WAAW;IAYzB,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,gBAAgB;CAIzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oobe-protocol-labs/synapse-sap-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "TypeScript SDK for the Synapse Agent Protocol (SAP v2) on Solana Mainnet/Devnet",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -97,6 +97,11 @@
|
|
|
97
97
|
"require": "./dist/cjs/registries/builder.js",
|
|
98
98
|
"types": "./dist/types/registries/builder.d.ts"
|
|
99
99
|
},
|
|
100
|
+
"./registries/metaplex-bridge": {
|
|
101
|
+
"import": "./dist/esm/registries/metaplex-bridge.js",
|
|
102
|
+
"require": "./dist/cjs/registries/metaplex-bridge.js",
|
|
103
|
+
"types": "./dist/types/registries/metaplex-bridge.d.ts"
|
|
104
|
+
},
|
|
100
105
|
"./idl": {
|
|
101
106
|
"import": "./dist/esm/idl/index.js",
|
|
102
107
|
"require": "./dist/cjs/idl/index.js",
|
|
@@ -156,19 +161,25 @@
|
|
|
156
161
|
"typecheck": "tsc --noEmit"
|
|
157
162
|
},
|
|
158
163
|
"dependencies": {
|
|
159
|
-
"@coral-xyz/anchor": "
|
|
160
|
-
"@solana/web3.js": "
|
|
164
|
+
"@coral-xyz/anchor": ">=0.30.0",
|
|
165
|
+
"@solana/web3.js": ">=1.90.0"
|
|
161
166
|
},
|
|
162
167
|
"devDependencies": {
|
|
168
|
+
"@metaplex-foundation/mpl-core": "^1.10.0",
|
|
169
|
+
"@metaplex-foundation/umi": "^1.5.0",
|
|
170
|
+
"@metaplex-foundation/umi-bundle-defaults": "^1.5.1",
|
|
163
171
|
"typescript": "^5.7.3",
|
|
164
172
|
"zod": "^4.3.6"
|
|
165
173
|
},
|
|
166
174
|
"peerDependencies": {
|
|
167
175
|
"@coral-xyz/anchor": ">=0.30.0",
|
|
176
|
+
"@metaplex-foundation/mpl-core": ">=1.9.0",
|
|
177
|
+
"@metaplex-foundation/umi": ">=0.9.0",
|
|
178
|
+
"@metaplex-foundation/umi-bundle-defaults": ">=0.9.0",
|
|
168
179
|
"@solana/web3.js": ">=1.90.0",
|
|
169
180
|
"@triton-one/yellowstone-grpc": ">=1.0.0",
|
|
170
|
-
"
|
|
171
|
-
"
|
|
181
|
+
"pg": ">=8.0.0",
|
|
182
|
+
"zod": ">=3.20.0"
|
|
172
183
|
},
|
|
173
184
|
"peerDependenciesMeta": {
|
|
174
185
|
"zod": {
|
|
@@ -179,6 +190,15 @@
|
|
|
179
190
|
},
|
|
180
191
|
"@triton-one/yellowstone-grpc": {
|
|
181
192
|
"optional": true
|
|
193
|
+
},
|
|
194
|
+
"@metaplex-foundation/mpl-core": {
|
|
195
|
+
"optional": true
|
|
196
|
+
},
|
|
197
|
+
"@metaplex-foundation/umi": {
|
|
198
|
+
"optional": true
|
|
199
|
+
},
|
|
200
|
+
"@metaplex-foundation/umi-bundle-defaults": {
|
|
201
|
+
"optional": true
|
|
182
202
|
}
|
|
183
203
|
},
|
|
184
204
|
"engines": {
|
package/src/core/client.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { DiscoveryRegistry } from "../registries/discovery";
|
|
|
45
45
|
import { X402Registry } from "../registries/x402";
|
|
46
46
|
import { SessionManager } from "../registries/session";
|
|
47
47
|
import { AgentBuilder } from "../registries/builder";
|
|
48
|
+
import { MetaplexBridge } from "../registries/metaplex-bridge";
|
|
48
49
|
|
|
49
50
|
// IDL is embedded inside the SDK — no external workspace dependency
|
|
50
51
|
import idl from "../idl/synapse_agent_sap.json";
|
|
@@ -132,6 +133,7 @@ export class SapClient {
|
|
|
132
133
|
#discovery?: DiscoveryRegistry;
|
|
133
134
|
#x402?: X402Registry;
|
|
134
135
|
#session?: SessionManager;
|
|
136
|
+
#metaplex?: MetaplexBridge;
|
|
135
137
|
|
|
136
138
|
private constructor(program: SapProgram) {
|
|
137
139
|
this.program = program;
|
|
@@ -497,4 +499,34 @@ export class SapClient {
|
|
|
497
499
|
get builder(): AgentBuilder {
|
|
498
500
|
return new AgentBuilder(this.program);
|
|
499
501
|
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @name metaplex
|
|
505
|
+
* @description Bridge between SAP and the Metaplex Agent Kit
|
|
506
|
+
* (MPL Core Asset + AgentIdentity plugin). Read-side merges SAP
|
|
507
|
+
* `AgentAccount` with MPL Core asset metadata; write-side composes
|
|
508
|
+
* atomic dual-protocol delegation instructions.
|
|
509
|
+
*
|
|
510
|
+
* Requires the optional peer dependencies
|
|
511
|
+
* `@metaplex-foundation/mpl-core` and
|
|
512
|
+
* `@metaplex-foundation/umi-bundle-defaults`. They are imported lazily
|
|
513
|
+
* the first time a method that needs them is called, so consumers that
|
|
514
|
+
* do not use the bridge incur zero overhead.
|
|
515
|
+
*
|
|
516
|
+
* @returns {MetaplexBridge} The lazily-instantiated `MetaplexBridge` singleton.
|
|
517
|
+
* @category Registries
|
|
518
|
+
* @since v0.9.0
|
|
519
|
+
* @see {@link MetaplexBridge}
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```ts
|
|
523
|
+
* const profile = await client.metaplex.getUnifiedProfile({
|
|
524
|
+
* wallet: agentWallet,
|
|
525
|
+
* rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
526
|
+
* });
|
|
527
|
+
* ```
|
|
528
|
+
*/
|
|
529
|
+
get metaplex(): MetaplexBridge {
|
|
530
|
+
return (this.#metaplex ??= new MetaplexBridge(this.program));
|
|
531
|
+
}
|
|
500
532
|
}
|
package/src/index.ts
CHANGED
|
@@ -373,6 +373,7 @@ export {
|
|
|
373
373
|
X402Registry,
|
|
374
374
|
SessionManager,
|
|
375
375
|
AgentBuilder,
|
|
376
|
+
MetaplexBridge,
|
|
376
377
|
} from "./registries/index";
|
|
377
378
|
export type {
|
|
378
379
|
DiscoveredAgent,
|
|
@@ -398,4 +399,11 @@ export type {
|
|
|
398
399
|
ToolInput,
|
|
399
400
|
RegisterResult,
|
|
400
401
|
RegisterWithToolsResult,
|
|
402
|
+
UnifiedProfile,
|
|
403
|
+
AgentIdentifierResolution,
|
|
404
|
+
MplAgentSnapshot,
|
|
405
|
+
Eip8004Registration,
|
|
406
|
+
Eip8004Service,
|
|
407
|
+
AttachAgentIdentityOpts,
|
|
408
|
+
UpdateAgentIdentityUriOpts,
|
|
401
409
|
} from "./registries/index";
|
package/src/registries/index.ts
CHANGED
|
@@ -76,3 +76,14 @@ export type {
|
|
|
76
76
|
RegisterResult,
|
|
77
77
|
RegisterWithToolsResult,
|
|
78
78
|
} from "./builder";
|
|
79
|
+
|
|
80
|
+
export { MetaplexBridge } from "./metaplex-bridge";
|
|
81
|
+
export type {
|
|
82
|
+
UnifiedProfile,
|
|
83
|
+
AgentIdentifierResolution,
|
|
84
|
+
MplAgentSnapshot,
|
|
85
|
+
Eip8004Registration,
|
|
86
|
+
Eip8004Service,
|
|
87
|
+
AttachAgentIdentityOpts,
|
|
88
|
+
UpdateAgentIdentityUriOpts,
|
|
89
|
+
} from "./metaplex-bridge";
|