@carrierllc/mcp 0.11.8 → 0.11.9

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/cli.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  verifyStorefront,
40
40
  walletScreen,
41
41
  which
42
- } from "./chunk-Y2CFRFGC.js";
42
+ } from "./chunk-BPCTRBF3.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ import {
65
65
  usageOverPeriodParams,
66
66
  verifyStorefront,
67
67
  withOcsListSummary
68
- } from "./chunk-Y2CFRFGC.js";
68
+ } from "./chunk-BPCTRBF3.js";
69
69
  import "./chunk-SHKKVIIA.js";
70
70
 
71
71
  // src/index.ts
@@ -9888,6 +9888,7 @@ async function assertManagedIccidAccess(baseUrl2, auth, iccid) {
9888
9888
  }
9889
9889
 
9890
9890
  // ../../packages/ocs-spec/src/ocs-event-buffer-read.ts
9891
+ var LIFECYCLE_RESELLER_ID2 = 1170;
9891
9892
  function ocsEventRingBufferIccidFromDigitsReference(raw) {
9892
9893
  const digits = raw.replace(/\D/g, "");
9893
9894
  if (digits.length === 0) {
@@ -9926,24 +9927,29 @@ function mergeOcsEventOutputsNewestFirst(parts, limit) {
9926
9927
  }
9927
9928
  async function listRecentOcsEvents(iccid, limit, eventTypes, since, kv) {
9928
9929
  const routingRaw = await kv.get(`iccid:${iccid}`, "json");
9929
- const resellerId = routingRaw?.reseller_id ?? 0;
9930
- const ringKey = `events:${resellerId}:${iccid}`;
9931
- const itemPrefix = `${ringKey}:evt:`;
9932
- const fromItems = [];
9933
- let listCursor;
9934
- do {
9935
- const listed = await kv.list({ prefix: itemPrefix, cursor: listCursor });
9936
- for (const k of listed.keys) {
9937
- const raw = await kv.get(k.name, "text");
9938
- if (!raw) continue;
9939
- try {
9940
- fromItems.push(JSON.parse(raw));
9941
- } catch {
9930
+ const resellerId = routingRaw?.reseller_id ?? LIFECYCLE_RESELLER_ID2;
9931
+ async function collectPrefix(itemPrefix) {
9932
+ const fromItems2 = [];
9933
+ let listCursor;
9934
+ do {
9935
+ const listed = await kv.list({ prefix: itemPrefix, cursor: listCursor });
9936
+ for (const k of listed.keys) {
9937
+ const raw = await kv.get(k.name, "text");
9938
+ if (!raw) continue;
9939
+ try {
9940
+ fromItems2.push(JSON.parse(raw));
9941
+ } catch {
9942
+ }
9942
9943
  }
9943
- }
9944
- listCursor = listed.list_complete ? void 0 : listed.cursor;
9945
- } while (listCursor !== void 0);
9944
+ listCursor = listed.list_complete ? void 0 : listed.cursor;
9945
+ } while (listCursor !== void 0);
9946
+ return fromItems2;
9947
+ }
9948
+ const ringKey = `events:${resellerId}:${iccid}`;
9949
+ const fromItems = await collectPrefix(`${ringKey}:evt:`);
9950
+ const fromLegacyZero = resellerId === 0 ? [] : await collectPrefix(`events:0:${iccid}:evt:`);
9946
9951
  const legacy = await kv.get(ringKey, "json");
9952
+ const legacyZero = resellerId === 0 ? null : await kv.get(`events:0:${iccid}`, "json");
9947
9953
  const merged = /* @__PURE__ */ new Map();
9948
9954
  for (const e of legacy?.events ?? []) {
9949
9955
  merged.set(e.event_id, e);
@@ -9951,6 +9957,12 @@ async function listRecentOcsEvents(iccid, limit, eventTypes, since, kv) {
9951
9957
  for (const e of fromItems) {
9952
9958
  merged.set(e.event_id, e);
9953
9959
  }
9960
+ for (const e of fromLegacyZero) {
9961
+ if (!merged.has(e.event_id)) merged.set(e.event_id, e);
9962
+ }
9963
+ for (const e of legacyZero?.events ?? []) {
9964
+ if (!merged.has(e.event_id)) merged.set(e.event_id, e);
9965
+ }
9954
9966
  const allSorted = [...merged.values()].sort((a, b) => {
9955
9967
  if (a.occurred_at !== b.occurred_at) return a.occurred_at - b.occurred_at;
9956
9968
  return a.event_id.localeCompare(b.event_id);
@@ -10016,7 +10028,7 @@ function registerListRecentOcsEventsTool(server2, ctx) {
10016
10028
  "list_recent_ocs_events",
10017
10029
  {
10018
10030
  title: "List Recent OCS Events",
10019
- description: "Return the last N OCS events buffered for a given ICCID. Events include eSIM activations, disable, package expiry warnings, location changes, and balance alerts. Buffer holds up to 50 events per ICCID, 24h TTL. Use this when a user asks 'what happened to ICCID X recently' or 'why did subscriber Y go offline'.",
10031
+ description: "Return the last N OCS events buffered for a given ICCID. Events include eSIM activations, disable, package expiry warnings, location changes, and balance alerts. Location for every SIM under reseller 1170 (all child accounts) lands on this buffer; each event may include account_id. Buffer holds up to 50 events per ICCID, 24h TTL. Use this when a user asks 'what happened to ICCID X recently' or 'why did subscriber Y go offline'.",
10020
10032
  inputSchema: listRecentOcsEventsSchema,
10021
10033
  annotations: {
10022
10034
  readOnlyHint: true,