argsbarg 7.0.8 → 7.0.10

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/CHANGELOG.md CHANGED
@@ -7,7 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [7.0.8] - 2026-09-15
10
+ ## [7.0.10] - 2026-09-16
11
+
12
+ ### Added
13
+
14
+ - **Canonical wire input schema generation (`buildLeafInputSchema`)** — unified wire input schema generation across MCP tools, OpenAPI request bodies, and CLI schema export into a single canonical helper. Synthesizes a complete JSON Schema (types, formats, enums, required properties, and positionals) from leaf-local options when `inputSchema` is not explicitly defined.
15
+ - **Leaf `inputSchema` in `docs cli-schema`** — `cliSchemaExport` now includes `inputSchema` for every leaf command in the machine-readable command tree (and `<app>://schema` MCP resource), giving programmatic and agent callers a unified JSON Schema input specification for both flag-based and document-based commands.
16
+ - **`buildLeafInputSchema` and `leafWireOptions` exports** — exported from framework root, CLI runtime export, and MCP tools module.
17
+
18
+ ## [7.0.9] - 2026-09-16
19
+
20
+ ### Added
21
+
22
+ - **`kind: "document"` leaf commands with YAML and JSON support** — introduced `kind: "document"` as the primary naming for structured payload leaves, while retaining `kind: "json"` and `isJsonLeaf` as fully backward-compatible aliases. Both `"document"` and `"json"` leaves now accept YAML input in addition to JSON via command positional arguments and piped stdin.
23
+ - **YAML request body support in HTTP server** — the HTTP API server now accepts YAML request bodies in addition to JSON for structured document endpoints.
24
+ - **`isDocumentLeaf` and `parseDocumentText` exports** — exported `isDocumentLeaf` type guard and `parseDocumentText` utility from framework root and CLI exports.
25
+
26
+ ### Changed
27
+
28
+ - **Help rendering for document leaves** — usage lines for `kind: "document"` leaves render `[DOCUMENT]` (retaining `[JSON]` for legacy `kind: "json"` leaves) and describe inputs as `"Pass a JSON or YAML document as an argument or pipe to stdin."`
11
29
 
12
30
  ### Added
13
31
 
@@ -992,8 +1010,9 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
992
1010
  - Migrate schemas: rename every `children` property to **`commands`**; move positional definitions to **`CliPositional`** objects on `positionals` and strip `positional` / `argMin` / `argMax` from flag definitions under `options` (flags only carry `name`, `description`, `kind`, and optional `shortName`).
993
1011
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
994
1012
 
995
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.8...HEAD
996
- [7.0.8]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.8
1013
+ [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.10...HEAD
1014
+ [7.0.10]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.10
1015
+ [7.0.9]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.9
997
1016
  [7.0.7]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.7
998
1017
  [7.0.6]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.6
999
1018
  [7.0.5]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.5
@@ -108,7 +108,7 @@ Use root **`notes`** for cross-cutting hints shown in help (install commands, do
108
108
  Descriptions and schemas are copied into MCP tools and HTTP OpenAPI — optimize for smaller, clearer agent payloads:
109
109
 
110
110
  - **Declare options on the leaf command** that uses them — routing groups cannot declare options (program root may). Wire schemas (MCP, OpenAPI) expose leaf-local options only.
111
- - Prefer **`kind: "json"`** leaves with schemagen `inputSchema` for complex tool bodies (one nested object beats many flat flags).
111
+ - Prefer **`kind: "document"`** (or legacy `kind: "json"`) leaves with schemagen `inputSchema` for complex tool bodies (one nested object beats many flat flags).
112
112
  - Keep **`description`** strings short and action-oriented; put examples in **`notes`**, not duplicated in every option.
113
113
  - Use **`hidden: true`** or **`mcpTool.enabled: false`** for debug/internal commands.
114
114
  - For shape discovery: HTTP agents load **`docs openapi`** or `GET /openapi.json`; MCP agents use **`docs cli-schema`**; load full **`docs cli`** only when prose is needed.
@@ -300,15 +300,15 @@ Use **`ctx.jsonOpt("invoice")`**, **`ctx.inputs`**, or **`ctx.inputsAs<MyInput>(
300
300
 
301
301
  At most one `pipable` Json option per leaf. Json option names must appear in `inputSchema.properties` when a custom `inputSchema` is set.
302
302
 
303
- ### Pure JSON leaves (`kind: "json"`)
303
+ ### Structured document leaves (`kind: "document"`)
304
304
 
305
- When the entire tool body is JSON (no CLI flags), set **`kind: "json"`** on the leaf with **`inputSchema`** and **no `options` or `positionals`**:
305
+ When the entire tool body is a structured document (JSON or YAML, no CLI flags), set **`kind: "document"`** (or legacy `"json"`) on the leaf with **`inputSchema`** and **no `options` or `positionals`**:
306
306
 
307
307
  ```typescript
308
308
  {
309
309
  key: "render-invoice",
310
310
  description: "Render an invoice from template data",
311
- kind: "json",
311
+ kind: "document",
312
312
  inputSchema,
313
313
  handler: (ctx) => {
314
314
  const { format, invoice } = ctx.inputsAs<RenderInvoiceInput>();
@@ -319,10 +319,25 @@ When the entire tool body is JSON (no CLI flags), set **`kind: "json"`** on the
319
319
 
320
320
  | Surface | How input is supplied |
321
321
  | --- | --- |
322
- | CLI | One JSON positional **or** pipe a JSON document to stdin |
323
- | MCP / HTTP | Full tool args object (`ctx.toolArgs` / POST body) |
322
+ | CLI | One JSON or YAML positional **or** pipe a JSON/YAML document to stdin |
323
+ | MCP / HTTP | Full tool args object (`ctx.toolArgs` / JSON or YAML request body) |
324
324
 
325
- Example CLI: `jq '{format:"pdf", invoice:.}' data.json | myapp render-invoice`
325
+ Example CLI:
326
+ ```bash
327
+ # JSON positional or pipe
328
+ jq '{format:"pdf", invoice:.}' data.json | myapp render-invoice
329
+ myapp render-invoice '{"format":"pdf","invoice":{"id":"INV-1"}}'
330
+
331
+ # YAML positional or pipe
332
+ myapp render-invoice 'format: pdf
333
+ invoice:
334
+ id: INV-1'
335
+ cat << 'EOF' | myapp render-invoice
336
+ format: pdf
337
+ invoice:
338
+ id: INV-1
339
+ EOF
340
+ ```
326
341
 
327
342
  See [output-schema.md](output-schema.md) for schemagen `inputType`, [http-server.md](http-server.md) for HTTP tool bodies, and [json-schema-subset.md](json-schema-subset.md) for validation drafts, Zod interop, and keyword notes.
328
343
 
@@ -13,6 +13,19 @@
13
13
  "required": true
14
14
  }
15
15
  ],
16
+ "inputSchema": {
17
+ "type": "object",
18
+ "properties": {
19
+ "message": {
20
+ "type": "string",
21
+ "description": "Text to print."
22
+ }
23
+ },
24
+ "additionalProperties": false,
25
+ "required": [
26
+ "message"
27
+ ]
28
+ },
16
29
  "commands": [
17
30
  {
18
31
  "key": "version",
@@ -20,7 +33,7 @@
20
33
  },
21
34
  {
22
35
  "key": "configure",
23
- "description": "Set up agent skills and MCP config for this app (binary via Homebrew).",
36
+ "description": "Set up MCP config for this app (binary via Homebrew).",
24
37
  "notes": "Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).\n\nHomebrew installs the binary and shell completions only. Agent artifacts live under ~/.agents and are not written during brew install.\n\nAfter install or upgrade:\n full-example configure install\n\nUpgrade:\n brew upgrade full-example\n full-example configure install\n\nShell completions are installed by Homebrew during brew install.\nSee: https://docs.brew.sh/Shell-Completion\n\nSee what is installed:\n full-example configure status\n\nUninstall:\n full-example configure uninstall\n brew uninstall <tap>/full-example\n\nUse `configure status --json` for machine-readable output.",
25
38
  "commands": [
26
39
  {
@@ -129,17 +142,6 @@
129
142
  "kind": "presence"
130
143
  }
131
144
  ]
132
- },
133
- {
134
- "key": "skill",
135
- "description": "Print a reference agent SKILL; run `configure install` to install an optimized copy.",
136
- "options": [
137
- {
138
- "name": "save",
139
- "description": "Write documentation to ./docs/.",
140
- "kind": "presence"
141
- }
142
- ]
143
145
  }
144
146
  ]
145
147
  },
@@ -247,6 +249,11 @@
247
249
  "kind": "presence"
248
250
  }
249
251
  ],
252
+ "inputSchema": {
253
+ "type": "object",
254
+ "properties": {},
255
+ "additionalProperties": false
256
+ },
250
257
  "commands": [
251
258
  {
252
259
  "key": "version",
@@ -254,7 +261,7 @@
254
261
  },
255
262
  {
256
263
  "key": "configure",
257
- "description": "Set up agent skills and MCP config for this app (binary via Homebrew).",
264
+ "description": "Set up MCP config for this app (binary via Homebrew).",
258
265
  "notes": "Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).\n\nHomebrew installs the binary and shell completions only. Agent artifacts live under ~/.agents and are not written during brew install.\n\nAfter install or upgrade:\n full-example configure install\n\nUpgrade:\n brew upgrade full-example\n full-example configure install\n\nShell completions are installed by Homebrew during brew install.\nSee: https://docs.brew.sh/Shell-Completion\n\nSee what is installed:\n full-example configure status\n\nUninstall:\n full-example configure uninstall\n brew uninstall <tap>/full-example\n\nUse `configure status --json` for machine-readable output.",
259
266
  "commands": [
260
267
  {
@@ -363,17 +370,6 @@
363
370
  "kind": "presence"
364
371
  }
365
372
  ]
366
- },
367
- {
368
- "key": "skill",
369
- "description": "Print a reference agent SKILL; run `configure install` to install an optimized copy.",
370
- "options": [
371
- {
372
- "name": "save",
373
- "description": "Write documentation to ./docs/.",
374
- "kind": "presence"
375
- }
376
- ]
377
373
  }
378
374
  ]
379
375
  },
@@ -28,7 +28,7 @@ Echo a message (MCP-friendly leaf).
28
28
  #### Subcommands
29
29
 
30
30
  - `version` — Print the program version.
31
- - `configure` — Set up agent skills and MCP config for this app (binary via Homebrew).
31
+ - `configure` — Set up MCP config for this app (binary via Homebrew).
32
32
  - `docs` — Print bundled CLI documentation.
33
33
  - `mcp` — MCP server and bundle tools.
34
34
  - `http` — HTTP API server for tools.
@@ -39,7 +39,7 @@ Print the program version.
39
39
 
40
40
  #### `full-example echo configure`
41
41
 
42
- Set up agent skills and MCP config for this app (binary via Homebrew).
42
+ Set up MCP config for this app (binary via Homebrew).
43
43
 
44
44
  > Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).
45
45
  >
@@ -114,7 +114,6 @@ Print bundled CLI documentation.
114
114
  - `openapi` — Print the HTTP OpenAPI 3.1 document as JSON.
115
115
  - `cli-schema` — Print the full CLI command tree as JSON.
116
116
  - `cli` — Print the full command reference as markdown.
117
- - `skill` — Print a reference agent SKILL; run `configure install` to install an optimized copy.
118
117
 
119
118
  ##### `full-example echo docs readme`
120
119
 
@@ -176,16 +175,6 @@ Print the full command reference as markdown.
176
175
  | --- | --- | --- | --- | --- |
177
176
  | `--save` | flag | optional | — | Write documentation to ./docs/. |
178
177
 
179
- ##### `full-example echo docs skill`
180
-
181
- Print a reference agent SKILL; run `configure install` to install an optimized copy.
182
-
183
- #### Options
184
-
185
- | Option | Type | Required | Format / default | Description |
186
- | --- | --- | --- | --- | --- |
187
- | `--save` | flag | optional | — | Write documentation to ./docs/. |
188
-
189
178
  #### `full-example echo mcp`
190
179
 
191
180
  MCP server and bundle tools.
@@ -262,7 +251,7 @@ Show app version.
262
251
  #### Subcommands
263
252
 
264
253
  - `version` — Print the program version.
265
- - `configure` — Set up agent skills and MCP config for this app (binary via Homebrew).
254
+ - `configure` — Set up MCP config for this app (binary via Homebrew).
266
255
  - `docs` — Print bundled CLI documentation.
267
256
  - `mcp` — MCP server and bundle tools.
268
257
  - `http` — HTTP API server for tools.
@@ -273,7 +262,7 @@ Print the program version.
273
262
 
274
263
  #### `full-example status configure`
275
264
 
276
- Set up agent skills and MCP config for this app (binary via Homebrew).
265
+ Set up MCP config for this app (binary via Homebrew).
277
266
 
278
267
  > Set up agent artifacts after the binary is installed via Homebrew (see README for tap install).
279
268
  >
@@ -348,7 +337,6 @@ Print bundled CLI documentation.
348
337
  - `openapi` — Print the HTTP OpenAPI 3.1 document as JSON.
349
338
  - `cli-schema` — Print the full CLI command tree as JSON.
350
339
  - `cli` — Print the full command reference as markdown.
351
- - `skill` — Print a reference agent SKILL; run `configure install` to install an optimized copy.
352
340
 
353
341
  ##### `full-example status docs readme`
354
342
 
@@ -410,16 +398,6 @@ Print the full command reference as markdown.
410
398
  | --- | --- | --- | --- | --- |
411
399
  | `--save` | flag | optional | — | Write documentation to ./docs/. |
412
400
 
413
- ##### `full-example status docs skill`
414
-
415
- Print a reference agent SKILL; run `configure install` to install an optimized copy.
416
-
417
- #### Options
418
-
419
- | Option | Type | Required | Format / default | Description |
420
- | --- | --- | --- | --- | --- |
421
- | `--save` | flag | optional | — | Write documentation to ./docs/. |
422
-
423
401
  #### `full-example status mcp`
424
402
 
425
403
  MCP server and bundle tools.
@@ -344,6 +344,7 @@
344
344
  "description": "Text to print."
345
345
  }
346
346
  },
347
+ "additionalProperties": false,
347
348
  "required": [
348
349
  "message"
349
350
  ]
@@ -450,7 +451,8 @@
450
451
  "application/json; charset=utf-8": {
451
452
  "schema": {
452
453
  "type": "object",
453
- "properties": {}
454
+ "properties": {},
455
+ "additionalProperties": false
454
456
  }
455
457
  }
456
458
  }