@psnext/slingcli 2.4.20260526-1 → 2.4.20260527-2

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 (227) hide show
  1. package/bin/sling.js +4 -1
  2. package/node_modules/@aws-sdk/core/package.json +2 -2
  3. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  4. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
  5. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  12. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  13. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  14. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  20. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  21. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
  22. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  23. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
  24. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  25. package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
  26. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +73 -58
  27. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
  29. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
  30. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
  31. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +60 -40
  32. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
  33. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
  34. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
  35. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
  36. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
  37. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  38. package/node_modules/@earendil-works/pi-ai/package.json +4 -3
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
  41. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
  42. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
  44. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
  45. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
  46. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
  47. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
  48. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
  49. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
  50. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  51. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
  52. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
  53. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
  54. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
  56. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
  57. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
  58. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
  59. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
  61. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  62. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  63. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  64. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  65. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
  66. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
  67. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  68. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
  69. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  70. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
  71. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
  84. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
  85. package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
  86. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
  87. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
  88. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
  89. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  90. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  91. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
  92. package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
  93. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  94. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  95. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  96. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  97. package/node_modules/@earendil-works/pi-tui/package.json +3 -5
  98. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  99. package/package.json +6 -6
  100. package/slingshot/index.js +246 -244
  101. package/node_modules/koffi/CHANGELOG.md +0 -1093
  102. package/node_modules/koffi/LICENSE.txt +0 -22
  103. package/node_modules/koffi/README.md +0 -43
  104. package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
  105. package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
  106. package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
  107. package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
  108. package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
  109. package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
  110. package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
  111. package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
  112. package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
  113. package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
  114. package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
  115. package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
  116. package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
  117. package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
  118. package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
  119. package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
  120. package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
  121. package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
  122. package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
  123. package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
  124. package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
  125. package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
  126. package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
  127. package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
  128. package/node_modules/koffi/doc/benchmarks.md +0 -126
  129. package/node_modules/koffi/doc/callbacks.md +0 -210
  130. package/node_modules/koffi/doc/contribute.md +0 -148
  131. package/node_modules/koffi/doc/functions.md +0 -250
  132. package/node_modules/koffi/doc/index.md +0 -61
  133. package/node_modules/koffi/doc/input.md +0 -471
  134. package/node_modules/koffi/doc/migration.md +0 -159
  135. package/node_modules/koffi/doc/misc.md +0 -180
  136. package/node_modules/koffi/doc/output.md +0 -305
  137. package/node_modules/koffi/doc/packaging.md +0 -88
  138. package/node_modules/koffi/doc/platforms.md +0 -36
  139. package/node_modules/koffi/doc/pointers.md +0 -328
  140. package/node_modules/koffi/doc/start.md +0 -118
  141. package/node_modules/koffi/doc/unions.md +0 -186
  142. package/node_modules/koffi/doc/variables.md +0 -102
  143. package/node_modules/koffi/index.d.ts +0 -288
  144. package/node_modules/koffi/index.js +0 -634
  145. package/node_modules/koffi/indirect.js +0 -533
  146. package/node_modules/koffi/lib/native/base/base.cc +0 -11015
  147. package/node_modules/koffi/lib/native/base/base.hh +0 -6003
  148. package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
  149. package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
  150. package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
  151. package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
  152. package/node_modules/koffi/lib/native/base/tower.cc +0 -821
  153. package/node_modules/koffi/lib/native/base/tower.hh +0 -81
  154. package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
  155. package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
  156. package/node_modules/koffi/package.json +0 -38
  157. package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
  158. package/node_modules/koffi/src/cnoke/README.md +0 -99
  159. package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
  160. package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
  161. package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
  162. package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
  163. package/node_modules/koffi/src/cnoke/package.json +0 -24
  164. package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
  165. package/node_modules/koffi/src/cnoke/src/index.js +0 -10
  166. package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
  167. package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
  168. package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
  169. package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
  170. package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
  171. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
  172. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
  173. package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
  174. package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
  175. package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
  176. package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
  177. package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
  178. package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
  179. package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
  180. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
  181. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
  182. package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
  183. package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
  184. package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
  185. package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
  186. package/node_modules/koffi/src/koffi/src/call.hh +0 -179
  187. package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
  188. package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
  189. package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
  190. package/node_modules/koffi/src/koffi/src/init.js +0 -105
  191. package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
  192. package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
  193. package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
  194. package/node_modules/koffi/src/koffi/src/util.hh +0 -221
  195. package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
  196. package/node_modules/koffi/src/koffi/src/uv.def +0 -10
  197. package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
  198. package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
  199. package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
  200. package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
  201. package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
  202. package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
  203. package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
  204. package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
  205. package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
  206. package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
  207. package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
  208. package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
  209. package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
  210. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
  211. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
  212. package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
  213. package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
  214. package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
  215. package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
  216. package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
  217. package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
  218. package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
  219. package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
  220. package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
  221. package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
  222. package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
  223. package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
  224. package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
  225. package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
  226. package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
  227. package/node_modules/koffi/vendor/node-api-headers/include/uv.h +0 -1990
@@ -27,17 +27,19 @@ export class Markdown {
27
27
  paddingY; // Top/bottom padding
28
28
  defaultTextStyle;
29
29
  theme;
30
+ options;
30
31
  defaultStylePrefix;
31
32
  // Cache for rendered output
32
33
  cachedText;
33
34
  cachedWidth;
34
35
  cachedLines;
35
- constructor(text, paddingX, paddingY, theme, defaultTextStyle) {
36
+ constructor(text, paddingX, paddingY, theme, defaultTextStyle, options) {
36
37
  this.text = text;
37
38
  this.paddingX = paddingX;
38
39
  this.paddingY = paddingY;
39
40
  this.theme = theme;
40
41
  this.defaultTextStyle = defaultTextStyle;
42
+ this.options = options ? { ...options } : {};
41
43
  }
42
44
  setText(text) {
43
45
  this.text = text;
@@ -421,6 +423,10 @@ export class Markdown {
421
423
  }
422
424
  return result;
423
425
  }
426
+ getOrderedListMarker(item) {
427
+ const match = /^(?: {0,3})(\d{1,9}[.)])[ \t]+/.exec(item.raw);
428
+ return match ? `${match[1]} ` : undefined;
429
+ }
424
430
  /**
425
431
  * Render a list with proper nesting support
426
432
  */
@@ -431,7 +437,11 @@ export class Markdown {
431
437
  const startNumber = typeof token.start === "number" ? token.start : 1;
432
438
  for (let i = 0; i < token.items.length; i++) {
433
439
  const item = token.items[i];
434
- const bullet = token.ordered ? `${startNumber + i}. ` : "- ";
440
+ const bullet = token.ordered
441
+ ? this.options.preserveOrderedListMarkers
442
+ ? (this.getOrderedListMarker(item) ?? `${startNumber + i}. `)
443
+ : `${startNumber + i}. `
444
+ : "- ";
435
445
  const taskMarker = item.task ? `[${item.checked ? "x" : " "}] ` : "";
436
446
  const marker = bullet + taskMarker;
437
447
  const firstPrefix = indent + this.theme.listBullet(marker);
@@ -0,0 +1,53 @@
1
+ import { createRequire } from "node:module";
2
+ import * as path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const cjsRequire = createRequire(import.meta.url);
5
+ let nativeModifiersHelper;
6
+ function isNativeModifiersHelper(value) {
7
+ if (typeof value !== "object" || value === null)
8
+ return false;
9
+ const candidate = value.isModifierPressed;
10
+ return typeof candidate === "function";
11
+ }
12
+ function loadNativeModifiersHelper() {
13
+ if (nativeModifiersHelper !== undefined)
14
+ return nativeModifiersHelper ?? undefined;
15
+ nativeModifiersHelper = null;
16
+ if (process.platform !== "darwin")
17
+ return undefined;
18
+ const arch = process.arch;
19
+ if (arch !== "x64" && arch !== "arm64")
20
+ return undefined;
21
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
22
+ const nativePath = path.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
23
+ const candidates = [
24
+ path.join(moduleDir, "..", nativePath),
25
+ path.join(moduleDir, nativePath),
26
+ path.join(path.dirname(process.execPath), nativePath),
27
+ ];
28
+ for (const modulePath of candidates) {
29
+ try {
30
+ const helper = cjsRequire(modulePath);
31
+ if (isNativeModifiersHelper(helper)) {
32
+ nativeModifiersHelper = helper;
33
+ return helper;
34
+ }
35
+ }
36
+ catch {
37
+ // Try the next possible packaging location.
38
+ }
39
+ }
40
+ return undefined;
41
+ }
42
+ export function isNativeModifierPressed(key) {
43
+ const helper = loadNativeModifiersHelper();
44
+ if (!helper)
45
+ return false;
46
+ try {
47
+ return helper.isModifierPressed(key) === true;
48
+ }
49
+ catch {
50
+ return false;
51
+ }
52
+ }
53
+ //# sourceMappingURL=native-modifiers.js.map
@@ -32,6 +32,9 @@ export function detectCapabilities() {
32
32
  if (process.env.ITERM_SESSION_ID || termProgram === "iterm.app") {
33
33
  return { images: "iterm2", trueColor: true, hyperlinks: true };
34
34
  }
35
+ if (process.env.WT_SESSION) {
36
+ return { images: null, trueColor: true, hyperlinks: true };
37
+ }
35
38
  if (termProgram === "vscode") {
36
39
  return { images: null, trueColor: true, hyperlinks: true };
37
40
  }
@@ -42,7 +45,7 @@ export function detectCapabilities() {
42
45
  // text" on terminals that swallow it, which means the URL disappears from
43
46
  // the rendered output. Default to the legacy `text (url)` behavior unless we
44
47
  // have positively identified a hyperlink-capable terminal above.
45
- return { images: null, trueColor: hasTrueColorHint || !!process.env.WT_SESSION, hyperlinks: false };
48
+ return { images: null, trueColor: hasTrueColorHint, hyperlinks: false };
46
49
  }
47
50
  export function getCapabilities() {
48
51
  if (!cachedCapabilities) {
@@ -1,12 +1,23 @@
1
1
  import * as fs from "node:fs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as path from "node:path";
4
+ import { fileURLToPath } from "node:url";
4
5
  import { setKittyProtocolActive } from "./keys.js";
6
+ import { isNativeModifierPressed } from "./native-modifiers.js";
5
7
  import { StdinBuffer } from "./stdin-buffer.js";
6
8
  const cjsRequire = createRequire(import.meta.url);
7
9
  const TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;
8
10
  const TERMINAL_PROGRESS_ACTIVE_SEQUENCE = "\x1b]9;4;3\x07";
9
11
  const TERMINAL_PROGRESS_CLEAR_SEQUENCE = "\x1b]9;4;0;\x07";
12
+ const APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE = "\x1b[13;2u";
13
+ export function isAppleTerminalSession() {
14
+ return process.platform === "darwin" && process.env.TERM_PROGRAM === "Apple_Terminal";
15
+ }
16
+ export function normalizeAppleTerminalInput(data, isAppleTerminal, isShiftPressed) {
17
+ if (isAppleTerminal && data === "\r" && isShiftPressed)
18
+ return APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE;
19
+ return data;
20
+ }
10
21
  /**
11
22
  * Real terminal using process.stdin/stdout
12
23
  */
@@ -97,7 +108,9 @@ export class ProcessTerminal {
97
108
  }
98
109
  }
99
110
  if (this.inputHandler) {
100
- this.inputHandler(sequence);
111
+ const isAppleTerminal = sequence === "\r" && isAppleTerminalSession();
112
+ const input = normalizeAppleTerminalInput(sequence, isAppleTerminal, isAppleTerminal && isNativeModifierPressed("shift"));
113
+ this.inputHandler(input);
101
114
  }
102
115
  });
103
116
  // Re-wrap paste content with bracketed paste markers for existing editor handling
@@ -146,23 +159,32 @@ export class ProcessTerminal {
146
159
  if (process.platform !== "win32")
147
160
  return;
148
161
  try {
149
- // Dynamic require to avoid bundling koffi's 74MB of cross-platform
150
- // native binaries into every compiled binary. Koffi is only needed
151
- // on Windows for VT input support.
152
- const koffi = cjsRequire("koffi");
153
- const k32 = koffi.load("kernel32.dll");
154
- const GetStdHandle = k32.func("void* __stdcall GetStdHandle(int)");
155
- const GetConsoleMode = k32.func("bool __stdcall GetConsoleMode(void*, _Out_ uint32_t*)");
156
- const SetConsoleMode = k32.func("bool __stdcall SetConsoleMode(void*, uint32_t)");
157
- const STD_INPUT_HANDLE = -10;
158
- const ENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200;
159
- const handle = GetStdHandle(STD_INPUT_HANDLE);
160
- const mode = new Uint32Array(1);
161
- GetConsoleMode(handle, mode);
162
- SetConsoleMode(handle, mode[0] | ENABLE_VIRTUAL_TERMINAL_INPUT);
162
+ const arch = process.arch;
163
+ if (arch !== "x64" && arch !== "arm64")
164
+ return;
165
+ // Dynamic require so non-Windows and bundled/browser paths never load the
166
+ // native helper. In the npm package native/ is next to dist/; in compiled
167
+ // binary archives native/ is copied next to the executable.
168
+ const moduleDir = path.dirname(fileURLToPath(import.meta.url));
169
+ const nativePath = path.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
170
+ const candidates = [
171
+ path.join(moduleDir, "..", nativePath),
172
+ path.join(moduleDir, nativePath),
173
+ path.join(path.dirname(process.execPath), nativePath),
174
+ ];
175
+ for (const modulePath of candidates) {
176
+ try {
177
+ const helper = cjsRequire(modulePath);
178
+ helper.enableVirtualTerminalInput?.();
179
+ return;
180
+ }
181
+ catch {
182
+ // Try the next possible packaging location.
183
+ }
184
+ }
163
185
  }
164
186
  catch {
165
- // koffi not available — Shift+Tab won't be distinguishable from Tab
187
+ // Native helper not available — Shift+Tab won't be distinguishable from Tab.
166
188
  }
167
189
  }
168
190
  async drainInput(maxMs = 1000, idleMs = 50) {
@@ -1,11 +1,18 @@
1
1
  import { eastAsianWidth } from "get-east-asian-width";
2
- // Grapheme segmenter (shared instance)
3
- const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
2
+ // segmenters (shared instance)
3
+ const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
4
+ const wordSegmenter = new Intl.Segmenter(undefined, { granularity: "word" });
4
5
  /**
5
6
  * Get the shared grapheme segmenter instance.
6
7
  */
7
- export function getSegmenter() {
8
- return segmenter;
8
+ export function getGraphemeSegmenter() {
9
+ return graphemeSegmenter;
10
+ }
11
+ /**
12
+ * Get the shared word segmenter instance.
13
+ */
14
+ export function getWordSegmenter() {
15
+ return wordSegmenter;
9
16
  }
10
17
  /**
11
18
  * Check if a grapheme cluster (after segmentation) could possibly be an RGI emoji.
@@ -52,7 +59,7 @@ function truncateFragmentToWidth(text, maxWidth) {
52
59
  if (!hasAnsi && !hasTabs) {
53
60
  let result = "";
54
61
  let width = 0;
55
- for (const { segment } of segmenter.segment(text)) {
62
+ for (const { segment } of graphemeSegmenter.segment(text)) {
56
63
  const w = graphemeWidth(segment);
57
64
  if (width + w > maxWidth) {
58
65
  break;
@@ -94,7 +101,7 @@ function truncateFragmentToWidth(text, maxWidth) {
94
101
  }
95
102
  end++;
96
103
  }
97
- for (const { segment } of segmenter.segment(text.slice(i, end))) {
104
+ for (const { segment } of graphemeSegmenter.segment(text.slice(i, end))) {
98
105
  const w = graphemeWidth(segment);
99
106
  if (width + w > maxWidth) {
100
107
  return { text: result, width };
@@ -203,7 +210,7 @@ export function visibleWidth(str) {
203
210
  }
204
211
  // Calculate width
205
212
  let width = 0;
206
- for (const { segment } of segmenter.segment(clean)) {
213
+ for (const { segment } of graphemeSegmenter.segment(clean)) {
207
214
  width += graphemeWidth(segment);
208
215
  }
209
216
  // Cache result
@@ -710,7 +717,7 @@ function breakLongWord(word, width, tracker) {
710
717
  }
711
718
  // Segment this non-ANSI portion into graphemes
712
719
  const textPortion = word.slice(i, end);
713
- for (const seg of segmenter.segment(textPortion)) {
720
+ for (const seg of graphemeSegmenter.segment(textPortion)) {
714
721
  segments.push({ type: "grapheme", value: seg.segment });
715
722
  }
716
723
  i = end;
@@ -812,7 +819,7 @@ export function truncateToWidth(text, maxWidth, ellipsis = "...", pad = false) {
812
819
  const hasAnsi = text.includes("\x1b");
813
820
  const hasTabs = text.includes("\t");
814
821
  if (!hasAnsi && !hasTabs) {
815
- for (const { segment } of segmenter.segment(text)) {
822
+ for (const { segment } of graphemeSegmenter.segment(text)) {
816
823
  const width = graphemeWidth(segment);
817
824
  if (keepContiguousPrefix && keptWidth + width <= targetWidth) {
818
825
  result += segment;
@@ -867,7 +874,7 @@ export function truncateToWidth(text, maxWidth, ellipsis = "...", pad = false) {
867
874
  }
868
875
  end++;
869
876
  }
870
- for (const { segment } of segmenter.segment(text.slice(i, end))) {
877
+ for (const { segment } of graphemeSegmenter.segment(text.slice(i, end))) {
871
878
  const width = graphemeWidth(segment);
872
879
  if (keepContiguousPrefix && keptWidth + width <= targetWidth) {
873
880
  if (pendingAnsi) {
@@ -925,7 +932,7 @@ export function sliceWithWidth(line, startCol, length, strict = false) {
925
932
  let textEnd = i;
926
933
  while (textEnd < line.length && !extractAnsiCode(line, textEnd))
927
934
  textEnd++;
928
- for (const { segment } of segmenter.segment(line.slice(i, textEnd))) {
935
+ for (const { segment } of graphemeSegmenter.segment(line.slice(i, textEnd))) {
929
936
  const w = graphemeWidth(segment);
930
937
  const inRange = currentCol >= startCol && currentCol < endCol;
931
938
  const fits = !strict || currentCol + w <= endCol;
@@ -981,7 +988,7 @@ export function extractSegments(line, beforeEnd, afterStart, afterLen, strictAft
981
988
  let textEnd = i;
982
989
  while (textEnd < line.length && !extractAnsiCode(line, textEnd))
983
990
  textEnd++;
984
- for (const { segment } of segmenter.segment(line.slice(i, textEnd))) {
991
+ for (const { segment } of graphemeSegmenter.segment(line.slice(i, textEnd))) {
985
992
  const w = graphemeWidth(segment);
986
993
  if (currentCol < beforeEnd) {
987
994
  if (pendingAnsiBefore) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-tui",
3
- "version": "0.75.4",
3
+ "version": "0.75.5",
4
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,6 +12,8 @@
12
12
  },
13
13
  "files": [
14
14
  "dist/**/*",
15
+ "native/win32/prebuilds/**/*.node",
16
+ "native/darwin/prebuilds/**/*.node",
15
17
  "README.md"
16
18
  ],
17
19
  "keywords": [
@@ -38,12 +40,8 @@
38
40
  "get-east-asian-width": "1.6.0",
39
41
  "marked": "15.0.12"
40
42
  },
41
- "optionalDependencies": {
42
- "koffi": "2.16.2"
43
- },
44
43
  "devDependencies": {
45
44
  "@xterm/headless": "5.5.0",
46
- "@xterm/xterm": "5.5.0",
47
45
  "chalk": "5.6.2"
48
46
  }
49
47
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.7.4",
3
+ "version": "4.7.3",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -26,7 +26,7 @@
26
26
  "module": "./dist-es/index.js",
27
27
  "types": "./dist-types/index.d.ts",
28
28
  "dependencies": {
29
- "@smithy/core": "^3.24.4",
29
+ "@smithy/core": "^3.24.3",
30
30
  "@smithy/types": "^4.14.2",
31
31
  "tslib": "^2.6.2"
32
32
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psnext/slingcli",
3
- "version": "2.4.20260526-1",
3
+ "version": "2.4.20260527-2",
4
4
  "description": "Connects Sling CLI to Publicis Sapient Slingshot enterprise LLM gateway. Bundles the pi coding-agent runtime.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,12 +29,12 @@
29
29
  "type": "git",
30
30
  "url": "git+https://pscode.lioncloud.net/psaiproducts/slingcli.git"
31
31
  },
32
- "slingVersion": "2.4.20260526-1",
32
+ "slingVersion": "2.4.20260527-2",
33
33
  "dependencies": {
34
- "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.75.4.tgz",
35
- "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.75.4.tgz",
36
- "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.75.4.tgz",
37
- "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.75.4.tgz",
34
+ "@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.75.5.tgz",
35
+ "@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.75.5.tgz",
36
+ "@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.75.5.tgz",
37
+ "@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.75.5.tgz",
38
38
  "undici": "^7.19.1",
39
39
  "semver": "^7.6.0"
40
40
  },