@ampersend_ai/ampersend-sdk 0.0.19 → 0.0.22
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/ampersend/client.d.ts +4 -9
- package/dist/ampersend/client.d.ts.map +1 -1
- package/dist/ampersend/client.js +25 -21
- package/dist/ampersend/client.js.map +1 -1
- package/dist/ampersend/curated-agent.d.ts +117 -0
- package/dist/ampersend/curated-agent.d.ts.map +1 -0
- package/dist/ampersend/curated-agent.js +149 -0
- package/dist/ampersend/curated-agent.js.map +1 -0
- package/dist/ampersend/env.d.ts +0 -15
- package/dist/ampersend/env.d.ts.map +1 -1
- package/dist/ampersend/env.js +0 -4
- package/dist/ampersend/env.js.map +1 -1
- package/dist/ampersend/index.d.ts +2 -0
- package/dist/ampersend/index.d.ts.map +1 -1
- package/dist/ampersend/index.js +2 -0
- package/dist/ampersend/index.js.map +1 -1
- package/dist/ampersend/marketplace.d.ts +47 -0
- package/dist/ampersend/marketplace.d.ts.map +1 -0
- package/dist/ampersend/marketplace.js +91 -0
- package/dist/ampersend/marketplace.js.map +1 -0
- package/dist/ampersend/treasurer.d.ts +14 -79
- package/dist/ampersend/treasurer.d.ts.map +1 -1
- package/dist/ampersend/treasurer.js +34 -102
- package/dist/ampersend/treasurer.js.map +1 -1
- package/dist/ampersend/types.d.ts +346 -336
- package/dist/ampersend/types.d.ts.map +1 -1
- package/dist/ampersend/types.js +112 -149
- package/dist/ampersend/types.js.map +1 -1
- package/dist/ampersend/zod-bridge.d.ts +15 -0
- package/dist/ampersend/zod-bridge.d.ts.map +1 -0
- package/dist/ampersend/zod-bridge.js +29 -0
- package/dist/ampersend/zod-bridge.js.map +1 -0
- package/dist/cli/ampersend.js +2 -0
- package/dist/cli/ampersend.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +2 -21
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/fetch.d.ts.map +1 -1
- package/dist/cli/commands/fetch.js +1 -6
- package/dist/cli/commands/fetch.js.map +1 -1
- package/dist/cli/commands/marketplace.d.ts +19 -0
- package/dist/cli/commands/marketplace.d.ts.map +1 -0
- package/dist/cli/commands/marketplace.js +117 -0
- package/dist/cli/commands/marketplace.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +6 -1
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/config.d.ts +0 -10
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +5 -30
- package/dist/cli/config.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/client/client.d.ts +0 -3
- package/dist/mcp/client/client.d.ts.map +1 -1
- package/dist/mcp/client/client.js +10 -14
- package/dist/mcp/client/client.js.map +1 -1
- package/dist/mcp/client/factory.d.ts +0 -2
- package/dist/mcp/client/factory.d.ts.map +1 -1
- package/dist/mcp/client/factory.js +0 -3
- package/dist/mcp/client/factory.js.map +1 -1
- package/dist/mcp/client/middleware.d.ts +0 -3
- package/dist/mcp/client/middleware.d.ts.map +1 -1
- package/dist/mcp/client/middleware.js +9 -12
- package/dist/mcp/client/middleware.js.map +1 -1
- package/dist/mcp/client/protocol.d.ts +81 -85
- package/dist/mcp/client/protocol.d.ts.map +1 -1
- package/dist/mcp/client/protocol.js +17 -15
- package/dist/mcp/client/protocol.js.map +1 -1
- package/dist/mcp/client/types.d.ts +6 -19
- package/dist/mcp/client/types.d.ts.map +1 -1
- package/dist/mcp/proxy/cli.d.ts.map +1 -1
- package/dist/mcp/proxy/cli.js +0 -1
- package/dist/mcp/proxy/cli.js.map +1 -1
- package/dist/mcp/proxy/env.d.ts +0 -9
- package/dist/mcp/proxy/env.d.ts.map +1 -1
- package/dist/mcp/proxy/env.js +0 -2
- package/dist/mcp/proxy/env.js.map +1 -1
- package/dist/mcp/proxy/factory.d.ts +0 -2
- package/dist/mcp/proxy/factory.d.ts.map +1 -1
- package/dist/mcp/proxy/factory.js +0 -3
- package/dist/mcp/proxy/factory.js.map +1 -1
- package/dist/mcp/server/fastmcp/middleware.d.ts +9 -29
- package/dist/mcp/server/fastmcp/middleware.d.ts.map +1 -1
- package/dist/mcp/server/fastmcp/middleware.js +10 -42
- package/dist/mcp/server/fastmcp/middleware.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/x402/envelopes.d.ts +62 -0
- package/dist/x402/envelopes.d.ts.map +1 -0
- package/dist/x402/envelopes.js +73 -0
- package/dist/x402/envelopes.js.map +1 -0
- package/dist/x402/http/client.d.ts +37 -0
- package/dist/x402/http/client.d.ts.map +1 -0
- package/dist/x402/http/client.js +159 -0
- package/dist/x402/http/client.js.map +1 -0
- package/dist/x402/http/factory.d.ts +9 -25
- package/dist/x402/http/factory.d.ts.map +1 -1
- package/dist/x402/http/factory.js +21 -27
- package/dist/x402/http/factory.js.map +1 -1
- package/dist/x402/http/index.d.ts +4 -1
- package/dist/x402/http/index.d.ts.map +1 -1
- package/dist/x402/http/index.js +2 -1
- package/dist/x402/http/index.js.map +1 -1
- package/dist/x402/index.d.ts +4 -1
- package/dist/x402/index.d.ts.map +1 -1
- package/dist/x402/index.js +3 -2
- package/dist/x402/index.js.map +1 -1
- package/dist/x402/treasurer.d.ts +22 -47
- package/dist/x402/treasurer.d.ts.map +1 -1
- package/dist/x402/treasurers/naive.d.ts +4 -40
- package/dist/x402/treasurers/naive.d.ts.map +1 -1
- package/dist/x402/treasurers/naive.js +7 -44
- package/dist/x402/treasurers/naive.js.map +1 -1
- package/dist/x402/wallet.d.ts +7 -32
- package/dist/x402/wallet.d.ts.map +1 -1
- package/dist/x402/wallet.js +0 -3
- package/dist/x402/wallet.js.map +1 -1
- package/dist/x402/wallets/account/wallet.d.ts +9 -30
- package/dist/x402/wallets/account/wallet.d.ts.map +1 -1
- package/dist/x402/wallets/account/wallet.js +30 -37
- package/dist/x402/wallets/account/wallet.js.map +1 -1
- package/dist/x402/wallets/index.d.ts +0 -1
- package/dist/x402/wallets/index.d.ts.map +1 -1
- package/dist/x402/wallets/index.js +0 -1
- package/dist/x402/wallets/index.js.map +1 -1
- package/dist/x402/wallets/smart-account/chain.d.ts +4 -0
- package/dist/x402/wallets/smart-account/chain.d.ts.map +1 -0
- package/dist/x402/wallets/smart-account/chain.js +12 -0
- package/dist/x402/wallets/smart-account/chain.js.map +1 -0
- package/dist/x402/wallets/smart-account/cosigned.d.ts +7 -33
- package/dist/x402/wallets/smart-account/cosigned.d.ts.map +1 -1
- package/dist/x402/wallets/smart-account/cosigned.js +28 -51
- package/dist/x402/wallets/smart-account/cosigned.js.map +1 -1
- package/dist/x402/wallets/smart-account/exact.d.ts +6 -20
- package/dist/x402/wallets/smart-account/exact.d.ts.map +1 -1
- package/dist/x402/wallets/smart-account/exact.js +33 -43
- package/dist/x402/wallets/smart-account/exact.js.map +1 -1
- package/dist/x402/wallets/smart-account/wallet.d.ts +6 -39
- package/dist/x402/wallets/smart-account/wallet.d.ts.map +1 -1
- package/dist/x402/wallets/smart-account/wallet.js +9 -36
- package/dist/x402/wallets/smart-account/wallet.js.map +1 -1
- package/package.json +4 -4
- package/dist/x402/http/adapter.d.ts +0 -38
- package/dist/x402/http/adapter.d.ts.map +0 -1
- package/dist/x402/http/adapter.js +0 -193
- package/dist/x402/http/adapter.js.map +0 -1
- package/dist/x402/http/v2-adapter.d.ts +0 -56
- package/dist/x402/http/v2-adapter.d.ts.map +0 -1
- package/dist/x402/http/v2-adapter.js +0 -94
- package/dist/x402/http/v2-adapter.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { PaymentAuthorization, PaymentRequest } from "../x402/envelopes.ts";
|
|
2
|
+
import { AgentAuthorizeRequest, AgentAuthorizeResponse, AgentPaymentEventResponse, type Address, type ApiClientOptions, type PaymentEvent } from "./types.js";
|
|
2
3
|
export * from "./types.js";
|
|
3
4
|
/**
|
|
4
5
|
* TypeScript SDK for the API
|
|
@@ -18,14 +19,8 @@ export declare class ApiClient {
|
|
|
18
19
|
* Internal method to perform authentication without mutex (for use within mutex)
|
|
19
20
|
*/
|
|
20
21
|
private performAuthentication;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
authorizePayment(requirements: readonly [PaymentRequirements, ...Array<PaymentRequirements>], context?: AgentPaymentAuthRequest["context"]): Promise<AgentPaymentAuthResponse>;
|
|
25
|
-
/**
|
|
26
|
-
* Report a payment lifecycle event
|
|
27
|
-
*/
|
|
28
|
-
reportPaymentEvent(eventId: string, payment: PaymentPayload, event: PaymentEvent): Promise<AgentPaymentEventResponse>;
|
|
22
|
+
authorizePayment(paymentRequest: PaymentRequest, context?: AgentAuthorizeRequest["context"]): Promise<typeof AgentAuthorizeResponse.Type>;
|
|
23
|
+
reportPaymentEvent(eventId: string, payment: PaymentAuthorization, event: PaymentEvent): Promise<AgentPaymentEventResponse>;
|
|
29
24
|
/**
|
|
30
25
|
* Clear the current authentication state
|
|
31
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ampersend/client.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ampersend/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EAEtB,yBAAyB,EAIzB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAElB,MAAM,YAAY,CAAA;AAEnB,cAAc,YAAY,CAAA;AAE1B;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,IAAI,CAGX;gBAEW,OAAO,EAAE,gBAAgB;IAOrC;;OAEG;YACW,qBAAqB;IAmE7B,gBAAgB,CACpB,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,GACzC,OAAO,CAAC,OAAO,sBAAsB,CAAC,IAAI,CAAC;IAoCxC,kBAAkB,CACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,yBAAyB,CAAC;IAoBrC;;OAEG;IACH,SAAS,IAAI,IAAI;IAOjB;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;YACW,mBAAmB;IAQjC;;OAEG;YACW,KAAK;CAkCpB"}
|
package/dist/ampersend/client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Mutex } from "async-mutex";
|
|
|
2
2
|
import { DateTime, Schema } from "effect";
|
|
3
3
|
import { SiweMessage } from "siwe";
|
|
4
4
|
import { privateKeyToAccount } from "viem/accounts";
|
|
5
|
-
import {
|
|
5
|
+
import { AgentAuthorizeRequest, AgentAuthorizeResponse, AgentPaymentEventReport, AgentPaymentEventResponse, ApiError, SIWELoginResponse, SIWENonceResponse, } from "./types.js";
|
|
6
6
|
export * from "./types.js";
|
|
7
7
|
/**
|
|
8
8
|
* TypeScript SDK for the API
|
|
@@ -84,41 +84,45 @@ export class ApiClient {
|
|
|
84
84
|
throw new ApiError(`Authentication failed: ${error}`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
* Request authorization for a payment
|
|
89
|
-
*/
|
|
90
|
-
async authorizePayment(requirements, context) {
|
|
87
|
+
async authorizePayment(paymentRequest, context) {
|
|
91
88
|
await this.ensureAuthenticated();
|
|
92
|
-
const request = {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
96
|
-
return this.fetch(`/api/v1/agents/${this.agentAddress}/payment/authorize`, {
|
|
89
|
+
const request = { paymentRequest, context };
|
|
90
|
+
const wireBody = Schema.encodeSync(AgentAuthorizeRequest)(request);
|
|
91
|
+
const response = await this.fetch(`/api/v1/agents/${this.agentAddress}/payment/authorize`, {
|
|
97
92
|
method: "POST",
|
|
98
93
|
headers: {
|
|
99
94
|
"Content-Type": "application/json",
|
|
100
95
|
Authorization: `Bearer ${this.auth.token}`,
|
|
101
96
|
},
|
|
102
|
-
body: JSON.stringify(
|
|
103
|
-
},
|
|
97
|
+
body: JSON.stringify(wireBody),
|
|
98
|
+
}, AgentAuthorizeResponse);
|
|
99
|
+
// A bad acceptsIndex from the server would silently point the wallet at
|
|
100
|
+
// the wrong line-item. Catch it here rather than letting it fall through.
|
|
101
|
+
const acceptsLen = paymentRequest.data.accepts.length;
|
|
102
|
+
const checkIndex = (idx, where) => {
|
|
103
|
+
if (!Number.isInteger(idx) || idx < 0 || idx >= acceptsLen) {
|
|
104
|
+
throw new ApiError(`authorize response: ${where} acceptsIndex=${idx} out of bounds (accepts.length=${acceptsLen})`);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
if (response.authorized.selected)
|
|
108
|
+
checkIndex(response.authorized.selected.acceptsIndex, "selected");
|
|
109
|
+
for (const alt of response.authorized.alternatives)
|
|
110
|
+
checkIndex(alt.acceptsIndex, "alternatives");
|
|
111
|
+
for (const rej of response.rejected)
|
|
112
|
+
checkIndex(rej.acceptsIndex, "rejected");
|
|
113
|
+
return response;
|
|
104
114
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Report a payment lifecycle event
|
|
107
|
-
*/
|
|
108
115
|
async reportPaymentEvent(eventId, payment, event) {
|
|
109
116
|
await this.ensureAuthenticated();
|
|
110
|
-
const report = {
|
|
111
|
-
|
|
112
|
-
payment,
|
|
113
|
-
event,
|
|
114
|
-
};
|
|
117
|
+
const report = { id: eventId, payment, event };
|
|
118
|
+
const wireBody = Schema.encodeSync(AgentPaymentEventReport)(report);
|
|
115
119
|
return this.fetch(`/api/v1/agents/${this.agentAddress}/payment/events`, {
|
|
116
120
|
method: "POST",
|
|
117
121
|
headers: {
|
|
118
122
|
"Content-Type": "application/json",
|
|
119
123
|
Authorization: `Bearer ${this.auth.token}`,
|
|
120
124
|
},
|
|
121
|
-
body: JSON.stringify(
|
|
125
|
+
body: JSON.stringify(wireBody),
|
|
122
126
|
}, AgentPaymentEventResponse);
|
|
123
127
|
}
|
|
124
128
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/ampersend/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/ampersend/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAGnD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAMlB,MAAM,YAAY,CAAA;AAEnB,cAAc,YAAY,CAAA;AAE1B;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IACZ,OAAO,CAAQ;IACf,oBAAoB,CAA2B;IAC/C,YAAY,CAAS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ACD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC1D,MAAM,IAAI,QAAQ,CAAC,yBAAyB,IAAI,CAAC,OAAO,IAAI,CAAC,CAAA;YAC/D,CAAC;YACD,MAAM,IAAI,QAAQ,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
export declare const CuratedAgentSource: Schema.Literal<["catalog", "bazaar", "ampersend"]>;
|
|
3
|
+
export type CuratedAgentSource = typeof CuratedAgentSource.Type;
|
|
4
|
+
export declare const HTTPMethod: Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]>;
|
|
5
|
+
export type HTTPMethod = typeof HTTPMethod.Type;
|
|
6
|
+
export declare const x402ProtocolVersion: Schema.Literal<[1, 2]>;
|
|
7
|
+
export type x402ProtocolVersion = typeof x402ProtocolVersion.Type;
|
|
8
|
+
export declare const CuratedAgentEndpointX402PricingConfig: Schema.Struct<{
|
|
9
|
+
amount: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
10
|
+
amountAtomicUnit: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
11
|
+
currency: Schema.SchemaClass<string, string, never>;
|
|
12
|
+
networkCaip2ID: Schema.refine<string, typeof Schema.Trimmed>;
|
|
13
|
+
assetAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
14
|
+
payTo: Schema.NullOr<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
15
|
+
x402Schema: Schema.NullOr<Schema.Literal<["exact", "deferred"]>>;
|
|
16
|
+
}>;
|
|
17
|
+
export type CuratedAgentEndpointX402PricingConfig = typeof CuratedAgentEndpointX402PricingConfig.Type;
|
|
18
|
+
export declare const CuratedAgentEndpointPricingConfig: Schema.Struct<{
|
|
19
|
+
amount: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
20
|
+
amountAtomicUnit: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
21
|
+
currency: Schema.SchemaClass<string, string, never>;
|
|
22
|
+
networkCaip2ID: Schema.refine<string, typeof Schema.Trimmed>;
|
|
23
|
+
assetAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
24
|
+
payTo: Schema.NullOr<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
25
|
+
x402Schema: Schema.NullOr<Schema.Literal<["exact", "deferred"]>>;
|
|
26
|
+
}>;
|
|
27
|
+
export type CuratedAgentEndpointPricingConfig = typeof CuratedAgentEndpointPricingConfig.Type;
|
|
28
|
+
export declare const CuratedAgentEndpointDTO: Schema.Struct<{
|
|
29
|
+
id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
30
|
+
curated_agent_id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
31
|
+
url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
32
|
+
methods: Schema.Array$<Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]>>;
|
|
33
|
+
x402_enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
34
|
+
x402_protocol_version: Schema.Literal<[1, 2]>;
|
|
35
|
+
network: Schema.NullOr<typeof Schema.String>;
|
|
36
|
+
description: Schema.NullOr<typeof Schema.String>;
|
|
37
|
+
enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
38
|
+
pricing_config: Schema.Struct<{
|
|
39
|
+
amount: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
40
|
+
amountAtomicUnit: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
41
|
+
currency: Schema.SchemaClass<string, string, never>;
|
|
42
|
+
networkCaip2ID: Schema.refine<string, typeof Schema.Trimmed>;
|
|
43
|
+
assetAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
44
|
+
payTo: Schema.NullOr<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
45
|
+
x402Schema: Schema.NullOr<Schema.Literal<["exact", "deferred"]>>;
|
|
46
|
+
}>;
|
|
47
|
+
created_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
48
|
+
updated_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
49
|
+
}>;
|
|
50
|
+
export type CuratedAgentEndpointDTO = typeof CuratedAgentEndpointDTO.Type;
|
|
51
|
+
export declare const CuratedAgentSkillDTO: Schema.Struct<{
|
|
52
|
+
id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
53
|
+
curated_agent_id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
54
|
+
name: Schema.refine<string, typeof Schema.Trimmed>;
|
|
55
|
+
instructions: Schema.SchemaClass<unknown, unknown, never>;
|
|
56
|
+
docs_url: Schema.NullOr<typeof Schema.String>;
|
|
57
|
+
skillmd_url: Schema.NullOr<typeof Schema.String>;
|
|
58
|
+
created_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
59
|
+
updated_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
60
|
+
}>;
|
|
61
|
+
export type CuratedAgentSkillDTO = typeof CuratedAgentSkillDTO.Type;
|
|
62
|
+
export declare const CuratedAgentDTO: Schema.Struct<{
|
|
63
|
+
id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
64
|
+
name: Schema.refine<string, typeof Schema.Trimmed>;
|
|
65
|
+
description: Schema.NullOr<typeof Schema.String>;
|
|
66
|
+
source: Schema.Literal<["catalog", "bazaar", "ampersend"]>;
|
|
67
|
+
enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
68
|
+
category: Schema.refine<string, typeof Schema.Trimmed>;
|
|
69
|
+
tags: Schema.Array$<typeof Schema.NonEmptyTrimmedString>;
|
|
70
|
+
url: Schema.NullOr<typeof Schema.String>;
|
|
71
|
+
logo_url: Schema.NullOr<typeof Schema.String>;
|
|
72
|
+
docs_url: Schema.NullOr<typeof Schema.String>;
|
|
73
|
+
ampersend_agent_address: Schema.NullOr<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
74
|
+
created_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
75
|
+
updated_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
76
|
+
endpoints: Schema.Array$<Schema.Struct<{
|
|
77
|
+
id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
78
|
+
curated_agent_id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
79
|
+
url: Schema.refine<string, typeof Schema.Trimmed>;
|
|
80
|
+
methods: Schema.Array$<Schema.Literal<["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]>>;
|
|
81
|
+
x402_enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
82
|
+
x402_protocol_version: Schema.Literal<[1, 2]>;
|
|
83
|
+
network: Schema.NullOr<typeof Schema.String>;
|
|
84
|
+
description: Schema.NullOr<typeof Schema.String>;
|
|
85
|
+
enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
86
|
+
pricing_config: Schema.Struct<{
|
|
87
|
+
amount: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
88
|
+
amountAtomicUnit: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.BigIntFromSelf, never>;
|
|
89
|
+
currency: Schema.SchemaClass<string, string, never>;
|
|
90
|
+
networkCaip2ID: Schema.refine<string, typeof Schema.Trimmed>;
|
|
91
|
+
assetAddress: Schema.refine<string, typeof Schema.NonEmptyTrimmedString>;
|
|
92
|
+
payTo: Schema.NullOr<Schema.refine<string, typeof Schema.NonEmptyTrimmedString>>;
|
|
93
|
+
x402Schema: Schema.NullOr<Schema.Literal<["exact", "deferred"]>>;
|
|
94
|
+
}>;
|
|
95
|
+
created_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
96
|
+
updated_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
97
|
+
}>>;
|
|
98
|
+
skills: Schema.Array$<Schema.Struct<{
|
|
99
|
+
id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
100
|
+
curated_agent_id: Schema.brand<typeof Schema.UUID, "ID">;
|
|
101
|
+
name: Schema.refine<string, typeof Schema.Trimmed>;
|
|
102
|
+
instructions: Schema.SchemaClass<unknown, unknown, never>;
|
|
103
|
+
docs_url: Schema.NullOr<typeof Schema.String>;
|
|
104
|
+
skillmd_url: Schema.NullOr<typeof Schema.String>;
|
|
105
|
+
created_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
106
|
+
updated_at: Schema.Union<[Schema.refine<number, typeof Schema.NonNegative>, Schema.filter<Schema.filter<typeof Schema.NumberFromString>>]>;
|
|
107
|
+
}>>;
|
|
108
|
+
}>;
|
|
109
|
+
export type CuratedAgentDTO = typeof CuratedAgentDTO.Type;
|
|
110
|
+
export declare const AgentMarketplaceListQueryParams: Schema.Struct<{
|
|
111
|
+
source: Schema.optional<Schema.Literal<["catalog", "bazaar", "ampersend"]>>;
|
|
112
|
+
category: Schema.optional<typeof Schema.String>;
|
|
113
|
+
search: Schema.optional<typeof Schema.String>;
|
|
114
|
+
network: Schema.optional<typeof Schema.String>;
|
|
115
|
+
}>;
|
|
116
|
+
export type AgentMarketplaceListQueryParams = typeof AgentMarketplaceListQueryParams.Type;
|
|
117
|
+
//# sourceMappingURL=curated-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curated-agent.d.ts","sourceRoot":"","sources":["../../src/ampersend/curated-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,eAAO,MAAM,kBAAkB,oDAAmD,CAAA;AAClF,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAE/D,eAAO,MAAM,UAAU,sEAAqE,CAAA;AAC5F,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,eAAO,MAAM,mBAAmB,wBAAuB,CAAA;AACvD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAA;AAEjE,eAAO,MAAM,qCAAqC;;;;;;;;EAuBhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,OAAO,qCAAqC,CAAC,IAAI,CAAA;AAErG,eAAO,MAAM,iCAAiC;;;;;;;;EAAsD,CAAA;AACpG,MAAM,MAAM,iCAAiC,GAAG,OAAO,iCAAiC,CAAC,IAAI,CAAA;AAE7F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;EA0ClC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAA;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;EA0B/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAA;AAEnE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyC1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD,eAAO,MAAM,+BAA+B;;;;;EAO1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,OAAO,+BAA+B,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { Address, ConvertedTimestamp, ID, Scheme } from "./types.js";
|
|
3
|
+
export const CuratedAgentSource = Schema.Literal("catalog", "bazaar", "ampersend");
|
|
4
|
+
export const HTTPMethod = Schema.Literal("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS");
|
|
5
|
+
export const x402ProtocolVersion = Schema.Literal(1, 2);
|
|
6
|
+
export const CuratedAgentEndpointX402PricingConfig = Schema.Struct({
|
|
7
|
+
amount: Schema.BigInt.annotations({
|
|
8
|
+
jsonSchema: {},
|
|
9
|
+
description: "The amount charged per request to the endpoint",
|
|
10
|
+
examples: [1000n],
|
|
11
|
+
}),
|
|
12
|
+
amountAtomicUnit: Schema.BigInt.annotations({
|
|
13
|
+
jsonSchema: {},
|
|
14
|
+
description: "atomic unit of the accepted asset for the payment to the endpoint. USDC has 6 decimals → $0.001 = '1000'",
|
|
15
|
+
examples: [100000n],
|
|
16
|
+
}),
|
|
17
|
+
currency: Schema.String.annotations({
|
|
18
|
+
examples: ["USDC"],
|
|
19
|
+
}),
|
|
20
|
+
networkCaip2ID: Schema.NonEmptyTrimmedString.annotations({
|
|
21
|
+
examples: ["eip155:8453"],
|
|
22
|
+
}),
|
|
23
|
+
assetAddress: Address,
|
|
24
|
+
payTo: Schema.NullOr(Address),
|
|
25
|
+
x402Schema: Schema.NullOr(Scheme),
|
|
26
|
+
}).annotations({
|
|
27
|
+
identifier: "Ampersend/db/tables/CuratedAgentEndpoint/CuratedAgentEndpointX402PricingConfig",
|
|
28
|
+
});
|
|
29
|
+
export const CuratedAgentEndpointPricingConfig = Schema.Union(CuratedAgentEndpointX402PricingConfig);
|
|
30
|
+
export const CuratedAgentEndpointDTO = Schema.Struct({
|
|
31
|
+
id: ID.annotations({
|
|
32
|
+
identifier: "curated_agent_endpoint.id",
|
|
33
|
+
}),
|
|
34
|
+
curated_agent_id: ID.annotations({
|
|
35
|
+
identifier: "curated_agent_endpoint.curated_agent_id",
|
|
36
|
+
}),
|
|
37
|
+
url: Schema.NonEmptyTrimmedString.annotations({
|
|
38
|
+
identifier: "curated_agent_endpoint.url",
|
|
39
|
+
examples: ["https://api.venice.ai/api/v1/chat/completions"],
|
|
40
|
+
}),
|
|
41
|
+
methods: Schema.Array(HTTPMethod).annotations({
|
|
42
|
+
identifier: "curated_agent_endpoint.methods",
|
|
43
|
+
description: "What HTTP method(s) does the endpoint allow/support",
|
|
44
|
+
}),
|
|
45
|
+
x402_enabled: Schema.Boolean.annotations({
|
|
46
|
+
identifier: "curated_agent_endpoint.x402_enabled",
|
|
47
|
+
}),
|
|
48
|
+
x402_protocol_version: x402ProtocolVersion.annotations({
|
|
49
|
+
identifier: "curated_agent_endpoint.x402_protocol_version",
|
|
50
|
+
description: "Identified which version of x402 the endpoint supports, which shows how to use the endpoint correctly",
|
|
51
|
+
}),
|
|
52
|
+
network: Schema.NullOr(Schema.String).annotations({
|
|
53
|
+
identifier: "curated_agent_endpoint.network",
|
|
54
|
+
description: "The network supported for payment to the endpoint; if the endpoint is x402 enabled",
|
|
55
|
+
examples: ["base", "base-sepolia", "solana"],
|
|
56
|
+
}),
|
|
57
|
+
description: Schema.NullOr(Schema.String).annotations({
|
|
58
|
+
identifier: "curated_agent_endpoint.description",
|
|
59
|
+
}),
|
|
60
|
+
enabled: Schema.Boolean.annotations({
|
|
61
|
+
identifier: "curated_agent_endpoint.enabled",
|
|
62
|
+
}),
|
|
63
|
+
pricing_config: CuratedAgentEndpointPricingConfig.annotations({
|
|
64
|
+
identifier: "curated_agent_endpoint.pricing_config",
|
|
65
|
+
description: "Contains the required pricing information for paying for the service",
|
|
66
|
+
}),
|
|
67
|
+
created_at: ConvertedTimestamp,
|
|
68
|
+
updated_at: ConvertedTimestamp,
|
|
69
|
+
}).annotations({
|
|
70
|
+
identifier: "Ampersend/domain/CuratedAgentEndpointDTO",
|
|
71
|
+
});
|
|
72
|
+
export const CuratedAgentSkillDTO = Schema.Struct({
|
|
73
|
+
id: ID.annotations({
|
|
74
|
+
identifier: "curated_agent_skill.id",
|
|
75
|
+
}),
|
|
76
|
+
curated_agent_id: ID.annotations({
|
|
77
|
+
identifier: "curated_agent_skill.curated_agent_id",
|
|
78
|
+
}),
|
|
79
|
+
name: Schema.NonEmptyTrimmedString.annotations({
|
|
80
|
+
identifier: "curated_agent_skill.name",
|
|
81
|
+
}),
|
|
82
|
+
instructions: Schema.Unknown.annotations({
|
|
83
|
+
identifier: "curated_agent_skill.instructions",
|
|
84
|
+
description: "Provided setup/install instructions for how to use the skill",
|
|
85
|
+
}),
|
|
86
|
+
docs_url: Schema.NullOr(Schema.String).annotations({
|
|
87
|
+
identifier: "curated_agent_skill.docs_url",
|
|
88
|
+
description: "Link to any docs for using the skill",
|
|
89
|
+
}),
|
|
90
|
+
skillmd_url: Schema.NullOr(Schema.String).annotations({
|
|
91
|
+
identifier: "curated_agent_skill.skillmd_url",
|
|
92
|
+
description: "Link to the skill.md file",
|
|
93
|
+
}),
|
|
94
|
+
created_at: ConvertedTimestamp,
|
|
95
|
+
updated_at: ConvertedTimestamp,
|
|
96
|
+
}).annotations({
|
|
97
|
+
identifier: "Ampersend/domain/CuratedAgentSkillDTO",
|
|
98
|
+
});
|
|
99
|
+
export const CuratedAgentDTO = Schema.Struct({
|
|
100
|
+
id: ID.annotations({
|
|
101
|
+
identifier: "curated_agent.id",
|
|
102
|
+
}),
|
|
103
|
+
name: Schema.NonEmptyTrimmedString.annotations({
|
|
104
|
+
identifier: "curated_agent.name",
|
|
105
|
+
}),
|
|
106
|
+
description: Schema.NullOr(Schema.String).annotations({
|
|
107
|
+
identifier: "curated_agent.description",
|
|
108
|
+
}),
|
|
109
|
+
source: CuratedAgentSource.annotations({
|
|
110
|
+
identifier: "curated_agent.source",
|
|
111
|
+
}),
|
|
112
|
+
enabled: Schema.Boolean.annotations({
|
|
113
|
+
identifier: "curated_agent.enabled",
|
|
114
|
+
}),
|
|
115
|
+
category: Schema.NonEmptyTrimmedString.annotations({
|
|
116
|
+
identifier: "curated_agent.category",
|
|
117
|
+
}),
|
|
118
|
+
tags: Schema.Array(Schema.NonEmptyTrimmedString).annotations({
|
|
119
|
+
identifier: "curated_agent.tags",
|
|
120
|
+
}),
|
|
121
|
+
url: Schema.NullOr(Schema.String).annotations({
|
|
122
|
+
identifier: "curated_agent.url",
|
|
123
|
+
}),
|
|
124
|
+
logo_url: Schema.NullOr(Schema.String).annotations({
|
|
125
|
+
identifier: "curated_agent.logo_url",
|
|
126
|
+
}),
|
|
127
|
+
docs_url: Schema.NullOr(Schema.String).annotations({
|
|
128
|
+
identifier: "curated_agent.docs_url",
|
|
129
|
+
}),
|
|
130
|
+
ampersend_agent_address: Schema.NullOr(Address).annotations({
|
|
131
|
+
identifier: "curated_agent.ampersend_agent_address",
|
|
132
|
+
description: "FK to the agent.address if the curated agent is also registered in ampersend.",
|
|
133
|
+
}),
|
|
134
|
+
created_at: ConvertedTimestamp,
|
|
135
|
+
updated_at: ConvertedTimestamp,
|
|
136
|
+
endpoints: Schema.Array(CuratedAgentEndpointDTO),
|
|
137
|
+
skills: Schema.Array(CuratedAgentSkillDTO),
|
|
138
|
+
}).annotations({
|
|
139
|
+
identifier: "Ampersend/domain/CuratedAgentDTO",
|
|
140
|
+
});
|
|
141
|
+
export const AgentMarketplaceListQueryParams = Schema.Struct({
|
|
142
|
+
source: CuratedAgentSource.pipe(Schema.optional),
|
|
143
|
+
category: Schema.String.pipe(Schema.optional),
|
|
144
|
+
search: Schema.String.pipe(Schema.optional),
|
|
145
|
+
network: Schema.String.pipe(Schema.optional),
|
|
146
|
+
}).annotations({
|
|
147
|
+
identifier: "Ampersend/domain/AgentMarketplaceListQueryParams",
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=curated-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curated-agent.js","sourceRoot":"","sources":["../../src/ampersend/curated-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;AAGlF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAG5F,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAGvD,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,MAAM,CAAC;IACjE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;QAChC,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,gDAAgD;QAC7D,QAAQ,EAAE,CAAC,KAAK,CAAC;KAClB,CAAC;IACF,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;QAC1C,UAAU,EAAE,EAAE;QACd,WAAW,EACT,0GAA0G;QAC5G,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;QAClC,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB,CAAC;IACF,cAAc,EAAE,MAAM,CAAC,qBAAqB,CAAC,WAAW,CAAC;QACvD,QAAQ,EAAE,CAAC,aA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,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC;QAC1D,UAAU,EAAE,uCAAuC;QACnD,WAAW,EAAE,+EAA+E;KAC7F,CAAC;IACF,UAAU,EAAE,kBAAkB;IAC9B,UAAU,EAAE,kBAAkB;IAC9B,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC;CAC3C,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,kCAAkC;CAC/C,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3D,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;CAC7C,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,kDAAkD;CAC/D,CAAC,CAAA"}
|
package/dist/ampersend/env.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Environment configuration for Ampersend smart account wallets.
|
|
4
|
-
*
|
|
5
|
-
* Supports two formats:
|
|
6
|
-
* 1. Combined: AMPERSEND_AGENT_SECRET="agent_key:::agent_account"
|
|
7
|
-
* 2. Separate: AMPERSEND_AGENT_ACCOUNT + AMPERSEND_AGENT_KEY
|
|
8
|
-
*
|
|
9
|
-
* The combined format is checked first. Error if both formats are present.
|
|
10
|
-
*/
|
|
11
|
-
/** Supported networks (Ampersend smart accounts only support Base) */
|
|
12
|
-
export declare const NETWORKS: readonly ["base", "base-sepolia"];
|
|
13
|
-
export type Network = (typeof NETWORKS)[number];
|
|
14
2
|
/**
|
|
15
3
|
* Zod schema for validated config (after resolving AGENT_SECRET)
|
|
16
4
|
*/
|
|
@@ -18,19 +6,16 @@ declare const configSchema: z.ZodObject<{
|
|
|
18
6
|
AGENT_ACCOUNT: z.ZodEffects<z.ZodString, string, string>;
|
|
19
7
|
AGENT_KEY: z.ZodEffects<z.ZodString, string, string>;
|
|
20
8
|
VALIDATOR_ADDRESS: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
-
NETWORK: z.ZodDefault<z.ZodEnum<["base", "base-sepolia"]>>;
|
|
22
9
|
API_URL: z.ZodOptional<z.ZodString>;
|
|
23
10
|
}, "strip", z.ZodTypeAny, {
|
|
24
11
|
AGENT_ACCOUNT: string;
|
|
25
12
|
AGENT_KEY: string;
|
|
26
13
|
VALIDATOR_ADDRESS: string;
|
|
27
|
-
NETWORK: "base-sepolia" | "base";
|
|
28
14
|
API_URL?: string | undefined;
|
|
29
15
|
}, {
|
|
30
16
|
AGENT_ACCOUNT: string;
|
|
31
17
|
AGENT_KEY: string;
|
|
32
18
|
VALIDATOR_ADDRESS?: string | undefined;
|
|
33
|
-
NETWORK?: "base-sepolia" | "base" | undefined;
|
|
34
19
|
API_URL?: string | undefined;
|
|
35
20
|
}>;
|
|
36
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/ampersend/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/ampersend/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqCvB;;GAEG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;EAchB,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,kBAAkB,CA2CnD"}
|
package/dist/ampersend/env.js
CHANGED
|
@@ -9,8 +9,6 @@ import { OWNABLE_VALIDATOR } from "../smart-account/constants.js";
|
|
|
9
9
|
*
|
|
10
10
|
* The combined format is checked first. Error if both formats are present.
|
|
11
11
|
*/
|
|
12
|
-
/** Supported networks (Ampersend smart accounts only support Base) */
|
|
13
|
-
export const NETWORKS = ["base", "base-sepolia"];
|
|
14
12
|
/** Separator for AMPERSEND_AGENT_SECRET format */
|
|
15
13
|
const AGENT_SECRET_SEPARATOR = ":::";
|
|
16
14
|
/**
|
|
@@ -46,7 +44,6 @@ const configSchema = z.object({
|
|
|
46
44
|
message: "VALIDATOR_ADDRESS must start with 0x",
|
|
47
45
|
})
|
|
48
46
|
.default(OWNABLE_VALIDATOR),
|
|
49
|
-
NETWORK: z.enum(NETWORKS).default("base"),
|
|
50
47
|
API_URL: z.string().url().optional(),
|
|
51
48
|
});
|
|
52
49
|
/**
|
|
@@ -91,7 +88,6 @@ export function parseEnvConfig() {
|
|
|
91
88
|
AGENT_ACCOUNT: account,
|
|
92
89
|
AGENT_KEY: key,
|
|
93
90
|
VALIDATOR_ADDRESS: process.env.AMPERSEND_VALIDATOR_ADDRESS,
|
|
94
|
-
NETWORK: process.env.AMPERSEND_NETWORK,
|
|
95
91
|
API_URL: process.env.AMPERSEND_API_URL,
|
|
96
92
|
});
|
|
97
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/ampersend/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAEjE;;;;;;;;GAQG;AAEH,
|
|
1
|
+
{"version":3,"file":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ACpD,CAAA;IACH,CAAC;IAED,4BAA4B;IAC5B,OAAO,YAAY,CAAC,KAAK,CAAC;QACxB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,GAAG;QACd,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B;QAC1D,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;KACvC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./types.ts";
|
|
2
|
+
export * from "./curated-agent.ts";
|
|
2
3
|
export { ApiClient } from "./client.ts";
|
|
3
4
|
export { AgentInitData, AgentResponse, AmpersendManagementClient, type SpendConfig, type CreateAgentOptions, } from "./management.ts";
|
|
4
5
|
export { ApprovalClient, type ApprovalClientOptions } from "./approval.ts";
|
|
6
|
+
export { MarketplaceClient, type MarketplaceClientOptions, type ListMarketplaceAgentsFilters } from "./marketplace.ts";
|
|
5
7
|
export { AmpersendTreasurer, createAmpersendTreasurer, type AmpersendTreasurerConfig, type SimpleAmpersendTreasurerConfig, type FullAmpersendTreasurerConfig, } from "./treasurer.ts";
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ampersend/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,GAClC,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ampersend/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AACtH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,GAClC,MAAM,gBAAgB,CAAA"}
|
package/dist/ampersend/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
|
+
export * from "./curated-agent.js";
|
|
2
3
|
export { ApiClient } from "./client.js";
|
|
3
4
|
export { AgentInitData, AgentResponse, AmpersendManagementClient, } from "./management.js";
|
|
4
5
|
export { ApprovalClient } from "./approval.js";
|
|
6
|
+
export { MarketplaceClient } from "./marketplace.js";
|
|
5
7
|
export { AmpersendTreasurer, createAmpersendTreasurer, } from "./treasurer.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ampersend/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,aAAa,EACb,aAAa,EACb,yBAAyB,GAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAA;AAC1E,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GAIzB,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ampersend/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,aAAa,EACb,aAAa,EACb,yBAAyB,GAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,cAAc,EAA8B,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAoE,MAAM,kBAAkB,CAAA;AACtH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GAIzB,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CuratedAgentDTO, type CuratedAgentSource } from "./curated-agent.js";
|
|
2
|
+
export interface MarketplaceClientOptions {
|
|
3
|
+
apiUrl?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ListMarketplaceAgentsFilters {
|
|
7
|
+
source?: CuratedAgentSource;
|
|
8
|
+
category?: string;
|
|
9
|
+
search?: string;
|
|
10
|
+
network?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Client for the agent marketplace API.
|
|
14
|
+
*
|
|
15
|
+
* Reads from the unauthenticated `/api/v1/agents/marketplace` endpoints
|
|
16
|
+
* to discover curated agents, their endpoints, and their skills.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { MarketplaceClient } from "@ampersend_ai/ampersend-sdk/ampersend"
|
|
21
|
+
*
|
|
22
|
+
* const client = new MarketplaceClient()
|
|
23
|
+
*
|
|
24
|
+
* const agents = await client.listAgents({ source: "catalog" })
|
|
25
|
+
* const agent = await client.getAgent(agents[0].id)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class MarketplaceClient {
|
|
29
|
+
private baseUrl;
|
|
30
|
+
private timeout;
|
|
31
|
+
constructor(options?: MarketplaceClientOptions);
|
|
32
|
+
/**
|
|
33
|
+
* List curated agents in the marketplace.
|
|
34
|
+
*
|
|
35
|
+
* Filters are optional and combine on the server side. `search` performs a
|
|
36
|
+
* fuzzy match across name, description, tags, and category.
|
|
37
|
+
*/
|
|
38
|
+
listAgents(filters?: ListMarketplaceAgentsFilters): Promise<ReadonlyArray<CuratedAgentDTO>>;
|
|
39
|
+
/**
|
|
40
|
+
* Get a single curated agent by its id.
|
|
41
|
+
*
|
|
42
|
+
* @throws ApiError with status 404 if the agent is not found.
|
|
43
|
+
*/
|
|
44
|
+
getAgent(id: string): Promise<CuratedAgentDTO>;
|
|
45
|
+
private fetch;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=marketplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/ampersend/marketplace.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAK9G,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAQ;gBAEX,OAAO,GAAE,wBAA6B;IAKlD;;;;;OAKG;IACG,UAAU,CAAC,OAAO,GAAE,4BAAiC,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAYrG;;;;OAIG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;YAItC,KAAK;CAkCpB"}
|