@miadi/tide 0.1.2 → 0.1.4
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 +7 -8
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/socket.ts +6 -6
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# `@miadi/tide`
|
|
2
2
|
|
|
3
|
-
Typed client boundary between Miadi and the **ironsilk `tide`** runtime
|
|
4
|
-
`hermes-navigator`). The single place the web app talks to `tide` — replacing the per-route
|
|
3
|
+
Typed client boundary between Miadi and the **ironsilk `tide`** runtime. The single place the web app talks to `tide` — replacing the per-route
|
|
5
4
|
`exec("/home/jgi/anaconda3/bin/tide …")` calls.
|
|
6
5
|
|
|
7
6
|
Grounded in `foundations/terminal-workspace-orchestration/` (Decision C) and
|
|
@@ -11,11 +10,11 @@ Grounded in `foundations/terminal-workspace-orchestration/` (Decision C) and
|
|
|
11
10
|
|
|
12
11
|
This package is a **client**; it does not bundle the runtime. The `tide` CLI is the
|
|
13
12
|
console entry point of the **`ironsilk`** PyPI package (`[project.scripts]`
|
|
14
|
-
`tide =
|
|
13
|
+
`tide = tide_runtime.cli:main`). Install / upgrade it in the Python env the
|
|
15
14
|
Next.js server can reach:
|
|
16
15
|
|
|
17
16
|
```bash
|
|
18
|
-
pip install -U ironsilk # provides the `tide` CLI (
|
|
17
|
+
pip install -U ironsilk # provides the `tide` CLI (0.9.27+)
|
|
19
18
|
tide --help # verify
|
|
20
19
|
```
|
|
21
20
|
|
|
@@ -66,7 +65,7 @@ is deferred to the runtime + a guarded route.
|
|
|
66
65
|
| Layer | Status |
|
|
67
66
|
|---|---|
|
|
68
67
|
| One-shot CLI (`tide … --format json`, `execFile` arg-arrays, no shell) | **implemented** |
|
|
69
|
-
| Daemon + Unix-domain-socket transport (`
|
|
68
|
+
| Daemon + Unix-domain-socket transport (`miadi.tide.daemon.v2`) | **implemented** (`src/socket.ts`) |
|
|
70
69
|
| Schema-first contract (`tide-api.schema.json` → generated types) | planned |
|
|
71
70
|
|
|
72
71
|
### How transport selection works
|
|
@@ -83,15 +82,15 @@ is deferred to the runtime + a guarded route.
|
|
|
83
82
|
`detect`, not the operator mutation verbs. `sendKeys` is independent of both — it talks to `tmux` directly. They join the socket path when the runtime adds those
|
|
84
83
|
actions — verb signatures are the stable surface; only the transport underneath changes.
|
|
85
84
|
|
|
86
|
-
### Wire protocol (mirrors `
|
|
85
|
+
### Wire protocol (mirrors `tide_runtime/daemon.py`)
|
|
87
86
|
|
|
88
87
|
Newline-delimited JSON over a Unix socket. Request
|
|
89
|
-
`{contract_version:"
|
|
88
|
+
`{contract_version:"miadi.tide.daemon.v2", request_id, action, payload}` →
|
|
90
89
|
`{contract_version, request_id, ok:true, data}` (or `ok:false, error:{code,message,retryable}}`).
|
|
91
90
|
|
|
92
91
|
### Socket path resolution
|
|
93
92
|
|
|
94
|
-
`TIDE_SOCKET` (explicit) → `${
|
|
93
|
+
`TIDE_SOCKET` (explicit) → `${MIADI_HOME || ~/.miadi/navigator}/daemon.sock`
|
|
95
94
|
(mirrors the runtime's `get_config_dir()`). Binary resolution for the CLI fallback:
|
|
96
95
|
`TIDE_BIN` → `which tide` → legacy `/home/jgi/anaconda3/bin/tide`.
|
|
97
96
|
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Two transports behind one verb surface:
|
|
4
4
|
// • DAEMON — newline-delimited JSON over the `tide daemon` Unix socket
|
|
5
|
-
// (
|
|
5
|
+
// (miadi.tide.daemon.v2). Preferred for `getContext` when up.
|
|
6
6
|
// • CLI — one-shot `tide <verb> --format json` via `execFile` with ARGUMENT
|
|
7
7
|
// ARRAYS (no shell). Always the fallback; the only path for the
|
|
8
8
|
// operator verbs (`peek`/`steerProposal`/`send`), which the daemon
|
package/src/socket.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// versioned Unix-domain-socket protocol so the web layer can read live context
|
|
3
3
|
// without paying a Python interpreter spawn per request.
|
|
4
4
|
//
|
|
5
|
-
// Wire protocol (mirrors
|
|
6
|
-
// contract: "
|
|
5
|
+
// Wire protocol (mirrors tide_runtime/daemon.py):
|
|
6
|
+
// contract: "miadi.tide.daemon.v2"
|
|
7
7
|
// transport: newline-delimited JSON over a Unix domain socket
|
|
8
8
|
// request: {contract_version, request_id, action, payload}
|
|
9
9
|
// response: {contract_version, request_id, ok, data} (success)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
//
|
|
13
13
|
// Socket path resolution mirrors the runtime's get_config_dir():
|
|
14
14
|
// TIDE_SOCKET (explicit full path)
|
|
15
|
-
// else ${
|
|
15
|
+
// else ${MIADI_HOME || ~/.miadi/navigator}/daemon.sock
|
|
16
16
|
//
|
|
17
17
|
// This module never throws synchronously for "daemon absent" — callers test
|
|
18
18
|
// `isSocketAvailable()` and fall back to the CLI transport (see client.ts).
|
|
@@ -23,7 +23,7 @@ import { statSync } from "node:fs"
|
|
|
23
23
|
import { homedir } from "node:os"
|
|
24
24
|
import { join } from "node:path"
|
|
25
25
|
|
|
26
|
-
export const DAEMON_CONTRACT_VERSION = "
|
|
26
|
+
export const DAEMON_CONTRACT_VERSION = "miadi.tide.daemon.v2"
|
|
27
27
|
|
|
28
28
|
const DEFAULT_DAEMON_TIMEOUT_MS = 5_000
|
|
29
29
|
|
|
@@ -33,11 +33,11 @@ function expandHome(p: string): string {
|
|
|
33
33
|
return p
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/** Resolve the daemon socket path: `TIDE_SOCKET`
|
|
36
|
+
/** Resolve the daemon socket path: `TIDE_SOCKET` -> `${MIADI_HOME|~/.miadi/navigator}/daemon.sock`. */
|
|
37
37
|
export function resolveSocketPath(): string {
|
|
38
38
|
const explicit = process.env.TIDE_SOCKET?.trim()
|
|
39
39
|
if (explicit) return expandHome(explicit)
|
|
40
|
-
const home = process.env.
|
|
40
|
+
const home = process.env.MIADI_HOME?.trim()
|
|
41
41
|
const dir = home ? expandHome(home) : join(homedir(), ".miadi", "navigator")
|
|
42
42
|
return join(dir, "daemon.sock")
|
|
43
43
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Typed contract for the ironsilk `tide` runtime (`--format json` output).
|
|
2
2
|
//
|
|
3
|
-
// Source of truth today: runtime/
|
|
3
|
+
// Source of truth today: runtime/tide-runtime/tide_runtime/models.py
|
|
4
4
|
// (`ContextSnapshot.to_dict()`, `TerminalContext`). When the schema-first
|
|
5
5
|
// contract lands (`tide-api.schema.json`), these types are regenerated, not
|
|
6
6
|
// hand-edited. See README.md.
|