@usesigil/plugins 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 ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2024-2026 Kaleb Rupe
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @usesigil/plugins
2
+
3
+ Agent framework adapters for [Sigil](https://github.com/Kaleb-Rupe/sigil) — plug Sigil's security guardrails into popular AI agent frameworks.
4
+
5
+ ## Available Adapters
6
+
7
+ | Subpath | Framework | Status |
8
+ |---------|-----------|--------|
9
+ | `@usesigil/plugins/sak` | [Solana Agent Kit](https://github.com/sendai-labs/solana-agent-kit) | Stable |
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install @usesigil/plugins
15
+ ```
16
+
17
+ ## Usage — Solana Agent Kit
18
+
19
+ ```typescript
20
+ import { createSigilPlugin } from "@usesigil/plugins/sak";
21
+
22
+ const plugin = createSigilPlugin({
23
+ vault: "YOUR_VAULT_ADDRESS",
24
+ agent: agentSigner,
25
+ network: "devnet",
26
+ rpcUrl: "https://api.devnet.solana.com",
27
+ });
28
+
29
+ // Register with Solana Agent Kit
30
+ const agent = new SolanaAgentKit({ plugins: [plugin] });
31
+ ```
32
+
33
+ The plugin wraps `seal()` from `@usesigil/kit` — every DeFi action the agent takes goes through Sigil's authorization and spending cap enforcement.
34
+
35
+ ## License
36
+
37
+ Apache-2.0
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ import type { SigilClient } from "@usesigil/kit";
3
+ export declare function statusAction(client: SigilClient): {
4
+ description: string;
5
+ schema: z.ZodObject<{}, z.core.$strip>;
6
+ handler: () => Promise<{
7
+ success: boolean;
8
+ vault: import("@solana/addresses").Address;
9
+ global: {
10
+ remaining: string;
11
+ limit: string;
12
+ spent: string;
13
+ };
14
+ agent: {
15
+ remaining: string;
16
+ limit: string;
17
+ spent: string;
18
+ };
19
+ error?: undefined;
20
+ recovery?: undefined;
21
+ } | {
22
+ success: boolean;
23
+ error: string;
24
+ recovery: import("@usesigil/kit").RecoveryAction[];
25
+ vault?: undefined;
26
+ global?: undefined;
27
+ agent?: undefined;
28
+ }>;
29
+ };
30
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/sak/actions/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKjD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;EA+C/C"}
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ import { formatUsd, toAgentError } from "@usesigil/kit";
3
+ const schema = z.object({}).describe("No input required — queries the configured vault.");
4
+ export function statusAction(client) {
5
+ return {
6
+ description: "Query Sigil vault budget and status. Returns global and agent spending limits, remaining budget, and vault health.",
7
+ schema,
8
+ handler: async () => {
9
+ try {
10
+ const budget = await client.getAgentBudget();
11
+ const globalRemaining = formatUsd(budget.globalBudget.remaining);
12
+ const globalLimit = formatUsd(budget.globalBudget.cap);
13
+ const globalSpent = formatUsd(budget.globalBudget.spent24h);
14
+ const agentRemaining = budget.agentBudget
15
+ ? formatUsd(budget.agentBudget.remaining)
16
+ : "unlimited";
17
+ const agentLimit = budget.agentBudget
18
+ ? formatUsd(budget.agentBudget.cap)
19
+ : "unlimited";
20
+ const agentSpent = budget.agentBudget
21
+ ? formatUsd(budget.agentBudget.spent24h)
22
+ : "$0.00";
23
+ return {
24
+ success: true,
25
+ vault: client.vault,
26
+ global: {
27
+ remaining: globalRemaining,
28
+ limit: globalLimit,
29
+ spent: globalSpent,
30
+ },
31
+ agent: {
32
+ remaining: agentRemaining,
33
+ limit: agentLimit,
34
+ spent: agentSpent,
35
+ },
36
+ };
37
+ }
38
+ catch (err) {
39
+ const agentErr = toAgentError(err);
40
+ return {
41
+ success: false,
42
+ error: agentErr.message,
43
+ recovery: agentErr.recovery_actions,
44
+ };
45
+ }
46
+ },
47
+ };
48
+ }
49
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/sak/actions/status.ts"],"names":[],"m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B,KAAK,EAAE,WAAW;qBACnB;oBACD,KAAK,EAAE;wBACL,SAAS,EAAE,cAAc;wBACzB,KAAK,EAAE,UAAU;wBACjB,KAAK,EAAE,UAAU;qBAClB;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gBACnC,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,QAAQ,CAAC,OAAO;oBACvB,QAAQ,EAAE,QAAQ,CAAC,gBAAgB;iBACpC,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ import type { SigilClient } from "@usesigil/kit";
3
+ import { type Address } from "@solana/kit";
4
+ declare const schema: z.ZodObject<{
5
+ inputMint: z.ZodString;
6
+ outputMint: z.ZodString;
7
+ amount: z.ZodNumber;
8
+ slippageBps: z.ZodOptional<z.ZodNumber>;
9
+ }, z.core.$strip>;
10
+ export declare function swapAction(client: SigilClient, jupiterApiUrl: string): {
11
+ description: string;
12
+ schema: z.ZodObject<{
13
+ inputMint: z.ZodString;
14
+ outputMint: z.ZodString;
15
+ amount: z.ZodNumber;
16
+ slippageBps: z.ZodOptional<z.ZodNumber>;
17
+ }, z.core.$strip>;
18
+ handler: (_agent: unknown, input: z.infer<typeof schema>) => Promise<{
19
+ success: boolean;
20
+ signature: string;
21
+ inputMint: Address;
22
+ outputMint: Address;
23
+ amount: number;
24
+ error?: undefined;
25
+ recovery?: undefined;
26
+ } | {
27
+ success: boolean;
28
+ error: string;
29
+ recovery: import("@usesigil/kit").RecoveryAction[];
30
+ signature?: undefined;
31
+ inputMint?: undefined;
32
+ outputMint?: undefined;
33
+ amount?: undefined;
34
+ }>;
35
+ };
36
+ export {};
37
+ //# sourceMappingURL=swap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../src/sak/actions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAe,KAAK,OAAO,EAAoB,MAAM,aAAa,CAAC;AAG1E,QAAA,MAAM,MAAM;;;;;iBAoBV,CAAC;AAEH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM;;;;;;;;sBAKzC,OAAO,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;EA+DjE"}
@@ -0,0 +1,125 @@
1
+ import { z } from "zod";
2
+ import { ActionType, resolveToken, toAgentError, toBaseUnits } from "@usesigil/kit";
3
+ import { AccountRole } from "@solana/kit";
4
+ import { toResolvedNetwork } from "../types.js";
5
+ const schema = z.object({
6
+ inputMint: z
7
+ .string()
8
+ .describe("Input token mint address or symbol (e.g. 'USDC' or full address)"),
9
+ outputMint: z
10
+ .string()
11
+ .describe("Output token mint address or symbol"),
12
+ amount: z
13
+ .number()
14
+ .positive()
15
+ .describe("Amount in human-readable units (e.g. 500 for $500 USDC)"),
16
+ slippageBps: z
17
+ .number()
18
+ .int()
19
+ .min(1)
20
+ .max(5000)
21
+ .optional()
22
+ .describe("Slippage tolerance in BPS (default 50 = 0.5%)"),
23
+ });
24
+ export function swapAction(client, jupiterApiUrl) {
25
+ return {
26
+ description: "Execute a Sigil-secured token swap via Jupiter. Enforces vault spending caps and permissions.",
27
+ schema,
28
+ handler: async (_agent, input) => {
29
+ try {
30
+ const net = toResolvedNetwork(client.network);
31
+ const inputToken = resolveToken(input.inputMint, net);
32
+ const outputToken = resolveToken(input.outputMint, net);
33
+ const inputMint = (inputToken?.mint ?? input.inputMint);
34
+ const outputMint = (outputToken?.mint ?? input.outputMint);
35
+ const decimals = inputToken?.decimals ?? 6;
36
+ const baseAmount = toBaseUnits(input.amount, decimals);
37
+ const quoteUrl = `${jupiterApiUrl}/quote?inputMint=${inputMint}&outputMint=${outputMint}` +
38
+ `&amount=${baseAmount}&slippageBps=${input.slippageBps ?? 50}`;
39
+ const quoteRes = await fetch(quoteUrl);
40
+ if (!quoteRes.ok)
41
+ throw new Error(`Jupiter quote failed: ${quoteRes.status}`);
42
+ const quote = await quoteRes.json();
43
+ const ixRes = await fetch(`${jupiterApiUrl}/swap-instructions`, {
44
+ method: "POST",
45
+ headers: { "Content-Type": "application/json" },
46
+ body: JSON.stringify({
47
+ quoteResponse: quote,
48
+ userPublicKey: client.agent.address,
49
+ wrapAndUnwrapSol: true,
50
+ }),
51
+ });
52
+ if (!ixRes.ok)
53
+ throw new Error(`Jupiter swap-instructions failed: ${ixRes.status}`);
54
+ const ixData = await ixRes.json();
55
+ const parsed = parseJupiterSwapResponse(ixData);
56
+ if (parsed.instructions.length === 0) {
57
+ throw new Error("Jupiter returned no swap instructions. The quote may be invalid or the route unavailable.");
58
+ }
59
+ const execResult = await client.executeAndConfirm(parsed.instructions, {
60
+ tokenMint: inputMint,
61
+ amount: baseAmount,
62
+ actionType: ActionType.Swap,
63
+ protocolAltAddresses: parsed.addressLookupTableAddresses,
64
+ });
65
+ return {
66
+ success: true,
67
+ signature: execResult.signature,
68
+ inputMint,
69
+ outputMint,
70
+ amount: input.amount,
71
+ };
72
+ }
73
+ catch (err) {
74
+ const agentErr = toAgentError(err);
75
+ return {
76
+ success: false,
77
+ error: agentErr.message,
78
+ recovery: agentErr.recovery_actions,
79
+ };
80
+ }
81
+ },
82
+ };
83
+ }
84
+ /**
85
+ * Parse Jupiter swap-instructions response into Kit types.
86
+ *
87
+ * Jupiter returns 6 fields:
88
+ * - computeBudgetInstructions: stripped by wrap() — excluded
89
+ * - setupInstructions: ATA creation, etc. — included
90
+ * - swapInstruction: the swap itself — included
91
+ * - cleanupInstruction: SOL unwrap (nullable) — included
92
+ * - otherInstructions: Jito tips, etc. — included
93
+ * - addressLookupTableAddresses: ALTs for tx compression — returned separately
94
+ */
95
+ function parseJupiterSwapResponse(ixData) {
96
+ const raw = ixData;
97
+ // Collect all DeFi instructions in execution order.
98
+ // ComputeBudget instructions are excluded — wrap() adds its own.
99
+ const all = [
100
+ ...(raw.setupInstructions ?? []),
101
+ raw.swapInstruction,
102
+ ...(raw.cleanupInstruction ? [raw.cleanupInstruction] : []),
103
+ ...(raw.otherInstructions ?? []),
104
+ ].filter(Boolean);
105
+ const instructions = all.map(toKitInstruction);
106
+ const addressLookupTableAddresses = (raw.addressLookupTableAddresses ?? []);
107
+ return { instructions, addressLookupTableAddresses };
108
+ }
109
+ function toKitInstruction(ix) {
110
+ return {
111
+ programAddress: ix.programId,
112
+ accounts: (ix.accounts ?? []).map((a) => ({
113
+ address: a.pubkey,
114
+ role: a.isSigner
115
+ ? a.isWritable
116
+ ? AccountRole.WRITABLE_SIGNER
117
+ : AccountRole.READONLY_SIGNER
118
+ : a.isWritable
119
+ ? AccountRole.WRITABLE
120
+ : AccountRole.READONLY,
121
+ })),
122
+ data: new Uint8Array(Buffer.from(ix.data, "base64")),
123
+ };
124
+ }
125
+ //# sourceMappingURL=swap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.js","sourceRoot":"","sources":["../../../src/sak/actions/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,CACP,kEAAkE,CACnE;IACH,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,CAAC,qCAAqC,CAAC;IACl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,CAAC,CAAC,WAAW,CAAC,eAAe;oBAC7B,CAAC,CAAC,WAAW,CAAC,eAAe;gBAC/B,CAAC,CAAC,CAAC,CAAC,UAAU;oBACZ,CAAC,CAAC,WAAW,CAAC,QAAQ;oBACtB,CAAC,CAAC,WAAW,CAAC,QAAQ;SAC3B,CAAC,CACH;QACD,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACrD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import type { SigilClient } from "@usesigil/kit";
3
+ declare const schema: z.ZodObject<{
4
+ destination: z.ZodString;
5
+ amount: z.ZodNumber;
6
+ mint: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export declare function transferAction(_client: SigilClient): {
9
+ description: string;
10
+ schema: z.ZodObject<{
11
+ destination: z.ZodString;
12
+ amount: z.ZodNumber;
13
+ mint: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ handler: (_agent: unknown, _input: z.infer<typeof schema>) => Promise<{
16
+ success: false;
17
+ error: string;
18
+ recovery: {
19
+ action: string;
20
+ description: string;
21
+ }[];
22
+ }>;
23
+ };
24
+ export {};
25
+ //# sourceMappingURL=transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/sak/actions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,QAAA,MAAM,MAAM;;;;iBAYV,CAAC;AAEH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW;;;;;;;sBAMvB,OAAO,UAAU,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC;;;;;;;;EAqBlE"}
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ const schema = z.object({
3
+ destination: z
4
+ .string()
5
+ .describe("Destination wallet address for the transfer"),
6
+ amount: z
7
+ .number()
8
+ .positive()
9
+ .describe("Amount in human-readable units (e.g. 100 for $100 USDC)"),
10
+ mint: z
11
+ .string()
12
+ .optional()
13
+ .describe("Token mint address or symbol (defaults to USDC)"),
14
+ });
15
+ export function transferAction(_client) {
16
+ return {
17
+ description: "Execute a Sigil-secured agent-to-agent stablecoin transfer. Enforces vault spending caps. " +
18
+ "(Not yet implemented — requires SigilClient.transfer() method.)",
19
+ schema,
20
+ handler: async (_agent, _input) => {
21
+ // agent_transfer is a standalone Sigil instruction (not a DeFi CPI wrapped
22
+ // with validate_and_authorize + finalize_session). It requires 11 accounts
23
+ // with PDA derivation (policy, tracker, overlay, destination ATA, fee ATAs).
24
+ // This must be exposed as SigilClient.transfer() — cannot be built inline
25
+ // because seal() rejects empty instructions ("No target protocol").
26
+ return {
27
+ success: false,
28
+ error: "sigil_transfer is not yet implemented. " +
29
+ "On-chain agent_transfer uses a standalone instruction, not seal(). " +
30
+ "Use the vault dashboard or SDK directly to transfer.",
31
+ recovery: [
32
+ {
33
+ action: "use_dashboard",
34
+ description: "Use the Sigil dashboard to execute transfers",
35
+ },
36
+ ],
37
+ };
38
+ },
39
+ };
40
+ }
41
+ //# sourceMappingURL=transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.js","sourceRoot":"","sources":["../../../src/sak/actions/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,OAAoB;IACjD,OAAO;QACL,WAAW,EACT,4FAA4F;YAC5F,iEAAiE;QACnE,MAAM;QACN,OAAO,EAAE,KAAK,EAAE,MAAe,EAAE,MAA8B,EAAE,EAAE;YACjE,2EAA2E;YAC3E,2EAA2E;YAC3E,6EAA6E;YAC7E,0EAA0E;YAC1E,oEAAoE;YACpE,OAAO;gBACL,OAAO,EAAE,KAAc;gBACvB,KAAK,EACH,yCAAyC;oBACzC,qEAAqE;oBACrE,sDAAsD;gBACxD,QAAQ,EAAE;oBACR;wBACE,MAAM,EAAE,eAAe;wBACvB,WAAW,EAAE,8CAA8C;qBAC5D;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,86 @@
1
+ import type { SigilSakConfig } from "./types.js";
2
+ export declare function createSigilPlugin(config: SigilSakConfig): {
3
+ name: string;
4
+ methods: {
5
+ sigil_swap: {
6
+ description: string;
7
+ schema: import("zod").ZodObject<{
8
+ inputMint: import("zod").ZodString;
9
+ outputMint: import("zod").ZodString;
10
+ amount: import("zod").ZodNumber;
11
+ slippageBps: import("zod").ZodOptional<import("zod").ZodNumber>;
12
+ }, import("zod/v4/core").$strip>;
13
+ handler: (_agent: unknown, input: import("zod").infer<import("zod").ZodObject<{
14
+ inputMint: import("zod").ZodString;
15
+ outputMint: import("zod").ZodString;
16
+ amount: import("zod").ZodNumber;
17
+ slippageBps: import("zod").ZodOptional<import("zod").ZodNumber>;
18
+ }, import("zod/v4/core").$strip>>) => Promise<{
19
+ success: boolean;
20
+ signature: string;
21
+ inputMint: import("@solana/addresses").Address;
22
+ outputMint: import("@solana/addresses").Address;
23
+ amount: number;
24
+ error?: undefined;
25
+ recovery?: undefined;
26
+ } | {
27
+ success: boolean;
28
+ error: string;
29
+ recovery: import("@usesigil/kit").RecoveryAction[];
30
+ signature?: undefined;
31
+ inputMint?: undefined;
32
+ outputMint?: undefined;
33
+ amount?: undefined;
34
+ }>;
35
+ };
36
+ sigil_transfer: {
37
+ description: string;
38
+ schema: import("zod").ZodObject<{
39
+ destination: import("zod").ZodString;
40
+ amount: import("zod").ZodNumber;
41
+ mint: import("zod").ZodOptional<import("zod").ZodString>;
42
+ }, import("zod/v4/core").$strip>;
43
+ handler: (_agent: unknown, _input: import("zod").infer<import("zod").ZodObject<{
44
+ destination: import("zod").ZodString;
45
+ amount: import("zod").ZodNumber;
46
+ mint: import("zod").ZodOptional<import("zod").ZodString>;
47
+ }, import("zod/v4/core").$strip>>) => Promise<{
48
+ success: false;
49
+ error: string;
50
+ recovery: {
51
+ action: string;
52
+ description: string;
53
+ }[];
54
+ }>;
55
+ };
56
+ sigil_status: {
57
+ description: string;
58
+ schema: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
59
+ handler: () => Promise<{
60
+ success: boolean;
61
+ vault: import("@solana/addresses").Address;
62
+ global: {
63
+ remaining: string;
64
+ limit: string;
65
+ spent: string;
66
+ };
67
+ agent: {
68
+ remaining: string;
69
+ limit: string;
70
+ spent: string;
71
+ };
72
+ error?: undefined;
73
+ recovery?: undefined;
74
+ } | {
75
+ success: boolean;
76
+ error: string;
77
+ recovery: import("@usesigil/kit").RecoveryAction[];
78
+ vault?: undefined;
79
+ global?: undefined;
80
+ agent?: undefined;
81
+ }>;
82
+ };
83
+ };
84
+ };
85
+ export type { SigilSakConfig } from "./types.js";
86
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sak/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAejD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBvD;AAED,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { SigilClient, custodyAdapterToTransactionSigner, } from "@usesigil/kit";
2
+ import { swapAction } from "./actions/swap.js";
3
+ import { transferAction } from "./actions/transfer.js";
4
+ import { statusAction } from "./actions/status.js";
5
+ function isCustodyAdapter(agent) {
6
+ return (typeof agent.getPublicKey === "function" &&
7
+ typeof agent.sign === "function" &&
8
+ !("address" in agent));
9
+ }
10
+ export function createSigilPlugin(config) {
11
+ const signer = isCustodyAdapter(config.agent)
12
+ ? custodyAdapterToTransactionSigner(config.agent)
13
+ : config.agent;
14
+ const client = new SigilClient({
15
+ rpc: config.rpc,
16
+ vault: config.vault,
17
+ agent: signer,
18
+ network: config.network,
19
+ });
20
+ const jupiterApi = config.jupiterApiUrl ?? "https://quote-api.jup.ag/v6";
21
+ return {
22
+ name: "sigil",
23
+ methods: {
24
+ sigil_swap: swapAction(client, jupiterApi),
25
+ sigil_transfer: transferAction(client),
26
+ sigil_status: statusAction(client),
27
+ },
28
+ };
29
+ }
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sak/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iCAAiC,GAElC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,SAAS,gBAAgB,CACvB,KAAyC;IAEzC,OAAO,CACL,OAAQ,KAAwB,CAAC,YAAY,KAAK,UAAU;QAC5D,OAAQ,KAAwB,CAAC,IAAI,KAAK,UAAU;QACpD,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3C,CAAC,CAAC,iCAAiC,CAAC,MAAM,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IAEjB,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC;QAC7B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,IAAI,6BAA6B,CAAC;IAEzE,OAAO;QACL,IAAI,EAAE,OAAO;QACb,OAAO,EAAE;YACP,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC;YAC1C,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC;SACnC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Address, Rpc, SolanaRpcApi, TransactionSigner } from "@solana/kit";
2
+ import type { CustodyAdapter, Network } from "@usesigil/kit";
3
+ /** Convert plugin's "mainnet" to kit's "mainnet-beta" network string. */
4
+ export declare function toResolvedNetwork(network: "devnet" | "mainnet"): Network;
5
+ export interface SigilSakConfig {
6
+ /** Vault PDA address. */
7
+ vault: Address;
8
+ /** Network selector. */
9
+ network: "devnet" | "mainnet";
10
+ /** @solana/kit RPC client. */
11
+ rpc: Rpc<SolanaRpcApi>;
12
+ /** Agent signer — either a Kit TransactionSigner or a CustodyAdapter (Turnkey/Privy). */
13
+ agent: TransactionSigner | CustodyAdapter;
14
+ /** Optional: Jupiter API base URL (defaults to public endpoint). */
15
+ jupiterApiUrl?: string;
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7D,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAExE;AAED,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,wBAAwB;IACxB,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,8BAA8B;IAC9B,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,yFAAyF;IACzF,KAAK,EAAE,iBAAiB,GAAG,cAAc,CAAC;IAC1C,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,5 @@
1
+ /** Convert plugin's "mainnet" to kit's "mainnet-beta" network string. */
2
+ export function toResolvedNetwork(network) {
3
+ return network === "mainnet" ? "mainnet-beta" : "devnet";
4
+ }
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AAGA,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3D,CAAC"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@usesigil/plugins",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Agent framework adapters for Sigil",
6
+ "exports": {
7
+ "./sak": {
8
+ "import": "./dist/sak/index.js",
9
+ "types": "./dist/sak/index.d.ts"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "sideEffects": false,
18
+ "engines": {
19
+ "node": ">=18.0.0"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "clean": "rm -rf dist",
24
+ "test": "mocha --require tsx tests/*.test.ts --timeout 30000"
25
+ },
26
+ "peerDependencies": {
27
+ "@usesigil/kit": "workspace:*",
28
+ "solana-agent-kit": ">=2.0.0"
29
+ },
30
+ "peerDependenciesMeta": {
31
+ "solana-agent-kit": {
32
+ "optional": true
33
+ }
34
+ },
35
+ "dependencies": {
36
+ "zod": "^4.3.6"
37
+ },
38
+ "devDependencies": {
39
+ "@usesigil/kit": "workspace:*",
40
+ "@types/chai": "^5.2.3",
41
+ "@types/mocha": "^10.0.6",
42
+ "chai": "^6.2.2",
43
+ "mocha": "^11.7.5",
44
+ "tsx": "^4.21.0",
45
+ "typescript": "^5.6.0"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public",
49
+ "provenance": true
50
+ },
51
+ "license": "Apache-2.0",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/Kaleb-Rupe/sigil",
55
+ "directory": "packages/plugins"
56
+ },
57
+ "homepage": "https://github.com/Kaleb-Rupe/sigil#readme",
58
+ "bugs": {
59
+ "url": "https://github.com/Kaleb-Rupe/sigil/issues"
60
+ }
61
+ }