@jini-ai/cli 0.1.2 → 0.3.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 +80 -0
- package/dist/daemon-command.d.ts +2 -2
- package/dist/daemon-command.js +2 -2
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/local-daemon-discovery.d.ts +1 -1
- package/dist/local-daemon-discovery.js +3 -3
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/run-command.js +1 -1
- package/dist/version-command.d.ts +1 -1
- package/dist/version-command.js +1 -1
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# `@jini-ai/cli`
|
|
2
|
+
|
|
3
|
+
CLI transport shell for driving a Jini daemon over HTTP: flag parsing, daemon-URL resolution,
|
|
4
|
+
local daemon discovery, and a pluggable command registry. This is deliberately **a first generic
|
|
5
|
+
slice, not the full `@jini-ai/cli` package** — it was extracted from Open Design's ~9,900-line
|
|
6
|
+
`cli.ts` by keeping only the transport/plumbing primitives that have nothing to do with any
|
|
7
|
+
product noun (project, plugin, brand, conversation, …); everything OD-domain-specific was left
|
|
8
|
+
behind (see `source-map.md`'s classification table). The library barrel (`index.ts`) intentionally
|
|
9
|
+
registers nothing — it ships the building blocks a host pack uses to register real commands, plus
|
|
10
|
+
a small set of concrete commands (`run`, `daemon`, `version`) that wrap `@jini-ai/http`'s actual
|
|
11
|
+
routes, and a bootable `jini` binary (`src/main.ts`, wired via `package.json`'s `bin` field) that
|
|
12
|
+
dispatches them.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @jini-ai/cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
No peer dependencies. Depends on `@jini-ai/core` (for the `token()`-based transport tokens) and
|
|
21
|
+
`@jini-ai/sidecar` (for local daemon discovery's on-disk registry read).
|
|
22
|
+
|
|
23
|
+
## What you get
|
|
24
|
+
|
|
25
|
+
- **Flag/positional parsing** — `parseFlags`, `positionalArgs`, `coerceCliValue`.
|
|
26
|
+
- **Daemon-URL resolution** — `resolveDaemonUrl` (flag → env var → injected `discover()` probe →
|
|
27
|
+
default, in that order), `sanitizeDaemonUrlForDisplay`, `daemonUrlPolicyWarning`.
|
|
28
|
+
- **Local daemon discovery** — `createLocalDaemonDiscovery({ dataDir } | { registryPath })`, a
|
|
29
|
+
`resolveDaemonUrl`-compatible `discover` probe reading `@jini-ai/sidecar`'s on-disk registry
|
|
30
|
+
record (and verifying the recording daemon's pid is still alive before trusting it).
|
|
31
|
+
- **HTTP transport** — `postJsonToDaemon`, `getJsonFromDaemon`, `surfaceFetchError` — bounded,
|
|
32
|
+
size-capped, structured-error-aware daemon requests.
|
|
33
|
+
- **Structured errors** — `exitWithStructuredError`, `DEFAULT_CLI_EXIT_CODES`,
|
|
34
|
+
`structuredErrorData` — maps an error code to a stable exit code and a `{ error: { code,
|
|
35
|
+
message, data } }` stderr envelope.
|
|
36
|
+
- **Command registry** — `CommandRegistry` (`.add(name, handler, { usage?, override? })`,
|
|
37
|
+
`.dispatch(argv, { valueFlags? })`), `CommandDispatchResult`, `CommandHandler` — the generic
|
|
38
|
+
"first-non-flag-token dispatch" shape a pack's `Pack['cli']` hook registers against.
|
|
39
|
+
- **Built-in commands** — `registerRunCommands` (`run start|list|get|cancel|watch`),
|
|
40
|
+
`registerDaemonCommands` (`daemon status|stop`), `registerVersionCommand` (`version`) — each a
|
|
41
|
+
thin transport over `@jini-ai/http`'s run/daemon-status routes.
|
|
42
|
+
- **Prompt/body input helpers** — `readPromptFromFlags`/`readBodyFromFlags` (`--prompt`/
|
|
43
|
+
`--prompt-file`/stdin conventions) and `redact.ts`'s `stripControlSequences`.
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { CommandRegistry, resolveDaemonUrl, registerRunCommands, exitWithStructuredError } from '@jini-ai/cli';
|
|
49
|
+
|
|
50
|
+
const registry = new CommandRegistry();
|
|
51
|
+
|
|
52
|
+
registerRunCommands(registry, {
|
|
53
|
+
resolveBaseUrl: () => resolveDaemonUrl({ envVarName: 'JINI_DAEMON_URL', defaultUrl: 'http://127.0.0.1:4317' }),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const result = await registry.dispatch(process.argv.slice(2));
|
|
57
|
+
if (result.kind === 'not-found') {
|
|
58
|
+
exitWithStructuredError({ code: 'invalid-flag', message: `unknown command "${result.name}"` });
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
For a ready-to-run entrypoint rather than composing the registry yourself, install this package
|
|
63
|
+
and run its `jini` binary directly (`npx jini run list --daemon-url http://127.0.0.1:4317`).
|
|
64
|
+
|
|
65
|
+
## What's swappable
|
|
66
|
+
|
|
67
|
+
`resolveDaemonUrl`'s `discover` callback is the intended injection point for daemon-discovery
|
|
68
|
+
strategy — `createLocalDaemonDiscovery` is the one concrete implementation shipped, but any
|
|
69
|
+
`(env, timeoutMs) => Promise<string | null>` works. `CommandRegistry` itself is the seam a pack
|
|
70
|
+
uses to add or `override` commands. The exit-code table (`DEFAULT_CLI_EXIT_CODES`) is a small
|
|
71
|
+
default a caller extends with its own `code → exitCode` entries rather than a fixed, closed set.
|
|
72
|
+
|
|
73
|
+
## Runtime
|
|
74
|
+
|
|
75
|
+
Node-only.
|
|
76
|
+
ESM only — ships `"type": "module"` with no CommonJS `require` build.
|
|
77
|
+
|
|
78
|
+
## Provenance
|
|
79
|
+
|
|
80
|
+
See [source-map.md](./source-map.md) for per-file provenance and scope decisions. Apache-2.0.
|
package/dist/daemon-command.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module daemon-command
|
|
3
3
|
*
|
|
4
|
-
* `daemon status` / `daemon stop` — concrete commands over `@jini-ai/http`'s
|
|
4
|
+
* `daemon status` / `daemon stop` — concrete commands over `@jini-ai/http-kit`'s
|
|
5
5
|
* `daemonStatusRoute`/`daemonShutdownRoute` (`packages/http/src/daemon-status.ts`).
|
|
6
6
|
* `packages/cli/source-map.md`'s original UNCLEAR verdict on these two
|
|
7
|
-
* blocked on `@jini-ai/http` being a stub with no `/status`/`/shutdown` route to
|
|
7
|
+
* blocked on `@jini-ai/http-kit` being a stub with no `/status`/`/shutdown` route to
|
|
8
8
|
* call; that blocker no longer holds (both routes exist and are tested), and
|
|
9
9
|
* `run-command.ts` is now a real, established "first concrete command"
|
|
10
10
|
* precedent this file follows rather than pioneers.
|
package/dist/daemon-command.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module daemon-command
|
|
3
3
|
*
|
|
4
|
-
* `daemon status` / `daemon stop` — concrete commands over `@jini-ai/http`'s
|
|
4
|
+
* `daemon status` / `daemon stop` — concrete commands over `@jini-ai/http-kit`'s
|
|
5
5
|
* `daemonStatusRoute`/`daemonShutdownRoute` (`packages/http/src/daemon-status.ts`).
|
|
6
6
|
* `packages/cli/source-map.md`'s original UNCLEAR verdict on these two
|
|
7
|
-
* blocked on `@jini-ai/http` being a stub with no `/status`/`/shutdown` route to
|
|
7
|
+
* blocked on `@jini-ai/http-kit` being a stub with no `/status`/`/shutdown` route to
|
|
8
8
|
* call; that blocker no longer holds (both routes exist and are tested), and
|
|
9
9
|
* `run-command.ts` is now a real, established "first concrete command"
|
|
10
10
|
* precedent this file follows rather than pioneers.
|
package/dist/http.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare function postJsonToDaemon(base: string, route: string, body: unkn
|
|
|
56
56
|
/**
|
|
57
57
|
* `GET` `<base><route>` and return the parsed JSON response. Same transport contract as
|
|
58
58
|
* {@link postJsonToDaemon} (timeout, response-size cap, structured-error mapping, redaction) with
|
|
59
|
-
* no request body — for read-only daemon routes such as `@jini-ai/http`'s `GET /api/runs` and
|
|
59
|
+
* no request body — for read-only daemon routes such as `@jini-ai/http-kit`'s `GET /api/runs` and
|
|
60
60
|
* `GET /api/runs/:runId`.
|
|
61
61
|
*/
|
|
62
62
|
export declare function getJsonFromDaemon(base: string, route: string, options?: GetJsonFromDaemonOptions): Promise<unknown>;
|
package/dist/http.js
CHANGED
|
@@ -204,7 +204,7 @@ export async function postJsonToDaemon(base, route, body, options = {}) {
|
|
|
204
204
|
/**
|
|
205
205
|
* `GET` `<base><route>` and return the parsed JSON response. Same transport contract as
|
|
206
206
|
* {@link postJsonToDaemon} (timeout, response-size cap, structured-error mapping, redaction) with
|
|
207
|
-
* no request body — for read-only daemon routes such as `@jini-ai/http`'s `GET /api/runs` and
|
|
207
|
+
* no request body — for read-only daemon routes such as `@jini-ai/http-kit`'s `GET /api/runs` and
|
|
208
208
|
* `GET /api/runs/:runId`.
|
|
209
209
|
*/
|
|
210
210
|
export async function getJsonFromDaemon(base, route, options = {}) {
|
|
@@ -3,7 +3,7 @@ export interface LocalDaemonDiscoveryOptions {
|
|
|
3
3
|
/**
|
|
4
4
|
* The same `dataDir` the target `createLocalNodeDaemon({ dataDir, ... })` call was given. The
|
|
5
5
|
* registry path is derived from it via `@jini-ai/sidecar`'s `resolveDaemonRegistryPath` — the
|
|
6
|
-
* identical derivation `@jini-ai/
|
|
6
|
+
* identical derivation `@jini-ai/server` uses for its own `discoveryFile` default. Ignored when
|
|
7
7
|
* `registryPath` is also given.
|
|
8
8
|
*/
|
|
9
9
|
dataDir?: string;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The real `discover` callback `resolveDaemonUrl` (`daemon-url.ts`) has always accepted but this
|
|
5
5
|
* package never implemented — see `source-map.md`'s "Deferred" item 1 and its own 2026-07-21
|
|
6
|
-
* investigation, which found `@jini-ai/
|
|
7
|
-
* separate CLI process could read. That daemon side is now built (`@jini-ai/
|
|
6
|
+
* investigation, which found `@jini-ai/server`'s `createLocalNodeDaemon` wrote nothing anywhere a
|
|
7
|
+
* separate CLI process could read. That daemon side is now built (`@jini-ai/server`'s
|
|
8
8
|
* `discoveryFile` config, backed by `@jini-ai/sidecar`'s `daemon-registry.ts`); this module is the
|
|
9
9
|
* matching CLI-side reader: `createLocalDaemonDiscovery(...)` builds a probe over that same
|
|
10
10
|
* on-disk record, verified live (not just present — see `readLiveDaemonRegistryRecord`'s own
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Deliberately not wired to a hardcoded default `dataDir`: exactly like `resolveDaemonUrl` itself
|
|
14
14
|
* has no baked-in env var name or default URL, this package has no opinion on where a given
|
|
15
|
-
* product's daemon keeps its data — the caller (whatever wires a `@jini-ai/
|
|
15
|
+
* product's daemon keeps its data — the caller (whatever wires a `@jini-ai/server` daemon and a
|
|
16
16
|
* `@jini-ai/cli`-transport pack together for one product) supplies the same `dataDir` (or an
|
|
17
17
|
* explicit `registryPath`, when `createLocalNodeDaemon`'s own `discoveryFile` was overridden away
|
|
18
18
|
* from its default) to both sides.
|
package/dist/main.js
CHANGED
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
*
|
|
23
23
|
* **Daemon-URL resolution.** `resolveDaemonUrl` (`daemon-url.ts`) has no baked-in default —
|
|
24
24
|
* this package has never had a locked default daemon port to fall back to (see
|
|
25
|
-
* `source-map.md`: `@jini-ai/
|
|
25
|
+
* `source-map.md`: `@jini-ai/server`'s `createLocalNodeDaemon` binds an ephemeral port, not a
|
|
26
26
|
* fixed one). This binary wires the three real, already-built pieces together instead of
|
|
27
27
|
* inventing a new one: an explicit `--daemon-url <url>` flag (highest precedence), a
|
|
28
28
|
* `JINI_DAEMON_URL` env var, and — when `--data-dir <path>` or `--registry-path <path>` is
|
|
29
29
|
* given — `local-daemon-discovery.ts`'s `createLocalDaemonDiscovery`, the CLI-side reader for
|
|
30
|
-
* a `@jini-ai/
|
|
30
|
+
* a `@jini-ai/server`-written on-disk daemon registry record. That discovery module's own doc
|
|
31
31
|
* already flagged it as built-but-unconsumed ("no pack has registered against
|
|
32
32
|
* `CommandRegistry` yet"); this is that consumer. If none of the three resolve, there is still
|
|
33
33
|
* no silent fallback — `resolveDaemonUrl` throws, and this file's own catch boundary (below)
|
|
@@ -96,7 +96,7 @@ const ROOT_USAGE = renderUsage({
|
|
|
96
96
|
description: 'CLI transport for a Jini daemon over HTTP. Commands: run, daemon, version.',
|
|
97
97
|
options: [
|
|
98
98
|
{ flag: '--daemon-url <url>', description: 'Explicit daemon base URL. Takes precedence over JINI_DAEMON_URL and local discovery.' },
|
|
99
|
-
{ flag: '--data-dir <path>', description: "Resolve a locally running daemon's URL from this data directory's on-disk registry (see @jini-ai/
|
|
99
|
+
{ flag: '--data-dir <path>', description: "Resolve a locally running daemon's URL from this data directory's on-disk registry (see @jini-ai/server's createLocalNodeDaemon)." },
|
|
100
100
|
{ flag: '--registry-path <path>', description: "Exact registry file path, overriding --data-dir's derived default." },
|
|
101
101
|
{ flag: '--help, -h', description: 'Show this help.' },
|
|
102
102
|
{ flag: '--version, -v', description: 'Print the running daemon\'s version (alias for "jini version"; recognized only as the first argument).' },
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAA8B,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAgC,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,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AC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,KAAK,CAAC,GAAG,UAAU,IAAI,CAAC,CAAC;QACzB,OAAO;IACT,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,uBAAuB,CACrB,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB,MAAM,CAAC,IAAI,iCAAiC,EAAE,EACpG,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAC1B,CAAC;IACJ,CAAC;AACH,CAAC;AAED,0FAA0F;AAC1F,yFAAyF;AACzF,oFAAoF;AACpF,2EAA2E;AAC3E,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzG,IAAI,YAAY,EAAE,CAAC;IACjB,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/run-command.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* first concrete commands registered against this package's
|
|
6
6
|
* `CommandRegistry` (`command-registry.ts`'s own docblock notes none existed
|
|
7
7
|
* yet because no HTTP-client-mode pack had landed to call). Built directly
|
|
8
|
-
* against `@jini-ai/http`'s real run transport (`packages/http/src/runs.ts`:
|
|
8
|
+
* against `@jini-ai/http-kit`'s real run transport (`packages/http/src/runs.ts`:
|
|
9
9
|
* `POST /api/runs`, `GET /api/runs`, `GET /api/runs/:runId`,
|
|
10
10
|
* `POST /api/runs/:runId/cancel`, `GET /api/runs/:runId/events` SSE) — a
|
|
11
11
|
* thin HTTP-transport-mode CLI over the kernel's own `Run` noun, with no
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `GET /api/daemon/status`'s `version` field (`packages/http/src/daemon-status.ts`,
|
|
6
6
|
* `DaemonStatusResponse.version`) — the same route `daemon-command.ts`'s `daemon status`
|
|
7
7
|
* already calls. `packages/cli/source-map.md`'s original UNCLEAR verdict on a standalone
|
|
8
|
-
* `version` command noted "@jini-ai/http has no version route yet ... nothing to call"; that
|
|
8
|
+
* `version` command noted "@jini-ai/http-kit has no version route yet ... nothing to call"; that
|
|
9
9
|
* blocker never actually required a *separate* route — `daemonStatusRoute`'s response body
|
|
10
10
|
* already carries a `version` field, so no new HTTP route was added for this command. It just
|
|
11
11
|
* extracts and prints that one field instead of the full status envelope `daemon status` prints.
|
package/dist/version-command.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `GET /api/daemon/status`'s `version` field (`packages/http/src/daemon-status.ts`,
|
|
6
6
|
* `DaemonStatusResponse.version`) — the same route `daemon-command.ts`'s `daemon status`
|
|
7
7
|
* already calls. `packages/cli/source-map.md`'s original UNCLEAR verdict on a standalone
|
|
8
|
-
* `version` command noted "@jini-ai/http has no version route yet ... nothing to call"; that
|
|
8
|
+
* `version` command noted "@jini-ai/http-kit has no version route yet ... nothing to call"; that
|
|
9
9
|
* blocker never actually required a *separate* route — `daemonStatusRoute`'s response body
|
|
10
10
|
* already carries a `version` field, so no new HTTP route was added for this command. It just
|
|
11
11
|
* extracts and prints that one field instead of the full status envelope `daemon status` prints.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "CLI transport shell for driving a Jini daemon over HTTP: flag parsing, daemon-URL resolution, local daemon discovery, and a pluggable command registry.",
|
|
4
5
|
"license": "Apache-2.0",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
@@ -10,10 +11,10 @@
|
|
|
10
11
|
"jini": {
|
|
11
12
|
"domain": "server",
|
|
12
13
|
"kind": "cli",
|
|
13
|
-
"runtime": "node"
|
|
14
|
-
"admission": "locked"
|
|
14
|
+
"runtime": "node"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
|
+
"sideEffects": false,
|
|
17
18
|
"main": "./dist/index.js",
|
|
18
19
|
"types": "./dist/index.d.ts",
|
|
19
20
|
"exports": {
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"registry": "https://registry.npmjs.org"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
|
-
"@jini-ai/
|
|
43
|
-
"@jini-ai/
|
|
43
|
+
"@jini-ai/sidecar": "0.3.0",
|
|
44
|
+
"@jini-ai/core": "0.3.0"
|
|
44
45
|
},
|
|
45
46
|
"scripts": {
|
|
46
47
|
"build": "tsc -p tsconfig.json && chmod +x dist/main.js",
|