Skip to content

Commit 330923c

Browse files
committed
feat: initialize CometAPI TypeScript SDK
0 parents  commit 330923c

72 files changed

Lines changed: 11674 additions & 0 deletions

Some content is hidden

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

‎.github/ACTIONLINT.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Local workflow validation
2+
3+
This repository pins `actionlint` in `.github/actionlint-version`. Run the
4+
checked-in wrapper through:
5+
6+
```bash
7+
npm run actionlint
8+
```
9+
10+
The wrapper rejects a different installed version. For the current pin,
11+
`actionlint -version` must report `1.7.12`. When no `actionlint` is on `PATH`,
12+
the wrapper downloads the supported release archive into the ignored `.cache`
13+
directory and verifies it against `.github/actionlint-checksums.txt` before
14+
execution. Set `ACTIONLINT_BIN` to use a separately installed exact-version
15+
binary.
16+
17+
`actionlint` statically validates workflow syntax, expressions, and embedded
18+
shell. A passing local run does not emulate GitHub-hosted runners, exercise
19+
repository settings, prove secret or environment configuration, perform a live
20+
CometAPI request, or prove npm Trusted Publishing. Those remain separate remote
21+
evidence.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Bug report
2+
description: Report reproducible incorrect SDK behavior.
3+
title: "[Bug]: "
4+
labels: []
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >-
9+
Do not include API keys, access tokens, private prompts, or customer
10+
data. Replace credentials and sensitive values with redacted examples.
11+
- type: input
12+
id: version
13+
attributes:
14+
label: CometAPI SDK version
15+
placeholder: 0.1.0-alpha.1
16+
validations:
17+
required: true
18+
- type: input
19+
id: node
20+
attributes:
21+
label: Node.js version
22+
placeholder: 22.x or 24.x
23+
validations:
24+
required: true
25+
- type: dropdown
26+
id: module-system
27+
attributes:
28+
label: Module system
29+
options:
30+
- ESM
31+
- CommonJS
32+
validations:
33+
required: true
34+
- type: textarea
35+
id: reproduction
36+
attributes:
37+
label: Minimal reproduction
38+
description: Include the smallest offline or redacted example that shows the problem.
39+
render: typescript
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: expected
44+
attributes:
45+
label: Expected behavior
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: actual
50+
attributes:
51+
label: Actual behavior
52+
validations:
53+
required: true
54+
- type: textarea
55+
id: context
56+
attributes:
57+
label: Additional context
58+
description: Include relevant dependency versions and sanitized logs.
59+
- type: checkboxes
60+
id: safety
61+
attributes:
62+
label: Safety check
63+
options:
64+
- label: I removed credentials, private prompts, and customer data.
65+
required: true

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
blank_issues_enabled: false
2+
contact_links: []
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Propose a change within the documented SDK roadmap.
3+
title: "[Feature]: "
4+
labels: []
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
description: Describe the user problem rather than only the proposed API.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposed behavior
17+
description: Explain the public behavior and why it belongs in this SDK.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Alternatives considered
24+
- type: checkboxes
25+
id: scope
26+
attributes:
27+
label: Scope check
28+
options:
29+
- label: I checked the roadmap and compatibility documentation.
30+
required: true
31+
- label: This request does not include credentials or customer data.
32+
required: true

‎.github/actionlint-checksums.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
5b44c3bc2255115c9b69e30efc0fecdf498fdb63c5d58e17084fd5f16324c644 actionlint_1.7.12_darwin_amd64.tar.gz
2+
aba9ced2dee8d27fecca3dc7feb1a7f9a52caefa1eb46f3271ea66b6e0e6953f actionlint_1.7.12_darwin_arm64.tar.gz
3+
8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 actionlint_1.7.12_linux_amd64.tar.gz
4+
325e971b6ba9bfa504672e29be93c24981eeb1c07576d730e9f7c8805afff0c6 actionlint_1.7.12_linux_arm64.tar.gz

‎.github/actionlint-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.7.12

‎.github/dependabot.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: npm
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: "04:00"
10+
timezone: Etc/UTC
11+
open-pull-requests-limit: 10
12+
groups:
13+
production-dependencies:
14+
dependency-type: production
15+
development-dependencies:
16+
dependency-type: development
17+
ignore:
18+
- dependency-name: openai
19+
versions:
20+
- ">=7"
21+
22+
- package-ecosystem: github-actions
23+
directory: /
24+
schedule:
25+
interval: weekly
26+
day: monday
27+
time: "04:30"
28+
timezone: Etc/UTC
29+
open-pull-requests-limit: 10

‎.github/pull_request_template.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Summary
2+
3+
Describe the behavior changed and the reason for the change.
4+
5+
## Verification
6+
7+
List the exact local commands run and their outcomes.
8+
9+
## Checklist
10+
11+
- [ ] The change is within the current roadmap milestone.
12+
- [ ] Public behavior, compatibility claims, and examples are documented.
13+
- [ ] Unit, mocked contract, type, lint, format, build, and package checks pass as applicable.
14+
- [ ] Packed ESM, CommonJS, and compatible-OpenAI host fixtures pass as applicable.
15+
- [ ] No credential, private prompt, customer data, generated build output, or local dependency directory is included.
16+
- [ ] Workflow edits pass the repository-pinned `actionlint` version.
17+
- [ ] Remote Actions, live API, and registry evidence are not claimed from local validation.

‎.github/workflows/ci.yml‎

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: "23 5 * * 1"
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: ci-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
workflow-lint:
21+
name: GitHub Actions static validation
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- name: Check out the repository
26+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
27+
with:
28+
persist-credentials: false
29+
- name: Set up Node.js 24
30+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
31+
with:
32+
node-version: 24.x
33+
- name: Validate Public Preview content and identity
34+
run: npm run check:public-preview
35+
- name: Download the pinned actionlint release
36+
id: actionlint
37+
shell: bash
38+
run: |
39+
set -euo pipefail
40+
version="$(tr -d '\n' < .github/actionlint-version)"
41+
asset="actionlint_${version}_linux_amd64.tar.gz"
42+
base="https://github.com/rhysd/actionlint/releases/download/v${version}"
43+
curl --fail --location --proto '=https' --retry 3 --silent --show-error \
44+
"$base/$asset" --output "$RUNNER_TEMP/$asset"
45+
expected="$(awk -v file="$asset" '$2 == file { print $1 }' .github/actionlint-checksums.txt)"
46+
actual="$(sha256sum "$RUNNER_TEMP/$asset" | awk '{ print $1 }')"
47+
if [[ -z "$expected" || "$actual" != "$expected" ]]; then
48+
echo "actionlint release checksum verification failed." >&2
49+
exit 1
50+
fi
51+
tar -xzf "$RUNNER_TEMP/$asset" -C "$RUNNER_TEMP" actionlint
52+
echo "binary=$RUNNER_TEMP/actionlint" >> "$GITHUB_OUTPUT"
53+
- name: Validate all workflows
54+
env:
55+
ACTIONLINT_BIN: ${{ steps.actionlint.outputs.binary }}
56+
run: npm run actionlint
57+
58+
locked:
59+
name: Locked OpenAI / Node.js ${{ matrix.node-version }}
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 25
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
node-version:
66+
- 22.x
67+
- 24.x
68+
steps:
69+
- name: Check out the repository
70+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
71+
with:
72+
persist-credentials: false
73+
- name: Set up Node.js ${{ matrix.node-version }}
74+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
75+
with:
76+
node-version: ${{ matrix.node-version }}
77+
cache: npm
78+
- name: Install locked dependencies
79+
run: npm ci
80+
- name: Check formatting
81+
run: npm run format:check
82+
- name: Lint
83+
run: npm run lint
84+
- name: Type-check
85+
run: npm run typecheck
86+
- name: Run unit and mocked contract tests
87+
run: npm test
88+
- name: Scan tracked material for secret patterns
89+
run: npm run test:secrets
90+
- name: Build ESM and CommonJS outputs
91+
run: npm run build
92+
- name: Validate the package shape
93+
run: npm run test:package
94+
- name: Verify live-smoke semantic checks with mocked transport
95+
run: npm run test:live-contract
96+
- name: Test packed-package fixtures
97+
run: npm run test:fixtures
98+
99+
minimum-openai:
100+
name: Minimum OpenAI / Node.js 22
101+
runs-on: ubuntu-latest
102+
timeout-minutes: 20
103+
steps:
104+
- name: Check out the repository
105+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
106+
with:
107+
persist-credentials: false
108+
- name: Set up Node.js 22
109+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
110+
with:
111+
node-version: 22.x
112+
cache: npm
113+
- name: Install locked development dependencies
114+
run: npm ci
115+
- name: Test the minimum supported OpenAI version
116+
run: npm run test:compat -- --lane minimum
117+
118+
latest-openai:
119+
name: Latest OpenAI 6.x canary / Node.js 24
120+
if: >-
121+
github.event_name == 'schedule' ||
122+
(github.event_name == 'pull_request' && github.actor == 'dependabot[bot]')
123+
runs-on: ubuntu-latest
124+
timeout-minutes: 20
125+
steps:
126+
- name: Check out the repository
127+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
128+
with:
129+
persist-credentials: false
130+
- name: Set up Node.js 24
131+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
132+
with:
133+
node-version: 24.x
134+
cache: npm
135+
- name: Install locked development dependencies
136+
run: npm ci
137+
- name: Test the latest compatible OpenAI version
138+
run: npm run test:compat -- --lane latest
139+
140+
current-node-advisory:
141+
name: Node.js 26 advisory
142+
continue-on-error: true
143+
runs-on: ubuntu-latest
144+
timeout-minutes: 20
145+
steps:
146+
- name: Check out the repository
147+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
148+
with:
149+
persist-credentials: false
150+
- name: Set up Node.js 26
151+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
152+
with:
153+
node-version: 26.x
154+
cache: npm
155+
- name: Install locked dependencies
156+
run: npm ci
157+
- name: Type-check
158+
run: npm run typecheck
159+
- name: Run unit and mocked contract tests
160+
run: npm test
161+
- name: Build ESM and CommonJS outputs
162+
run: npm run build
163+
- name: Validate the package shape
164+
run: npm run test:package
165+
- name: Verify live-smoke semantic checks with mocked transport
166+
run: npm run test:live-contract
167+
168+
self-contained:
169+
name: Standalone repository check
170+
runs-on: ubuntu-latest
171+
timeout-minutes: 25
172+
steps:
173+
- name: Check out the repository
174+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
175+
with:
176+
persist-credentials: false
177+
- name: Set up Node.js 24
178+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
179+
with:
180+
node-version: 24.x
181+
cache: npm
182+
- name: Install locked dependencies
183+
run: npm ci
184+
- name: Copy and verify the standalone repository
185+
run: npm run check:self-contained

0 commit comments

Comments
 (0)