@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.
- package/bin/sling.js +4 -1
- package/node_modules/@aws-sdk/core/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
- package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
- package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +73 -58
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +60 -40
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
- package/node_modules/@earendil-works/pi-ai/package.json +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +3 -5
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/package.json +6 -6
- package/slingshot/index.js +246 -244
- package/node_modules/koffi/CHANGELOG.md +0 -1093
- package/node_modules/koffi/LICENSE.txt +0 -22
- package/node_modules/koffi/README.md +0 -43
- package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/doc/benchmarks.md +0 -126
- package/node_modules/koffi/doc/callbacks.md +0 -210
- package/node_modules/koffi/doc/contribute.md +0 -148
- package/node_modules/koffi/doc/functions.md +0 -250
- package/node_modules/koffi/doc/index.md +0 -61
- package/node_modules/koffi/doc/input.md +0 -471
- package/node_modules/koffi/doc/migration.md +0 -159
- package/node_modules/koffi/doc/misc.md +0 -180
- package/node_modules/koffi/doc/output.md +0 -305
- package/node_modules/koffi/doc/packaging.md +0 -88
- package/node_modules/koffi/doc/platforms.md +0 -36
- package/node_modules/koffi/doc/pointers.md +0 -328
- package/node_modules/koffi/doc/start.md +0 -118
- package/node_modules/koffi/doc/unions.md +0 -186
- package/node_modules/koffi/doc/variables.md +0 -102
- package/node_modules/koffi/index.d.ts +0 -288
- package/node_modules/koffi/index.js +0 -634
- package/node_modules/koffi/indirect.js +0 -533
- package/node_modules/koffi/lib/native/base/base.cc +0 -11015
- package/node_modules/koffi/lib/native/base/base.hh +0 -6003
- package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
- package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
- package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
- package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
- package/node_modules/koffi/lib/native/base/tower.cc +0 -821
- package/node_modules/koffi/lib/native/base/tower.hh +0 -81
- package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
- package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
- package/node_modules/koffi/package.json +0 -38
- package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
- package/node_modules/koffi/src/cnoke/README.md +0 -99
- package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
- package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
- package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
- package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
- package/node_modules/koffi/src/cnoke/package.json +0 -24
- package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
- package/node_modules/koffi/src/cnoke/src/index.js +0 -10
- package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
- package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
- package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
- package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
- package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
- package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
- package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
- package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
- package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
- package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
- package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
- package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
- package/node_modules/koffi/src/koffi/src/call.hh +0 -179
- package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
- package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
- package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
- package/node_modules/koffi/src/koffi/src/init.js +0 -105
- package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
- package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
- package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
- package/node_modules/koffi/src/koffi/src/util.hh +0 -221
- package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
- package/node_modules/koffi/src/koffi/src/uv.def +0 -10
- package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
- package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
- package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
- package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
- package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
- package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
- package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
- package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
- package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
- package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
- package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
- package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
- package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
- package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
- package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
- package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
- package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
- package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
- package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
- package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
- package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
- package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
- package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
- package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
- package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
- package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
- 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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
3
|
-
const
|
|
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
|
|
8
|
-
return
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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) {
|
|
Binary file
|
package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node
ADDED
|
Binary file
|
|
Binary file
|
package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node
ADDED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-tui",
|
|
3
|
-
"version": "0.75.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
32
|
+
"slingVersion": "2.4.20260527-2",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@earendil-works/pi-tui": "file:../.sling-pack/earendil-works-pi-tui-0.75.
|
|
35
|
-
"@earendil-works/pi-ai": "file:../.sling-pack/earendil-works-pi-ai-0.75.
|
|
36
|
-
"@earendil-works/pi-agent-core": "file:../.sling-pack/earendil-works-pi-agent-core-0.75.
|
|
37
|
-
"@earendil-works/pi-coding-agent": "file:../.sling-pack/earendil-works-pi-coding-agent-0.75.
|
|
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
|
},
|