argsbarg 7.0.10 → 7.1.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +26 -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 +20 -7
  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/plugin.json +11 -0
  19. package/examples/mcp-plugin/.cursor/hooks/run-tests-on-stop.ts +56 -0
  20. package/examples/mcp-plugin/.cursor/hooks.json +12 -0
  21. package/examples/mcp-plugin/.cursor-plugin/plugin.json +12 -0
  22. package/examples/mcp-plugin/.mcp.json +6 -0
  23. package/examples/mcp-plugin/AGENTS.md +90 -0
  24. package/examples/mcp-plugin/CLAUDE.md +1 -0
  25. package/examples/mcp-plugin/README.md +70 -0
  26. package/examples/mcp-plugin/biome.json +20 -0
  27. package/examples/mcp-plugin/bun.lock +48 -0
  28. package/examples/mcp-plugin/bunfig.toml +3 -0
  29. package/examples/mcp-plugin/docs/README.md +27 -0
  30. package/examples/mcp-plugin/docs/cli-schema.json +2085 -0
  31. package/examples/mcp-plugin/docs/cli.md +2026 -0
  32. package/examples/mcp-plugin/docs/http.md +92 -0
  33. package/examples/mcp-plugin/docs/mcp.md +116 -0
  34. package/examples/mcp-plugin/docs/openapi.json +1243 -0
  35. package/examples/mcp-plugin/justfile +89 -0
  36. package/examples/mcp-plugin/mcp.json +8 -0
  37. package/examples/mcp-plugin/package.json +23 -0
  38. package/examples/mcp-plugin/scripts/create-identity.ts +12 -0
  39. package/examples/mcp-plugin/scripts/mcp.mjs +11106 -0
  40. package/examples/mcp-plugin/scripts/release.ts +225 -0
  41. package/examples/mcp-plugin/skills/mcp-plugin/SKILL.md +59 -0
  42. package/examples/mcp-plugin/src/commands/echo/command.ts +26 -0
  43. package/examples/mcp-plugin/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
  44. package/examples/mcp-plugin/src/commands/render-json/__generated__/index.ts +5 -0
  45. package/examples/mcp-plugin/src/commands/render-json/command.test.ts +46 -0
  46. package/examples/mcp-plugin/src/commands/render-json/command.ts +30 -0
  47. package/examples/mcp-plugin/src/commands/render-json/types.ts +9 -0
  48. package/examples/mcp-plugin/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
  49. package/examples/mcp-plugin/src/commands/status/__generated__/index.ts +5 -0
  50. package/examples/mcp-plugin/src/commands/status/command.test.ts +10 -0
  51. package/examples/mcp-plugin/src/commands/status/command.ts +28 -0
  52. package/examples/mcp-plugin/src/commands/status/types.ts +6 -0
  53. package/examples/mcp-plugin/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
  54. package/examples/mcp-plugin/src/commands/workspaces/__generated__/index.ts +5 -0
  55. package/examples/mcp-plugin/src/commands/workspaces/command.test.ts +58 -0
  56. package/examples/mcp-plugin/src/commands/workspaces/command.ts +94 -0
  57. package/examples/mcp-plugin/src/commands/workspaces/types.ts +6 -0
  58. package/examples/mcp-plugin/src/db/index.test.ts +86 -0
  59. package/examples/mcp-plugin/src/db/index.ts +77 -0
  60. package/examples/mcp-plugin/src/db/tables/workspaces.ts +58 -0
  61. package/examples/mcp-plugin/src/index.ts +10 -0
  62. package/examples/mcp-plugin/src/program.ts +32 -0
  63. package/examples/mcp-plugin/src/types/argsbarg.d.ts +11 -0
  64. package/examples/mcp-plugin/src/types/md.d.ts +4 -0
  65. package/examples/mcp-plugin/tsconfig.json +17 -0
  66. package/index.d.ts +12 -0
  67. package/package.json +1 -1
  68. package/src/builtins/mcp.ts +1 -1
  69. package/src/cli-tool/create.test.ts +5 -0
  70. package/src/cli-tool/create.ts +9 -1
  71. package/src/config/manifest.ts +56 -0
  72. package/src/config/resolve.test.ts +12 -12
  73. package/src/configure/configure.test.ts +5 -3
  74. package/src/core/parse.test.ts +6 -5
  75. package/src/core/types.ts +12 -0
  76. package/src/exports/mcp.ts +12 -0
  77. package/src/help.test.ts +36 -0
  78. package/src/help.ts +32 -19
  79. package/src/mcp/bundle.ts +12 -3
  80. package/src/mcp/claude.test.ts +2 -7
  81. package/src/mcp/claude.ts +49 -67
  82. package/src/mcp/cursor.test.ts +151 -0
  83. package/src/mcp/cursor.ts +155 -0
  84. package/src/mcp/hidden-mcpb.test.ts +34 -1
  85. package/src/mcp/plugin-shared.ts +107 -0
  86. package/src/mcp/result.ts +5 -1
  87. package/src/mcp/server.ts +3 -2
  88. package/src/test/fixtures.ts +13 -0
  89. package/src/test/integration/mcp.test.ts +8 -7
  90. package/examples/full-example/scripts/print-identity.ts +0 -28
  91. package/examples/full-example-json/scripts/print-identity.ts +0 -28
@@ -0,0 +1,89 @@
1
+ # bash (not sh); -e bail on errors, -u error on unset vars, pipefail fails pipelines when any stage fails
2
+ set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
3
+
4
+ export PATH := justfile_directory() + "/node_modules/.bin:" + env_var("PATH")
5
+
6
+ # List available recipes (default)
7
+ _:
8
+ @just --list
9
+
10
+ # Bundle the standalone Node MCP server script
11
+ build:
12
+ bun build ./src/index.ts --target=node --outfile=./scripts/mcp.mjs
13
+
14
+ # Run schemagen, typecheck, and format
15
+ check: schemagen format typecheck
16
+
17
+ # demo the HTTP API
18
+ demo-http:
19
+ #!/usr/bin/env bash
20
+ set -euo pipefail
21
+ bun ./src/index.ts http --port 13000 &
22
+ trap 'kill $! 2>/dev/null || true' EXIT
23
+ until curl -sf http://127.0.0.1:13000/health/liveness >/dev/null; do sleep 0.1; done
24
+
25
+ # demo a CLI command
26
+ demo-cli:
27
+ @just run mcp-plugin status
28
+
29
+ # demo a CLI command
30
+ demo-help:
31
+ @just run mcp-plugin --help
32
+
33
+ # Run the CLI from source with optional args; restarts on file changes
34
+ dev *ARGS:
35
+ bun --watch ./src/index.ts {{ARGS}}
36
+
37
+ # Regenerate consumer docs under ./docs/
38
+ docgen: schemagen
39
+ @just run docs cli-schema --save
40
+ @just run docs cli --save
41
+ @just run docs mcp --save
42
+ @just run docs http --save
43
+ @just run docs openapi --save
44
+
45
+ alias fmt := format
46
+
47
+ # Format and lint sources (auto-fix)
48
+ format:
49
+ bun run biome check ./src ./scripts --write --unsafe
50
+
51
+ # Run the HTTP server
52
+ http:
53
+ @just run http
54
+
55
+ # Link plugin into ~/.cursor/plugins/local/mcp-plugin for local testing
56
+ install-plugin-cursor: build
57
+ mkdir -p ~/.cursor/plugins/local
58
+ ln -sfn '{{justfile_directory()}}' ~/.cursor/plugins/local/mcp-plugin
59
+ @echo "Linked MCP plugin to ~/.cursor/plugins/local/mcp-plugin"
60
+
61
+ # Lint sources without writing
62
+ lint:
63
+ bun run biome check ./src ./scripts
64
+
65
+ # Run the CLI from source once
66
+ run *ARGS:
67
+ bun ./src/index.ts {{ARGS}}
68
+
69
+ # Generate JSON Schema artifacts from TypeScript types
70
+ schemagen:
71
+ argsbarg schemagen
72
+
73
+ # Install bun/npm dependencies and generate schemas
74
+ setup:
75
+ bun install
76
+ test -f node_modules/argsbarg/bin/argsbarg && ln -sf ../argsbarg/bin/argsbarg node_modules/.bin/argsbarg
77
+ just schemagen
78
+
79
+ # Run unit tests (after check)
80
+ test: check
81
+ bun test .
82
+
83
+ # Bump version, build, publish release
84
+ release *ARGS:
85
+ bun scripts/release.ts {{ARGS}}
86
+
87
+ # Typecheck without emitting build artifacts
88
+ typecheck:
89
+ bun run tsc --noEmit
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "mcp-plugin": {
4
+ "command": "node",
5
+ "args": ["${CURSOR_PLUGIN_ROOT}/scripts/mcp.mjs", "mcp"]
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "mcp-plugin",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "module": "src/index.ts",
7
+ "description": "Argsbarg MCP plugin template for Cursor and Claude Code marketplaces.",
8
+ "engines": {
9
+ "bun": ">=1.3"
10
+ },
11
+ "scripts": {
12
+ "biome": "biome",
13
+ "start": "bun run src/index.ts"
14
+ },
15
+ "dependencies": {
16
+ "argsbarg": "file:../.."
17
+ },
18
+ "devDependencies": {
19
+ "@biomejs/biome": "^2.5.0",
20
+ "@types/bun": "^1.3.12",
21
+ "typescript": "^5.9.3"
22
+ }
23
+ }
@@ -0,0 +1,12 @@
1
+ /** CLI identity — substituted by `argsbarg create`. */
2
+
3
+ export const createIdentity = {
4
+ key: "mcp-plugin",
5
+ className: "McpPlugin",
6
+ tap: "bdombro/bun-argsbarg",
7
+ homepage: "https://github.com/bdombro/bun-argsbarg",
8
+ releaseRepo: "bdombro/bun-argsbarg",
9
+ desc: "Argsbarg MCP plugin template for Cursor and Claude Code marketplaces",
10
+ envPrefix: "MCP_PLUGIN",
11
+ template: "plugin",
12
+ } as const;