Skip to content

Commit ea9c490

Browse files
authored
Merge pull request #48 from isaacus-dev/release-please--branches--main--changes--next--components--isaacus
release: 0.11.0
2 parents f0054fe + 94bd11e commit ea9c490

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+799
-472
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
1317
timeout-minutes: 10
1418
name: lint
1519
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

@@ -31,6 +36,7 @@ jobs:
3136
timeout-minutes: 5
3237
name: build
3338
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3440
permissions:
3541
contents: read
3642
id-token: write
@@ -66,6 +72,7 @@ jobs:
6672
timeout-minutes: 10
6773
name: test
6874
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
75+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
6976
steps:
7077
- uses: actions/checkout@v4
7178

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.10.0"
2+
".": "0.11.0"
33
}

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Changelog
22

3+
## 0.11.0 (2025-07-24)
4+
5+
Full Changelog: [v0.10.0...v0.11.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.10.0...v0.11.0)
6+
7+
### Features
8+
9+
* **client:** add support for endpoint-specific base URLs ([5f69f71](https://github.com/isaacus-dev/isaacus-typescript/commit/5f69f71f60b25ce1559a244ab666042b944533b0))
10+
* **mcp:** implement support for binary responses ([bec8bea](https://github.com/isaacus-dev/isaacus-typescript/commit/bec8beac1c9e9187aa3cbeb6ba49764763530277))
11+
* **mcp:** set X-Stainless-MCP header ([db4bb4f](https://github.com/isaacus-dev/isaacus-typescript/commit/db4bb4f568df5883c148250104123900466b2f05))
12+
* **mcp:** support filtering tool results by a jq expression ([8d0556f](https://github.com/isaacus-dev/isaacus-typescript/commit/8d0556f619b94473c24c362e72cbc4eaba644374))
13+
14+
15+
### Bug Fixes
16+
17+
* **ci:** release-doctor — report correct token name ([02f5170](https://github.com/isaacus-dev/isaacus-typescript/commit/02f5170723293eda6ae0995673136e3528c39f8c))
18+
* **client:** explicitly copy fetch in withOptions ([0112989](https://github.com/isaacus-dev/isaacus-typescript/commit/01129895de3a6d135186e75817f75c8512084985))
19+
* **client:** get fetchOptions type more reliably ([d2e9558](https://github.com/isaacus-dev/isaacus-typescript/commit/d2e9558832362fff02e3ffd5f5a950b609bdbd0c))
20+
* **mcp:** include required section for top-level properties and support naming transformations ([d7e791b](https://github.com/isaacus-dev/isaacus-typescript/commit/d7e791bb7a3afbe7d8bf6a2c48a010fd091ada8d))
21+
* **mcp:** relax input type for asTextContextResult ([1627904](https://github.com/isaacus-dev/isaacus-typescript/commit/1627904fcb3474757ba2a29f940b5a4ce067b053))
22+
* **mcp:** support jq filtering on cloudflare workers ([391d825](https://github.com/isaacus-dev/isaacus-typescript/commit/391d8252818ab34f67f7ca02119a6660cdbe5520))
23+
* publish script — handle NPM errors correctly ([6805e78](https://github.com/isaacus-dev/isaacus-typescript/commit/6805e78dc985503dd1f84a8de227aedd5dddf99d))
24+
25+
26+
### Chores
27+
28+
* add docs to RequestOptions type ([16b7822](https://github.com/isaacus-dev/isaacus-typescript/commit/16b7822028f977b12a1c262e6b0a6602fb1ce8dd))
29+
* avoid type error in certain environments ([8a16797](https://github.com/isaacus-dev/isaacus-typescript/commit/8a167970c0102371267194262318788f07dafc1d))
30+
* **ci:** enable for pull requests ([840289e](https://github.com/isaacus-dev/isaacus-typescript/commit/840289ede6ef0e034cf1b72a4d3a324d467cf43e))
31+
* **ci:** only run for pushes and fork pull requests ([cf544d1](https://github.com/isaacus-dev/isaacus-typescript/commit/cf544d1ae1cc37bb2cfd13189652bb2b0a2ab92e))
32+
* **client:** improve path param validation ([0c8d6f0](https://github.com/isaacus-dev/isaacus-typescript/commit/0c8d6f0123f808d8bc950936c45fbf7dfbe7ce07))
33+
* **client:** refactor imports ([301c341](https://github.com/isaacus-dev/isaacus-typescript/commit/301c34137a10f732d62218fedf0614a068acd997))
34+
* **docs:** use top-level-await in example snippets ([63d8953](https://github.com/isaacus-dev/isaacus-typescript/commit/63d895384acdadbeee292f951d524df90508c9b2))
35+
* **internal:** add pure annotations, make base APIResource abstract ([03358ec](https://github.com/isaacus-dev/isaacus-typescript/commit/03358ec382f8c487656f80e5679a73aa54e8a867))
36+
* **internal:** codegen related update ([bda7719](https://github.com/isaacus-dev/isaacus-typescript/commit/bda771936be7dd0db83239b898a9fb8e8fd4a6ce))
37+
* **internal:** fix readablestream types in node 20 ([604d380](https://github.com/isaacus-dev/isaacus-typescript/commit/604d380c9062489e279a76750b8cbf3707f16ecd))
38+
* make some internal functions async ([d763165](https://github.com/isaacus-dev/isaacus-typescript/commit/d76316597b31c533754260474bee660e515fbffc))
39+
* **mcp:** formatting ([62ef41e](https://github.com/isaacus-dev/isaacus-typescript/commit/62ef41ef9a61df100c684bb7cc694c299a84daf9))
40+
* **mcp:** provides high-level initMcpServer function and exports known clients ([43d4446](https://github.com/isaacus-dev/isaacus-typescript/commit/43d44461cf592c7a93277cc6b939ffaf23da2342))
41+
* **mcp:** rework imports in tools ([6d55f27](https://github.com/isaacus-dev/isaacus-typescript/commit/6d55f27f2157499c3ba7e5e137f821909269d5df))
42+
* **readme:** update badges ([2413a0e](https://github.com/isaacus-dev/isaacus-typescript/commit/2413a0e5a09e1aff4490aef3f27eff77fb1e5c0b))
43+
* **readme:** use better example snippet for undocumented params ([35f22a6](https://github.com/isaacus-dev/isaacus-typescript/commit/35f22a6f4288fe6736ea39e20870b59adfc91e58))
44+
* **ts:** reorder package.json imports ([d0b6815](https://github.com/isaacus-dev/isaacus-typescript/commit/d0b6815a17366c5f67372cd44c4e43a4977cc3dc))
45+
346
## 0.10.0 (2025-06-03)
447

548
Full Changelog: [v0.9.0...v0.10.0](https://github.com/isaacus-dev/isaacus-typescript/compare/v0.9.0...v0.10.0)

README.md

Lines changed: 31 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Isaacus TypeScript API Library
22

3-
[![NPM version](https://img.shields.io/npm/v/isaacus.svg)](https://npmjs.org/package/isaacus) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/isaacus)
3+
[![NPM version](<https://img.shields.io/npm/v/isaacus.svg?label=npm%20(stable)>)](https://npmjs.org/package/isaacus) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/isaacus)
44

55
This library provides convenient access to the Isaacus REST API from server-side TypeScript or JavaScript.
66

@@ -26,17 +26,13 @@ const client = new Isaacus({
2626
apiKey: process.env['ISAACUS_API_KEY'], // This is the default and can be omitted
2727
});
2828

29-
async function main() {
30-
const universalClassification = await client.classifications.universal.create({
31-
model: 'kanon-universal-classifier',
32-
query: 'This is a confidentiality clause.',
33-
texts: ['I agree not to tell anyone about the document.'],
34-
});
35-
36-
console.log(universalClassification.classifications);
37-
}
29+
const universalClassification = await client.classifications.universal.create({
30+
model: 'kanon-universal-classifier',
31+
query: 'This is a confidentiality clause.',
32+
texts: ['I agree not to tell anyone about the document.'],
33+
});
3834

39-
main();
35+
console.log(universalClassification.classifications);
4036
```
4137

4238
### Request & Response types
@@ -51,17 +47,13 @@ const client = new Isaacus({
5147
apiKey: process.env['ISAACUS_API_KEY'], // This is the default and can be omitted
5248
});
5349

54-
async function main() {
55-
const params: Isaacus.Classifications.UniversalCreateParams = {
56-
model: 'kanon-universal-classifier',
57-
query: 'This is a confidentiality clause.',
58-
texts: ['I agree not to tell anyone about the document.'],
59-
};
60-
const universalClassification: Isaacus.Classifications.UniversalClassification =
61-
await client.classifications.universal.create(params);
62-
}
63-
64-
main();
50+
const params: Isaacus.Classifications.UniversalCreateParams = {
51+
model: 'kanon-universal-classifier',
52+
query: 'This is a confidentiality clause.',
53+
texts: ['I agree not to tell anyone about the document.'],
54+
};
55+
const universalClassification: Isaacus.Classifications.UniversalClassification =
56+
await client.classifications.universal.create(params);
6557
```
6658

6759
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -74,25 +66,21 @@ a subclass of `APIError` will be thrown:
7466

7567
<!-- prettier-ignore -->
7668
```ts
77-
async function main() {
78-
const universalClassification = await client.classifications.universal
79-
.create({
80-
model: 'kanon-universal-classifier',
81-
query: 'This is a confidentiality clause.',
82-
texts: ['I agree not to tell anyone about the document.'],
83-
})
84-
.catch(async (err) => {
85-
if (err instanceof Isaacus.APIError) {
86-
console.log(err.status); // 400
87-
console.log(err.name); // BadRequestError
88-
console.log(err.headers); // {server: 'nginx', ...}
89-
} else {
90-
throw err;
91-
}
92-
});
93-
}
94-
95-
main();
69+
const universalClassification = await client.classifications.universal
70+
.create({
71+
model: 'kanon-universal-classifier',
72+
query: 'This is a confidentiality clause.',
73+
texts: ['I agree not to tell anyone about the document.'],
74+
})
75+
.catch(async (err) => {
76+
if (err instanceof Isaacus.APIError) {
77+
console.log(err.status); // 400
78+
console.log(err.name); // BadRequestError
79+
console.log(err.headers); // {server: 'nginx', ...}
80+
} else {
81+
throw err;
82+
}
83+
});
9684
```
9785

9886
Error codes are as follows:
@@ -262,9 +250,8 @@ parameter. This library doesn't validate at runtime that the request matches the
262250
send will be sent as-is.
263251

264252
```ts
265-
client.foo.create({
266-
foo: 'my_param',
267-
bar: 12,
253+
client.classifications.universal.create({
254+
// ...
268255
// @ts-expect-error baz is not yet public
269256
baz: 'undocumented option',
270257
});

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${NPM_TOKEN}" ]; then
6-
errors+=("The ISAACUS_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
77
fi
88

99
lenErrors=${#errors[@]}

bin/publish-npm

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,35 @@ npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
77
yarn build
88
cd dist
99

10+
# Get package name and version from package.json
11+
PACKAGE_NAME="$(jq -r -e '.name' ./package.json)"
12+
VERSION="$(jq -r -e '.version' ./package.json)"
13+
1014
# Get latest version from npm
1115
#
12-
# If the package doesn't exist, yarn will return
13-
# {"type":"error","data":"Received invalid response from npm."}
14-
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
15-
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"
16-
17-
# Get current version from package.json
18-
VERSION="$(node -p "require('./package.json').version")"
16+
# If the package doesn't exist, npm will return:
17+
# {
18+
# "error": {
19+
# "code": "E404",
20+
# "summary": "Unpublished on 2025-06-05T09:54:53.528Z",
21+
# "detail": "'the_package' is not in this registry..."
22+
# }
23+
# }
24+
NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)"
25+
26+
# Check if we got an E404 error
27+
if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then
28+
# Package doesn't exist yet, no last version
29+
LAST_VERSION=""
30+
elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then
31+
# Report other errors
32+
echo "ERROR: npm returned unexpected data:"
33+
echo "$NPM_INFO"
34+
exit 1
35+
else
36+
# Success - get the version
37+
LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes
38+
fi
1939

2040
# Check if current version is pre-release (e.g. alpha / beta / rc)
2141
CURRENT_IS_PRERELEASE=false

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaacus",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "The official TypeScript library for the Isaacus API",
55
"author": "Isaacus <support@isaacus.com>",
66
"types": "dist/index.d.ts",
@@ -30,7 +30,6 @@
3030
"@swc/jest": "^0.2.29",
3131
"@types/jest": "^29.4.0",
3232
"@types/node": "^20.17.6",
33-
"typescript-eslint": "8.31.1",
3433
"@typescript-eslint/eslint-plugin": "8.31.1",
3534
"@typescript-eslint/parser": "8.31.1",
3635
"eslint": "^9.20.1",
@@ -42,9 +41,10 @@
4241
"publint": "^0.2.12",
4342
"ts-jest": "^29.1.0",
4443
"ts-node": "^10.5.0",
45-
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
44+
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.8/tsc-multi.tgz",
4645
"tsconfig-paths": "^4.0.0",
47-
"typescript": "5.8.3"
46+
"typescript": "5.8.3",
47+
"typescript-eslint": "8.31.1"
4848
},
4949
"imports": {
5050
"isaacus": ".",

packages/mcp-server/build

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/ma
2323
node scripts/postprocess-dist-package-json.cjs
2424

2525
# build to .js/.mjs/.d.ts files
26-
npm exec tsc-multi
26+
./node_modules/.bin/tsc-multi
2727

2828
cp tsconfig.dist-src.json dist/src/tsconfig.json
2929

30-
# Add proper Node.js shebang to the top of the file
31-
sed -i.bak '1s;^;#!/usr/bin/env node\n;' dist/index.js
32-
rm dist/index.js.bak
33-
3430
chmod +x dist/index.js
3531

3632
DIST_PATH=./dist PKG_IMPORT_PATH=isaacus-mcp/ node ../../scripts/utils/postprocess-files.cjs

packages/mcp-server/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaacus-mcp",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "The official MCP Server for the Isaacus API",
55
"author": "Isaacus <support@isaacus.com>",
66
"types": "dist/index.d.ts",
@@ -28,10 +28,11 @@
2828
},
2929
"dependencies": {
3030
"isaacus": "file:../../dist/",
31-
"@modelcontextprotocol/sdk": "^1.6.1",
31+
"@modelcontextprotocol/sdk": "^1.11.5",
32+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.2/jq-web.tar.gz",
3233
"yargs": "^17.7.2",
3334
"@cloudflare/cabidela": "^0.2.4",
34-
"zod": "^3.24.4",
35+
"zod": "^3.25.20",
3536
"zod-to-json-schema": "^3.24.5"
3637
},
3738
"bin": {
@@ -49,7 +50,7 @@
4950
"ts-jest": "^29.1.0",
5051
"ts-morph": "^19.0.0",
5152
"ts-node": "^10.5.0",
52-
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
53+
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.8/tsc-multi.tgz",
5354
"tsconfig-paths": "^4.0.0",
5455
"typescript": "5.8.3"
5556
},

packages/mcp-server/src/compat.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,46 @@ export const defaultClientCapabilities: ClientCapabilities = {
1919
toolNameLength: undefined,
2020
};
2121

22+
export type ClientType = 'openai-agents' | 'claude' | 'claude-code' | 'cursor';
23+
24+
// Client presets for compatibility
25+
// Note that these could change over time as models get better, so this is
26+
// a best effort.
27+
export const knownClients: Record<ClientType, ClientCapabilities> = {
28+
'openai-agents': {
29+
topLevelUnions: false,
30+
validJson: true,
31+
refs: true,
32+
unions: true,
33+
formats: true,
34+
toolNameLength: undefined,
35+
},
36+
claude: {
37+
topLevelUnions: true,
38+
validJson: false,
39+
refs: true,
40+
unions: true,
41+
formats: true,
42+
toolNameLength: undefined,
43+
},
44+
'claude-code': {
45+
topLevelUnions: false,
46+
validJson: true,
47+
refs: true,
48+
unions: true,
49+
formats: true,
50+
toolNameLength: undefined,
51+
},
52+
cursor: {
53+
topLevelUnions: false,
54+
validJson: true,
55+
refs: false,
56+
unions: false,
57+
formats: false,
58+
toolNameLength: 50,
59+
},
60+
};
61+
2262
/**
2363
* Attempts to parse strings into JSON objects
2464
*/

0 commit comments

Comments
 (0)