Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v6
Expand All @@ -45,10 +44,11 @@ jobs:
pnpm tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
env:
INPUT_PATH: ${{ github.event.inputs.path }}
NPM_TOKEN: ${{ secrets.HYPERSPELL_NPM_TOKEN || secrets.NPM_TOKEN }}

- name: Upload MCP Server DXT GitHub release asset
run: |
gh release upload ${{ github.event.release.tag_name }} \
packages/mcp-server/hyperspell_api.mcpb
packages/mcp-server/hyperspell_hyperspell_api.mcpb
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ jobs:
- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.HYPERSPELL_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ dist-deno
.eslintcache
dist-bundle
*.mcpb
oidc
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.36.0"
".": "0.36.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-a4bf4f3aaf1509541db646bc9ff7ec58e78cb4d42cf6bf83881b02739ad77b87.yml
openapi_spec_hash: 89cd02b2290061877e6badcddb7c8eb8
config_hash: bd8505e17db740d82e578d0edaa9bfe0
config_hash: f779e7db9263cd21efe5e9469bc1d012
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.36.1 (2026-04-22)

Full Changelog: [v0.36.0...v0.36.1](https://github.com/hyperspell/node-sdk/compare/v0.36.0...v0.36.1)

### Chores

* update SDK settings ([597e2c0](https://github.com/hyperspell/node-sdk/commit/597e2c01ec271e6f7054a03b475968ce5e19af31))
* update SDK settings ([b4e0424](https://github.com/hyperspell/node-sdk/commit/b4e04248e73f2f8f5db328c54b1e6708d5e95799))

## 0.36.0 (2026-04-22)

Full Changelog: [v0.35.1...v0.36.0](https://github.com/hyperspell/node-sdk/compare/v0.35.1...v0.36.0)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ $ cd node-sdk
# With yarn
$ yarn link
$ cd ../my-package
$ yarn link hyperspell
$ yarn link @hyperspell/hyperspell

# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link --global hyperspell
$ pnpm link --global @hyperspell/hyperspell
```

## Running tests
Expand Down
58 changes: 29 additions & 29 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The main changes are that the SDK now relies on the [builtin Web fetch API](http
## Migration CLI

Most programs will only need minimal changes, but to assist there is a migration tool that will automatically update your code for the new version.
To use it, upgrade the `hyperspell` package, then run `./node_modules/.bin/hyperspell migrate ./your/src/folders` to update your code.
To use it, upgrade the `@hyperspell/hyperspell` package, then run `./node_modules/.bin/hyperspell-hyperspell migrate ./your/src/folders` to update your code.
To preview the changes without writing them to disk, run the tool with `--dry`.

## Environment requirements
Expand Down Expand Up @@ -104,7 +104,7 @@ If you were using `httpAgent` for proxy support, check out the [new proxy docume
Before:

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
import http from 'http';
import { HttpsProxyAgent } from 'https-proxy-agent';

Expand All @@ -117,7 +117,7 @@ const client = new Hyperspell({
After:

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent(process.env.PROXY_URL);
Expand All @@ -130,27 +130,27 @@ const client = new Hyperspell({

### Changed exports

#### Refactor of `hyperspell/core`, `error`, `pagination`, `resource` and `uploads`
#### Refactor of `@hyperspell/hyperspell/core`, `error`, `pagination`, `resource` and `uploads`

Much of the `hyperspell/core` file was intended to be internal-only but it was publicly accessible, as such it has been refactored and split up into internal and public files, with public-facing code moved to a new `core` folder and internal code moving to the private `internal` folder.
Much of the `@hyperspell/hyperspell/core` file was intended to be internal-only but it was publicly accessible, as such it has been refactored and split up into internal and public files, with public-facing code moved to a new `core` folder and internal code moving to the private `internal` folder.

At the same time, we moved some public-facing files which were previously at the top level into `core` to make the file structure cleaner and more clear:

```typescript
// Before
import 'hyperspell/error';
import 'hyperspell/pagination';
import 'hyperspell/resource';
import 'hyperspell/uploads';
import '@hyperspell/hyperspell/error';
import '@hyperspell/hyperspell/pagination';
import '@hyperspell/hyperspell/resource';
import '@hyperspell/hyperspell/uploads';

// After
import 'hyperspell/core/error';
import 'hyperspell/core/pagination';
import 'hyperspell/core/resource';
import 'hyperspell/core/uploads';
import '@hyperspell/hyperspell/core/error';
import '@hyperspell/hyperspell/core/pagination';
import '@hyperspell/hyperspell/core/resource';
import '@hyperspell/hyperspell/core/uploads';
```

If you were relying on anything that was only exported from `hyperspell/core` and is also not accessible anywhere else, please open an issue and we'll consider adding it to the public API.
If you were relying on anything that was only exported from `@hyperspell/hyperspell/core` and is also not accessible anywhere else, please open an issue and we'll consider adding it to the public API.

#### Resource classes

Expand All @@ -159,16 +159,16 @@ Now you must always either reference them as static class properties or import t

```typescript
// Before
const { Connections } = require('hyperspell');
const { Connections } = require('@hyperspell/hyperspell');

// After
const { Hyperspell } = require('hyperspell');
Hyperspell.Connections; // or import directly from hyperspell/resources/connections
const { Hyperspell } = require('@hyperspell/hyperspell');
Hyperspell.Connections; // or import directly from @hyperspell/hyperspell/resources/connections
```

#### Cleaned up `uploads` exports

As part of the `core` refactor, `hyperspell/uploads` was moved to `hyperspell/core/uploads`
As part of the `core` refactor, `@hyperspell/hyperspell/uploads` was moved to `@hyperspell/hyperspell/core/uploads`
and the following exports were removed, as they were not intended to be a part of the public API:

- `fileFromPath`
Expand All @@ -188,7 +188,7 @@ and the following exports were removed, as they were not intended to be a part o
Note that `Uploadable` & `toFile` **are** still exported:

```typescript
import { type Uploadable, toFile } from 'hyperspell/core/uploads';
import { type Uploadable, toFile } from '@hyperspell/hyperspell/core/uploads';
```

#### `APIClient`
Expand All @@ -197,10 +197,10 @@ The `APIClient` base client class has been removed as it is no longer needed. If

```typescript
// Before
import { APIClient } from 'hyperspell/core';
import { APIClient } from '@hyperspell/hyperspell/core';

// After
import { Hyperspell } from 'hyperspell';
import { Hyperspell } from '@hyperspell/hyperspell';
```

### File handling
Expand All @@ -224,11 +224,11 @@ Previously you could configure the types that the SDK used like this:

```ts
// Tell TypeScript and the package to use the global Web fetch instead of node-fetch.
import 'hyperspell/shims/web';
import Hyperspell from 'hyperspell';
import '@hyperspell/hyperspell/shims/web';
import Hyperspell from '@hyperspell/hyperspell';
```

The `hyperspell/shims` imports have been removed. Your global types must now be [correctly configured](#minimum-types-requirements).
The `@hyperspell/hyperspell/shims` imports have been removed. Your global types must now be [correctly configured](#minimum-types-requirements).

### Pagination changes

Expand Down Expand Up @@ -267,19 +267,19 @@ export type ResourcesCursorPage = CursorPage<Resource>;

If you were importing these classes at runtime, you'll need to switch to importing the base class or only import them at the type-level.

### `hyperspell/src` directory removed
### `@hyperspell/hyperspell/src` directory removed

Previously IDEs may have auto-completed imports from the `hyperspell/src` directory, however this
Previously IDEs may have auto-completed imports from the `@hyperspell/hyperspell/src` directory, however this
directory was only included for an improved go-to-definition experience and should not have been used at runtime.

If you have any `hyperspell/src/*` imports, you will need to replace them with `hyperspell/*`.
If you have any `@hyperspell/hyperspell/src/*` imports, you will need to replace them with `@hyperspell/hyperspell/*`.

```ts
// Before
import Hyperspell from 'hyperspell/src';
import Hyperspell from '@hyperspell/hyperspell/src';

// After
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
```

## TypeScript troubleshooting
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hyperspell TypeScript API Library

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

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

Expand All @@ -20,7 +20,7 @@ Use the Hyperspell MCP Server to enable AI assistants to interact with this API,
## Installation

```sh
npm install hyperspell
npm install @hyperspell/hyperspell
```

## Usage
Expand All @@ -29,7 +29,7 @@ The full API of this library can be found in [api.md](api.md).

<!-- prettier-ignore -->
```js
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
Expand All @@ -46,7 +46,7 @@ This library includes TypeScript definitions for all request params and response

<!-- prettier-ignore -->
```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
Expand All @@ -69,7 +69,7 @@ Request parameters that correspond to file uploads can be passed in many differe

```ts
import fs from 'fs';
import Hyperspell, { toFile } from 'hyperspell';
import Hyperspell, { toFile } from '@hyperspell/hyperspell';

const client = new Hyperspell();

Expand Down Expand Up @@ -231,7 +231,7 @@ The log level can be configured in two ways:
2. Using the `logLevel` client option (overrides the environment variable if set)

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
logLevel: 'debug', // Show all log messages
Expand Down Expand Up @@ -259,7 +259,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
below the configured level will not be sent to your logger.

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
import pino from 'pino';

const logger = pino();
Expand Down Expand Up @@ -328,7 +328,7 @@ globalThis.fetch = fetch;
Or pass it to the client:

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
import fetch from 'my-fetch';

const client = new Hyperspell({ fetch });
Expand All @@ -339,7 +339,7 @@ const client = new Hyperspell({ fetch });
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
fetchOptions: {
Expand All @@ -356,7 +356,7 @@ options to requests:
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';
import * as undici from 'undici';

const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
Expand All @@ -370,7 +370,7 @@ const client = new Hyperspell({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>

```ts
import Hyperspell from 'hyperspell';
import Hyperspell from '@hyperspell/hyperspell';

const client = new Hyperspell({
fetchOptions: {
Expand All @@ -382,7 +382,7 @@ const client = new Hyperspell({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>

```ts
import Hyperspell from 'npm:hyperspell';
import Hyperspell from 'npm:@hyperspell/hyperspell';

const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
const client = new Hyperspell({
Expand Down
4 changes: 4 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

errors=()

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

lenErrors=${#errors[@]}

if [[ lenErrors -gt 0 ]]; then
Expand Down
4 changes: 2 additions & 2 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { spawnSync } = require('child_process');

const commands = {
migrate: {
description: 'Run migrations to update your code using hyperspell@0.22.1 to be compatible with hyperspell@0.24.0',
description: 'Run migrations to update your code using @hyperspell/hyperspell@0.22.1 to be compatible with @hyperspell/hyperspell@0.24.0',
fn: () => {
const result = spawnSync(
'npx',
Expand All @@ -19,7 +19,7 @@ const commands = {
}

function exitWithHelp() {
console.log(`Usage: hyperspell <subcommand>`);
console.log(`Usage: hyperspell-hyperspell <subcommand>`);
console.log();
console.log('Subcommands:');

Expand Down
2 changes: 1 addition & 1 deletion bin/migration-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"pkg": "hyperspell",
"pkg": "@hyperspell/hyperspell",
"githubRepo": "https://github.com/hyperspell/node-sdk",
"clientClass": "Hyperspell",
"methods": [
Expand Down
12 changes: 2 additions & 10 deletions bin/publish-npm
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

set -eux

if [[ ${NPM_TOKEN:-} ]]; then
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then
echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission"
exit 1
fi
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"

pnpm build
cd dist
Expand Down Expand Up @@ -62,8 +57,5 @@ else
TAG="latest"
fi

# Install OIDC compatible npm version
npm install --prefix ../oidc/ npm@11.6.2

# Publish with the appropriate tag
pnpm publish --npm-path "$(cd ../ && pwd)/oidc/node_modules/.bin/npm" --no-git-checks --tag "$TAG"
pnpm publish --no-git-checks --tag "$TAG"
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default tseslint.config(
{
patterns: [
{
regex: '^hyperspell(/.*)?',
regex: '^@hyperspell/hyperspell(/.*)?',
message: 'Use a relative import, not a package import.',
},
],
Expand Down
Loading
Loading