From e818e37f0a2bd81e0026b9c202eae95be6996787 Mon Sep 17 00:00:00 2001 From: Coder Date: Thu, 20 Aug 2026 22:16:17 +0700 Subject: [PATCH] chore: regenerate cordis/client service catalogs for openRouterUsage The prior openrouter feature commit added the ctx.openRouterUsage Remote service without a SERVICE_PAGE partition entry or regenerated artifacts, so the committed api-catalog, slot-catalog, and llm-streaming subsystems docs were stale and the catalog byte-for-byte gate failed. Map the service to its documentation page, regenerate all three artifacts, and re-record the bilingual sidecar. --- docs/subsystems/llm-streaming.i18n.yaml | 4 ++-- docs/subsystems/llm-streaming.md | 16 ++++++++++++++++ docs/subsystems/llm-streaming.zh.md | 16 ++++++++++++++++ .../src/client/slot-catalog.ts | 2 ++ .../extensions/tool-cordis/src/api-catalog.ts | 17 +++++++++++++++++ scripts/gen-cordis-catalog.ts | 1 + 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/docs/subsystems/llm-streaming.i18n.yaml b/docs/subsystems/llm-streaming.i18n.yaml index 8f287e2a0f..e46798b513 100644 --- a/docs/subsystems/llm-streaming.i18n.yaml +++ b/docs/subsystems/llm-streaming.i18n.yaml @@ -2,5 +2,5 @@ # side as of the last confirmed-consistent state. Both languages carry equal authority; # after editing either side, bring the other along and re-record with: # pnpm run verify-translation-pairing --write docs/subsystems/llm-streaming.md -llm-streaming.md: 7c0e0865f8dcc0e7722bb2205d0129d9e0ca3086 -llm-streaming.zh.md: 5c31909ee79137c6c5eef101235b43a2419b1339 +llm-streaming.md: 6adaf86016a6bcab757c86d47c10518f41539fe7 +llm-streaming.zh.md: 20349f426b4976904941b4069dfe51e988a8b142 diff --git a/docs/subsystems/llm-streaming.md b/docs/subsystems/llm-streaming.md index 7c0e0865f8..6adaf86016 100644 --- a/docs/subsystems/llm-streaming.md +++ b/docs/subsystems/llm-streaming.md @@ -866,6 +866,22 @@ stream(options: GenerateOptions): AsyncIterable Source: [`packages/llm/llm/src/index.ts:284`](../../packages/llm/llm/src/index.ts) + + +### `ctx.openRouterUsage` — `OpenRouterUsageGateway` + +OpenRouter usage + balance gateway (`ctx.openRouterUsage`). + +```ts cordis-catalog +/** + * The latest known account snapshot. + * @returns a fresh copy of the cached balance. + */ +@Remote('snapshot') snapshot(): OpenRouterBalance +``` + +Source: [`packages/llm/openrouter-usage/src/index.ts:91`](../../packages/llm/openrouter-usage/src/index.ts) + ### `llm/*` events diff --git a/docs/subsystems/llm-streaming.zh.md b/docs/subsystems/llm-streaming.zh.md index 5c31909ee7..20349f426b 100644 --- a/docs/subsystems/llm-streaming.zh.md +++ b/docs/subsystems/llm-streaming.zh.md @@ -872,6 +872,22 @@ stream(options: GenerateOptions): AsyncIterable Source: [`packages/llm/llm/src/index.ts:284`](../../packages/llm/llm/src/index.ts) + + +### `ctx.openRouterUsage` — `OpenRouterUsageGateway` + +OpenRouter usage + balance gateway (`ctx.openRouterUsage`). + +```ts cordis-catalog +/** + * The latest known account snapshot. + * @returns a fresh copy of the cached balance. + */ +@Remote('snapshot') snapshot(): OpenRouterBalance +``` + +Source: [`packages/llm/openrouter-usage/src/index.ts:91`](../../packages/llm/openrouter-usage/src/index.ts) + ### `llm/*` events diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts index dbd3731614..1985a4b3e0 100644 --- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts +++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts @@ -421,6 +421,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ declaredBy: 'an entry in \'conversation\' (client-ui-conversation), so it exists while that entry is mounted', occupants: [ 'client-ui-conversation StatsLine id \'stats\'', + 'client-ui-openrouter-usage CostDock id \'openrouter-cost\'', ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.composer.dock\', () => ctx.slots.register(\n { name: \'conversation.composer.dock\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', @@ -1527,6 +1528,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ slotInject: '', declaredBy: 'an entry in \'sidebar\' (client-ui-sidebar), so it exists while that entry is mounted', occupants: [ + 'client-ui-openrouter-usage BalanceBadge id \'openrouter-balance\'', 'client-ui-cordis CordisPanel id \'cordis-panel\'', ], replaceRisk: 'none', diff --git a/packages/extensions/tool-cordis/src/api-catalog.ts b/packages/extensions/tool-cordis/src/api-catalog.ts index c029511681..7268159dd8 100644 --- a/packages/extensions/tool-cordis/src/api-catalog.ts +++ b/packages/extensions/tool-cordis/src/api-catalog.ts @@ -912,6 +912,19 @@ export const SERVICE_API: readonly ServiceApiEntry[] = [ }, ], }, + { + key: 'openRouterUsage', + summary: 'OpenRouter usage + balance gateway (`ctx.openRouterUsage`).', + description: 'OpenRouter usage + balance gateway (`ctx.openRouterUsage`).', + methods: [ + { + signature: '@Remote(\'snapshot\') snapshot(): OpenRouterBalance', + description: 'The latest known account snapshot.', + parameters: [], + returns: 'a fresh copy of the cached balance.', + }, + ], + }, { key: 'permissionPresets', summary: 'Owns the deployment\'s permission presets and their write path.', @@ -3479,6 +3492,10 @@ export const TYPE_API: readonly TypeApiEntry[] = [ name: 'OneShotSubagentDescriptorData', declaration: 'export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: \'one-shot\';\n readonly label?: string;\n}', }, + { + name: 'OpenRouterBalance', + declaration: 'export interface OpenRouterBalance {\n balanceUsd: number | null;\n label: string | null;\n usageTokens: number | null;\n limitTokens: number | null;\n isFreeTier: boolean | null;\n updatedAt: number | null;\n currency: \'USD\';\n}', + }, { name: 'PermissionSelect', declaration: 'export interface PermissionSelect {\n options: PresetOption[];\n currentValue: string;\n}', diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts index be6d96d23b..494406673c 100644 --- a/scripts/gen-cordis-catalog.ts +++ b/scripts/gen-cordis-catalog.ts @@ -102,6 +102,7 @@ export const SERVICE_PAGE: Record = { tools: 'tools.md', typert: 'typert.md', typertGateway: 'typert.md', + openRouterUsage: 'llm-streaming.md', userQuestions: 'user-questions.md', web: 'web.md', workflowEngine: 'workflow.md',