Skip to content

Duck-type defineTool/GrantStore across @intx interface versions - #33

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5865-workspace-typecheck-fixes
Aug 14, 2026
Merged

Duck-type defineTool/GrantStore across @intx interface versions#33
TheGreatAxios merged 1 commit into
mainfrom
cl-5865-workspace-typecheck-fixes

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Follow-up to #31. Consuming this package as a git dependency in a monorepo whose vendored @intx/agent/@intx/authz are ahead of the last npm publish this package depends on (0.2.2) surfaced two real typecheck failures once the resident distiller's export graph pulled tools/install.ts and ports/writable-grant-store.ts into that consumer's compile:

  • defineTool's options in the newer interface add a static definitions field; this package's pinned version predates it.
  • GrantStore in the newer interface adds collectGrantsInChain; this package's pinned version predates it.

Both fixes bind the object to a named const before passing it to the typed API instead of a fresh object literal, so normal structural (duck-typed) parameter/return assignment applies instead of TypeScript's excess-property check on literals. The object satisfies either interface shape at compile time; at runtime an older caller simply never reads the extra field. No behavior change — bun test (401 pass) and tsc --noEmit both still green against this package's own pinned dependencies.

…llow-up)

Consumers with a newer @intx/agent (static definitions on defineTool
options) or @intx/authz (collectGrantsInChain on GrantStore) than this
package's own pinned dependency were failing to typecheck the raw
source pulled in transitively through the resident distiller's export
of the memory tool factories. Both fixes bind the object to a named
const before handing it to the typed API instead of a fresh literal,
so normal structural (duck-typed) assignment applies rather than
TypeScript's excess-property check on literals — the object satisfies
either interface shape, and an older caller simply never reads the
extra field.
@TheGreatAxios
TheGreatAxios merged commit 9e6f213 into main Aug 14, 2026
1 check passed
@TheGreatAxios
TheGreatAxios deleted the cl-5865-workspace-typecheck-fixes branch August 14, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant