billion-context 0.1.87-pr.397.392 → 0.1.87-pr.397.396

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/index.js CHANGED
@@ -55036,7 +55036,7 @@ function handlePluginManifest(res) {
55036
55036
  statusEndpoint: "/__bili/plugin/status"
55037
55037
  }));
55038
55038
  }
55039
- function handlePluginStatus(conversationId2, res, fallbackLatest = false) {
55039
+ function handlePluginStatus(conversationId2, res, deps, fallbackLatest = false) {
55040
55040
  let entry = conversations.get(conversationId2);
55041
55041
  let session = entry ? peekSession(entry.sessionId) : void 0;
55042
55042
  let viaFallback = false;
@@ -55060,6 +55060,21 @@ function handlePluginStatus(conversationId2, res, fallbackLatest = false) {
55060
55060
  const limit = session.metadata.effectiveContextLimit;
55061
55061
  const mem = remembered.get(session.id);
55062
55062
  const modelContextLimit = typeof limit === "number" && limit > 0 ? limit : 0;
55063
+ let nudge;
55064
+ try {
55065
+ const messages = mem ? mem.processed.length > 0 ? mem.processed : mem.original : [];
55066
+ if (messages.length > 0) {
55067
+ nudge = deps.core.processTurn({
55068
+ messages,
55069
+ state: session.state,
55070
+ config: deps.config,
55071
+ tokenCount: session.stats.lastInputTokens,
55072
+ renderTags: "none"
55073
+ }).nudge;
55074
+ }
55075
+ } catch {
55076
+ nudge = void 0;
55077
+ }
55063
55078
  let panel;
55064
55079
  try {
55065
55080
  panel = buildStatusPanel({
@@ -55067,7 +55082,7 @@ function handlePluginStatus(conversationId2, res, fallbackLatest = false) {
55067
55082
  tokenCount: session.stats.lastInputTokens,
55068
55083
  systemPromptTokens: 0,
55069
55084
  state: session.state,
55070
- nudge: mem?.nudge,
55085
+ nudge,
55071
55086
  modelContextLimit,
55072
55087
  unprunedTokens: mem && mem.original.length > 0 ? mem.original.reduce((sum, m2) => sum + defaultCountTokens(m2.text ?? ""), 0) : void 0
55073
55088
  });
@@ -57560,7 +57575,7 @@ async function handle(req, res, opts, core, config, log2, instanceId, instanceSt
57560
57575
  res.end(JSON.stringify({ ok: false, error: "conversationId query parameter is required" }));
57561
57576
  return;
57562
57577
  }
57563
- return handlePluginStatus(conversationId2, res, params.get("fallback") === "latest");
57578
+ return handlePluginStatus(conversationId2, res, { core, config, log: log2 }, params.get("fallback") === "latest");
57564
57579
  }
57565
57580
  if (req.method === "POST" && req.url === "/__bili/plugin/tool") {
57566
57581
  try {