@cortexkit/claustrum-client 0.6.2 → 0.7.0
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.
- package/dist/wire.d.ts +2 -0
- package/dist/wire.js +6 -0
- package/package.json +1 -1
package/dist/wire.d.ts
CHANGED
|
@@ -212,6 +212,8 @@ export interface ScopedInventoryRow {
|
|
|
212
212
|
* which is also what an unmapped credential reports.
|
|
213
213
|
*/
|
|
214
214
|
readonly providerIds: readonly string[];
|
|
215
|
+
/** Operator assertion, unknown when absent; pricing owns the vocabulary. */
|
|
216
|
+
readonly planTier?: string;
|
|
215
217
|
readonly authMethod?: 'apikey' | 'chatgpt' | 'antigravity' | 'oauth';
|
|
216
218
|
/**
|
|
217
219
|
* Which provider protocol this credential speaks. Absent for static keys.
|
package/dist/wire.js
CHANGED
|
@@ -401,6 +401,11 @@ export function decodeScopedInventory(response, logUnknownClass) {
|
|
|
401
401
|
: undefined;
|
|
402
402
|
if (createdAtMs === undefined)
|
|
403
403
|
throw asCredentialError(response, 'invalid_response', logUnknownClass);
|
|
404
|
+
// A negative end assertion refuses trailing newlines too; JavaScript's $ accepts one.
|
|
405
|
+
const planTier = row.plan_tier;
|
|
406
|
+
if (planTier !== undefined && (typeof planTier !== 'string' || !/^[a-z][a-z0-9_]{0,31}(?![\s\S])/.test(planTier))) {
|
|
407
|
+
throw asCredentialError(response, 'invalid_response', logUnknownClass);
|
|
408
|
+
}
|
|
404
409
|
const authMethod = row.auth_method;
|
|
405
410
|
if (authMethod !== undefined &&
|
|
406
411
|
authMethod !== 'apikey' && authMethod !== 'chatgpt' &&
|
|
@@ -424,6 +429,7 @@ export function decodeScopedInventory(response, logUnknownClass) {
|
|
|
424
429
|
// no ids set. A present non-array is a malformed reply and still refuses.
|
|
425
430
|
providerIds: row.provider_ids === undefined ? [] : strings(row.provider_ids),
|
|
426
431
|
authMethod,
|
|
432
|
+
planTier,
|
|
427
433
|
state: row.state,
|
|
428
434
|
refreshAdapter: row.refresh_adapter,
|
|
429
435
|
recordVersion,
|