aixyz 0.11.0 → 0.12.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/accepts.ts CHANGED
@@ -34,5 +34,5 @@ export { HTTPFacilitatorClient };
34
34
  * The default facilitator client provided by aixyz.
35
35
  */
36
36
  export const facilitator: FacilitatorClient = new HTTPFacilitatorClient({
37
- url: "https://x402.agently.to/facilitator",
37
+ url: "https://x402.use-agently.com/facilitator",
38
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aixyz",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Payment-native SDK for AI Agent",
5
5
  "keywords": [
6
6
  "ai",
@@ -23,9 +23,9 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@a2a-js/sdk": "^0.3.10",
26
- "@aixyz/cli": "0.11.0",
27
- "@aixyz/config": "0.11.0",
28
- "@aixyz/erc-8004": "0.11.0",
26
+ "@aixyz/cli": "0.12.0",
27
+ "@aixyz/config": "0.12.0",
28
+ "@aixyz/erc-8004": "0.12.0",
29
29
  "@modelcontextprotocol/sdk": "^1.26.0",
30
30
  "@next/env": "^16.1.6",
31
31
  "@x402/core": "^2.3.1",
@@ -105,14 +105,14 @@ export class ToolLoopAgentExecutor<TOOLS extends ToolSet = ToolSet> implements A
105
105
  }
106
106
  }
107
107
 
108
- export function getAgentCard(): AgentCard {
108
+ export function getAgentCard(agentPath = "/agent"): AgentCard {
109
109
  const config = getAixyzConfigRuntime();
110
110
  return {
111
111
  name: config.name,
112
112
  description: config.description,
113
113
  protocolVersion: "0.3.0",
114
114
  version: config.version,
115
- url: new URL("/agent", config.url).toString(),
115
+ url: new URL(agentPath, config.url).toString(),
116
116
  capabilities: {
117
117
  streaming: true,
118
118
  pushNotifications: false,
@@ -129,6 +129,7 @@ export function useA2A<TOOLS extends ToolSet = ToolSet>(
129
129
  default: ToolLoopAgent<never, TOOLS>;
130
130
  accepts?: Accepts;
131
131
  },
132
+ prefix?: string,
132
133
  taskStore: TaskStore = new InMemoryTaskStore(),
133
134
  ): void {
134
135
  if (exports.accepts) {
@@ -140,22 +141,27 @@ export function useA2A<TOOLS extends ToolSet = ToolSet>(
140
141
  return;
141
142
  }
142
143
 
144
+ const agentPath: `/${string}` = prefix ? `/${prefix}/agent` : "/agent";
145
+ const wellKnownPath: `/${string}` = prefix
146
+ ? `/${prefix}/.well-known/agent-card.json`
147
+ : "/.well-known/agent-card.json";
148
+
143
149
  const agentExecutor = new ToolLoopAgentExecutor(exports.default);
144
- const requestHandler = new DefaultRequestHandler(getAgentCard(), taskStore, agentExecutor);
150
+ const requestHandler = new DefaultRequestHandler(getAgentCard(agentPath), taskStore, agentExecutor);
145
151
 
146
152
  app.express.use(
147
- "/.well-known/agent-card.json",
153
+ wellKnownPath,
148
154
  agentCardHandler({
149
155
  agentCardProvider: requestHandler,
150
156
  }),
151
157
  );
152
158
 
153
159
  if (exports.accepts.scheme === "exact") {
154
- app.withX402Exact("POST /agent", exports.accepts);
160
+ app.withX402Exact(`POST ${agentPath}`, exports.accepts);
155
161
  }
156
162
 
157
163
  app.express.use(
158
- "/agent",
164
+ agentPath,
159
165
  jsonRpcHandler({
160
166
  requestHandler,
161
167
  userBuilder: UserBuilder.noAuthentication,
@@ -12,16 +12,16 @@ export function getAgentRegistrationFile(
12
12
  data: unknown,
13
13
  options: {
14
14
  mcp: boolean;
15
- a2a: boolean;
15
+ a2a: string[];
16
16
  },
17
17
  ): StrictAgentRegistrationFile {
18
18
  const config = getAixyzConfigRuntime();
19
19
  const services: StrictAgentRegistrationFile["services"] = [];
20
20
 
21
- if (options.a2a) {
21
+ for (const path of options.a2a) {
22
22
  services.push({
23
23
  name: "A2A",
24
- endpoint: new URL("/.well-known/agent-card.json", config.url).toString(),
24
+ endpoint: new URL(path, config.url).toString(),
25
25
  version: "0.3.0",
26
26
  });
27
27
  }
@@ -53,7 +53,7 @@ export function useERC8004(
53
53
  default: unknown;
54
54
  options: {
55
55
  mcp: boolean;
56
- a2a: boolean;
56
+ a2a: string[];
57
57
  };
58
58
  },
59
59
  ): void {