@ottocode/web-sdk 0.1.313 → 0.1.314
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/ConfigModal.d.ts.map +1 -1
- package/dist/components/dashboard/UsageDashboard.d.ts.map +1 -1
- package/dist/components/index.js +333 -9
- package/dist/components/index.js.map +9 -9
- package/dist/components/sessions/LeanHeader.d.ts.map +1 -1
- package/dist/components/sessions/SessionHeader.d.ts.map +1 -1
- package/dist/components/settings/SettingsSidebar.d.ts.map +1 -1
- package/dist/hooks/index.js.map +3 -3
- package/dist/hooks/useAgents.d.ts +1 -0
- package/dist/hooks/useAgents.d.ts.map +1 -1
- package/dist/hooks/useChatComposer.d.ts +1 -0
- package/dist/hooks/useChatComposer.d.ts.map +1 -1
- package/dist/hooks/useConfig.d.ts +4 -0
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/index.js +333 -9
- package/dist/index.js.map +9 -9
- package/dist/lib/api-client/config.d.ts +3 -0
- package/dist/lib/api-client/config.d.ts.map +1 -1
- package/dist/lib/api-client/index.d.ts +3 -0
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/index.js.map +2 -2
- package/dist/types/api.d.ts +4 -1
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigModal.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ConfigModal.tsx"],"names":[],"mappings":"AAcA,UAAU,gBAAgB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,WAAW,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,aAAuB,EACvB,iBAAyB,GACzB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ConfigModal.d.ts","sourceRoot":"","sources":["../../../src/components/chat/ConfigModal.tsx"],"names":[],"mappings":"AAcA,UAAU,gBAAgB;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,aAAa,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACrC,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,WAAW,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,aAAuB,EACvB,iBAAyB,GACzB,EAAE,gBAAgB,2CAsMlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsageDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dashboard/UsageDashboard.tsx"],"names":[],"mappings":"AAMA,UAAU,mBAAmB;IAC5B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"UsageDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/dashboard/UsageDashboard.tsx"],"names":[],"mappings":"AAMA,UAAU,mBAAmB;IAC5B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AA+uBD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CAiT7D"}
|
package/dist/components/index.js
CHANGED
|
@@ -10610,6 +10610,7 @@ function ConfigModal({
|
|
|
10610
10610
|
const updateDefaults = useUpdateDefaults();
|
|
10611
10611
|
const reasoningEnabled = config2?.defaults?.reasoningText ?? true;
|
|
10612
10612
|
const reasoningLevel = config2?.defaults?.reasoningLevel ?? "high";
|
|
10613
|
+
const coAuthorCommits = config2?.defaults?.coAuthorCommits ?? false;
|
|
10613
10614
|
const ottoEnabled = config2?.defaults?.ottoEnabled ?? true;
|
|
10614
10615
|
const agentNames = useMemo16(() => ((agentDetails?.agents.length) ? agentDetails.agents.map((agentDetail) => agentDetail.name) : config2?.agents ?? []).filter((name) => name !== "otto"), [agentDetails?.agents, config2?.agents]);
|
|
10615
10616
|
const agentSelectorRef = useRef11(null);
|
|
@@ -10717,6 +10718,36 @@ function ConfigModal({
|
|
|
10717
10718
|
})
|
|
10718
10719
|
]
|
|
10719
10720
|
}),
|
|
10721
|
+
/* @__PURE__ */ jsxs22("div", {
|
|
10722
|
+
className: "flex items-center justify-between",
|
|
10723
|
+
children: [
|
|
10724
|
+
/* @__PURE__ */ jsxs22("div", {
|
|
10725
|
+
children: [
|
|
10726
|
+
/* @__PURE__ */ jsx29("div", {
|
|
10727
|
+
className: "text-sm font-medium text-foreground",
|
|
10728
|
+
children: "Otto Commit Co-author"
|
|
10729
|
+
}),
|
|
10730
|
+
/* @__PURE__ */ jsx29("p", {
|
|
10731
|
+
className: "mt-0.5 text-xs text-muted-foreground",
|
|
10732
|
+
children: "Add the ottocode bot as a co-author on Otto commits."
|
|
10733
|
+
})
|
|
10734
|
+
]
|
|
10735
|
+
}),
|
|
10736
|
+
/* @__PURE__ */ jsx29("button", {
|
|
10737
|
+
type: "button",
|
|
10738
|
+
role: "switch",
|
|
10739
|
+
"aria-checked": coAuthorCommits,
|
|
10740
|
+
onClick: () => updateDefaults.mutate({
|
|
10741
|
+
coAuthorCommits: !coAuthorCommits,
|
|
10742
|
+
scope: "global"
|
|
10743
|
+
}),
|
|
10744
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 ${coAuthorCommits ? "bg-primary" : "bg-muted"}`,
|
|
10745
|
+
children: /* @__PURE__ */ jsx29("span", {
|
|
10746
|
+
className: `inline-block h-4 w-4 transform rounded-full transition-transform ${coAuthorCommits ? "translate-x-6" : "translate-x-1"} ${coAuthorCommits ? "bg-primary-foreground" : "bg-foreground"}`
|
|
10747
|
+
})
|
|
10748
|
+
})
|
|
10749
|
+
]
|
|
10750
|
+
}),
|
|
10720
10751
|
/* @__PURE__ */ jsxs22("div", {
|
|
10721
10752
|
className: "flex items-center justify-between",
|
|
10722
10753
|
children: [
|
|
@@ -23413,6 +23444,8 @@ function SessionHeader({
|
|
|
23413
23444
|
const width = useContainerWidth(rootRef);
|
|
23414
23445
|
const isCompact = width > 0 && width < 640;
|
|
23415
23446
|
const estimatedCost = useMemo25(() => {
|
|
23447
|
+
if (typeof session.totalCostUsd === "number")
|
|
23448
|
+
return session.totalCostUsd;
|
|
23416
23449
|
const inputTokens = session.totalInputTokens || 0;
|
|
23417
23450
|
const outputTokens2 = session.totalOutputTokens || 0;
|
|
23418
23451
|
const cachedInputTokens = session.totalCachedTokens || 0;
|
|
@@ -23429,8 +23462,10 @@ function SessionHeader({
|
|
|
23429
23462
|
session.totalInputTokens,
|
|
23430
23463
|
session.totalOutputTokens,
|
|
23431
23464
|
session.totalCachedTokens,
|
|
23432
|
-
session.totalCacheCreationTokens
|
|
23465
|
+
session.totalCacheCreationTokens,
|
|
23466
|
+
session.totalCostUsd
|
|
23433
23467
|
]);
|
|
23468
|
+
const subagentCost = session.subagentCostUsd ?? 0;
|
|
23434
23469
|
const formatDuration3 = (ms) => {
|
|
23435
23470
|
if (!ms)
|
|
23436
23471
|
return "0s";
|
|
@@ -23593,6 +23628,7 @@ function SessionHeader({
|
|
|
23593
23628
|
}),
|
|
23594
23629
|
estimatedCost > 0 && !isCompact && /* @__PURE__ */ jsxs75("div", {
|
|
23595
23630
|
className: "flex items-center gap-1.5",
|
|
23631
|
+
title: subagentCost > 0 ? `Total cost includes $${subagentCost.toFixed(4)} from sub-agents` : "Estimated session cost",
|
|
23596
23632
|
children: [
|
|
23597
23633
|
/* @__PURE__ */ jsx87(DollarSign, {
|
|
23598
23634
|
className: "w-4 h-4"
|
|
@@ -24072,6 +24108,8 @@ function LeanHeader({
|
|
|
24072
24108
|
const { data: parentData } = useParentSession(session.sessionType === "branch" ? session.id : undefined);
|
|
24073
24109
|
const { data: shareStatus } = useShareStatus(session.id);
|
|
24074
24110
|
const estimatedCost = useMemo27(() => {
|
|
24111
|
+
if (typeof session.totalCostUsd === "number")
|
|
24112
|
+
return session.totalCostUsd;
|
|
24075
24113
|
const inputTokens = session.totalInputTokens || 0;
|
|
24076
24114
|
const outputTokens = session.totalOutputTokens || 0;
|
|
24077
24115
|
const cachedInputTokens = session.totalCachedTokens || 0;
|
|
@@ -24088,8 +24126,10 @@ function LeanHeader({
|
|
|
24088
24126
|
session.totalInputTokens,
|
|
24089
24127
|
session.totalOutputTokens,
|
|
24090
24128
|
session.totalCachedTokens,
|
|
24091
|
-
session.totalCacheCreationTokens
|
|
24129
|
+
session.totalCacheCreationTokens,
|
|
24130
|
+
session.totalCostUsd
|
|
24092
24131
|
]);
|
|
24132
|
+
const subagentCost = session.subagentCostUsd ?? 0;
|
|
24093
24133
|
const formatCompactNumber = (num) => {
|
|
24094
24134
|
if (num >= 1e6)
|
|
24095
24135
|
return `${(num / 1e6).toFixed(1)}M`;
|
|
@@ -24222,6 +24262,7 @@ function LeanHeader({
|
|
|
24222
24262
|
}),
|
|
24223
24263
|
estimatedCost > 0 && !isCompact && /* @__PURE__ */ jsxs78("div", {
|
|
24224
24264
|
className: "flex items-center gap-1",
|
|
24265
|
+
title: subagentCost > 0 ? `Total cost includes $${subagentCost.toFixed(4)} from sub-agents` : "Estimated session cost",
|
|
24225
24266
|
children: [
|
|
24226
24267
|
/* @__PURE__ */ jsx90(DollarSign2, {
|
|
24227
24268
|
className: "size-3.5"
|
|
@@ -33569,6 +33610,15 @@ function PreferencesModal({ isOpen, onClose }) {
|
|
|
33569
33610
|
scope: "global"
|
|
33570
33611
|
})
|
|
33571
33612
|
}),
|
|
33613
|
+
/* @__PURE__ */ jsx128(ToggleRow, {
|
|
33614
|
+
label: "Otto Commit Co-author",
|
|
33615
|
+
description: "Add the ottocode bot as a co-author on commits made through Otto.",
|
|
33616
|
+
checked: config2?.defaults?.coAuthorCommits ?? false,
|
|
33617
|
+
onChange: (checked) => updateDefaults.mutate({
|
|
33618
|
+
coAuthorCommits: checked,
|
|
33619
|
+
scope: "global"
|
|
33620
|
+
})
|
|
33621
|
+
}),
|
|
33572
33622
|
/* @__PURE__ */ jsx128(ToggleRow, {
|
|
33573
33623
|
label: "Otto & Goals",
|
|
33574
33624
|
description: "Supervisor agent that verifies goal progress and re-enqueues sessions until the goal is done. Disabling also disables goals.",
|
|
@@ -44164,6 +44214,278 @@ function TokenChart({ data, max, hover, onHover }) {
|
|
|
44164
44214
|
})
|
|
44165
44215
|
});
|
|
44166
44216
|
}
|
|
44217
|
+
var SKELETON_BARS = [
|
|
44218
|
+
{ id: "a", height: 32 },
|
|
44219
|
+
{ id: "b", height: 48 },
|
|
44220
|
+
{ id: "c", height: 24 },
|
|
44221
|
+
{ id: "d", height: 64 },
|
|
44222
|
+
{ id: "e", height: 40 },
|
|
44223
|
+
{ id: "f", height: 72 },
|
|
44224
|
+
{ id: "g", height: 16 },
|
|
44225
|
+
{ id: "h", height: 56 },
|
|
44226
|
+
{ id: "i", height: 36 },
|
|
44227
|
+
{ id: "j", height: 80 },
|
|
44228
|
+
{ id: "k", height: 28 },
|
|
44229
|
+
{ id: "l", height: 44 },
|
|
44230
|
+
{ id: "m", height: 20 },
|
|
44231
|
+
{ id: "n", height: 60 },
|
|
44232
|
+
{ id: "o", height: 52 },
|
|
44233
|
+
{ id: "p", height: 12 },
|
|
44234
|
+
{ id: "q", height: 68 },
|
|
44235
|
+
{ id: "r", height: 76 },
|
|
44236
|
+
{ id: "s", height: 44 },
|
|
44237
|
+
{ id: "t", height: 32 },
|
|
44238
|
+
{ id: "u", height: 50 },
|
|
44239
|
+
{ id: "v", height: 18 },
|
|
44240
|
+
{ id: "w", height: 66 },
|
|
44241
|
+
{ id: "x", height: 38 },
|
|
44242
|
+
{ id: "y", height: 58 },
|
|
44243
|
+
{ id: "z", height: 26 },
|
|
44244
|
+
{ id: "aa", height: 70 },
|
|
44245
|
+
{ id: "ab", height: 22 },
|
|
44246
|
+
{ id: "ac", height: 46 },
|
|
44247
|
+
{ id: "ad", height: 54 }
|
|
44248
|
+
];
|
|
44249
|
+
var SKELETON_LIST_ROWS = [
|
|
44250
|
+
{ id: "a" },
|
|
44251
|
+
{ id: "b" },
|
|
44252
|
+
{ id: "c" },
|
|
44253
|
+
{ id: "d" },
|
|
44254
|
+
{ id: "e" },
|
|
44255
|
+
{ id: "f" },
|
|
44256
|
+
{ id: "g" },
|
|
44257
|
+
{ id: "h" },
|
|
44258
|
+
{ id: "i" },
|
|
44259
|
+
{ id: "j" },
|
|
44260
|
+
{ id: "k" },
|
|
44261
|
+
{ id: "l" }
|
|
44262
|
+
];
|
|
44263
|
+
function SkeletonHero() {
|
|
44264
|
+
return /* @__PURE__ */ jsxs137("div", {
|
|
44265
|
+
className: "rounded-2xl border border-border bg-card/60 px-6 py-7",
|
|
44266
|
+
children: [
|
|
44267
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44268
|
+
className: "grid grid-cols-1 md:grid-cols-[1.4fr_1fr_1fr] gap-6 md:gap-10 items-center",
|
|
44269
|
+
children: [
|
|
44270
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44271
|
+
children: [
|
|
44272
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44273
|
+
className: "h-3 w-32 bg-muted rounded animate-pulse"
|
|
44274
|
+
}),
|
|
44275
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44276
|
+
className: "mt-3 h-12 w-40 bg-muted rounded animate-pulse"
|
|
44277
|
+
}),
|
|
44278
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44279
|
+
className: "mt-3 h-3 w-56 bg-muted rounded animate-pulse"
|
|
44280
|
+
})
|
|
44281
|
+
]
|
|
44282
|
+
}),
|
|
44283
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44284
|
+
className: "md:border-l md:border-border/60 md:pl-6",
|
|
44285
|
+
children: [
|
|
44286
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44287
|
+
className: "h-3 w-24 bg-muted rounded animate-pulse"
|
|
44288
|
+
}),
|
|
44289
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44290
|
+
className: "mt-3 h-9 w-32 bg-muted rounded animate-pulse"
|
|
44291
|
+
}),
|
|
44292
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44293
|
+
className: "mt-3 h-3 w-40 bg-muted rounded animate-pulse"
|
|
44294
|
+
})
|
|
44295
|
+
]
|
|
44296
|
+
}),
|
|
44297
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44298
|
+
className: "md:border-l md:border-border/60 md:pl-6",
|
|
44299
|
+
children: [
|
|
44300
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44301
|
+
className: "h-3 w-28 bg-muted rounded animate-pulse"
|
|
44302
|
+
}),
|
|
44303
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44304
|
+
className: "mt-3 h-9 w-32 bg-muted rounded animate-pulse"
|
|
44305
|
+
}),
|
|
44306
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44307
|
+
className: "mt-3 h-3 w-44 bg-muted rounded animate-pulse"
|
|
44308
|
+
})
|
|
44309
|
+
]
|
|
44310
|
+
})
|
|
44311
|
+
]
|
|
44312
|
+
}),
|
|
44313
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44314
|
+
className: "mt-6 pt-5 border-t border-border/40 grid grid-cols-3 gap-6",
|
|
44315
|
+
children: [
|
|
44316
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44317
|
+
children: [
|
|
44318
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44319
|
+
className: "h-3 w-20 bg-muted rounded animate-pulse"
|
|
44320
|
+
}),
|
|
44321
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44322
|
+
className: "mt-2 h-5 w-32 bg-muted rounded animate-pulse"
|
|
44323
|
+
})
|
|
44324
|
+
]
|
|
44325
|
+
}),
|
|
44326
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44327
|
+
children: [
|
|
44328
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44329
|
+
className: "h-3 w-16 bg-muted rounded animate-pulse"
|
|
44330
|
+
}),
|
|
44331
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44332
|
+
className: "mt-2 h-5 w-36 bg-muted rounded animate-pulse"
|
|
44333
|
+
})
|
|
44334
|
+
]
|
|
44335
|
+
}),
|
|
44336
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44337
|
+
children: [
|
|
44338
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44339
|
+
className: "h-3 w-12 bg-muted rounded animate-pulse"
|
|
44340
|
+
}),
|
|
44341
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44342
|
+
className: "mt-2 h-5 w-40 bg-muted rounded animate-pulse"
|
|
44343
|
+
})
|
|
44344
|
+
]
|
|
44345
|
+
})
|
|
44346
|
+
]
|
|
44347
|
+
})
|
|
44348
|
+
]
|
|
44349
|
+
});
|
|
44350
|
+
}
|
|
44351
|
+
function SkeletonSplit() {
|
|
44352
|
+
return /* @__PURE__ */ jsx157("div", {
|
|
44353
|
+
className: "space-y-2",
|
|
44354
|
+
children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs137("div", {
|
|
44355
|
+
className: "flex items-center gap-3 py-2",
|
|
44356
|
+
children: [
|
|
44357
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44358
|
+
className: "h-3 w-20 bg-muted rounded animate-pulse shrink-0"
|
|
44359
|
+
}),
|
|
44360
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44361
|
+
className: "flex-1 h-1.5 rounded-full bg-muted/40 overflow-hidden",
|
|
44362
|
+
children: /* @__PURE__ */ jsx157("div", {
|
|
44363
|
+
className: "h-full w-2/3 bg-muted rounded animate-pulse"
|
|
44364
|
+
})
|
|
44365
|
+
}),
|
|
44366
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44367
|
+
className: "h-3 w-20 bg-muted rounded animate-pulse shrink-0"
|
|
44368
|
+
}),
|
|
44369
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44370
|
+
className: "h-4 w-16 bg-muted rounded animate-pulse shrink-0"
|
|
44371
|
+
})
|
|
44372
|
+
]
|
|
44373
|
+
}, i))
|
|
44374
|
+
});
|
|
44375
|
+
}
|
|
44376
|
+
function SkeletonChart() {
|
|
44377
|
+
return /* @__PURE__ */ jsxs137("div", {
|
|
44378
|
+
children: [
|
|
44379
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44380
|
+
className: "flex items-baseline justify-between gap-4 mb-4",
|
|
44381
|
+
children: [
|
|
44382
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44383
|
+
className: "min-w-0 space-y-2",
|
|
44384
|
+
children: [
|
|
44385
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44386
|
+
className: "h-3 w-24 bg-muted rounded animate-pulse"
|
|
44387
|
+
}),
|
|
44388
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44389
|
+
className: "h-7 w-28 bg-muted rounded animate-pulse"
|
|
44390
|
+
}),
|
|
44391
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44392
|
+
className: "h-3 w-48 bg-muted rounded animate-pulse"
|
|
44393
|
+
})
|
|
44394
|
+
]
|
|
44395
|
+
}),
|
|
44396
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44397
|
+
className: "h-7 w-28 bg-muted rounded animate-pulse shrink-0"
|
|
44398
|
+
})
|
|
44399
|
+
]
|
|
44400
|
+
}),
|
|
44401
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44402
|
+
className: "flex items-end gap-[3px] h-44",
|
|
44403
|
+
children: SKELETON_BARS.map((bar) => /* @__PURE__ */ jsx157("div", {
|
|
44404
|
+
className: "flex-1 bg-muted rounded-sm animate-pulse",
|
|
44405
|
+
style: { height: `${bar.height}%` }
|
|
44406
|
+
}, `chart-skeleton-${bar.id}`))
|
|
44407
|
+
}),
|
|
44408
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44409
|
+
className: "mt-3 flex items-center justify-between",
|
|
44410
|
+
children: [
|
|
44411
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44412
|
+
className: "h-3 w-16 bg-muted rounded animate-pulse"
|
|
44413
|
+
}),
|
|
44414
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44415
|
+
className: "h-3 w-24 bg-muted rounded animate-pulse"
|
|
44416
|
+
}),
|
|
44417
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44418
|
+
className: "h-3 w-16 bg-muted rounded animate-pulse"
|
|
44419
|
+
})
|
|
44420
|
+
]
|
|
44421
|
+
})
|
|
44422
|
+
]
|
|
44423
|
+
});
|
|
44424
|
+
}
|
|
44425
|
+
function SkeletonList({ rows = 6 }) {
|
|
44426
|
+
return /* @__PURE__ */ jsx157("div", {
|
|
44427
|
+
className: "divide-y divide-border/60",
|
|
44428
|
+
children: SKELETON_LIST_ROWS.slice(0, rows).map((row, index) => /* @__PURE__ */ jsxs137("div", {
|
|
44429
|
+
className: "flex items-center gap-3 py-2.5 px-1",
|
|
44430
|
+
children: [
|
|
44431
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44432
|
+
className: "size-7 shrink-0 rounded-md bg-muted animate-pulse"
|
|
44433
|
+
}),
|
|
44434
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44435
|
+
className: "flex-1 min-w-0 space-y-1.5",
|
|
44436
|
+
children: [
|
|
44437
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44438
|
+
className: "h-3.5 w-24 bg-muted rounded animate-pulse"
|
|
44439
|
+
}),
|
|
44440
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44441
|
+
className: "h-2.5 w-36 bg-muted rounded animate-pulse"
|
|
44442
|
+
})
|
|
44443
|
+
]
|
|
44444
|
+
}),
|
|
44445
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44446
|
+
className: "space-y-1.5 text-right shrink-0",
|
|
44447
|
+
children: [
|
|
44448
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44449
|
+
className: "h-3.5 w-16 bg-muted rounded animate-pulse"
|
|
44450
|
+
}),
|
|
44451
|
+
/* @__PURE__ */ jsx157("div", {
|
|
44452
|
+
className: "h-2.5 w-14 bg-muted rounded animate-pulse ml-auto"
|
|
44453
|
+
})
|
|
44454
|
+
]
|
|
44455
|
+
})
|
|
44456
|
+
]
|
|
44457
|
+
}, `list-skeleton-${row.id}-${index}`))
|
|
44458
|
+
});
|
|
44459
|
+
}
|
|
44460
|
+
function UsageDashboardSkeleton() {
|
|
44461
|
+
return /* @__PURE__ */ jsxs137("div", {
|
|
44462
|
+
className: "max-w-5xl mx-auto px-6 py-8 space-y-5",
|
|
44463
|
+
children: [
|
|
44464
|
+
/* @__PURE__ */ jsx157(SkeletonHero, {}),
|
|
44465
|
+
/* @__PURE__ */ jsx157(Section, {
|
|
44466
|
+
title: "How you're paying",
|
|
44467
|
+
children: /* @__PURE__ */ jsx157(SkeletonSplit, {})
|
|
44468
|
+
}),
|
|
44469
|
+
/* @__PURE__ */ jsx157(Section, {
|
|
44470
|
+
title: "Daily activity",
|
|
44471
|
+
children: /* @__PURE__ */ jsx157(SkeletonChart, {})
|
|
44472
|
+
}),
|
|
44473
|
+
/* @__PURE__ */ jsxs137("div", {
|
|
44474
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-5",
|
|
44475
|
+
children: [
|
|
44476
|
+
/* @__PURE__ */ jsx157(Section, {
|
|
44477
|
+
title: "By provider",
|
|
44478
|
+
children: /* @__PURE__ */ jsx157(SkeletonList, {})
|
|
44479
|
+
}),
|
|
44480
|
+
/* @__PURE__ */ jsx157(Section, {
|
|
44481
|
+
title: "Top models",
|
|
44482
|
+
children: /* @__PURE__ */ jsx157(SkeletonList, {})
|
|
44483
|
+
})
|
|
44484
|
+
]
|
|
44485
|
+
})
|
|
44486
|
+
]
|
|
44487
|
+
});
|
|
44488
|
+
}
|
|
44167
44489
|
function Dot({ color, label }) {
|
|
44168
44490
|
return /* @__PURE__ */ jsxs137("span", {
|
|
44169
44491
|
className: "flex items-center gap-1",
|
|
@@ -44523,6 +44845,11 @@ function UsageDashboard({ onBack }) {
|
|
|
44523
44845
|
else
|
|
44524
44846
|
window.location.assign("/");
|
|
44525
44847
|
}, [onBack]);
|
|
44848
|
+
const handleScopeChange = useCallback53((next) => {
|
|
44849
|
+
setScope(next);
|
|
44850
|
+
setStats(null);
|
|
44851
|
+
setError(null);
|
|
44852
|
+
}, []);
|
|
44526
44853
|
const projectName = useMemo48(() => {
|
|
44527
44854
|
if (scope === "global") {
|
|
44528
44855
|
const included = stats?.projects?.included.length ?? 0;
|
|
@@ -44588,13 +44915,13 @@ function UsageDashboard({ onBack }) {
|
|
|
44588
44915
|
children: [
|
|
44589
44916
|
/* @__PURE__ */ jsx157("button", {
|
|
44590
44917
|
type: "button",
|
|
44591
|
-
onClick: () =>
|
|
44918
|
+
onClick: () => handleScopeChange("project"),
|
|
44592
44919
|
className: `px-2 py-0.5 rounded transition-colors ${scope === "project" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
44593
44920
|
children: "Project"
|
|
44594
44921
|
}),
|
|
44595
44922
|
/* @__PURE__ */ jsxs137("button", {
|
|
44596
44923
|
type: "button",
|
|
44597
|
-
onClick: () =>
|
|
44924
|
+
onClick: () => handleScopeChange("global"),
|
|
44598
44925
|
className: `px-2 py-0.5 rounded transition-colors inline-flex items-center gap-1 ${scope === "global" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
44599
44926
|
children: [
|
|
44600
44927
|
/* @__PURE__ */ jsx157(Globe25, {
|
|
@@ -44630,10 +44957,7 @@ function UsageDashboard({ onBack }) {
|
|
|
44630
44957
|
className: "rounded-xl border border-destructive/40 bg-destructive/10 p-3 text-xs text-destructive",
|
|
44631
44958
|
children: error
|
|
44632
44959
|
}),
|
|
44633
|
-
loading && !stats && /* @__PURE__ */ jsx157(
|
|
44634
|
-
className: "py-24 text-center text-xs text-muted-foreground",
|
|
44635
|
-
children: "loading…"
|
|
44636
|
-
}),
|
|
44960
|
+
loading && !stats && /* @__PURE__ */ jsx157(UsageDashboardSkeleton, {}),
|
|
44637
44961
|
stats && /* @__PURE__ */ jsxs137(Fragment62, {
|
|
44638
44962
|
children: [
|
|
44639
44963
|
/* @__PURE__ */ jsxs137("div", {
|
|
@@ -44983,4 +45307,4 @@ export {
|
|
|
44983
45307
|
AgentProviderModelFields
|
|
44984
45308
|
};
|
|
44985
45309
|
|
|
44986
|
-
//# debugId=
|
|
45310
|
+
//# debugId=6CD6747FE4C52DF464756E2164756E21
|