agentdeckd 0.0.0-dev

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/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # agentdeckd
2
+
3
+ Run and manage local ACP agents from [AgentDeck](https://github.com/mantou132/AgentDeck) on your phone or browser.
4
+
5
+ Requires Node.js 22 or newer. Supports macOS arm64/x64, Linux x64 with glibc, and Windows x64. Linux arm64 and Alpine/musl are not included.
6
+
7
+ ```sh
8
+ npm install -g agentdeckd
9
+ agentdeckd start
10
+ ```
11
+
12
+ Paste the Pairing ID into AgentDeck's Settings. Keep it secret: anyone with it can access your agent.
13
+
14
+ The matching precompiled binary is installed as an optional dependency. No Rust toolchain, postinstall script, or GitHub download is needed. Do not omit optional dependencies.
15
+
16
+ ## Upgrade and uninstall
17
+
18
+ Stop before upgrading, particularly on Windows where the running executable cannot be replaced:
19
+
20
+ ```sh
21
+ agentdeckd stop
22
+ npm install -g agentdeckd@latest
23
+ agentdeckd start
24
+ ```
25
+
26
+ Autostart uses the binary's absolute path. After changing your Node installation or npm prefix, run the newly installed `agentdeckd restart` to register the new path and restart the daemon. Installation itself does not start or restart services.
27
+
28
+ Before uninstalling:
29
+
30
+ ```sh
31
+ agentdeckd stop
32
+ npm uninstall -g agentdeckd
33
+ ```
34
+
35
+ Use `agentdeckd --help` for commands and options.
package/cli.mjs ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'node:child_process';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { currentPlatform } from './platforms.mjs';
5
+
6
+ try {
7
+ const platform = currentPlatform();
8
+ const packageName = `agentdeckd-${platform.suffix}`;
9
+ const executable = platform.os === 'win32' ? 'agentdeckd.exe' : 'agentdeckd';
10
+ let binary;
11
+ try {
12
+ binary = fileURLToPath(import.meta.resolve(`${packageName}/bin/${executable}`));
13
+ } catch (error) {
14
+ if (error.code !== 'ERR_MODULE_NOT_FOUND') throw error;
15
+ throw new Error(`Missing ${packageName}. Reinstall with: npm install -g agentdeckd --include=optional`);
16
+ }
17
+
18
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
19
+ const handlers = new Map();
20
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
21
+ const handler = () => child.kill(signal);
22
+ handlers.set(signal, handler);
23
+ process.on(signal, handler);
24
+ }
25
+ child.on('error', (error) => {
26
+ console.error(`agentdeckd: ${error.message}`);
27
+ process.exitCode = 1;
28
+ });
29
+ child.on('exit', (code, signal) => {
30
+ for (const [name, handler] of handlers) process.removeListener(name, handler);
31
+ if (signal) process.kill(process.pid, signal);
32
+ else process.exitCode = code;
33
+ });
34
+ } catch (error) {
35
+ console.error(`agentdeckd: ${error.message}`);
36
+ process.exitCode = 1;
37
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "version": "0.0.0-dev",
3
+ "license": "MIT",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/mantou132/AgentDeck.git",
7
+ "directory": "crates/daemon/npm"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "registry": "https://registry.npmjs.org/"
12
+ },
13
+ "name": "agentdeckd",
14
+ "description": "Run and manage local ACP agents from AgentDeck on your phone or browser",
15
+ "bin": {
16
+ "agentdeckd": "cli.mjs"
17
+ },
18
+ "engines": {
19
+ "node": ">=22"
20
+ },
21
+ "files": [
22
+ "cli.mjs",
23
+ "platforms.mjs"
24
+ ],
25
+ "optionalDependencies": {
26
+ "agentdeckd-darwin-arm64": "0.0.0-dev",
27
+ "agentdeckd-darwin-x64": "0.0.0-dev",
28
+ "agentdeckd-linux-x64-gnu": "0.0.0-dev",
29
+ "agentdeckd-win32-x64": "0.0.0-dev"
30
+ }
31
+ }
package/platforms.mjs ADDED
@@ -0,0 +1,14 @@
1
+ export const platforms = [
2
+ { suffix: 'darwin-arm64', os: 'darwin', cpu: 'arm64', target: 'aarch64-apple-darwin' },
3
+ { suffix: 'darwin-x64', os: 'darwin', cpu: 'x64', target: 'x86_64-apple-darwin' },
4
+ { suffix: 'linux-x64-gnu', os: 'linux', cpu: 'x64', libc: 'glibc', target: 'x86_64-unknown-linux-gnu' },
5
+ { suffix: 'win32-x64', os: 'win32', cpu: 'x64', target: 'x86_64-pc-windows-msvc' },
6
+ ];
7
+
8
+ export function currentPlatform() {
9
+ const platform = platforms.find(({ os, cpu }) => os === process.platform && cpu === process.arch);
10
+ if (!platform || (platform.libc && !process.report.getReport().header.glibcVersionRuntime)) {
11
+ throw new Error(`Unsupported platform: ${process.platform}/${process.arch}. Linux requires x64 with glibc.`);
12
+ }
13
+ return platform;
14
+ }