Skip to content
Closed
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
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Development",
"image": "mcr.microsoft.com/devcontainers/typescript-node:latest",
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": ["esbenp.prettier-vscode"]
}
}
}
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI
on:
push:
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/xtrace-memory-manager-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Check types
run: ./scripts/lint

build:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/xtrace-memory-manager-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/xtrace-memory-manager-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: |-
github.repository == 'stainless-sdks/xtrace-memory-manager-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/xtrace-memory-manager-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test
32 changes: 32 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to NPM in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/XTraceAI/memory-sdk-ts/actions/workflows/publish-npm.yml
name: Publish NPM
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
with:
node-version: '20'

- name: Install dependencies
run: |
yarn install

- name: Publish to NPM
run: |
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.XTRACEAI_NPM_TOKEN || secrets.NPM_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'XTraceAI/memory-sdk-ts' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.XTRACEAI_NPM_TOKEN || secrets.NPM_TOKEN }}
17 changes: 10 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.prism.log
.stdy.log
node_modules
yarn-error.log
codegen.log
Brewfile.lock.json
dist
*.tsbuildinfo
.DS_Store
.env
.env.local
coverage
.vitest-cache
.npm-cache
dist-deno
/*.tgz
.idea/
.eslintcache

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .env in gitignore risks secret exposure

Medium Severity

The new .gitignore drops the .env and .env.local entries that were present in the previous version. Since the SDK requires apiKey and orgID credentials (visible in src/client.ts), developers working locally are likely to store these in .env files. Without gitignore protection, secrets could be accidentally committed to the repository.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d80a3b6. Configure here.

7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHANGELOG.md
/ecosystem-tests/*/**
/node_modules
/deno

# don't format tsc output, will break source maps
/dist
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"experimentalTernaries": true,
"printWidth": 110,
"singleQuote": true,
"trailingComma": "all"
}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.3.0"
}
4 changes: 4 additions & 0 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xtrace/xtrace-memory-manager-44c3f332a6859f61260ca687d5500b395bc4048c65b23d0e35320121aebedb97.yml
openapi_spec_hash: f5b0148c800f181ccee41a1195070c8b
config_hash: 57e728b5795fc791e7088360a8418b7c
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "node"
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Changelog

## 0.3.0 (2026-05-28)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/XTraceAI/memory-sdk-ts/compare/v0.2.0...v0.3.0)

### Features

* **api:** add Stainless SDK configuration for TypeScript target ([38d392e](https://github.com/XTraceAI/memory-sdk-ts/commit/38d392e5a0b376bda20d94f17466d4e523063ed3))
* **api:** manual updates ([3cac1dc](https://github.com/XTraceAI/memory-sdk-ts/commit/3cac1dc853574504877610aeda9cc1a15db094b4))
* **api:** manual updates ([26b65df](https://github.com/XTraceAI/memory-sdk-ts/commit/26b65df2de00e8f57e989d024d104c6472d7fd7a))
* **api:** manual updates ([e3763c5](https://github.com/XTraceAI/memory-sdk-ts/commit/e3763c5da9117f1250f8ec9049157d22713982aa))
* initial @xtrace/memory TypeScript SDK ([b7fb885](https://github.com/XTraceAI/memory-sdk-ts/commit/b7fb885a1ce1ace44f91c56fc9f56ccfd83759b9))


### Bug Fixes

* **typescript:** upgrade tsc-multi so that it works with Node 26 ([52a48ca](https://github.com/XTraceAI/memory-sdk-ts/commit/52a48ca20281d052cdb9a2d7fc4ed73bda1be451))


### Chores

* bump to 0.0.1 + allow empty test suite for publish ([1d866fe](https://github.com/XTraceAI/memory-sdk-ts/commit/1d866fe6a0b7fc167ad2215cb15021b95ba4ea10))
* **internal:** codegen related update ([40f81f7](https://github.com/XTraceAI/memory-sdk-ts/commit/40f81f73b011fa18b9d58483f7bbfede90b417a9))
* rename scope [@xtrace](https://github.com/xtrace) → [@xtraceai](https://github.com/xtraceai) ([82322ab](https://github.com/XTraceAI/memory-sdk-ts/commit/82322ab6db292f0d7083083acd8758da30be87a7))
* sync repo ([cf7470d](https://github.com/XTraceAI/memory-sdk-ts/commit/cf7470dd3a6580526116c15d896b258c4df07429))
* **tests:** remove redundant File import ([2d2565c](https://github.com/XTraceAI/memory-sdk-ts/commit/2d2565ca269b84ebe907ed91491d76dd0a7fa0dd))
* use canonical XTraceAI casing in repo URLs ([428c38a](https://github.com/XTraceAI/memory-sdk-ts/commit/428c38aa06236463a9fb7983f2e7f05b7e931290))

## 0.2.0 (2026-05-20)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/XTraceAI/memory-sdk-ts/compare/v0.1.0...v0.2.0)

### Features

* **api:** manual updates ([3cac1dc](https://github.com/XTraceAI/memory-sdk-ts/commit/3cac1dc853574504877610aeda9cc1a15db094b4))


### Bug Fixes

* **typescript:** upgrade tsc-multi so that it works with Node 26 ([52a48ca](https://github.com/XTraceAI/memory-sdk-ts/commit/52a48ca20281d052cdb9a2d7fc4ed73bda1be451))


### Chores

* **tests:** remove redundant File import ([2d2565c](https://github.com/XTraceAI/memory-sdk-ts/commit/2d2565ca269b84ebe907ed91491d76dd0a7fa0dd))

## 0.1.0 (2026-05-16)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/XTraceAI/memory-sdk-ts/compare/v0.0.1...v0.1.0)

### Features

* **api:** manual updates ([26b65df](https://github.com/XTraceAI/memory-sdk-ts/commit/26b65df2de00e8f57e989d024d104c6472d7fd7a))
* **api:** manual updates ([e3763c5](https://github.com/XTraceAI/memory-sdk-ts/commit/e3763c5da9117f1250f8ec9049157d22713982aa))
* initial @xtrace/memory TypeScript SDK ([b7fb885](https://github.com/XTraceAI/memory-sdk-ts/commit/b7fb885a1ce1ace44f91c56fc9f56ccfd83759b9))


### Chores

* bump to 0.0.1 + allow empty test suite for publish ([1d866fe](https://github.com/XTraceAI/memory-sdk-ts/commit/1d866fe6a0b7fc167ad2215cb15021b95ba4ea10))
* rename scope [@xtrace](https://github.com/xtrace) → [@xtraceai](https://github.com/xtraceai) ([82322ab](https://github.com/XTraceAI/memory-sdk-ts/commit/82322ab6db292f0d7083083acd8758da30be87a7))
* sync repo ([cf7470d](https://github.com/XTraceAI/memory-sdk-ts/commit/cf7470dd3a6580526116c15d896b258c4df07429))
* use canonical XTraceAI casing in repo URLs ([428c38a](https://github.com/XTraceAI/memory-sdk-ts/commit/428c38aa06236463a9fb7983f2e7f05b7e931290))
107 changes: 107 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
## Setting up the environment

This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
Other package managers may work but are not officially supported for development.

To set up the repository, run:

```sh
$ yarn
$ yarn build
```

This will install all the required dependencies and build output files to `dist/`.

## Modifying/Adding code

Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
modify the contents of the `src/lib/` and `examples/` directories.

## Adding and running examples

All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.

```ts
// add an example to examples/<your-example>.ts

#!/usr/bin/env -S npm run tsn -T
```

```sh
$ chmod +x examples/<your-example>.ts
# run the example against your api
$ yarn tsn -T examples/<your-example>.ts
```

## Using the repository from source

If you’d like to use the repository from source, you can either install from git or link to a cloned repository:

To install via git:

```sh
$ npm install git+ssh://git@github.com:XTraceAI/memory-sdk-ts.git
```

Alternatively, to link a local copy of the repo:

```sh
# Clone
$ git clone https://www.github.com/XTraceAI/memory-sdk-ts
$ cd memory-sdk-ts

# With yarn
$ yarn link
$ cd ../my-package
$ yarn link @xtraceai/memory

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

## Running tests

Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.

```sh
$ ./scripts/mock
```

```sh
$ yarn run test
```

## Linting and formatting

This repository uses [prettier](https://www.npmjs.com/package/prettier) and
[eslint](https://www.npmjs.com/package/eslint) to format the code in the repository.

To lint:

```sh
$ yarn lint
```

To format and fix all lint issues automatically:

```sh
$ yarn fix
```

## Publishing and releases

Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
the changes aren't made through the automated pipeline, you may want to make releases manually.

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/XTraceAI/memory-sdk-ts/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
the environment.
Loading
Loading