Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9286b25
feat(types): Implement SEP-1577 - Sampling with Tools
ochafik Oct 1, 2025
58ea5dc
rm tmp
ochafik Oct 1, 2025
353789a
refactor: Remove isError from ToolResultContent to align with Claude/…
ochafik Oct 1, 2025
3c287c8
add sampling backfill example
ochafik Oct 1, 2025
744c83d
Update backfillSampling.ts
ochafik Oct 1, 2025
735b413
Merge branch 'ochafik/sampling-backfill-example' into ochafik/sep1577
ochafik Oct 1, 2025
cc03097
feat(examples): Add tool calling support to sampling backfill proxy
ochafik Oct 1, 2025
e5c5df2
feat(examples): Add toolLoopSampling example demonstrating agentic fi…
ochafik Oct 1, 2025
c856187
docs: Add comprehensive test patterns analysis for sampling
ochafik Oct 1, 2025
b688779
test(examples): Add comprehensive tests for toolLoopSampling
ochafik Oct 1, 2025
48cc38c
Update backfillSampling.ts
ochafik Oct 1, 2025
ddac3b1
Merge branch 'ochafik/sampling-backfill-example' into ochafik/sep1577
ochafik Oct 1, 2025
751d102
Update backfillSampling.ts
ochafik Oct 1, 2025
3650608
Merge branch 'ochafik/sampling-backfill-example' into ochafik/sep1577
ochafik Oct 1, 2025
265c227
fix(examples): Handle CreateMessageResult.content as array in toolLoo…
ochafik Oct 1, 2025
2ed11ea
updated result content to be a content or content array
ochafik Oct 1, 2025
f583264
feat(examples): Add logging feedback for tool loop operations
ochafik Oct 1, 2025
c4a4582
feat(examples): Add line range support and tool-specific logging to t…
ochafik Oct 1, 2025
a924cfa
rm unrelated changes
ochafik Oct 1, 2025
0f7885e
rm unrelated changes
ochafik Oct 1, 2025
01903a1
improve backfill errors
ochafik Oct 1, 2025
48115e4
less logs in toolLoopSampling
ochafik Oct 1, 2025
0ec533a
feat(examples): Add aggregated token usage tracking to toolLoopSampling
ochafik Oct 1, 2025
c12620d
Update toolLoopSampling.ts
ochafik Oct 1, 2025
ed94c4e
feat(examples): Support array content in SamplingMessage
ochafik Oct 1, 2025
a7c92b4
allow content arrays in SamplingMessage
ochafik Oct 1, 2025
70120a2
Merge branch 'ochafik/sep1577' of https://github.com/modelcontextprot…
ochafik Oct 1, 2025
e6cf5f8
Add toolChoice.mode == "none" + to help gracefully handle last iterat…
ochafik Oct 1, 2025
46fc761
rename: fileSearch -> localResearch
ochafik Oct 1, 2025
ed29d47
pin zod version compatible w/ dev dep of claude api
ochafik Oct 1, 2025
e45b5b1
Update toolLoopSampling.test.ts
ochafik Oct 1, 2025
a8affb3
align ToolResultContentSchema on (subset of) CallToolResult
ochafik Oct 6, 2025
904d036
Update backfillSampling.ts
ochafik Oct 6, 2025
daedb61
Update backfillSampling.ts
ochafik Oct 6, 2025
27d36a1
Update toolLoopSampling.ts
ochafik Oct 6, 2025
193bb38
allow AudioContent in ToolResultContent.content
ochafik Oct 6, 2025
0e3f45c
Fix and simplify CallableTool examples
ochafik Oct 6, 2025
86a6c91
Update backfillSampling.ts
ochafik Oct 6, 2025
f1f983b
Merge branch 'ochafik/sep1577' of https://github.com/modelcontextprot…
ochafik Oct 9, 2025
28441ce
add examples:tool-loop & prepare script to simplify testing
ochafik Oct 9, 2025
8d180d3
Fix examples:tool-loop script to use built files for npx execution
ochafik Oct 9, 2025
3377665
Update package.json
ochafik Oct 9, 2025
70843ad
Add example-tool-loop binary wrapper for npx usage
ochafik Oct 9, 2025
459a66c
Update package.json
ochafik Oct 9, 2025
b60b516
update run setup
ochafik Oct 9, 2025
d46703f
Refactor toolLoopSampling example w/ ToolRegistry
ochafik Oct 10, 2025
b14e07c
Update toolLoopSampling.ts
ochafik Oct 10, 2025
d372eff
Delete callables.ts
ochafik Oct 10, 2025
f86cf10
rename local researcher example
ochafik Oct 10, 2025
929e9a4
tool loop & tool registry files
ochafik Oct 10, 2025
d76449a
Create adventureGame.ts (sampling + elicitation example)
ochafik Oct 10, 2025
2c5ab4c
Update adventureGame.ts
ochafik Oct 10, 2025
145cad3
fix adventure game command
ochafik Oct 10, 2025
07cacff
fix build
ochafik Oct 10, 2025
7ec4f3c
Update toolLoop.ts
ochafik Oct 10, 2025
b41580f
Merge branch 'main' into ochafik/sep1577
ochafik Oct 16, 2025
8b02940
align ToolResultContentSchema.content on CallToolResultSchema.content
ochafik Oct 27, 2025
cffef1b
add ToolResultContent._meta
ochafik Oct 27, 2025
d09601f
convert resource / resource_link to Claude API equivalents when possi…
ochafik Oct 27, 2025
337ad89
Merge branch 'main' into ochafik/sep1577
ochafik Nov 7, 2025
c0976cf
Fix TypeScript build errors
ochafik Nov 7, 2025
89f14e5
ToolCallContent -> ToolUseContent
ochafik Nov 7, 2025
262f0aa
Update types.test.ts
ochafik Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,188 changes: 1,581 additions & 1,607 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
"modelcontextprotocol",
"mcp"
],
"bin": {
"backfill-sampling": "./dist/backfillSampling.js",
"example-local-researcher": "./dist/simpleLocalResearcher.js",
"example-adventure-game": "./dist/adventureGame.js"
},
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand Down Expand Up @@ -61,12 +66,17 @@
"scripts": {
"fetch:spec-types": "tsx scripts/fetch-spec-types.ts",
"typecheck": "tsgo --noEmit",
"build": "npm run build:esm && npm run build:cjs",
"build": "npm run build:esm && npm run build:cjs && npm run build:backfill-sampling && npm run build:example-local-researcher && npm run build:example-adventure-game",
"build:esm": "mkdir -p dist/esm && echo '{\"type\": \"module\"}' > dist/esm/package.json && tsc -p tsconfig.prod.json",
"build:esm:w": "npm run build:esm -- -w",
"build:cjs": "mkdir -p dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.cjs.json",
"build:cjs:w": "npm run build:cjs -- -w",
"examples:simple-server:w": "tsx --watch src/examples/server/simpleStreamableHttp.ts --oauth",
"examples:local-researcher": "tsx src/examples/backfill/backfillSampling.ts tsx src/examples/server/simpleLocalResearcher.ts",
"examples:adventure-game": "tsx src/examples/backfill/backfillSampling.ts tsx src/examples/server/adventureGame.ts",
"build:backfill-sampling": "bun build src/examples/backfill/backfillSampling.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/backfillSampling.js",
"build:example-local-researcher": "bun build src/examples/server/simpleLocalResearcher.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/simpleLocalResearcher.js",
"build:example-adventure-game": "bun build src/examples/server/adventureGame.ts --outdir=dist --banner '#!/usr/bin/env node' --target=node --minify && shx chmod +x dist/adventureGame.js",
"prepack": "npm run build:esm && npm run build:cjs",
"lint": "eslint src/ && prettier --check .",
"lint:fix": "eslint src/ --fix && prettier --write .",
Expand All @@ -89,6 +99,7 @@
"pkce-challenge": "^5.0.0",
"raw-body": "^3.0.0",
"zod": "^3.23.8",
"zod-from-json-schema": "^0.5.0",
"zod-to-json-schema": "^3.24.1"
},
"peerDependencies": {
Expand All @@ -100,6 +111,7 @@
}
},
"devDependencies": {
"@anthropic-ai/sdk": "^0.66.0",
"@cfworker/json-schema": "^4.1.1",
"@eslint/js": "^9.8.0",
"@jest-mock/express": "^3.0.0",
Expand All @@ -113,6 +125,7 @@
"@types/node": "^22.0.2",
"@types/supertest": "^6.0.2",
"@types/ws": "^8.5.12",
"bun": "^1.3.0",
"@typescript/native-preview": "^7.0.0-dev.20251103.1",
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.1.8",
Expand Down
Loading
Loading