@cartanova/qgrid-cli 2.12.0 → 2.13.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.ko.md +1 -1
- package/README.md +1 -1
- package/bundle/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/decorate.js +1 -1
- package/bundle/dist/_virtual/{_@oxc-project_runtime@0.140.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/decorateMetadata.js +1 -1
- package/bundle/dist/_virtual/_rolldown/runtime.js +2 -2
- package/bundle/dist/application/monit/monit.frame.js +2 -2
- package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +3 -3
- package/bundle/dist/application/qgrid/qgrid.dispatcher.js +1 -1
- package/bundle/dist/application/qgrid/qgrid.frame.js +6 -6
- package/bundle/dist/application/qgrid/qgrid.types.js +8 -8
- package/bundle/dist/application/qgrid/token-death.js +3 -2
- package/bundle/dist/application/qgrid/token-subscriber.js +2 -2
- package/bundle/dist/application/qgrid/token-window-keepalive.js +2 -2
- package/bundle/dist/application/qgrid/tool-emulation-schema.js +5 -3
- package/bundle/dist/application/qgrid/tool-emulation.js +2 -2
- package/bundle/dist/application/request-log/request-log.model.js +9 -7
- package/bundle/dist/application/request-log-step/request-log-step.model.js +11 -7
- package/bundle/dist/application/setting/setting.model.js +11 -7
- package/bundle/dist/application/token/token.model.js +15 -11
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +7 -5
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +15 -11
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -1
- package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -1
- package/bundle/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -1
- package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +18 -12
- package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +1 -1
- package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +16 -13
- package/bundle/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -1
- package/bundle/dist/sonamu.config.js +11 -11
- package/bundle/dist/startup-migrations.js +1 -1
- package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +3 -2
- package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +5 -2
- package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +9 -7
- package/bundle/dist/utils/providers/common/model-cost.js +7 -5
- package/bundle/dist/utils/providers/common/schema-validation.js +3 -3
- package/bundle/dist/utils/providers/grok/grok-constants.js +1 -1
- package/bundle/dist/utils/providers/grok/grok-dispatcher.js +5 -3
- package/bundle/dist/utils/providers/grok/grok-media-client.js +4 -4
- package/bundle/dist/utils/providers/grok/grok-oauth.js +2 -2
- package/bundle/dist/utils/providers/openai/openai-dispatcher.js +8 -6
- package/bundle/dist/utils/providers/openai/openai-image-generation.js +4 -4
- package/bundle/src/application/qgrid/qgrid.frame.test.ts +3 -2
- package/bundle/src/application/qgrid/qgrid.types.ts +5 -5
- package/bundle/src/application/request-log/request-log.model.ts +1 -1
- package/bundle/src/sonamu.config.ts +14 -14
- package/bundle/src/utils/providers/common/model-cost.ts +8 -6
- package/bundle/src/utils/providers/grok/grok-constants.ts +7 -8
- package/bundle/web-dist/client/assets/clsx-DB0hHKMi.js +1 -0
- package/bundle/web-dist/client/assets/cost-CZzlCFS2.js +1 -0
- package/bundle/web-dist/client/assets/index-DLo1QCw7.css +1 -0
- package/bundle/web-dist/client/assets/index-DplV-wqZ.js +104 -0
- package/bundle/web-dist/client/assets/logs-st46aRba.js +1 -0
- package/bundle/web-dist/client/assets/monit-BMXR2tY2.js +1 -0
- package/bundle/web-dist/client/assets/plus-Bab0ACnC.js +1 -0
- package/bundle/web-dist/client/assets/refresh-cw-BtYoFHVw.js +1 -0
- package/bundle/web-dist/client/assets/request-model-Dl31cZdf.js +1 -0
- package/bundle/web-dist/client/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/bundle/web-dist/client/assets/routes-BWPjgvhg.js +5 -0
- package/bundle/web-dist/client/assets/settings-DTXZjDAw.js +1 -0
- package/bundle/web-dist/client/assets/show-CdWNFPyS.js +2 -0
- package/bundle/web-dist/client/assets/tokens-eA34Gw5f.js +1 -0
- package/bundle/web-dist/client/assets/use-oauth-login-flow-CcUdLsa7.js +1 -0
- package/bundle/web-dist/client/assets/use-update-token-mutation-D2r5K5Bz.js +1 -0
- package/bundle/web-dist/client/assets/vendor-react-8xo7RSum.js +9 -0
- package/bundle/web-dist/client/assets/vendor-tanstack-6B86itGS.js +2 -0
- package/bundle/web-dist/client/index.html +5 -7
- package/bundle/web-dist/server/assets/{logs-B5M5B7pN.js → logs-C0md5rmp.js} +48 -36
- package/bundle/web-dist/server/assets/monit-YVvwJuAF.js +479 -0
- package/bundle/web-dist/server/assets/plus-z5Hy__3C.js +26 -0
- package/bundle/web-dist/server/assets/refresh-cw-CNm0CERy.js +30 -0
- package/bundle/web-dist/server/assets/{request-model-Cp6h5EuP.js → request-model-DIuPZZwu.js} +14 -7
- package/bundle/web-dist/server/assets/{routes-rIXpkI-t.js → routes-CjWxvHAO.js} +1741 -1101
- package/bundle/web-dist/server/assets/{services.generated-CMJ8AHbO.js → services.generated-CqS8DCjT.js} +11973 -6081
- package/bundle/web-dist/server/assets/{settings-_MoaFGxj.js → settings-CXwnKiMG.js} +40 -19
- package/bundle/web-dist/server/assets/{show-Cfm9UeDr.js → show-G1t8dOEh.js} +268 -213
- package/bundle/web-dist/server/assets/{tokens-DMSHDg9D.js → tokens-C4D67FBX.js} +41 -18
- package/bundle/web-dist/server/assets/{use-oauth-login-flow-jkAkT3X6.js → use-oauth-login-flow-CFzShQtp.js} +1569 -38
- package/bundle/web-dist/server/assets/{use-update-token-mutation-Sm6kh02m.js → use-update-token-mutation-oH0O0n-g.js} +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +11595 -5045
- package/dist/cli.js +20 -11
- package/package.json +24 -24
- package/skills/qgrid/references/ai-sdk-provider-contract.md +4 -4
- package/skills/qgrid/references/decision-rationale.md +3 -0
- package/skills/qgrid/references/repo-map.md +1 -1
- package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
- package/skills/qgrid/references/tool-calling-and-multiturn.md +2 -2
- package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +0 -1
- package/bundle/web-dist/client/assets/cost-DB3HbU7T.js +0 -1
- package/bundle/web-dist/client/assets/index-Be2qCZmI.css +0 -1
- package/bundle/web-dist/client/assets/index-CK9LwGNV.js +0 -32
- package/bundle/web-dist/client/assets/logs-DjQcEivP.js +0 -1
- package/bundle/web-dist/client/assets/monit-RTxpU7oZ.js +0 -1
- package/bundle/web-dist/client/assets/plus-DDvVTvQP.js +0 -1
- package/bundle/web-dist/client/assets/preload-helper-DWTEM3RW.js +0 -1
- package/bundle/web-dist/client/assets/refresh-cw-CTQsNddA.js +0 -1
- package/bundle/web-dist/client/assets/request-model-DliRuPcw.js +0 -1
- package/bundle/web-dist/client/assets/rolldown-runtime-Dw2cE7zH.js +0 -1
- package/bundle/web-dist/client/assets/routes-DVHoo-YF.js +0 -5
- package/bundle/web-dist/client/assets/services.generated-B5lc3aIC.js +0 -51
- package/bundle/web-dist/client/assets/settings-BQUz6UFr.js +0 -1
- package/bundle/web-dist/client/assets/show-CalQG1Ew.js +0 -2
- package/bundle/web-dist/client/assets/tokens-DU4fWXI9.js +0 -1
- package/bundle/web-dist/client/assets/use-oauth-login-flow-BfxYI4Oh.js +0 -1
- package/bundle/web-dist/client/assets/use-update-token-mutation-qKBC2sn7.js +0 -1
- package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
- package/bundle/web-dist/client/assets/vendor-tanstack-DRPs09ai.js +0 -1
- package/bundle/web-dist/server/assets/lazyRouteComponent-AKiHfZWp.js +0 -1983
- package/bundle/web-dist/server/assets/monit-p6JM8MMl.js +0 -1652
- package/bundle/web-dist/server/assets/plus-I0FfLVgU.js +0 -19
- package/bundle/web-dist/server/assets/react-dom-Cv23mm1K.js +0 -335
- package/bundle/web-dist/server/assets/refresh-cw-DYsnffRC.js +0 -23
- /package/bundle/web-dist/server/assets/{clsx-D_N5PN_2.js → clsx-DgIEfj3H.js} +0 -0
- /package/bundle/web-dist/server/assets/{cost-BC9yzyA9.js → cost-oNK0T4Jo.js} +0 -0
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { J as require_react, Q as __toESM, k as useQuery, q as require_jsx_runtime, t as MonitService } from "./services.generated-CqS8DCjT.js";
|
|
2
|
+
import { t as clsx } from "./clsx-DgIEfj3H.js";
|
|
3
|
+
import { n as Route } from "../entry-server.generated.js";
|
|
4
|
+
import { t as cacheHitRate } from "./cost-oNK0T4Jo.js";
|
|
5
|
+
import { t as ForwardRef } from "./refresh-cw-CNm0CERy.js";
|
|
6
|
+
//#region src/components/qgrid/MonitConsole.tsx
|
|
7
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
9
|
+
var POLL_INTERVAL_MS = 1e3;
|
|
10
|
+
var STALE_AFTER_MS = 5e3;
|
|
11
|
+
var MIRROR_CAP = 4e3;
|
|
12
|
+
var SCROLL_END_THRESHOLD_PX = 80;
|
|
13
|
+
var NO_ITEMS = [];
|
|
14
|
+
var MonitLogMirror = class {
|
|
15
|
+
cursor;
|
|
16
|
+
epoch;
|
|
17
|
+
lastKey = 0;
|
|
18
|
+
items = NO_ITEMS;
|
|
19
|
+
inFlightSamples = [];
|
|
20
|
+
async poll() {
|
|
21
|
+
const chunk = await MonitService.monitLogs(this.cursor);
|
|
22
|
+
this.merge(chunk);
|
|
23
|
+
this.inFlightSamples = appendSample(this.inFlightSamples, chunk.vitals.openaiInFlight);
|
|
24
|
+
return {
|
|
25
|
+
items: this.items,
|
|
26
|
+
processStartedAt: chunk.processStartedAt,
|
|
27
|
+
vitals: chunk.vitals,
|
|
28
|
+
inFlightSamples: this.inFlightSamples
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
nextKey() {
|
|
32
|
+
this.lastKey += 1;
|
|
33
|
+
return this.lastKey;
|
|
34
|
+
}
|
|
35
|
+
merge(chunk) {
|
|
36
|
+
let base = this.items;
|
|
37
|
+
const appended = [];
|
|
38
|
+
if (this.epoch !== void 0 && chunk.processStartedAt !== this.epoch) {
|
|
39
|
+
base = NO_ITEMS;
|
|
40
|
+
appended.push({
|
|
41
|
+
kind: "restart",
|
|
42
|
+
key: this.nextKey(),
|
|
43
|
+
processStartedAt: chunk.processStartedAt
|
|
44
|
+
});
|
|
45
|
+
} else if (chunk.dropped > 0) appended.push({
|
|
46
|
+
kind: "dropped",
|
|
47
|
+
key: this.nextKey(),
|
|
48
|
+
count: chunk.dropped
|
|
49
|
+
});
|
|
50
|
+
this.epoch = chunk.processStartedAt;
|
|
51
|
+
this.cursor = chunk.nextCursor;
|
|
52
|
+
const lastSeq = base.findLast((item) => item.kind === "log")?.entry.seq;
|
|
53
|
+
for (const entry of chunk.entries) {
|
|
54
|
+
if (lastSeq !== void 0 && entry.seq <= lastSeq) continue;
|
|
55
|
+
appended.push({
|
|
56
|
+
kind: "log",
|
|
57
|
+
key: this.nextKey(),
|
|
58
|
+
entry
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (appended.length === 0) return;
|
|
62
|
+
const next = [...base, ...appended];
|
|
63
|
+
this.items = next.length > MIRROR_CAP ? next.slice(-4e3) : next;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var LEVEL_RANK = new Map(Object.entries({
|
|
67
|
+
trace: 0,
|
|
68
|
+
debug: 1,
|
|
69
|
+
info: 2,
|
|
70
|
+
warning: 3,
|
|
71
|
+
error: 4,
|
|
72
|
+
fatal: 5
|
|
73
|
+
}));
|
|
74
|
+
var LEVEL_LABEL = new Map(Object.entries({
|
|
75
|
+
trace: "TRC",
|
|
76
|
+
debug: "DBG",
|
|
77
|
+
info: "INF",
|
|
78
|
+
warning: "WRN",
|
|
79
|
+
error: "ERR",
|
|
80
|
+
fatal: "FTL"
|
|
81
|
+
}));
|
|
82
|
+
var TIME_FORMATTER = new Intl.DateTimeFormat("en-GB", {
|
|
83
|
+
hour: "2-digit",
|
|
84
|
+
minute: "2-digit",
|
|
85
|
+
second: "2-digit",
|
|
86
|
+
hour12: false
|
|
87
|
+
});
|
|
88
|
+
function formatTime(epochMs) {
|
|
89
|
+
return TIME_FORMATTER.format(new Date(epochMs));
|
|
90
|
+
}
|
|
91
|
+
function categoryLabel(category) {
|
|
92
|
+
return category.join("·");
|
|
93
|
+
}
|
|
94
|
+
function appendSample(samples, value) {
|
|
95
|
+
return [...samples, value].slice(-120);
|
|
96
|
+
}
|
|
97
|
+
var SPARK_WIDTH = 56;
|
|
98
|
+
var SPARK_HEIGHT = 14;
|
|
99
|
+
function Sparkline({ values }) {
|
|
100
|
+
if (values.length < 2) return null;
|
|
101
|
+
const width = SPARK_WIDTH;
|
|
102
|
+
const height = SPARK_HEIGHT;
|
|
103
|
+
const max = Math.max(...values, 1);
|
|
104
|
+
const step = width / 119;
|
|
105
|
+
const startX = width - (values.length - 1) * step;
|
|
106
|
+
const points = values.map((v, i) => {
|
|
107
|
+
const x = startX + i * step;
|
|
108
|
+
const y = 13 - v / max * 12;
|
|
109
|
+
return `${x.toFixed(1)},${y.toFixed(1)}`;
|
|
110
|
+
}).join(" ");
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
|
112
|
+
width,
|
|
113
|
+
height,
|
|
114
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
115
|
+
className: "shrink-0",
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", {
|
|
118
|
+
points,
|
|
119
|
+
fill: "none",
|
|
120
|
+
stroke: "currentColor",
|
|
121
|
+
strokeWidth: "1.5",
|
|
122
|
+
strokeLinejoin: "round",
|
|
123
|
+
strokeLinecap: "round",
|
|
124
|
+
className: "text-sand-300"
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function QuotaGauge({ usedPercent, threshold, blocked }) {
|
|
129
|
+
if (usedPercent === null) return null;
|
|
130
|
+
const clamped = Math.max(0, Math.min(usedPercent, 100));
|
|
131
|
+
const over = blocked || threshold !== null && usedPercent >= threshold;
|
|
132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
133
|
+
className: "inline-flex items-center gap-1",
|
|
134
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
135
|
+
className: "relative inline-block h-[4px] w-9 overflow-hidden rounded-full bg-sand-100",
|
|
136
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
137
|
+
className: clsx("absolute inset-y-0 left-0 rounded-full", over ? "bg-caution-500" : "bg-sand-400"),
|
|
138
|
+
style: { width: `${clamped}%` }
|
|
139
|
+
}), threshold !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
140
|
+
className: "absolute inset-y-0 w-px bg-sand-500",
|
|
141
|
+
style: { left: `${Math.min(threshold, 100)}%` }
|
|
142
|
+
})]
|
|
143
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
144
|
+
className: clsx("font-mono text-[10px] tabular-nums", over ? "font-semibold text-caution-500" : "text-sand-500"),
|
|
145
|
+
children: [Math.round(usedPercent), "%"]
|
|
146
|
+
})]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function MonitConsole({ search, onSearchChange }) {
|
|
150
|
+
const [mirror] = (0, import_react.useState)(() => new MonitLogMirror());
|
|
151
|
+
const [clock, setClock] = (0, import_react.useState)(() => Date.now());
|
|
152
|
+
const query = useQuery({
|
|
153
|
+
queryKey: ["Monit", "monitLogs"],
|
|
154
|
+
queryFn: () => mirror.poll(),
|
|
155
|
+
refetchInterval: POLL_INTERVAL_MS,
|
|
156
|
+
retry: false,
|
|
157
|
+
structuralSharing: false
|
|
158
|
+
});
|
|
159
|
+
const info = useQuery({
|
|
160
|
+
...MonitService.monitInfoQueryOptions(),
|
|
161
|
+
staleTime: Infinity
|
|
162
|
+
}).data;
|
|
163
|
+
const snapshot = query.data;
|
|
164
|
+
const items = snapshot?.items ?? NO_ITEMS;
|
|
165
|
+
const vitals = snapshot?.vitals;
|
|
166
|
+
const processStartedAt = snapshot?.processStartedAt;
|
|
167
|
+
const stats = useQuery({
|
|
168
|
+
...MonitService.monitStatsQueryOptions(),
|
|
169
|
+
refetchInterval: 3e4,
|
|
170
|
+
retry: false
|
|
171
|
+
}).data;
|
|
172
|
+
(0, import_react.useEffect)(() => {
|
|
173
|
+
const timer = window.setInterval(() => setClock(Date.now()), 2e3);
|
|
174
|
+
return () => window.clearInterval(timer);
|
|
175
|
+
}, []);
|
|
176
|
+
const isStale = items.length > 0 && (query.isRefetchError || query.dataUpdatedAt > 0 && clock - query.dataUpdatedAt > STALE_AFTER_MS);
|
|
177
|
+
const visible = (0, import_react.useMemo)(() => {
|
|
178
|
+
return items.filter((item) => {
|
|
179
|
+
if (item.kind !== "log") return true;
|
|
180
|
+
switch (search.level) {
|
|
181
|
+
case "warn": return (LEVEL_RANK.get(item.entry.level) ?? 2) >= 3;
|
|
182
|
+
case "error": return (LEVEL_RANK.get(item.entry.level) ?? 2) >= 4;
|
|
183
|
+
default: return true;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}, [items, search.level]);
|
|
187
|
+
const parentRef = (0, import_react.useRef)(null);
|
|
188
|
+
const [atEnd, setAtEnd] = (0, import_react.useState)(true);
|
|
189
|
+
const followRef = (0, import_react.useRef)(true);
|
|
190
|
+
const handleScroll = () => {
|
|
191
|
+
const element = parentRef.current;
|
|
192
|
+
if (!element) return;
|
|
193
|
+
const following = element.scrollHeight - element.scrollTop - element.clientHeight <= SCROLL_END_THRESHOLD_PX;
|
|
194
|
+
followRef.current = following;
|
|
195
|
+
setAtEnd(following);
|
|
196
|
+
};
|
|
197
|
+
const scrollToEnd = () => {
|
|
198
|
+
const element = parentRef.current;
|
|
199
|
+
if (element) element.scrollTop = element.scrollHeight;
|
|
200
|
+
};
|
|
201
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
202
|
+
const element = parentRef.current;
|
|
203
|
+
if (element && followRef.current && visible.length > 0) element.scrollTop = element.scrollHeight;
|
|
204
|
+
}, [visible]);
|
|
205
|
+
const hasFirstData = query.dataUpdatedAt > 0;
|
|
206
|
+
const firstLoadFailed = !hasFirstData && query.isError;
|
|
207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
208
|
+
className: "panel overflow-hidden",
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
211
|
+
className: "panel-header flex min-h-11 flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2 sm:px-5",
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
|
|
214
|
+
className: "text-[13px] font-semibold tracking-[-0.01em] text-sand-800",
|
|
215
|
+
children: "Server logs"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
218
|
+
className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-sand-700",
|
|
219
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: clsx("size-1.5 rounded-full", isStale || firstLoadFailed ? "bg-danger-400" : "bg-sienna-500 motion-safe:animate-pulse") }), firstLoadFailed ? "Disconnected" : isStale ? "Stale" : hasFirstData ? "Live" : "…"]
|
|
220
|
+
}),
|
|
221
|
+
processStartedAt !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
222
|
+
className: "text-[11px] text-sand-500",
|
|
223
|
+
children: ["ephemeral · resets on restart · since ", formatTime(processStartedAt)]
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
226
|
+
className: "ml-auto flex flex-wrap items-center gap-2",
|
|
227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
228
|
+
className: "segmented-control inline-flex",
|
|
229
|
+
role: "tablist",
|
|
230
|
+
"aria-label": "Log filter",
|
|
231
|
+
children: [
|
|
232
|
+
{
|
|
233
|
+
value: "all",
|
|
234
|
+
label: "All"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
value: "warn",
|
|
238
|
+
label: "Warn+"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
value: "error",
|
|
242
|
+
label: "Err+"
|
|
243
|
+
}
|
|
244
|
+
].map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
245
|
+
type: "button",
|
|
246
|
+
"data-active": search.level === option.value,
|
|
247
|
+
onClick: () => onSearchChange({
|
|
248
|
+
...search,
|
|
249
|
+
level: option.value
|
|
250
|
+
}),
|
|
251
|
+
className: "rounded-[6px] px-2.5 py-1 text-[11px] font-medium text-sand-500 transition-colors hover:text-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-300 data-[active=true]:text-sand-900",
|
|
252
|
+
children: option.label
|
|
253
|
+
}, option.value))
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
}),
|
|
258
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
259
|
+
className: "flex flex-wrap items-center gap-x-5 gap-y-1 border-b border-sand-100 bg-sand-50/60 px-4 py-2 text-[11px] text-sand-600 sm:px-5",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: ["server ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
262
|
+
className: "font-mono text-sand-800",
|
|
263
|
+
children: info.serverUrl
|
|
264
|
+
})] }),
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
266
|
+
"db",
|
|
267
|
+
" ",
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
269
|
+
className: "font-mono text-sand-800",
|
|
270
|
+
children: [
|
|
271
|
+
info.dbHost,
|
|
272
|
+
"/",
|
|
273
|
+
info.dbName
|
|
274
|
+
]
|
|
275
|
+
})
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
278
|
+
"openai transport",
|
|
279
|
+
" ",
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
281
|
+
className: "font-mono text-sand-800",
|
|
282
|
+
children: info.openai.transport
|
|
283
|
+
})
|
|
284
|
+
] }),
|
|
285
|
+
vitals && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
286
|
+
className: "inline-flex items-center gap-1.5",
|
|
287
|
+
children: [
|
|
288
|
+
"openai in-flight",
|
|
289
|
+
" ",
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
291
|
+
className: "font-mono text-sand-800",
|
|
292
|
+
children: vitals.openaiInFlight
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Sparkline, { values: snapshot?.inFlightSamples ?? [] })
|
|
295
|
+
]
|
|
296
|
+
}), vitals.anthropicTokenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
297
|
+
"anthropic running",
|
|
298
|
+
" ",
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
300
|
+
className: "font-mono text-sand-800",
|
|
301
|
+
children: vitals.anthropicInFlight
|
|
302
|
+
})
|
|
303
|
+
] })] }),
|
|
304
|
+
stats?.providers.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
305
|
+
className: "text-sand-500",
|
|
306
|
+
children: [
|
|
307
|
+
"1h ",
|
|
308
|
+
p.provider,
|
|
309
|
+
" ",
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
311
|
+
className: "font-mono text-sand-700",
|
|
312
|
+
children: p.requests
|
|
313
|
+
}),
|
|
314
|
+
" req",
|
|
315
|
+
p.errors > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
316
|
+
" · ",
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
318
|
+
className: "font-mono font-semibold text-caution-500",
|
|
319
|
+
children: p.errors
|
|
320
|
+
}),
|
|
321
|
+
" err"
|
|
322
|
+
] }),
|
|
323
|
+
" · hit ",
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
325
|
+
className: "font-mono text-sand-700",
|
|
326
|
+
children: cacheHitRate({
|
|
327
|
+
input_tokens: p.inputTokens,
|
|
328
|
+
cache_read_tokens: p.cacheReadTokens
|
|
329
|
+
})
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}, p.provider))
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
vitals && (vitals.openaiQuotaByToken.length > 0 || vitals.anthropicTokenNames.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
336
|
+
className: "space-y-1.5 border-b border-sand-100 px-4 py-2.5 sm:px-5",
|
|
337
|
+
children: [vitals.openaiQuotaByToken.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
338
|
+
className: "flex flex-wrap items-center gap-2",
|
|
339
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
340
|
+
className: "w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400",
|
|
341
|
+
children: "openai"
|
|
342
|
+
}), vitals.openaiQuotaByToken.map((quota) => {
|
|
343
|
+
const quotaTitle = quota.usedPercent === null ? "quota not sampled yet" : `quota ${Math.round(quota.usedPercent)}%${quota.threshold !== null ? ` / threshold ${quota.threshold}%` : ""}${quota.resetsAt ? ` · resets ${formatTime(quota.resetsAt)}` : ""}`;
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
345
|
+
title: `${quota.name} · ${quotaTitle}`,
|
|
346
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-sand-200 bg-white px-2 py-1",
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
349
|
+
className: "font-mono text-[11px] text-sand-600",
|
|
350
|
+
children: quota.name.split("/").pop()
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QuotaGauge, {
|
|
353
|
+
usedPercent: quota.usedPercent,
|
|
354
|
+
threshold: quota.threshold,
|
|
355
|
+
blocked: quota.blocked
|
|
356
|
+
}),
|
|
357
|
+
quota.blocked && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
358
|
+
className: "rounded-full bg-caution-500/10 px-1.5 py-0.5 text-[9px] font-semibold text-caution-500",
|
|
359
|
+
children: "quota"
|
|
360
|
+
})
|
|
361
|
+
]
|
|
362
|
+
}, quota.name);
|
|
363
|
+
})]
|
|
364
|
+
}), vitals.anthropicTokenNames.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
365
|
+
className: "flex flex-wrap items-center gap-2",
|
|
366
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
367
|
+
className: "w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400",
|
|
368
|
+
children: "anthropic"
|
|
369
|
+
}), vitals.anthropicTokenNames.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
370
|
+
title: name,
|
|
371
|
+
className: "inline-flex items-baseline rounded-md border border-sand-200 bg-white px-2 py-1 font-mono text-[11px] text-sand-600",
|
|
372
|
+
children: name.split("/").pop()
|
|
373
|
+
}, name))]
|
|
374
|
+
})]
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
377
|
+
className: "relative",
|
|
378
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
379
|
+
ref: parentRef,
|
|
380
|
+
onScroll: handleScroll,
|
|
381
|
+
role: "log",
|
|
382
|
+
"aria-label": "Server process logs",
|
|
383
|
+
tabIndex: 0,
|
|
384
|
+
className: "main-scroll h-[calc(100vh-232px)] min-h-[320px] overflow-y-auto bg-sand-900 px-4 py-3 font-mono text-[12px] leading-[1.6] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sienna-400",
|
|
385
|
+
children: firstLoadFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
386
|
+
className: "flex h-full flex-col items-center justify-center gap-3 text-sand-400",
|
|
387
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
388
|
+
className: "text-[12px]",
|
|
389
|
+
children: ["Could not reach the qgrid server — is it running?", query.error instanceof Error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
390
|
+
className: "block text-center text-[11px] text-sand-500",
|
|
391
|
+
children: query.error.message
|
|
392
|
+
})]
|
|
393
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
394
|
+
type: "button",
|
|
395
|
+
onClick: () => void query.refetch(),
|
|
396
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-sand-600 px-2.5 py-1.5 text-[11px] font-medium text-sand-300 transition-colors hover:bg-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400",
|
|
397
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ForwardRef, { className: "size-3" }), "Retry now"]
|
|
398
|
+
})]
|
|
399
|
+
}) : !hasFirstData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
400
|
+
className: "flex h-full items-center justify-center text-[12px] text-sand-500",
|
|
401
|
+
children: "Connecting to server logs…"
|
|
402
|
+
}) : visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
403
|
+
className: "flex h-full items-center justify-center text-[12px] text-sand-500",
|
|
404
|
+
children: items.length === 0 ? `No log lines yet — waiting for activity since ${processStartedAt !== void 0 ? formatTime(processStartedAt) : "startup"}.` : "No lines match the current filters."
|
|
405
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
406
|
+
className: "w-full",
|
|
407
|
+
children: visible.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
408
|
+
className: "[content-visibility:auto] [contain-intrinsic-size:auto_20px]",
|
|
409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogLine, { item })
|
|
410
|
+
}, item.key))
|
|
411
|
+
})
|
|
412
|
+
}), hasFirstData && !firstLoadFailed && !atEnd && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
413
|
+
type: "button",
|
|
414
|
+
onClick: scrollToEnd,
|
|
415
|
+
className: "absolute bottom-4 right-5 inline-flex items-center gap-1.5 rounded-full border border-sand-600 bg-sand-800/90 px-3 py-1.5 text-[11px] font-medium text-sand-200 shadow-lg backdrop-blur transition-colors hover:bg-sand-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400",
|
|
416
|
+
children: "↓ Jump to live"
|
|
417
|
+
})]
|
|
418
|
+
})
|
|
419
|
+
]
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
var LogLine = (0, import_react.memo)(function LogLine({ item }) {
|
|
423
|
+
if (item.kind === "restart") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
424
|
+
className: "py-1 text-center text-[11px] text-caution-400",
|
|
425
|
+
children: [
|
|
426
|
+
"── process restarted · ",
|
|
427
|
+
formatTime(item.processStartedAt),
|
|
428
|
+
" ──"
|
|
429
|
+
]
|
|
430
|
+
});
|
|
431
|
+
if (item.kind === "dropped") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
432
|
+
className: "py-1 text-center text-[11px] italic text-sand-500",
|
|
433
|
+
children: [
|
|
434
|
+
"── ",
|
|
435
|
+
item.count,
|
|
436
|
+
" lines dropped (buffer overflow) ──"
|
|
437
|
+
]
|
|
438
|
+
});
|
|
439
|
+
const { entry } = item;
|
|
440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
441
|
+
className: "whitespace-pre-wrap break-words text-sand-200",
|
|
442
|
+
children: [
|
|
443
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
444
|
+
className: "text-sand-500",
|
|
445
|
+
children: formatTime(entry.timestamp)
|
|
446
|
+
}),
|
|
447
|
+
" ",
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
449
|
+
className: clsx("font-semibold", entry.level === "fatal" || entry.level === "error" ? "text-danger-400" : entry.level === "warning" ? "text-caution-400" : "text-sand-400"),
|
|
450
|
+
children: LEVEL_LABEL.get(entry.level) ?? entry.level.slice(0, 3).toUpperCase()
|
|
451
|
+
}),
|
|
452
|
+
" ",
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
454
|
+
className: "text-sienna-300",
|
|
455
|
+
children: categoryLabel(entry.category)
|
|
456
|
+
}),
|
|
457
|
+
" ",
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: entry.text })
|
|
459
|
+
]
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region src/routes/monit.tsx?tsr-split=component
|
|
464
|
+
function MonitPage() {
|
|
465
|
+
const search = Route.useSearch();
|
|
466
|
+
const navigate = Route.useNavigate();
|
|
467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
468
|
+
className: "max-w-[100rem] mx-auto",
|
|
469
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonitConsole, {
|
|
470
|
+
search,
|
|
471
|
+
onSearchChange: (next) => navigate({
|
|
472
|
+
search: next,
|
|
473
|
+
replace: true
|
|
474
|
+
})
|
|
475
|
+
})
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
//#endregion
|
|
479
|
+
export { MonitPage as component };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { J as require_react, Q as __toESM, q as require_jsx_runtime } from "./services.generated-CqS8DCjT.js";
|
|
2
|
+
//#region ~icons/lucide/plus.jsx
|
|
3
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
4
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
5
|
+
var lucidePlus = ({ title, titleId, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
width: "1.2em",
|
|
8
|
+
height: "1.2em",
|
|
9
|
+
ref,
|
|
10
|
+
"aria-labelledby": titleId,
|
|
11
|
+
...props,
|
|
12
|
+
children: [title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", {
|
|
13
|
+
id: titleId,
|
|
14
|
+
children: title
|
|
15
|
+
}) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
strokeWidth: 2,
|
|
21
|
+
d: "M5 12h14m-7-7v14"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
var ForwardRef = (0, import_react.forwardRef)(lucidePlus);
|
|
25
|
+
//#endregion
|
|
26
|
+
export { ForwardRef as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { J as require_react, Q as __toESM, q as require_jsx_runtime } from "./services.generated-CqS8DCjT.js";
|
|
2
|
+
//#region ~icons/lucide/refresh-cw.jsx
|
|
3
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
4
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
5
|
+
var lucideRefreshCw = ({ title, titleId, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
width: "1.2em",
|
|
8
|
+
height: "1.2em",
|
|
9
|
+
ref,
|
|
10
|
+
"aria-labelledby": titleId,
|
|
11
|
+
...props,
|
|
12
|
+
children: [title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", {
|
|
13
|
+
id: titleId,
|
|
14
|
+
children: title
|
|
15
|
+
}) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
strokeWidth: 2,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 16H3v5" })
|
|
25
|
+
]
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
var ForwardRef = (0, import_react.forwardRef)(lucideRefreshCw);
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ForwardRef as t };
|
package/bundle/web-dist/server/assets/{request-model-Cp6h5EuP.js → request-model-DIuPZZwu.js}
RENAMED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { J as require_react, Q as __toESM, q as require_jsx_runtime } from "./services.generated-CqS8DCjT.js";
|
|
2
|
+
//#region ~icons/lucide/zap.jsx
|
|
3
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
3
4
|
var import_jsx_runtime = require_jsx_runtime();
|
|
4
|
-
var lucideZap = (props) => /* @__PURE__ */ (0, import_jsx_runtime.
|
|
5
|
+
var lucideZap = ({ title, titleId, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
5
6
|
viewBox: "0 0 24 24",
|
|
6
7
|
width: "1.2em",
|
|
7
8
|
height: "1.2em",
|
|
9
|
+
ref,
|
|
10
|
+
"aria-labelledby": titleId,
|
|
8
11
|
...props,
|
|
9
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
12
|
+
children: [title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", {
|
|
13
|
+
id: titleId,
|
|
14
|
+
children: title
|
|
15
|
+
}) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
10
16
|
fill: "none",
|
|
11
17
|
stroke: "currentColor",
|
|
12
18
|
strokeLinecap: "round",
|
|
13
19
|
strokeLinejoin: "round",
|
|
14
20
|
strokeWidth: 2,
|
|
15
|
-
d: "
|
|
16
|
-
})
|
|
21
|
+
d: "M15.914 4a1.5 1.5 0 0 0-2.474-1.561l-9 9A1.5 1.5 0 0 0 5.5 14h4.002a.5.5 0 0 1 .471.666L8.086 20a1.5 1.5 0 0 0 2.475 1.56l9-9A1.5 1.5 0 0 0 18.5 10h-3.997a.5.5 0 0 1-.472-.667z"
|
|
22
|
+
})]
|
|
17
23
|
});
|
|
24
|
+
var ForwardRef = (0, import_react.forwardRef)(lucideZap);
|
|
18
25
|
//#endregion
|
|
19
26
|
//#region src/lib/request-model.ts
|
|
20
27
|
function requestModelDisplay({ status, requestedModel, servedModel, imageCostMethod }) {
|
|
@@ -28,4 +35,4 @@ function requestModelDisplay({ status, requestedModel, servedModel, imageCostMet
|
|
|
28
35
|
return { label: requestedModel && servedModel && requestedModel !== servedModel ? `${requestedModel} → ${servedModel}` : servedModel ?? requestedModel ?? "—" };
|
|
29
36
|
}
|
|
30
37
|
//#endregion
|
|
31
|
-
export {
|
|
38
|
+
export { ForwardRef as n, requestModelDisplay as t };
|