opencode-quota-gui 1.3.0 → 1.3.1
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/README.md +27 -17
- package/dist/bin/opencode-quota-gui.js +0 -0
- package/dist/contracts/build-identity.js +1 -1
- package/dist/contracts/dashboard.d.ts +8 -1
- package/dist/contracts/dto-guards.js +2 -0
- package/dist/contracts/openai-quota.d.ts +3 -0
- package/dist/contracts/openai-quota.js +3 -0
- package/dist/data/modelsdev-temporal.min.json +57 -0
- package/dist/gui/config.d.ts +3 -3
- package/dist/gui/config.js +31 -2
- package/dist/gui/lifecycle.d.ts +5 -3
- package/dist/gui/lifecycle.js +3 -3
- package/dist/gui/primary-quota-windows.js +16 -14
- package/dist/gui/provider-cards.d.ts +10 -2
- package/dist/gui/provider-cards.js +51 -23
- package/dist/gui/quota-notification-detector.d.ts +4 -4
- package/dist/gui/quota-notification-detector.js +76 -42
- package/dist/gui/quota-notification-observer.d.ts +2 -3
- package/dist/gui/quota-notification-observer.js +68 -19
- package/dist/gui/rpc.d.ts +2 -0
- package/dist/gui/rpc.js +11 -3
- package/dist/gui/server.js +11 -2
- package/dist/gui/snapshot-service.d.ts +3 -1
- package/dist/gui/snapshot-service.js +126 -18
- package/dist/gui/sources.js +98 -56
- package/dist/gui-experimental.cjs +230 -225
- package/dist/lib/accounting-format.js +8 -0
- package/dist/lib/alibaba-coding-plan-cli.d.ts +79 -0
- package/dist/lib/alibaba-coding-plan-cli.js +539 -0
- package/dist/lib/anthropic-auth.d.ts +2 -3
- package/dist/lib/anthropic-auth.js +2 -3
- package/dist/lib/anthropic.d.ts +48 -12
- package/dist/lib/anthropic.js +610 -275
- package/dist/lib/api-key-retry-after.d.ts +7 -0
- package/dist/lib/api-key-retry-after.js +62 -0
- package/dist/lib/atomic-json.d.ts +2 -0
- package/dist/lib/atomic-json.js +1 -0
- package/dist/lib/cache-observer-ingestion.d.ts +90 -0
- package/dist/lib/cache-observer-ingestion.js +981 -0
- package/dist/lib/cache-observer.d.ts +138 -0
- package/dist/lib/cache-observer.js +317 -0
- package/dist/lib/canonical-config-lock.d.ts +9 -0
- package/dist/lib/canonical-config-lock.js +36 -0
- package/dist/lib/chutes.js +62 -51
- package/dist/lib/claude-agent-transcript-ttl.d.ts +48 -0
- package/dist/lib/claude-agent-transcript-ttl.js +154 -0
- package/dist/lib/claude-agent-ttl-tracker.d.ts +21 -0
- package/dist/lib/claude-agent-ttl-tracker.js +152 -0
- package/dist/lib/cli-show.js +5 -3
- package/dist/lib/config-write-target.d.ts +1 -1
- package/dist/lib/config-write-target.js +5 -2
- package/dist/lib/config.d.ts +2 -1
- package/dist/lib/config.js +193 -2
- package/dist/lib/copilot.js +171 -86
- package/dist/lib/dashboard-web-policy.d.ts +4 -4
- package/dist/lib/dashboard-web-policy.js +2 -2
- package/dist/lib/deepseek.js +25 -13
- package/dist/lib/display-sanitize.js +1 -0
- package/dist/lib/entries.d.ts +23 -0
- package/dist/lib/entries.js +2 -0
- package/dist/lib/glm-coding-plan.js +98 -74
- package/dist/lib/google-agy.js +90 -12
- package/dist/lib/google-gemini-cli.js +84 -11
- package/dist/lib/http.d.ts +4 -0
- package/dist/lib/http.js +16 -2
- package/dist/lib/init-installer.js +5 -3
- package/dist/lib/kilo.js +37 -18
- package/dist/lib/kimi.js +35 -18
- package/dist/lib/mimo.d.ts +2 -0
- package/dist/lib/mimo.js +36 -0
- package/dist/lib/nanogpt.d.ts +1 -0
- package/dist/lib/nanogpt.js +26 -3
- package/dist/lib/ollama-cloud.d.ts +1 -1
- package/dist/lib/ollama-cloud.js +48 -35
- package/dist/lib/openai.js +84 -38
- package/dist/lib/opencode-auth-sqlite.d.ts +2 -2
- package/dist/lib/opencode-auth-sqlite.js +2 -2
- package/dist/lib/opencode-config-editor.d.ts +1 -0
- package/dist/lib/opencode-config-editor.js +6 -1
- package/dist/lib/opencode-go.js +29 -2
- package/dist/lib/opencode-version-core.d.ts +23 -0
- package/dist/lib/opencode-version-core.js +49 -0
- package/dist/lib/opencode-version.d.ts +2 -22
- package/dist/lib/opencode-version.js +4 -48
- package/dist/lib/opencode-zen.d.ts +3 -0
- package/dist/lib/opencode-zen.js +71 -5
- package/dist/lib/provider-add.js +5 -2
- package/dist/lib/provider-registration.d.ts +19 -9
- package/dist/lib/provider-registration.js +17 -6
- package/dist/lib/quota-command-format.js +1 -1
- package/dist/lib/quota-exhaustion-projection.d.ts +11 -0
- package/dist/lib/quota-exhaustion-projection.js +25 -0
- package/dist/lib/quota-providers-remote.d.ts +2 -1
- package/dist/lib/quota-providers-remote.js +59 -3
- package/dist/lib/quota-providers.d.ts +1 -1
- package/dist/lib/quota-providers.js +12 -35
- package/dist/lib/quota-render-data.d.ts +6 -0
- package/dist/lib/quota-render-data.js +43 -17
- package/dist/lib/quota-state-codec.js +17 -1
- package/dist/lib/quota-state.d.ts +7 -1
- package/dist/lib/quota-state.js +208 -34
- package/dist/lib/quota-stats.js +21 -0
- package/dist/lib/quota-status.js +3 -51
- package/dist/lib/scoped-update.d.ts +1 -1
- package/dist/lib/synthetic.js +65 -54
- package/dist/lib/types.d.ts +31 -1
- package/dist/lib/types.js +13 -0
- package/dist/lib/xai.js +48 -22
- package/dist/plugin.js +261 -13
- package/dist/provider-logos/NOTICE.md +1 -1
- package/dist/provider-logos/OPENCODE-NOTICE.md +4 -3
- package/dist/providers/alibaba-coding-plan.js +107 -104
- package/dist/providers/anthropic.d.ts +12 -3
- package/dist/providers/anthropic.js +71 -228
- package/dist/providers/cache-policies.d.ts +11 -4
- package/dist/providers/cache-policies.js +19 -13
- package/dist/providers/claude-agent.d.ts +19 -0
- package/dist/providers/claude-agent.js +196 -0
- package/dist/providers/copilot.js +2 -0
- package/dist/providers/glm-coding-plan-provider.d.ts +1 -0
- package/dist/providers/google-account-format.js +1 -0
- package/dist/providers/google-agy.d.ts +6 -5
- package/dist/providers/google-agy.js +43 -15
- package/dist/providers/google-gemini-cli.js +1 -0
- package/dist/providers/kilo.js +1 -0
- package/dist/providers/kimi-code.js +2 -0
- package/dist/providers/mimo.js +1 -0
- package/dist/providers/nanogpt.js +1 -0
- package/dist/providers/opencode-go.js +3 -0
- package/dist/providers/opencode-zen.js +2 -0
- package/dist/providers/openrouter.js +1 -0
- package/dist/providers/quota-providers.js +16 -5
- package/dist/providers/registry.js +2 -0
- package/dist/providers/result-helpers.d.ts +2 -0
- package/dist/providers/result-helpers.js +2 -0
- package/dist/rpc.d.ts +121 -8
- package/dist/rpc.js +204 -12
- package/dist/ui/assets/{index-cDd9jUVY.css → index-BcueIm3Z.css} +1 -1
- package/dist/ui/assets/index-C6qRSoh8.js +10 -0
- package/dist/ui/assets/{popover-BGkgv9s0.js → popover-4bFSvRZ7.js} +1 -1
- package/dist/ui/assets/providers/claude-agent.svg +3 -0
- package/dist/ui/index.html +2 -2
- package/package.json +44 -45
- package/dist/lib/alibaba-coding-plan-local-quota.d.ts +0 -47
- package/dist/lib/alibaba-coding-plan-local-quota.js +0 -146
- package/dist/ui/assets/index-DLHeXYff.js +0 -9
package/dist/rpc.js
CHANGED
|
@@ -110,6 +110,8 @@ export const QuotaRpc = {
|
|
|
110
110
|
};
|
|
111
111
|
export const DASHBOARD_RPC_ID = "opencode-quota-gui.dashboard";
|
|
112
112
|
const MAX_RESOURCE_ID_LENGTH = 256;
|
|
113
|
+
/** Bounded relayed session titles; display layers truncate further. */
|
|
114
|
+
const SESSION_METADATA_TITLE_MAX_LENGTH = 200;
|
|
113
115
|
const NO_INPUT = schema((value) => value === undefined || (isObject(value) && Object.keys(value).length === 0)
|
|
114
116
|
? null
|
|
115
117
|
: "input must be an empty object", () => ({}));
|
|
@@ -173,9 +175,8 @@ function checkRange(value) {
|
|
|
173
175
|
return isRangeKey(value.range) ? null : "range must be one of 24h, 7d, 30d, lifetime";
|
|
174
176
|
}
|
|
175
177
|
/**
|
|
176
|
-
* The explicit typed dashboard RPC.
|
|
177
|
-
* operation (plus
|
|
178
|
-
* no generic dispatch/call method.
|
|
178
|
+
* The explicit typed dashboard RPC. Methods map to a dashboard data-source or
|
|
179
|
+
* user settings-store operation (plus `watch`); there is no generic dispatch.
|
|
179
180
|
*/
|
|
180
181
|
export const DashboardRpc = {
|
|
181
182
|
id: DASHBOARD_RPC_ID,
|
|
@@ -184,19 +185,29 @@ export const DashboardRpc = {
|
|
|
184
185
|
schema: eventSchema((value) => {
|
|
185
186
|
if (!isObject(value))
|
|
186
187
|
return "event must be an object";
|
|
187
|
-
if (!hasOnlyKeys(value, ["topic", "at", "scope"])) {
|
|
188
|
-
return "event must contain only topic, at and
|
|
188
|
+
if (!hasOnlyKeys(value, ["topic", "at", "scope", "cacheObserverEvent"])) {
|
|
189
|
+
return "event must contain only topic, at, scope and cacheObserverEvent";
|
|
190
|
+
}
|
|
191
|
+
if (!Number.isFinite(value.at))
|
|
192
|
+
return "at must be a finite number";
|
|
193
|
+
if (value.topic === "cache.observer") {
|
|
194
|
+
if (value.scope !== undefined)
|
|
195
|
+
return "cache observer events cannot have a scope";
|
|
196
|
+
return isDashboardRpcCacheObserverEvent(value.cacheObserverEvent)
|
|
197
|
+
? null
|
|
198
|
+
: "cache.observer topic requires a valid cache observer payload";
|
|
189
199
|
}
|
|
190
200
|
if (value.topic !== "quota.changed" &&
|
|
191
201
|
value.topic !== "sessions.changed" &&
|
|
192
202
|
value.topic !== "settings.changed") {
|
|
193
203
|
return "topic must be a dashboard event topic";
|
|
194
204
|
}
|
|
195
|
-
if (!Number.isFinite(value.at))
|
|
196
|
-
return "at must be a finite number";
|
|
197
205
|
if (value.scope !== undefined && value.scope !== "visibility") {
|
|
198
206
|
return "scope must be visibility";
|
|
199
207
|
}
|
|
208
|
+
if (value.cacheObserverEvent !== undefined) {
|
|
209
|
+
return "cache observer payload requires the cache.observer topic";
|
|
210
|
+
}
|
|
200
211
|
return null;
|
|
201
212
|
}),
|
|
202
213
|
},
|
|
@@ -231,7 +242,15 @@ export const DashboardRpc = {
|
|
|
231
242
|
errors: DASHBOARD_RPC_ERRORS,
|
|
232
243
|
},
|
|
233
244
|
quota: {
|
|
234
|
-
input:
|
|
245
|
+
input: schema((value) => {
|
|
246
|
+
if (value === undefined)
|
|
247
|
+
return null;
|
|
248
|
+
if (!isObject(value) || !hasOnlyKeys(value, ["refresh"]))
|
|
249
|
+
return "input must be an empty object";
|
|
250
|
+
return value.refresh === undefined || typeof value.refresh === "boolean"
|
|
251
|
+
? null
|
|
252
|
+
: "refresh must be boolean";
|
|
253
|
+
}, (value) => (value === undefined ? {} : value)),
|
|
235
254
|
output: output(isQuotaSnapshot),
|
|
236
255
|
errors: DASHBOARD_RPC_ERRORS,
|
|
237
256
|
},
|
|
@@ -352,12 +371,16 @@ export const DashboardRpc = {
|
|
|
352
371
|
},
|
|
353
372
|
watch: {
|
|
354
373
|
input: schema((value) => {
|
|
355
|
-
if (!isObject(value) || !
|
|
356
|
-
return "input must contain only scope";
|
|
374
|
+
if (!isObject(value) || !hasOnlyKeys(value, ["scope", "attemptNonce"])) {
|
|
375
|
+
return "input must contain only scope and attemptNonce";
|
|
357
376
|
}
|
|
358
|
-
|
|
377
|
+
if (value.scope !== "quota" && value.scope !== "analytics") {
|
|
378
|
+
return "scope must be quota or analytics";
|
|
379
|
+
}
|
|
380
|
+
return value.attemptNonce === undefined ||
|
|
381
|
+
(typeof value.attemptNonce === "string" && isValidResourceId(value.attemptNonce))
|
|
359
382
|
? null
|
|
360
|
-
: "
|
|
383
|
+
: "attemptNonce must be a non-empty safe string";
|
|
361
384
|
}),
|
|
362
385
|
output: schema((value) => isObject(value) && typeof value.active === "boolean" ? null : "output must report active"),
|
|
363
386
|
errors: DASHBOARD_RPC_ERRORS,
|
|
@@ -387,4 +410,173 @@ export function isDashboardRpcQuotaNotificationData(value) {
|
|
|
387
410
|
return false;
|
|
388
411
|
return value.description === undefined || isSafeNotificationText(value.description, 1024);
|
|
389
412
|
}
|
|
413
|
+
/** Strict runtime validation for the narrow, content-free cache observer event DTO. */
|
|
414
|
+
export function isDashboardRpcCacheObserverEvent(value) {
|
|
415
|
+
if (!isObject(value) || typeof value.type !== "string")
|
|
416
|
+
return false;
|
|
417
|
+
if (value.type === "source.status") {
|
|
418
|
+
return (hasExactKeys(value, ["type", "created", "data"]) &&
|
|
419
|
+
Number.isFinite(value.created) &&
|
|
420
|
+
isObject(value.data) &&
|
|
421
|
+
hasOnlyKeys(value.data, ["state", "attemptNonce", "sourceBinding"]) &&
|
|
422
|
+
(value.data.state === "unverified" ||
|
|
423
|
+
value.data.state === "observed" ||
|
|
424
|
+
value.data.state === "unavailable" ||
|
|
425
|
+
value.data.state === "stopped") &&
|
|
426
|
+
(value.data.attemptNonce === undefined ||
|
|
427
|
+
(typeof value.data.attemptNonce === "string" &&
|
|
428
|
+
isValidResourceId(value.data.attemptNonce))) &&
|
|
429
|
+
(value.data.sourceBinding === undefined ||
|
|
430
|
+
(typeof value.data.sourceBinding === "string" &&
|
|
431
|
+
isValidResourceId(value.data.sourceBinding))));
|
|
432
|
+
}
|
|
433
|
+
if (value.type === "session.step.started") {
|
|
434
|
+
if (!hasExactKeys(value, ["type", "created", "data"]) ||
|
|
435
|
+
!Number.isFinite(value.created) ||
|
|
436
|
+
!isObject(value.data) ||
|
|
437
|
+
!hasOnlyKeys(value.data, [
|
|
438
|
+
"sessionID",
|
|
439
|
+
"assistantMessageID",
|
|
440
|
+
"model",
|
|
441
|
+
"started",
|
|
442
|
+
"connectionMethod",
|
|
443
|
+
]) ||
|
|
444
|
+
(value.data.connectionMethod !== undefined &&
|
|
445
|
+
value.data.connectionMethod !== "oauth" &&
|
|
446
|
+
value.data.connectionMethod !== "key" &&
|
|
447
|
+
value.data.connectionMethod !== "external") ||
|
|
448
|
+
typeof value.data.sessionID !== "string" ||
|
|
449
|
+
!isValidResourceId(value.data.sessionID) ||
|
|
450
|
+
typeof value.data.assistantMessageID !== "string" ||
|
|
451
|
+
!isValidResourceId(value.data.assistantMessageID) ||
|
|
452
|
+
!isObject(value.data.model) ||
|
|
453
|
+
!hasOnlyKeys(value.data.model, ["providerID", "id", "variant"]) ||
|
|
454
|
+
typeof value.data.model.providerID !== "string" ||
|
|
455
|
+
!isValidResourceId(value.data.model.providerID) ||
|
|
456
|
+
typeof value.data.model.id !== "string" ||
|
|
457
|
+
!isValidResourceId(value.data.model.id) ||
|
|
458
|
+
(value.data.model.variant !== undefined &&
|
|
459
|
+
(typeof value.data.model.variant !== "string" ||
|
|
460
|
+
!isValidResourceId(value.data.model.variant))) ||
|
|
461
|
+
(value.data.started !== undefined &&
|
|
462
|
+
(typeof value.data.started !== "number" ||
|
|
463
|
+
!Number.isFinite(value.data.started) ||
|
|
464
|
+
value.data.started < 0))) {
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
return true;
|
|
468
|
+
}
|
|
469
|
+
if (value.type === "session.step.ended") {
|
|
470
|
+
if (!hasExactKeys(value, ["type", "created", "data"]) || !isObject(value.data))
|
|
471
|
+
return false;
|
|
472
|
+
if (!Number.isFinite(value.created) ||
|
|
473
|
+
!hasExactKeys(value.data, ["sessionID", "assistantMessageID", "tokens"]) ||
|
|
474
|
+
typeof value.data.sessionID !== "string" ||
|
|
475
|
+
!isValidResourceId(value.data.sessionID) ||
|
|
476
|
+
typeof value.data.assistantMessageID !== "string" ||
|
|
477
|
+
!isValidResourceId(value.data.assistantMessageID) ||
|
|
478
|
+
!isObject(value.data.tokens) ||
|
|
479
|
+
!hasOnlyKeys(value.data.tokens, ["input", "cache"])) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
const tokens = value.data.tokens;
|
|
483
|
+
if (tokens.input !== undefined &&
|
|
484
|
+
(!Number.isFinite(tokens.input) || tokens.input < 0)) {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
if (tokens.cache === undefined)
|
|
488
|
+
return true;
|
|
489
|
+
if (!isObject(tokens.cache) || !hasOnlyKeys(tokens.cache, ["read", "write"]))
|
|
490
|
+
return false;
|
|
491
|
+
return [tokens.cache.read, tokens.cache.write].every((count) => count === undefined || (Number.isFinite(count) && count >= 0));
|
|
492
|
+
}
|
|
493
|
+
if (value.type === "session.cache.ttl") {
|
|
494
|
+
return (hasExactKeys(value, ["type", "created", "data"]) &&
|
|
495
|
+
Number.isFinite(value.created) &&
|
|
496
|
+
isObject(value.data) &&
|
|
497
|
+
hasExactKeys(value.data, ["sessionID", "assistantMessageID", "ttlMs"]) &&
|
|
498
|
+
typeof value.data.sessionID === "string" &&
|
|
499
|
+
isValidResourceId(value.data.sessionID) &&
|
|
500
|
+
typeof value.data.assistantMessageID === "string" &&
|
|
501
|
+
isValidResourceId(value.data.assistantMessageID) &&
|
|
502
|
+
value.data.ttlMs === 3_600_000);
|
|
503
|
+
}
|
|
504
|
+
if (value.type === "session.created") {
|
|
505
|
+
return (hasExactKeys(value, ["type", "data"]) &&
|
|
506
|
+
isObject(value.data) &&
|
|
507
|
+
hasExactKeys(value.data, ["sessionID", "parentID"]) &&
|
|
508
|
+
typeof value.data.sessionID === "string" &&
|
|
509
|
+
isValidResourceId(value.data.sessionID) &&
|
|
510
|
+
typeof value.data.parentID === "string" &&
|
|
511
|
+
isValidResourceId(value.data.parentID));
|
|
512
|
+
}
|
|
513
|
+
if (value.type === "session.forked") {
|
|
514
|
+
return (hasExactKeys(value, ["type", "data"]) &&
|
|
515
|
+
isObject(value.data) &&
|
|
516
|
+
hasOnlyKeys(value.data, ["sessionID", "parentID"]) &&
|
|
517
|
+
typeof value.data.sessionID === "string" &&
|
|
518
|
+
isValidResourceId(value.data.sessionID) &&
|
|
519
|
+
(value.data.parentID === undefined ||
|
|
520
|
+
(typeof value.data.parentID === "string" && isValidResourceId(value.data.parentID))));
|
|
521
|
+
}
|
|
522
|
+
if (value.type === "session.status") {
|
|
523
|
+
return (hasExactKeys(value, ["type", "created", "data"]) &&
|
|
524
|
+
Number.isFinite(value.created) &&
|
|
525
|
+
isObject(value.data) &&
|
|
526
|
+
hasExactKeys(value.data, ["sessionID", "state"]) &&
|
|
527
|
+
typeof value.data.sessionID === "string" &&
|
|
528
|
+
isValidResourceId(value.data.sessionID) &&
|
|
529
|
+
(value.data.state === "busy" || value.data.state === "idle"));
|
|
530
|
+
}
|
|
531
|
+
if (value.type === "session.metadata") {
|
|
532
|
+
if (!hasExactKeys(value, ["type", "created", "data"]) ||
|
|
533
|
+
!Number.isFinite(value.created) ||
|
|
534
|
+
!isObject(value.data) ||
|
|
535
|
+
!hasOnlyKeys(value.data, ["sessionID", "title", "agent", "model"])) {
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
if (typeof value.data.sessionID !== "string" || !isValidResourceId(value.data.sessionID)) {
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
if (value.data.title !== undefined &&
|
|
542
|
+
!isSafeNotificationText(value.data.title, SESSION_METADATA_TITLE_MAX_LENGTH)) {
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
if (value.data.agent !== undefined &&
|
|
546
|
+
(typeof value.data.agent !== "string" || !isValidResourceId(value.data.agent))) {
|
|
547
|
+
return false;
|
|
548
|
+
}
|
|
549
|
+
if (value.data.model !== undefined) {
|
|
550
|
+
const model = value.data.model;
|
|
551
|
+
if (!isObject(model) ||
|
|
552
|
+
!hasOnlyKeys(model, ["providerID", "id", "variant"]) ||
|
|
553
|
+
typeof model.providerID !== "string" ||
|
|
554
|
+
!isValidResourceId(model.providerID) ||
|
|
555
|
+
typeof model.id !== "string" ||
|
|
556
|
+
!isValidResourceId(model.id) ||
|
|
557
|
+
(model.variant !== undefined &&
|
|
558
|
+
(typeof model.variant !== "string" || !isValidResourceId(model.variant)))) {
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
564
|
+
if (value.type !== "session.compaction.ended" && value.type !== "session.deleted")
|
|
565
|
+
return false;
|
|
566
|
+
return (hasExactKeys(value, ["type", "data"]) &&
|
|
567
|
+
isObject(value.data) &&
|
|
568
|
+
hasExactKeys(value.data, ["sessionID"]) &&
|
|
569
|
+
typeof value.data.sessionID === "string" &&
|
|
570
|
+
isValidResourceId(value.data.sessionID));
|
|
571
|
+
}
|
|
572
|
+
/** Strict guard for cache observer DTOs wrapped in the existing invalidation event envelope. */
|
|
573
|
+
export function isDashboardRpcCacheObserverEventData(value) {
|
|
574
|
+
return (isObject(value) &&
|
|
575
|
+
hasExactKeys(value, ["topic", "at", "cacheObserverEvent"]) &&
|
|
576
|
+
value.topic === "cache.observer" &&
|
|
577
|
+
typeof value.at === "number" &&
|
|
578
|
+
Number.isFinite(value.at) &&
|
|
579
|
+
value.at >= 0 &&
|
|
580
|
+
isDashboardRpcCacheObserverEvent(value.cacheObserverEvent));
|
|
581
|
+
}
|
|
390
582
|
//# sourceMappingURL=rpc.js.map
|