create-mono-agent 0.19.0 → 0.20.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 +42 -23
- package/dist/bin/mono-agent.js +4 -3
- package/dist/bin/mono-agent.js.map +1 -1
- package/dist/delegate.d.ts +3 -1
- package/dist/delegate.d.ts.map +1 -1
- package/dist/delegate.js +8 -2
- package/dist/delegate.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
# create-mono-agent
|
|
2
2
|
|
|
3
3
|
The unscoped npm-init entry point for mono-agent. Use it for a one-off guided
|
|
4
|
-
setup with `npm create mono-agent@latest
|
|
4
|
+
setup with `npm create mono-agent@latest`, or install it globally when you want
|
|
5
5
|
the `mono-agent` command on `PATH`. Both shipped bins delegate to the CLI in
|
|
6
6
|
[`@mono-agent/agent-app`](https://www.npmjs.com/package/@mono-agent/agent-app).
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Two installer forms and one persistent CLI:
|
|
9
9
|
|
|
10
|
-
- `npm create mono-agent@latest` — npm's `create-*` convention resolves this package (no install).
|
|
11
|
-
- `npx create-mono-agent` — the same, spelled explicitly.
|
|
10
|
+
- `npm create mono-agent@latest` — npm's `create-*` convention resolves this package and enters `init` (no global install).
|
|
11
|
+
- `npx create-mono-agent` — the same installer, spelled explicitly.
|
|
12
12
|
- `npm i -g create-mono-agent` — a global install that puts the natural `mono-agent` command on your `PATH`.
|
|
13
13
|
|
|
14
|
+
The installer name is deliberately init-oriented. Bare `create-mono-agent` and
|
|
15
|
+
any invocation whose first argument is a flag enter `init`, except that a
|
|
16
|
+
singleton `--help`/`-h` prints the `init` help topic and a singleton
|
|
17
|
+
`--version`/`-v` prints the shared CLI version as `mono-agent <version>`.
|
|
18
|
+
Explicit subcommands pass through. The same package's second bin, `mono-agent`,
|
|
19
|
+
always passes its arguments through unchanged.
|
|
20
|
+
|
|
14
21
|
On macOS, a one-off `npm create`/npx wizard may start the finished agent in the
|
|
15
22
|
background. Before it does, `@mono-agent/agent-app` copies the already-resolved
|
|
16
23
|
package closure it is executing into a private, verified runtime under
|
|
@@ -42,17 +49,23 @@ core/plugin package counts and carries no library API.
|
|
|
42
49
|
|
|
43
50
|
Provide the discoverable, unscoped `create-mono-agent` name on npm so
|
|
44
51
|
`npm create mono-agent`/`npx create-mono-agent` and a global `mono-agent` command
|
|
45
|
-
work
|
|
46
|
-
|
|
52
|
+
work. It owns only the basename-aware npm-init routing described above, then
|
|
53
|
+
delegates command parsing and execution to `@mono-agent/agent-app`'s
|
|
54
|
+
`mono-agent` CLI.
|
|
47
55
|
|
|
48
56
|
## Install / Usage
|
|
49
57
|
|
|
50
58
|
```bash
|
|
51
|
-
# Recommended: one-off guided setup (
|
|
59
|
+
# Recommended: one-off guided setup (bare create implies init):
|
|
60
|
+
npm create mono-agent@latest
|
|
61
|
+
|
|
62
|
+
# Spelling init explicitly is equivalent:
|
|
52
63
|
npm create mono-agent@latest init
|
|
53
64
|
|
|
54
65
|
# The explicit npx form is equivalent:
|
|
55
66
|
npx create-mono-agent init
|
|
67
|
+
npx create-mono-agent --help
|
|
68
|
+
npx create-mono-agent --version
|
|
56
69
|
|
|
57
70
|
# Or install globally for the persistent `mono-agent` command:
|
|
58
71
|
npm i -g create-mono-agent
|
|
@@ -61,13 +74,13 @@ mono-agent validate
|
|
|
61
74
|
mono-agent --version
|
|
62
75
|
```
|
|
63
76
|
|
|
64
|
-
|
|
65
|
-
provides — including interactive shutdown:
|
|
66
|
-
|
|
67
|
-
agent-app's bin directly (the bin forwards
|
|
68
|
-
child; see `delegateSignals`).
|
|
77
|
+
After the small create-name routing above, every command, flag, and exit code is
|
|
78
|
+
exactly what `@mono-agent/agent-app` provides — including interactive shutdown:
|
|
79
|
+
Ctrl-C on `mono-agent start --foreground` runs the same graceful teardown and
|
|
80
|
+
yields the same exit status as calling agent-app's bin directly (the bin forwards
|
|
81
|
+
signals without double-signalling the child; see `delegateSignals`). Prefer
|
|
69
82
|
pinning the scoped host directly (`npm i -g @mono-agent/agent-app`) if you don't
|
|
70
|
-
need the installer.
|
|
83
|
+
need the installer name.
|
|
71
84
|
|
|
72
85
|
## Architecture
|
|
73
86
|
|
|
@@ -77,11 +90,14 @@ Both bin names point to `dist/bin/mono-agent.js` and follow one path:
|
|
|
77
90
|
|
|
78
91
|
1. `resolveAgentAppCliEntry()` resolves the installed
|
|
79
92
|
`@mono-agent/agent-app/package.json` and reads its declared `mono-agent` bin.
|
|
80
|
-
2.
|
|
93
|
+
2. `delegatedCliArgs()` passes `mono-agent` arguments through; under the
|
|
94
|
+
`create-mono-agent` basename it supplies implicit `init`, init-topic help, or
|
|
95
|
+
singleton version passthrough as described above.
|
|
96
|
+
3. The shim starts the resolved CLI with the current Node executable, those
|
|
81
97
|
arguments, and inherited standard input/output.
|
|
82
|
-
|
|
98
|
+
4. `delegateSignals()` lets group-delivered Ctrl-C reach the child once,
|
|
83
99
|
forwards a targeted `SIGTERM`, and mirrors the child's exit code or signal.
|
|
84
|
-
|
|
100
|
+
5. From that point, `@mono-agent/agent-app` owns all command behavior, including
|
|
85
101
|
any verified background-runtime publication.
|
|
86
102
|
|
|
87
103
|
### Package structure
|
|
@@ -90,7 +106,7 @@ Both bin names point to `dist/bin/mono-agent.js` and follow one path:
|
|
|
90
106
|
| --- | --- |
|
|
91
107
|
| `src/bin/mono-agent.ts` | Shared entry point for both bin names. |
|
|
92
108
|
| `src/resolve-agent-app-cli.ts` | Finds the dependency's declared CLI without hard-coding its build path. |
|
|
93
|
-
| `src/delegate.ts` |
|
|
109
|
+
| `src/delegate.ts` | Selects the create-name argv route and preserves signal/exit semantics while the real CLI runs. |
|
|
94
110
|
|
|
95
111
|
## Public API
|
|
96
112
|
|
|
@@ -98,8 +114,10 @@ Both bin names point to `dist/bin/mono-agent.js` and follow one path:
|
|
|
98
114
|
|
|
99
115
|
| Surface | Use |
|
|
100
116
|
| --- | --- |
|
|
101
|
-
| `npm create mono-agent@latest
|
|
117
|
+
| `npm create mono-agent@latest` | One-off npm-init setup (`init` is implicit). |
|
|
102
118
|
| `npx create-mono-agent init` | Explicit one-off setup. |
|
|
119
|
+
| `npx create-mono-agent --help` | Init-specific help without writing scaffold files. |
|
|
120
|
+
| `npx create-mono-agent --version` | Exact shared `mono-agent <version>` identity without writing files. |
|
|
103
121
|
| Global `mono-agent` bin | Persistent command after `npm i -g create-mono-agent`. |
|
|
104
122
|
| Library imports | None; import programmatic APIs from `@mono-agent/agent-app`. |
|
|
105
123
|
|
|
@@ -117,14 +135,15 @@ None. This package exports no library surface; it ships `create-mono-agent` and
|
|
|
117
135
|
Depends only on `@mono-agent/agent-app` (category `app`) at the same lockstep
|
|
118
136
|
version, resolved at runtime through its published `bin`. It must not depend on
|
|
119
137
|
runtime, communication, memory, observability, or operator-surface packages, and
|
|
120
|
-
it must not reimplement
|
|
138
|
+
it must not reimplement agent-app command parsing or execution.
|
|
121
139
|
|
|
122
140
|
## What This Package Does Not Own
|
|
123
141
|
|
|
124
|
-
It does not parse
|
|
125
|
-
command — all of that lives in `@mono-agent/agent-app`.
|
|
126
|
-
|
|
127
|
-
behaviour belongs in
|
|
142
|
+
It does not parse command options, load config, run models, scaffold files, or
|
|
143
|
+
define any command — all of that lives in `@mono-agent/agent-app`. Its only argv
|
|
144
|
+
decision is whether the installer basename should request implicit `init`, the
|
|
145
|
+
`init` help topic, or global version; additional CLI behaviour belongs in
|
|
146
|
+
`@mono-agent/agent-app`, not here.
|
|
128
147
|
|
|
129
148
|
## Related Documentation
|
|
130
149
|
|
package/dist/bin/mono-agent.js
CHANGED
|
@@ -5,9 +5,10 @@ import { resolveAgentAppCliEntry } from "../resolve-agent-app-cli.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Delegating bin for the `create-mono-agent` installer. Both of its bin names
|
|
7
7
|
* (`create-mono-agent` and `mono-agent`) point here. It owns no CLI logic of its
|
|
8
|
-
* own
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* own beyond basename-aware installer routing: it locates
|
|
9
|
+
* `@mono-agent/agent-app`'s `mono-agent` CLI entry and runs it in a child process
|
|
10
|
+
* with normalized args and inherited stdio. After that routing, behaviour —
|
|
11
|
+
* output, interactive shutdown, and exit status — is byte-identical to calling
|
|
11
12
|
* `@mono-agent/agent-app`'s own bin directly.
|
|
12
13
|
*
|
|
13
14
|
* Why a child process instead of importing `runCli` in-process: agent-app's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mono-agent.js","sourceRoot":"","sources":["../../src/bin/mono-agent.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"mono-agent.js","sourceRoot":"","sources":["../../src/bin/mono-agent.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,QAAQ,GAAG,uBAAuB,EAAE,CAAC;AAC3C,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACjF,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC"}
|
package/dist/delegate.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type { ChildProcess } from "node:child_process";
|
|
|
2
2
|
/**
|
|
3
3
|
* npm's `create-*` convention treats arguments as init options. Keep the
|
|
4
4
|
* separately exposed `mono-agent` bin byte-for-byte compatible, while a bare
|
|
5
|
-
* `create-mono-agent` (or one followed directly by flags) enters init.
|
|
5
|
+
* `create-mono-agent` (or one followed directly by flags) enters init. A lone
|
|
6
|
+
* informational flag remains non-mutating: help resolves to the init topic
|
|
7
|
+
* while version reaches agent-app unchanged.
|
|
6
8
|
*/
|
|
7
9
|
export declare function delegatedCliArgs(invocationPath: string | undefined, args: readonly string[]): readonly string[];
|
|
8
10
|
/**
|
package/dist/delegate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAa/G;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IACzD,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACnD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACnD,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACpD;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAuBtG"}
|
package/dist/delegate.js
CHANGED
|
@@ -2,13 +2,19 @@ import { basename } from "node:path";
|
|
|
2
2
|
/**
|
|
3
3
|
* npm's `create-*` convention treats arguments as init options. Keep the
|
|
4
4
|
* separately exposed `mono-agent` bin byte-for-byte compatible, while a bare
|
|
5
|
-
* `create-mono-agent` (or one followed directly by flags) enters init.
|
|
5
|
+
* `create-mono-agent` (or one followed directly by flags) enters init. A lone
|
|
6
|
+
* informational flag remains non-mutating: help resolves to the init topic
|
|
7
|
+
* while version reaches agent-app unchanged.
|
|
6
8
|
*/
|
|
7
9
|
export function delegatedCliArgs(invocationPath, args) {
|
|
8
10
|
const invocation = invocationPath === undefined ? "" : basename(invocationPath);
|
|
9
|
-
|
|
11
|
+
const singletonArg = args.length === 1 ? args[0] : undefined;
|
|
12
|
+
if (invocation === "create-mono-agent" && ["--help", "-h"].includes(singletonArg ?? "")) {
|
|
10
13
|
return ["help", "init"];
|
|
11
14
|
}
|
|
15
|
+
if (invocation === "create-mono-agent" && ["--version", "-v"].includes(singletonArg ?? "")) {
|
|
16
|
+
return args;
|
|
17
|
+
}
|
|
12
18
|
if (invocation === "create-mono-agent" && (args.length === 0 || args[0]?.startsWith("-") === true)) {
|
|
13
19
|
return ["init", ...args];
|
|
14
20
|
}
|
package/dist/delegate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../src/delegate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAAkC,EAAE,IAAuB;IAC1F,MAAM,UAAU,GAAG,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,IAAI,UAAU,KAAK,mBAAmB,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QACxF,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,UAAU,KAAK,mBAAmB,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3F,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,UAAU,KAAK,mBAAmB,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;QACnG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAgBD;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAA8B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,KAAwC,EAAE,IAAsB;IAC9F,KAAK,MAAM,MAAM,IAAI,uBAAuB,EAAE,CAAC;QAC7C,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACnB,uEAAuE;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACtB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,+DAA+D,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QACpG,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAmB,EAAE,MAA6B,EAAE,EAAE;QACtE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mono-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "npm-init style installer for the mono-agent CLI: `npm create mono-agent`. Ships both a `create-mono-agent` and a `mono-agent` bin, each delegating to the @mono-agent/agent-app CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@mono-agent/agent-app": "0.
|
|
25
|
+
"@mono-agent/agent-app": "0.20.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|