@burdenoff/fe-libs 2026.1027.14 → 2026.1028.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/dist/shared/assistant/api.d.ts +18 -3
- package/dist/shared/assistant/api.js +215 -183
- package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -2
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/operations.d.ts +8 -0
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/productAiCredits.d.ts +28 -0
- package/dist/shared/assistant/productAiCredits.js +64 -0
- package/dist/shared/assistant/types.d.ts +15 -0
- package/dist/shared/pages/AiPage.js +92 -66
- package/dist/shared/pages/ai/BreakdownPanel.d.ts +6 -0
- package/dist/shared/pages/ai/BreakdownPanel.js +117 -0
- package/dist/shared/pages/ai/CreditsPanel.d.ts +10 -0
- package/dist/shared/pages/ai/CreditsPanel.js +64 -0
- package/dist/shared/pages/ai/contracts.d.ts +35 -0
- package/dist/shared/pages/ai/contracts.js +93 -1
- package/dist/shared-assistant.js +310 -309
- package/package.json +1 -1
|
@@ -155,5 +155,97 @@ function f(e = /* @__PURE__ */ new Date()) {
|
|
|
155
155
|
to: e.toISOString()
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
+
var p = e`
|
|
159
|
+
query AiOperationsBreakdown(
|
|
160
|
+
$from: DateTime!
|
|
161
|
+
$to: DateTime!
|
|
162
|
+
$productKey: String!
|
|
163
|
+
$groupBy: [PromptUsageDimensionV2!]!
|
|
164
|
+
) {
|
|
165
|
+
promptUsageBreakdownV2(from: $from, to: $to, productKey: $productKey, groupBy: $groupBy) {
|
|
166
|
+
workspaceId
|
|
167
|
+
productKey
|
|
168
|
+
currency
|
|
169
|
+
costKind
|
|
170
|
+
truncated
|
|
171
|
+
rows {
|
|
172
|
+
providerKey
|
|
173
|
+
modelKey
|
|
174
|
+
operationKey
|
|
175
|
+
trigger
|
|
176
|
+
attempts
|
|
177
|
+
totalTokens {
|
|
178
|
+
knownSubtotal
|
|
179
|
+
knownAttempts
|
|
180
|
+
missingAttempts
|
|
181
|
+
}
|
|
182
|
+
costMicroUsd {
|
|
183
|
+
knownSubtotal
|
|
184
|
+
knownAttempts
|
|
185
|
+
missingAttempts
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
`, m = e`
|
|
191
|
+
query AiOperationsCredits($productKey: String!) {
|
|
192
|
+
aiCreditStatus(productKey: $productKey) {
|
|
193
|
+
productKey
|
|
194
|
+
quotaName
|
|
195
|
+
provisioned
|
|
196
|
+
noLimit
|
|
197
|
+
used
|
|
198
|
+
limit
|
|
199
|
+
remaining
|
|
200
|
+
exhausted
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
204
|
+
function h(e) {
|
|
205
|
+
return e == null ? null : a(e);
|
|
206
|
+
}
|
|
207
|
+
function g(e, t) {
|
|
208
|
+
if (t === "MODEL") {
|
|
209
|
+
let t = h(e.providerKey), n = h(e.modelKey);
|
|
210
|
+
return n ? t ? `${t}/${n}` : n : null;
|
|
211
|
+
}
|
|
212
|
+
return h(t === "OPERATION" ? e.operationKey : e.trigger);
|
|
213
|
+
}
|
|
214
|
+
function _(e, t, n, r) {
|
|
215
|
+
let a = i(i(e).promptUsageBreakdownV2);
|
|
216
|
+
if (a.workspaceId !== t || a.productKey !== n || a.currency !== "USD" || a.costKind !== "ESTIMATE" || !Array.isArray(a.rows)) throw Error("AI_READ_SCOPE");
|
|
217
|
+
let c = a.rows.map((e) => {
|
|
218
|
+
let t = i(e), n = s(t.attempts), a = i(t.totalTokens), o = i(t.costMicroUsd);
|
|
219
|
+
return {
|
|
220
|
+
key: g(t, r),
|
|
221
|
+
attempts: n,
|
|
222
|
+
totalTokens: a.knownSubtotal === null ? null : s(a.knownSubtotal),
|
|
223
|
+
costMicroUsd: o.knownSubtotal === null ? null : s(o.knownSubtotal),
|
|
224
|
+
costKnownAttempts: s(o.knownAttempts)
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
return {
|
|
228
|
+
dimension: r,
|
|
229
|
+
rows: c.slice(0, 10),
|
|
230
|
+
more: o(a.truncated) || c.length > 10
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function v(e) {
|
|
234
|
+
if (e === null) return null;
|
|
235
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw Error("AI_READ_SHAPE");
|
|
236
|
+
return e;
|
|
237
|
+
}
|
|
238
|
+
function y(e, t) {
|
|
239
|
+
let n = i(i(e).aiCreditStatus);
|
|
240
|
+
if (n.productKey !== t || n.quotaName !== `${t}.ai.credits`) throw Error("AI_READ_SCOPE");
|
|
241
|
+
return {
|
|
242
|
+
provisioned: o(n.provisioned),
|
|
243
|
+
noLimit: o(n.noLimit),
|
|
244
|
+
exhausted: o(n.exhausted),
|
|
245
|
+
used: v(n.used),
|
|
246
|
+
limit: v(n.limit),
|
|
247
|
+
remaining: v(n.remaining)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
158
250
|
//#endregion
|
|
159
|
-
export { t as MODELS, n as PROVIDERS, r as SUMMARY, c as catalog, u as exactInteger, d as exactUsd, f as sevenDays, l as summary };
|
|
251
|
+
export { p as BREAKDOWN, m as CREDITS, t as MODELS, n as PROVIDERS, r as SUMMARY, _ as breakdown, c as catalog, y as credits, u as exactInteger, d as exactUsd, f as sevenDays, l as summary };
|