cartethyia 2.5.2 → 2.5.3
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/dashboard/assets/{BannedPage-MsQaeQTs.js → BannedPage-hfCzi-Ux.js} +1 -1
- package/dist/dashboard/assets/BannedPage-hfCzi-Ux.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-BO9nKg9w.js → CliToolDetailPage-DLGqYEwI.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-DLGqYEwI.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-DfWHTJ7v.js → CliToolsPage-DEDyKBlC.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-DEDyKBlC.js.gz +0 -0
- package/dist/dashboard/assets/{CombosPage-BrCBQDAc.js → CombosPage-CfuYiQ8Z.js} +1 -1
- package/dist/dashboard/assets/CombosPage-CfuYiQ8Z.js.gz +0 -0
- package/dist/dashboard/assets/{ConsoleLogPage-C6Uh33er.js → ConsoleLogPage-bsLuZmYH.js} +1 -1
- package/dist/dashboard/assets/ConsoleLogPage-bsLuZmYH.js.gz +0 -0
- package/dist/dashboard/assets/{CustomizationPage-8aS9hyJu.js → CustomizationPage-_UWhwziJ.js} +1 -1
- package/dist/dashboard/assets/CustomizationPage-_UWhwziJ.js.gz +0 -0
- package/dist/dashboard/assets/{HealthEventsModal-qomXThxX.js → HealthEventsModal-Cjfc5WFS.js} +1 -1
- package/dist/dashboard/assets/HealthEventsModal-Cjfc5WFS.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-C8hKyXBe.js → LoginPage-DDVIfZGW.js} +1 -1
- package/dist/dashboard/assets/LoginPage-DDVIfZGW.js.gz +0 -0
- package/dist/dashboard/assets/{OverviewPage-C-ExCy1V.js → OverviewPage-B53YYMng.js} +1 -1
- package/dist/dashboard/assets/OverviewPage-B53YYMng.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-B0KaAQf0.js +3 -0
- package/dist/dashboard/assets/ProviderDetailPage-B0KaAQf0.js.gz +0 -0
- package/dist/dashboard/assets/{ProvidersPage-BS9IEpvv.js → ProvidersPage-Dx31DgIO.js} +1 -1
- package/dist/dashboard/assets/ProvidersPage-Dx31DgIO.js.gz +0 -0
- package/dist/dashboard/assets/{ProxyPage-Rn_qXScb.js → ProxyPage-BpnR4kXT.js} +1 -1
- package/dist/dashboard/assets/ProxyPage-BpnR4kXT.js.gz +0 -0
- package/dist/dashboard/assets/{QuotaPage-BihkgQSq.js → QuotaPage-BpOQCnun.js} +1 -1
- package/dist/dashboard/assets/QuotaPage-BpOQCnun.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-DV1eo2J_.js +1 -0
- package/dist/dashboard/assets/SettingsPage-DV1eo2J_.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-CXjUlfqr.js → SetupPage-D6pmQ86L.js} +1 -1
- package/dist/dashboard/assets/SetupPage-D6pmQ86L.js.gz +0 -0
- package/dist/dashboard/assets/{SortableList-C-_oD3F2.js → SortableList-DWvKiuSl.js} +1 -1
- package/dist/dashboard/assets/SortableList-DWvKiuSl.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-u9IxmYOI.js → StudioPage-CmkUrgdj.js} +1 -1
- package/dist/dashboard/assets/StudioPage-CmkUrgdj.js.gz +0 -0
- package/dist/dashboard/assets/{UsagePage-BEVLVrwP.js → UsagePage-B47uOydr.js} +1 -1
- package/dist/dashboard/assets/UsagePage-B47uOydr.js.gz +0 -0
- package/dist/dashboard/assets/{entry-Dj9AR0gY.js → entry-CkryrIea.js} +3 -3
- package/dist/dashboard/assets/entry-CkryrIea.js.gz +0 -0
- package/dist/dashboard/assets/{index-DCBtROoK.js → index-BydyKaDz.js} +2 -2
- package/dist/dashboard/assets/index-BydyKaDz.js.gz +0 -0
- package/dist/dashboard/assets/{select-DsX5QT8K.js → select-BO6h8yNv.js} +1 -1
- package/dist/dashboard/assets/select-BO6h8yNv.js.gz +0 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +21 -21
- package/package.json +1 -1
- package/scripts/cli/command/console-menu.ts +248 -246
- package/scripts/cli/command/tray.ts +208 -204
- package/src/config/spec.ts +26 -2
- package/src/console/backup/routes.ts +52 -1
- package/src/console/backup/service.ts +60 -4
- package/src/console/share/share-router.ts +6 -9
- package/src/observability/payload-capture.ts +366 -344
- package/src/observability/payload-store.ts +12 -2
- package/src/observability/telemetry-status.ts +28 -16
- package/src/persistence/stores/api-key-store.ts +6 -0
- package/src/persistence/stores/share-store.ts +583 -556
- package/src/persistence/stores/telemetry-store.ts +1 -1
- package/src/protocol/response/gemini.ts +18 -4
- package/src/providers/integrations/antigravity/antigravity-quota.ts +11 -3
- package/src/providers/integrations/buddy/buddy-catalog-shared.ts +4 -4
- package/src/providers/integrations/buddy/workbuddy/shared.ts +201 -200
- package/src/providers/integrations/cline/cline-quota.ts +8 -11
- package/src/providers/integrations/opencode/provider.ts +532 -532
- package/src/providers/integrations/tokenharbor.ts +2 -2
- package/src/providers/integrations/trae/trae-catalog.ts +5 -3
- package/src/providers/operations/account-health-service.ts +23 -0
- package/src/providers/operations/client-versions.ts +9 -2
- package/src/providers/provider-metadata.ts +7 -1
- package/src/transport/dispatch/attempt-finalize.ts +46 -5
- package/src/transport/dispatch/proxy-request.ts +9 -0
- package/src/transport/dispatch/streaming/stream.ts +16 -2
- package/src/transport/routing/route-catalog.ts +806 -799
- package/dist/dashboard/assets/BannedPage-MsQaeQTs.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-BO9nKg9w.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-DfWHTJ7v.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-BrCBQDAc.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-C6Uh33er.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-8aS9hyJu.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-qomXThxX.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-C8hKyXBe.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-C-ExCy1V.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-tr811uaF.js +0 -3
- package/dist/dashboard/assets/ProviderDetailPage-tr811uaF.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-BS9IEpvv.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-Rn_qXScb.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-BihkgQSq.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-DhiEjm6T.js +0 -1
- package/dist/dashboard/assets/SettingsPage-DhiEjm6T.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-CXjUlfqr.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-C-_oD3F2.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-u9IxmYOI.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-BEVLVrwP.js.gz +0 -0
- package/dist/dashboard/assets/entry-Dj9AR0gY.js.gz +0 -0
- package/dist/dashboard/assets/index-DCBtROoK.js.gz +0 -0
- package/dist/dashboard/assets/select-DsX5QT8K.js.gz +0 -0
|
@@ -157,12 +157,22 @@ async function appendFrameToPath(
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* The frame's body keys, in the same order `buildPayloadRecord` serializes
|
|
162
|
+
* them.
|
|
163
|
+
*
|
|
164
|
+
* The record hands the writer one string per body already serialized, so the
|
|
165
|
+
* two orders must agree or every body lands under the wrong key. The order is
|
|
166
|
+
* drawer order with the legacy `response_body` alias last, for the same reason
|
|
167
|
+
* the record accounts it last: it names no panel of its own and must not
|
|
168
|
+
* spend the shared byte budget ahead of the provider stages.
|
|
169
|
+
*/
|
|
160
170
|
const FRAME_BODY_KEYS = [
|
|
161
171
|
"request_body",
|
|
162
|
-
"response_body",
|
|
163
|
-
"client_response_body",
|
|
164
172
|
"provider_request_body",
|
|
165
173
|
"provider_response_body",
|
|
174
|
+
"client_response_body",
|
|
175
|
+
"response_body",
|
|
166
176
|
] as const;
|
|
167
177
|
|
|
168
178
|
/**
|
|
@@ -32,12 +32,18 @@
|
|
|
32
32
|
* - **`503`** is capacity or availability: the gateway *correctly* refusing work
|
|
33
33
|
* it cannot do right now (`admission_unavailable`, `accounts_unavailable`,
|
|
34
34
|
* `shutting_down`, `restart_for_update`, `platform_unavailable`). Retryable,
|
|
35
|
-
* self-inflicted, and an
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
35
|
+
* self-inflicted, and an operator-capacity signal rather than a defect.
|
|
36
|
+
* - **`504`** is a timeout, not a malfunction. It represents a deadline that
|
|
37
|
+
* expired: the request deadline, the stream-stall
|
|
38
|
+
* watchdog, an HTTP/2 read-idle or WebSocket receive timer, an upstream that
|
|
39
|
+
* stopped sending mid-stream. The gateway *did* its job — it stopped waiting
|
|
40
|
+
* — and the wait may have been the upstream or network. Counting a slow
|
|
41
|
+
* provider as a gateway defect makes the error rate track provider
|
|
42
|
+
* latency rather than gateway health, and a caller can inflate it for free
|
|
43
|
+
* by requesting a window nobody can fill in time.
|
|
44
|
+
* - **`529`** is the upstream's own overload signal, not this gateway's.
|
|
45
|
+
* - **`500`, `502`** — an internal error, a stream that ended before
|
|
46
|
+
* completion — are the gateway failing at its job. These count.
|
|
41
47
|
*
|
|
42
48
|
* Excluded requests are still recorded, still rendered in the Requests table,
|
|
43
49
|
* still filterable, and still openable in the detail drawer. "Not an error"
|
|
@@ -59,12 +65,18 @@ export const GATEWAY_ERROR_STATUSES = ["failed", "truncated"] as const;
|
|
|
59
65
|
export const GATEWAY_ERROR_HTTP_MIN = 500;
|
|
60
66
|
|
|
61
67
|
/**
|
|
62
|
-
* The `5xx` statuses that
|
|
63
|
-
*
|
|
68
|
+
* The `5xx` statuses that are *not* a gateway defect: capacity and
|
|
69
|
+
* availability (`503`, `529`) and deadlines (`504`). Named explicitly so
|
|
70
|
+
* error-rate rollups exclude all of them.
|
|
71
|
+
*
|
|
72
|
+
* `504` belongs here even though it is not capacity. The name covers the
|
|
73
|
+
* shared property — the gateway behaved correctly and the outcome belongs to
|
|
74
|
+
* somebody else — because listing it under "capacity" invites a later reader
|
|
75
|
+
* to prune a code that does not look like one.
|
|
64
76
|
*/
|
|
65
|
-
export const
|
|
77
|
+
export const NON_DEFECT_HTTP_STATUSES = [503, 504, 529] as const;
|
|
66
78
|
|
|
67
|
-
const
|
|
79
|
+
const NON_DEFECT_HTTP_STATUS_SET: ReadonlySet<number> = new Set(NON_DEFECT_HTTP_STATUSES);
|
|
68
80
|
|
|
69
81
|
/**
|
|
70
82
|
* Whether a terminal lifecycle status represents a gateway failure, before the
|
|
@@ -86,10 +98,10 @@ export function isGatewayErrorStatus(status: string | null | undefined): boolean
|
|
|
86
98
|
|
|
87
99
|
/**
|
|
88
100
|
* Whether an HTTP status is a gateway defect: a `5xx` that is not one of the
|
|
89
|
-
* capacity
|
|
101
|
+
* non-defect statuses (capacity, availability, or a deadline).
|
|
90
102
|
*/
|
|
91
103
|
export function isGatewayErrorHttpStatus(httpStatus: number): boolean {
|
|
92
|
-
return httpStatus >= GATEWAY_ERROR_HTTP_MIN && !
|
|
104
|
+
return httpStatus >= GATEWAY_ERROR_HTTP_MIN && !NON_DEFECT_HTTP_STATUS_SET.has(httpStatus);
|
|
93
105
|
}
|
|
94
106
|
|
|
95
107
|
/**
|
|
@@ -116,7 +128,7 @@ export function isGatewayError(
|
|
|
116
128
|
*
|
|
117
129
|
* Derived from the same constants `isGatewayError` reads — the status list from
|
|
118
130
|
* `GATEWAY_ERROR_STATUSES`, the floor from `GATEWAY_ERROR_HTTP_MIN`, the
|
|
119
|
-
* exceptions from `
|
|
131
|
+
* exceptions from `NON_DEFECT_HTTP_STATUSES` — so the two forms cannot drift:
|
|
120
132
|
* an unknown status must be classified the same way row-level and in SQL, or
|
|
121
133
|
* the durable rollup disagrees with every read-side count.
|
|
122
134
|
*/
|
|
@@ -125,9 +137,9 @@ export function gatewayErrorSql(status: AnyColumn, httpStatus: AnyColumn): SQL {
|
|
|
125
137
|
GATEWAY_ERROR_STATUSES.map((value) => sql`${value}`),
|
|
126
138
|
sql`, `,
|
|
127
139
|
);
|
|
128
|
-
const
|
|
129
|
-
|
|
140
|
+
const nonDefect = sql.join(
|
|
141
|
+
NON_DEFECT_HTTP_STATUSES.map((code) => sql`${code}`),
|
|
130
142
|
sql`, `,
|
|
131
143
|
);
|
|
132
|
-
return sql`(${status} in (${included}) and (${httpStatus} is null or (${httpStatus} >= ${GATEWAY_ERROR_HTTP_MIN} and ${httpStatus} not in (${
|
|
144
|
+
return sql`(${status} in (${included}) and (${httpStatus} is null or (${httpStatus} >= ${GATEWAY_ERROR_HTTP_MIN} and ${httpStatus} not in (${nonDefect}))))`;
|
|
133
145
|
}
|
|
@@ -411,6 +411,12 @@ export class DrizzleApiKeyStore implements ApiKeyStore {
|
|
|
411
411
|
...(patch.clientRouterDenylist !== undefined
|
|
412
412
|
? { clientRouterDenylist: patch.clientRouterDenylist }
|
|
413
413
|
: {}),
|
|
414
|
+
// Scopes are validated once, in `validateApiKeyRequest`, against the
|
|
415
|
+
// tenant scope set; the store writes what it is handed. Omitting the
|
|
416
|
+
// field here meant an update was type-checked, accepted, and then
|
|
417
|
+
// silently dropped — a grant like `routing:cli_mapping` could be
|
|
418
|
+
// turned on and never stick.
|
|
419
|
+
...(patch.scopes === undefined ? {} : { scopes: patch.scopes }),
|
|
414
420
|
})
|
|
415
421
|
.where(and(eq(apiKeys.tenantId, tenantId), eq(apiKeys.id, keyId)))
|
|
416
422
|
.returning();
|