@aixyz/config 0.2.0 → 0.4.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.
Files changed (2) hide show
  1. package/index.ts +58 -4
  2. package/package.json +5 -10
package/index.ts CHANGED
@@ -5,12 +5,23 @@ import { z } from "zod";
5
5
  export type Network = `${string}:${string}`;
6
6
 
7
7
  export type AixyzConfig = {
8
+ /**
9
+ * The name of the agent will be used in the agent card.
10
+ */
8
11
  name: string;
12
+ /**
13
+ * A short description of the agent.
14
+ * This will be used in the agent card.
15
+ */
9
16
  description: string;
10
17
  /**
11
18
  * Version of the agent.
12
19
  */
13
20
  version: string;
21
+ /**
22
+ * The URL of the agent, required for canonical urls.
23
+ * Defaults to `process.env.VERCEL_URL` for Vercel deployments.
24
+ */
14
25
  url?: string;
15
26
  x402: {
16
27
  /**
@@ -24,7 +35,16 @@ export type AixyzConfig = {
24
35
  */
25
36
  network: string;
26
37
  };
27
- skills?: GetAixyzConfig["skills"];
38
+ build?: {
39
+ /**
40
+ * Output format for `aixyz build`.
41
+ * - `"standalone"`: Bundles into a single executable file (default).
42
+ * - `"vercel"`: Generates Vercel Build Output API v3 structure.
43
+ * Overrides the `VERCEL=1` environment variable, but is overridden by the `--output` CLI flag.
44
+ */
45
+ output?: "standalone" | "vercel";
46
+ };
47
+ skills?: InferredAixyzConfig["skills"];
28
48
  };
29
49
 
30
50
  const NetworkSchema = z.custom<Network>((val) => {
@@ -57,6 +77,11 @@ const AixyzConfigSchema = z.object({
57
77
  payTo: z.string(),
58
78
  network: NetworkSchema,
59
79
  }),
80
+ build: z
81
+ .object({
82
+ output: z.enum(["standalone", "vercel"]).optional(),
83
+ })
84
+ .optional(),
60
85
  skills: z
61
86
  .array(
62
87
  z.object({
@@ -73,12 +98,22 @@ const AixyzConfigSchema = z.object({
73
98
  .default([]),
74
99
  });
75
100
 
101
+ type InferredAixyzConfig = z.infer<typeof AixyzConfigSchema>;
102
+
76
103
  /**
104
+ * Subset of `AixyzConfig` that is expose and materialized at runtime.
105
+ *
77
106
  * This is the materialized config object that is cached for performance.
78
107
  * It is the result of parsing and validating the user's `aixyz.config.ts` file,
79
108
  * with environment variables loaded and applied.
80
109
  */
81
- export type GetAixyzConfig = z.infer<typeof AixyzConfigSchema>;
110
+ export type AixyzConfigRuntime = {
111
+ name: AixyzConfig["name"];
112
+ description: AixyzConfig["description"];
113
+ version: AixyzConfig["version"];
114
+ url: AixyzConfig["url"];
115
+ skills: NonNullable<AixyzConfig["skills"]>;
116
+ };
82
117
 
83
118
  /**
84
119
  * Environment variables are looked up in the following places, in order, stopping once the variable is found.
@@ -93,8 +128,11 @@ export type GetAixyzConfig = z.infer<typeof AixyzConfigSchema>;
93
128
  *
94
129
  * In production:
95
130
  * This is a materialized config object that is cached for performance.
131
+ *
132
+ * @deprecated Use `getAixyzConfigRuntime()` instead, which is designed for runtime use.
133
+ * This will be deprecated in the next major version—when we materialize the config for downstream.
96
134
  */
97
- export function getAixyzConfig(): GetAixyzConfig {
135
+ export function getAixyzConfig(): InferredAixyzConfig {
98
136
  const cwd = process.cwd();
99
137
  const configPath = resolve(cwd, "aixyz.config.ts");
100
138
  const mod = require(configPath);
@@ -109,5 +147,21 @@ export function getAixyzConfig(): GetAixyzConfig {
109
147
  throw new Error(`aixyz.config.ts: ${parsedConfig.error}`);
110
148
  }
111
149
 
112
- return parsedConfig.data as GetAixyzConfig;
150
+ return parsedConfig.data as InferredAixyzConfig;
151
+ }
152
+
153
+ /**
154
+ * Returns the subset of `aixyz.config.ts` that is safe to expose at runtime.
155
+ * Unlike `getAixyzConfig()`, which is intended for the build/CLI phase only,
156
+ * this function is designed to be available in the deployed runtime bundle.
157
+ */
158
+ export function getAixyzConfigRuntime(): AixyzConfigRuntime {
159
+ const config = getAixyzConfig();
160
+ return {
161
+ name: config.name,
162
+ description: config.description,
163
+ version: config.version,
164
+ url: config.url,
165
+ skills: config.skills,
166
+ };
113
167
  }
package/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "@aixyz/config",
3
- "version": "0.2.0",
4
- "description": "",
3
+ "version": "0.4.2",
4
+ "description": "Payment-native SDK for AI Agent",
5
5
  "keywords": [
6
6
  "ai",
7
+ "payments",
7
8
  "agent",
8
- "a2a",
9
- "mcp",
10
- "x402",
11
- "erc-8004",
12
- "framework"
9
+ "aixyz"
13
10
  ],
14
11
  "homepage": "https://ai-xyz.dev",
15
- "bugs": {
16
- "url": "https://github.com/AgentlyHQ/aixyz/issues"
17
- },
12
+ "bugs": "https://github.com/AgentlyHQ/aixyz/issues",
18
13
  "repository": {
19
14
  "type": "git",
20
15
  "url": "git+https://github.com/AgentlyHQ/aixyz.git"