@cartanova/qgrid-cli 2.9.10 → 2.10.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.
Files changed (74) hide show
  1. package/bundle/dist/application/qgrid/conv-routing.js +4 -14
  2. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +10 -5
  3. package/bundle/dist/application/qgrid/qgrid.frame.js +7 -2
  4. package/bundle/dist/application/qgrid/qgrid.types.js +3 -1
  5. package/bundle/dist/application/request-log/request-log.model.js +14 -12
  6. package/bundle/dist/application/request-log-step/request-log-step.model.js +7 -11
  7. package/bundle/dist/application/setting/setting.model.js +13 -27
  8. package/bundle/dist/application/token/token.model.js +52 -47
  9. package/bundle/dist/server-error-handler.js +1 -1
  10. package/bundle/dist/sonamu.config.js +3 -15
  11. package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +4 -2
  12. package/bundle/dist/utils/providers/common/model-cost.js +10 -3
  13. package/bundle/src/application/qgrid/conv-routing.test.ts +0 -32
  14. package/bundle/src/application/qgrid/conv-routing.ts +7 -26
  15. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +65 -121
  16. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +12 -6
  17. package/bundle/src/application/qgrid/qgrid.frame.test.ts +13 -26
  18. package/bundle/src/application/qgrid/qgrid.frame.ts +9 -3
  19. package/bundle/src/application/qgrid/qgrid.types.ts +2 -0
  20. package/bundle/src/application/request-log/request-log.model.test.ts +37 -2
  21. package/bundle/src/application/request-log/request-log.model.ts +14 -7
  22. package/bundle/src/application/request-log-step/request-log-step.model.ts +3 -15
  23. package/bundle/src/application/setting/setting.constant.test.ts +1 -13
  24. package/bundle/src/application/setting/setting.model.ts +10 -26
  25. package/bundle/src/application/setting/setting.persistence.test.ts +27 -0
  26. package/bundle/src/application/token/token.model.test.ts +86 -19
  27. package/bundle/src/application/token/token.model.ts +59 -44
  28. package/bundle/src/server-error-handler.ts +1 -2
  29. package/bundle/src/sonamu.config.ts +4 -31
  30. package/bundle/src/utils/providers/anthropic/anthropic-constants.test.ts +6 -1
  31. package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +5 -2
  32. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.test.ts +1 -26
  33. package/bundle/src/utils/providers/common/model-cost.test.ts +22 -1
  34. package/bundle/src/utils/providers/common/model-cost.ts +22 -5
  35. package/bundle/src/utils/providers/common/provider-dispatcher.ts +4 -11
  36. package/bundle/web-dist/client/assets/index-Cq4_ExLO.js +106 -0
  37. package/bundle/web-dist/client/assets/logs-kg1KOMBk.js +1 -0
  38. package/bundle/web-dist/client/assets/{monit-C6ZRFTQr.js → monit-DmtHTmSM.js} +1 -1
  39. package/bundle/web-dist/client/assets/{routes-CrMRMQvC.js → routes-CXotE1OF.js} +1 -1
  40. package/bundle/web-dist/client/assets/services.generated-Cbvg2sGQ.js +51 -0
  41. package/bundle/web-dist/client/assets/{settings-BVhU4Oul.js → settings-CfJDz4AC.js} +1 -1
  42. package/bundle/web-dist/client/assets/show-gBpWK4z2.js +2 -0
  43. package/bundle/web-dist/client/assets/{tokens-DliSEDiF.js → tokens-CbFJjIyC.js} +1 -1
  44. package/bundle/web-dist/client/assets/use-oauth-login-flow-jJo7GV3r.js +1 -0
  45. package/bundle/web-dist/client/assets/{use-update-token-mutation-Dkv_HG-C.js → use-update-token-mutation-D-Y8OySK.js} +1 -1
  46. package/bundle/web-dist/client/index.html +2 -2
  47. package/bundle/web-dist/server/assets/{lazyRouteComponent-DyizoQKi.js → lazyRouteComponent-Bj1cPq6x.js} +2 -2
  48. package/bundle/web-dist/server/assets/{logs-DO8zBdBR.js → logs-DMlOXcDS.js} +20 -12
  49. package/bundle/web-dist/server/assets/{monit-COH4MckI.js → monit-Dg1wZCdx.js} +3 -3
  50. package/bundle/web-dist/server/assets/{plus-C1D8z9o0.js → plus-DVobMrag.js} +1 -1
  51. package/bundle/web-dist/server/assets/{react-dom-PfWvArTX.js → react-dom-BjR1Iaz8.js} +1 -1
  52. package/bundle/web-dist/server/assets/{routes-Btja-741.js → routes-C7lB2Q85.js} +5 -5
  53. package/bundle/web-dist/server/assets/{services.generated-BsKOUSXl.js → services.generated-BM4X3Ecj.js} +102 -6
  54. package/bundle/web-dist/server/assets/{settings-DPcWGvy-.js → settings-BaIBt_Vs.js} +4 -4
  55. package/bundle/web-dist/server/assets/{show-CMXbb3TJ.js → show-CDxGr4rS.js} +9 -8
  56. package/bundle/web-dist/server/assets/{tokens-DAUmTrgO.js → tokens-DJlfeGcx.js} +5 -5
  57. package/bundle/web-dist/server/assets/{use-oauth-login-flow-GsGwqefs.js → use-oauth-login-flow-DYKnG4A2.js} +32 -15
  58. package/bundle/web-dist/server/assets/{use-update-token-mutation-RujWERvj.js → use-update-token-mutation-DqGMopII.js} +1 -1
  59. package/bundle/web-dist/server/entry-server.generated.js +381 -21
  60. package/package.json +1 -1
  61. package/skills/qgrid/SKILL.md +6 -0
  62. package/skills/qgrid/references/ai-sdk-provider-contract.md +8 -2
  63. package/skills/qgrid/references/anthropic-claude-code-runtime.md +3 -2
  64. package/skills/qgrid/references/request-log-run-lifecycle.md +4 -0
  65. package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
  66. package/skills/qgrid/references/token-auth-quota-lifecycle.md +2 -0
  67. package/skills/qgrid/references/verification-and-debugging.md +24 -13
  68. package/bundle/dist/utils/providers/common/token-picker.js +0 -14
  69. package/bundle/src/utils/providers/common/token-picker.ts +0 -18
  70. package/bundle/web-dist/client/assets/index-DJpa8UaG.js +0 -106
  71. package/bundle/web-dist/client/assets/logs-COwHodGU.js +0 -1
  72. package/bundle/web-dist/client/assets/services.generated-Bg2XkD-D.js +0 -51
  73. package/bundle/web-dist/client/assets/show-DA-1k3Mt.js +0 -2
  74. package/bundle/web-dist/client/assets/use-oauth-login-flow-C0qa-nOp.js +0 -1
@@ -1,6 +1,6 @@
1
- import { H as __toESM, S as require_react, i as RequestLogStepService, r as RequestLogService, v as useQuery, x as require_jsx_runtime, z as __commonJSMin } from "./services.generated-BsKOUSXl.js";
2
- import { a as Link } from "./lazyRouteComponent-DyizoQKi.js";
3
- import { c as remarkGfm, l as Markdown, o as lucideX, t as Route } from "../entry-server.generated.js";
1
+ import { A as require_jsx_runtime, D as useQuery, J as __commonJSMin, Z as __toESM, i as RequestLogStepService, j as require_react, l as isSonamuError, r as RequestLogService } from "./services.generated-BM4X3Ecj.js";
2
+ import { a as Link } from "./lazyRouteComponent-Bj1cPq6x.js";
3
+ import { c as lucideX, d as Markdown, t as Route, u as remarkGfm } from "../entry-server.generated.js";
4
4
  import { n as formatMicroUsd, t as cacheHitRate } from "./cost-CSH_t17I.js";
5
5
  import { t as requestModelDisplay } from "./request-model-DXclJfdP.js";
6
6
  //#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/extends.js
@@ -2867,8 +2867,8 @@ function ResponseTypePanel({ id }) {
2867
2867
  });
2868
2868
  }
2869
2869
  function RequestDetail({ id }) {
2870
- const { data, isLoading } = RequestLogService.useRequestLog("A", id);
2871
- const { data: stepsData, isLoading: isStepsLoading } = RequestLogStepService.useRequestLogSteps("T", {
2870
+ const { data, isLoading, error, isError } = RequestLogService.useRequestLog("A", id);
2871
+ const { data: stepsData, isLoading: isStepsLoading, isError: isStepsError } = RequestLogStepService.useRequestLogSteps("T", {
2872
2872
  request_log_id: id,
2873
2873
  num: 0,
2874
2874
  page: 1,
@@ -2883,15 +2883,16 @@ function RequestDetail({ id }) {
2883
2883
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-32 panel animate-pulse" })
2884
2884
  ]
2885
2885
  });
2886
- if (!data) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2886
+ if (isError || isStepsError || !data) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2887
2887
  className: "max-w-6xl mx-auto",
2888
2888
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
2889
2889
  to: "/logs",
2890
2890
  className: "flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4",
2891
2891
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideArrowLeft, { className: "size-3.5" }), "Back to Logs"]
2892
2892
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2893
- className: "text-sand-400 text-sm",
2894
- children: "Request not found."
2893
+ role: "alert",
2894
+ className: "text-danger-500 text-sm",
2895
+ children: isError ? isSonamuError(error) && error.code === 404 ? "Request not found." : "Failed to load request." : isStepsError ? "Failed to load request steps." : "Request not found."
2895
2896
  })]
2896
2897
  });
2897
2898
  const toolCalls = stepTree.flatMap((step) => step.toolCalls);
@@ -1,8 +1,8 @@
1
- import { H as __toESM, S as require_react, b as useQueryClient, n as QgridService, o as TokenService, x as require_jsx_runtime } from "./services.generated-BsKOUSXl.js";
2
- import { i as Q, u as lucideKeyRound } from "../entry-server.generated.js";
3
- import { t as useUpdateTokenMutation } from "./use-update-token-mutation-RujWERvj.js";
4
- import { n as OAuthCodeEntry, t as useOAuthLoginFlow } from "./use-oauth-login-flow-GsGwqefs.js";
5
- import { t as lucidePlus } from "./plus-C1D8z9o0.js";
1
+ import { A as require_jsx_runtime, Z as __toESM, j as require_react, k as useQueryClient, n as QgridService, o as TokenService } from "./services.generated-BM4X3Ecj.js";
2
+ import { f as lucideKeyRound, o as Q } from "../entry-server.generated.js";
3
+ import { t as useUpdateTokenMutation } from "./use-update-token-mutation-DqGMopII.js";
4
+ import { n as OAuthCodeEntry, t as useOAuthLoginFlow } from "./use-oauth-login-flow-DYKnG4A2.js";
5
+ import { t as lucidePlus } from "./plus-DVobMrag.js";
6
6
  //#region src/components/qgrid/AddTokenModal.tsx
7
7
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
8
  var import_jsx_runtime = require_jsx_runtime();
@@ -1,5 +1,5 @@
1
- import { H as __toESM, S as require_react, b as useQueryClient, n as QgridService, x as require_jsx_runtime } from "./services.generated-BsKOUSXl.js";
2
- import { i as Q } from "../entry-server.generated.js";
1
+ import { A as require_jsx_runtime, Z as __toESM, j as require_react, k as useQueryClient, n as QgridService, o as TokenService } from "./services.generated-BM4X3Ecj.js";
2
+ import { o as Q } from "../entry-server.generated.js";
3
3
  //#region src/components/qgrid/OAuthCodeEntry.tsx
4
4
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
5
  var import_jsx_runtime = require_jsx_runtime();
@@ -53,14 +53,12 @@ function OAuthCodeEntry({ provider, isPending, isError, onSubmit, onRestart }) {
53
53
  //#region src/components/qgrid/use-oauth-login-flow.ts
54
54
  var OPENAI_POLL_INTERVAL_MS = 3e3;
55
55
  var OPENAI_POLL_TIMEOUT_MS = 3e5;
56
- /** 캐시에 적재된 토큰 행 수. 폴링 조기 종료 판정에만 쓰는 근사치다. */
57
- function countTokens(queryClient) {
58
- let total = 0;
59
- for (const query of queryClient.getQueryCache().findAll({ queryKey: ["Token"] })) {
60
- const rows = query.state.data?.rows;
61
- if (Array.isArray(rows)) total = Math.max(total, rows.length);
62
- }
63
- return total;
56
+ async function getTokenIds(provider, name) {
57
+ const { rows } = await TokenService.getTokens("A", {
58
+ num: 0,
59
+ queryMode: "list"
60
+ });
61
+ return new Set(rows.filter((token) => token.provider === provider && token.name === name).map((token) => token.id));
64
62
  }
65
63
  /**
66
64
  * provider별 OAuth 로그인 시작과 코드 제출을 한 곳에 모은다.
@@ -75,7 +73,9 @@ function useOAuthLoginFlow() {
75
73
  const oauthStartOpenAIMutation = QgridService.useOauthStartOpenAIMutation();
76
74
  const oauthCompleteMutation = QgridService.useOauthCompleteMutation();
77
75
  const pollTimers = (0, import_react.useRef)({});
76
+ const attemptRef = (0, import_react.useRef)(0);
78
77
  const stopPolling = () => {
78
+ attemptRef.current += 1;
79
79
  if (pollTimers.current.interval !== void 0) clearInterval(pollTimers.current.interval);
80
80
  if (pollTimers.current.timeout !== void 0) clearTimeout(pollTimers.current.timeout);
81
81
  pollTimers.current = {};
@@ -85,11 +85,22 @@ function useOAuthLoginFlow() {
85
85
  const start = async (provider, name) => {
86
86
  const trimmed = name.trim();
87
87
  if (!trimmed) return;
88
+ stopPolling();
89
+ const attempt = attemptRef.current;
88
90
  const popup = window.open("about:blank", "_blank");
89
91
  setLoadingProvider(provider);
90
92
  try {
91
93
  if (provider === "openai") {
94
+ const before = await getTokenIds(provider, trimmed);
95
+ if (attempt !== attemptRef.current) {
96
+ popup?.close();
97
+ return;
98
+ }
92
99
  const { authUrl, mode } = await oauthStartOpenAIMutation.mutateAsync({ name: trimmed });
100
+ if (attempt !== attemptRef.current) {
101
+ popup?.close();
102
+ return;
103
+ }
93
104
  if (popup) popup.location.href = authUrl;
94
105
  else window.open(authUrl, "_blank");
95
106
  if (mode === "code") {
@@ -97,23 +108,28 @@ function useOAuthLoginFlow() {
97
108
  setLoadingProvider(null);
98
109
  return;
99
110
  }
100
- const before = countTokens(queryClient);
101
- stopPolling();
102
111
  pollTimers.current.interval = window.setInterval(() => {
103
- invalidateTokens().then(() => {
104
- if (countTokens(queryClient) > before) {
112
+ getTokenIds(provider, trimmed).then((ids) => {
113
+ if (attempt !== attemptRef.current) return;
114
+ if ([...ids].some((id) => !before.has(id))) {
105
115
  stopPolling();
106
116
  setLoadingProvider(null);
117
+ invalidateTokens();
107
118
  }
108
- });
119
+ }).catch(() => {});
109
120
  }, OPENAI_POLL_INTERVAL_MS);
110
121
  pollTimers.current.timeout = window.setTimeout(() => {
122
+ if (attempt !== attemptRef.current) return;
111
123
  stopPolling();
112
124
  setLoadingProvider(null);
113
125
  }, OPENAI_POLL_TIMEOUT_MS);
114
126
  return;
115
127
  }
116
128
  const { authUrl, mode } = await oauthStartMutation.mutateAsync({ name: trimmed });
129
+ if (attempt !== attemptRef.current) {
130
+ popup?.close();
131
+ return;
132
+ }
117
133
  if (mode === "code") {
118
134
  if (popup) popup.location.href = authUrl;
119
135
  else window.open(authUrl, "_blank");
@@ -125,6 +141,7 @@ function useOAuthLoginFlow() {
125
141
  }
126
142
  } catch (e) {
127
143
  popup?.close();
144
+ if (attempt !== attemptRef.current) return;
128
145
  console.error("OAuth start failed:", e);
129
146
  setLoadingProvider(null);
130
147
  }
@@ -1,4 +1,4 @@
1
- import { _ as useMutation, n as QgridService } from "./services.generated-BsKOUSXl.js";
1
+ import { E as useMutation, n as QgridService } from "./services.generated-BM4X3Ecj.js";
2
2
  //#region src/services/token/use-update-token-mutation.ts
3
3
  function useUpdateTokenMutation() {
4
4
  return useMutation({ mutationFn: ({ id, name, quotaThreshold, weight, keepaliveEnabled }) => QgridService.updateToken(id, name, quotaThreshold, weight, keepaliveEnabled) });
@@ -1,6 +1,6 @@
1
- import { A as hashQueryKeyByOptions, B as __exportAll, C as Mutation, D as notifyManager, E as onlineManager, F as resolveStaleTime, H as __toESM, I as skipToken, L as focusManager, M as matchQuery, N as noop$1, O as functionalUpdate, P as partialMatchKey, R as Subscribable, S as require_react, T as Query, V as __require, d as setLocale, f as _enum, h as string$2, j as matchMutation, k as hashKey, l as SD, m as object, n as QgridService, o as TokenService, p as number$1, s as fetch$1, u as SUPPORTED_LOCALES, w as infiniteQueryBehavior, x as require_jsx_runtime, y as QueryClientProvider, z as __commonJSMin } from "./assets/services.generated-BsKOUSXl.js";
2
- import { A as decodePath, C as findRouteMatch, D as createLRUCache, E as processRouteTree, F as last, I as replaceEqualDeep, M as findLast, N as functionalUpdate$1, O as invariant, P as isPromise, S as findFlatMatch, T as processRouteMasks, _ as interpolatePath, a as Link$1, b as trimPath, c as usePrevious$1, d as useRouter, f as getRouterContext, g as cleanPath, h as isNotFound, i as createRootRouteWithContext, j as deepEqual$2, k as createControlledPromise, l as matchContext, m as rootRouteId, n as createFileRoute, p as warning, r as createLazyFileRoute, s as useLayoutEffect$3, t as lazyRouteComponent, u as useRouterState, v as joinPaths, w as findSingleMatch, x as trimPathRight, y as resolvePath } from "./assets/lazyRouteComponent-DyizoQKi.js";
3
- import { n as require_shim, t as require_react_dom } from "./assets/react-dom-PfWvArTX.js";
1
+ import { A as require_jsx_runtime, B as matchMutation, C as union, F as onlineManager, G as skipToken, H as noop$1, I as notifyManager, J as __commonJSMin, K as focusManager, L as functionalUpdate, M as Mutation, N as infiniteQueryBehavior, O as QueryClientProvider, P as Query, R as hashKey, S as string$2, U as partialMatchKey, V as matchQuery, W as resolveStaleTime, X as __require, Y as __exportAll, Z as __toESM, _ as custom, b as number$1, c as fetch$1, d as SD, f as SUPPORTED_LOCALES, g as boolean$1, h as array, j as require_react, m as _enum, n as QgridService, o as TokenService, p as setLocale, q as Subscribable, s as SonamuQueryMode, u as zArrayable, v as date, w as unknown, x as object, y as int, z as hashQueryKeyByOptions } from "./assets/services.generated-BM4X3Ecj.js";
2
+ import { A as decodePath, C as findRouteMatch, D as createLRUCache, E as processRouteTree, F as last, I as replaceEqualDeep, M as findLast, N as functionalUpdate$1, O as invariant, P as isPromise, S as findFlatMatch, T as processRouteMasks, _ as interpolatePath, a as Link$1, b as trimPath, c as usePrevious$1, d as useRouter, f as getRouterContext, g as cleanPath, h as isNotFound, i as createRootRouteWithContext, j as deepEqual$2, k as createControlledPromise, l as matchContext, m as rootRouteId, n as createFileRoute, p as warning, r as createLazyFileRoute, s as useLayoutEffect$3, t as lazyRouteComponent, u as useRouterState, v as joinPaths, w as findSingleMatch, x as trimPathRight, y as resolvePath } from "./assets/lazyRouteComponent-Bj1cPq6x.js";
3
+ import { n as require_shim, t as require_react_dom } from "./assets/react-dom-BjR1Iaz8.js";
4
4
  import minpath from "node:path";
5
5
  import minproc from "node:process";
6
6
  import { fileURLToPath as urlToPath } from "node:url";
@@ -46269,6 +46269,7 @@ var MODEL_PRESET_GROUPS = [{
46269
46269
  "anthropic/claude-opus-5",
46270
46270
  "anthropic/claude-sonnet-5-5",
46271
46271
  "anthropic/claude-sonnet-5",
46272
+ "anthropic/claude-haiku-5-5",
46272
46273
  "anthropic/claude-opus-4-8",
46273
46274
  "anthropic/claude-opus-4-7",
46274
46275
  "anthropic/claude-opus-4-6",
@@ -46393,7 +46394,7 @@ function ChatWidget() {
46393
46394
  tokenName: data.tokenName,
46394
46395
  durationMs: data.durationMs,
46395
46396
  costUsd: data.costUsd,
46396
- requestLogId: data.runContext?.requestLogId,
46397
+ requestLogId: data.requestLogId,
46397
46398
  fallback: (data.modelFallbacks?.length ?? 0) > 0
46398
46399
  }
46399
46400
  }));
@@ -46492,7 +46493,7 @@ function ChatWidget() {
46492
46493
  tokenName: result.tokenName,
46493
46494
  durationMs: result.durationMs,
46494
46495
  costUsd: result.costUsd,
46495
- requestLogId: result.runContext?.requestLogId,
46496
+ requestLogId: result.requestLogId,
46496
46497
  fallback: (result.modelFallbacks?.length ?? 0) > 0
46497
46498
  }
46498
46499
  }));
@@ -46874,7 +46875,7 @@ function ChatWidget() {
46874
46875
  }
46875
46876
  //#endregion
46876
46877
  //#region src/components/Sidebar.tsx
46877
- var qgridVersion = "2.9.10";
46878
+ var qgridVersion = "2.10.1";
46878
46879
  function Sidebar({ className }) {
46879
46880
  const pathname = useRouterState({ select: (s) => s.location.pathname });
46880
46881
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", {
@@ -68697,15 +68698,9 @@ var Lo = import_react.forwardRef(({ className: t, children: n, variant: r, size:
68697
68698
  Lo.displayName = Item2.displayName;
68698
68699
  //#endregion
68699
68700
  //#region src/contexts/sonamu-provider.tsx
68700
- var uploader = async (files) => {
68701
- if (files.length === 0) return [];
68702
- console.log("File upload not implemented yet");
68703
- return [];
68704
- };
68705
68701
  var sd = (key) => SD(key);
68706
68702
  function SonamuProvider({ children }) {
68707
68703
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(qt, {
68708
- uploader,
68709
68704
  SD: sd,
68710
68705
  children
68711
68706
  });
@@ -68758,15 +68753,15 @@ function RootComponent() {
68758
68753
  }
68759
68754
  //#endregion
68760
68755
  //#region src/routes/tokens.tsx
68761
- var $$splitComponentImporter$5 = () => import("./assets/tokens-DAUmTrgO.js");
68756
+ var $$splitComponentImporter$5 = () => import("./assets/tokens-DJlfeGcx.js");
68762
68757
  var Route$5 = createFileRoute("/tokens")({ component: lazyRouteComponent($$splitComponentImporter$5, "component") });
68763
68758
  //#endregion
68764
68759
  //#region src/routes/settings.tsx
68765
- var $$splitComponentImporter$4 = () => import("./assets/settings-DPcWGvy-.js");
68760
+ var $$splitComponentImporter$4 = () => import("./assets/settings-BaIBt_Vs.js");
68766
68761
  var Route$4 = createFileRoute("/settings")({ component: lazyRouteComponent($$splitComponentImporter$4, "component") });
68767
68762
  //#endregion
68768
68763
  //#region src/routes/monit.tsx
68769
- var $$splitComponentImporter$3 = () => import("./assets/monit-COH4MckI.js");
68764
+ var $$splitComponentImporter$3 = () => import("./assets/monit-Dg1wZCdx.js");
68770
68765
  var monitSearchSchema = object({ level: _enum([
68771
68766
  "all",
68772
68767
  "warn",
@@ -68777,14 +68772,379 @@ var Route$3 = createFileRoute("/monit")({
68777
68772
  component: lazyRouteComponent($$splitComponentImporter$3, "component")
68778
68773
  });
68779
68774
  //#endregion
68775
+ //#region src/services/sonamu.generated.ts
68776
+ /**
68777
+ * @generated
68778
+ * API에서 동기화된 파일입니다. 직접 수정하지 마세요.
68779
+ */
68780
+ var HistoryItems = array(object({
68781
+ type: string$2(),
68782
+ role: string$2().optional(),
68783
+ content: unknown().optional(),
68784
+ name: string$2().optional(),
68785
+ arguments: string$2().optional(),
68786
+ call_id: string$2().optional(),
68787
+ output: string$2().optional()
68788
+ }));
68789
+ var TokenCredentials = union([object({
68790
+ accessToken: string$2(),
68791
+ refreshToken: string$2(),
68792
+ expiresAt: number$1(),
68793
+ accountUuid: string$2()
68794
+ }), object({
68795
+ accessToken: string$2(),
68796
+ refreshToken: string$2(),
68797
+ idToken: string$2().optional(),
68798
+ accessTokenExpiresAt: number$1(),
68799
+ idTokenExpiresAt: number$1().optional(),
68800
+ accountId: string$2(),
68801
+ planType: string$2().optional()
68802
+ })]);
68803
+ var ToolDefinitions = array(object({
68804
+ name: string$2(),
68805
+ description: string$2().optional(),
68806
+ inputSchema: unknown()
68807
+ }));
68808
+ var RequestLogOrderBy = _enum([
68809
+ "id-desc",
68810
+ "id-asc",
68811
+ "created_at-desc",
68812
+ "created_at-asc",
68813
+ "ttft_ms-desc",
68814
+ "ttft_ms-asc",
68815
+ "duration_ms-desc",
68816
+ "duration_ms-asc",
68817
+ "input_tokens-desc",
68818
+ "input_tokens-asc",
68819
+ "output_tokens-desc",
68820
+ "output_tokens-asc",
68821
+ "cache_read_tokens-desc",
68822
+ "cache_read_tokens-asc",
68823
+ "cache_creation_tokens-desc",
68824
+ "cache_creation_tokens-asc",
68825
+ "cost_usd-desc",
68826
+ "cost_usd-asc"
68827
+ ]).describe("RequestLogOrderBy");
68828
+ var RequestLogSearchField = _enum([
68829
+ "id",
68830
+ "token_name",
68831
+ "user_prompt"
68832
+ ]).describe("RequestLogSearchField");
68833
+ var RequestLogStatus = _enum([
68834
+ "running",
68835
+ "succeeded",
68836
+ "error",
68837
+ "aborted"
68838
+ ]).describe("RequestLogStatus");
68839
+ var RequestLogStepType = _enum(["generate", "tool_call"]).describe("RequestLogStepType");
68840
+ var RequestLogStepOrderBy = _enum(["id-asc"]).describe("RequestLogStepOrderBy");
68841
+ var RequestLogStepSearchField = _enum(["id"]).describe("RequestLogStepSearchField");
68842
+ var SettingOrderBy = _enum(["key-asc"]).describe("SettingOrderBy");
68843
+ var SettingSearchField = _enum(["key"]).describe("SettingSearchField");
68844
+ var TokenOrderBy = _enum(["id-desc", "ord-asc"]).describe("TokenOrderBy");
68845
+ var TokenSearchField = _enum(["id", "name"]).describe("TokenSearchField");
68846
+ object({
68847
+ id: int(),
68848
+ created_at: date(),
68849
+ token_name: string$2().max(100).nullable(),
68850
+ project_name: string$2().max(50).nullable(),
68851
+ model_name: string$2().max(255).nullable(),
68852
+ requested_model_name: string$2().max(255).nullable(),
68853
+ fallback_count: int().nullable(),
68854
+ user_prompt: string$2().nullable(),
68855
+ system_prompt: string$2().nullable(),
68856
+ response: string$2(),
68857
+ input_tokens: int(),
68858
+ output_tokens: int(),
68859
+ cache_read_tokens: int(),
68860
+ cache_creation_tokens: int(),
68861
+ cache_creation_5m_tokens: int().nullable(),
68862
+ cache_creation_1h_tokens: int().nullable(),
68863
+ duration_ms: int(),
68864
+ ttft_ms: int(),
68865
+ cost_usd: int().nullable(),
68866
+ cost_source: string$2().max(20).nullable(),
68867
+ image_cost_usd: int().nullable(),
68868
+ image_cost_method: string$2().max(100).nullable(),
68869
+ effort: string$2().max(10).nullable(),
68870
+ history: HistoryItems.nullable(),
68871
+ tools: ToolDefinitions.nullable(),
68872
+ json_schema: string$2().nullable(),
68873
+ status: RequestLogStatus,
68874
+ error_message: string$2().nullable(),
68875
+ response_json_ok: boolean$1().nullable(),
68876
+ tool_call_count: int(),
68877
+ is_image_generation: boolean$1(),
68878
+ is_structured: boolean$1()
68879
+ });
68880
+ object({
68881
+ id: int(),
68882
+ created_at: date(),
68883
+ request_log_id: int(),
68884
+ step_index: int(),
68885
+ type: RequestLogStepType,
68886
+ model_name: string$2().max(255).nullable(),
68887
+ requested_model_name: string$2().max(255).nullable(),
68888
+ fallback_count: int().nullable(),
68889
+ input_tokens: int().nullable(),
68890
+ output_tokens: int().nullable(),
68891
+ cache_read_tokens: int().nullable(),
68892
+ cache_creation_tokens: int().nullable(),
68893
+ cache_creation_5m_tokens: int().nullable(),
68894
+ cache_creation_1h_tokens: int().nullable(),
68895
+ cost_usd: int().nullable(),
68896
+ cost_source: string$2().max(20).nullable(),
68897
+ duration_ms: int().nullable(),
68898
+ ttft_ms: int().nullable(),
68899
+ finish_reason: string$2().max(20).nullable(),
68900
+ reasoning_text: string$2().nullable(),
68901
+ reasoning_tokens: int().nullable(),
68902
+ tool_call_index: int().nullable(),
68903
+ tool_call_id: string$2().max(100).nullable(),
68904
+ tool_name: string$2().max(100).nullable(),
68905
+ tool_args: string$2().nullable(),
68906
+ tool_result: string$2().nullable(),
68907
+ tool_duration_ms: int().nullable(),
68908
+ error: string$2().nullable()
68909
+ });
68910
+ object({
68911
+ id: int(),
68912
+ created_at: date(),
68913
+ key: string$2().max(100),
68914
+ value: string$2(),
68915
+ updated_at: date().nullable()
68916
+ });
68917
+ object({
68918
+ id: int(),
68919
+ created_at: date(),
68920
+ provider: string$2().max(20),
68921
+ credentials: TokenCredentials,
68922
+ name: string$2(),
68923
+ active: boolean$1(),
68924
+ reauth_required: boolean$1(),
68925
+ ord: int(),
68926
+ quota_threshold: int().nullable(),
68927
+ weight: int(),
68928
+ keepalive_enabled: boolean$1()
68929
+ });
68930
+ var RequestLogBaseListParams = object({
68931
+ num: number$1().int().nonnegative(),
68932
+ page: number$1().int().min(1),
68933
+ search: RequestLogSearchField,
68934
+ keyword: string$2(),
68935
+ orderBy: RequestLogOrderBy,
68936
+ queryMode: SonamuQueryMode,
68937
+ id: zArrayable(number$1().int().positive()),
68938
+ sonamuFilter: custom(),
68939
+ token_name: string$2().max(100).nullable(),
68940
+ project_name: string$2().max(50).nullable(),
68941
+ model_name: string$2().max(255).nullable()
68942
+ }).partial();
68943
+ object({
68944
+ num: number$1().int().nonnegative(),
68945
+ page: number$1().int().min(1),
68946
+ search: RequestLogStepSearchField,
68947
+ keyword: string$2(),
68948
+ orderBy: RequestLogStepOrderBy,
68949
+ queryMode: SonamuQueryMode,
68950
+ id: zArrayable(number$1().int().positive()),
68951
+ sonamuFilter: custom(),
68952
+ request_log_id: int()
68953
+ }).partial();
68954
+ object({
68955
+ num: number$1().int().nonnegative(),
68956
+ page: number$1().int().min(1),
68957
+ search: SettingSearchField,
68958
+ keyword: string$2(),
68959
+ orderBy: SettingOrderBy,
68960
+ queryMode: SonamuQueryMode,
68961
+ id: zArrayable(number$1().int().positive()),
68962
+ sonamuFilter: custom(),
68963
+ key: string$2().max(100)
68964
+ }).partial();
68965
+ object({
68966
+ num: number$1().int().nonnegative(),
68967
+ page: number$1().int().min(1),
68968
+ search: TokenSearchField,
68969
+ keyword: string$2(),
68970
+ orderBy: TokenOrderBy,
68971
+ queryMode: SonamuQueryMode,
68972
+ id: zArrayable(number$1().int().positive()),
68973
+ sonamuFilter: custom()
68974
+ }).partial();
68975
+ object({
68976
+ id: int(),
68977
+ created_at: date(),
68978
+ token_name: string$2().max(100).nullable(),
68979
+ project_name: string$2().max(50).nullable(),
68980
+ model_name: string$2().max(255).nullable(),
68981
+ requested_model_name: string$2().max(255).nullable(),
68982
+ fallback_count: int().nullable(),
68983
+ user_prompt: string$2().nullable(),
68984
+ system_prompt: string$2().nullable(),
68985
+ response: string$2(),
68986
+ input_tokens: int(),
68987
+ output_tokens: int(),
68988
+ cache_read_tokens: int(),
68989
+ cache_creation_tokens: int(),
68990
+ cache_creation_5m_tokens: int().nullable(),
68991
+ cache_creation_1h_tokens: int().nullable(),
68992
+ duration_ms: int(),
68993
+ ttft_ms: int(),
68994
+ cost_usd: int().nullable(),
68995
+ cost_source: string$2().max(20).nullable(),
68996
+ image_cost_usd: int().nullable(),
68997
+ image_cost_method: string$2().max(100).nullable(),
68998
+ effort: string$2().max(10).nullable(),
68999
+ history: HistoryItems.nullable(),
69000
+ tools: ToolDefinitions.nullable(),
69001
+ status: RequestLogStatus,
69002
+ response_json_ok: boolean$1().nullable(),
69003
+ error_message: string$2().nullable(),
69004
+ tool_call_count: int(),
69005
+ is_image_generation: boolean$1(),
69006
+ is_structured: boolean$1()
69007
+ });
69008
+ object({
69009
+ id: int(),
69010
+ created_at: date(),
69011
+ token_name: string$2().max(100).nullable(),
69012
+ project_name: string$2().max(50).nullable(),
69013
+ model_name: string$2().max(255).nullable(),
69014
+ requested_model_name: string$2().max(255).nullable(),
69015
+ fallback_count: int().nullable(),
69016
+ input_tokens: int(),
69017
+ output_tokens: int(),
69018
+ cache_read_tokens: int(),
69019
+ cache_creation_tokens: int(),
69020
+ cache_creation_5m_tokens: int().nullable(),
69021
+ cache_creation_1h_tokens: int().nullable(),
69022
+ duration_ms: int(),
69023
+ ttft_ms: int(),
69024
+ cost_usd: int().nullable(),
69025
+ cost_source: string$2().max(20).nullable(),
69026
+ image_cost_usd: int().nullable(),
69027
+ image_cost_method: string$2().max(100).nullable(),
69028
+ effort: string$2().max(10).nullable(),
69029
+ status: RequestLogStatus,
69030
+ response_json_ok: boolean$1().nullable(),
69031
+ tool_call_count: int(),
69032
+ is_image_generation: boolean$1(),
69033
+ is_structured: boolean$1()
69034
+ });
69035
+ object({
69036
+ id: int(),
69037
+ token_name: string$2().max(100).nullable(),
69038
+ model_name: string$2().max(255).nullable(),
69039
+ input_tokens: int(),
69040
+ output_tokens: int(),
69041
+ cache_read_tokens: int(),
69042
+ cache_creation_tokens: int(),
69043
+ cache_creation_5m_tokens: int().nullable(),
69044
+ cache_creation_1h_tokens: int().nullable(),
69045
+ cost_usd: int().nullable(),
69046
+ cost_source: string$2().max(20).nullable()
69047
+ });
69048
+ _enum([
69049
+ "A",
69050
+ "P",
69051
+ "C"
69052
+ ]);
69053
+ object({
69054
+ id: int(),
69055
+ created_at: date(),
69056
+ step_index: int(),
69057
+ type: RequestLogStepType,
69058
+ model_name: string$2().max(255).nullable(),
69059
+ requested_model_name: string$2().max(255).nullable(),
69060
+ fallback_count: int().nullable(),
69061
+ input_tokens: int().nullable(),
69062
+ output_tokens: int().nullable(),
69063
+ cache_read_tokens: int().nullable(),
69064
+ cache_creation_tokens: int().nullable(),
69065
+ cache_creation_5m_tokens: int().nullable(),
69066
+ cache_creation_1h_tokens: int().nullable(),
69067
+ cost_usd: int().nullable(),
69068
+ cost_source: string$2().max(20).nullable(),
69069
+ duration_ms: int().nullable(),
69070
+ ttft_ms: int().nullable(),
69071
+ finish_reason: string$2().max(20).nullable(),
69072
+ reasoning_text: string$2().nullable(),
69073
+ reasoning_tokens: int().nullable(),
69074
+ tool_call_index: int().nullable(),
69075
+ tool_call_id: string$2().max(100).nullable(),
69076
+ tool_name: string$2().max(100).nullable(),
69077
+ tool_args: string$2().nullable(),
69078
+ tool_result: string$2().nullable(),
69079
+ tool_duration_ms: int().nullable(),
69080
+ error: string$2().nullable()
69081
+ });
69082
+ object({
69083
+ id: int(),
69084
+ created_at: date(),
69085
+ step_index: int(),
69086
+ type: RequestLogStepType,
69087
+ model_name: string$2().max(255).nullable(),
69088
+ requested_model_name: string$2().max(255).nullable(),
69089
+ fallback_count: int().nullable(),
69090
+ input_tokens: int().nullable(),
69091
+ output_tokens: int().nullable(),
69092
+ cache_read_tokens: int().nullable(),
69093
+ cache_creation_tokens: int().nullable(),
69094
+ cache_creation_5m_tokens: int().nullable(),
69095
+ cache_creation_1h_tokens: int().nullable(),
69096
+ cost_usd: int().nullable(),
69097
+ cost_source: string$2().max(20).nullable(),
69098
+ duration_ms: int().nullable(),
69099
+ ttft_ms: int().nullable(),
69100
+ finish_reason: string$2().max(20).nullable(),
69101
+ reasoning_tokens: int().nullable(),
69102
+ tool_call_index: int().nullable(),
69103
+ tool_call_id: string$2().max(100).nullable(),
69104
+ tool_name: string$2().max(100).nullable(),
69105
+ tool_duration_ms: int().nullable(),
69106
+ error: string$2().nullable()
69107
+ });
69108
+ object({
69109
+ id: int(),
69110
+ tool_args: string$2().nullable()
69111
+ });
69112
+ _enum([
69113
+ "A",
69114
+ "T",
69115
+ "I"
69116
+ ]);
69117
+ object({
69118
+ id: int(),
69119
+ created_at: date(),
69120
+ key: string$2().max(100),
69121
+ value: string$2(),
69122
+ updated_at: date().nullable()
69123
+ });
69124
+ _enum(["A"]);
69125
+ object({
69126
+ id: int(),
69127
+ created_at: date(),
69128
+ provider: string$2().max(20),
69129
+ credentials: TokenCredentials,
69130
+ name: string$2(),
69131
+ active: boolean$1(),
69132
+ reauth_required: boolean$1(),
69133
+ ord: int(),
69134
+ quota_threshold: int().nullable(),
69135
+ weight: int(),
69136
+ keepalive_enabled: boolean$1()
69137
+ });
69138
+ _enum(["A"]);
69139
+ //#endregion
68780
69140
  //#region src/routes/logs.tsx
68781
- var $$splitComponentImporter$2 = () => import("./assets/logs-DO8zBdBR.js");
69141
+ var $$splitComponentImporter$2 = () => import("./assets/logs-DMlOXcDS.js");
68782
69142
  var logsSearchSchema = object({
68783
69143
  token: string$2().optional(),
68784
69144
  project: string$2().optional(),
68785
69145
  model: string$2().optional(),
68786
- sort: string$2().optional(),
68787
- page: number$1().optional().default(1)
69146
+ sort: RequestLogOrderBy.optional(),
69147
+ page: RequestLogBaseListParams.shape.page.default(1)
68788
69148
  });
68789
69149
  var Route$2 = createFileRoute("/logs")({
68790
69150
  validateSearch: logsSearchSchema,
@@ -68792,11 +69152,11 @@ var Route$2 = createFileRoute("/logs")({
68792
69152
  });
68793
69153
  //#endregion
68794
69154
  //#region src/routes/index.tsx
68795
- var $$splitComponentImporter$1 = () => import("./assets/routes-Btja-741.js");
69155
+ var $$splitComponentImporter$1 = () => import("./assets/routes-C7lB2Q85.js");
68796
69156
  var Route$1 = createFileRoute("/")({ component: lazyRouteComponent($$splitComponentImporter$1, "component") });
68797
69157
  //#endregion
68798
69158
  //#region src/routes/requests/show.tsx
68799
- var $$splitComponentImporter = () => import("./assets/show-CMXbb3TJ.js");
69159
+ var $$splitComponentImporter = () => import("./assets/show-CDxGr4rS.js");
68800
69160
  var showSearchSchema = object({ id: number$1() });
68801
69161
  var Route = createFileRoute("/requests/show")({
68802
69162
  validateSearch: showSearchSchema,
@@ -68871,4 +69231,4 @@ async function render(url, preloadedData = []) {
68871
69231
  };
68872
69232
  }
68873
69233
  //#endregion
68874
- export { clsx as a, remarkGfm as c, Q as i, Markdown as l, Route$2 as n, lucideX as o, Route$3 as r, render, lucideRotateCcw as s, Route as t, lucideKeyRound as u };
69234
+ export { Route$3 as a, lucideX as c, Markdown as d, lucideKeyRound as f, RequestLogOrderBy as i, lucideRotateCcw as l, Route$2 as n, Q as o, RequestLogBaseListParams as r, render, clsx as s, Route as t, remarkGfm as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartanova/qgrid-cli",
3
- "version": "2.9.10",
3
+ "version": "2.10.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cartanova-ai/qgrid"
@@ -55,6 +55,12 @@ Request logging is enabled by default. Use `providerOptions.qgrid.logger: false`
55
55
  - Keep OpenAI Codex built-in tools, apps, plugins, skills, web search, shell, and environment instruction blocks disabled unless the user explicitly asks for agentic Codex behavior.
56
56
  - Treat OpenAI image generation as opt-in outside dashboard chat. In 2.9.8, OpenAI `qgrid_chat` opts into raw API `imageGeneration: "auto"` on every turn; the public AI SDK option remains boolean. Ordinary images use the hosted Responses image tool; a server-executed transparent-image function calls Codex standalone Images directly with subscription credentials. Do not reintroduce a client decision tool followed by another GPT generation request. Image costs remain API-price estimates.
57
57
 
58
+ ## Request log IDs (2.10.0+)
59
+
60
+ - Successful raw query responses and stream `done` events expose optional top-level `requestLogId`. The AI SDK exposes it as `providerMetadata.qgrid.requestLogId`; await stream metadata after consuming the stream.
61
+ - The ID identifies the parent request log and stays the same across tool-run steps. It is omitted with `logger: false`. Keep `runContext.requestLogId` for tool continuation only; do not replay the top-level ID as continuation state.
62
+ - Update both server and AI SDK to 2.10.0 or later to consume the metadata. Older servers may omit the ID. This contract does not add IDs to delta or error events or change `createQgridLogger` for external providers.
63
+
58
64
  ## Automatic chat images (2.9.8+)
59
65
 
60
66
  - Raw `imageGeneration: "auto"` permits text-only replies; explicit `true` still requires an image. Both use non-stream requests. Auto mode rejects caller tools and output schemas.