dsh-budget 0.3.0 → 0.4.0

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/lib/index.js CHANGED
@@ -1,5 +1,8 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { $ as ZodRecord, $a as $ZodCIDRv4, $i as _overwrite, $n as unknown, $o as $ZodTemplateLiteral, $r as _date, $s as decodeAsync, $t as hostname, A as ZodIPv6, Aa as _uppercase, Ai as _lt, An as pipe, Ao as $ZodMap, Ar as extractDefs, As as $ZodCheckMultipleOf, At as base64url, B as ZodNever, Ba as meta, Bi as _nan, Bn as string$1, Bo as $ZodObjectJIT, Br as _boolean, Bs as _decode, Bt as date$1, C as ZodEmoji, Ca as _tuple, Cc as $ZodEncodeError, Ci as _isoTime, Cn as nonoptional, Co as $ZodISOTime, Cr as ZodISODuration, Cs as $ZodCheckLessThan, Ct as _instanceof, D as ZodFunction, Da as _undefined, Dc as config, Di as _length, Dn as object, Do as $ZodLazy, Dr as toJSONSchema, Ds as $ZodCheckMimeType, Dt as any, E as ZodFile, Ea as _ulid, Ec as NEVER, Ei as _lazy, En as number$1, Eo as $ZodKSUID, Er as allProcessors, Es as $ZodCheckMaxSize, Et as _void$1, F as ZodLiteral, Fa as _uuidv7, Fi as _maxSize, Fn as record, Fo as $ZodNull, Fr as _any, Fs as $ZodCheckSizeEquals, Ft as cidrv6, G as ZodNumberFormat, Ga as registry, Gi as _nonnegative, Gn as symbol, Go as $ZodPromise, Gr as _coercedBigint, Gs as _parseAsync, Gt as emoji, H as ZodNull, Ha as $input, Hi as _nativeEnum, Hn as stringbool, Ho as $ZodPipe, Hr as _check, Hs as _encode, Ht as discriminatedUnion, I as ZodMAC, Ia as _void, Ii as _mime, In as refine, Io as $ZodNullable, Ir as _array, Is as $ZodCheckStartsWith, It as codec, J as ZodPipe, Ja as $ZodBase64, Ji as _normalize, Jn as tuple, Jo as $ZodSet, Jr as _coercedNumber, Js as _safeEncode, Jt as float32, K as ZodObject, Ka as $ZodAny, Ki as _nonoptional, Kn as templateLiteral, Ko as $ZodReadonly, Kr as _coercedBoolean, Ks as _safeDecode, Kt as exactOptional, L as ZodMap, La as _xid, Li as _minLength, Ln as schemas_exports, Lo as $ZodNumber, Lr as _base64, Ls as $ZodCheckStringFormat, Lt as cuid, M as ZodJWT, Ma as _uuid, Mi as _mac, Mn as preprocess, Mo as $ZodNanoID, Mr as initializeContext, Ms as $ZodCheckOverwrite, Mt as boolean$1, N as ZodKSUID, Na as _uuidv4, Ni as _map, Nn as promise, No as $ZodNever, Nr as process, Ns as $ZodCheckProperty, Nt as check, O as ZodGUID, Oa as _union, Oc as globalConfig, Oi as _literal, On as optional, Oo as $ZodLiteral, Or as createStandardJSONSchemaMethod, Os as $ZodCheckMinLength, Ot as array, P as ZodLazy, Pa as _uuidv6, Pi as _maxLength, Pn as readonly, Po as $ZodNonOptional, Pr as TimePrecision, Ps as $ZodCheckRegex, Pt as cidrv4, Q as ZodReadonly, Qa as $ZodBoolean, Qi as _optional, Qn as union, Qo as $ZodSymbol, Qr as _custom, Qs as decode, Qt as hex, R as ZodNaN, Ra as _xor, Ri as _minSize, Rn as set, Ro as $ZodNumberFormat, Rr as _base64url, Rs as $ZodCheckUpperCase, Rt as cuid2, S as ZodEmail, Sa as _trim, Sc as $ZodAsyncError, Si as _isoDuration, Sn as never, So as $ZodISODuration, Sr as ZodISODateTime, Ss as $ZodCheckLengthEquals, St as _function, T as ZodExactOptional, Ta as _uint64, Tc as $constructor, Ti as _ksuid, Tn as nullish, To as $ZodJWT, Tr as iso_exports, Ts as $ZodCheckMaxLength, Tt as _undefined$1, U as ZodNullable, Ua as $output, Ui as _negative, Un as success, Uo as $ZodPrefault, Ur as _cidrv4, Us as _encodeAsync, Ut as e164, V as ZodNonOptional, Va as $ZodRegistry, Vi as _nanoid, Vn as stringFormat, Vo as $ZodOptional, Vr as _catch, Vs as _decodeAsync, Vt as describe$1, W as ZodNumber, Wa as globalRegistry, Wi as _never, Wn as superRefine, Wo as $ZodPreprocess, Wr as _cidrv6, Ws as _parse, Wt as email, X as ZodPreprocess, Xa as $ZodBigInt, Xi as _nullable, Xn as uint64, Xo as $ZodStringFormat, Xr as _cuid, Xs as _safeParse, Xt as guid, Y as ZodPrefault, Ya as $ZodBase64URL, Yi as _null, Yn as uint32, Yo as $ZodString, Yr as _coercedString, Ys as _safeEncodeAsync, Yt as float64, Z as ZodPromise, Za as $ZodBigIntFormat, Zi as _number, Zn as ulid, Zo as $ZodSuccess, Zr as _cuid2, Zs as _safeParseAsync, Zt as hash, _ as ZodCustomStringFormat, _a as _symbol, _c as clone, _i as _intersection, _n as map, _o as $ZodGUID, _r as safeParse$1, _s as $ZodCheck, _t as ZodXor, a as ZodBase64, aa as _record, ac as safeDecodeAsync, ai as _endsWith, an as invertCodec, ao as $ZodCustom, ar as xid, as as $ZodUUID, at as ZodTemplateLiteral, b as ZodDiscriminatedUnion, ba as _toUpperCase, bc as stringifyPrimitive, bi as _isoDate, bn as nanoid, bo as $ZodISODate, br as ZodRealError, bs as $ZodCheckGreaterThan, bt as _default$1, c as ZodBigIntFormat, ca as _set, cc as safeParse, ci as _float32, cn as json, co as $ZodDefault, cr as decodeAsync$1, cs as $ZodUnknown, ct as ZodType, d as ZodCIDRv6, da as _startsWith, dc as $ZodRealError, di as _gte, dn as ksuid, do as $ZodEmail, dr as parse$1, ds as $ZodXor, dt as ZodUUID, ea as _pipe, ec as encode, ei as _default, en as httpUrl, eo as $ZodCIDRv6, er as url, es as $ZodTransform, et as ZodSet, f as ZodCUID, fa as _string, fc as flattenError, fi as _guid, fn as lazy, fo as $ZodEmoji, fr as parseAsync$1, fs as isValidBase64, ft as ZodUndefined, g as ZodCustom, ga as _superRefine, gc as treeifyError, gi as _int64, gn as mac, go as $ZodFunction, gr as safeEncodeAsync$1, gs as Doc, gt as ZodXID, h as ZodCodec, ha as _success, hc as toDotPath, hi as _int32, hn as looseRecord, ho as $ZodFile, hr as safeEncode$1, hs as version, ht as ZodVoid, i as ZodArray, ia as _readonly, ic as safeDecode, ii as _emoji, in as intersection, io as $ZodCodec, ir as uuidv7, is as $ZodURL, it as ZodSymbol, j as ZodIntersection, ja as _url, ji as _lte, jn as prefault, jo as $ZodNaN, jr as finalize, js as $ZodCheckNumberFormat, jt as bigint$1, k as ZodIPv4, ka as _unknown, ki as _lowercase, kn as partialRecord, ko as $ZodMAC, kr as createToJSONSchemaMethod, ks as $ZodCheckMinSize, kt as base64, l as ZodBoolean, la as _size, lc as safeParseAsync, li as _float64, ln as jwt, lo as $ZodDiscriminatedUnion, lr as encode$1, ls as $ZodVoid, lt as ZodULID, m as ZodCatch, ma as _stringbool, mc as prettifyError, mi as _int, mn as looseObject, mo as $ZodExactOptional, mr as safeDecodeAsync$1, ms as isValidJWT, mt as ZodUnknown, n as BUDGET_SETTINGS_SCHEMA, na as _promise, nc as parse, ni as _e164, nn as int32, no as $ZodCUID2, nr as uuidv4, ns as $ZodType, nt as ZodStringFormat, o as ZodBase64URL, oa as _refine, oc as safeEncode, oi as _enum, on as ipv4, oo as $ZodCustomStringFormat, or as xor, os as $ZodUndefined, ot as ZodTransform, p as ZodCUID2, pa as _stringFormat, pc as formatError, pi as _includes, pn as literal, po as $ZodEnum, pr as safeDecode$1, ps as isValidBase64URL, pt as ZodUnion, q as ZodOptional, qa as $ZodArray, qi as _nonpositive, qn as transform, qo as $ZodRecord, qr as _coercedDate, qs as _safeDecodeAsync, qt as file, r as ZodAny, ra as _property, rc as parseAsync, ri as _email, rn as int64, ro as $ZodCatch, rr as uuidv6, rs as $ZodULID, rt as ZodSuccess, s as ZodBigInt, sa as _regex, sc as safeEncodeAsync, si as _file, sn as ipv6, so as $ZodDate, sr as decode$1, ss as $ZodUnion, st as ZodTuple, ta as _positive, tc as encodeAsync, ti as _discriminatedUnion, tn as int, to as $ZodCUID, tr as uuid, ts as $ZodTuple, tt as ZodString, u as ZodCIDRv4, ua as _slugify, uc as $ZodError, ui as _gt, un as keyof, uo as $ZodE164, ur as encodeAsync$1, us as $ZodXID, ut as ZodURL, v as ZodDate, va as _templateLiteral, vc as joinValues, vi as _ipv4, vn as meta$1, vo as $ZodIPv4, vr as safeParseAsync$1, vs as $ZodCheckBigIntFormat, vt as _ZodString, w as ZodEnum, wa as _uint32, wc as $brand, wi as _jwt, wn as nullable, wo as $ZodIntersection, wr as ZodISOTime, ws as $ZodCheckLowerCase, wt as _null$1, x as ZodE164, xa as _transform, xc as util_exports, xi as _isoDateTime, xn as nativeEnum, xo as $ZodISODateTime, xr as ZodISODate, xs as $ZodCheckIncludes, xt as _enum$1, y as ZodDefault, ya as _toLowerCase, yc as parsedType, yi as _ipv6, yn as nan, yo as $ZodIPv6, yr as ZodError, ys as $ZodCheckEndsWith, yt as _catch$1, z as ZodNanoID, za as describe, zi as _multipleOf, zn as strictObject, zo as $ZodObject, zr as _bigint, zs as regexes_exports, zt as custom } from "./wire-zYaXk7IG.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
+ import { $ as ZodRecord, $a as $ZodCIDRv4, $i as _overwrite, $n as unknown, $o as $ZodTemplateLiteral, $r as _date, $s as decodeAsync, $t as hostname, A as ZodIPv6, Aa as _uppercase, Ai as _lt, An as pipe, Ao as $ZodMap, Ar as extractDefs, As as $ZodCheckMultipleOf, At as base64url, B as ZodNever, Ba as meta, Bi as _nan, Bn as string$1, Bo as $ZodObjectJIT, Br as _boolean, Bs as _decode, Bt as date$1, C as ZodEmoji, Ca as _tuple, Cc as $ZodEncodeError, Ci as _isoTime, Cn as nonoptional, Co as $ZodISOTime, Cr as ZodISODuration, Cs as $ZodCheckLessThan, Ct as _instanceof, D as ZodFunction, Da as _undefined, Dc as config, Di as _length, Dn as object, Do as $ZodLazy, Dr as toJSONSchema, Ds as $ZodCheckMimeType, Dt as any, E as ZodFile, Ea as _ulid, Ec as NEVER, Ei as _lazy, En as number$1, Eo as $ZodKSUID, Er as allProcessors, Es as $ZodCheckMaxSize, Et as _void$1, F as ZodLiteral, Fa as _uuidv7, Fi as _maxSize, Fn as record, Fo as $ZodNull, Fr as _any, Fs as $ZodCheckSizeEquals, Ft as cidrv6, G as ZodNumberFormat, Ga as registry, Gi as _nonnegative, Gn as symbol, Go as $ZodPromise, Gr as _coercedBigint, Gs as _parseAsync, Gt as emoji, H as ZodNull, Ha as $input, Hi as _nativeEnum, Hn as stringbool, Ho as $ZodPipe, Hr as _check, Hs as _encode, Ht as discriminatedUnion, I as ZodMAC, Ia as _void, Ii as _mime, In as refine, Io as $ZodNullable, Ir as _array, Is as $ZodCheckStartsWith, It as codec, J as ZodPipe, Ja as $ZodBase64, Ji as _normalize, Jn as tuple, Jo as $ZodSet, Jr as _coercedNumber, Js as _safeEncode, Jt as float32, K as ZodObject, Ka as $ZodAny, Ki as _nonoptional, Kn as templateLiteral, Ko as $ZodReadonly, Kr as _coercedBoolean, Ks as _safeDecode, Kt as exactOptional, L as ZodMap, La as _xid, Li as _minLength, Ln as schemas_exports, Lo as $ZodNumber, Lr as _base64, Ls as $ZodCheckStringFormat, Lt as cuid, M as ZodJWT, Ma as _uuid, Mi as _mac, Mn as preprocess, Mo as $ZodNanoID, Mr as initializeContext, Ms as $ZodCheckOverwrite, Mt as boolean$1, N as ZodKSUID, Na as _uuidv4, Ni as _map, Nn as promise, No as $ZodNever, Nr as process, Ns as $ZodCheckProperty, Nt as check, O as ZodGUID, Oa as _union, Oc as globalConfig, Oi as _literal, On as optional, Oo as $ZodLiteral, Or as createStandardJSONSchemaMethod, Os as $ZodCheckMinLength, Ot as array, P as ZodLazy, Pa as _uuidv6, Pi as _maxLength, Pn as readonly, Po as $ZodNonOptional, Pr as TimePrecision, Ps as $ZodCheckRegex, Pt as cidrv4, Q as ZodReadonly, Qa as $ZodBoolean, Qi as _optional, Qn as union, Qo as $ZodSymbol, Qr as _custom, Qs as decode, Qt as hex, R as ZodNaN, Ra as _xor, Ri as _minSize, Rn as set, Ro as $ZodNumberFormat, Rr as _base64url, Rs as $ZodCheckUpperCase, Rt as cuid2, S as ZodEmail, Sa as _trim, Sc as $ZodAsyncError, Si as _isoDuration, Sn as never, So as $ZodISODuration, Sr as ZodISODateTime, Ss as $ZodCheckLengthEquals, St as _function, T as ZodExactOptional, Ta as _uint64, Tc as $constructor, Ti as _ksuid, Tn as nullish, To as $ZodJWT, Tr as iso_exports, Ts as $ZodCheckMaxLength, Tt as _undefined$1, U as ZodNullable, Ua as $output, Ui as _negative, Un as success, Uo as $ZodPrefault, Ur as _cidrv4, Us as _encodeAsync, Ut as e164, V as ZodNonOptional, Va as $ZodRegistry, Vi as _nanoid, Vn as stringFormat, Vo as $ZodOptional, Vr as _catch, Vs as _decodeAsync, Vt as describe$1, W as ZodNumber, Wa as globalRegistry, Wi as _never, Wn as superRefine, Wo as $ZodPreprocess, Wr as _cidrv6, Ws as _parse, Wt as email, X as ZodPreprocess, Xa as $ZodBigInt, Xi as _nullable, Xn as uint64, Xo as $ZodStringFormat, Xr as _cuid, Xs as _safeParse, Xt as guid, Y as ZodPrefault, Ya as $ZodBase64URL, Yi as _null, Yn as uint32, Yo as $ZodString, Yr as _coercedString, Ys as _safeEncodeAsync, Yt as float64, Z as ZodPromise, Za as $ZodBigIntFormat, Zi as _number, Zn as ulid, Zo as $ZodSuccess, Zr as _cuid2, Zs as _safeParseAsync, Zt as hash, _ as ZodCustomStringFormat, _a as _symbol, _c as clone, _i as _intersection, _n as map, _o as $ZodGUID, _r as safeParse$1, _s as $ZodCheck, _t as ZodXor, a as ZodBase64, aa as _record, ac as safeDecodeAsync, ai as _endsWith, an as invertCodec, ao as $ZodCustom, ar as xid, as as $ZodUUID, at as ZodTemplateLiteral, b as ZodDiscriminatedUnion, ba as _toUpperCase, bc as stringifyPrimitive, bi as _isoDate, bn as nanoid, bo as $ZodISODate, br as ZodRealError, bs as $ZodCheckGreaterThan, bt as _default$1, c as ZodBigIntFormat, ca as _set, cc as safeParse, ci as _float32, cn as json, co as $ZodDefault, cr as decodeAsync$1, cs as $ZodUnknown, ct as ZodType, d as ZodCIDRv6, da as _startsWith, dc as $ZodRealError, di as _gte, dn as ksuid, do as $ZodEmail, dr as parse$1, ds as $ZodXor, dt as ZodUUID, ea as _pipe, ec as encode, ei as _default, en as httpUrl, eo as $ZodCIDRv6, er as url, es as $ZodTransform, et as ZodSet, f as ZodCUID, fa as _string, fc as flattenError, fi as _guid, fn as lazy, fo as $ZodEmoji, fr as parseAsync$1, fs as isValidBase64, ft as ZodUndefined, g as ZodCustom, ga as _superRefine, gc as treeifyError, gi as _int64, gn as mac, go as $ZodFunction, gr as safeEncodeAsync$1, gs as Doc, gt as ZodXID, h as ZodCodec, ha as _success, hc as toDotPath, hi as _int32, hn as looseRecord, ho as $ZodFile, hr as safeEncode$1, hs as version, ht as ZodVoid, i as ZodArray, ia as _readonly, ic as safeDecode, ii as _emoji, in as intersection, io as $ZodCodec, ir as uuidv7, is as $ZodURL, it as ZodSymbol, j as ZodIntersection, ja as _url, ji as _lte, jn as prefault, jo as $ZodNaN, jr as finalize, js as $ZodCheckNumberFormat, jt as bigint$1, k as ZodIPv4, ka as _unknown, ki as _lowercase, kn as partialRecord, ko as $ZodMAC, kr as createToJSONSchemaMethod, ks as $ZodCheckMinSize, kt as base64, l as ZodBoolean, la as _size, lc as safeParseAsync, li as _float64, ln as jwt, lo as $ZodDiscriminatedUnion, lr as encode$1, ls as $ZodVoid, lt as ZodULID, m as ZodCatch, ma as _stringbool, mc as prettifyError, mi as _int, mn as looseObject, mo as $ZodExactOptional, mr as safeDecodeAsync$1, ms as isValidJWT, mt as ZodUnknown, n as BUDGET_SETTINGS_SCHEMA, na as _promise, nc as parse, ni as _e164, nn as int32, no as $ZodCUID2, nr as uuidv4, ns as $ZodType, nt as ZodStringFormat, o as ZodBase64URL, oa as _refine, oc as safeEncode, oi as _enum, on as ipv4, oo as $ZodCustomStringFormat, or as xor, os as $ZodUndefined, ot as ZodTransform, p as ZodCUID2, pa as _stringFormat, pc as formatError, pi as _includes, pn as literal, po as $ZodEnum, pr as safeDecode$1, ps as isValidBase64URL, pt as ZodUnion, q as ZodOptional, qa as $ZodArray, qi as _nonpositive, qn as transform, qo as $ZodRecord, qr as _coercedDate, qs as _safeDecodeAsync, qt as file, r as ZodAny, ra as _property, rc as parseAsync, ri as _email, rn as int64, ro as $ZodCatch, rr as uuidv6, rs as $ZodULID, rt as ZodSuccess, s as ZodBigInt, sa as _regex, sc as safeEncodeAsync, si as _file, sn as ipv6, so as $ZodDate, sr as decode$1, ss as $ZodUnion, st as ZodTuple, ta as _positive, tc as encodeAsync, ti as _discriminatedUnion, tn as int, to as $ZodCUID, tr as uuid, ts as $ZodTuple, tt as ZodString, u as ZodCIDRv4, ua as _slugify, uc as $ZodError, ui as _gt, un as keyof, uo as $ZodE164, ur as encodeAsync$1, us as $ZodXID, ut as ZodURL, v as ZodDate, va as _templateLiteral, vc as joinValues, vi as _ipv4, vn as meta$1, vo as $ZodIPv4, vr as safeParseAsync$1, vs as $ZodCheckBigIntFormat, vt as _ZodString, w as ZodEnum, wa as _uint32, wc as $brand, wi as _jwt, wn as nullable, wo as $ZodIntersection, wr as ZodISOTime, ws as $ZodCheckLowerCase, wt as _null$1, x as ZodE164, xa as _transform, xc as util_exports, xi as _isoDateTime, xn as nativeEnum, xo as $ZodISODateTime, xr as ZodISODate, xs as $ZodCheckIncludes, xt as _enum$1, y as ZodDefault, ya as _toLowerCase, yc as parsedType, yi as _ipv6, yn as nan, yo as $ZodIPv6, yr as ZodError, ys as $ZodCheckEndsWith, yt as _catch$1, z as ZodNanoID, za as describe, zi as _multipleOf, zn as strictObject, zo as $ZodObject, zr as _bigint, zs as regexes_exports, zt as custom } from "./wire-DE0ooHk0.js";
3
+ import { createRequire } from "node:module";
4
+ import { readFileSync } from "node:fs";
5
+ import { dirname, join } from "node:path";
3
6
  import z from "@deepseek-ai/schemastery";
4
7
  import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
5
8
  import { defineDomain, domainTable } from "@deepseek-ai/dsh-storage-domain";
@@ -965,6 +968,27 @@ async function sendWebhook(url, payload, timeoutMs, logger) {
965
968
  const ALERT_EVENT = "budget/alert";
966
969
  /** The block audit event type. */
967
970
  const BLOCK_EVENT = "budget/block";
971
+ /**
972
+ * Decide whether `budget/alert` and `budget/block` appends are safe on this
973
+ * host line. From 0.1.2-alpha.1 the session read path refuses logs
974
+ * containing event types outside the harness-known vocabulary and exposes no
975
+ * external registration surface, so appends would poison the log. Earlier
976
+ * lines accept any event type and keep the legacy write behavior; an
977
+ * undefined or unparseable version is treated as legacy.
978
+ *
979
+ * @param sessionVersion - the installed @deepseek-ai/dsh-session version
980
+ * (the session package ships with the harness and carries its line version).
981
+ * @returns true when audit appends are safe on the host.
982
+ */
983
+ function auditAppendsAllowed(sessionVersion) {
984
+ if (sessionVersion === void 0) return true;
985
+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(sessionVersion);
986
+ if (match === null) return true;
987
+ const major = Number(match[1]);
988
+ const minor = Number(match[2]);
989
+ const patch = Number(match[3]);
990
+ return major * 1e6 + minor * 1e3 + patch < 1002;
991
+ }
968
992
  //#endregion
969
993
  //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ar.js
970
994
  const error$49 = () => {
@@ -7950,6 +7974,32 @@ const budgetDomainSpec = defineDomain({
7950
7974
  });
7951
7975
  //#endregion
7952
7976
  //#region src/index.ts
7977
+ /**
7978
+ * The installed `@deepseek-ai/dsh-session` version: the session package
7979
+ * ships with the harness, so its version names the harness line. Read from
7980
+ * the package manifest next to the resolved entry.
7981
+ *
7982
+ * @returns the harness-line version, or undefined when the peer cannot be
7983
+ * resolved or the manifest cannot be read.
7984
+ */
7985
+ function installedSessionVersion() {
7986
+ try {
7987
+ const entry = createRequire(import.meta.url).resolve("@deepseek-ai/dsh-session");
7988
+ let dir = dirname(entry);
7989
+ for (let depth = 0; depth < 6; depth++) {
7990
+ try {
7991
+ const manifest = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
7992
+ if (manifest.name === "@deepseek-ai/dsh-session" && typeof manifest.version === "string") return manifest.version;
7993
+ } catch (error) {}
7994
+ const parent = dirname(dir);
7995
+ if (parent === dir) return void 0;
7996
+ dir = parent;
7997
+ }
7998
+ return;
7999
+ } catch (error) {
8000
+ return;
8001
+ }
8002
+ }
7953
8003
  const name = "dsh-budget";
7954
8004
  /** Hard services: the session store every aggregation keys off. */
7955
8005
  const inject = ["sessions"];
@@ -8036,7 +8086,10 @@ async function apply(ctx, config) {
8036
8086
  desktopNotifications: resolved.desktopNotifications
8037
8087
  };
8038
8088
  let degradation;
8089
+ const auditWritable = auditAppendsAllowed(installedSessionVersion());
8090
+ if (!auditWritable) logger.warn("budget audit events suppressed on this harness (>= 0.1.2-alpha.1): the fail-closed session event vocabulary rejects logs containing unregistered event types and exposes no external registration surface; the alert/block trail degrades to the budget logger and webhook only");
8039
8091
  const append = (session, type, event) => {
8092
+ if (!auditWritable) return;
8040
8093
  queueMicrotask(() => {
8041
8094
  try {
8042
8095
  session.append(type, event);
@@ -8135,4 +8188,4 @@ async function apply(ctx, config) {
8135
8188
  if (commands !== void 0) ctx.effect(() => commands.register(budgetCommand(ctx.get("budget"), resolved.outputLanguage)), "dsh-budget: /budget command");
8136
8189
  }
8137
8190
  //#endregion
8138
- export { ALERT_EVENT, BLOCK_EVENT, BudgetAggregator, BudgetService, Config, apply, budgetCommand, budgetDomainSpec, budgetStateSchema, checkBudgets, degradationFor, effectiveCap, inject, name, parseBudgetArgs, renderBudgetModels, renderBudgetOverview, resolveConfig };
8191
+ export { ALERT_EVENT, BLOCK_EVENT, BudgetAggregator, BudgetService, Config, apply, auditAppendsAllowed, budgetCommand, budgetDomainSpec, budgetStateSchema, checkBudgets, degradationFor, effectiveCap, inject, name, parseBudgetArgs, renderBudgetModels, renderBudgetOverview, resolveConfig };
@@ -1,3 +1,4 @@
1
+ import "node:module";
1
2
  //#region \0rolldown/runtime.js
2
3
  var __defProp = Object.defineProperty;
3
4
  var __exportAll = (all, no_symbols) => {
@@ -1,4 +1,4 @@
1
- import { t as BUDGET_INVOCATIONS } from "./wire-zYaXk7IG.js";
1
+ import { t as BUDGET_INVOCATIONS } from "./wire-DE0ooHk0.js";
2
2
  //#region src/typert.host.ts
3
3
  /**
4
4
  * The hand-written Typert HOST manifest for `dsh-budget`, exported as
@@ -2,12 +2,12 @@
2
2
  * `dsh-budget`, browser half: mounts the `budget` Remote contribution, then
3
3
  * registers the budget tab into the Plugins settings section
4
4
  * (`settings.plugins.tab`, id `budget`). All data arrives through the
5
- * `remote.budget` namespace — the tab issues no other RPC and holds no state
5
+ * `remote.budget` namespace 鈥?the tab issues no other RPC and holds no state
6
6
  * of its own beyond the edit form and the last loaded snapshot.
7
7
  *
8
8
  * @module dsh-budget/client
9
9
  */
10
- import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
10
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
11
11
  import { type BudgetLocaleKey } from './locales.js';
12
12
  export type { BudgetTabInjected, BudgetTabProps } from './BudgetTab.js';
13
13
  export type { BudgetLocaleKey } from './locales.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAM3E,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAM3D,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpF,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,gCAAgC;QAChC,iBAAiB,EAAE,eAAe,CAAA;KACnC;CACF;AAED,iDAAiD;AACjD,eAAO,MAAM,EAAE,oBAAoB,CAAA;AAEnC,kFAAkF;AAClF,eAAO,MAAM,IAAI,eAAe,CAAA;AAEhC,gGAAgG;AAChG,eAAO,MAAM,MAAM,UAA4C,CAAA;AAE/D;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAcnE,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAM3D,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACxE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpF,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,gCAAgC;QAChC,iBAAiB,EAAE,eAAe,CAAA;KACnC;CACF;AAED,iDAAiD;AACjD,eAAO,MAAM,EAAE,oBAAoB,CAAA;AAEnC,kFAAkF;AAClF,eAAO,MAAM,IAAI,eAAe,CAAA;AAEhC,gGAAgG;AAChG,eAAO,MAAM,MAAM,UAA4C,CAAA;AAE/D;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC7D"}
@@ -38,7 +38,17 @@ export declare const BUDGET_REMOTE: Readonly<{
38
38
  readonly invocation: Readonly<{
39
39
  kind: "direct";
40
40
  }>;
41
- readonly parameters: readonly never[];
41
+ readonly parameters: readonly Readonly<{
42
+ name: string;
43
+ wire: string;
44
+ source: "json";
45
+ codec: Readonly<{
46
+ mode: "strict";
47
+ typeSymbol: "dsh-budget/types#SessionId";
48
+ schema: import("zod").ZodOptional<import("zod").ZodString>;
49
+ }>;
50
+ acceptsUndefined: true;
51
+ }>[];
42
52
  readonly result: Readonly<{
43
53
  mode: "strict";
44
54
  typeSymbol: "dsh-budget/types#BudgetStatus";
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/client/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,kCAAkC,CAAA;AAE9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,4BAA4B;QACpC,6DAA6D;QAC7D,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;QACnE,4DAA4D;QAC5D,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;QAC1E,sDAAsD;QACtD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;KAChE;IACD,UAAU,eAAe;QACvB,eAAe,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;QAC5E,oBAAoB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;QACnF,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;KACzE;IACD,UAAU,wBAAwB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CAAA;QACnF,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAA;KACzE;IACD,UAAU,wBAAwB;QAChC,MAAM,EAAE,4BAA4B,CAAA;KACrC;CACF;AAED,iEAAiE;AACjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGW,CAAA"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Session audit events for `dsh-budget` (declaration merging into the
3
3
  * harness `SessionEventMap`). Both events are log-only: the panel/command
4
- * surfaces are the model-visible projections, and these events keep the
5
- * alert/block trail reconstructable from the session log. Amounts are plain
4
+ * surfaces are the model-visible projections; on legacy harnesses these
5
+ * events keep the alert/block trail reconstructable from the session log
6
+ * (see auditAppendsAllowed for the fail-closed gate). Amounts are plain
6
7
  * numbers, webhook URLs are sanitized before they ever reach a payload.
7
8
  *
8
9
  * @module dsh-budget/events
@@ -38,6 +39,19 @@ declare module '@deepseek-ai/dsh-session/types' {
38
39
  export declare const ALERT_EVENT: "budget/alert";
39
40
  /** The block audit event type. */
40
41
  export declare const BLOCK_EVENT: "budget/block";
42
+ /**
43
+ * Decide whether `budget/alert` and `budget/block` appends are safe on this
44
+ * host line. From 0.1.2-alpha.1 the session read path refuses logs
45
+ * containing event types outside the harness-known vocabulary and exposes no
46
+ * external registration surface, so appends would poison the log. Earlier
47
+ * lines accept any event type and keep the legacy write behavior; an
48
+ * undefined or unparseable version is treated as legacy.
49
+ *
50
+ * @param sessionVersion - the installed @deepseek-ai/dsh-session version
51
+ * (the session package ships with the harness and carries its line version).
52
+ * @returns true when audit appends are safe on the host.
53
+ */
54
+ export declare function auditAppendsAllowed(sessionVersion: string | undefined): boolean;
41
55
  /** Alert payload type. */
42
56
  export type BudgetAlertEvent = {
43
57
  scope: 'session' | 'daily' | 'monthly';
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,UAAU,eAAe;QACvB;;;WAGG;QACH,cAAc,EAAE;YACd,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;YACtC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;YACrB,OAAO,EAAE,MAAM,CAAA;YACf,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;QACD;;;;WAIG;QACH,cAAc,EAAE;YACd,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;YACtC,OAAO,EAAE,OAAO,CAAA;YAChB,WAAW,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,EAAE,EAAE,MAAM,CAAA;aAAE,CAAA;SAC3C,CAAA;KACF;CACF;AAED,kCAAkC;AAClC,eAAO,MAAM,WAAW,EAAG,cAAuB,CAAA;AAElD,kCAAkC;AAClC,eAAO,MAAM,WAAW,EAAG,cAAuB,CAAA;AAElD,0BAA0B;AAC1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;IACtC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,0BAA0B;AAC1B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS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AO,GAAG,SAAS,CAAA;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C,CAAA"}
@@ -5,7 +5,8 @@
5
5
  * alert/block/degrade over-limit policies; per-model latency statistics; the
6
6
  * `budget` Typert Remote (`budget/status`, `budget/setSettings`,
7
7
  * `budget/unblock`) that the browser half's Settings tab consumes; the
8
- * `/budget` command; and `budget/alert` + `budget/block` session audit events.
8
+ * `/budget` command; and `budget/alert` + `budget/block` session audit events
9
+ * (suppressed on hosts whose fail-closed event vocabulary rejects them).
9
10
  *
10
11
  * Function plugin 鈥?no default export (the Loader unwraps
11
12
  * `exports.default ?? exports`).
@@ -38,7 +39,7 @@ export type { PersistedBudgetState, PersistedBucket, PersistedModelUsage } from
38
39
  export { checkBudgets, degradationFor } from './governance.js';
39
40
  export { BudgetService, effectiveCap } from './service.js';
40
41
  export { budgetCommand, parseBudgetArgs, renderBudgetModels, renderBudgetOverview } from './command.js';
41
- export { ALERT_EVENT, BLOCK_EVENT } from './events.js';
42
+ export { ALERT_EVENT, auditAppendsAllowed, BLOCK_EVENT } from './events.js';
42
43
  export { budgetDomainSpec, budgetStateSchema } from './store.js';
43
44
  /**
44
45
  * Mount the plugin: resolve config, build the aggregator, restore any durable
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAA;AASnD,eAAO,MAAM,IAAI,eAAe,CAAA;AAEhC,mEAAmE;AACnE,eAAO,MAAM,MAAM,UAAe,CAAA;AAElC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;A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Ac,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACvG,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAqBhE;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgLvE"}
@@ -21,7 +21,17 @@ export declare const TYPERT: Readonly<{
21
21
  readonly invocation: Readonly<{
22
22
  kind: "direct";
23
23
  }>;
24
- readonly parameters: readonly never[];
24
+ readonly parameters: readonly Readonly<{
25
+ name: string;
26
+ wire: string;
27
+ source: "json";
28
+ codec: Readonly<{
29
+ mode: "strict";
30
+ typeSymbol: "dsh-budget/types#SessionId";
31
+ schema: import("zod").ZodOptional<import("zod").ZodString>;
32
+ }>;
33
+ acceptsUndefined: true;
34
+ }>[];
25
35
  readonly result: Readonly<{
26
36
  mode: "strict";
27
37
  typeSymbol: "dsh-budget/types#BudgetStatus";
@@ -1 +1 @@
1
- {"version":3,"file":"typert.host.d.ts","sourceRoot":"","sources":["../../src/typert.host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAA"}
1
+ {"version":3,"file":"typert.host.d.ts","sourceRoot":"","sources":["../../src/typert.host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAA"}
@@ -140,11 +140,16 @@ export declare const BUDGET_STATUS_SCHEMA: z.ZodObject<{
140
140
  warnRatio: z.ZodNumber;
141
141
  refreshIntervalMs: z.ZodNumber;
142
142
  }, z.core.$strip>;
143
+ /** Strict wire schema for the optional status session id. */
144
+ export declare const BUDGET_SESSION_ID_SCHEMA: z.ZodOptional<z.ZodString>;
143
145
  /**
144
146
  * The `budget/status` invocation descriptor, shared verbatim by the host
145
147
  * `TYPERT` manifest and the client `TypertRemoteContribution`. Hand-written
146
148
  * in the exact shape the Typert generator emits; validated by the typert
147
- * loader and the client registry at mount time.
149
+ * loader and the client registry at mount time. The optional `sessionId`
150
+ * parameter matches `BudgetService.status(sessionId?)` and the client
151
+ * `remote.budget.status(sessionId?)` — it attributes the snapshot to one
152
+ * session and may be omitted (missing wire fields decode to `undefined`).
148
153
  */
149
154
  export declare const BUDGET_STATUS_DESCRIPTOR: Readonly<{
150
155
  readonly id: "dsh-budget#budget/status";
@@ -154,7 +159,17 @@ export declare const BUDGET_STATUS_DESCRIPTOR: Readonly<{
154
159
  readonly invocation: Readonly<{
155
160
  kind: "direct";
156
161
  }>;
157
- readonly parameters: readonly never[];
162
+ readonly parameters: readonly Readonly<{
163
+ name: string;
164
+ wire: string;
165
+ source: "json";
166
+ codec: Readonly<{
167
+ mode: "strict";
168
+ typeSymbol: "dsh-budget/types#SessionId";
169
+ schema: z.ZodOptional<z.ZodString>;
170
+ }>;
171
+ acceptsUndefined: true;
172
+ }>[];
158
173
  readonly result: Readonly<{
159
174
  mode: "strict";
160
175
  typeSymbol: "dsh-budget/types#BudgetStatus";
@@ -444,7 +459,17 @@ export declare const BUDGET_INVOCATIONS: readonly (Readonly<{
444
459
  readonly invocation: Readonly<{
445
460
  kind: "direct";
446
461
  }>;
447
- readonly parameters: readonly never[];
462
+ readonly parameters: readonly Readonly<{
463
+ name: string;
464
+ wire: string;
465
+ source: "json";
466
+ codec: Readonly<{
467
+ mode: "strict";
468
+ typeSymbol: "dsh-budget/types#SessionId";
469
+ schema: z.ZodOptional<z.ZodString>;
470
+ }>;
471
+ acceptsUndefined: true;
472
+ }>[];
448
473
  readonly result: Readonly<{
449
474
  mode: "strict";
450
475
  typeSymbol: "dsh-budget/types#BudgetStatus";
@@ -1 +1 @@
1
- {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,0CAA0C;AAC1C,eAAO,MAAM,aAAa,0CAA2C,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,oDAAoD;AACpD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,CAAA;IAClB,oCAAoC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;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;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBD,CAAA;AAE1C,wDAAwD;AACxD,eAAO,MAAM,2BAA2B;;;;EAAwB,CAAA;AAEhE;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBI,CAAA;AAE1C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAI7B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
3
3
  var _a$1;
4
4
  /** A special constant with type `never` */
@@ -6900,11 +6900,16 @@ const BUDGET_STATUS_SCHEMA = object({
6900
6900
  warnRatio: number().min(0).max(1),
6901
6901
  refreshIntervalMs: number().int().min(1e3)
6902
6902
  });
6903
+ /** Strict wire schema for the optional status session id. */
6904
+ const BUDGET_SESSION_ID_SCHEMA = string().optional();
6903
6905
  /**
6904
6906
  * The `budget/status` invocation descriptor, shared verbatim by the host
6905
6907
  * `TYPERT` manifest and the client `TypertRemoteContribution`. Hand-written
6906
6908
  * in the exact shape the Typert generator emits; validated by the typert
6907
- * loader and the client registry at mount time.
6909
+ * loader and the client registry at mount time. The optional `sessionId`
6910
+ * parameter matches `BudgetService.status(sessionId?)` and the client
6911
+ * `remote.budget.status(sessionId?)` — it attributes the snapshot to one
6912
+ * session and may be omitted (missing wire fields decode to `undefined`).
6908
6913
  */
6909
6914
  const BUDGET_STATUS_DESCRIPTOR = Object.freeze({
6910
6915
  id: "dsh-budget#budget/status",
@@ -6912,7 +6917,17 @@ const BUDGET_STATUS_DESCRIPTOR = Object.freeze({
6912
6917
  namespace: "budget",
6913
6918
  method: "status",
6914
6919
  invocation: Object.freeze({ kind: "direct" }),
6915
- parameters: Object.freeze([]),
6920
+ parameters: Object.freeze([Object.freeze({
6921
+ name: "sessionId",
6922
+ wire: "sessionId",
6923
+ source: "json",
6924
+ codec: Object.freeze({
6925
+ mode: "strict",
6926
+ typeSymbol: "dsh-budget/types#SessionId",
6927
+ schema: BUDGET_SESSION_ID_SCHEMA
6928
+ }),
6929
+ acceptsUndefined: true
6930
+ })]),
6916
6931
  result: Object.freeze({
6917
6932
  mode: "strict",
6918
6933
  typeSymbol: "dsh-budget/types#BudgetStatus",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-budget",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Cost governance for DeepSeek Harness: aggregated token/cost metering per model, session and day, session/daily/monthly budget caps with threshold alerts (desktop notification + webhook) and alert/block/degrade over-limit policies, built-in carbon footprint estimation and per-model latency benchmarks, a Settings budget tab, and the /budget command",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,7 +51,6 @@
51
51
  "platform": "web",
52
52
  "inject": [
53
53
  "@deepseek-ai/dsh-client-connection",
54
- "@deepseek-ai/dsh-client-runtime",
55
54
  "@deepseek-ai/dsh-client-locale",
56
55
  "@deepseek-ai/dsh-client-ui-settings"
57
56
  ]
@@ -123,7 +122,21 @@
123
122
  "@deepseek-ai/dsh-token-meter": ">=0.1.0-rc.8 <0.2.0",
124
123
  "@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
125
124
  "@deepseek-ai/dsh-typert-protocol": ">=0.1.0-rc.8 <0.2.0",
126
- "@deepseek-ai/schemastery": "^3.18.0"
125
+ "@deepseek-ai/schemastery": "^3.18.0",
126
+ "@deepseek-ai/dsh-client-connection": ">=0.1.1-rc.2 <0.2.0",
127
+ "@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0",
128
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.1-rc.2 <0.2.0"
129
+ },
130
+ "peerDependenciesMeta": {
131
+ "@deepseek-ai/dsh-client-connection": {
132
+ "optional": true
133
+ },
134
+ "@deepseek-ai/dsh-client-locale": {
135
+ "optional": true
136
+ },
137
+ "@deepseek-ai/dsh-client-ui-settings": {
138
+ "optional": true
139
+ }
127
140
  },
128
141
  "dependencies": {
129
142
  "tsdown": "^0.22.14",
@@ -137,7 +150,6 @@
137
150
  "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
138
151
  "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
139
152
  "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
140
- "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
141
153
  "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
142
154
  "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
143
155
  "@deepseek-ai/dsh-commands": "0.1.1-rc.2",
@@ -169,5 +181,9 @@
169
181
  "verify:self-contained": "node scripts/verify-self-contained.mjs",
170
182
  "verify:artifacts": "node scripts/verify-artifacts.mjs"
171
183
  },
172
- "license": "Apache-2.0"
184
+ "license": "Apache-2.0",
185
+ "funding": {
186
+ "type": "individual",
187
+ "url": "https://github.com/sponsors/PerryLink"
188
+ }
173
189
  }