@shipers-dev/dayline 0.100.0 → 0.105.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.
package/README.md CHANGED
@@ -1,39 +1,15 @@
1
1
  # @shipers-dev/dayline
2
2
 
3
- CLI daemon (`dayline`) that pairs a device with a Multi workspace and runs assigned issues via ACP / acpx adapters.
3
+ The `dayline` CLI and daemon. This package is a shim: `bin/dayline.js` execs
4
+ the prebuilt Rust binary for the host platform, which arrives through the
5
+ `@shipers-dev/dayline-<platform>` optional dependency.
4
6
 
5
- ## Install
7
+ npm i -g @shipers-dev/dayline
8
+ dayline setup
9
+ dayline service install
6
10
 
7
- ```bash
8
- bun add -g @shipers-dev/dayline
9
- # or
10
- npm i -g @shipers-dev/dayline
11
- ```
11
+ Set `DAYLINE_BIN` to run a binary you built yourself
12
+ (`cargo build --release -p dayline-cli`).
12
13
 
13
- ## Quick start
14
-
15
- ```bash
16
- dayline setup # pair the device against prod
17
- dayline start # foreground daemon
18
- dayline start -d # detached
19
- dayline status
20
- dayline logs
21
- ```
22
-
23
- ## Pointing at a local API worker
24
-
25
- For local development against a wrangler-dev API worker, set `MULTI_API` to its base URL:
26
-
27
- ```bash
28
- MULTI_API=http://localhost:8787 dayline setup
29
- MULTI_API=http://localhost:8787 dayline start
30
- ```
31
-
32
- The resolved API base URL is printed at start. `MULTI_API_URL` is still accepted as a fallback alias. CLI flag `--api <url>` overrides both.
33
-
34
- ## Common env vars
35
-
36
- | Var | Purpose |
37
- | --- | --- |
38
- | `MULTI_API` | API base URL (default `https://multi-api.adnb3r.workers.dev`) |
39
- | `MULTI_MAX_CONCURRENT` | Max concurrent tasks per device (default 3) |
14
+ Source and documentation: `crates/dayline-cli`. Staged for publish by
15
+ `scripts/build-cli.sh`.
package/bin/dayline.js ADDED
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ // The npm distribution shim. Everything `dayline` does lives in the Rust
3
+ // binary; this file exists only because npm is how the CLI reaches machines,
4
+ // and npm installs JavaScript.
5
+ //
6
+ // The binary rides in per-platform packages listed under optionalDependencies,
7
+ // each with `os`/`cpu` fields, so an install resolves exactly the matching one
8
+ // and skips the rest — the same shape the chat-peer sidecar already ships in.
9
+ // Never a postinstall compile: the machines this exists for are precisely the
10
+ // ones with no Rust toolchain.
11
+ "use strict";
12
+
13
+ const { spawnSync } = require("child_process");
14
+ const { createRequire } = require("module");
15
+ const { existsSync } = require("fs");
16
+ const { dirname, join } = require("path");
17
+
18
+ // The platforms this release actually publishes a binary for. Keep in sync
19
+ // with the optionalDependencies block in this package's package.json — the two
20
+ // ship together, so they can never disagree.
21
+ //
22
+ // scripts/build-cli.sh knows how to build five targets; only these two are
23
+ // published, because they are the only ones that can be built without a cross
24
+ // toolchain. Listing a platform whose package does not exist is worse than
25
+ // omitting it: npm skips the failed optional dependency and the user is told
26
+ // their install is broken, when in truth it was never published.
27
+ const TARGETS = new Set(["darwin-arm64", "darwin-x64"]);
28
+
29
+ const BIN = process.platform === "win32" ? "dayline.exe" : "dayline";
30
+
31
+ function resolveBinary() {
32
+ const override = process.env.DAYLINE_BIN;
33
+ if (override) return existsSync(override) ? override : null;
34
+
35
+ const target = `${process.platform}-${process.arch}`;
36
+ if (!TARGETS.has(target)) return null;
37
+ try {
38
+ // The package's entry is the binary itself, not a module — resolve its
39
+ // package.json and walk to the file, so this works however the installer
40
+ // hoisted it.
41
+ const manifest = createRequire(__filename).resolve(
42
+ `@shipers-dev/dayline-${target}/package.json`,
43
+ );
44
+ const candidate = join(dirname(manifest), "bin", BIN);
45
+ return existsSync(candidate) ? candidate : null;
46
+ } catch {
47
+ return null;
48
+ }
49
+ }
50
+
51
+ const bin = resolveBinary();
52
+ if (!bin) {
53
+ const target = `${process.platform}-${process.arch}`;
54
+ process.stderr.write(
55
+ `dayline: no prebuilt binary for ${target}.\n` +
56
+ (TARGETS.has(target)
57
+ ? "The platform package failed to install. Re-run the install without --no-optional,\n" +
58
+ "or point DAYLINE_BIN at a binary you built yourself (cargo build -p dayline-cli).\n"
59
+ : "This platform is not published yet. Build from source with `cargo build --release -p dayline-cli`\n" +
60
+ "and set DAYLINE_BIN to the resulting binary.\n"),
61
+ );
62
+ process.exit(1);
63
+ }
64
+
65
+ // stdio: inherit — the daemon streams logs, `connect` runs in the foreground,
66
+ // and some commands read a TTY. Nothing may be buffered through this process.
67
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
68
+ if (result.error) {
69
+ process.stderr.write(`dayline: failed to run ${bin}: ${result.error.message}\n`);
70
+ process.exit(1);
71
+ }
72
+ // A signalled child is reported as a signal, not as exit 0 — otherwise a
73
+ // SIGTERM'd daemon looks like a clean shutdown to whatever supervises npx.
74
+ if (result.signal) {
75
+ process.kill(process.pid, result.signal);
76
+ process.exit(1);
77
+ }
78
+ process.exit(result.status === null ? 1 : result.status);
package/package.json CHANGED
@@ -1,36 +1,22 @@
1
1
  {
2
2
  "name": "@shipers-dev/dayline",
3
- "version": "0.100.0",
4
- "type": "module",
3
+ "version": "0.105.0",
4
+ "description": "Run coding agents on your machine, driven from anywhere.",
5
+ "license": "UNLICENSED",
5
6
  "bin": {
6
- "dayline": "./dist/index.js"
7
+ "dayline": "./bin/dayline.js"
7
8
  },
8
9
  "files": [
9
- "dist"
10
+ "bin"
10
11
  ],
11
- "scripts": {
12
- "dev": "DAYLINE_HOME=${DAYLINE_HOME:-$HOME/.dayline-dev} MULTI_API=${MULTI_API:-http://127.0.0.1:8787} bun run src/index.ts connect",
13
- "build": "bun build src/index.ts --outdir=dist --target=node --sourcemap=none --external loro-crdt",
14
- "test": "bun test",
15
- "prepublishOnly": "bun run build",
16
- "publish:npm": "npm publish --access public"
12
+ "optionalDependencies": {
13
+ "@shipers-dev/dayline-darwin-arm64": "0.105.0",
14
+ "@shipers-dev/dayline-darwin-x64": "0.105.0"
17
15
  },
18
16
  "dependencies": {
19
- "@agentclientprotocol/claude-agent-acp": "0.65.0",
20
- "@agentclientprotocol/sdk": "1.3.0",
21
- "effect": "^3.22.1",
22
- "jsonc-parser": "^3.3.1",
23
- "loro-crdt": "^1.13.9",
24
- "zod": "^4.4.3"
25
- },
26
- "devDependencies": {
27
- "@multi/lib": "workspace:*"
17
+ "@agentclientprotocol/claude-agent-acp": "0.65.0"
28
18
  },
29
- "optionalDependencies": {
30
- "@shipers-dev/dayline-chat-peer-darwin-arm64": "0.1.0",
31
- "@shipers-dev/dayline-chat-peer-darwin-x64": "0.1.0",
32
- "@shipers-dev/dayline-chat-peer-linux-x64": "0.1.0",
33
- "@shipers-dev/dayline-chat-peer-linux-arm64": "0.1.0",
34
- "@shipers-dev/dayline-chat-peer-win32-x64": "0.1.0"
35
- }
19
+ "os": [
20
+ "darwin"
21
+ ]
36
22
  }