@code-yeongyu/senpi 2026.9.12-2 → 2026.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +0 -17
  2. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  3. package/dist/core/agent-session-runtime.js +1 -5
  4. package/dist/core/agent-session-runtime.js.map +1 -1
  5. package/dist/core/agent-session.d.ts +9 -13
  6. package/dist/core/agent-session.d.ts.map +1 -1
  7. package/dist/core/agent-session.js +121 -54
  8. package/dist/core/agent-session.js.map +1 -1
  9. package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
  10. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +1 -2
  11. package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
  12. package/dist/core/session-manager.d.ts +0 -2
  13. package/dist/core/session-manager.d.ts.map +1 -1
  14. package/dist/core/session-manager.js +13 -22
  15. package/dist/core/session-manager.js.map +1 -1
  16. package/dist/core/session-write-reservation.d.ts +0 -9
  17. package/dist/core/session-write-reservation.d.ts.map +1 -1
  18. package/dist/core/session-write-reservation.js +0 -33
  19. package/dist/core/session-write-reservation.js.map +1 -1
  20. package/dist/modes/interactive/components/ask-user-async-widget.d.ts +0 -2
  21. package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
  22. package/dist/modes/interactive/components/ask-user-async-widget.js +1 -17
  23. package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
  24. package/dist/modes/interactive/interactive-mode.js +2 -2
  25. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  26. package/dist/modes/rpc/rpc-types.d.ts +1 -2
  27. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  28. package/dist/modes/rpc/rpc-types.js +0 -1
  29. package/dist/modes/rpc/rpc-types.js.map +1 -1
  30. package/dist/modes/rpc/session-registry.d.ts +1 -3
  31. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  32. package/dist/modes/rpc/session-registry.js.map +1 -1
  33. package/dist/modes/rpc/session-worker-client.d.ts +8 -10
  34. package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
  35. package/dist/modes/rpc/session-worker-client.js +23 -14
  36. package/dist/modes/rpc/session-worker-client.js.map +1 -1
  37. package/dist/modes/rpc/session-worker-protocol.d.ts +0 -10
  38. package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
  39. package/dist/modes/rpc/session-worker-protocol.js +0 -2
  40. package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
  41. package/dist/modes/rpc/session-worker.js +16 -12
  42. package/dist/modes/rpc/session-worker.js.map +1 -1
  43. package/dist/modes/rpc/worker-session-registry.d.ts +0 -12
  44. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  45. package/dist/modes/rpc/worker-session-registry.js +24 -51
  46. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  47. package/docs/rpc.md +6 -14
  48. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -12
  49. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  50. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  51. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +0 -11
  52. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
  53. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +0 -18
  54. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
  55. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
  56. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
  57. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +1 -5
  58. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  59. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
  60. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +1 -2
  61. package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
  62. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -1
  63. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  64. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
  65. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  66. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
  67. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +1 -2
  68. package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
  69. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  70. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  71. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  72. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  73. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  74. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  75. package/package.json +7 -7
  76. package/dist/core/cursor-history-admission.d.ts +0 -50
  77. package/dist/core/cursor-history-admission.d.ts.map +0 -1
  78. package/dist/core/cursor-history-admission.js +0 -130
  79. package/dist/core/cursor-history-admission.js.map +0 -1
  80. package/dist/modes/rpc/session-path-reservations.d.ts +0 -30
  81. package/dist/modes/rpc/session-path-reservations.d.ts.map +0 -1
  82. package/dist/modes/rpc/session-path-reservations.js +0 -58
  83. package/dist/modes/rpc/session-path-reservations.js.map +0 -1
  84. package/dist/modes/rpc/session-worker-credit.d.ts +0 -17
  85. package/dist/modes/rpc/session-worker-credit.d.ts.map +0 -1
  86. package/dist/modes/rpc/session-worker-credit.js +0 -39
  87. package/dist/modes/rpc/session-worker-credit.js.map +0 -1
  88. package/dist/modes/rpc/session-worker-signals.d.ts +0 -7
  89. package/dist/modes/rpc/session-worker-signals.d.ts.map +0 -1
  90. package/dist/modes/rpc/session-worker-signals.js +0 -19
  91. package/dist/modes/rpc/session-worker-signals.js.map +0 -1
  92. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +0 -32
  93. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +0 -1
  94. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +0 -62
  95. package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +0 -1
  96. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +0 -12
  97. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +0 -1
  98. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +0 -93
  99. package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"store-migration.d.ts","sourceRoot":"","sources":["../../src/cursor/store-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA0CzC;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,KAAK,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,cAAc,CAAC,EAAE,CAiC3G"}
1
+ {"version":3,"file":"store-migration.d.ts","sourceRoot":"","sources":["../../src/cursor/store-migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAyCzC;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,KAAK,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,cAAc,CAAC,EAAE,CAiC3G"}
@@ -1,5 +1,4 @@
1
1
  import { normalizeCursorCatalog } from "./catalog-grouping.js";
2
- import { resolveCursorContextWindow } from "./context-limit-store.js";
3
2
  import { getCursorVariantAlias } from "./model-capabilities.js";
4
3
  function isGroupedShape(model) {
5
4
  return model.compat?.cursorReasoning !== undefined || getCursorVariantAlias(model.id) === undefined;
@@ -17,7 +16,7 @@ function entryToModel(entry, maxTokensById) {
17
16
  ...(entry.thinkingLevelMap ? { thinkingLevelMap: entry.thinkingLevelMap } : {}),
18
17
  input: entry.input,
19
18
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
20
- contextWindow: resolveCursorContextWindow(entry.id, entry.window),
19
+ contextWindow: entry.window,
21
20
  maxTokens,
22
21
  ...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id
23
22
  ? { upstreamModelId: entry.representativeVariantId }
@@ -1 +1 @@
1
- {"version":3,"file":"store-migration.js","sourceRoot":"","sources":["../../src/cursor/store-migration.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,SAAS,cAAc,CAAC,KAA4B;IACnD,OAAO,KAAK,CAAC,MAAM,EAAE,eAAe,KAAK,SAAS,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;AACrG,CAAC;AAED,SAAS,YAAY,CAAC,KAAyB,EAAE,aAA0C;IAC1F,MAAM,cAAc,GAAG,KAAK,CAAC,uBAAuB,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;IAC3F,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;IAC5F,OAAO;QACN,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,cAAc;QACnB,QAAQ,E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CAAC;QAC9C,MAAM,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,KAAK,CAAC,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,SAAS;QACjC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnB,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/B,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["import type { Model } from \"../types.ts\";\nimport { type CursorCatalogEntry, normalizeCursorCatalog } from \"./catalog-grouping.ts\";\nimport { resolveCursorContextWindow } from \"./context-limit-store.ts\";\nimport { getCursorVariantAlias } from \"./model-capabilities.ts\";\n\nfunction isGroupedShape(model: Model<\"cursor-agent\">): boolean {\n\treturn model.compat?.cursorReasoning !== undefined || getCursorVariantAlias(model.id) === undefined;\n}\n\nfunction entryToModel(entry: CursorCatalogEntry, maxTokensById: ReadonlyMap<string, number>): Model<\"cursor-agent\"> {\n\tconst representative = entry.representativeVariantId ?? entry.legacyAliases[0] ?? entry.id;\n\tconst maxTokens = maxTokensById.get(representative) ?? maxTokensById.get(entry.id) ?? 64000;\n\treturn {\n\t\tid: entry.id,\n\t\tname: entry.name,\n\t\tapi: \"cursor-agent\",\n\t\tprovider: \"cursor\",\n\t\tbaseUrl: \"https://api2.cursor.sh\",\n\t\treasoning: entry.reasoning,\n\t\t...(entry.thinkingLevelMap ? { thinkingLevelMap: entry.thinkingLevelMap } : {}),\n\t\tinput: entry.input,\n\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow: resolveCursorContextWindow(entry.id, entry.window),\n\t\tmaxTokens,\n\t\t...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id\n\t\t\t? { upstreamModelId: entry.representativeVariantId }\n\t\t\t: {}),\n\t\tcompat: {\n\t\t\t...(entry.cursorMaxMode ? { cursorMaxMode: true } : {}),\n\t\t\t...(entry.capabilityId !== undefined && entry.representativeVariantId !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\tcursorReasoning: {\n\t\t\t\t\t\t\tcapabilityId: entry.capabilityId,\n\t\t\t\t\t\t\t...(entry.thinkingMode !== undefined ? { thinkingMode: entry.thinkingMode } : {}),\n\t\t\t\t\t\t\trepresentativeVariantId: entry.representativeVariantId,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t};\n}\n\n/**\n * Idempotent stored-catalog transform: pre-grouping 204-variant cursor entries\n * are regrouped into selectable identities; already-grouped, unknown, and\n * malformed entries pass through unchanged in stable input order.\n */\nexport function regroupStoredCursorModels(models: readonly Model<\"cursor-agent\">[]): Model<\"cursor-agent\">[] {\n\tconst legacy = models.filter((model) => !isGroupedShape(model));\n\tif (legacy.length === 0) return [...models];\n\tconst maxTokensById = new Map(models.map((model) => [model.id, model.maxTokens]));\n\tconst regrouped = new Map(\n\t\tnormalizeCursorCatalog(\n\t\t\tlegacy.map((model) => ({\n\t\t\t\tid: model.id,\n\t\t\t\tname: model.name,\n\t\t\t\tinput: model.input.filter((modality): modality is \"text\" | \"image\" => modality !== \"video\"),\n\t\t\t\tcursorMaxMode: model.compat?.cursorMaxMode === true,\n\t\t\t})),\n\t\t).map((entry) => [entry.id, entryToModel(entry, maxTokensById)] as const),\n\t);\n\tconst seen = new Set<string>();\n\tconst out: Model<\"cursor-agent\">[] = [];\n\tfor (const model of models) {\n\t\tif (isGroupedShape(model)) {\n\t\t\tout.push(model);\n\t\t\tcontinue;\n\t\t}\n\t\tconst alias = getCursorVariantAlias(model.id);\n\t\tconst targetId = alias?.targetId ?? model.id;\n\t\tif (seen.has(targetId)) continue;\n\t\tseen.add(targetId);\n\t\tconst transformed = regrouped.get(targetId);\n\t\tif (transformed !== undefined) {\n\t\t\tout.push(transformed);\n\t\t} else {\n\t\t\tout.push(model);\n\t\t}\n\t}\n\treturn out;\n}\n"]}
1
+ {"version":3,"file":"store-migration.js","sourceRoot":"","sources":["../../src/cursor/store-migration.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,SAAS,cAAc,CAAC,KAA4B;IACnD,OAAO,KAAK,CAAC,MAAM,EAAE,eAAe,KAAK,SAAS,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;AACrG,CAAC;AAED,SAAS,YAAY,CAAC,KAAyB,EAAE,aAA0C;IAC1F,MAAM,cAAc,GAAG,KAAK,CAAC,uBAAuB,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;IAC3F,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;IAC5F,OAAO;QACN,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,wBAAwB;QACjC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAA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QACvB,CAAC;aAAM,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC","sourcesContent":["import type { Model } from \"../types.ts\";\nimport { type CursorCatalogEntry, normalizeCursorCatalog } from \"./catalog-grouping.ts\";\nimport { getCursorVariantAlias } from \"./model-capabilities.ts\";\n\nfunction isGroupedShape(model: Model<\"cursor-agent\">): boolean {\n\treturn model.compat?.cursorReasoning !== undefined || getCursorVariantAlias(model.id) === undefined;\n}\n\nfunction entryToModel(entry: CursorCatalogEntry, maxTokensById: ReadonlyMap<string, number>): Model<\"cursor-agent\"> {\n\tconst representative = entry.representativeVariantId ?? entry.legacyAliases[0] ?? entry.id;\n\tconst maxTokens = maxTokensById.get(representative) ?? maxTokensById.get(entry.id) ?? 64000;\n\treturn {\n\t\tid: entry.id,\n\t\tname: entry.name,\n\t\tapi: \"cursor-agent\",\n\t\tprovider: \"cursor\",\n\t\tbaseUrl: \"https://api2.cursor.sh\",\n\t\treasoning: entry.reasoning,\n\t\t...(entry.thinkingLevelMap ? { thinkingLevelMap: entry.thinkingLevelMap } : {}),\n\t\tinput: entry.input,\n\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow: entry.window,\n\t\tmaxTokens,\n\t\t...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id\n\t\t\t? { upstreamModelId: entry.representativeVariantId }\n\t\t\t: {}),\n\t\tcompat: {\n\t\t\t...(entry.cursorMaxMode ? { cursorMaxMode: true } : {}),\n\t\t\t...(entry.capabilityId !== undefined && entry.representativeVariantId !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\tcursorReasoning: {\n\t\t\t\t\t\t\tcapabilityId: entry.capabilityId,\n\t\t\t\t\t\t\t...(entry.thinkingMode !== undefined ? { thinkingMode: entry.thinkingMode } : {}),\n\t\t\t\t\t\t\trepresentativeVariantId: entry.representativeVariantId,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t};\n}\n\n/**\n * Idempotent stored-catalog transform: pre-grouping 204-variant cursor entries\n * are regrouped into selectable identities; already-grouped, unknown, and\n * malformed entries pass through unchanged in stable input order.\n */\nexport function regroupStoredCursorModels(models: readonly Model<\"cursor-agent\">[]): Model<\"cursor-agent\">[] {\n\tconst legacy = models.filter((model) => !isGroupedShape(model));\n\tif (legacy.length === 0) return [...models];\n\tconst maxTokensById = new Map(models.map((model) => [model.id, model.maxTokens]));\n\tconst regrouped = new Map(\n\t\tnormalizeCursorCatalog(\n\t\t\tlegacy.map((model) => ({\n\t\t\t\tid: model.id,\n\t\t\t\tname: model.name,\n\t\t\t\tinput: model.input.filter((modality): modality is \"text\" | \"image\" => modality !== \"video\"),\n\t\t\t\tcursorMaxMode: model.compat?.cursorMaxMode === true,\n\t\t\t})),\n\t\t).map((entry) => [entry.id, entryToModel(entry, maxTokensById)] as const),\n\t);\n\tconst seen = new Set<string>();\n\tconst out: Model<\"cursor-agent\">[] = [];\n\tfor (const model of models) {\n\t\tif (isGroupedShape(model)) {\n\t\t\tout.push(model);\n\t\t\tcontinue;\n\t\t}\n\t\tconst alias = getCursorVariantAlias(model.id);\n\t\tconst targetId = alias?.targetId ?? model.id;\n\t\tif (seen.has(targetId)) continue;\n\t\tseen.add(targetId);\n\t\tconst transformed = regrouped.get(targetId);\n\t\tif (transformed !== undefined) {\n\t\t\tout.push(transformed);\n\t\t} else {\n\t\t\tout.push(model);\n\t\t}\n\t}\n\treturn out;\n}\n"]}
@@ -4,7 +4,7 @@ export type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from
4
4
  export { sanitizeAnthropicToolPairs } from "./api/anthropic-tool-pairs.ts";
5
5
  export type { AzureOpenAIResponsesOptions } from "./api/azure-openai-responses.ts";
6
6
  export type { BedrockOptions, BedrockThinkingDisplay } from "./api/bedrock-converse-stream.ts";
7
- export { measureCursorHistorySerializedBytes, measureCursorModelInputSerializedBytes, } from "./api/cursor-agent/measure.ts";
7
+ export { measureCursorHistorySerializedBytes } from "./api/cursor-agent/measure.ts";
8
8
  export { composeShellCommand as composeCursorShellCommand, omitUndefinedArgs as omitUndefinedCursorArgs, piLimit as cursorPiLimit, piLsPath as cursorPiLsPath, piReadArgs as cursorPiReadArgs, piTimeout as cursorPiTimeout, } from "./api/cursor-agent/pi-args.ts";
9
9
  export type { CursorAgentOptions, CursorExecHandlerResult, CursorExecHandlers, CursorExecPairing, CursorMcpCall, CursorPiCall, CursorShellStreamCallbacks, CursorToolResultHandler, } from "./api/cursor-agent/types.ts";
10
10
  export type { GoogleOptions } from "./api/google-generative-ai.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAM/B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/G,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EACN,mCAAmC,EACnC,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACX,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,YAAY,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AM,iBAAiB,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { Type } from "typebox";
2
2
  export { sanitizeAnthropicToolPairs } from "./api/anthropic-tool-pairs.js";
3
- export { measureCursorHistorySerializedBytes, measureCursorModelInputSerializedBytes, } from "./api/cursor-agent/measure.js";
3
+ export { measureCursorHistorySerializedBytes } from "./api/cursor-agent/measure.js";
4
4
  export { composeShellCommand as composeCursorShellCommand, omitUndefinedArgs as omitUndefinedCursorArgs, piLimit as cursorPiLimit, piLsPath as cursorPiLsPath, piReadArgs as cursorPiReadArgs, piTimeout as cursorPiTimeout, } from "./api/cursor-agent/pi-args.js";
5
5
  export * from "./api/lazy.js";
6
6
  export { convertResponsesMessages } from "./api/openai-responses-shared.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,EACN,mCAAmC,EACnC,sCAAsC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AAcvC,cAAc,eAAe,CAAC;AAK9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAIN,eAAe,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc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A4B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@earendil-works/pi-ai/providers/*\", API implementations under\n// \"@earendil-works/pi-ai/api/*\", the old global API under\n// \"@earendil-works/pi-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport { sanitizeAnthropicToolPairs } from \"./api/anthropic-tool-pairs.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport {\n\tmeasureCursorHistorySerializedBytes,\n\tmeasureCursorModelInputSerializedBytes,\n} from \"./api/cursor-agent/measure.ts\";\nexport {\n\tcomposeShellCommand as composeCursorShellCommand,\n\tomitUndefinedArgs as omitUndefinedCursorArgs,\n\tpiLimit as cursorPiLimit,\n\tpiLsPath as cursorPiLsPath,\n\tpiReadArgs as cursorPiReadArgs,\n\tpiTimeout as cursorPiTimeout,\n} from \"./api/cursor-agent/pi-args.ts\";\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./api/cursor-agent/types.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleApiThinkingLevel, ResolvedGoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport { convertResponsesMessages } from \"./api/openai-responses-shared.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport {\n\ttype WarmPromptCacheOptions,\n\ttype WarmPromptCacheResult,\n\ttype WarmPromptCacheUsage,\n\twarmPromptCache,\n} from \"./api/warm-prompt-cache.ts\";\nexport { getApiProvider } from \"./api-registry.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/headers.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderId,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport {\n\tCONTEXT_PROVENANCE_FIELD,\n\ttype ContextProvenance,\n\tcontextProvenanceFingerprint,\n\tcopyContextProvenance,\n\tgetContextProvenance,\n} from \"./context-provenance.ts\";\nexport * from \"./cursor/catalog-grouping.ts\";\nexport {\n\tCURSOR_MODEL_CAPABILITIES,\n\ttype CursorCapabilityEvidence,\n\ttype CursorLevelEncoding,\n\ttype CursorLevelSpec,\n\ttype CursorModelCapability,\n\ttype CursorParameterId,\n\ttype CursorVariantAlias,\n\ttype CursorVariantParse,\n\tgetCursorBaseIdForVariant,\n\tgetCursorCapabilityForBase,\n\tgetCursorVariantAlias,\n} from \"./cursor/model-capabilities.ts\";\nexport {\n\ttype CursorResolvedSelection,\n\trenderCursorCliModelString,\n\tresolveCursorSelectionDescriptor,\n} from \"./cursor/selection-descriptor.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\thasKimiTextToolCallRecovery,\n\tshouldRecoverTextToolCalls,\n\ttransformContext,\n\twrapStreamWithModelRecovery,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nexport { createXtmlRecoveryStreamParser } from \"./tool-call-middleware/protocols/kimi-xtml/recovery-stream.ts\";\nexport { wrapStreamWithInvokeRecovery } from \"./tool-call-middleware/recovery-stream-wrapper.ts\";\nexport * from \"./types.ts\";\nexport {\n\ttype CursorExecResolvedCarrier,\n\tcopyCursorExecResolved,\n\tisCursorExecResolved,\n\tkCursorExecResolved,\n} from \"./utils/block-symbols.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport { dropFailedAssistantTurns } from \"./utils/drop-failed-assistant-turns.ts\";\nexport { estimateContextTokens } from \"./utils/estimate.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport { extractOpenAiCodexAccountId } from \"./utils/openai-codex-auth.ts\";\nexport * from \"./utils/overflow.ts\";\nexport {\n\tisAnthropicApiBaseUrl,\n\tPROMPT_CACHE_TTL_LONG_SECONDS,\n\tPROMPT_CACHE_TTL_SHORT_SECONDS,\n\tresolvePromptCacheTtlSeconds,\n} from \"./utils/prompt-cache-ttl.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/server-fallback-receipt.ts\";\nexport * from \"./utils/stop-details.ts\";\nexport { contentText } from \"./utils/text.ts\";\nexport * from \"./utils/tool-pair-repair.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport { uuidv7 } from \"./utils/uuid.ts\";\nexport * from \"./utils/validation.ts\";\nexport * from \"./utils/visible-text.ts\";\nexport { getWireIdentity, setWireIdentity } from \"./wire-identity.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAG3E,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EACN,mBAAmB,IAAI,yBAAyB,EAChD,iBAAiB,IAAI,uBAAuB,EAC5C,OAAO,IAAI,aAAa,EACxB,QAAQ,IAAI,cAAc,EAC1B,UAAU,IAAI,gBAAgB,EAC9B,SAAS,IAAI,eAAe,GAC5B,MAAM,+BAA+B,CAAC;AAcvC,cAAc,eAAe,CAAC;AAK9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAIN,eAAe,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAUhC,OAAO,EACN,wBAAwB,EAExB,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EACN,yBAAyB,EAQzB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEN,0BAA0B,EAC1B,gCAAgC,GAChC,MAAM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BAAoB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@earendil-works/pi-ai/providers/*\", API implementations under\n// \"@earendil-works/pi-ai/api/*\", the old global API under\n// \"@earendil-works/pi-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport { sanitizeAnthropicToolPairs } from \"./api/anthropic-tool-pairs.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport { measureCursorHistorySerializedBytes } from \"./api/cursor-agent/measure.ts\";\nexport {\n\tcomposeShellCommand as composeCursorShellCommand,\n\tomitUndefinedArgs as omitUndefinedCursorArgs,\n\tpiLimit as cursorPiLimit,\n\tpiLsPath as cursorPiLsPath,\n\tpiReadArgs as cursorPiReadArgs,\n\tpiTimeout as cursorPiTimeout,\n} from \"./api/cursor-agent/pi-args.ts\";\nexport type {\n\tCursorAgentOptions,\n\tCursorExecHandlerResult,\n\tCursorExecHandlers,\n\tCursorExecPairing,\n\tCursorMcpCall,\n\tCursorPiCall,\n\tCursorShellStreamCallbacks,\n\tCursorToolResultHandler,\n} from \"./api/cursor-agent/types.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleApiThinkingLevel, ResolvedGoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport { convertResponsesMessages } from \"./api/openai-responses-shared.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport {\n\ttype WarmPromptCacheOptions,\n\ttype WarmPromptCacheResult,\n\ttype WarmPromptCacheUsage,\n\twarmPromptCache,\n} from \"./api/warm-prompt-cache.ts\";\nexport { getApiProvider } from \"./api-registry.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/headers.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderId,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport {\n\tCONTEXT_PROVENANCE_FIELD,\n\ttype ContextProvenance,\n\tcontextProvenanceFingerprint,\n\tcopyContextProvenance,\n\tgetContextProvenance,\n} from \"./context-provenance.ts\";\nexport * from \"./cursor/catalog-grouping.ts\";\nexport {\n\tCURSOR_MODEL_CAPABILITIES,\n\ttype CursorCapabilityEvidence,\n\ttype CursorLevelEncoding,\n\ttype CursorLevelSpec,\n\ttype CursorModelCapability,\n\ttype CursorParameterId,\n\ttype CursorVariantAlias,\n\ttype CursorVariantParse,\n\tgetCursorBaseIdForVariant,\n\tgetCursorCapabilityForBase,\n\tgetCursorVariantAlias,\n} from \"./cursor/model-capabilities.ts\";\nexport {\n\ttype CursorResolvedSelection,\n\trenderCursorCliModelString,\n\tresolveCursorSelectionDescriptor,\n} from \"./cursor/selection-descriptor.ts\";\nexport * from \"./env-api-keys.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport {\n\tgetProtocol,\n\tgetToolCallFormat,\n\thasKimiTextToolCallRecovery,\n\tshouldRecoverTextToolCalls,\n\ttransformContext,\n\twrapStreamWithModelRecovery,\n\twrapStreamWithToolCallMiddleware,\n} from \"./tool-call-middleware/index.ts\";\nexport { createXtmlRecoveryStreamParser } from \"./tool-call-middleware/protocols/kimi-xtml/recovery-stream.ts\";\nexport { wrapStreamWithInvokeRecovery } from \"./tool-call-middleware/recovery-stream-wrapper.ts\";\nexport * from \"./types.ts\";\nexport {\n\ttype CursorExecResolvedCarrier,\n\tcopyCursorExecResolved,\n\tisCursorExecResolved,\n\tkCursorExecResolved,\n} from \"./utils/block-symbols.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport { dropFailedAssistantTurns } from \"./utils/drop-failed-assistant-turns.ts\";\nexport { estimateContextTokens } from \"./utils/estimate.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport { extractOpenAiCodexAccountId } from \"./utils/openai-codex-auth.ts\";\nexport * from \"./utils/overflow.ts\";\nexport {\n\tisAnthropicApiBaseUrl,\n\tPROMPT_CACHE_TTL_LONG_SECONDS,\n\tPROMPT_CACHE_TTL_SHORT_SECONDS,\n\tresolvePromptCacheTtlSeconds,\n} from \"./utils/prompt-cache-ttl.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/server-fallback-receipt.ts\";\nexport * from \"./utils/stop-details.ts\";\nexport { contentText } from \"./utils/text.ts\";\nexport * from \"./utils/tool-pair-repair.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport { uuidv7 } from \"./utils/uuid.ts\";\nexport * from \"./utils/validation.ts\";\nexport * from \"./utils/visible-text.ts\";\nexport { getWireIdentity, setWireIdentity } from \"./wire-identity.ts\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/providers/cursor.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,QAAQ,EAA6B,MAAM,cAAc,CAAC;AAiExF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,CAkBzD"}
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/providers/cursor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,QAAQ,EAA6B,MAAM,cAAc,CAAC;AAiExF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,CAkBzD"}
@@ -2,7 +2,6 @@ import { cursorAgentApi, loadCursorAgentModule } from "../api/cursor-agent.lazy.
2
2
  import { lazyOAuth } from "../auth/helpers.js";
3
3
  import { loadCursorOAuth } from "../auth/oauth/load.js";
4
4
  import { normalizeCursorCatalog } from "../cursor/catalog-grouping.js";
5
- import { resolveCursorContextWindow } from "../cursor/context-limit-store.js";
6
5
  import { regroupStoredCursorModels } from "../cursor/store-migration.js";
7
6
  import { createProvider } from "../models.js";
8
7
  const CURSOR_BASE_URL = "https://api2.cursor.sh";
@@ -44,7 +43,7 @@ async function fetchCursorModels(context) {
44
43
  input: entry.input,
45
44
  // Subscription-billed: Cursor reports no per-token pricing here.
46
45
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
47
- contextWindow: resolveCursorContextWindow(entry.id, entry.window),
46
+ contextWindow: entry.window,
48
47
  maxTokens,
49
48
  ...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id
50
49
  ? { upstreamModelId: entry.representativeVariantId }
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/providers/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,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AI,KAAK,CAAC,uBAAuB,KAAK,SAAS;oBAClF,CAAC,CAAC;wBACA,eAAe,EAAE;4BAChB,YAAY,EAAE,KAAK,CAAC,YAAY;4BAChC,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;4BACjF,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;yBACtD;qBACD;oBACF,CAAC,CAAC,EAAE,CAAC;aACN;SACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc;IAC7B,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,CAAC;QAC5D,IAAI,EAAE;YACL,KAAK,EAAE,SAAS,CAAC;gBAChB,IAAI,EAAE,0BAA0B;gBAChC,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,qBAAqB;gBACjC,IAAI,EAAE,eAAe;aACrB,CAAC;SACF;QACD,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,iBAAiB;QAC9B,GAAG,EAAE,cAAc,EAAE;KACrB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { cursorAgentApi, loadCursorAgentModule } from \"../api/cursor-agent.lazy.ts\";\nimport { lazyOAuth } from \"../auth/helpers.ts\";\nimport { loadCursorOAuth } from \"../auth/oauth/load.ts\";\nimport { normalizeCursorCatalog } from \"../cursor/catalog-grouping.ts\";\nimport { resolveCursorContextWindow } from \"../cursor/context-limit-store.ts\";\nimport { regroupStoredCursorModels } from \"../cursor/store-migration.ts\";\nimport { createProvider, type Provider, type RefreshModelsContext } from \"../models.ts\";\nimport type { Model } from \"../types.ts\";\n\nconst CURSOR_BASE_URL = \"https://api2.cursor.sh\";\n\n/**\n * Cursor's catalog is fully dynamic: `GetUsableModels` requires an\n * authenticated access token and reports the account's usable models, so the\n * provider ships no static baseline. The discovery call lives in the\n * Node-only `cursor-agent` API module, loaded through the bundler-opaque\n * lazy boundary so the provider factory stays browser-safe.\n */\nasync function fetchCursorModels(context: RefreshModelsContext): Promise<Model<\"cursor-agent\">[]> {\n\tconst credential = context.credential;\n\tconst accessToken = credential?.type === \"oauth\" ? credential.access : credential?.key;\n\tif (!accessToken) return [];\n\tconst { fetchCursorUsableModels } = await loadCursorAgentModule();\n\tconst discovered = await fetchCursorUsableModels({ apiKey: accessToken, signal: context.signal });\n\tif (discovered === null) {\n\t\tthrow new Error(\"Could not load Cursor model catalog from GetUsableModels\");\n\t}\n\tconst normalized = normalizeCursorCatalog(\n\t\tdiscovered.map((model) => ({\n\t\t\tid: model.id,\n\t\t\tname: model.name,\n\t\t\tinput: model.input,\n\t\t\tcursorMaxMode: model.cursorMaxMode,\n\t\t})),\n\t);\n\tconst maxTokensByVariant = new Map(discovered.map((model) => [model.id, model.maxTokens]));\n\treturn normalized.map((entry): Model<\"cursor-agent\"> => {\n\t\tconst representative = entry.representativeVariantId ?? entry.legacyAliases[0] ?? entry.id;\n\t\tconst maxTokens = maxTokensByVariant.get(representative) ?? maxTokensByVariant.get(entry.id) ?? 64000;\n\t\treturn {\n\t\t\tid: entry.id,\n\t\t\tname: entry.name,\n\t\t\tapi: \"cursor-agent\",\n\t\t\tprovider: \"cursor\",\n\t\t\tbaseUrl: CURSOR_BASE_URL,\n\t\t\treasoning: entry.reasoning,\n\t\t\t...(entry.thinkingLevelMap ? { thinkingLevelMap: entry.thinkingLevelMap } : {}),\n\t\t\tinput: entry.input,\n\t\t\t// Subscription-billed: Cursor reports no per-token pricing here.\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\t\tcontextWindow: resolveCursorContextWindow(entry.id, entry.window),\n\t\t\tmaxTokens,\n\t\t\t...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id\n\t\t\t\t? { upstreamModelId: entry.representativeVariantId }\n\t\t\t\t: {}),\n\t\t\tcompat: {\n\t\t\t\t...(entry.cursorMaxMode ? { cursorMaxMode: true } : {}),\n\t\t\t\t...(entry.capabilityId !== undefined && entry.representativeVariantId !== undefined\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcursorReasoning: {\n\t\t\t\t\t\t\t\tcapabilityId: entry.capabilityId,\n\t\t\t\t\t\t\t\t...(entry.thinkingMode !== undefined ? { thinkingMode: entry.thinkingMode } : {}),\n\t\t\t\t\t\t\t\trepresentativeVariantId: entry.representativeVariantId,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t};\n\t});\n}\n\n/**\n * Cursor subscription provider (OAuth only).\n *\n * Chat runs on Cursor's protobuf Connect-RPC agent protocol\n * (`agent.v1.AgentService/Run` on `api2.cursor.sh`), implemented by the\n * `cursor-agent` API. The model catalog is discovered per account through\n * `GetUsableModels` after login (`Models.refresh` runs automatically after a\n * successful `/login cursor`).\n */\nexport function cursorProvider(): Provider<\"cursor-agent\"> {\n\treturn createProvider({\n\t\tid: \"cursor\",\n\t\tname: \"Cursor\",\n\t\tbaseUrl: CURSOR_BASE_URL,\n\t\trestoreModels: (models) => regroupStoredCursorModels(models),\n\t\tauth: {\n\t\t\toauth: lazyOAuth({\n\t\t\t\tname: \"Cursor (Pro/Ultra/Teams)\",\n\t\t\t\tisSubscription: true,\n\t\t\t\tloginLabel: \"Sign in with Cursor\",\n\t\t\t\tload: loadCursorOAuth,\n\t\t\t}),\n\t\t},\n\t\tmodels: [],\n\t\tfetchModels: fetchCursorModels,\n\t\tapi: cursorAgentApi(),\n\t});\n}\n"]}
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/providers/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,6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CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvD,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,KAAK,CAAC,uBAAuB,KAAK,SAAS;oBAClF,CAAC,CAAC;wBACA,eAAe,EAAE;4BAChB,YAAY,EAAE,KAAK,CAAC,YAAY;4BAChC,GAAG,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;4BACjF,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;yBACtD;qBACD;oBACF,CAAC,CAAC,EAAE,CAAC;aACN;SACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc;IAC7B,OAAO,cAAc,CAAC;QACrB,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,CAAC;QAC5D,IAAI,EAAE;YACL,KAAK,EAAE,SAAS,CAAC;gBAChB,IAAI,EAAE,0BAA0B;gBAChC,cAAc,EAAE,IAAI;gBACpB,UAAU,EAAE,qBAAqB;gBACjC,IAAI,EAAE,eAAe;aACrB,CAAC;SACF;QACD,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,iBAAiB;QAC9B,GAAG,EAAE,cAAc,EAAE;KACrB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { cursorAgentApi, loadCursorAgentModule } from \"../api/cursor-agent.lazy.ts\";\nimport { lazyOAuth } from \"../auth/helpers.ts\";\nimport { loadCursorOAuth } from \"../auth/oauth/load.ts\";\nimport { normalizeCursorCatalog } from \"../cursor/catalog-grouping.ts\";\nimport { regroupStoredCursorModels } from \"../cursor/store-migration.ts\";\nimport { createProvider, type Provider, type RefreshModelsContext } from \"../models.ts\";\nimport type { Model } from \"../types.ts\";\n\nconst CURSOR_BASE_URL = \"https://api2.cursor.sh\";\n\n/**\n * Cursor's catalog is fully dynamic: `GetUsableModels` requires an\n * authenticated access token and reports the account's usable models, so the\n * provider ships no static baseline. The discovery call lives in the\n * Node-only `cursor-agent` API module, loaded through the bundler-opaque\n * lazy boundary so the provider factory stays browser-safe.\n */\nasync function fetchCursorModels(context: RefreshModelsContext): Promise<Model<\"cursor-agent\">[]> {\n\tconst credential = context.credential;\n\tconst accessToken = credential?.type === \"oauth\" ? credential.access : credential?.key;\n\tif (!accessToken) return [];\n\tconst { fetchCursorUsableModels } = await loadCursorAgentModule();\n\tconst discovered = await fetchCursorUsableModels({ apiKey: accessToken, signal: context.signal });\n\tif (discovered === null) {\n\t\tthrow new Error(\"Could not load Cursor model catalog from GetUsableModels\");\n\t}\n\tconst normalized = normalizeCursorCatalog(\n\t\tdiscovered.map((model) => ({\n\t\t\tid: model.id,\n\t\t\tname: model.name,\n\t\t\tinput: model.input,\n\t\t\tcursorMaxMode: model.cursorMaxMode,\n\t\t})),\n\t);\n\tconst maxTokensByVariant = new Map(discovered.map((model) => [model.id, model.maxTokens]));\n\treturn normalized.map((entry): Model<\"cursor-agent\"> => {\n\t\tconst representative = entry.representativeVariantId ?? entry.legacyAliases[0] ?? entry.id;\n\t\tconst maxTokens = maxTokensByVariant.get(representative) ?? maxTokensByVariant.get(entry.id) ?? 64000;\n\t\treturn {\n\t\t\tid: entry.id,\n\t\t\tname: entry.name,\n\t\t\tapi: \"cursor-agent\",\n\t\t\tprovider: \"cursor\",\n\t\t\tbaseUrl: CURSOR_BASE_URL,\n\t\t\treasoning: entry.reasoning,\n\t\t\t...(entry.thinkingLevelMap ? { thinkingLevelMap: entry.thinkingLevelMap } : {}),\n\t\t\tinput: entry.input,\n\t\t\t// Subscription-billed: Cursor reports no per-token pricing here.\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\t\tcontextWindow: entry.window,\n\t\t\tmaxTokens,\n\t\t\t...(entry.representativeVariantId !== undefined && entry.representativeVariantId !== entry.id\n\t\t\t\t? { upstreamModelId: entry.representativeVariantId }\n\t\t\t\t: {}),\n\t\t\tcompat: {\n\t\t\t\t...(entry.cursorMaxMode ? { cursorMaxMode: true } : {}),\n\t\t\t\t...(entry.capabilityId !== undefined && entry.representativeVariantId !== undefined\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcursorReasoning: {\n\t\t\t\t\t\t\t\tcapabilityId: entry.capabilityId,\n\t\t\t\t\t\t\t\t...(entry.thinkingMode !== undefined ? { thinkingMode: entry.thinkingMode } : {}),\n\t\t\t\t\t\t\t\trepresentativeVariantId: entry.representativeVariantId,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t};\n\t});\n}\n\n/**\n * Cursor subscription provider (OAuth only).\n *\n * Chat runs on Cursor's protobuf Connect-RPC agent protocol\n * (`agent.v1.AgentService/Run` on `api2.cursor.sh`), implemented by the\n * `cursor-agent` API. The model catalog is discovered per account through\n * `GetUsableModels` after login (`Models.refresh` runs automatically after a\n * successful `/login cursor`).\n */\nexport function cursorProvider(): Provider<\"cursor-agent\"> {\n\treturn createProvider({\n\t\tid: \"cursor\",\n\t\tname: \"Cursor\",\n\t\tbaseUrl: CURSOR_BASE_URL,\n\t\trestoreModels: (models) => regroupStoredCursorModels(models),\n\t\tauth: {\n\t\t\toauth: lazyOAuth({\n\t\t\t\tname: \"Cursor (Pro/Ultra/Teams)\",\n\t\t\t\tisSubscription: true,\n\t\t\t\tloginLabel: \"Sign in with Cursor\",\n\t\t\t\tload: loadCursorOAuth,\n\t\t\t}),\n\t\t},\n\t\tmodels: [],\n\t\tfetchModels: fetchCursorModels,\n\t\tapi: cursorAgentApi(),\n\t});\n}\n"]}
@@ -1 +1 @@
1
- {"schemaVersion":3,"generatedAt":"2026-09-12T06:20:51.564Z","structureHash":"b923e6312c0aab42f23e34d0ea52f496652de19fd408d6b6573803c48382fc37","files":{"alibaba-token-plan.json":"9f9e8f88b1faa2e4134a0d8bcda600531d4d044d64b7ec3d2373f1db46dcf452","amazon-bedrock.json":"24a7b48f0b60c7aeaa9286049cb06aecbd603a41aa373b1ea5b4d484a3bff97f","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e9d883ee35d94dba963320b5496bd7dd368d226cbafcf134bfec66a0a24b3b7f","azure-openai-responses.json":"eebbe078feec3565c7457c6b6c065d3d8931b20b168ea4ffb31a33e93066e9ee","baseten.json":"c7cf9a7e7e6bee9c53005acf4706c25f954adaa64a9058535fb7e5b1d6920852","cerebras.json":"9eaa554e1b02f3665f8f63e6432d253bf81351af7c72001054dd8108aa528a52","cloudflare-ai-gateway.json":"244d98311e81b5f33fa736688d135b29add6a8acee466aa3a5988ac5b022d1eb","cloudflare-workers-ai.json":"07ef63208ff7517fd1a80962f18143e21de399640423329490b157f459ccf995","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"eb986d5c6649ded170df730c579b08861b6c510347ed7479d6966722bda41527","github-copilot.json":"26cd0af57e17caf7fbd9c0b34da4653e2e29f1ba5a00c1ff996d2549f8b74c05","google-vertex.json":"e1631109172dc1f7d7977570420a5bb86258bdd1088427e244a2c51545c4f24d","google.json":"7619bf03edd2a7acb06a2274a14b13c3a61354288abe029a758401d4de36a8fd","groq.json":"e4728fd72e358cd8f25e9a518e9b49a521ef44523d3debe38a7db9e0663c4077","huggingface.json":"a488b6f175b382277ccf7d487f877ef0c698994576bb55d2410838bf9c8c7c41","kimi-coding.json":"88150f8970f83e17968b02f3b33fac803b96ebf1474e76437689b7d0f1b69363","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"c4e1801b5dfd61bebcaa33cbfc5ed0c69df14a3bee37da218a558668d817864e","moonshotai.json":"3dab637e7e2648792c786157f85f29026b93393f7098b77593c1180928d371c9","nvidia.json":"a942cfffa6fc764d603503f7ce2abf4d2bdd1d541b98a65aa6ff53bfe2df4efd","openai-codex.json":"b8f275f5b501456000f6445398faac2189292378b837beeddcdbe1c42a319d22","openai.json":"203a1d6bf61178268edf3d3f0ad4a6408eded401c4472bda4ac0ec73142f38ce","opencode-go.json":"f97adb96bf613ee102585c6c4cd0a8cc8047d51c8cfe4cf2f98673afce09ee3d","opencode.json":"52b40ba8ab7435c9029bf59f38558f41528462990a6a7d7ba3f00aa10481da09","opengateway.json":"7a4c98061b7b84c476ba70d6f597019ef53c02c0135b9d8a7507e2c30905c07d","openrouter.json":"5889088cd8c2c06b5d08aae122c615b6285a601ffd0239c0ab981e99491b8b06","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"5649fd4075ada766ec65a7a162cd65f096a7ecc29960ace04b2e6a6a4a995a41","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"6010980c9b0af72c60965ae325dbdb21e67c91844a7f7f6f7d71d363f1325f56","venice.json":"ece2872660f480c3580de21be569681e13c752ded8c346ec9feb8c32ddf61a96","vercel-ai-gateway.json":"70381264ccd02d5ac7444205cd703be832726a67c8e7c3a8a9a789385ab50120","xai.json":"9973aae022723732b8a7ea12107e6fb8b3f1d0e087ec6bbc2ee18f0820595e19","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"d3c969020a7ab978497837a3301c7bca364d704082832221cfe61e6596333e56","zai.json":"f42790c77fb4681a656897a9d860b939916c0ddf979a5f16856bce9573cdf64e"}}
1
+ {"schemaVersion":3,"generatedAt":"2026-09-12T04:33:43.838Z","structureHash":"b923e6312c0aab42f23e34d0ea52f496652de19fd408d6b6573803c48382fc37","files":{"alibaba-token-plan.json":"9f9e8f88b1faa2e4134a0d8bcda600531d4d044d64b7ec3d2373f1db46dcf452","amazon-bedrock.json":"24a7b48f0b60c7aeaa9286049cb06aecbd603a41aa373b1ea5b4d484a3bff97f","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"e9d883ee35d94dba963320b5496bd7dd368d226cbafcf134bfec66a0a24b3b7f","azure-openai-responses.json":"eebbe078feec3565c7457c6b6c065d3d8931b20b168ea4ffb31a33e93066e9ee","baseten.json":"c7cf9a7e7e6bee9c53005acf4706c25f954adaa64a9058535fb7e5b1d6920852","cerebras.json":"9eaa554e1b02f3665f8f63e6432d253bf81351af7c72001054dd8108aa528a52","cloudflare-ai-gateway.json":"244d98311e81b5f33fa736688d135b29add6a8acee466aa3a5988ac5b022d1eb","cloudflare-workers-ai.json":"07ef63208ff7517fd1a80962f18143e21de399640423329490b157f459ccf995","deepseek.json":"e3106724723fd82d48a3ff685da9908a3a7b7b4fd84cc3cfe97a6a23067b6029","fireworks.json":"eb986d5c6649ded170df730c579b08861b6c510347ed7479d6966722bda41527","github-copilot.json":"26cd0af57e17caf7fbd9c0b34da4653e2e29f1ba5a00c1ff996d2549f8b74c05","google-vertex.json":"e1631109172dc1f7d7977570420a5bb86258bdd1088427e244a2c51545c4f24d","google.json":"7619bf03edd2a7acb06a2274a14b13c3a61354288abe029a758401d4de36a8fd","groq.json":"e4728fd72e358cd8f25e9a518e9b49a521ef44523d3debe38a7db9e0663c4077","huggingface.json":"a488b6f175b382277ccf7d487f877ef0c698994576bb55d2410838bf9c8c7c41","kimi-coding.json":"88150f8970f83e17968b02f3b33fac803b96ebf1474e76437689b7d0f1b69363","minimax-cn.json":"65d37e55a6d9585855f94b3fb7739308d107fe248ebd9e1001d1c5d4606ad2c4","minimax.json":"c7dc5765995ae77242916430929c7cc9a782589f7e483e13f7e01663190d028e","mistral.json":"e3a109306644bf2f2fa38fece50b2d3ce1dbe3b87b1f1b9e2d70cce7eb5c0ea1","moonshotai-cn.json":"c4e1801b5dfd61bebcaa33cbfc5ed0c69df14a3bee37da218a558668d817864e","moonshotai.json":"3dab637e7e2648792c786157f85f29026b93393f7098b77593c1180928d371c9","nvidia.json":"a942cfffa6fc764d603503f7ce2abf4d2bdd1d541b98a65aa6ff53bfe2df4efd","openai-codex.json":"b8f275f5b501456000f6445398faac2189292378b837beeddcdbe1c42a319d22","openai.json":"203a1d6bf61178268edf3d3f0ad4a6408eded401c4472bda4ac0ec73142f38ce","opencode-go.json":"f97adb96bf613ee102585c6c4cd0a8cc8047d51c8cfe4cf2f98673afce09ee3d","opencode.json":"52b40ba8ab7435c9029bf59f38558f41528462990a6a7d7ba3f00aa10481da09","opengateway.json":"7a4c98061b7b84c476ba70d6f597019ef53c02c0135b9d8a7507e2c30905c07d","openrouter.json":"ce69376fa2141ff535fbf9c642f8492c7a0621b7f3cb3bb95c3d3bf5dc186543","qwen-token-plan-cn.json":"e62dde34edb603376a1dc60b2a74a9c2605b9e81d81df55cc259796c45aa4793","qwen-token-plan-individual.json":"5649fd4075ada766ec65a7a162cd65f096a7ecc29960ace04b2e6a6a4a995a41","qwen-token-plan.json":"fe914313157ff41ab2f71977f0fdcfedb3a8a205d1092e3180f6799e5d7942fd","together.json":"6010980c9b0af72c60965ae325dbdb21e67c91844a7f7f6f7d71d363f1325f56","venice.json":"ece2872660f480c3580de21be569681e13c752ded8c346ec9feb8c32ddf61a96","vercel-ai-gateway.json":"70381264ccd02d5ac7444205cd703be832726a67c8e7c3a8a9a789385ab50120","xai.json":"9973aae022723732b8a7ea12107e6fb8b3f1d0e087ec6bbc2ee18f0820595e19","xiaomi-token-plan-ams.json":"568b9992cf320536a65826e26a414afa5c0d17f083a01af4bd96658d9dd3e705","xiaomi-token-plan-cn.json":"c423857d0bbb0b126394eaf1ebb2a91bf2d1193cc5a4fe77843ff0f4536a0a80","xiaomi-token-plan-sgp.json":"008f1eb41037e93c5ae478f12815cd67bac1978f131ffefa602775bb60b63fea","xiaomi.json":"37acf451bb4364bdca2ecea6b7d962590d9974a87e80cfe34bb800be6a95c13b","zai-coding-cn.json":"d3c969020a7ab978497837a3301c7bca364d704082832221cfe61e6596333e56","zai.json":"f42790c77fb4681a656897a9d860b939916c0ddf979a5f16856bce9573cdf64e"}}