@notrico/pi-fold 3.0.5 → 3.1.1

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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/compatibility-testing.md +17 -0
  4. package/docs/implementation.md +1 -1
  5. package/docs/renderer-reference.md +1 -1
  6. package/index.ts +37 -23
  7. package/package.json +3 -2
  8. package/scripts/compatibility-check.mjs +40 -0
  9. package/scripts/compatibility-cli-smoke.mjs +41 -0
  10. package/scripts/preview-scroll.mjs +9 -0
  11. package/scripts/preview-work-strip.mjs +15 -1
  12. package/scripts/test.mjs +2 -2
  13. package/src/action-intent.ts +5 -1
  14. package/src/display-card.ts +2 -1
  15. package/src/fold-command.ts +7 -3
  16. package/src/fullscreen-overlays.ts +13 -11
  17. package/src/inspection.ts +19 -12
  18. package/src/modern-native-tools.ts +13 -7
  19. package/src/modern-prompts-adapter.ts +9 -7
  20. package/src/modern-skill-prompts.ts +17 -10
  21. package/src/modern-subagent-messages.ts +16 -7
  22. package/src/modern-subagent-spacing.ts +8 -6
  23. package/src/modern-thinking-adapter.ts +13 -9
  24. package/src/modern-thinking.ts +1 -1
  25. package/src/modern-tool-images.ts +8 -6
  26. package/src/modern-tools.ts +74 -30
  27. package/src/modern-workflows.ts +12 -7
  28. package/src/permission-presentation.ts +2 -1
  29. package/src/runtime-compatibility.ts +53 -14
  30. package/src/work-strip.ts +11 -9
  31. package/tests/action-intent.test.mjs +2 -0
  32. package/tests/codemode-wheel.test.mjs +111 -0
  33. package/tests/codemode.test.mjs +1 -1
  34. package/tests/compatibility-fallbacks.test.mjs +99 -0
  35. package/tests/display-cache-lifecycle.test.mjs +3 -3
  36. package/tests/fold-command.test.mjs +4 -4
  37. package/tests/fullscreen-overlays.test.mjs +4 -2
  38. package/tests/inspection.test.mjs +1 -1
  39. package/tests/modern-prompts.test.mjs +2 -2
  40. package/tests/modern-subagent-messages.test.mjs +2 -2
  41. package/tests/modern-thinking.test.mjs +2 -2
  42. package/tests/modern-tools.test.mjs +17 -8
  43. package/tests/modern-workflows.test.mjs +2 -2
  44. package/tests/ordinary-prompts.test.mjs +0 -1
  45. package/tests/preview-example.test.mjs +2 -2
  46. package/tests/runtime-compatibility.test.mjs +48 -21
  47. package/tests/subagent-spacing.test.mjs +1 -1
  48. package/tests/work-strip-hierarchy.test.mjs +0 -1
  49. package/tests/work-strip.test.mjs +13 -0
@@ -146,3 +146,16 @@ try {
146
146
  assert.equal(JSON.stringify(manager.getBranch().filter(e=>e.type==='message')).includes('DETAILS_REMAIN_AVAILABLE'),true);
147
147
  console.log('Work strip native grouping, settlement, scrollback, decisions, nested inspection, children, replay, fallback and disposal passed');
148
148
  } finally {dispose();}
149
+
150
+ // A changed native container must delegate before reading its former children.
151
+ {
152
+ const proto = core.InteractiveMode.prototype, original = proto.addMessageToChat;
153
+ let calls = 0, reason;
154
+ proto.addMessageToChat = function() { calls++; return 'native result'; };
155
+ const fallback = registerWorkStrip(pi, mode, undefined, value => { reason = value; });
156
+ try {
157
+ assert.equal(proto.addMessageToChat.call({ chatContainer: {}, ui: {} }, { role: 'user' }), 'native result');
158
+ assert.equal(calls, 1);
159
+ assert.match(reason, /chat container changed/);
160
+ } finally { fallback.dispose(); proto.addMessageToChat = original; }
161
+ }