Skip to content

Commit dc7bae4

Browse files
committed
Merge branch 'main' into ring-individial-members
# Conflicts: # src/gen/chat/ChatApi.ts # src/gen/common/CommonApi.ts # src/gen/model-decoders/index.ts # src/gen/models/index.ts # src/gen/video/CallApi.ts # src/gen/video/VideoApi.ts
2 parents c14c663 + 94e45da commit dc7bae4

40 files changed

+18605
-7969
lines changed

.github/workflows/release-pr.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@ jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: google-github-actions/release-please-action@v3
17-
with:
18-
release-type: node
19-
package-name: "@stream-io/node-sdk"
20-
bump-minor-pre-major: true
21-
bump-patch-for-minor-pre-major: true
16+
- uses: googleapis/release-please-action@v4

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
test-node:
3333
strategy:
3434
matrix:
35-
version: [18, 20, 22]
35+
version: [18, 20, 22, 24]
3636
runs-on: ubuntu-latest
3737
needs: [lint]
3838
steps:

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
dist
2+
CHANGELOG.md

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.7.18"
3+
}

AGENTS.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
Guidance for AI coding agents (Copilot, Cursor, Aider, Claude, etc.) working in this repository. Human readers are welcome, but this file is written for tools.
2+
3+
### Repository purpose
4+
5+
This repo hosts Stream's Node.js SDK in TypeScript. It provides:
6+
• A comprehensive client for Stream's Chat, Video, and Feeds (v3) APIs
7+
• Server-side SDK for building chat, video calling, and activity feeds
8+
• Support for all Stream services: Chat, Video, Feeds (v3), and Moderation
9+
10+
Agents should prioritize backwards compatibility, API stability, and high test coverage when changing code.
11+
12+
### Tech & toolchain
13+
14+
• Language: TypeScript (Node.js)
15+
• Package managers: Yarn (primary)
16+
• Minimum Node.js: 18.0.0 or newer (see package.json engines)
17+
• Runtime targets: Node.js 18+, Node.js 20+, Node.js 22+, Bun 1+
18+
• CI: GitHub Actions (assume PR validation on build + tests + lint)
19+
• Linters & docs: ESLint + Prettier
20+
21+
### Project layout (high level)
22+
23+
src/
24+
gen/ # Generated API clients and models
25+
chat/ # Chat API client and models
26+
video/ # Video API client and models
27+
feeds/ # Feeds API client and models
28+
moderation/ # Moderation API client and models
29+
common/ # Common API utilities
30+
models/ # API request and response models for all supported products
31+
utils/ # Utility functions (token creation, rate limiting)
32+
StreamClient.ts # Main client class
33+
StreamChatClient.ts # Chat-specific client
34+
StreamVideoClient.ts # Video-specific client
35+
StreamFeedsClient.ts # Feeds-specific client
36+
StreamModerationClient.ts # Moderation-specific client
37+
**tests**/ # Test files
38+
\*.test.ts # Test files for each module
39+
40+
Use the closest folder's patterns and conventions when editing.
41+
42+
### Local setup (Node.js)
43+
44+
1. Ensure Node.js 18+ is installed
45+
2. Install dependencies: `yarn install`
46+
3. Build the project: `yarn build`
47+
4. Run tests: `yarn test`
48+
49+
### Alternative: Package consumer check
50+
51+
If you need to validate as a package consumer:
52+
53+
1. Create a throwaway sample project.
54+
2. Add to package.json:
55+
56+
```json
57+
{
58+
"dependencies": {
59+
"@stream-io/node-sdk": "^0.6.5"
60+
}
61+
}
62+
```
63+
64+
3. Install and test the integration.
65+
66+
### Available Scripts
67+
68+
Common npm/yarn scripts in this repo include:
69+
`build` - Build the TypeScript project to dist/
70+
`test` - Run tests with Vitest
71+
`test:bun` - Run tests with Bun
72+
`lint` - Run ESLint
73+
`lint:fix` - Run ESLint with auto-fix
74+
`prettier:fix` - Run Prettier to format code
75+
`generate:open-api` - Regenerate API clients from OpenAPI specs
76+
77+
Agents should check package.json scripts before running commands.
78+
79+
### Build & test commands (CLI)
80+
81+
Use yarn/npm for day-to-day work; use CLI for CI parity & agent automation.
82+
83+
Build the project:
84+
85+
```bash
86+
yarn build
87+
```
88+
89+
Run all tests:
90+
91+
```bash
92+
yarn test
93+
```
94+
95+
Run tests with Bun:
96+
97+
```bash
98+
yarn test:bun
99+
```
100+
101+
Run linting:
102+
103+
```bash
104+
yarn lint
105+
```
106+
107+
Format code:
108+
109+
```bash
110+
yarn prettier:fix
111+
```
112+
113+
Linting & formatting
114+
• ESLint and Prettier are configured for this project. Run before committing:
115+
116+
```bash
117+
yarn lint
118+
yarn prettier:fix
119+
```
120+
121+
• Respect .eslintrc and .prettierrc configurations. Do not suppress rules broadly; justify and scope exceptions.
122+
• The project uses lint-staged with Husky for pre-commit hooks.
123+
124+
Commit / PR conventions
125+
• Use conventional commit format for commit messages.
126+
• Keep PRs small and focused; include tests.
127+
• Follow the project’s “zero warnings” policy—fix new warnings and avoid introducing any.
128+
• Ensure public API changes include docs and migration notes.
129+
130+
Testing policy
131+
• Add/extend tests in the **tests**/ folder with .test.ts suffix.
132+
• Cover:
133+
• Core API clients and models (StreamClient, StreamChatClient, etc.)
134+
• Utility functions (token creation, rate limiting)
135+
• Generated API clients and their interactions
136+
137+
Security & credentials
138+
• Never commit API keys or customer data.
139+
• Example code must use obvious placeholders (e.g., YOUR_STREAM_KEY).
140+
• If you add scripts, ensure they fail closed on missing env vars.
141+
142+
Compatibility & distribution
143+
• Maintain compatibility with supported Node.js versions listed in package.json engines (Node.js 18+).
144+
• Don't introduce third-party deps without discussion.
145+
• Validate yarn integration and ensure the package works in both CommonJS and ES modules.
146+
• Test compatibility with Bun runtime when making changes.
147+
148+
When in doubt
149+
• Mirror existing patterns in the nearest module.
150+
• Prefer additive changes; avoid breaking public APIs.
151+
• Ask maintainers (CODEOWNERS) through PR mentions for modules you touch.
152+
153+
154+
155+
Quick agent checklist (per commit)
156+
• Build the project: `yarn build`
157+
• Run tests: `yarn test`
158+
• Run linting: `yarn lint`
159+
• Format code: `yarn prettier:fix`
160+
• Add/adjust tests
161+
• No new warnings or linting errors
162+
163+
End of machine guidance. Edit this file to refine agent behavior over time; keep human-facing details in README.md and docs.

0 commit comments

Comments
 (0)