@svsprotocol/solana 0.1.0
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/LICENSE +158 -0
- package/README.md +365 -0
- package/dist/action-production-proof-evidence.js +553 -0
- package/dist/adapter-catalog.d.ts +29 -0
- package/dist/adapter-catalog.js +146 -0
- package/dist/adapter-core.d.ts +48 -0
- package/dist/adapter-core.js +249 -0
- package/dist/approval-signature.js +197 -0
- package/dist/base58.js +69 -0
- package/dist/bot-auth.js +50 -0
- package/dist/bot-certification-evidence.js +342 -0
- package/dist/bot-first-action-runbook.js +299 -0
- package/dist/bot-integration-contract.js +41 -0
- package/dist/certified-submit-status.js +176 -0
- package/dist/common.d.ts +1135 -0
- package/dist/elizaos.d.ts +43 -0
- package/dist/elizaos.js +227 -0
- package/dist/goat.d.ts +47 -0
- package/dist/goat.js +261 -0
- package/dist/index.d.ts +330 -0
- package/dist/index.js +128 -0
- package/dist/protocol.d.ts +205 -0
- package/dist/protocol.js +900 -0
- package/dist/receipt.js +51 -0
- package/dist/signed-proof-read-protection.js +495 -0
- package/dist/solana-agent-kit.d.ts +35 -0
- package/dist/solana-agent-kit.js +151 -0
- package/dist/svs-client.js +1232 -0
- package/dist/vercel-ai.d.ts +47 -0
- package/dist/vercel-ai.js +266 -0
- package/dist/verified-agent-adoption-kit.js +471 -0
- package/dist/verified-agent-profile.js +329 -0
- package/dist/verified-agent-registry-consumer.js +421 -0
- package/dist/verified-agent-registry.d.ts +36 -0
- package/dist/verified-agent-registry.js +826 -0
- package/dist/verified-agent-trust-score.js +335 -0
- package/dist/webhooks.js +834 -0
- package/package.json +72 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SvsAdapterCoreError,
|
|
3
|
+
createSvsAdapterClient,
|
|
4
|
+
requireSvsAdapterProductionReady,
|
|
5
|
+
verifyAndSubmitSvsAdapterSolanaAction
|
|
6
|
+
} from "./adapter-core.js";
|
|
7
|
+
|
|
8
|
+
export const SOLANA_AGENT_KIT_ADAPTER_VERSION = "svs.solana-agent-kit-adapter.v1";
|
|
9
|
+
export const SOLANA_AGENT_KIT_TOOL_NAME = "svs_verify_and_submit_solana_action";
|
|
10
|
+
|
|
11
|
+
export class SvsSolanaAgentKitAdapterError extends SvsAdapterCoreError {
|
|
12
|
+
constructor(message, details = {}) {
|
|
13
|
+
super(message, details);
|
|
14
|
+
this.name = "SvsSolanaAgentKitAdapterError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function createSvsSolanaAgentKitAdapter({
|
|
19
|
+
client = null,
|
|
20
|
+
baseUrl,
|
|
21
|
+
apiKey,
|
|
22
|
+
requestSigningSecret,
|
|
23
|
+
expectedIntegrationContractHash,
|
|
24
|
+
botId,
|
|
25
|
+
policyId = null,
|
|
26
|
+
rpcUrl = null,
|
|
27
|
+
certificationStaleAfterMs = undefined,
|
|
28
|
+
requireCurrentIntegrationContract = true,
|
|
29
|
+
waitForProof = false,
|
|
30
|
+
waitAttempts = 12,
|
|
31
|
+
waitIntervalMs = 5000,
|
|
32
|
+
fetchProof = true,
|
|
33
|
+
checkReceiptRegistryChain = true,
|
|
34
|
+
requireReadinessOnSubmit = true
|
|
35
|
+
} = {}) {
|
|
36
|
+
if (!botId) {
|
|
37
|
+
throw new Error("botId is required.");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const svs = createSvsAdapterClient({
|
|
41
|
+
client,
|
|
42
|
+
baseUrl,
|
|
43
|
+
apiKey,
|
|
44
|
+
requestSigningSecret,
|
|
45
|
+
expectedIntegrationContractHash
|
|
46
|
+
});
|
|
47
|
+
const defaults = {
|
|
48
|
+
botId,
|
|
49
|
+
policyId,
|
|
50
|
+
rpcUrl,
|
|
51
|
+
certificationStaleAfterMs,
|
|
52
|
+
requireCurrentIntegrationContract,
|
|
53
|
+
waitForProof,
|
|
54
|
+
waitAttempts,
|
|
55
|
+
waitIntervalMs,
|
|
56
|
+
fetchProof,
|
|
57
|
+
checkReceiptRegistryChain,
|
|
58
|
+
requireReadinessOnSubmit
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
version: SOLANA_AGENT_KIT_ADAPTER_VERSION,
|
|
63
|
+
name: SOLANA_AGENT_KIT_TOOL_NAME,
|
|
64
|
+
description: "Submit a Solana agent action through SVS human approval, production certification, policy enforcement, and portable proof generation.",
|
|
65
|
+
botId,
|
|
66
|
+
policyId,
|
|
67
|
+
rpcUrl,
|
|
68
|
+
client: svs,
|
|
69
|
+
async requireSvsProductionReady(options = {}) {
|
|
70
|
+
return requireSvsProductionReady({
|
|
71
|
+
client: svs,
|
|
72
|
+
...defaults,
|
|
73
|
+
...options
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
async verifyAndSubmitSolanaAction(input = {}, options = {}) {
|
|
77
|
+
return verifyAndSubmitSolanaAction({
|
|
78
|
+
client: svs,
|
|
79
|
+
...defaults,
|
|
80
|
+
...input,
|
|
81
|
+
...options
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
tool: {
|
|
85
|
+
name: SOLANA_AGENT_KIT_TOOL_NAME,
|
|
86
|
+
description: "Require SVS production readiness, then queue a Solana action for human approval and proof-backed execution.",
|
|
87
|
+
parameters: {
|
|
88
|
+
type: "object",
|
|
89
|
+
required: ["intent", "serializedTransaction"],
|
|
90
|
+
properties: {
|
|
91
|
+
requestId: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Stable idempotency key for this agent action."
|
|
94
|
+
},
|
|
95
|
+
intent: {
|
|
96
|
+
type: "object",
|
|
97
|
+
description: "Human-readable action intent shown to the operator."
|
|
98
|
+
},
|
|
99
|
+
policyId: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "SVS policy id to enforce for this action."
|
|
102
|
+
},
|
|
103
|
+
serializedTransaction: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Base64 or wire-format serialized Solana transaction prepared by the agent."
|
|
106
|
+
},
|
|
107
|
+
rpcUrl: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Solana RPC URL used to simulate or broadcast the action."
|
|
110
|
+
},
|
|
111
|
+
simulation: {
|
|
112
|
+
type: "object",
|
|
113
|
+
description: "Optional simulation result produced before submitting."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
execute: async (input = {}) => verifyAndSubmitSolanaAction({
|
|
118
|
+
client: svs,
|
|
119
|
+
...defaults,
|
|
120
|
+
...input
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export async function requireSvsProductionReady({
|
|
127
|
+
...options
|
|
128
|
+
} = {}) {
|
|
129
|
+
return requireSvsAdapterProductionReady({
|
|
130
|
+
...options,
|
|
131
|
+
readinessVersion: "svs.solana-agent-kit-readiness.v1",
|
|
132
|
+
readyMessage: "SVS bot readiness and production certification passed.",
|
|
133
|
+
adapterLabel: "Solana Agent Kit adapter",
|
|
134
|
+
ErrorClass: SvsSolanaAgentKitAdapterError
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export async function verifyAndSubmitSolanaAction({
|
|
139
|
+
...options
|
|
140
|
+
} = {}) {
|
|
141
|
+
return verifyAndSubmitSvsAdapterSolanaAction({
|
|
142
|
+
...options,
|
|
143
|
+
adapterVersion: SOLANA_AGENT_KIT_ADAPTER_VERSION,
|
|
144
|
+
agentFramework: "solana-agent-kit",
|
|
145
|
+
resultVersion: "svs.solana-agent-kit-action-result.v1",
|
|
146
|
+
readinessVersion: "svs.solana-agent-kit-readiness.v1",
|
|
147
|
+
readyMessage: "SVS bot readiness and production certification passed.",
|
|
148
|
+
adapterLabel: "Solana Agent Kit adapter",
|
|
149
|
+
ErrorClass: SvsSolanaAgentKitAdapterError
|
|
150
|
+
});
|
|
151
|
+
}
|