aixyz 0.6.0 → 0.8.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.
Files changed (2) hide show
  1. package/package.json +5 -4
  2. package/test.ts +29 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aixyz",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Payment-native SDK for AI Agent",
5
5
  "keywords": [
6
6
  "ai",
@@ -8,7 +8,7 @@
8
8
  "agent",
9
9
  "aixyz"
10
10
  ],
11
- "homepage": "https://ai-xyz.dev",
11
+ "homepage": "https://aixyz.sh",
12
12
  "bugs": "https://github.com/AgentlyHQ/aixyz/issues",
13
13
  "repository": {
14
14
  "type": "git",
@@ -23,9 +23,10 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@a2a-js/sdk": "^0.3.10",
26
- "@aixyz/cli": "0.6.0",
27
- "@aixyz/config": "0.6.0",
26
+ "@aixyz/cli": "0.8.0",
27
+ "@aixyz/config": "0.8.0",
28
28
  "@modelcontextprotocol/sdk": "^1.26.0",
29
+ "@next/env": "^16.1.6",
29
30
  "@x402/core": "^2.3.1",
30
31
  "@x402/evm": "^2.3.1",
31
32
  "@x402/express": "^2.3.0",
package/test.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { loadEnvConfig as loadEnvConfigNext } from "@next/env";
4
+
5
+ function findProjectRoot(from: string): string {
6
+ let dir = resolve(from);
7
+ while (true) {
8
+ if (existsSync(join(dir, "aixyz.config.ts"))) {
9
+ return dir;
10
+ }
11
+ const parent = dirname(dir);
12
+ if (parent === dir) {
13
+ return from;
14
+ }
15
+ dir = parent;
16
+ }
17
+ }
18
+
19
+ /**
20
+ * There is a small difference between test environment, and both development and production that you need to bear in
21
+ * mind: .env.local won't be loaded, as you expect tests to produce the same results for everyone. This way every test
22
+ * execution will use the same env defaults across different executions by ignoring your .env.local (which is intended
23
+ * to override the default set).
24
+ *
25
+ * You can use .env.test.local if you want to use local overrides for tests only.
26
+ */
27
+ export function loadEnv(cwd = process.cwd(), dev = true) {
28
+ loadEnvConfigNext(findProjectRoot(cwd), dev);
29
+ }