argsbarg 7.0.11 → 7.1.1

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +3 -2
  3. package/docs/ai-skills.md +2 -2
  4. package/docs/cli-program.md +3 -5
  5. package/docs/developing.md +3 -3
  6. package/docs/mcp.md +21 -8
  7. package/docs/output-schema.md +1 -1
  8. package/examples/full-example/AGENTS.md +20 -12
  9. package/examples/full-example/README.md +57 -12
  10. package/examples/full-example/biome.json +5 -4
  11. package/examples/full-example/bunfig.toml +3 -0
  12. package/examples/full-example/justfile +22 -27
  13. package/examples/full-example-json/AGENTS.md +14 -12
  14. package/examples/full-example-json/README.md +63 -15
  15. package/examples/full-example-json/biome.json +1 -3
  16. package/examples/full-example-json/bunfig.toml +3 -0
  17. package/examples/full-example-json/justfile +22 -27
  18. package/examples/mcp-plugin/.claude-plugin/marketplace.json +13 -0
  19. package/examples/mcp-plugin/.claude-plugin/plugin.json +10 -0
  20. package/examples/mcp-plugin/.cursor/hooks/run-tests-on-stop.ts +56 -0
  21. package/examples/mcp-plugin/.cursor/hooks.json +12 -0
  22. package/examples/mcp-plugin/.cursor-plugin/plugin.json +11 -0
  23. package/examples/mcp-plugin/.mcp.json +6 -0
  24. package/examples/mcp-plugin/AGENTS.md +90 -0
  25. package/examples/mcp-plugin/CLAUDE.md +1 -0
  26. package/examples/mcp-plugin/README.md +72 -0
  27. package/examples/mcp-plugin/biome.json +20 -0
  28. package/examples/mcp-plugin/bun.lock +48 -0
  29. package/examples/mcp-plugin/bunfig.toml +3 -0
  30. package/examples/mcp-plugin/docs/README.md +27 -0
  31. package/examples/mcp-plugin/docs/cli-schema.json +2085 -0
  32. package/examples/mcp-plugin/docs/cli.md +2026 -0
  33. package/examples/mcp-plugin/docs/http.md +92 -0
  34. package/examples/mcp-plugin/docs/mcp.md +116 -0
  35. package/examples/mcp-plugin/docs/openapi.json +1243 -0
  36. package/examples/mcp-plugin/justfile +89 -0
  37. package/examples/mcp-plugin/mcp.json +8 -0
  38. package/examples/mcp-plugin/package.json +23 -0
  39. package/examples/mcp-plugin/scripts/create-identity.ts +12 -0
  40. package/examples/mcp-plugin/scripts/mcp.mjs +11106 -0
  41. package/examples/mcp-plugin/scripts/release.ts +225 -0
  42. package/examples/mcp-plugin/skills/mcp-plugin/SKILL.md +59 -0
  43. package/examples/mcp-plugin/src/commands/echo/command.ts +26 -0
  44. package/examples/mcp-plugin/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
  45. package/examples/mcp-plugin/src/commands/render-json/__generated__/index.ts +5 -0
  46. package/examples/mcp-plugin/src/commands/render-json/command.test.ts +46 -0
  47. package/examples/mcp-plugin/src/commands/render-json/command.ts +30 -0
  48. package/examples/mcp-plugin/src/commands/render-json/types.ts +9 -0
  49. package/examples/mcp-plugin/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
  50. package/examples/mcp-plugin/src/commands/status/__generated__/index.ts +5 -0
  51. package/examples/mcp-plugin/src/commands/status/command.test.ts +10 -0
  52. package/examples/mcp-plugin/src/commands/status/command.ts +28 -0
  53. package/examples/mcp-plugin/src/commands/status/types.ts +6 -0
  54. package/examples/mcp-plugin/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
  55. package/examples/mcp-plugin/src/commands/workspaces/__generated__/index.ts +5 -0
  56. package/examples/mcp-plugin/src/commands/workspaces/command.test.ts +58 -0
  57. package/examples/mcp-plugin/src/commands/workspaces/command.ts +94 -0
  58. package/examples/mcp-plugin/src/commands/workspaces/types.ts +6 -0
  59. package/examples/mcp-plugin/src/db/index.test.ts +86 -0
  60. package/examples/mcp-plugin/src/db/index.ts +77 -0
  61. package/examples/mcp-plugin/src/db/tables/workspaces.ts +58 -0
  62. package/examples/mcp-plugin/src/index.ts +10 -0
  63. package/examples/mcp-plugin/src/program.ts +32 -0
  64. package/examples/mcp-plugin/src/types/argsbarg.d.ts +11 -0
  65. package/examples/mcp-plugin/src/types/md.d.ts +4 -0
  66. package/examples/mcp-plugin/tsconfig.json +17 -0
  67. package/index.d.ts +12 -0
  68. package/package.json +1 -1
  69. package/src/builtins/mcp.ts +1 -1
  70. package/src/cli-tool/create.test.ts +5 -0
  71. package/src/cli-tool/create.ts +9 -1
  72. package/src/cli-tool/program.ts +1 -1
  73. package/src/config/manifest.ts +56 -0
  74. package/src/config/resolve.test.ts +12 -12
  75. package/src/configure/configure.test.ts +5 -3
  76. package/src/core/parse.test.ts +6 -5
  77. package/src/core/types.ts +12 -0
  78. package/src/exports/mcp.ts +12 -0
  79. package/src/headless/tool-call.test.ts +32 -0
  80. package/src/headless/tool-call.ts +19 -8
  81. package/src/mcp/bundle.ts +15 -5
  82. package/src/mcp/claude.test.ts +2 -7
  83. package/src/mcp/claude.ts +52 -68
  84. package/src/mcp/cursor.test.ts +151 -0
  85. package/src/mcp/cursor.ts +157 -0
  86. package/src/mcp/hidden-mcpb.test.ts +34 -1
  87. package/src/mcp/plugin-shared.ts +107 -0
  88. package/src/mcp/result.ts +5 -1
  89. package/src/mcp/server.ts +3 -2
  90. package/src/test/fixtures.ts +13 -0
  91. package/src/test/integration/mcp.test.ts +8 -7
  92. package/examples/full-example/scripts/print-identity.ts +0 -28
  93. package/examples/full-example-json/scripts/print-identity.ts +0 -28
@@ -0,0 +1,92 @@
1
+ <!-- Generated by full-example-json docs http --save; do not edit. -->
2
+
3
+ # HTTP API (full-example-json)
4
+
5
+ full-example-json exposes user commands over HTTP REST routes derived from the CLI tree.
6
+
7
+ ## Running
8
+
9
+ ```bash
10
+ full-example-json http
11
+ ```
12
+
13
+ Listens on **http://127.0.0.1:3000** by default (`httpServer.host` / `httpServer.port`).
14
+
15
+ Bind is localhost-only by default — use a reverse proxy for remote access.
16
+
17
+ ## Endpoints
18
+
19
+ | Method | Path | Purpose |
20
+ | --- | --- | --- |
21
+ | `GET` | `/health/liveness` | Liveness — server is online and accepting requests |
22
+ | `GET` | `/health/readiness` | Readiness — online plus config and `program.readiness` checks passed |
23
+ | `GET` | `/openapi.json` | OpenAPI 3.1 REST paths |
24
+ | `GET` | `/swagger` | Interactive Swagger UI API reference |
25
+ | * | `/*` | Invoke user commands (method per route) |
26
+ | `OPTIONS` | `*` | CORS preflight |
27
+
28
+ Discover paths from `openapi.json` (`/*`). Query binds options; POST/PUT/PATCH body binds options and `inputSchema` fields.
29
+
30
+ ## Examples
31
+
32
+ ```bash
33
+ curl -s http://127.0.0.1:3000/health/liveness
34
+ curl -s http://127.0.0.1:3000/health/readiness
35
+ curl -s http://127.0.0.1:3000/openapi.json
36
+ curl -s http://127.0.0.1:3000/workspaces
37
+ curl -s -X POST http://127.0.0.1:3000/workspaces \
38
+ -H "content-type: application/json" \
39
+ -d '{"name":"qa2"}'
40
+ ```
41
+
42
+ ## Responses
43
+
44
+ Success: status from handler → `http.successStatus` → method default (GET 200, POST 201, DELETE 204).
45
+
46
+ Handlers must use `ctx.respond()` or return a value for API/MCP tool calls.
47
+
48
+ Errors use `{ "error": "..." }` with `400`, `404`, `503`, or `500`.
49
+
50
+ ## Logging
51
+
52
+ Server logs go to **stderr** (one JSON object per line by default).
53
+
54
+ - Configure with `program.log` on the program root
55
+ - **`enrich`** — add custom JSON fields on top of the default line
56
+ - **`serialize`** — replace the formatter and emit your own line shape
57
+
58
+ See the argsbarg [logging guide](https://github.com/bdombro/bun-argsbarg/blob/main/docs/logging.md) for examples and the full `LogEnrichContext` shape.
59
+
60
+ ## REST routes
61
+
62
+ - `POST /echo` (CLI: `full-example-json echo`) — Echo a message (MCP-friendly leaf).
63
+ - `POST /render-json` (CLI: `full-example-json render-json`) — Echo a JSON message (schema-first JSON leaf demo).
64
+ - `POST /status` (CLI: `full-example-json status`) — Show app version.
65
+ - `GET /workspaces` (CLI: `full-example-json workspaces get`) — List workspaces.
66
+ - `POST /workspaces` (CLI: `full-example-json workspaces post`) — Create a workspace.
67
+ - `GET /workspaces/{id}` (CLI: `full-example-json workspaces :id get`) — Get one workspace.
68
+ - `PUT /workspaces/{id}` (CLI: `full-example-json workspaces :id put`) — Replace a workspace.
69
+ - `PATCH /workspaces/{id}` (CLI: `full-example-json workspaces :id patch`) — Patch a workspace name.
70
+ - `DELETE /workspaces/{id}` (CLI: `full-example-json workspaces :id delete`) — Delete a workspace.
71
+
72
+ ## Request bodies
73
+
74
+ POST/PUT/PATCH bodies are a flat JSON object keyed by long option and positional names (hyphenated option names are valid keys).
75
+
76
+ For HTTP clients, use **`GET /openapi.json`** (or **`GET /swagger`**) for per-route request shapes.
77
+
78
+ Varargs positionals accept a JSON array of strings (not a comma-separated string).
79
+ Options with `format: comma-list` accept a comma-separated string or JSON array.
80
+ Options with a schema `default` are applied when omitted.
81
+
82
+ Shell invocation reference: `full-example-json docs cli`. Full CLI tree JSON: `full-example-json docs cli-schema`.
83
+
84
+ ## OpenAPI
85
+
86
+ The HTTP API is described in OpenAPI 3.1.
87
+
88
+ - **Browse** — [http://127.0.0.1:3000/swagger](http://127.0.0.1:3000/swagger) (Swagger UI; loads `/openapi.json`)
89
+ - **Fetch** — `curl -s http://127.0.0.1:3000/openapi.json`
90
+ - **Save offline** — `full-example-json docs openapi --save` → `./docs/openapi.json` (or `just docgen` in app repos)
91
+
92
+ Use the spec to discover REST paths and request/response shapes before calling `/*`.
@@ -0,0 +1,116 @@
1
+ <!-- Generated by full-example-json docs mcp --save; do not edit. -->
2
+
3
+ # MCP server (full-example-json)
4
+
5
+ full-example-json exposes an MCP server with features similar to the CLI.
6
+
7
+ ## Installation
8
+
9
+ ### `.agents` auto-install
10
+
11
+ When `mcpServer.enabled` is set, `configure install` merges this server into `~/.agents/mcp.json` per the https://dotagentsprotocol.com.
12
+
13
+ Install the CLI first so `full-example-json` is on your PATH (e.g. `brew install full-example-json`).
14
+
15
+ ```bash
16
+ full-example-json configure install
17
+ ```
18
+
19
+ Writes or updates `~/.agents/mcp.json` with a `mcpServers` entry for this app.
20
+
21
+ ### Manual client setup
22
+
23
+ Many clients do not read `~/.agents/mcp.json` yet. Copy the `mcpServers` entry from that file, or paste:
24
+
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "full_example_json": {
29
+ "command": "full-example-json",
30
+ "args": [
31
+ "mcp"
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ | Client | Config file |
39
+ | --- | --- |
40
+ | **Cursor** | `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project) |
41
+ | **Claude Code** | `~/.claude.json` under `mcpServers`, or project `.mcp.json` |
42
+ | **Claude Desktop** | See platform paths below |
43
+
44
+ Restart Cursor or reload MCP after editing. Restart Claude Desktop after config changes.
45
+
46
+ Claude Desktop config paths:
47
+
48
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
49
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
50
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json`
51
+
52
+ On this machine (macOS/Linux): `/Users/briandombrowski/Library/Application Support/Claude/claude_desktop_config.json`
53
+
54
+ ### Manual `mcpServers` entry
55
+
56
+ Same shape as in `~/.agents/mcp.json`:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "full_example_json": {
62
+ "command": "full-example-json",
63
+ "args": [
64
+ "mcp"
65
+ ]
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## Running directly
72
+
73
+ Start the stdio MCP server without editing host config:
74
+
75
+ ```bash
76
+ full-example-json mcp
77
+ ```
78
+
79
+ ## Environment
80
+
81
+ - **`shellEnv`** — on by default; captures login-shell environment at MCP startup (PATH, toolchain shims, exports). Opt out with `shellEnv: false`.
82
+
83
+ ## What agents get
84
+
85
+ | Mechanism | Purpose |
86
+ |-----------|---------|
87
+ | `tools/list` | Callable tools for exposed leaf commands |
88
+ | `tools/call` | Runs handlers headlessly; JSON stdout becomes `structuredContent` when valid |
89
+ | Schema resource | `full_example_json://schema` — same JSON as `full-example-json docs cli-schema` |
90
+ | Docs topic `readme` | `full_example_json://docs/readme` — same markdown as `full-example-json docs readme` |
91
+
92
+ ## Exposed tools
93
+
94
+ - `full-example-json echo` — echo — Echo a message (MCP-friendly leaf).
95
+ - `full-example-json render-json` — render-json — Echo a JSON message (schema-first JSON leaf demo).
96
+ - `full-example-json status` — status — Show app version.
97
+ - `full-example-json workspaces :id delete` — workspaces :id delete — Delete a workspace.
98
+ - `full-example-json workspaces :id get` — workspaces :id get — Get one workspace.
99
+ - `full-example-json workspaces :id patch` — workspaces :id patch — Patch a workspace name.
100
+ - `full-example-json workspaces :id put` — workspaces :id put — Replace a workspace.
101
+ - `full-example-json workspaces get` — workspaces get — List workspaces.
102
+ - `full-example-json workspaces post` — workspaces post — Create a workspace.
103
+
104
+ ## Tool arguments
105
+
106
+ Arguments are a flat JSON object keyed by long option and positional names (hyphenated option names are valid keys).
107
+ See `full-example-json docs cli-schema` or the schema resource for per-tool shapes.
108
+
109
+ Varargs positionals accept a JSON array of strings (not a comma-separated string).
110
+ Options with `format: comma-list` accept a comma-separated string or JSON array.
111
+ Options with a schema `default` are applied when omitted.
112
+
113
+ ## Protocol
114
+
115
+ Stdio NDJSON JSON-RPC. Help and `docs cli-schema` are not available through tool calls.
116
+ Run `full-example-json docs` for bundled user documentation.