@okxweb3/a2a-node 0.0.1-beta-38940d220c-260602175146

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.
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
6
+ if ! command -v npm >/dev/null 2>&1; then
7
+ echo "npm is required to install okx-a2a globally." >&2
8
+ exit 1
9
+ fi
10
+
11
+ TARGET="${1:-}"
12
+ PACK_TMP=""
13
+
14
+ pack_source_dir() {
15
+ local source_dir="$1"
16
+ PACK_TMP="$(mktemp -d "${TMPDIR:-/tmp}/okx-a2a-pack.XXXXXX")"
17
+ npm --prefix "$source_dir" run build
18
+ local pack_output
19
+ pack_output="$(npm pack "$source_dir" --pack-destination "$PACK_TMP")"
20
+ local tarball_name
21
+ tarball_name="$(printf '%s\n' "$pack_output" | awk 'NF { last=$0 } END { print last }')"
22
+ if [[ -z "$tarball_name" || "$tarball_name" != *.tgz ]]; then
23
+ echo "Unable to detect npm pack tarball from output: $pack_output" >&2
24
+ exit 1
25
+ fi
26
+ TARGET="$PACK_TMP/$tarball_name"
27
+ }
28
+
29
+ install_runtime_deps() {
30
+ local package_dir="$1"
31
+ npm --prefix "$package_dir" install --omit=dev
32
+ TARGET="$package_dir"
33
+ }
34
+
35
+ if [[ -z "$TARGET" ]]; then
36
+ if [[ -f "$SCRIPT_DIR/scripts/build.mjs" ]]; then
37
+ pack_source_dir "$SCRIPT_DIR"
38
+ elif [[ -f "$SCRIPT_DIR/package.json" ]]; then
39
+ install_runtime_deps "$SCRIPT_DIR"
40
+ else
41
+ echo "No package.json found next to install.sh" >&2
42
+ exit 1
43
+ fi
44
+ elif [[ -d "$TARGET" && -f "$TARGET/scripts/build.mjs" ]]; then
45
+ pack_source_dir "$TARGET"
46
+ elif [[ -d "$TARGET" && -f "$TARGET/package.json" ]]; then
47
+ install_runtime_deps "$TARGET"
48
+ fi
49
+
50
+ npm install -g "$TARGET"
51
+
52
+ if ! command -v okx-a2a >/dev/null 2>&1; then
53
+ global_prefix="$(npm prefix -g 2>/dev/null || true)"
54
+ echo "okx-a2a was installed, but it is not on PATH." >&2
55
+ if [[ -n "$global_prefix" ]]; then
56
+ echo "Add this directory to PATH: $global_prefix/bin" >&2
57
+ fi
58
+ exit 1
59
+ fi
60
+
61
+ echo "okx-a2a installed: $(command -v okx-a2a)"
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@okxweb3/a2a-node",
3
+ "version": "0.0.1-beta-38940d220c-260602175146",
4
+ "description": "Host-agnostic Node CLI for E2E encrypted agent-to-agent communication via XMTP",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "okx-a2a": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "engines": {
13
+ "node": ">=22.13.0"
14
+ },
15
+ "scripts": {
16
+ "build": "node scripts/build.mjs",
17
+ "pack": "node scripts/pack.mjs",
18
+ "typecheck": "tsc --noEmit",
19
+ "test": "node --test test/*.test.mjs"
20
+ },
21
+ "keywords": [
22
+ "xmtp",
23
+ "a2a",
24
+ "onchainos",
25
+ "agent-task"
26
+ ],
27
+ "license": "SEE LICENSE IN LICENSE",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "dependencies": {
32
+ "@xmtp/agent-sdk": "0.0.7",
33
+ "@xmtp/content-type-remote-attachment": "2.0.4",
34
+ "@xmtp/node-bindings": "1.6.8",
35
+ "@xmtp/proto": "3.78.0",
36
+ "viem": "2.48.4"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "25.6.0",
40
+ "esbuild": "0.28.0",
41
+ "typescript": "5.9.3"
42
+ }
43
+ }