@awebai/aw 1.35.1 → 1.36.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/bin/aw-gc-mail +51 -0
  2. package/package.json +9 -8
package/bin/aw-gc-mail ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // Launcher for Gas City's exec mail provider: `GC_MAIL=exec:aw-gc-mail`.
4
+ //
5
+ // Gas City's exec: value is ONE command with no arguments — it is passed
6
+ // straight to exec.Command with the operation as argv[1] and nothing is split
7
+ // on whitespace (gascity internal/mail/exec/exec.go, cmd/gc/providers.go). So
8
+ // `exec:aw gc-mail` would look for a program literally named "aw gc-mail".
9
+ // This launcher is that single command; it runs `aw gc-mail <args...>` against
10
+ // the exact binary shipped in this package, so the provider can never skew
11
+ // from the CLI that installed it.
12
+ //
13
+ // stdio is inherited because the protocol is JSON on stdin/stdout and gc reads
14
+ // our exit code: 1 is a real failure, and 2 means "unknown operation" to gc,
15
+ // so the child's status must reach gc unchanged.
16
+ const { execFileSync } = require("child_process");
17
+ const os = require("os");
18
+
19
+ const PLATFORMS = {
20
+ "linux x64": { pkg: "@awebai/aw-linux-x64", bin: "bin/aw" },
21
+ "linux arm64": { pkg: "@awebai/aw-linux-arm64", bin: "bin/aw" },
22
+ "darwin x64": { pkg: "@awebai/aw-darwin-x64", bin: "bin/aw" },
23
+ "darwin arm64": { pkg: "@awebai/aw-darwin-arm64", bin: "bin/aw" },
24
+ "win32 x64": { pkg: "@awebai/aw-windows-x64", bin: "bin/aw.exe" },
25
+ "win32 arm64": { pkg: "@awebai/aw-windows-arm64", bin: "bin/aw.exe" },
26
+ };
27
+
28
+ const key = `${process.platform} ${os.arch()}`;
29
+ const platform = PLATFORMS[key];
30
+ if (!platform) {
31
+ console.error(`Error: Unsupported platform: ${key}`);
32
+ console.error("Visit https://github.com/awebai/aw for installation alternatives.");
33
+ process.exit(1);
34
+ }
35
+
36
+ let binPath;
37
+ try {
38
+ binPath = require.resolve(`${platform.pkg}/${platform.bin}`);
39
+ } catch {
40
+ console.error(`Error: Could not find the aw binary for ${key}.`);
41
+ console.error("The platform-specific package may not have been installed.");
42
+ console.error("Try: npm install @awebai/aw --force");
43
+ process.exit(1);
44
+ }
45
+
46
+ try {
47
+ execFileSync(binPath, ["gc-mail", ...process.argv.slice(2)], { stdio: "inherit" });
48
+ } catch (e) {
49
+ if (e.status !== null && e.status !== undefined) process.exit(e.status);
50
+ throw e;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/aw",
3
- "version": "1.35.1",
3
+ "version": "1.36.0",
4
4
  "description": "CLI for the aWeb agent coordination protocol",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,8 @@
9
9
  "license": "MIT",
10
10
  "bin": {
11
11
  "aw": "bin/aw",
12
- "aweb-a2a-gw": "bin/aweb-a2a-gw"
12
+ "aweb-a2a-gw": "bin/aweb-a2a-gw",
13
+ "aw-gc-mail": "bin/aw-gc-mail"
13
14
  },
14
15
  "scripts": {
15
16
  "postinstall": "node install.js"
@@ -19,11 +20,11 @@
19
20
  },
20
21
  "preferUnplugged": true,
21
22
  "optionalDependencies": {
22
- "@awebai/aw-linux-x64": "1.35.1",
23
- "@awebai/aw-linux-arm64": "1.35.1",
24
- "@awebai/aw-darwin-x64": "1.35.1",
25
- "@awebai/aw-darwin-arm64": "1.35.1",
26
- "@awebai/aw-windows-x64": "1.35.1",
27
- "@awebai/aw-windows-arm64": "1.35.1"
23
+ "@awebai/aw-linux-x64": "1.36.0",
24
+ "@awebai/aw-linux-arm64": "1.36.0",
25
+ "@awebai/aw-darwin-x64": "1.36.0",
26
+ "@awebai/aw-darwin-arm64": "1.36.0",
27
+ "@awebai/aw-windows-x64": "1.36.0",
28
+ "@awebai/aw-windows-arm64": "1.36.0"
28
29
  }
29
30
  }