Commit Graph

527 Commits

Author SHA1 Message Date
Peter Steinberger
50619cb48a fix: align --raw-strings and --no-coerce semantics (#59) (thanks @nobrainer-tech) 2026-03-02 21:35:33 +00:00
nobrainer-tech
3325d32d03 Add --raw-strings flag to prevent numeric string coercion
Values like phone numbers, PINs, or codes with leading zeros (e.g. 000123)
are auto-coerced to numbers by default. The --raw-strings flag (or --no-coerce
alias) preserves them as strings.

Note: Cannot use --raw as the flag name because it conflicts with the
existing --raw output format shortcut in output-format.ts.

Fixes: numeric strings being silently converted to numbers
2026-03-02 21:34:19 +00:00
Peter Steinberger
30abe3d9a5 fix: stabilize oauth wait/redirect deferred lifecycle (#70) (thanks @monotykamary) 2026-03-02 20:02:11 +00:00
Tom X Nguyen
5edc213a9e fix(oauth): prevent race condition in authorization code wait
Ensure waitForAuthorizationCode uses the same deferred created by redirectToAuthorization instead of creating a new one. If waitForAuthorizationCode is called before redirectToAuthorization has been invoked, it now waits for the redirect to be initiated before proceeding. This fixes the race condition where the OAuth callback could resolve a different promise than what the runtime was waiting on, causing authentication to fail with a timeout.

Fixes #36
2026-03-02 20:02:11 +00:00
Peter Steinberger
cb06392738 fix: harden raw output inspect depth and add regression coverage (#91) (thanks @Blankdlh) 2026-03-02 19:17:29 +00:00
Blankdlh
9746dab9d2 fix: collect all JSON entries from MCP content arrays instead of only the first
Previously json() in createCallResult returned early on the first
parseable JSON entry. When an MCP server returned multiple results
in the content array, only the first item was ever surfaced.

Now all parseable entries are collected. A single item still returns
as a single object (backward compatible); multiple items return as
an array.

Also increased inspect depth in printRaw from 2 to null to prevent
truncation of deeply nested list results.
2026-03-02 19:17:29 +00:00
Peter Steinberger
98c300b3dc fix: harden oauth headless flow + add scope override/tests (#72) (thanks @mgonto) 2026-03-02 18:32:55 +00:00
Martin Gontovnikas
b908c4bbe3 fix: close callback server on persistence errors during stale-client check
Address review feedback: wrap the redirect URI mismatch check in
try/catch so that if readClientInfo() or clear() throws (malformed
cache JSON, filesystem permissions), the already-bound HTTP callback
server is closed before rethrowing. Prevents the process from hanging
with an open listener in failure paths.
2026-03-02 18:32:55 +00:00
Martin Gontovnikas
31142e03a6 fix(oauth): three fixes for headless servers and non-standard OAuth providers
1. Remove hardcoded scope='mcp:tools' from client metadata.
   Providers like Granola reject this scope at the authorize endpoint
   (invalid_scope). Let the MCP SDK derive scope from server metadata
   instead, falling back to the auth server's scopes_supported.

2. Swallow xdg-open ENOENT on headless Linux servers.
   On VPS/CI environments without a desktop, spawning xdg-open throws
   an unhandled error event that crashes the process before the OAuth
   callback server can receive the redirect.

3. Clear stale client registration when dynamic callback port changes.
   With dynamic ports (the default), each run picks a different port.
   If a previous client registration is cached with a different
   redirect_uri, the auth server rejects subsequent requests with
   invalid_redirect_uri. Now detects the mismatch and re-registers.

Fixes #67
2026-03-02 18:32:55 +00:00
Peter Steinberger
938c09cf0f chore(deps): update dependencies to latest 2026-03-02 17:39:57 +00:00
Peter Steinberger
8cc23a2388 chore: update copyright year to 2026 2026-01-01 14:22:48 +01:00
Peter Steinberger
d55b813c4f fix: preserve config imports defaults 2025-12-30 01:25:04 +01:00
Peter Steinberger
6b9fa78bdb chore: start 0.7.4 2025-12-30 00:48:30 +01:00
Peter Steinberger
e18af40078 docs: add front matter to live tests 2025-12-30 00:09:03 +01:00
Peter Steinberger
3c092e7a0f docs: finalize 0.7.3 release notes 2025-12-30 00:08:27 +01:00
Peter Steinberger
103aa63cfd docs: clarify release definition 2025-12-29 23:56:46 +01:00
Peter Steinberger
9b216b9820 test(windows): run pnpm via cmd.exe 2025-12-29 23:38:06 +01:00
Peter Steinberger
3f654d1ae9 test(windows): use pnpm.cmd in integration builds 2025-12-29 23:30:07 +01:00
Peter Steinberger
522276c599 test: rename bun cli e2e 2025-12-29 23:22:00 +01:00
Peter Steinberger
4a6f25478f test(oauth): isolate callback state persistence 2025-12-29 23:16:14 +01:00
Peter Steinberger
08128fe3b6 test: avoid generate-cli timeouts under coverage 2025-12-29 23:14:28 +01:00
Peter Steinberger
ea85104bb0 style: format ban cli test 2025-12-29 23:12:34 +01:00
Peter Steinberger
cabe3f47d6 chore: set version to 0.7.3 2025-12-29 23:11:07 +01:00
Peter Steinberger
78d7631d3f test: add ban CLI end-to-end 2025-12-29 23:11:07 +01:00
Peter Steinberger
2670b59e91 chore(deps): update lockfile 2025-12-29 23:11:07 +01:00
Peter Steinberger
4cc11329f7 chore: add vitest coverage 2025-12-29 23:07:02 +01:00
Peter Steinberger
53eedf8f29 test: increase generate-cli integration timeout 2025-12-29 23:06:53 +01:00
Peter Steinberger
91386bbc67 feat(generate-cli): filter tools in generated CLIs
Co-authored-by: Zack Leman <6403966+zackleman@users.noreply.github.com>
2025-12-29 21:23:46 +01:00
Peter Steinberger
523b6f377a docs: credit contributors 2025-12-29 21:00:45 +01:00
Peter Steinberger
eca5af9a09
Merge pull request #27 from rawwerks/fix/array-item-type-coercion
fix: coerce array elements to proper types based on JSON schema
2025-12-29 20:48:22 +01:00
Peter Steinberger
ecfbaee7f9 fix: coerce array option items 2025-12-29 20:47:04 +01:00
Raymond Weitekamp
d2f0de130b fix: coerce array elements to proper types based on schema
When parsing CLI array arguments like `--corner1 0,0`, the values were
being split by comma but kept as strings. This caused JSON schema
validation to fail when the schema specified number arrays.

Changes:
- Add `arrayItemType` field to `GeneratedOption` interface
- Add `inferArrayItemType()` function to extract item type from schema
- Update `optionParser()` to coerce array elements based on item type:
  - number arrays: parseFloat each element
  - boolean arrays: compare against 'false'
  - string arrays: trim whitespace (existing behavior)

Fixes issues with MCP tools that have array<number> parameters like
Onshape's `create_sketch_rectangle` which expects corner coordinates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 20:45:51 +01:00
Peter Steinberger
d1cf5572f9 chore: release 0.7.2 2025-12-29 20:35:43 +01:00
Peter Steinberger
cd36e8fe61
Merge pull request #28 from rawwerks/fix/camelcase-option-names
fix(generate-cli): use camelCase for Commander.js option names
2025-12-29 20:25:09 +01:00
Raymond Weitekamp
8b7b7328e9 fix(generate-cli): use camelCase for Commander.js option names
Commander.js converts kebab-case flag names (e.g., --relative-path) to
camelCase property names (e.g., relativePath) when accessing cmdOpts.

The generated CLI template was using the original property names from the
schema (often snake_case), causing option values to not be recognized.

This converts the CLI option name to camelCase when generating cmdOpts
property access.
2025-12-24 17:55:57 -05:00
Peter Steinberger
8e7861d383 Release 0.7.1 2025-12-08 23:42:56 +00:00
Peter Steinberger
a99cc56bb4 config: update playwright and iterm entries 2025-12-08 23:42:13 +00:00
Peter Steinberger
2238352336 Changelog: move daemon note to unreleased 2025-12-08 23:34:58 +00:00
Peter Steinberger
6a16e80ce1 Daemon restart on config changes 2025-12-08 21:09:57 +00:00
Peter Steinberger
571e9183e0 Docs: clarify release title format 2025-12-06 04:45:26 +01:00
Peter Steinberger
67c1c871f5 Chore: add Unreleased placeholder 2025-12-06 04:41:26 +01:00
Peter Steinberger
699a184d9c Release 0.7.0 2025-12-06 04:38:58 +01:00
Peter Steinberger
872c9a953e fix(oauth): enforce state and custom callbacks 2025-12-06 02:49:52 +01:00
Peter Steinberger
38c6f99bce chore: store oauth vault in credentials.json 2025-12-06 02:24:45 +01:00
Peter Steinberger
85b0a3e3d5 test(oauth): cover vault + migration 2025-12-06 02:17:14 +01:00
Peter Steinberger
5d39d00fff chore(changelog): tag 0.7.0 2025-12-06 02:12:09 +01:00
Peter Steinberger
b652bbdecc chore(changelog): fold 0.6.7 into unreleased 2025-12-06 02:11:34 +01:00
Peter Steinberger
54f8f2eecb chore(changelog): 0.6.7 raw output 2025-12-06 01:48:28 +01:00
Peter Steinberger
4afb948228
fix(ci): keep raw output untruncated (#23) 2025-12-06 00:46:04 +00:00
Kenn Costales
4a07ceedf3
fix(cli): prevent silent string truncation to 10k characters in raw output (#22)
* fix(cli): prevent string truncation in raw output

Node's util.inspect() has a default maxStringLength of 10000 characters,
causing large MCP responses to be truncated with '... N more characters'.

See: https://nodejs.org/api/util.html#utilinspectobject-options

This affects --output raw and the default output format when it falls
back to printRaw().

Fix: set maxStringLength: null to disable string truncation while
preserving depth: 2 for readable nested object summaries.

Verify (before fix shows 10000, after fix shows 15000):
  node -e "console.log('x count:', (require('util').inspect({t:'x'.repeat(15000)}, {depth:2}).match(/x/g)||[]).length)"
  node -e "console.log('x count:', (require('util').inspect({t:'x'.repeat(15000)}, {depth:2, maxStringLength:null}).match(/x/g)||[]).length)"

* test(cli): ensure raw output not truncated

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2025-12-06 00:32:57 +00:00