codex-to-im 1.0.33 → 1.0.34

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.
Files changed (2) hide show
  1. package/dist/daemon.mjs +37 -5
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -16718,20 +16718,39 @@ function settleMirrorSuppression(store, sessionId, config2, suppressionId, durat
16718
16718
  }
16719
16719
  target.until = nowMs + durationMs;
16720
16720
  }
16721
+ function abortMirrorSuppression(store, sessionId, config2, suppressionId, nowMs = Date.now()) {
16722
+ const suppressions = getMirrorSuppressionStates(store, sessionId, nowMs);
16723
+ if (suppressions.length === 0) return;
16724
+ const target = suppressionId ? suppressions.find((suppression) => suppression.id === suppressionId) : suppressions[suppressions.length - 1];
16725
+ if (!target) return;
16726
+ const trackedTurnId = target.activeTurnId || target.candidateTurnId;
16727
+ if (trackedTurnId) {
16728
+ markIgnoredMirrorTurn(
16729
+ store,
16730
+ sessionId,
16731
+ trackedTurnId,
16732
+ config2.promptMatchGraceMs,
16733
+ nowMs
16734
+ );
16735
+ clearMirrorSuppression(store, sessionId, target.id);
16736
+ return;
16737
+ }
16738
+ target.until = nowMs + config2.suppressionWindowMs;
16739
+ }
16721
16740
  function isMirrorSuppressed(store, sessionId, nowMs = Date.now()) {
16722
16741
  return getMirrorSuppressionStates(store, sessionId, nowMs).length > 0;
16723
16742
  }
16724
16743
  function filterSuppressedMirrorRecords(store, sessionId, records, config2, nowMs = Date.now()) {
16725
16744
  const suppressions = getMirrorSuppressionStates(store, sessionId, nowMs);
16726
- if (suppressions.length === 0 || records.length === 0) return records;
16745
+ const ignoredTurnIds = cleanupIgnoredMirrorTurns(store, sessionId, nowMs);
16746
+ if (suppressions.length === 0 && ignoredTurnIds.size === 0 || records.length === 0) return records;
16727
16747
  const filtered = [];
16728
- cleanupIgnoredMirrorTurns(store, sessionId, nowMs);
16729
16748
  for (const record of records) {
16730
16749
  const normalizedContent = record.type === "message" ? normalizeMirrorPromptText(record.content || "") : "";
16731
16750
  let handled = false;
16732
16751
  while (true) {
16733
- const ignoredTurnIds = cleanupIgnoredMirrorTurns(store, sessionId, nowMs);
16734
- if (record.turnId && ignoredTurnIds.has(record.turnId)) {
16752
+ const ignoredTurnIds2 = cleanupIgnoredMirrorTurns(store, sessionId, nowMs);
16753
+ if (record.turnId && ignoredTurnIds2.has(record.turnId)) {
16735
16754
  if (record.type === "task_complete") {
16736
16755
  clearIgnoredMirrorTurn(store, sessionId, record.turnId, nowMs);
16737
16756
  }
@@ -18990,7 +19009,11 @@ async function runInteractiveMessage(adapter, msg, text2, attachments, deps) {
18990
19009
  );
18991
19010
  }
18992
19011
  if (taskState.mirrorSuppressionId) {
18993
- deps.settleMirrorSuppression(binding.codepilotSessionId, taskState.mirrorSuppressionId);
19012
+ if (taskAbort.signal.aborted) {
19013
+ deps.abortMirrorSuppression(binding.codepilotSessionId, taskState.mirrorSuppressionId);
19014
+ } else {
19015
+ deps.settleMirrorSuppression(binding.codepilotSessionId, taskState.mirrorSuppressionId);
19016
+ }
18994
19017
  taskState.mirrorSuppressionId = null;
18995
19018
  }
18996
19019
  if (shouldRecordHealthEnd) {
@@ -20394,6 +20417,14 @@ function getMirrorSuppressionStore() {
20394
20417
  function beginMirrorSuppression2(sessionId, promptText) {
20395
20418
  return beginMirrorSuppression(getMirrorSuppressionStore(), sessionId, promptText);
20396
20419
  }
20420
+ function abortMirrorSuppression2(sessionId, suppressionId) {
20421
+ abortMirrorSuppression(
20422
+ getMirrorSuppressionStore(),
20423
+ sessionId,
20424
+ MIRROR_SUPPRESSION_CONFIG,
20425
+ suppressionId
20426
+ );
20427
+ }
20397
20428
  function settleMirrorSuppression2(sessionId, suppressionId, durationMs = MIRROR_SUPPRESSION_WINDOW_MS) {
20398
20429
  settleMirrorSuppression(
20399
20430
  getMirrorSuppressionStore(),
@@ -20852,6 +20883,7 @@ async function handleMessage(adapter, msg) {
20852
20883
  },
20853
20884
  recordInteractiveHealthEnd: (sessionId, outcome, detail) => SESSION_HEALTH_RUNTIME.recordInteractiveEnd(sessionId, outcome, detail),
20854
20885
  beginMirrorSuppression: beginMirrorSuppression2,
20886
+ abortMirrorSuppression: abortMirrorSuppression2,
20855
20887
  settleMirrorSuppression: settleMirrorSuppression2,
20856
20888
  releaseInteractiveTask: (sessionId, taskId) => INTERACTIVE_RUNTIME.releaseInteractiveTask(sessionId, taskId),
20857
20889
  deliverResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-to-im",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Installable Codex-to-IM bridge with local setup UI and background service",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/zhangle1987/codex-to-im#readme",