Skip to content

Commit 94ab6bf

Browse files
release: 0.6.0 (#41)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent e93fa24 commit 94ab6bf

Some content is hidden

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

44 files changed

+1384
-537
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
13+
timeout-minutes: 10
1314
name: lint
14-
runs-on: ubuntu-latest
15-
16-
15+
runs-on: ${{ github.repository == 'stainless-sdks/sunrise-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1716
steps:
1817
- uses: actions/checkout@v4
1918

@@ -29,10 +28,12 @@ jobs:
2928
run: ./scripts/lint
3029

3130
build:
31+
timeout-minutes: 5
3232
name: build
33-
runs-on: ubuntu-latest
34-
35-
33+
runs-on: ${{ github.repository == 'stainless-sdks/sunrise-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
34+
permissions:
35+
contents: read
36+
id-token: write
3637
steps:
3738
- uses: actions/checkout@v4
3839

@@ -46,21 +47,35 @@ jobs:
4647

4748
- name: Check build
4849
run: ./scripts/build
50+
51+
- name: Get GitHub OIDC Token
52+
if: github.repository == 'stainless-sdks/sunrise-node'
53+
id: github-oidc
54+
uses: actions/github-script@v6
55+
with:
56+
script: core.setOutput('github_token', await core.getIDToken());
57+
58+
- name: Upload tarball
59+
if: github.repository == 'stainless-sdks/sunrise-node'
60+
env:
61+
URL: https://pkg.stainless.com/s
62+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
63+
SHA: ${{ github.sha }}
64+
run: ./scripts/utils/upload-artifact.sh
4965
test:
66+
timeout-minutes: 10
5067
name: test
51-
runs-on: ubuntu-latest
52-
68+
runs-on: ${{ github.repository == 'stainless-sdks/sunrise-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
5369
steps:
5470
- uses: actions/checkout@v4
5571

5672
- name: Set up Node
5773
uses: actions/setup-node@v4
5874
with:
59-
node-version: '18'
75+
node-version: '20'
6076

6177
- name: Bootstrap
6278
run: ./scripts/bootstrap
6379

6480
- name: Run tests
6581
run: ./scripts/test
66-

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Node
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: '18'
22+
node-version: '20'
2323

2424
- name: Install dependencies
2525
run: |

.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.5.0"
2+
".": "0.6.0"
33
}

.stats.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-194878b194cd507d7c5418ff38cc0fc53441ef618f991990d334b4b75775cd8f.yml
1+
configured_endpoints: 52
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-17bdb8a33fb4fcade827bba868bd65cd30c64b1d09b4a6d83c3e37a8439ed37f.yml
3+
openapi_spec_hash: bc325b52f3b20d8c56e0be5de88f2dc3
4+
config_hash: 1ecef0ff4fd125bbc00eec65e3dd4798

CHANGELOG.md

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

3+
## 0.6.0 (2025-05-08)
4+
5+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/ContextualAI/contextual-client-node/compare/v0.5.0...v0.6.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([d6ff47c](https://github.com/ContextualAI/contextual-client-node/commit/d6ff47c58dd8b0cb4f142951d0e3043b8487bcdd))
10+
* **api:** update via SDK Studio ([fd67b96](https://github.com/ContextualAI/contextual-client-node/commit/fd67b96723a0234588545d4b45dfbb939c8de7bf))
11+
* **api:** update via SDK Studio ([c6635f9](https://github.com/ContextualAI/contextual-client-node/commit/c6635f95de77157c6fa97545bd9b6a215ae56bab))
12+
* **api:** update via SDK Studio ([#40](https://github.com/ContextualAI/contextual-client-node/issues/40)) ([67be5c7](https://github.com/ContextualAI/contextual-client-node/commit/67be5c7f62052e4d8d4ca960acf5d741f626103e))
13+
* **api:** update via SDK Studio ([#42](https://github.com/ContextualAI/contextual-client-node/issues/42)) ([a20be25](https://github.com/ContextualAI/contextual-client-node/commit/a20be255eccdd3d73b8b82215ed1bb4f5ca2e010))
14+
* **api:** update via SDK Studio ([#43](https://github.com/ContextualAI/contextual-client-node/issues/43)) ([14c74c1](https://github.com/ContextualAI/contextual-client-node/commit/14c74c15ebcef0871e7325453eb1ed02d12a7306))
15+
* **api:** update via SDK Studio ([#44](https://github.com/ContextualAI/contextual-client-node/issues/44)) ([94cf64d](https://github.com/ContextualAI/contextual-client-node/commit/94cf64d933f96e05b70757122a22871109190014))
16+
* **api:** update via SDK Studio ([#45](https://github.com/ContextualAI/contextual-client-node/issues/45)) ([6f38963](https://github.com/ContextualAI/contextual-client-node/commit/6f3896383295cdfbdec9a65a5a470abf3379410c))
17+
18+
19+
### Bug Fixes
20+
21+
* **api:** improve type resolution when importing as a package ([#54](https://github.com/ContextualAI/contextual-client-node/issues/54)) ([bd2f8ab](https://github.com/ContextualAI/contextual-client-node/commit/bd2f8ab3d2cc796201c530c5e85e4485ac337506))
22+
* avoid type error in certain environments ([#50](https://github.com/ContextualAI/contextual-client-node/issues/50)) ([91cd06a](https://github.com/ContextualAI/contextual-client-node/commit/91cd06af830f4ef13bda0cea76908afaeb03ec19))
23+
* **client:** send `X-Stainless-Timeout` in seconds ([#52](https://github.com/ContextualAI/contextual-client-node/issues/52)) ([94fba4c](https://github.com/ContextualAI/contextual-client-node/commit/94fba4c76050b7471c7dbb50391cd8196278cac2))
24+
* **exports:** ensure resource imports don't require /index ([#47](https://github.com/ContextualAI/contextual-client-node/issues/47)) ([e530478](https://github.com/ContextualAI/contextual-client-node/commit/e530478fe8da3337643d66f4eb6cb98fb715cc16))
25+
* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#51](https://github.com/ContextualAI/contextual-client-node/issues/51)) ([7f0bfdd](https://github.com/ContextualAI/contextual-client-node/commit/7f0bfddede9817da316a849511cfa112191c8bef))
26+
* **mcp:** remove unused tools.ts ([#55](https://github.com/ContextualAI/contextual-client-node/issues/55)) ([119ec6f](https://github.com/ContextualAI/contextual-client-node/commit/119ec6fb6eff339fa9dd08481d527ca46674485f))
27+
28+
29+
### Chores
30+
31+
* **ci:** add timeout thresholds for CI jobs ([b6b2a07](https://github.com/ContextualAI/contextual-client-node/commit/b6b2a07f2bd01f34336c5a4964efe4a07a004f68))
32+
* **ci:** bump node version for release workflows ([5d04e11](https://github.com/ContextualAI/contextual-client-node/commit/5d04e11485d0379d5ff7db1dedb7f25c26db4498))
33+
* **ci:** only use depot for staging repos ([873ba2f](https://github.com/ContextualAI/contextual-client-node/commit/873ba2f355fca96db4bcbcad1ef92e0597fa9bd3))
34+
* **client:** minor internal fixes ([321469a](https://github.com/ContextualAI/contextual-client-node/commit/321469aec2485d12c95fdf34308ed61714d3cdfd))
35+
* **exports:** cleaner resource index imports ([#48](https://github.com/ContextualAI/contextual-client-node/issues/48)) ([b204f8a](https://github.com/ContextualAI/contextual-client-node/commit/b204f8a909d95f11e4cf795d68a96b7eaf362c67))
36+
* **exports:** stop using path fallbacks ([#49](https://github.com/ContextualAI/contextual-client-node/issues/49)) ([b0bed50](https://github.com/ContextualAI/contextual-client-node/commit/b0bed50ab202f8b80636db662c063a9094c3de16))
37+
* **internal:** add aliases for Record and Array ([#53](https://github.com/ContextualAI/contextual-client-node/issues/53)) ([3fcab5f](https://github.com/ContextualAI/contextual-client-node/commit/3fcab5f1e451d41b1c3c3f399fe170c3fccb895a))
38+
* **internal:** codegen related update ([f3cadb2](https://github.com/ContextualAI/contextual-client-node/commit/f3cadb2de612e13ed00fb7971af8d4676b11db33))
39+
* **internal:** reduce CI branch coverage ([82a1e3f](https://github.com/ContextualAI/contextual-client-node/commit/82a1e3f2cd28208a6de65145a62614a16b25c5da))
40+
* **internal:** remove extra empty newlines ([#46](https://github.com/ContextualAI/contextual-client-node/issues/46)) ([bf1f16c](https://github.com/ContextualAI/contextual-client-node/commit/bf1f16c174c4d6caf5d120cdfe4da281a2398a8a))
41+
* **internal:** upload builds and expand CI branch coverage ([ba02a4a](https://github.com/ContextualAI/contextual-client-node/commit/ba02a4a584975a100a61610e0cb819a7f345f01f))
42+
43+
44+
### Documentation
45+
46+
* **readme:** fix typo ([3ab3596](https://github.com/ContextualAI/contextual-client-node/commit/3ab3596376577889a370fc1b2c9a98b1e71b3bce))
47+
348
## 0.5.0 (2025-03-11)
449

550
Full Changelog: [v0.4.0...v0.5.0](https://github.com/ContextualAI/contextual-client-node/compare/v0.4.0...v0.5.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function main() {
118118
main();
119119
```
120120

121-
Error codes are as followed:
121+
Error codes are as follows:
122122

123123
| Status Code | Error Type |
124124
| ----------- | -------------------------- |

api.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ Types:
77
- <code><a href="./src/resources/datastores/datastores.ts">DatastoreMetadata</a></code>
88
- <code><a href="./src/resources/datastores/datastores.ts">ListDatastoresResponse</a></code>
99
- <code><a href="./src/resources/datastores/datastores.ts">DatastoreDeleteResponse</a></code>
10+
- <code><a href="./src/resources/datastores/datastores.ts">DatastoreResetResponse</a></code>
1011

1112
Methods:
1213

1314
- <code title="post /datastores">client.datastores.<a href="./src/resources/datastores/datastores.ts">create</a>({ ...params }) -> CreateDatastoreResponse</code>
1415
- <code title="get /datastores">client.datastores.<a href="./src/resources/datastores/datastores.ts">list</a>({ ...params }) -> DatastoresDatastoresPage</code>
1516
- <code title="delete /datastores/{datastore_id}">client.datastores.<a href="./src/resources/datastores/datastores.ts">delete</a>(datastoreId) -> unknown</code>
1617
- <code title="get /datastores/{datastore_id}/metadata">client.datastores.<a href="./src/resources/datastores/datastores.ts">metadata</a>(datastoreId) -> DatastoreMetadata</code>
18+
- <code title="put /datastores/{datastore_id}/reset">client.datastores.<a href="./src/resources/datastores/datastores.ts">reset</a>(datastoreId) -> unknown</code>
1719

1820
## Documents
1921

@@ -38,19 +40,27 @@ Methods:
3840
Types:
3941

4042
- <code><a href="./src/resources/agents/agents.ts">Agent</a></code>
43+
- <code><a href="./src/resources/agents/agents.ts">AgentConfigs</a></code>
4144
- <code><a href="./src/resources/agents/agents.ts">AgentMetadata</a></code>
4245
- <code><a href="./src/resources/agents/agents.ts">CreateAgentOutput</a></code>
46+
- <code><a href="./src/resources/agents/agents.ts">FilterAndRerankConfig</a></code>
47+
- <code><a href="./src/resources/agents/agents.ts">GenerateResponseConfig</a></code>
48+
- <code><a href="./src/resources/agents/agents.ts">GlobalConfig</a></code>
4349
- <code><a href="./src/resources/agents/agents.ts">ListAgentsResponse</a></code>
50+
- <code><a href="./src/resources/agents/agents.ts">RetrievalConfig</a></code>
4451
- <code><a href="./src/resources/agents/agents.ts">AgentUpdateResponse</a></code>
4552
- <code><a href="./src/resources/agents/agents.ts">AgentDeleteResponse</a></code>
53+
- <code><a href="./src/resources/agents/agents.ts">AgentMetadataResponse</a></code>
54+
- <code><a href="./src/resources/agents/agents.ts">AgentResetResponse</a></code>
4655

4756
Methods:
4857

4958
- <code title="post /agents">client.agents.<a href="./src/resources/agents/agents.ts">create</a>({ ...params }) -> CreateAgentOutput</code>
5059
- <code title="put /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">update</a>(agentId, { ...params }) -> unknown</code>
5160
- <code title="get /agents">client.agents.<a href="./src/resources/agents/agents.ts">list</a>({ ...params }) -> AgentsPage</code>
5261
- <code title="delete /agents/{agent_id}">client.agents.<a href="./src/resources/agents/agents.ts">delete</a>(agentId) -> unknown</code>
53-
- <code title="get /agents/{agent_id}/metadata">client.agents.<a href="./src/resources/agents/agents.ts">metadata</a>(agentId) -> AgentMetadata</code>
62+
- <code title="get /agents/{agent_id}/metadata">client.agents.<a href="./src/resources/agents/agents.ts">metadata</a>(agentId) -> AgentMetadataResponse</code>
63+
- <code title="put /agents/{agent_id}/reset">client.agents.<a href="./src/resources/agents/agents.ts">reset</a>(agentId) -> unknown</code>
5464

5565
## Query
5666

@@ -210,3 +220,19 @@ Types:
210220
Methods:
211221

212222
- <code title="post /generate">client.generate.<a href="./src/resources/generate.ts">create</a>({ ...params }) -> GenerateCreateResponse</code>
223+
224+
# Parse
225+
226+
Types:
227+
228+
- <code><a href="./src/resources/parse.ts">ParseCreateResponse</a></code>
229+
- <code><a href="./src/resources/parse.ts">ParseJobResultsResponse</a></code>
230+
- <code><a href="./src/resources/parse.ts">ParseJobStatusResponse</a></code>
231+
- <code><a href="./src/resources/parse.ts">ParseJobsResponse</a></code>
232+
233+
Methods:
234+
235+
- <code title="post /parse">client.parse.<a href="./src/resources/parse.ts">create</a>({ ...params }) -> ParseCreateResponse</code>
236+
- <code title="get /parse/jobs/{job_id}/results">client.parse.<a href="./src/resources/parse.ts">jobResults</a>(jobId, { ...params }) -> ParseJobResultsResponse</code>
237+
- <code title="get /parse/jobs/{job_id}/status">client.parse.<a href="./src/resources/parse.ts">jobStatus</a>(jobId) -> ParseJobStatusResponse</code>
238+
- <code title="get /parse/jobs">client.parse.<a href="./src/resources/parse.ts">jobs</a>({ ...params }) -> ParseJobsResponse</code>

package.json

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contextual-client",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "The official TypeScript library for the Contextual AI API",
55
"author": "Contextual AI <[email protected]>",
66
"types": "dist/index.d.ts",
@@ -107,38 +107,17 @@
107107
"default": "./dist/index.mjs"
108108
},
109109
"./*.mjs": {
110-
"types": [
111-
"./dist/*.d.ts",
112-
"./dist/*/index.d.ts"
113-
],
114-
"default": [
115-
"./dist/*.mjs",
116-
"./dist/*/index.mjs"
117-
]
110+
"types": "./dist/*.d.ts",
111+
"default": "./dist/*.mjs"
118112
},
119113
"./*.js": {
120-
"types": [
121-
"./dist/*.d.ts",
122-
"./dist/*/index.d.ts"
123-
],
124-
"default": [
125-
"./dist/*.js",
126-
"./dist/*/index.js"
127-
]
114+
"types": "./dist/*.d.ts",
115+
"default": "./dist/*.js"
128116
},
129117
"./*": {
130-
"types": [
131-
"./dist/*.d.ts",
132-
"./dist/*/index.d.ts"
133-
],
134-
"require": [
135-
"./dist/*.js",
136-
"./dist/*/index.js"
137-
],
138-
"default": [
139-
"./dist/*.mjs",
140-
"./dist/*/index.mjs"
141-
]
118+
"types": "./dist/*.d.ts",
119+
"require": "./dist/*.js",
120+
"default": "./dist/*.mjs"
142121
}
143122
}
144123
}

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21+
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/sunrise-node/$SHA'\033[0m"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/_shims/index-deno.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable {
108108
const _ReadableStream = ReadableStream;
109109
type _ReadableStream = ReadableStream;
110110
export { _ReadableStream as ReadableStream };
111+
112+
export const init = () => {};

src/_shims/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi
7979
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
8080

8181
export function isFsReadStream(value: any): value is FsReadStream;
82+
83+
export const init: () => void;

src/_shims/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
*/
44
const shims = require('./registry');
55
const auto = require('contextual-client/_shims/auto/runtime');
6-
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6+
exports.init = () => {
7+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8+
};
79
for (const property of Object.keys(shims)) {
810
Object.defineProperty(exports, property, {
911
get() {
1012
return shims[property];
1113
},
1214
});
1315
}
16+
17+
exports.init();

src/_shims/index.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
*/
44
import * as shims from './registry.mjs';
55
import * as auto from 'contextual-client/_shims/auto/runtime';
6-
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6+
export const init = () => {
7+
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8+
};
79
export * from './registry.mjs';
10+
11+
init();

0 commit comments

Comments
 (0)