Skip to content

feat(sdk): generate TypeScript SDK for the AIP spec#4469

Merged
tothandras merged 6 commits into
mainfrom
feat/aip-sdk-typescript
Jun 5, 2026
Merged

feat(sdk): generate TypeScript SDK for the AIP spec#4469
tothandras merged 6 commits into
mainfrom
feat/aip-sdk-typescript

Conversation

@tothandras

@tothandras tothandras commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Public JavaScript/TypeScript SDK (@openmeter/client) with class-based facades and standalone function surface for meters, events, customers, subscriptions, billing, tax, features, plans, addons, LLM cost, entitlements, governance.
  • Bug Fixes
    • Structured HTTP error mapping exposing a typed HTTPError with problem-detail fields.
  • Documentation
    • Comprehensive SDK README with installation, init, and usage examples.
  • CI
    • Reusable workflow to publish the SDK to npm via OIDC.
  • Tests
    • New test suites validating client routing, auth, void responses, and error mapping.
  • Chores
    • Packaging/build and emit tooling added (package config, publish target, TS configs).

@tothandras tothandras added the kind/feature New feature or request label Jun 1, 2026
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a TypeSpec→TypeScript emitter, emits a full AIP JS SDK package (core, funcs, models, facades, types, README), updates API TypeSpec namespaces/models, adds tests, and wires CI + Make target to publish @openmeter/client via a reusable GitHub Actions workflow (OIDC).

Changes

AIP JavaScript SDK and tooling

Layer / File(s) Summary
Emitter, SDK package, tests, and CI release
.github/workflows/*, api/spec/packages/typespec-typescript/*, api/spec/packages/aip-client-javascript/**/*, api/spec/packages/aip/**/*, api/spec/packages/legacy/**/*, api/spec/*
Adds a TypeSpec→TS emitter and helper libs; generates @openmeter/client sources (core, encodings, request wrappers, funcs, models, SDK facades, index/README, runtime templates); adds package manifests, tsconfigs, tests, .npmignore/.gitignore, and a reusable GitHub Actions workflow + Make target to publish the SDK.

Sequence Diagram(s)

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested labels

release-note/feature

Suggested reviewers

  • chrisgacsal
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/aip-sdk-typescript

Comment thread api/spec/pnpm-lock.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 Open source vulnerabilities detected - high severity
Aikido detected 2 vulnerabilities across 2 packages, it includes 2 high vulnerabilities.

Details

Remediation Aikido suggests bumping the vulnerable packages to a safe version.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

@tothandras
tothandras force-pushed the feat/aip-sdk-typescript branch from 61915e2 to 58719eb Compare June 5, 2026 11:37
@tothandras
tothandras marked this pull request as ready for review June 5, 2026 11:43
@tothandras
tothandras requested a review from a team as a code owner June 5, 2026 11:43
Comment thread api/spec/packages/typespec-typescript/src/readme.ts Fixed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 13

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (27)
api/spec/packages/aip-client-javascript/src/funcs/plans.ts (1)

1-113: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Generated output isn’t Prettier-clean and currently blocks lint.

CI reports prettier --check failures for this file. Since this package is generated, please fix it via regeneration/formatter in the generation flow rather than manual edits.

As per coding guidelines, api/spec/packages/aip-client-javascript/**: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/plans.ts` around lines 1 -
113, The file fails Prettier checks; regenerate the aip-client-javascript
package (do not hand-edit) from the typespec/typespec-typescript + aip sources
so generated output is Prettier-clean, ensuring the generation step runs the
formatter (or run prettier --write as part of the generation pipeline); target
the generated module containing functions like listPlans, createPlan,
updatePlan, getPlan, deletePlan, archivePlan, and publishPlan so their output
matches project Prettier config and the CI `prettier --check` passes.
api/spec/packages/aip-client-javascript/src/funcs/apps.ts (1)

1-39: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier is failing on this emitted file.

CI already reports style issues here; please fix this through regeneration/template formatting so emitted SDK files pass prettier --check consistently.

As per coding guidelines: "api/spec/packages/aip-client-javascript/**: Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/apps.ts` around lines 1 -
39, The emitted file fails Prettier; do not hand-edit—regenerate the SDK so the
file is formatted correctly. Re-run the typespec/typescript generator
(aip/typespec-typescript) that produces api/spec/packages/aip-client-javascript
and regenerate the file containing listApps and getApp (which use
toURLSearchParams, encodePath, encodeSort, http, and request); ensure the
generator/template outputs pass `prettier --check` (or run the formatter as part
of the generation step) so listApps and getApp are reformatted to match project
Prettier rules.
api/spec/packages/aip-client-javascript/src/sdk/apps.ts (1)

1-31: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier is also failing on this emitted SDK wrapper.

Line-level logic looks fine, but CI flags style issues here too; this should be fixed via the generation/template path so the emitted SDK stays lint-clean.

As per coding guidelines: "api/spec/packages/aip-client-javascript/**: Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/apps.ts` around lines 1 - 31,
The emitted SDK wrapper for the Apps class is failing Prettier/CI; do not
hand-edit apps.ts—instead update the codegen template in the generator
(typespec-typescript / aip generation templates) that emits the Apps class,
imports (listApps, getApp, Client, unwrap, RequestOptions and model types) and
the methods list/get so the produced output conforms to project Prettier rules
(fix import ordering/spacing, trailing newlines, and blank-line placement) and
regenerate the package so the generated Apps class and its methods (constructor,
list, get) are lint-clean.
api/spec/packages/aip-client-javascript/src/sdk/billing.ts (1)

1-61: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports formatting issues. Regenerate the SDK to fix:

cd api/spec
make generate

Based on learnings: Never hand-edit files in aip-client-javascript; regenerate using make generate.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/billing.ts` around lines 1 -
61, The file shows formatting mismatches in the generated SDK (class Billing
with methods listProfiles, createProfile, getProfile, updateProfile,
deleteProfile); do not hand-edit this file—regenerate the JavaScript SDK to fix
Prettier issues by running the repo generation step (from the api/spec directory
run the project generator, e.g., make generate) so the Billing class and its
methods are re-emitted with correct formatting.
api/spec/packages/aip-client-javascript/src/models/operations/billing.ts (1)

1-31: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports formatting issues. Regenerate the SDK to fix:

cd api/spec
make generate

Based on learnings: Never hand-edit files in aip-client-javascript; regenerate using make generate.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/billing.ts`
around lines 1 - 31, The file containing exported types like
ListBillingProfilesQuery, CreateBillingProfileRequest, GetBillingProfileRequest,
UpdateBillingProfileRequest, DeleteBillingProfileRequest has Prettier formatting
issues that must not be hand-edited; regenerate the SDK instead by running the
project generation command (run the make generate target in the spec generator)
so the file is recreated cleanly—do not manually format or change the exported
types such as ListBillingProfilesQuery, CreateBillingProfileRequest,
ProfilePagePaginatedResponse, UpsertBillingProfileRequestInput, etc.
api/spec/packages/aip-client-javascript/src/funcs/billing.ts (1)

1-81: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports formatting issues. Regenerate the SDK to fix:

cd api/spec
make generate

Based on learnings: Never hand-edit files in aip-client-javascript; regenerate using make generate.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/billing.ts` around lines 1
- 81, Prettier formatting failed because this generated file
(api/spec/packages/aip-client-javascript/src/funcs/billing.ts) was hand-edited;
do not manually modify functions like listBillingProfiles, createBillingProfile,
getBillingProfile, updateBillingProfile, or deleteBillingProfile — regenerate
the SDK to fix formatting by running the generator in the spec repo (cd api/spec
&& make generate) and commit the regenerated files instead of manual edits.
api/spec/packages/aip-client-javascript/README.md (1)

1-319: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports formatting issues. Since this README is generated (per the api/spec/**/readme.ts guidelines), regenerate the SDK to fix formatting:

cd api/spec
make generate

Based on learnings: Never hand-edit files in aip-client-javascript; everything is regenerable. As per coding guidelines: the README is emitted by readme.ts and should not be manually edited.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/README.md` around lines 1 - 319, The
README.md in the aip-client-javascript package has Prettier formatting errors;
do not edit it manually—instead regenerate the SDK using the repository's
generator: run the generator (make generate) in the api/spec workspace to reemit
README.md from the readme.ts generator, commit the regenerated files, and ensure
no manual edits remain in the aip-client-javascript readme.
api/spec/packages/aip-client-javascript/.gitignore (1)

1-10: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports this file has formatting issues. Run pnpm format from api/spec/ to fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/.gitignore` around lines 1 - 10,
Prettier reports formatting errors in the .gitignore that contains entries like
"dist/", "tsconfig.tsbuildinfo", "node_modules/", and "*.assert.ts"; fix by
running the repo formatter (pnpm format) in the package that owns this
.gitignore (the package where this file lives) and commit the reformatted
.gitignore so the CI Prettier check passes.
api/spec/packages/aip-client-javascript/.npmignore (1)

1-18: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier formatting issue blocking CI.

The pipeline reports this file has formatting issues. Run pnpm format from api/spec/ to fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/.npmignore` around lines 1 - 18, The
.npmignore file fails Prettier formatting and is blocking CI; reformat it by
running the workspace formatter (run pnpm format from the package root) so
.npmignore matches Prettier rules and the pipeline passes, then commit the
updated .npmignore; target the .npmignore file in the aip-client-javascript
package.
api/spec/packages/aip-client-javascript/src/funcs/addons.ts (1)

1-113: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Fix formatting in the generator, not the generated output.

The Prettier check is failing on this file, but per the coding guidelines this file is regenerable and should never be hand-edited. The formatting issues need to be resolved by either:

  1. Running Prettier as part of the generation step in typespec-typescript/src/emitter.tsx, or
  2. Adding a post-generation formatting step in the emitter

The generated code patterns look correct.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/addons.ts` around lines 1 -
113, The generated file aip-client-javascript/src/funcs/addons.ts is failing
Prettier because the generator doesn't format output; update the generator in
typespec-typescript/src/emitter.tsx to run Prettier (or invoke the Prettier CLI)
on generated TypeScript output (either per-file or as a post-generation step)
after emitting the code for functions like listAddons, createAddon, updateAddon,
etc.; ensure the emitter catches and logs formatting errors, applies the
Prettier config used by the repo, and writes the formatted contents back so
regenerations produce Prettier-compliant files without manual edits.
api/spec/packages/typespec-typescript/src/sdk-files.ts (1)

1-323: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Run Prettier on source files.

This is actual source code (not generated), so the Prettier failure should be fixed by running pnpm run format or similar in the typespec-typescript package.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/typespec-typescript/src/sdk-files.ts` around lines 1 - 323,
Prettier formatting errors detected in the source (fix by running the formatter)
— run the project formatter (e.g. cd into the typespec-typescript package and
run pnpm run format or your repo's equivalent) and commit the resulting changes
so functions like funcsFile, operationsFile, facadeFile, namespaceFile and
related source (sdk-files.ts) are properly formatted; ensure you re-run
lint/format checks to confirm the Prettier issues are resolved before updating
the PR.
api/spec/packages/typespec-typescript/src/runtime-templates.ts (1)

1-36: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

This file is generated—edit the baseline instead.

Line 1's header says this is generated by gen-runtime-templates.mjs, so formatting fixes should go in the baseline runtime files, not here. Per the learnings, to update this:

  1. Restore the baseline from /tmp/om-aip-sdk-baseline or git history
  2. Update the baseline templates
  3. Re-run gen-runtime-templates.mjs with BASELINE_DIR pointing at it

The Prettier failure is expected for generated files.

Based on learnings: "To edit runtime templates or conformance tests, restore the baseline ... update it, and re-run gen-runtime-templates.mjs with BASELINE_DIR pointing at it"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/typespec-typescript/src/runtime-templates.ts` around lines
1 - 36, This file (RUNTIME_TEMPLATES / ENCODED in
api/spec/packages/typespec-typescript/src/runtime-templates.ts) is generated; do
not modify it—instead restore the baseline templates (e.g. from
/tmp/om-aip-sdk-baseline or git history), make your formatting/templating
changes in the baseline files, then re-run the generator
scripts/gen-runtime-templates.mjs with BASELINE_DIR pointed at the restored
baseline to regenerate runtime-templates.ts; verify the regenerated output
(ENCODED / RUNTIME_TEMPLATES) before committing.
api/spec/packages/aip-client-javascript/src/funcs/customers.ts (1)

1-281: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Generated SDK output is failing lint gates.

CI is flagging Prettier issues here (and sibling generated SDK files), so pnpm lint currently fails. Please regenerate from the emitter and ensure emitted output is Prettier-clean before commit.

Based on learnings: run generation via the Makefile (make generate) instead of hand-editing generated SDK artifacts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/customers.ts` around lines
1 - 281, The generated SDK file has Prettier formatting errors (causing pnpm
lint to fail) across emitted functions like createCustomer, getCustomer,
listCustomers, upsertCustomer, etc.; fix by re-generating the SDK from the
emitter (run the project Makefile target: make generate) instead of
hand-editing, then run the formatter/lint (pnpm lint or prettier --write) to
ensure emitted files (including the functions above) are Prettier-clean before
committing.
api/spec/packages/aip-client-javascript/src/models/operations/features.ts (1)

1-41: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier check is failing on this file too.

Please run formatting here as well; it’s listed in CI and currently blocks lint.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/features.ts`
around lines 1 - 41, This file is failing Prettier formatting; run the project's
formatter (e.g. the repo's configured Prettier via npm run format or prettier
--write) on the file that defines ListFeaturesQuery, CreateFeatureRequest,
UpdateFeatureRequest, and related types, fix formatting differences (imports,
spacing, trailing commas, newline at EOF) and commit the reformatted file so CI
passes.
api/spec/packages/aip-client-javascript/src/funcs/features.ts (1)

1-98: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier check is blocking CI for this file.

This file is explicitly reported by prettier --check; please format it so pnpm lint can pass.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/features.ts` around lines 1
- 98, The file fails Prettier formatting; run the formatter and apply its
suggested changes to make CI pass. Reformat this file (affecting functions
listFeatures, createFeature, getFeature, updateFeature, deleteFeature,
queryFeatureCost and their imports/exports) by running the project's formatter
(e.g. pnpm lint or prettier --write) and commit the resulting
whitespace/line-break/style updates so the file conforms to the repo Prettier
rules.
api/spec/packages/aip-client-javascript/src/funcs/governance.ts (1)

1-24: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Generated code must pass prettier check before merge.

The CI pipeline is failing because this generated file doesn't pass prettier --check. Since these files in aip-client-javascript/ are regenerable from the TypeSpec emitter, you'll need to either:

  1. Update the emitter to produce prettier-compliant output, or
  2. Add a formatting step after generation (e.g., prettier --write in the generation script)

As per coding guidelines: Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/governance.ts` around lines
1 - 24, The generated file fails the project's Prettier check; update the
TypeSpec emitter or the generation pipeline so generated code for symbols like
queryGovernanceAccess (in aip-client-javascript/src/funcs/governance.ts) is
emitted in Prettier-compliant format or is automatically formatted after
generation; specifically either fix the emitter templates that produce the
http(...).post(...) call and import ordering/style, or add a post-generation
step (e.g., run prettier --write on aip-client-javascript) in the generation
script so files like governance.ts always pass prettier --check.
api/spec/packages/legacy/src/notification/channel.tsp (1)

200-251: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Run prettier to fix formatting.

The return type formatting changes need to be auto-formatted with prettier to pass CI.

#!/bin/bash
# Auto-fix formatting
cd api/spec && pnpm prettier --write packages/legacy/src/notification/channel.tsp
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/legacy/src/notification/channel.tsp` around lines 200 -
251, Run the project's Prettier formatter on the changed TypeSpec file so the
return-type alignment for the create/update/get/delete operations (see functions
named create, update, get, delete and types
NotificationChannelCreateRequest/NotificationChannel) matches CI style; run the
repo's formatting command (e.g., the api/spec pnpm prettier --write target file)
or your usual project formatting step and commit the updated file so the
return-type blocks are auto-formatted.
api/spec/packages/aip-client-javascript/src/sdk/llmCost.ts (1)

1-61: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix formatting by regenerating the SDK.

Prettier check is failing. Since this is generated code, run the emitter with prettier enabled to fix formatting.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/llmCost.ts` around lines 1 -
61, This file is generated and failing Prettier; do not hand-edit—regenerate the
aip-client-javascript SDK with the emitter configured to run Prettier so
formatting is corrected (the class LLMCost and its methods listPrices, getPrice,
listOverrides, createOverride, deleteOverride will be replaced by the formatted
output). Re-run the typespec/types + aip emitter pipeline with prettier enabled
and commit the regenerated file so the LLMCost class and its exported functions
match project style.
api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts (1)

1-38: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix formatting by regenerating the SDK.

Prettier check is failing. Since this is generated code, run the emitter with prettier to fix formatting.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts`
around lines 1 - 38, The file containing types like ListLlmCostPricesQuery,
ListLlmCostPricesRequest, GetLlmCostPriceRequest, ListLlmCostOverridesQuery,
CreateLlmCostOverrideRequest, and DeleteLlmCostOverrideRequest is misformatted;
do not hand-edit it—regenerate the aip-client-javascript SDK using the
typespec-typescript/aip emitter and ensure the emitter runs Prettier (or run
Prettier on the generated output) so the formatting checks pass and the
generated declarations are correctly formatted.
api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts (1)

1-86: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix formatting by regenerating the SDK.

Prettier check is failing. Since this is generated code, the formatting should be corrected by running the emitter with prettier enabled.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts` around lines 1
- 86, The file funcs/llmCost.ts is failing Prettier because it is generated code
with formatting drift; do not hand-edit—regenerate the SDK from the typespec/aip
sources and run the emitter with Prettier enabled so funcs/llmCost.ts (including
functions listLlmCostPrices, getLlmCostPrice, listLlmCostOverrides,
createLlmCostOverride, deleteLlmCostOverride) is rewritten with the correct
formatting; after regeneration, run the repository Prettier/CI checks and commit
the regenerated output.
api/spec/packages/legacy/src/meters.tsp (1)

65-263: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Run prettier to fix formatting.

All the return type formatting changes need to be auto-formatted with prettier to pass CI.

#!/bin/bash
# Auto-fix formatting
cd api/spec && pnpm prettier --write packages/legacy/src/meters.tsp
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/legacy/src/meters.tsp` around lines 65 - 263, The file
defining the Meter endpoints (symbols: get, create, update, delete, queryJson,
queryCsv, query, queryCsvPost, listSubjects, listGroupByValues) is incorrectly
formatted; run Prettier to auto-fix the return type and spacing changes and
re-run CI. Specifically, run your repository's standard formatter (e.g., pnpm
prettier --write or prettier --write) over the API spec package containing
meters.tsp and commit the resulting changes so the return type blocks match the
project's Prettier rules.
api/spec/packages/legacy/src/events.tsp (1)

114-144: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Run prettier to fix formatting.

The return type formatting changes need to be auto-formatted with prettier to pass CI.

#!/bin/bash
# Auto-fix formatting
cd api/spec && pnpm prettier --write packages/legacy/src/events.tsp
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/legacy/src/events.tsp` around lines 114 - 144, Run the
formatter to fix the return-type/union alignment in the TSP spec where the
ingestEvents and ingestEventsJson operations are declared (the events.tsp
module); run your project's Prettier (e.g. pnpm prettier --write) against that
spec file or the repo, verify the file containing ingestEvents/ingestEventsJson
is updated, then stage the formatted changes so CI passes.
api/spec/packages/aip-client-javascript/src/models/operations/tax.ts (1)

1-33: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Please format this file; lint is failing here.

Prettier check flags this file in CI, so this needs a formatting pass before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/tax.ts` around
lines 1 - 33, This file is failing Prettier formatting; run the project's
formatter (e.g., npm run format or Prettier) and reformat this file so imports,
spacing, and type declarations conform to lint rules; specifically ensure
consistent import spacing for "z" and "schemas", align export type blocks like
CreateTaxCodeRequest, GetTaxCodeRequest, ListTaxCodesQuery,
UpsertTaxCodeRequest, DeleteTaxCodeRequest, and remove/adjust any trailing
whitespace or inconsistent indentation so the file passes CI Prettier checks.
api/spec/packages/aip-client-javascript/src/funcs/tax.ts (1)

1-82: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Run Prettier on this file to unblock CI.

CI lint is currently failing on this file due to formatting drift. A quick format pass should clear it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/tax.ts` around lines 1 -
82, This file is failing CI due to formatting drift; run Prettier (or your
project's formatter) on this file and commit the changes to fix formatting
inconsistencies across the exported functions (createTaxCode, getTaxCode,
listTaxCodes, upsertTaxCode, deleteTaxCode) and imports; simply format the file
(e.g., npx prettier --write
api/spec/packages/aip-client-javascript/src/funcs/tax.ts) and re-run CI.
api/spec/packages/aip-client-javascript/src/sdk/tax.ts (1)

1-61: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Prettier mismatch in this file is failing lint.

This file is part of the current formatting failures in CI; please run formatter here too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/tax.ts` around lines 1 - 61,
This file fails Prettier formatting; run the project's formatter on the Tax
class file (which defines class Tax and its methods createCode, getCode,
listCodes, upsertCode, deleteCode) and reformat imports, spacing, line breaks
and trailing newline so it matches the repo Prettier config, then stage and
commit the formatted file so the CI linting error is resolved.
api/spec/packages/aip-client-javascript/src/sdk/planAddons.ts (1)

1-61: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Formatting fix needed in this SDK facade file.

CI shows Prettier drift here; reformatting will unblock lint.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/planAddons.ts` around lines 1
- 61, The file has Prettier/formatting drift around the PlanAddons SDK facade
(class PlanAddons and its methods list, create, get, update, delete); reformat
the file to match the repository Prettier/ESLint rules (apply the project's
Prettier config or run the formatter used by CI) so imports, spacing, line
breaks and trailing newline conform to CI expectations and then commit the
formatted file.
api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts (1)

1-56: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prettier is still blocking CI on this generated output.

pnpm lint is currently failing on prettier --check for this file, so this needs regeneration/reformatting before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts`
around lines 1 - 56, The file containing the TypeScript model types (e.g.,
CreateSubscriptionRequest, ListSubscriptionsQuery, GetSubscriptionResponse,
ListSubscriptionAddonsResponse) is failing prettier --check; regenerate or
reformat this generated output so it matches the project's Prettier
configuration—either re-run the code generator that produced these types or run
the project's formatter (e.g., the configured Prettier) on this file and commit
the updated formatting so `pnpm lint` / `prettier --check` passes.
♻️ Duplicate comments (6)
api/spec/packages/aip-client-javascript/tests/errors.spec.ts (1)

1-67: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated test.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tests/errors.spec.ts` around lines 1
- 67, The tests in errors.spec.ts are failing Prettier formatting because this
file is generated; do not hand-edit it—re-generate the aip-client-javascript
artifacts from the authoritative sources instead: run the generator that
produces api/spec/packages/aip-client-javascript (the typespec-typescript / aip
codegen step) so errors.spec.ts (and any formatting) is rebuilt correctly;
locate the failing test file errors.spec.ts (refs: describe('error mapping'),
funcs.getMeter, HTTPError) and regenerate the package rather than applying
manual formatting fixes.
api/spec/packages/aip-client-javascript/tests/client.spec.ts (1)

1-121: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated test.

Same root cause as the main source files - the emitter needs to format its output or the generation pipeline should include a formatting step.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tests/client.spec.ts` around lines 1
- 121, The failing tests are due to Prettier formatting issues in the generated
test file; fix by reformatting the generated output rather than hand-editing it:
regenerate the aip-client-javascript artifacts from typespec-typescript/aip
sources (ensuring the emitter emits Prettier-compliant code) or run Prettier on
this test file (tests/client.spec.ts) after generation so utilities like
mockMeter, lastUrl, and the OpenMeter test usages are formatted correctly;
update the generation pipeline to include a formatting step so future outputs
from the emitter are Prettier-clean.
api/spec/packages/aip-client-javascript/tests/void-responses.spec.ts (1)

1-99: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated test.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tests/void-responses.spec.ts` around
lines 1 - 99, The test file tests/void-responses.spec.ts has Prettier formatting
violations that should not be fixed by hand; regenerate the file from the
canonical sources instead—run the aip/typespec Typescript generator (the
typespec-typescript + aip codegen pipeline you use to produce
aip-client-javascript tests) to produce a properly formatted
tests/void-responses.spec.ts (which contains funcs.ingestMeteringEvents and
funcs.deleteMeter usages) and commit the generated output; do not manually edit
the file in aip-client-javascript.
api/spec/packages/aip-client-javascript/tests/nesting.spec.ts (1)

1-32: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated test.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tests/nesting.spec.ts` around lines 1
- 32, The failing file
api/spec/packages/aip-client-javascript/tests/nesting.spec.ts has Prettier
formatting errors but must not be hand-edited; instead regenerate the
aip-client-javascript client so the test is produced correctly: re-run the
Typespec/AIP generator that emits aip-client-javascript (the sources that
produce nesting.spec.ts and the OpenMeter client), then run the repo formatter
(prettier) on the generated output and commit the regenerated files; do not
manually edit nesting.spec.ts or tests like the "routes customers.charges.list()
to the charges sub-resource" case.
api/spec/packages/aip-client-javascript/tsconfig.json (1)

1-14: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated config.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tsconfig.json` around lines 1 - 14,
The tsconfig.json in the aip-client-javascript package was hand-edited and is
causing Prettier/pipeline failures; revert this manual change and regenerate the
package files from the canonical generators rather than editing by hand: remove
your edits to the tsconfig.json in the aip-client-javascript package, then run
the typespec/typescript generator pipeline (the typespec-typescript + aip
regeneration command used by the repo) to produce the correct, formatted
tsconfig.json and commit those generated outputs; ensure future changes to
tsconfig.json come from the generator outputs only and not from manual edits.
api/spec/packages/aip-client-javascript/tests/meters.spec.ts (1)

1-93: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Pipeline failure: Prettier formatting issues in generated test.

As per coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources"

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/tests/meters.spec.ts` around lines 1
- 93, The failing pipeline is due to Prettier formatting in a generated test
(tests using client(), mockList(), funcs.listMeters and funcs.getMeter) which
should not be manually edited; fix by updating the upstream generator or source
definitions (typespec-typescript / aip) that produce this file and then re-run
the codegen to regenerate a properly formatted meters.spec.ts, or adjust the
generator template to emit Prettier-compliant formatting and re-run generation
so the generated test (and its helper functions client and mockList) conform to
project formatting rules.
🧹 Nitpick comments (5)
api/spec/Makefile (1)

41-41: ⚡ Quick win

Redundant "with tag" in success message.

The message prints "with tag $${AIP_SDK_RELEASE_TAG}" twice: once in "version ... with tag" and again at the end.

✨ Proposed fix
-	`@echo` "✅ Published $${AIP_SDK_RELEASE_TAG} AIP TypeScript SDK (`@openmeter/client`) version $${AIP_SDK_RELEASE_VERSION} with tag $${AIP_SDK_RELEASE_TAG}"
+	`@echo` "✅ Published AIP TypeScript SDK (`@openmeter/client`) version $${AIP_SDK_RELEASE_VERSION} with tag $${AIP_SDK_RELEASE_TAG}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/Makefile` at line 41, Update the success echo in the Makefile to
remove the duplicated "with tag" wording: locate the echo that references
AIP_SDK_RELEASE_TAG and AIP_SDK_RELEASE_VERSION (the line containing "`@echo` \"✅
Published $${AIP_SDK_RELEASE_TAG} AIP TypeScript SDK (`@openmeter/client`) version
$${AIP_SDK_RELEASE_VERSION} with tag $${AIP_SDK_RELEASE_TAG}\"") and edit the
message so "with tag" appears only once (for example, include the tag only once
after either the package name or the version).
api/spec/packages/aip-client-javascript/src/models/operations/meters.ts (1)

1-2: 💤 Low value

Unused zod imports.

The file imports zod and schemas but doesn't appear to use them—only type aliases and interfaces are defined. This increases bundle size unnecessarily. Since this is generated code (per guidelines, aip-client-javascript/** files are regenerable), the emitter should be updated to omit these imports when zod schemas aren't actually emitted.

Based on coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources" and "Do not validate request bodies; let the server own defaults and validation; do not parse request bodies with zod schemas."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/meters.ts`
around lines 1 - 2, Remove the unused Zod-related imports from the generated
module: eliminate "import { z } from 'zod'" and "import * as schemas from
'../schemas.js'" in the meters.ts emitter when no zod schemas are emitted;
update the codegen template that produces
api/spec/packages/aip-client-javascript/src/models/operations/meters.ts so it
only emits those import lines when the file actually references z or schemas
(e.g., check for any usages of z or schemas before emitting imports), and
regenerate the file so only the type aliases/interfaces remain.
api/spec/packages/aip-client-javascript/src/funcs/defaults.ts (1)

12-22: 💤 Low value

Unused req parameter in GET request.

The req parameter is declared but never used in the function body since GetOrganizationDefaultTaxCodesRequest is an empty Record<string, never>. While this is generated code (per guidelines, files in aip-client-javascript/** are regenerable), the emitter could be updated to omit the req parameter entirely when the request type is empty, improving the generated API surface.

Based on coding guidelines: "Never hand-edit files in aip-client-javascript; everything it contains is regenerable from typespec-typescript and aip sources."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/defaults.ts` around lines
12 - 22, The function getOrganizationDefaultTaxCodes currently accepts an unused
req parameter (GetOrganizationDefaultTaxCodesRequest is an empty Record) —
remove the unused req parameter from the function signature and all generated
call sites so the function becomes getOrganizationDefaultTaxCodes(client:
Client, options?: RequestOptions):
Promise<Result<GetOrganizationDefaultTaxCodesResponse>>; keep the internal
implementation calling http(client).get('openmeter/defaults/tax-codes',
options).json<...>(), preserve the return type, and update the generator/emitter
that produces this file so it omits request parameters when the request type is
empty to prevent reintroducing the unused parameter.
api/spec/packages/aip-client-javascript/src/models/operations/addons.ts (1)

1-1: 💤 Low value

Unused import optimization opportunity.

Line 1 imports z from zod but this namespace doesn't use any Zod schemas. This happens because sdk-files.ts:84 checks requestTypes.usesZod at a global level rather than per-namespace. Consider refining the generator to only emit the zod import when the specific namespace actually uses it.

Not a bug, just a minor generated-code optimization.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/operations/addons.ts` at
line 1, This file imports `z` from 'zod' but doesn't use it; remove the unused
import from
api/spec/packages/aip-client-javascript/src/models/operations/addons.ts or,
better, update the generator check in sdk-files.ts (around the
requestTypes.usesZod logic) to evaluate usesZod per-namespace instead of
globally so the import is only emitted when that namespace actually references
Zod; target the generator symbol `requestTypes.usesZod` and the output file
`addons.ts` when making the change.
api/spec/packages/typespec-typescript/src/sdk-files.ts (1)

84-88: 💤 Low value

Consider per-namespace Zod import check.

Line 84 checks requestTypes.usesZod globally, so if any namespace uses Zod, every namespace's operation file gets the import. This causes unused imports in namespaces that don't use Zod (like the addons.ts we saw earlier).

Consider checking whether this specific namespace uses Zod instead. Low priority optimization.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/typespec-typescript/src/sdk-files.ts` around lines 84 - 88,
The current code uses the global flag requestTypes.usesZod to decide adding Zod
imports, causing imports in namespaces that don't use Zod; change the check to
inspect the requestTypes for the specific namespace being generated (e.g., use
the per-namespace requestTypes object or a
requestTypesByNamespace[namespace].usesZod or the local variable passed into the
operations generator) before pushing `import { z } from 'zod'` and `import * as
schemas...`; update the conditional around imports.push in sdk-files.ts (the
block referencing requestTypes.usesZod and imports.push) to use the
namespace-scoped flag so only namespaces that actually use Zod get the imports.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3bb69f1d-b9a9-4516-990f-be3a0fdb3e9b

📥 Commits

Reviewing files that changed from the base of the PR and between f443a24 and 58719eb.

⛔ Files ignored due to path filters (3)
  • api/spec/patches/@typespec__emitter-framework@0.17.0.patch is excluded by !api/spec/patches/**
  • api/spec/patches/@typespec__http-client.patch is excluded by !api/spec/patches/**
  • api/spec/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (144)
  • .github/workflows/aip-npm-release.yaml
  • .github/workflows/release.yaml
  • AGENTS.md
  • api/spec/.gitignore
  • api/spec/.prettierignore
  • api/spec/AGENTS.md
  • api/spec/Makefile
  • api/spec/package.json
  • api/spec/packages/aip-client-javascript/.gitignore
  • api/spec/packages/aip-client-javascript/.npmignore
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/package.json
  • api/spec/packages/aip-client-javascript/src/core.ts
  • api/spec/packages/aip-client-javascript/src/funcs/addons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/funcs/billing.ts
  • api/spec/packages/aip-client-javascript/src/funcs/currencies.ts
  • api/spec/packages/aip-client-javascript/src/funcs/customers.ts
  • api/spec/packages/aip-client-javascript/src/funcs/defaults.ts
  • api/spec/packages/aip-client-javascript/src/funcs/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/funcs/events.ts
  • api/spec/packages/aip-client-javascript/src/funcs/features.ts
  • api/spec/packages/aip-client-javascript/src/funcs/governance.ts
  • api/spec/packages/aip-client-javascript/src/funcs/index.ts
  • api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/funcs/meters.ts
  • api/spec/packages/aip-client-javascript/src/funcs/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/plans.ts
  • api/spec/packages/aip-client-javascript/src/funcs/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/lib/config.ts
  • api/spec/packages/aip-client-javascript/src/lib/encodings.ts
  • api/spec/packages/aip-client-javascript/src/lib/request.ts
  • api/spec/packages/aip-client-javascript/src/lib/to-error.ts
  • api/spec/packages/aip-client-javascript/src/lib/types.ts
  • api/spec/packages/aip-client-javascript/src/models/errors.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/addons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/billing.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/customers.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/defaults.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/events.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/features.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/governance.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/meters.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/plans.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/tax.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/addons.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip-client-javascript/src/sdk/billing.ts
  • api/spec/packages/aip-client-javascript/src/sdk/currencies.ts
  • api/spec/packages/aip-client-javascript/src/sdk/customers.ts
  • api/spec/packages/aip-client-javascript/src/sdk/defaults.ts
  • api/spec/packages/aip-client-javascript/src/sdk/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/sdk/events.ts
  • api/spec/packages/aip-client-javascript/src/sdk/features.ts
  • api/spec/packages/aip-client-javascript/src/sdk/governance.ts
  • api/spec/packages/aip-client-javascript/src/sdk/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/sdk/meters.ts
  • api/spec/packages/aip-client-javascript/src/sdk/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/sdk/plans.ts
  • api/spec/packages/aip-client-javascript/src/sdk/sdk.ts
  • api/spec/packages/aip-client-javascript/src/sdk/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/sdk/tax.ts
  • api/spec/packages/aip-client-javascript/tests/client.spec.ts
  • api/spec/packages/aip-client-javascript/tests/errors.spec.ts
  • api/spec/packages/aip-client-javascript/tests/meters.spec.ts
  • api/spec/packages/aip-client-javascript/tests/nesting.spec.ts
  • api/spec/packages/aip-client-javascript/tests/void-responses.spec.ts
  • api/spec/packages/aip-client-javascript/tsconfig.json
  • api/spec/packages/aip/package.json
  • api/spec/packages/aip/src/common/error.tsp
  • api/spec/packages/aip/src/common/parameters.tsp
  • api/spec/packages/aip/src/common/properties.tsp
  • api/spec/packages/aip/src/customers/billing.tsp
  • api/spec/packages/aip/src/customers/charges/charges.tsp
  • api/spec/packages/aip/src/customers/charges/operations.tsp
  • api/spec/packages/aip/src/customers/credits/grant.tsp
  • api/spec/packages/aip/src/customers/credits/operations.tsp
  • api/spec/packages/aip/src/customers/operations.tsp
  • api/spec/packages/aip/src/konnect.tsp
  • api/spec/packages/aip/src/meters/operations.tsp
  • api/spec/packages/aip/src/openmeter.tsp
  • api/spec/packages/aip/tspconfig.yaml
  • api/spec/packages/legacy/src/app/app.tsp
  • api/spec/packages/legacy/src/app/marketplace.tsp
  • api/spec/packages/legacy/src/app/stripe.tsp
  • api/spec/packages/legacy/src/billing/customeroverride.tsp
  • api/spec/packages/legacy/src/billing/invoices.tsp
  • api/spec/packages/legacy/src/billing/profile.tsp
  • api/spec/packages/legacy/src/customer/app.tsp
  • api/spec/packages/legacy/src/customer/customer.tsp
  • api/spec/packages/legacy/src/customer/stripe.tsp
  • api/spec/packages/legacy/src/debug.tsp
  • api/spec/packages/legacy/src/entitlements/customer.tsp
  • api/spec/packages/legacy/src/entitlements/entitlements.tsp
  • api/spec/packages/legacy/src/entitlements/subjects.tsp
  • api/spec/packages/legacy/src/entitlements/v2/customer.tsp
  • api/spec/packages/legacy/src/events.tsp
  • api/spec/packages/legacy/src/meters.tsp
  • api/spec/packages/legacy/src/notification/channel.tsp
  • api/spec/packages/legacy/src/notification/event.tsp
  • api/spec/packages/legacy/src/notification/invoice.tsp
  • api/spec/packages/legacy/src/notification/rule.tsp
  • api/spec/packages/legacy/src/portal.tsp
  • api/spec/packages/legacy/src/productcatalog/routes.tsp
  • api/spec/packages/typespec-typescript/.gitignore
  • api/spec/packages/typespec-typescript/package.json
  • api/spec/packages/typespec-typescript/scripts/gen-runtime-templates.mjs
  • api/spec/packages/typespec-typescript/src/ZodOperations.tsx
  • api/spec/packages/typespec-typescript/src/components/ZodCustomTypeComponent.tsx
  • api/spec/packages/typespec-typescript/src/components/ZodOptions.tsx
  • api/spec/packages/typespec-typescript/src/components/ZodSchema.tsx
  • api/spec/packages/typespec-typescript/src/components/ZodSchemaDeclaration.tsx
  • api/spec/packages/typespec-typescript/src/components/index.ts
  • api/spec/packages/typespec-typescript/src/context/zod-options.ts
  • api/spec/packages/typespec-typescript/src/emitter.tsx
  • api/spec/packages/typespec-typescript/src/external-packages/zod.ts
  • api/spec/packages/typespec-typescript/src/index.ts
  • api/spec/packages/typespec-typescript/src/input-variants.ts
  • api/spec/packages/typespec-typescript/src/interface-types.ts
  • api/spec/packages/typespec-typescript/src/lib.ts
  • api/spec/packages/typespec-typescript/src/readme.ts
  • api/spec/packages/typespec-typescript/src/request-types.ts
  • api/spec/packages/typespec-typescript/src/runtime-templates.ts
  • api/spec/packages/typespec-typescript/src/sdk-files.ts
  • api/spec/packages/typespec-typescript/src/sdk-operations.ts
  • api/spec/packages/typespec-typescript/src/strip-prefixes.ts
  • api/spec/packages/typespec-typescript/src/ts-types.ts
  • api/spec/packages/typespec-typescript/src/utils.tsx
  • api/spec/packages/typespec-typescript/src/zodBaseSchema.tsx
  • api/spec/packages/typespec-typescript/src/zodConstraintsParts.tsx
  • api/spec/packages/typespec-typescript/src/zodDescriptionParts.tsx
  • api/spec/packages/typespec-typescript/src/zodMemberParts.tsx
  • api/spec/packages/typespec-typescript/tsconfig.json
  • api/spec/pnpm-workspace.yaml

Comment thread api/spec/package.json Outdated
Comment thread api/spec/packages/legacy/src/entitlements/v2/customer.tsp
Comment thread api/spec/packages/typespec-typescript/src/context/zod-options.ts
Comment thread api/spec/packages/typespec-typescript/src/emitter.tsx
Comment thread api/spec/packages/typespec-typescript/src/request-types.ts
Comment thread api/spec/packages/typespec-typescript/src/sdk-operations.ts
Comment thread api/spec/packages/typespec-typescript/src/ts-types.ts
Comment thread api/spec/packages/typespec-typescript/src/zodConstraintsParts.tsx
Comment thread api/spec/packages/typespec-typescript/src/ZodOperations.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/spec/packages/aip-client-javascript/README.md`:
- Line 169: The table entry for client.subscriptions.change (POST
/openmeter/subscriptions/{subscriptionId}/change) contains a sentence fragment
"Can be used for upgrades, downgrades, and plan changes."; update the
description to a complete sentence (e.g. "This endpoint can be used for
upgrades, downgrades, and plan changes.") so the table reads grammatically
correct and conveys a clear subject.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6abbaa32-c43c-4d7d-a9df-20ec3b146fe3

📥 Commits

Reviewing files that changed from the base of the PR and between 58719eb and 87b1f2e.

📒 Files selected for processing (43)
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/src/funcs/addons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/funcs/billing.ts
  • api/spec/packages/aip-client-javascript/src/funcs/currencies.ts
  • api/spec/packages/aip-client-javascript/src/funcs/customers.ts
  • api/spec/packages/aip-client-javascript/src/funcs/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/funcs/features.ts
  • api/spec/packages/aip-client-javascript/src/funcs/governance.ts
  • api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/funcs/meters.ts
  • api/spec/packages/aip-client-javascript/src/funcs/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/plans.ts
  • api/spec/packages/aip-client-javascript/src/funcs/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts
  • api/spec/packages/aip-client-javascript/src/lib/config.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/addons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/billing.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/customers.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/defaults.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/events.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/features.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/governance.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/meters.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/plans.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/tax.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip-client-javascript/src/sdk/customers.ts
  • api/spec/packages/aip-client-javascript/src/sdk/defaults.ts
  • api/spec/packages/aip-client-javascript/src/sdk/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/sdk/events.ts
  • api/spec/packages/aip-client-javascript/src/sdk/governance.ts
  • api/spec/packages/aip-client-javascript/tests/client.spec.ts
  • api/spec/packages/aip-client-javascript/tests/errors.spec.ts
  • api/spec/packages/aip-client-javascript/tests/meters.spec.ts
  • api/spec/packages/aip-client-javascript/tests/nesting.spec.ts
✅ Files skipped from review due to trivial changes (3)
  • api/spec/packages/aip-client-javascript/src/models/operations/tax.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/plans.ts
🚧 Files skipped from review as they are similar to previous changes (34)
  • api/spec/packages/aip-client-javascript/src/sdk/entitlements.ts
  • api/spec/packages/aip-client-javascript/tests/nesting.spec.ts
  • api/spec/packages/aip-client-javascript/src/sdk/governance.ts
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/sdk/events.ts
  • api/spec/packages/aip-client-javascript/src/funcs/governance.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/defaults.ts
  • api/spec/packages/aip-client-javascript/tests/errors.spec.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/funcs/entitlements.ts
  • api/spec/packages/aip-client-javascript/tests/meters.spec.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/governance.ts
  • api/spec/packages/aip-client-javascript/src/sdk/defaults.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts
  • api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/funcs/billing.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/features.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/billing.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/lib/config.ts
  • api/spec/packages/aip-client-javascript/src/funcs/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/customers.ts
  • api/spec/packages/aip-client-javascript/src/funcs/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/meters.ts
  • api/spec/packages/aip-client-javascript/src/funcs/features.ts
  • api/spec/packages/aip-client-javascript/src/funcs/plans.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/events.ts
  • api/spec/packages/aip-client-javascript/src/funcs/meters.ts
  • api/spec/packages/aip-client-javascript/src/funcs/customers.ts
  • api/spec/packages/aip-client-javascript/src/sdk/customers.ts
  • api/spec/packages/aip-client-javascript/src/funcs/addons.ts

Comment thread api/spec/packages/aip-client-javascript/README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/spec/packages/legacy/package.json`:
- Line 29: The package.json currently mixes
`@typespec/prettier-plugin-typespec`@1.12.0 with the rest of the `@typespec/`*
packages pinned at 1.11.0; update the plugin to match the toolchain minor by
changing "`@typespec/prettier-plugin-typespec`" to "1.11.0" in package.json (or
alternatively bump all `@typespec/`* packages to 1.12.0 if you intend to upgrade
the toolchain), then reinstall/update your lockfile (npm/yarn/pnpm) to ensure
the lockfile reflects the consistent versions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f9d641a-55ee-4371-ad51-8b976ca29794

📥 Commits

Reviewing files that changed from the base of the PR and between 87b1f2e and 1acdc1d.

⛔ Files ignored due to path filters (1)
  • api/spec/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • api/spec/packages/aip/package.json
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/spec/packages/aip/src/billing/operations.tsp
  • api/spec/packages/aip/src/currencies/cost-bases/operations.tsp
  • api/spec/packages/aip/src/currencies/operations.tsp
  • api/spec/packages/aip/src/customers/charges/operations.tsp
  • api/spec/packages/aip/src/customers/credits/operations.tsp
  • api/spec/packages/aip/src/customers/operations.tsp
  • api/spec/packages/aip/src/defaults/operations.tsp
  • api/spec/packages/aip/src/entitlements/operations.tsp
  • api/spec/packages/aip/src/features/operations.tsp
  • api/spec/packages/aip/src/governance/operations.tsp
  • api/spec/packages/aip/src/llmcost/operations.tsp
  • api/spec/packages/aip/src/meters/operations.tsp
  • api/spec/packages/aip/src/productcatalog/operations.tsp
  • api/spec/packages/aip/src/subscriptions/operations.tsp
  • api/spec/packages/aip/src/tax/operations.tsp
  • api/spec/packages/legacy/package.json
✅ Files skipped from review due to trivial changes (11)
  • api/spec/packages/aip/src/currencies/cost-bases/operations.tsp
  • api/spec/packages/aip/src/entitlements/operations.tsp
  • api/spec/packages/aip/src/governance/operations.tsp
  • api/spec/packages/aip/src/defaults/operations.tsp
  • api/spec/packages/aip/src/features/operations.tsp
  • api/spec/packages/aip/src/tax/operations.tsp
  • api/spec/packages/aip/src/billing/operations.tsp
  • api/spec/packages/aip/src/llmcost/operations.tsp
  • api/spec/packages/aip/src/apps/operations.tsp
  • api/spec/packages/aip/src/subscriptions/operations.tsp
  • api/spec/packages/aip/src/productcatalog/operations.tsp
🚧 Files skipped from review as they are similar to previous changes (4)
  • api/spec/packages/aip/src/customers/charges/operations.tsp
  • api/spec/packages/aip/package.json
  • api/spec/packages/aip/src/meters/operations.tsp
  • api/spec/packages/aip/src/customers/credits/operations.tsp

Comment thread api/spec/packages/legacy/package.json
@tothandras
tothandras enabled auto-merge (squash) June 5, 2026 15:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
api/spec/Makefile (1)

40-40: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a portable timestamp command on Line 40

date --rfc-3339=seconds is GNU-specific and can fail on macOS/BSD shells, which breaks make publish-aip-sdk before publish runs.

Suggested fix
-		CACHE_BUSTER="$$(date --rfc-3339=seconds)" pnpm publish --no-git-checks --access public --tag "$${AIP_SDK_RELEASE_TAG}"
+		CACHE_BUSTER="$$(date -u +"%Y-%m-%dT%H:%M:%SZ")" pnpm publish --no-git-checks --access public --tag "$${AIP_SDK_RELEASE_TAG}"

Based on learnings: "Use the Makefile for all common development tasks (running tests, generating code, linting, building, etc.)".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/Makefile` at line 40, The current CACHE_BUSTER assignment uses the
GNU-only `date --rfc-3339=seconds` which fails on macOS/BSD; update the Makefile
line that sets CACHE_BUSTER (used by the publish-aip-sdk target that runs `pnpm
publish`) to use a portable timestamp command instead, e.g., use
POSIX-compatible `date -u` with a format string (so CACHE_BUSTER is set via
`date -u +...`) or fall back to a short portable generator (Python/Node) so the
`pnpm publish --tag ${AIP_SDK_RELEASE_TAG}` invocation works cross-platform.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@api/spec/Makefile`:
- Line 40: The current CACHE_BUSTER assignment uses the GNU-only `date
--rfc-3339=seconds` which fails on macOS/BSD; update the Makefile line that sets
CACHE_BUSTER (used by the publish-aip-sdk target that runs `pnpm publish`) to
use a portable timestamp command instead, e.g., use POSIX-compatible `date -u`
with a format string (so CACHE_BUSTER is set via `date -u +...`) or fall back to
a short portable generator (Python/Node) so the `pnpm publish --tag
${AIP_SDK_RELEASE_TAG}` invocation works cross-platform.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 896c8349-306b-41dd-a496-fbd68d68b65d

📥 Commits

Reviewing files that changed from the base of the PR and between 61b7d14 and 253d238.

⛔ Files ignored due to path filters (1)
  • api/spec/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • api/spec/Makefile
  • api/spec/package.json
  • api/spec/packages/typespec-typescript/src/readme.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • api/spec/package.json
  • api/spec/packages/typespec-typescript/src/readme.ts

@tothandras
tothandras merged commit 4bc7392 into main Jun 5, 2026
29 of 30 checks passed
@tothandras
tothandras deleted the feat/aip-sdk-typescript branch June 5, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants