@genesislcap/ai-assistant 15.10.3-GENC-1494.2 → 15.10.4

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.
@@ -3076,7 +3076,6 @@ function createInteractionContext(interactionId) {
3076
3076
  // src/utils/condense-history.ts
3077
3077
  var CONDENSE_MIN_CHARS = 1e3;
3078
3078
  var CONDENSED_ARGS_KEY = "condensed";
3079
- var ELIDED_PLACEHOLDER = "[elided]";
3080
3079
  var APPROX_CHARS_PER_TOKEN = 4;
3081
3080
  function triggerReason(trigger) {
3082
3081
  switch (trigger.kind) {
@@ -3092,10 +3091,11 @@ function triggerReason(trigger) {
3092
3091
  return "superseded";
3093
3092
  }
3094
3093
  }
3095
- function condenseStub(target, tool, trigger, origLen) {
3094
+ function condenseStub(target, tool, trigger, origLen, restorable) {
3096
3095
  const what = target === "args" ? "args" : "result";
3097
3096
  const key = trigger.kind === "superseded" ? ` ${trigger.by}` : "";
3098
- return `[${tool}${key} \u2014 ${what} elided, ~${origLen} chars (${triggerReason(trigger)}); re-call to restore]`;
3097
+ const restore = restorable ? "; re-call to restore" : "";
3098
+ return `[${tool}${key} \u2014 ${what} elided, ~${origLen} chars (${triggerReason(trigger)})${restore}]`;
3099
3099
  }
3100
3100
  function triggerLabel(trigger) {
3101
3101
  switch (trigger.kind) {
@@ -3173,7 +3173,7 @@ function applyCondensation(history, policies, ctx, onCondensed) {
3173
3173
  changed = true;
3174
3174
  const result = entry.policy.args;
3175
3175
  const args = {
3176
- [CONDENSED_ARGS_KEY]: result === "drop" ? ELIDED_PLACEHOLDER : result === "pointer" ? condenseStub("args", tc.name, fired, origLen) : result.replaceWith
3176
+ [CONDENSED_ARGS_KEY]: result === "drop" || result === "pointer" ? condenseStub("args", tc.name, fired, origLen, result === "pointer") : result.replaceWith
3177
3177
  };
3178
3178
  if (!entry.reportedArgs) {
3179
3179
  entry.reportedArgs = true;
@@ -3199,7 +3199,7 @@ function applyCondensation(history, policies, ctx, onCondensed) {
3199
3199
  if (entry && fired && origLen >= CONDENSE_MIN_CHARS) {
3200
3200
  const tool = nameById.get(msg.toolResult.toolCallId) ?? msg.toolResult.toolCallId;
3201
3201
  const result = entry.policy.response;
3202
- const content = result === "drop" ? ELIDED_PLACEHOLDER : result === "pointer" ? condenseStub("response", tool, fired, origLen) : result.replaceWith;
3202
+ const content = result === "drop" || result === "pointer" ? condenseStub("response", tool, fired, origLen, result === "pointer") : result.replaceWith;
3203
3203
  if (!entry.reportedResponse) {
3204
3204
  entry.reportedResponse = true;
3205
3205
  onCondensed({