@psnext/slingcli 3.3.20260911-1 → 3.3.20260914-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.
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-VDBOM5UG.js → chunk-BRL3MDQL.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +79 -32
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/node_modules/@types/node/assert.d.ts +189 -190
- package/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/node_modules/@types/node/buffer.d.ts +103 -237
- package/node_modules/@types/node/child_process.d.ts +39 -154
- package/node_modules/@types/node/cluster.d.ts +238 -384
- package/node_modules/@types/node/console.d.ts +45 -404
- package/node_modules/@types/node/constants.d.ts +3 -10
- package/node_modules/@types/node/crypto.d.ts +1000 -1593
- package/node_modules/@types/node/dgram.d.ts +133 -81
- package/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/node_modules/@types/node/dns.d.ts +136 -183
- package/node_modules/@types/node/domain.d.ts +12 -32
- package/node_modules/@types/node/events.d.ts +872 -840
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/node_modules/@types/node/fs.d.ts +865 -525
- package/node_modules/@types/node/globals.d.ts +12 -34
- package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/node_modules/@types/node/http.d.ts +433 -312
- package/node_modules/@types/node/http2.d.ts +545 -891
- package/node_modules/@types/node/https.d.ts +64 -243
- package/node_modules/@types/node/index.d.ts +25 -7
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +70 -58
- package/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/node_modules/@types/node/module.d.ts +54 -219
- package/node_modules/@types/node/net.d.ts +208 -222
- package/node_modules/@types/node/os.d.ts +41 -49
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +119 -141
- package/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/node_modules/@types/node/process.d.ts +389 -205
- package/node_modules/@types/node/punycode.d.ts +3 -31
- package/node_modules/@types/node/querystring.d.ts +3 -16
- package/node_modules/@types/node/quic.d.ts +2153 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/node_modules/@types/node/readline.d.ts +66 -152
- package/node_modules/@types/node/repl.d.ts +101 -109
- package/node_modules/@types/node/sea.d.ts +1 -116
- package/node_modules/@types/node/sqlite.d.ts +486 -68
- package/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/node_modules/@types/node/stream/iter.d.ts +452 -0
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +197 -454
- package/node_modules/@types/node/stream.d.ts +603 -491
- package/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +513 -292
- package/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/node_modules/@types/node/timers.d.ts +3 -141
- package/node_modules/@types/node/tls.d.ts +166 -257
- package/node_modules/@types/node/trace_events.d.ts +3 -97
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +61 -43
- package/node_modules/@types/node/url.d.ts +156 -584
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +170 -1099
- package/node_modules/@types/node/v8.d.ts +175 -36
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +292 -209
- package/node_modules/@types/node/wasi.d.ts +24 -74
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +257 -407
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +24 -165
- package/node_modules/undici-types/agent.d.ts +12 -13
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +63 -37
- package/node_modules/undici-types/connector.d.ts +5 -2
- package/node_modules/undici-types/cookies.d.ts +3 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/node_modules/undici-types/errors.d.ts +92 -54
- package/node_modules/undici-types/eventsource.d.ts +9 -4
- package/node_modules/undici-types/fetch.d.ts +51 -25
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +10 -9
- package/node_modules/undici-types/header.d.ts +162 -1
- package/node_modules/undici-types/index.d.ts +69 -47
- package/node_modules/undici-types/interceptors.d.ts +72 -9
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -4
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +14 -6
- package/node_modules/undici-types/readable.d.ts +19 -16
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +148 -30
- package/node_modules/undici-types/websocket.d.ts +48 -10
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +14 -30
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +1 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +2 -11
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -4
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +53 -137
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +70 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +87 -35
- package/node_modules/zod/src/v4/core/api.ts +21 -29
- package/node_modules/zod/src/v4/core/checks.ts +61 -1
- package/node_modules/zod/src/v4/core/compile.ts +35 -24
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +9 -63
- package/node_modules/zod/src/v4/core/memoizer.ts +2 -5
- package/node_modules/zod/src/v4/core/regexes.ts +4 -0
- package/node_modules/zod/src/v4/core/schemas.ts +36 -109
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +177 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +1 -1
- package/node_modules/zod/src/v4/core/util.ts +0 -4
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/src/v4/core/visit.ts +0 -11
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +1 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +12 -23
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +56 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +7 -0
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/schemas.cjs +11 -15
- package/node_modules/zod/v4/classic/schemas.d.cts +4 -6
- package/node_modules/zod/v4/classic/schemas.d.ts +4 -6
- package/node_modules/zod/v4/classic/schemas.js +9 -13
- package/node_modules/zod/v4/core/api.cjs +11 -23
- package/node_modules/zod/v4/core/api.d.cts +8 -4
- package/node_modules/zod/v4/core/api.d.ts +8 -4
- package/node_modules/zod/v4/core/api.js +11 -23
- package/node_modules/zod/v4/core/checks.cjs +32 -1
- package/node_modules/zod/v4/core/checks.d.cts +16 -0
- package/node_modules/zod/v4/core/checks.d.ts +16 -0
- package/node_modules/zod/v4/core/checks.js +31 -0
- package/node_modules/zod/v4/core/compile.cjs +12 -17
- package/node_modules/zod/v4/core/compile.js +13 -18
- package/node_modules/zod/v4/core/core.cjs +1 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/json-schema-processors.cjs +8 -44
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.js +8 -43
- package/node_modules/zod/v4/core/memoizer.cjs +2 -5
- package/node_modules/zod/v4/core/memoizer.js +2 -5
- package/node_modules/zod/v4/core/regexes.cjs +4 -2
- package/node_modules/zod/v4/core/regexes.d.cts +1 -0
- package/node_modules/zod/v4/core/regexes.d.ts +1 -0
- package/node_modules/zod/v4/core/regexes.js +2 -0
- package/node_modules/zod/v4/core/schemas.cjs +33 -73
- package/node_modules/zod/v4/core/schemas.d.cts +7 -22
- package/node_modules/zod/v4/core/schemas.d.ts +7 -22
- package/node_modules/zod/v4/core/schemas.js +30 -72
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -1
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.js +1 -1
- package/node_modules/zod/v4/core/util.cjs +0 -4
- package/node_modules/zod/v4/core/util.js +0 -4
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/node_modules/zod/v4/core/visit.cjs +0 -12
- package/node_modules/zod/v4/core/visit.js +0 -12
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +1 -0
- package/node_modules/zod/v4/locales/tg.js +1 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +11 -13
- package/node_modules/zod/v4/mini/schemas.d.cts +1 -4
- package/node_modules/zod/v4/mini/schemas.d.ts +1 -4
- package/node_modules/zod/v4/mini/schemas.js +9 -11
- package/package.json +2 -2
- package/slingshot/index.js +183 -182
- package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1344,7 +1344,7 @@ Sling will resume when the editor exits.
|
|
|
1344
1344
|
${codeSpan(styledWarning)}
|
|
1345
1345
|
`}return`${(options.theme?themedLines(art,options.theme):art.plain).map(codeSpan).join(`
|
|
1346
1346
|
`)}
|
|
1347
|
-
`}).join("")}}var ModelCatalogRefreshCoordinator=class{activeByRuntime=new WeakMap;refresh(modelRuntime,signal){signal.throwIfAborted();let active=this.activeByRuntime.get(modelRuntime);if(!active){let controller=new AbortController,created,operation=modelRuntime.refresh({signal:controller.signal}),promise=raceWithAbortSignal(operation,controller.signal).finally(()=>{this.activeByRuntime.get(modelRuntime)===created&&this.activeByRuntime.delete(modelRuntime)});created={controller,promise,waiters:0},active=created,this.activeByRuntime.set(modelRuntime,active)}return active.waiters++,raceWithAbortSignal(active.promise,signal).finally(()=>{active.waiters--,active.waiters===0&&this.activeByRuntime.get(modelRuntime)===active&&active.controller.abort()})}},modelCatalogRefreshCoordinator=new ModelCatalogRefreshCoordinator;function refreshModelCatalogs(modelRuntime,signal){return modelCatalogRefreshCoordinator.refresh(modelRuntime,signal)}function getModelSearchText(item){let{id,provider}=item,name=item.name?` ${item.name}`:"";return`${id} ${provider} ${provider}/${id} ${provider} ${id}${name}`}function getModelSelectorSearchText(item){let{id,provider}=item,name=item.name?` ${item.name}`:"";return`${provider} ${provider}/${id} ${provider} ${id}${name}`}var ModelSelectorComponent=class extends Container{searchInput;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.searchInput.focused=value}listContainer;allModels=[];scopedModelItems=[];activeModels=[];filteredModels=[];selectedIndex=0;currentModel;modelRuntime;onSelectCallback;onSelectAsDefaultCallback;onCancelCallback;errorMessage;refreshStatusMessage="Refreshing model catalogs\u2026";refreshStatusSuccess=!1;tui;scopedModels;defaultModel;scope="all";scopeText;scopeHintText;refreshAbortController=new AbortController;refreshTimeout;closed=!1;constructor(tui,currentModel,modelRuntime,scopedModels,onSelect,onCancel,initialSearchInput,onSelectAsDefault,defaultModel){if(super(),this.tui=tui,this.currentModel=currentModel,this.modelRuntime=modelRuntime,this.scopedModels=scopedModels,this.defaultModel=defaultModel,this.scope=scopedModels.length>0?"scoped":"all",this.onSelectCallback=onSelect,this.onSelectAsDefaultCallback=onSelectAsDefault,this.onCancelCallback=onCancel,this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),scopedModels.length>0)this.scopeText=new Text(this.getScopeText(),0,0),this.addChild(this.scopeText),this.scopeHintText=new Text(this.getScopeHintText(),0,0),this.addChild(this.scopeHintText);else{let hintText="Only showing models from configured providers. Use /login to add providers.";this.addChild(new Text(theme.fg("warning",hintText),0,0))}this.addChild(new Spacer(1)),this.searchInput=new Input,initialSearchInput&&this.searchInput.setValue(initialSearchInput),this.searchInput.onSubmit=()=>{this.filteredModels[this.selectedIndex]&&this.handleSelect(this.filteredModels[this.selectedIndex].model)},this.addChild(this.searchInput),this.addChild(new Spacer(1)),this.listContainer=new Container,this.addChild(this.listContainer),this.addChild(new Spacer(1)),this.onSelectAsDefaultCallback&&this.addChild(new Text(theme.fg("dim"," Enter to select \xB7 Ctrl+S to set as default \xB7 Esc to cancel"),0,0)),this.addChild(new DynamicBorder),this.loadModelsFromSnapshot(),initialSearchInput?this.filterModels(initialSearchInput):this.updateList(),this.tui.requestRender(),this.refreshModels()}loadModelsFromSnapshot(){let models=this.modelRuntime.getAvailableSnapshot().map(model=>({provider:model.provider,id:model.id,model}));this.allModels=this.sortModels(models),this.scopedModels=this.scopedModels.map(scoped=>{let refreshed=this.modelRuntime.getModel(scoped.model.provider,scoped.model.id);return refreshed?{...scoped,model:refreshed}:scoped}),this.scopedModelItems=this.scopedModels.map(scoped=>({provider:scoped.model.provider,id:scoped.model.id,model:scoped.model})),this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels,this.filteredModels=this.activeModels;let currentIndex=this.filteredModels.findIndex(item=>modelsAreEqual(this.currentModel,item.model));this.selectedIndex=currentIndex>=0?currentIndex:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1))}async refreshModels(){let timedOut=!1;this.refreshTimeout=setTimeout(()=>{timedOut=!0,this.refreshAbortController.abort()},15e3);try{let result=await refreshModelCatalogs(this.modelRuntime,this.refreshAbortController.signal);if(this.closed)return;this.refreshStatusMessage="",result.aborted&&timedOut?this.errorMessage="Model refresh timed out; showing cached models.":result.errors.size===1?this.errorMessage=`Could not refresh ${result.errors.keys().next().value}; showing cached models.`:result.errors.size>1?this.errorMessage=`Could not refresh ${result.errors.size} model catalogs (${[...result.errors.keys()].join(", ")}); showing cached models.`:(this.errorMessage=this.modelRuntime.getError(),this.errorMessage||(this.refreshStatusMessage="Model catalogs refreshed.",this.refreshStatusSuccess=!0)),this.loadModelsFromSnapshot(),this.filterModels(this.searchInput.getValue()),this.tui.requestRender()}catch(error){if(this.closed)return;this.refreshStatusMessage="",this.errorMessage=timedOut?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${error instanceof Error?error.message:String(error)}`,this.updateList(),this.tui.requestRender()}finally{this.refreshTimeout&&clearTimeout(this.refreshTimeout)}}dispose(){this.closed||(this.closed=!0,this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshAbortController.abort())}sortModels(models){let sorted=[...models];return sorted.sort((a,b2)=>{let aIsCurrent=modelsAreEqual(this.currentModel,a.model),bIsCurrent=modelsAreEqual(this.currentModel,b2.model);if(aIsCurrent&&!bIsCurrent)return-1;if(!aIsCurrent&&bIsCurrent)return 1;let aIsDefault=this.isDefaultModel(a.model),bIsDefault=this.isDefaultModel(b2.model);return aIsDefault&&!bIsDefault?-1:!aIsDefault&&bIsDefault?1:a.provider.localeCompare(b2.provider)}),sorted}getScopeText(){let allText=this.scope==="all"?theme.fg("accent","all"):theme.fg("muted","all"),scopedText=this.scope==="scoped"?theme.fg("accent","scoped"):theme.fg("muted","scoped");return`${theme.fg("muted","Scope: ")}${allText}${theme.fg("muted"," | ")}${scopedText}`}getScopeHintText(){return keyHint("tui.input.tab","scope")+theme.fg("muted"," (all/scoped)")}isDefaultModel(model){return this.defaultModel?.provider===model.provider&&this.defaultModel.id===model.id}isDefaultSearch(query){let normalized=query.trim().toLowerCase();return normalized.length>0&&"default".startsWith(normalized)}setScope(scope){if(this.scope===scope)return;this.scope=scope,this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels;let currentIndex=this.activeModels.findIndex(item=>modelsAreEqual(this.currentModel,item.model));this.selectedIndex=currentIndex>=0?currentIndex:0,this.filterModels(this.searchInput.getValue()),this.scopeText&&this.scopeText.setText(this.getScopeText())}filterModels(query){if(query){let filtered=fuzzyFilter(this.activeModels,query,item=>{let defaultText=this.isDefaultModel(item.model)?" default":"";return`${getModelSelectorSearchText({id:item.id,provider:item.provider,name:item.model.name})}${defaultText}`});if(this.isDefaultSearch(query)){let defaultItems=this.activeModels.filter(item=>this.isDefaultModel(item.model)),defaultKeys=new Set(defaultItems.map(item=>`${item.provider}\0${item.id}`));this.filteredModels=[...defaultItems,...filtered.filter(item=>!defaultKeys.has(`${item.provider}\0${item.id}`))]}else this.filteredModels=filtered}else this.filteredModels=this.activeModels;this.selectedIndex=query?0:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1)),this.updateList()}updateList(){this.listContainer.clear();let maxVisible=10,startIndex=Math.max(0,Math.min(this.selectedIndex-Math.floor(maxVisible/2),this.filteredModels.length-maxVisible)),endIndex=Math.min(startIndex+maxVisible,this.filteredModels.length);for(let i=startIndex;i<endIndex;i++){let item=this.filteredModels[i];if(!item)continue;let isSelected=i===this.selectedIndex,isCurrent=modelsAreEqual(this.currentModel,item.model),defaultBadge=this.isDefaultModel(item.model)?theme.fg("muted"," \xB7 default"):"",line="";if(isSelected){let prefix=theme.fg("accent","\u2192 "),modelText=`${item.id}`,providerBadge=theme.fg("muted",`[${item.provider}]`),checkmark=isCurrent?theme.fg("success"," \u2713"):"";line=`${prefix+theme.fg("accent",modelText)} ${providerBadge}${defaultBadge}${checkmark}`}else{let modelText=` ${item.id}`,providerBadge=theme.fg("muted",`[${item.provider}]`),checkmark=isCurrent?theme.fg("success"," \u2713"):"";line=`${modelText} ${providerBadge}${defaultBadge}${checkmark}`}this.listContainer.addChild(new Text(line,0,0))}if(startIndex>0||endIndex<this.filteredModels.length){let scrollInfo=theme.fg("muted",` (${this.selectedIndex+1}/${this.filteredModels.length})`);this.listContainer.addChild(new Text(scrollInfo,0,0))}if(this.errorMessage){let errorLines=this.errorMessage.split(`
|
|
1347
|
+
`}).join("")}}var ModelCatalogRefreshCoordinator=class{activeByRuntime=new WeakMap;refresh(modelRuntime,signal){signal.throwIfAborted();let active=this.activeByRuntime.get(modelRuntime);if(!active){let controller=new AbortController,created,operation=modelRuntime.refresh({signal:controller.signal}),promise=raceWithAbortSignal(operation,controller.signal).finally(()=>{this.activeByRuntime.get(modelRuntime)===created&&this.activeByRuntime.delete(modelRuntime)});created={controller,promise,waiters:0},active=created,this.activeByRuntime.set(modelRuntime,active)}return active.waiters++,raceWithAbortSignal(active.promise,signal).finally(()=>{active.waiters--,active.waiters===0&&this.activeByRuntime.get(modelRuntime)===active&&active.controller.abort()})}},modelCatalogRefreshCoordinator=new ModelCatalogRefreshCoordinator;function refreshModelCatalogs(modelRuntime,signal){return modelCatalogRefreshCoordinator.refresh(modelRuntime,signal)}function getModelSearchText(item){let{id,provider}=item,name=item.name?` ${item.name}`:"";return`${id} ${provider} ${provider}/${id} ${provider} ${id}${name}`}function getModelSelectorSearchText(item){let{id,provider}=item,name=item.name?` ${item.name}`:"";return`${provider} ${provider}/${id} ${provider} ${id}${name}`}var ModelRow=class{modelText;details;constructor(modelText,details){this.modelText=modelText,this.details=details}invalidate(){}render(width){let details=truncateToWidth(this.details,Math.max(1,width-1),"\u2026"),availableModelWidth=Math.max(1,width-visibleWidth(details)-1),model=truncateToWidth(this.modelText,availableModelWidth,"\u2026");return[truncateToWidth(`${model} ${details}`,width,"\u2026")]}};function getModelCostBucket(model){let cost=model.cost;if(!cost)return"unknown";let{input,output}=cost;if(![input,output].every(price=>Number.isFinite(price)&&price>0))return"unknown";let highestRate=Math.max(input,output);return highestRate<5?"low":highestRate<20?"medium":"high"}function getModelDetails(model){return`cost: ${getModelCostBucket(model)} \xB7 thinking: ${model.reasoning?"yes":"no"}`}function parseModelSearchQuery(query){let textTokens=[],filters={};for(let token of query.trim().split(/\s+/u).filter(Boolean)){let[key,value]=token.toLowerCase().split(":",2);key==="cost"&&(value==="low"||value==="medium"||value==="high"||value==="unknown")?filters.cost=value:key==="thinking"&&(value==="yes"||value==="no")?filters.thinking=value==="yes":textTokens.push(token)}return{text:textTokens.join(" "),filters}}function matchesModelFilters(model,filters){return!(filters.cost!==void 0&&getModelCostBucket(model)!==filters.cost||filters.thinking!==void 0&&model.reasoning!==filters.thinking)}var ModelSelectorComponent=class extends Container{searchInput;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.searchInput.focused=value}listContainer;allModels=[];scopedModelItems=[];activeModels=[];filteredModels=[];selectedIndex=0;currentModel;modelRuntime;onSelectCallback;onSelectAsDefaultCallback;onCancelCallback;errorMessage;refreshStatusMessage="Refreshing model catalogs\u2026";refreshStatusSuccess=!1;tui;scopedModels;defaultModel;scope="all";scopeText;scopeHintText;refreshAbortController=new AbortController;refreshTimeout;closed=!1;constructor(tui,currentModel,modelRuntime,scopedModels,onSelect,onCancel,initialSearchInput,onSelectAsDefault,defaultModel){if(super(),this.tui=tui,this.currentModel=currentModel,this.modelRuntime=modelRuntime,this.scopedModels=scopedModels,this.defaultModel=defaultModel,this.scope=scopedModels.length>0?"scoped":"all",this.onSelectCallback=onSelect,this.onSelectAsDefaultCallback=onSelectAsDefault,this.onCancelCallback=onCancel,this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),scopedModels.length>0)this.scopeText=new Text(this.getScopeText(),0,0),this.addChild(this.scopeText),this.scopeHintText=new Text(this.getScopeHintText(),0,0),this.addChild(this.scopeHintText);else{let hintText="Only showing models from configured providers. Use /login to add providers.";this.addChild(new Text(theme.fg("warning",hintText),0,0))}this.addChild(new Text(theme.fg("muted","Filters: cost:low|medium|high|unknown \xB7 thinking:yes|no"),0,0)),this.addChild(new Spacer(1)),this.searchInput=new Input,initialSearchInput&&this.searchInput.setValue(initialSearchInput),this.searchInput.onSubmit=()=>{this.filteredModels[this.selectedIndex]&&this.handleSelect(this.filteredModels[this.selectedIndex].model)},this.addChild(this.searchInput),this.addChild(new Spacer(1)),this.listContainer=new Container,this.addChild(this.listContainer),this.addChild(new Spacer(1)),this.onSelectAsDefaultCallback&&this.addChild(new Text(theme.fg("dim"," Enter to select \xB7 Ctrl+S to set as default \xB7 Esc to cancel"),0,0)),this.addChild(new DynamicBorder),this.loadModelsFromSnapshot(),initialSearchInput?this.filterModels(initialSearchInput):this.updateList(),this.tui.requestRender(),this.refreshModels()}loadModelsFromSnapshot(){let models=this.modelRuntime.getAvailableSnapshot().map(model=>({provider:model.provider,id:model.id,model}));this.allModels=this.sortModels(models),this.scopedModels=this.scopedModels.map(scoped=>{let refreshed=this.modelRuntime.getModel(scoped.model.provider,scoped.model.id);return refreshed?{...scoped,model:refreshed}:scoped}),this.scopedModelItems=this.scopedModels.map(scoped=>({provider:scoped.model.provider,id:scoped.model.id,model:scoped.model})),this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels,this.filteredModels=this.activeModels;let currentIndex=this.filteredModels.findIndex(item=>modelsAreEqual(this.currentModel,item.model));this.selectedIndex=currentIndex>=0?currentIndex:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1))}async refreshModels(){let timedOut=!1;this.refreshTimeout=setTimeout(()=>{timedOut=!0,this.refreshAbortController.abort()},15e3);try{let result=await refreshModelCatalogs(this.modelRuntime,this.refreshAbortController.signal);if(this.closed)return;this.refreshStatusMessage="",result.aborted&&timedOut?this.errorMessage="Model refresh timed out; showing cached models.":result.errors.size===1?this.errorMessage=`Could not refresh ${result.errors.keys().next().value}; showing cached models.`:result.errors.size>1?this.errorMessage=`Could not refresh ${result.errors.size} model catalogs (${[...result.errors.keys()].join(", ")}); showing cached models.`:(this.errorMessage=this.modelRuntime.getError(),this.errorMessage||(this.refreshStatusMessage="Model catalogs refreshed.",this.refreshStatusSuccess=!0)),this.loadModelsFromSnapshot(),this.filterModels(this.searchInput.getValue()),this.tui.requestRender()}catch(error){if(this.closed)return;this.refreshStatusMessage="",this.errorMessage=timedOut?"Model refresh timed out; showing cached models.":`Could not refresh model catalogs: ${error instanceof Error?error.message:String(error)}`,this.updateList(),this.tui.requestRender()}finally{this.refreshTimeout&&clearTimeout(this.refreshTimeout)}}dispose(){this.closed||(this.closed=!0,this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshAbortController.abort())}sortModels(models){let sorted=[...models];return sorted.sort((a,b2)=>{let aIsCurrent=modelsAreEqual(this.currentModel,a.model),bIsCurrent=modelsAreEqual(this.currentModel,b2.model);if(aIsCurrent&&!bIsCurrent)return-1;if(!aIsCurrent&&bIsCurrent)return 1;let aIsDefault=this.isDefaultModel(a.model),bIsDefault=this.isDefaultModel(b2.model);return aIsDefault&&!bIsDefault?-1:!aIsDefault&&bIsDefault?1:a.provider.localeCompare(b2.provider)}),sorted}getScopeText(){let allText=this.scope==="all"?theme.fg("accent","all"):theme.fg("muted","all"),scopedText=this.scope==="scoped"?theme.fg("accent","scoped"):theme.fg("muted","scoped");return`${theme.fg("muted","Scope: ")}${allText}${theme.fg("muted"," | ")}${scopedText}`}getScopeHintText(){return keyHint("tui.input.tab","scope")+theme.fg("muted"," (all/scoped)")}isDefaultModel(model){return this.defaultModel?.provider===model.provider&&this.defaultModel.id===model.id}isDefaultSearch(query){let normalized=query.trim().toLowerCase();return normalized.length>0&&"default".startsWith(normalized)}setScope(scope){if(this.scope===scope)return;this.scope=scope,this.activeModels=this.scope==="scoped"?this.scopedModelItems:this.allModels;let currentIndex=this.activeModels.findIndex(item=>modelsAreEqual(this.currentModel,item.model));this.selectedIndex=currentIndex>=0?currentIndex:0,this.filterModels(this.searchInput.getValue()),this.scopeText&&this.scopeText.setText(this.getScopeText())}filterModels(query){let parsed=parseModelSearchQuery(query),hasQuery=parsed.text.length>0||parsed.filters.cost!==void 0||parsed.filters.thinking!==void 0,capabilityMatches=this.activeModels.filter(item=>matchesModelFilters(item.model,parsed.filters)),filtered=parsed.text?fuzzyFilter(capabilityMatches,parsed.text,item=>{let defaultText=this.isDefaultModel(item.model)?" default":"";return`${getModelSelectorSearchText({id:item.id,provider:item.provider,name:item.model.name})}${defaultText}`}):capabilityMatches;if(this.isDefaultSearch(parsed.text)){let defaultItems=capabilityMatches.filter(item=>this.isDefaultModel(item.model)),defaultKeys=new Set(defaultItems.map(item=>`${item.provider}\0${item.id}`));this.filteredModels=[...defaultItems,...filtered.filter(item=>!defaultKeys.has(`${item.provider}\0${item.id}`))]}else this.filteredModels=filtered;this.selectedIndex=hasQuery?0:Math.min(this.selectedIndex,Math.max(0,this.filteredModels.length-1)),this.updateList()}updateList(){this.listContainer.clear();let maxVisible=10,startIndex=Math.max(0,Math.min(this.selectedIndex-Math.floor(maxVisible/2),this.filteredModels.length-maxVisible)),endIndex=Math.min(startIndex+maxVisible,this.filteredModels.length);for(let i=startIndex;i<endIndex;i++){let item=this.filteredModels[i];if(!item)continue;let isSelected=i===this.selectedIndex,isCurrent=modelsAreEqual(this.currentModel,item.model),defaultBadge=this.isDefaultModel(item.model)?theme.fg("muted"," \xB7 default"):"",modelText=isSelected?`${theme.fg("accent","\u2192 ")}${theme.fg("accent",item.id)}`:` ${item.id}`,providerBadge=theme.fg("muted",`[${item.provider}]`),checkmark=isCurrent?theme.fg("success"," \u2713"):"",details=`${providerBadge}${defaultBadge}${checkmark} ${theme.fg("muted",getModelDetails(item.model))}`;this.listContainer.addChild(new ModelRow(modelText,details))}if(startIndex>0||endIndex<this.filteredModels.length){let scrollInfo=theme.fg("muted",` (${this.selectedIndex+1}/${this.filteredModels.length})`);this.listContainer.addChild(new Text(scrollInfo,0,0))}if(this.errorMessage){let errorLines=this.errorMessage.split(`
|
|
1348
1348
|
`);for(let line of errorLines)this.listContainer.addChild(new Text(theme.fg("error",line),0,0))}else if(this.filteredModels.length===0)this.listContainer.addChild(new Text(theme.fg("muted"," No matching models"),0,0));else{let selected=this.filteredModels[this.selectedIndex];this.listContainer.addChild(new Spacer(1)),this.listContainer.addChild(new Text(theme.fg("muted",` Model Name: ${selected.model.name}`),0,0))}this.refreshStatusMessage&&(this.listContainer.addChild(new Spacer(1)),this.listContainer.addChild(new Text(theme.fg(this.refreshStatusSuccess?"success":"muted",` ${this.refreshStatusMessage}`),0,0)))}handleInput(keyData){let kb=getKeybindings();if(kb.matches(keyData,"tui.input.tab")){if(this.scopedModelItems.length>0){let nextScope=this.scope==="all"?"scoped":"all";this.setScope(nextScope),this.scopeHintText&&this.scopeHintText.setText(this.getScopeHintText())}return}if(kb.matches(keyData,"tui.select.up")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredModels.length-1:this.selectedIndex-1,this.updateList()}else if(kb.matches(keyData,"tui.select.down")){if(this.filteredModels.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredModels.length-1?0:this.selectedIndex+1,this.updateList()}else if(kb.matches(keyData,"tui.select.confirm")){let selectedModel=this.filteredModels[this.selectedIndex];selectedModel&&this.handleSelect(selectedModel.model)}else if(kb.matches(keyData,"tui.select.cancel"))this.dispose(),this.onCancelCallback();else if(matchesKey(keyData,"ctrl+s")&&this.onSelectAsDefaultCallback){let selectedModel=this.filteredModels[this.selectedIndex];selectedModel&&(this.dispose(),this.onSelectAsDefaultCallback(selectedModel.model))}else this.searchInput.handleInput(keyData),this.filterModels(this.searchInput.getValue())}handleSelect(model){this.dispose(),this.onSelectCallback(model)}getSearchInput(){return this.searchInput}};function formatAuthSelectorProviderType(authType){return authType==="oauth"?"subscription":"API key"}var OAuthSelectorComponent=class extends Container{searchInput;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.searchInput.focused=value}listContainer;allProviders;filteredProviders;selectedIndex=0;mode;onSelectCallback;onCancelCallback;showAuthTypeLabels;constructor(mode,providers,onSelect,onCancel,initialSearchInput){super(),this.mode=mode,this.allProviders=providers,this.filteredProviders=providers,this.showAuthTypeLabels=new Set(providers.map(provider=>provider.authType)).size>1,this.onSelectCallback=onSelect,this.onCancelCallback=onCancel,this.addChild(new DynamicBorder),this.addChild(new Spacer(1));let title=mode==="login"?"Select provider to configure:":"Select provider to logout:";this.addChild(new TruncatedText(theme.fg("accent",theme.bold(title)),1,0)),this.addChild(new Spacer(1)),this.searchInput=new Input,initialSearchInput&&this.searchInput.setValue(initialSearchInput),this.searchInput.onSubmit=()=>{let selectedProvider=this.filteredProviders[this.selectedIndex];selectedProvider&&this.onSelectCallback(selectedProvider.id,selectedProvider.authType)},this.addChild(this.searchInput),this.addChild(new Spacer(1)),this.listContainer=new Container,this.addChild(this.listContainer),this.addChild(new Spacer(1)),this.addChild(new DynamicBorder),this.filterProviders(initialSearchInput??"")}filterProviders(query){this.filteredProviders=query?fuzzyFilter(this.allProviders,query,provider=>`${provider.name} ${provider.id} ${provider.authType} ${provider.method?.name??""}`):this.allProviders,this.selectedIndex=Math.max(0,Math.min(this.selectedIndex,Math.max(0,this.filteredProviders.length-1))),this.updateList()}updateList(){this.listContainer.clear();let maxVisible=8,startIndex=Math.max(0,Math.min(this.selectedIndex-Math.floor(maxVisible/2),this.filteredProviders.length-maxVisible)),endIndex=Math.min(startIndex+maxVisible,this.filteredProviders.length);for(let i=startIndex;i<endIndex;i++){let provider=this.filteredProviders[i];if(!provider)continue;let isSelected=i===this.selectedIndex,statusIndicator=this.formatStatusIndicator(provider),authTypeLabel=this.showAuthTypeLabels?theme.fg("muted",` [${formatAuthSelectorProviderType(provider.authType)}]`):"",line="";if(isSelected){let prefix=theme.fg("accent","\u2192 "),text=theme.fg("accent",provider.name);line=prefix+text+authTypeLabel+statusIndicator}else line=` ${theme.fg("text",provider.name)}`+authTypeLabel+statusIndicator;this.listContainer.addChild(new TruncatedText(line,1,0))}if(startIndex>0||endIndex<this.filteredProviders.length){let scrollInfo=theme.fg("muted",` (${this.selectedIndex+1}/${this.filteredProviders.length})`);this.listContainer.addChild(new TruncatedText(scrollInfo,1,0))}if(this.filteredProviders.length===0){let message=this.allProviders.length===0?this.mode==="login"?"No providers available":"No providers logged in. Use /login first.":"No matching providers";this.listContainer.addChild(new TruncatedText(theme.fg("muted",` ${message}`),1,0))}}formatStatusIndicator(provider){if(!provider.status)return theme.fg("muted"," \u2022 unconfigured");if(provider.status.type!==provider.authType){let label=provider.status.type==="oauth"?"subscription configured":"API key configured";return theme.fg("muted"," \u2022 ")+theme.fg("warning",label)}if(!provider.status.source||provider.status.source==="OAuth"||provider.status.source==="stored credential")return theme.fg("success"," \u2713 configured");let source=/^[A-Z][A-Z0-9_]*(?:, [A-Z][A-Z0-9_]*)*$/.test(provider.status.source)?`env: ${provider.status.source}`:provider.status.source;return theme.fg("success",` \u2713 ${source}`)}handleInput(keyData){let kb=getKeybindings();if(kb.matches(keyData,"tui.select.up")){if(this.filteredProviders.length===0)return;this.selectedIndex=Math.max(0,this.selectedIndex-1),this.updateList()}else if(kb.matches(keyData,"tui.select.down")){if(this.filteredProviders.length===0)return;this.selectedIndex=Math.min(this.filteredProviders.length-1,this.selectedIndex+1),this.updateList()}else if(kb.matches(keyData,"tui.select.confirm")){let selectedProvider=this.filteredProviders[this.selectedIndex];selectedProvider&&this.onSelectCallback(selectedProvider.id,selectedProvider.authType)}else kb.matches(keyData,"tui.select.cancel")?this.onCancelCallback():(this.searchInput.handleInput(keyData),this.filterProviders(this.searchInput.getValue()))}};function isEnabled(enabledIds,id){return enabledIds===null||enabledIds.includes(id)}function toggle(enabledIds,id){if(enabledIds===null)return[id];let index3=enabledIds.indexOf(id);return index3>=0?[...enabledIds.slice(0,index3),...enabledIds.slice(index3+1)]:[...enabledIds,id]}function enableAll(enabledIds,allIds,targetIds){if(enabledIds===null)return null;let targets=targetIds??allIds,result=[...enabledIds];for(let id of targets)result.includes(id)||result.push(id);return result.length===allIds.length&&result.every(id=>allIds.includes(id))?null:result}function clearAll(enabledIds,allIds,targetIds){if(enabledIds===null)return targetIds?allIds.filter(id=>!targetIds.includes(id)):[];let targets=new Set(targetIds??enabledIds);return enabledIds.filter(id=>!targets.has(id))}function move(enabledIds,id,delta){if(enabledIds===null)return null;let list=[...enabledIds],index3=list.indexOf(id);if(index3<0)return list;let newIndex=index3+delta;if(newIndex<0||newIndex>=list.length)return list;let result=[...list];return[result[index3],result[newIndex]]=[result[newIndex],result[index3]],result}function getSortedIds(enabledIds,allIds){if(enabledIds===null)return allIds;let enabledSet=new Set(enabledIds);return[...enabledIds,...allIds.filter(id=>!enabledSet.has(id))]}var ScopedModelsSelectorComponent=class extends Container{modelsById=new Map;allIds=[];enabledIds=null;filteredItems=[];selectedIndex=0;searchInput;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.searchInput.focused=value}listContainer;footerText;callbacks;maxVisible=8;isDirty=!1;refreshStatusText;constructor(config,callbacks){super(),this.callbacks=callbacks;for(let model of config.allModels){let fullId=`${model.provider}/${model.id}`;this.modelsById.set(fullId,model),this.allIds.push(fullId)}this.enabledIds=config.enabledModelIds===null?null:[...config.enabledModelIds],this.filteredItems=this.buildItems(),this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),this.addChild(new Text(theme.fg("accent",theme.bold("Model Configuration")),0,0)),this.addChild(new Text(theme.fg("muted",`Session-only. ${keyText("app.models.save")} to save to settings.`),0,0)),this.addChild(new Spacer(1)),this.searchInput=new Input,this.addChild(this.searchInput),this.addChild(new Spacer(1)),this.listContainer=new Container,this.addChild(this.listContainer),this.addChild(new Spacer(1)),config.refreshStatus&&(this.refreshStatusText=new Text(theme.fg("muted",` ${config.refreshStatus}`),0,0),this.addChild(this.refreshStatusText)),this.footerText=new Text(this.getFooterText(),0,0),this.addChild(this.footerText),this.addChild(new DynamicBorder),this.updateList()}updateModels(models,enabledModelIds){let selectedId=this.filteredItems[this.selectedIndex]?.fullId;enabledModelIds!==void 0&&(this.enabledIds=enabledModelIds===null?null:[...enabledModelIds]),this.modelsById.clear(),this.allIds=[];for(let model of models){let fullId=`${model.provider}/${model.id}`;this.modelsById.set(fullId,model),this.allIds.push(fullId)}this.refresh();let refreshedIndex=selectedId?this.filteredItems.findIndex(item=>item.fullId===selectedId):-1;refreshedIndex>=0&&(this.selectedIndex=refreshedIndex,this.updateList())}setRefreshStatus(message,kind){this.refreshStatusText?.setText(theme.fg(kind,` ${message}`))}buildItems(){return getSortedIds(this.enabledIds,this.allIds).map(id=>({fullId:id,model:this.modelsById.get(id),enabled:isEnabled(this.enabledIds,id)}))}getFooterText(){let enabledCount=this.enabledIds?.filter(id=>this.modelsById.has(id)).length??this.allIds.length,unavailableCount=this.enabledIds?.filter(id=>!this.modelsById.has(id)).length??0,countText=this.enabledIds===null?"all enabled":`${enabledCount}/${this.allIds.length} enabled${unavailableCount?` \xB7 ${unavailableCount} unavailable`:""}`,parts=[`${keyText("tui.select.confirm")} toggle`,`${keyText("app.models.enableAll")} all`,`${keyText("app.models.clearAll")} clear`,`${keyText("app.models.toggleProvider")} provider`,`${keyText("app.models.reorderUp")}/${keyText("app.models.reorderDown")} reorder`,`${keyText("app.models.save")} save`,countText];return this.isDirty?theme.fg("dim",` ${parts.join(" \xB7 ")} `)+theme.fg("warning","(unsaved)"):theme.fg("dim",` ${parts.join(" \xB7 ")}`)}refresh(){let query=this.searchInput.getValue(),items=this.buildItems();this.filteredItems=query?fuzzyFilter(items,query,item=>item.model?getModelSearchText({id:item.model.id,provider:item.model.provider,name:item.model.name}):item.fullId):items,this.selectedIndex=Math.min(this.selectedIndex,Math.max(0,this.filteredItems.length-1)),this.updateList(),this.footerText.setText(this.getFooterText())}notifyChange(){this.callbacks.onChange(this.enabledIds===null?null:[...this.enabledIds])}updateList(){if(this.listContainer.clear(),this.filteredItems.length===0){this.listContainer.addChild(new Text(theme.fg("muted"," No matching models"),0,0));return}let startIndex=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),endIndex=Math.min(startIndex+this.maxVisible,this.filteredItems.length),allEnabled=this.enabledIds===null;for(let i=startIndex;i<endIndex;i++){let item=this.filteredItems[i],isSelected=i===this.selectedIndex,prefix=isSelected?theme.fg("accent","\u2192 "):" ",id=item.model?.id??item.fullId,modelText=isSelected?theme.fg("accent",id):id,providerBadge=theme.fg("muted",item.model?` [${item.model.provider}]`:" [unavailable]"),status=item.model?allEnabled?"":item.enabled?theme.fg("success"," \u2713"):theme.fg("dim"," \u2717"):theme.fg("dim"," \u2717");this.listContainer.addChild(new Text(`${prefix}${modelText}${providerBadge}${status}`,0,0))}if((startIndex>0||endIndex<this.filteredItems.length)&&this.listContainer.addChild(new Text(theme.fg("muted",` (${this.selectedIndex+1}/${this.filteredItems.length})`),0,0)),this.filteredItems.length>0){let selected=this.filteredItems[this.selectedIndex];this.listContainer.addChild(new Spacer(1)),this.listContainer.addChild(new Text(theme.fg("muted",` ${selected.model?`Model Name: ${selected.model.name}`:"Model unavailable"}`),0,0))}}handleInput(data){let kb=getKeybindings();if(kb.matches(data,"tui.select.up")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.updateList();return}if(kb.matches(data,"tui.select.down")){if(this.filteredItems.length===0)return;this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.updateList();return}let reorderUp=kb.matches(data,"app.models.reorderUp"),reorderDown=kb.matches(data,"app.models.reorderDown");if(reorderUp||reorderDown){if(this.enabledIds===null)return;let item=this.filteredItems[this.selectedIndex];if(item&&isEnabled(this.enabledIds,item.fullId)){let delta=reorderUp?-1:1,newIndex=this.enabledIds.indexOf(item.fullId)+delta;newIndex>=0&&newIndex<this.enabledIds.length&&(this.enabledIds=move(this.enabledIds,item.fullId,delta),this.isDirty=!0,this.selectedIndex+=delta,this.refresh(),this.notifyChange())}return}if(kb.matches(data,"tui.select.confirm")){let item=this.filteredItems[this.selectedIndex];item&&(this.enabledIds=toggle(this.enabledIds,item.fullId),this.isDirty=!0,this.refresh(),this.notifyChange());return}if(kb.matches(data,"app.models.enableAll")){let targetIds=this.searchInput.getValue()?this.filteredItems.map(i=>i.fullId):void 0;this.enabledIds=enableAll(this.enabledIds,this.allIds,targetIds),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(kb.matches(data,"app.models.clearAll")){let targetIds=this.searchInput.getValue()?this.filteredItems.map(i=>i.fullId):void 0;this.enabledIds=clearAll(this.enabledIds,this.allIds,targetIds),this.isDirty=!0,this.refresh(),this.notifyChange();return}if(kb.matches(data,"app.models.toggleProvider")){let item=this.filteredItems[this.selectedIndex];if(item?.model){let provider=item.model.provider,providerIds=this.allIds.filter(id=>this.modelsById.get(id).provider===provider),allEnabled=providerIds.every(id=>isEnabled(this.enabledIds,id));this.enabledIds=allEnabled?clearAll(this.enabledIds,this.allIds,providerIds):enableAll(this.enabledIds,this.allIds,providerIds),this.isDirty=!0,this.refresh(),this.notifyChange()}return}if(kb.matches(data,"app.models.save")){this.callbacks.onPersist(this.enabledIds===null?null:[...this.enabledIds]),this.isDirty=!1,this.footerText.setText(this.getFooterText());return}if(matchesKey(data,Key.ctrl("c"))){this.searchInput.getValue()?(this.searchInput.setValue(""),this.refresh()):this.callbacks.onCancel();return}if(matchesKey(data,Key.escape)){this.callbacks.onCancel();return}this.searchInput.handleInput(data),this.refresh()}getSearchInput(){return this.searchInput}};var SUBMENU_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},SelectSubmenu=class extends Container{selectList;listChildIndex;allOptions;listLayout;searchInput;onSelectCb;onCancelCb;onSelectionChangeCb;constructor(title,description,options,currentValue,onSelect,onCancel,onSelectionChange,submenuOptions){super(),this.allOptions=options,this.listLayout=submenuOptions?.layout??SUBMENU_SELECT_LIST_LAYOUT,this.onSelectCb=onSelect,this.onCancelCb=onCancel,this.onSelectionChangeCb=onSelectionChange,this.addChild(new Text(theme.bold(theme.fg("accent",title)),0,0)),description&&(this.addChild(new Spacer(1)),this.addChild(new Text(theme.fg("muted",description),0,0))),submenuOptions?.searchable&&(this.addChild(new Spacer(1)),this.searchInput=new Input,this.searchInput.onSubmit=()=>{this.selectList.handleInput("\r")},this.addChild(this.searchInput)),this.addChild(new Spacer(1)),this.selectList=this.buildSelectList(options,currentValue),this.listChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Spacer(1));let hint=submenuOptions?.searchable?" Type to filter \xB7 Enter to select \xB7 Esc to go back":" Enter to select \xB7 Esc to go back";this.addChild(new Text(theme.fg("dim",hint),0,0))}buildSelectList(options,preselect){let list=new SelectList(options,Math.min(options.length,10),getSelectListTheme(),this.listLayout),idx=options.findIndex(o=>o.value===preselect);if(idx!==-1&&list.setSelectedIndex(idx),list.onSelect=item=>this.onSelectCb(item.value),list.onCancel=this.onCancelCb,this.onSelectionChangeCb){let cb=this.onSelectionChangeCb;list.onSelectionChange=item=>cb(item.value)}return list}applyFilter(query){let filtered=query?fuzzyFilter(this.allOptions,query,item=>`${item.label} ${item.description??""}`):this.allOptions,newList=this.buildSelectList(filtered,"");this.children[this.listChildIndex]=newList,this.selectList=newList}handleInput(data){if(this.searchInput){let kb=getKeybindings();kb.matches(data,"tui.select.up")||kb.matches(data,"tui.select.down")||kb.matches(data,"tui.select.confirm")||kb.matches(data,"tui.select.cancel")?this.selectList.handleInput(data):(this.searchInput.handleInput(data),this.applyFilter(this.searchInput.getValue()))}else this.selectList.handleInput(data)}},SteppedSubmenu=class extends Container{steps;onComplete;onCancel;opts;activeComponent;context;constructor(steps,onComplete,onCancel,opts={}){super(),this.steps=steps,this.onComplete=onComplete,this.onCancel=onCancel,this.opts=opts,this.context={...opts.initialContext??{}},this.activeComponent=this.buildStep(opts.startAtStep??0)}buildStep(stepIndex){let step=this.steps[stepIndex],total=this.steps.length,stepLabel=total>1?`Step ${stepIndex+1}/${total} \xB7 `:"",title=typeof step.title=="function"?step.title(this.context):step.title,desc=typeof step.description=="function"?step.description(this.context):step.description,items=step.options(this.context),preselect=step.preselect?.(this.context)??"";return new SelectSubmenu(title,`${stepLabel}${desc}`,items,preselect,value=>{this.context[step.key]=value,stepIndex<total-1?this.activeComponent=this.buildStep(stepIndex+1):(this.onComplete({...this.context}),this.opts.loop?(this.context={},this.activeComponent=this.buildStep(0)):this.onCancel())},()=>{stepIndex>0?(delete this.context[step.key],this.activeComponent=this.buildStep(stepIndex-1)):this.onCancel()},void 0,step.searchable||step.layout?{searchable:step.searchable,layout:step.layout}:void 0)}render(width){return this.activeComponent.render(width)}handleInput(data){this.activeComponent.handleInput?.(data)}invalidate(){this.activeComponent.invalidate?.()}};var MODEL_PICKER_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:46},THINKING_DESCRIPTIONS={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},DEFAULT_PROJECT_TRUST_LABELS={ask:"Ask",always:"Always trust",never:"Never trust"},DEFAULT_PROJECT_TRUST_BY_LABEL=new Map(Object.entries(DEFAULT_PROJECT_TRUST_LABELS).map(([value,label])=>[label,value])),WarningSettingsSubmenu=class extends Container{settingsList;state;constructor(warnings,onChange,onCancel){super(),this.state={...warnings};let items=[{id:"anthropic-extra-usage",label:"Anthropic extra usage",description:"Warn when Anthropic subscription auth may use paid extra usage",currentValue:this.state.anthropicExtraUsage??!0?"true":"false",values:["true","false"]}];this.settingsList=new SettingsList(items,Math.min(items.length,10),getSettingsListTheme(),(id,newValue)=>{id==="anthropic-extra-usage"&&(this.state={...this.state,anthropicExtraUsage:newValue==="true"},onChange({...this.state}))},onCancel),this.addChild(this.settingsList)}handleInput(data){this.settingsList.handleInput(data)}},CLEAR_OVERRIDE_VALUE="__clear__";function modelSettingKey(model){return`${model.provider}/${model.id}`}function modelDisplayLabel(model){return`${model.id} [${model.provider}]`}function modelThinkingOverridesSummary(overrides){let count=Object.keys(overrides).length;return count===0?"none":`${count} configured`}function modelItemLabel(model){return`${model.id} ${theme.fg("muted",`[${model.provider}]`)}`}function themeItems(availableThemes){return availableThemes.map(name=>({value:name,label:name}))}var AUTOMATIC_THEME_VALUE="/";function singleModeThemeItems(availableThemes){return[{value:AUTOMATIC_THEME_VALUE,label:"Automatic",description:"Use separate themes for light and dark terminal appearance"},...themeItems(availableThemes)]}function preferredTheme(availableThemes,preferred,fallback){return preferred&&availableThemes.includes(preferred)?preferred:availableThemes.includes(fallback)?fallback:availableThemes[0]??fallback}function defaultAutomaticThemes(currentThemeSetting,availableThemes){let autoTheme=parseAutoThemeSetting(currentThemeSetting);if(autoTheme)return autoTheme;let currentFixedTheme=currentThemeSetting.includes("/")?void 0:currentThemeSetting,themeName=preferredTheme(availableThemes,currentFixedTheme,"dark");return{lightTheme:themeName,darkTheme:themeName}}var ThemeSubmenu=class extends Container{inputComponent;callbacks;availableThemes;terminalTheme;onDone;originalThemeSetting;mode;singleTheme;lightTheme;darkTheme;constructor(currentThemeSetting,terminalTheme,availableThemes,callbacks,onDone){super(),this.callbacks=callbacks,this.availableThemes=availableThemes,this.terminalTheme=terminalTheme,this.onDone=onDone,this.originalThemeSetting=currentThemeSetting;let autoTheme=parseAutoThemeSetting(currentThemeSetting),automaticThemes=defaultAutomaticThemes(currentThemeSetting,availableThemes),fixedTheme=autoTheme||currentThemeSetting.includes("/")?void 0:currentThemeSetting;this.mode=autoTheme?"automatic":"single",this.lightTheme=automaticThemes.lightTheme,this.darkTheme=automaticThemes.darkTheme,this.singleTheme=preferredTheme(availableThemes,fixedTheme??(autoTheme?this.getActiveAutomaticTheme():void 0),"dark"),this.mode==="automatic"?this.showAutomaticMenu():this.showSingleMenu()}handleInput(data){this.inputComponent?.handleInput?.(data)}setContent(renderComponent,inputComponent=renderComponent){this.clear(),this.addChild(renderComponent),this.inputComponent=inputComponent}showSingleMenu(){this.mode="single";let menu=new SelectSubmenu("Theme","Select a theme, or choose Automatic to follow terminal appearance.",singleModeThemeItems(this.availableThemes),this.singleTheme,value=>{if(value===AUTOMATIC_THEME_VALUE){this.mode="automatic",this.callbacks.onThemePreview?.(this.getThemeSetting()),this.showAutomaticMenu();return}this.singleTheme=value,this.apply(value)},()=>this.cancel(),value=>{this.callbacks.onThemePreview?.(value===AUTOMATIC_THEME_VALUE?this.getAutomaticThemeSetting():value)});this.setContent(menu)}showAutomaticMenu(){this.mode="automatic";let content=new Container;content.addChild(new Text(theme.bold(theme.fg("accent","Automatic Theme")),0,0)),content.addChild(new Spacer(1)),content.addChild(new Text(theme.fg("muted","Choose themes for terminal light and dark appearance."),0,0)),content.addChild(new Text(theme.fg("muted","Light/dark detection requires terminal support."),0,0)),content.addChild(new Spacer(1));let items=[{id:"light-theme",label:"Light theme",description:"Theme to use in automatic mode when the terminal is light",currentValue:this.lightTheme,submenu:(currentValue,done)=>this.createThemeSelect("Light Theme","Select the theme to use for light terminal appearance",currentValue,done,value=>{this.lightTheme=value,this.callbacks.onThemePreview?.(this.getThemeSetting()),done(value)})},{id:"dark-theme",label:"Dark theme",description:"Theme to use in automatic mode when the terminal is dark",currentValue:this.darkTheme,submenu:(currentValue,done)=>this.createThemeSelect("Dark Theme","Select the theme to use for dark terminal appearance",currentValue,done,value=>{this.darkTheme=value,this.callbacks.onThemePreview?.(this.getThemeSetting()),done(value)})},{id:"apply",label:"Apply",description:"Save and go back",currentValue:"save and go back",values:["save and go back"]},{id:"single-mode",label:"Change mode",description:"Switch to one theme for light and dark",currentValue:"switch to single theme",values:["switch to single theme"]}],settingsList=new SettingsList(items,Math.min(items.length,10),getSettingsListTheme(),id=>{switch(id){case"single-mode":this.mode="single",this.singleTheme=this.getActiveAutomaticTheme(),this.callbacks.onThemePreview?.(this.singleTheme),this.showSingleMenu();break;case"apply":this.apply(this.getAutomaticThemeSetting());break}},()=>this.cancel());content.addChild(settingsList),this.setContent(content,settingsList)}createThemeSelect(title,description,currentValue,done,onSelect){return new SelectSubmenu(title,description,themeItems(this.availableThemes),currentValue,onSelect,()=>{this.callbacks.onThemePreview?.(this.getThemeSetting()),done()},value=>this.callbacks.onThemePreview?.(value))}getThemeSetting(){return this.mode==="automatic"?this.getAutomaticThemeSetting():this.singleTheme}getActiveAutomaticTheme(){return this.terminalTheme==="light"?this.lightTheme:this.darkTheme}getAutomaticThemeSetting(){return`${this.lightTheme}/${this.darkTheme}`}apply(themeSetting){this.onDone(themeSetting)}cancel(){this.callbacks.onThemePreview?.(this.originalThemeSetting),this.onDone()}},SettingsSelectorComponent=class extends Container{settingsList;constructor(config,callbacks){super();let supportsImages=getCapabilities().images,followUpKey=keyDisplayText("app.message.followUp"),cycleThinkingKey=keyDisplayText("app.thinking.cycle"),currentWarnings={...config.warnings},currentModelThinkingLevels={...config.modelThinkingLevels},defaultModelByValue=new Map(config.availableDefaultModels.map(model=>[modelSettingKey(model),model])),currentDefaultModelKey=defaultModelByValue.has(config.defaultModel)?config.defaultModel:void 0,currentModelKey=config.currentModel?modelSettingKey(config.currentModel):void 0,items=[{id:"autocompact",label:"Auto-compact",description:"Automatically compact context when it gets too large",currentValue:config.autoCompact?"true":"false",values:["true","false"]},{id:"steering-mode",label:"Steering mode",description:"Enter while streaming queues steering messages. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.",currentValue:config.steeringMode,values:["one-at-a-time","all"]},{id:"follow-up-mode",label:"Follow-up mode",description:`${followUpKey} queues follow-up messages until agent stops. 'one-at-a-time': deliver one, wait for response. 'all': deliver all at once.`,currentValue:config.followUpMode,values:["one-at-a-time","all"]},{id:"transport",label:"Transport",description:"Preferred transport for providers that support multiple transports",currentValue:config.transport,values:["sse","websocket","websocket-cached","auto"]},{id:"http-idle-timeout",label:"HTTP idle timeout",description:"Maximum idle gap while waiting for HTTP headers or body chunks. Disable for local models that pause longer than five minutes.",currentValue:formatHttpIdleTimeoutMs(config.httpIdleTimeoutMs),values:HTTP_IDLE_TIMEOUT_CHOICES.map(choice=>choice.label)},{id:"hide-thinking",label:"Hide thinking",description:"Hide thinking blocks in assistant responses",currentValue:config.hideThinkingBlock?"true":"false",values:["true","false"]},{id:"mermaid-rendering",label:"Mermaid diagrams",description:"Render Mermaid code blocks as Unicode diagrams",currentValue:config.mermaidRenderingMode,values:["off","final","streaming"]},{id:"cache-miss-notices",label:"Cache miss notices",description:"Show transcript notices for significant prompt-cache misses and compaction costs",currentValue:config.showCacheMissNotices?"true":"false",values:["true","false"]},{id:"collapse-changelog",label:"Collapse changelog",description:"Show condensed changelog after updates",currentValue:config.collapseChangelog?"true":"false",values:["true","false"]},{id:"quiet-startup",label:"Quiet startup",description:"Disable verbose printing at startup",currentValue:config.quietStartup?"true":"false",values:["true","false"]},{id:"install-telemetry",label:"Install telemetry",description:"Send an anonymous version/update ping after changelog-detected updates",currentValue:config.enableInstallTelemetry?"true":"false",values:["true","false"]},{id:"default-project-trust",label:"Default project trust",description:"Fallback behavior when no extension or saved trust decision decides project trust",currentValue:DEFAULT_PROJECT_TRUST_LABELS[config.defaultProjectTrust],values:Object.values(DEFAULT_PROJECT_TRUST_LABELS)},{id:"double-escape-action",label:"Double-escape action",description:"Action when pressing Escape twice with empty editor",currentValue:config.doubleEscapeAction,values:["tree","fork","none"]},{id:"tree-filter-mode",label:"Tree filter mode",description:"Default filter when opening /tree",currentValue:config.treeFilterMode,values:["default","no-tools","user-only","labeled-only","all"]},{id:"warnings",label:"Warnings",description:"Enable or disable individual warnings",currentValue:"configure",submenu:(_currentValue,done)=>new WarningSettingsSubmenu(currentWarnings,warnings=>{currentWarnings=warnings,callbacks.onWarningsChange(warnings)},()=>done())},{id:"model-thinking",label:"Default thinking level per model",description:`Override the default thinking level for specific models. ${cycleThinkingKey} cycles in-session.`,currentValue:modelThinkingOverridesSummary(currentModelThinkingLevels),submenu:(_currentValue,done)=>{let steps=[{key:"model",title:"Per-Model Thinking Level",description:"Select a model to configure",options:()=>{let items2=[...config.availableDefaultModels].sort((a,b2)=>{let aKey=modelSettingKey(a),bKey=modelSettingKey(b2);return aKey===currentModelKey?-1:bKey===currentModelKey?1:aKey===currentDefaultModelKey?-1:bKey===currentDefaultModelKey?1:a.provider.localeCompare(b2.provider)}).map(model=>{let key=modelSettingKey(model),override=currentModelThinkingLevels[key];return{value:key,label:modelItemLabel(model),description:override??void 0}});return items2.length===0&&items2.push({value:"__none__",label:"No models available",description:"Log in to a provider or configure an API key first"}),items2},preselect:()=>currentModelKey??currentDefaultModelKey,searchable:!0,layout:MODEL_PICKER_LAYOUT},{key:"level",title:ctx=>{let m2=defaultModelByValue.get(ctx.model);return`Thinking Level for ${m2?modelDisplayLabel(m2):ctx.model}`},description:"Select default thinking level for this model",options:ctx=>{let model=defaultModelByValue.get(ctx.model);if(!model)return[];let items2=(model.reasoning?getSupportedThinkingLevels(model):["off"]).map(level=>({value:level,label:level,description:THINKING_DESCRIPTIONS[level]}));return currentModelThinkingLevels[ctx.model]!==void 0&&items2.push({value:CLEAR_OVERRIDE_VALUE,label:"(clear override)",description:`Revert to global default (${config.thinkingLevel})`}),items2},preselect:ctx=>currentModelThinkingLevels[ctx.model]}],summary=()=>modelThinkingOverridesSummary(currentModelThinkingLevels);return new SteppedSubmenu(steps,selections=>{let model=defaultModelByValue.get(selections.model);model&&(selections.level===CLEAR_OVERRIDE_VALUE?(callbacks.onModelThinkingLevelRemove(model.provider,model.id),delete currentModelThinkingLevels[selections.model]):(callbacks.onModelThinkingLevelChange(model.provider,model.id,selections.level),currentModelThinkingLevels[selections.model]=selections.level))},()=>{done(summary())},{loop:!0})}},{id:"tui-mode",label:"TUI mode",description:"Interface layout; fullscreen mode is experimental",currentValue:config.tuiMode,values:["regular","fullscreen"]},{id:"fullscreen-exit-output",label:"Fullscreen exit output",description:"Print the transcript or only a session resume hint when exiting fullscreen mode",currentValue:config.fullscreenExitOutput,values:["transcript","resume-hint"]},{id:"fullscreen-scrollbar",label:"Fullscreen scrollbar",description:"Scrollbar behavior in fullscreen mode; has no effect in regular mode",currentValue:config.fullscreenScrollbar,values:["auto","always","hidden"]},{id:"theme",label:"Theme",description:"Color theme for the interface",currentValue:config.currentTheme,submenu:(currentValue,done)=>new ThemeSubmenu(currentValue,config.terminalTheme,config.availableThemes,callbacks,done)}];supportsImages&&(items.splice(1,0,{id:"show-images",label:"Show images",description:"Render images inline in terminal",currentValue:config.showImages?"true":"false",values:["true","false"]}),items.splice(2,0,{id:"image-width-cells",label:"Image width",description:"Preferred inline image width in terminal cells",currentValue:String(config.imageWidthCells),values:["60","80","120"]})),items.splice(supportsImages?3:1,0,{id:"auto-resize-images",label:"Auto-resize images",description:"Resize large images to 2000x2000 max for better model compatibility",currentValue:config.autoResizeImages?"true":"false",values:["true","false"]});let autoResizeIndex=items.findIndex(item=>item.id==="auto-resize-images");items.splice(autoResizeIndex+1,0,{id:"block-images",label:"Block images",description:"Prevent images from being sent to LLM providers",currentValue:config.blockImages?"true":"false",values:["true","false"]});let blockImagesIndex=items.findIndex(item=>item.id==="block-images");items.splice(blockImagesIndex+1,0,{id:"skill-commands",label:"Skill commands",description:"Register skills as /skill:name commands",currentValue:config.enableSkillCommands?"true":"false",values:["true","false"]});let skillCommandsIndex=items.findIndex(item=>item.id==="skill-commands");items.splice(skillCommandsIndex+1,0,{id:"show-hardware-cursor",label:"Show hardware cursor",description:"Show the terminal cursor while still positioning it for IME support",currentValue:config.showHardwareCursor?"true":"false",values:["true","false"]});let hardwareCursorIndex=items.findIndex(item=>item.id==="show-hardware-cursor");items.splice(hardwareCursorIndex+1,0,{id:"editor-padding",label:"Editor padding",description:"Horizontal padding for input editor (0-3)",currentValue:String(config.editorPaddingX),values:["0","1","2","3"]});let editorPaddingIndex=items.findIndex(item=>item.id==="editor-padding");items.splice(editorPaddingIndex+1,0,{id:"output-padding",label:"Output padding",description:"Horizontal padding for user messages, assistant messages, and thinking",currentValue:String(config.outputPad),values:["0","1"]});let outputPaddingIndex=items.findIndex(item=>item.id==="output-padding");items.splice(outputPaddingIndex+1,0,{id:"autocomplete-max-visible",label:"Autocomplete max items",description:"Max visible items in autocomplete dropdown (3-20)",currentValue:String(config.autocompleteMaxVisible),values:["3","5","7","10","15","20"]});let autocompleteIndex=items.findIndex(item=>item.id==="autocomplete-max-visible");items.splice(autocompleteIndex+1,0,{id:"clear-on-shrink",label:"Clear on shrink",description:"Clear empty rows when content shrinks (may cause flicker)",currentValue:config.clearOnShrink?"true":"false",values:["true","false"]});let clearOnShrinkIndex=items.findIndex(item=>item.id==="clear-on-shrink");items.splice(clearOnShrinkIndex+1,0,{id:"terminal-progress",label:"Terminal progress",description:"Show OSC 9;4 progress indicators in the terminal tab bar",currentValue:config.showTerminalProgress?"true":"false",values:["true","false"]}),this.addChild(new DynamicBorder),this.settingsList=new SettingsList(items,10,getSettingsListTheme(),(id,newValue)=>{switch(id){case"autocompact":callbacks.onAutoCompactChange(newValue==="true");break;case"show-images":callbacks.onShowImagesChange(newValue==="true");break;case"image-width-cells":callbacks.onImageWidthCellsChange(parseInt(newValue,10));break;case"auto-resize-images":callbacks.onAutoResizeImagesChange(newValue==="true");break;case"block-images":callbacks.onBlockImagesChange(newValue==="true");break;case"skill-commands":callbacks.onEnableSkillCommandsChange(newValue==="true");break;case"steering-mode":callbacks.onSteeringModeChange(newValue);break;case"follow-up-mode":callbacks.onFollowUpModeChange(newValue);break;case"transport":callbacks.onTransportChange(newValue);break;case"http-idle-timeout":{let choice=HTTP_IDLE_TIMEOUT_CHOICES.find(item=>item.label===newValue);choice&&callbacks.onHttpIdleTimeoutMsChange(choice.timeoutMs);break}case"hide-thinking":callbacks.onHideThinkingBlockChange(newValue==="true");break;case"mermaid-rendering":callbacks.onMermaidRenderingModeChange(newValue);break;case"cache-miss-notices":callbacks.onShowCacheMissNoticesChange(newValue==="true");break;case"collapse-changelog":callbacks.onCollapseChangelogChange(newValue==="true");break;case"quiet-startup":callbacks.onQuietStartupChange(newValue==="true");break;case"install-telemetry":callbacks.onEnableInstallTelemetryChange(newValue==="true");break;case"default-project-trust":{let defaultProjectTrust=DEFAULT_PROJECT_TRUST_BY_LABEL.get(newValue);defaultProjectTrust&&callbacks.onDefaultProjectTrustChange(defaultProjectTrust);break}case"double-escape-action":callbacks.onDoubleEscapeActionChange(newValue);break;case"tree-filter-mode":callbacks.onTreeFilterModeChange(newValue);break;case"show-hardware-cursor":callbacks.onShowHardwareCursorChange(newValue==="true");break;case"editor-padding":callbacks.onEditorPaddingXChange(parseInt(newValue,10));break;case"output-padding":callbacks.onOutputPadChange(newValue==="0"?0:1);break;case"autocomplete-max-visible":callbacks.onAutocompleteMaxVisibleChange(parseInt(newValue,10));break;case"clear-on-shrink":callbacks.onClearOnShrinkChange(newValue==="true");break;case"terminal-progress":callbacks.onShowTerminalProgressChange(newValue==="true");break;case"tui-mode":callbacks.onTuiModeChange(newValue);break;case"fullscreen-exit-output":callbacks.onFullscreenExitOutputChange(newValue);break;case"fullscreen-scrollbar":callbacks.onFullscreenScrollbarChange(newValue);break;case"theme":callbacks.onThemeChange(newValue);break}},callbacks.onCancel,{enableSearch:!0}),this.addChild(this.settingsList),this.addChild(new DynamicBorder)}getSettingsList(){return this.settingsList}};var SkillInvocationMessageComponent=class extends Box{expanded=!1;skillBlock;markdownTheme;constructor(skillBlock,markdownTheme=getMarkdownTheme()){super(1,1,t=>theme.bg("customMessageBg",t)),this.skillBlock=skillBlock,this.markdownTheme=markdownTheme,this.updateDisplay()}setExpanded(expanded){this.expanded=expanded,this.updateDisplay()}invalidate(){super.invalidate(),this.updateDisplay()}updateDisplay(){if(this.clear(),this.expanded){let label=theme.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m");this.addChild(new Text(label,0,0));let header=`**${this.skillBlock.name}**
|
|
1349
1349
|
|
|
1350
1350
|
`;this.addChild(new Markdown(header+this.skillBlock.content,0,0,this.markdownTheme,{color:text=>theme.fg("customMessageText",text)}))}else{let line=theme.fg("customMessageLabel","\x1B[1m[skill]\x1B[22m ")+theme.fg("customMessageText",this.skillBlock.name)+theme.fg("dim",` (${keyText("app.tools.expand")} to expand)`);this.addChild(new Text(line,0,0))}}};var StatusIndicator=class extends Loader{kind;constructor(kind,ui,spinnerColorFn,messageColorFn,message,indicator){super(ui,spinnerColorFn,messageColorFn,message,indicator),this.kind=kind}dispose(){this.stop()}},WorkingStatusIndicator=class extends StatusIndicator{constructor(ui,message,indicator){super("working",ui,spinner=>theme.fg("accent",spinner),text=>theme.fg("muted",text),message,indicator)}},RetryStatusIndicator=class extends StatusIndicator{countdown;constructor(ui,attempt2,maxAttempts,delayMs){let retryMessage=seconds=>`Retrying (${attempt2}/${maxAttempts}) in ${seconds}s... (${keyText("app.interrupt")} to cancel)`;super("retry",ui,spinner=>theme.fg("warning",spinner),text=>theme.fg("muted",text),retryMessage(Math.ceil(delayMs/1e3))),this.countdown=new CountdownTimer(delayMs,ui,seconds=>{this.setMessage(retryMessage(seconds))},()=>{this.countdown=void 0})}dispose(){this.countdown?.dispose(),this.countdown=void 0,super.dispose()}},CompactionStatusIndicator=class extends StatusIndicator{constructor(ui,reason){let cancelHint=`(${keyText("app.interrupt")} to cancel)`,label=reason==="manual"?`Compacting context... ${cancelHint}`:`${reason==="overflow"?"Context overflow detected, ":""}Auto-compacting... ${cancelHint}`;super("compaction",ui,spinner=>theme.fg("accent",spinner),text=>theme.fg("muted",text),label)}},BranchSummaryStatusIndicator=class extends StatusIndicator{constructor(ui){super("branchSummary",ui,spinner=>theme.fg("accent",spinner),text=>theme.fg("muted",text),`Summarizing branch... (${keyText("app.interrupt")} to cancel)`)}},IdleStatus=class{invalidate(){}render(width){let emptyLine=" ".repeat(width);return[emptyLine,emptyLine]}};var THINKING_SELECT_LIST_LAYOUT={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},LEVEL_DESCRIPTIONS={off:"No reasoning",minimal:"Very brief reasoning (~1k tokens)",low:"Light reasoning (~2k tokens)",medium:"Moderate reasoning (~8k tokens)",high:"Deep reasoning (~16k tokens)",xhigh:"Extra-high reasoning (~32k tokens)",max:"Maximum reasoning"},ThinkingSelectorComponent=class extends Container{searchInput;selectList;selectListChildIndex;allItems;onSelect;onCancel;onSelectAsDefault;_focused=!1;get focused(){return this._focused}set focused(value){this._focused=value,this.searchInput.focused=value}constructor(currentLevel,availableLevels,onSelect,onCancel,onSelectAsDefault,defaultThinkingLevel){super(),this.onSelect=onSelect,this.onCancel=onCancel,this.onSelectAsDefault=onSelectAsDefault,this.allItems=availableLevels.map(level=>({value:level,label:level,description:level===defaultThinkingLevel?`${LEVEL_DESCRIPTIONS[level]} \xB7 default`:LEVEL_DESCRIPTIONS[level]})),this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),this.addChild(new Text("Thinking Level",0,0)),this.addChild(new Spacer(1)),this.addChild(new Text(`${keyDisplayText("app.thinking.cycle")} cycles thinking levels in-session`,0,0)),this.addChild(new Spacer(1)),this.searchInput=new Input,this.searchInput.onSubmit=()=>this.selectList.handleInput("\r"),this.addChild(this.searchInput),this.addChild(new Spacer(1)),this.selectList=this.buildSelectList(this.allItems,currentLevel),this.selectListChildIndex=this.children.length,this.addChild(this.selectList),this.addChild(new Spacer(1)),this.addChild(new Text(theme.fg("dim"," Enter to select \xB7 Ctrl+S to set as default \xB7 Esc to cancel"),0,0)),this.addChild(new DynamicBorder)}buildSelectList(items,preselect){let list=new SelectList(items,Math.max(1,items.length),getSelectListTheme(),THINKING_SELECT_LIST_LAYOUT),currentIndex=items.findIndex(item=>item.value===preselect);return currentIndex!==-1&&list.setSelectedIndex(currentIndex),list.onSelect=item=>this.onSelect(item.value),list.onCancel=()=>this.onCancel(),list}applyFilter(query){let filtered=query?fuzzyFilter(this.allItems,query,item=>`${item.label} ${item.description??""}`):this.allItems,selectedValue=this.selectList.getSelectedItem()?.value,newList=this.buildSelectList(filtered,selectedValue);this.children[this.selectListChildIndex]=newList,this.selectList=newList}handleInput(keyData){if(matchesKey(keyData,"ctrl+s")&&this.onSelectAsDefault){let item=this.selectList.getSelectedItem();item&&this.onSelectAsDefault(item.value);return}let kb=getKeybindings();if(kb.matches(keyData,"tui.select.up")||kb.matches(keyData,"tui.select.down")||kb.matches(keyData,"tui.select.confirm")||kb.matches(keyData,"tui.select.cancel")){this.selectList.handleInput(keyData);return}this.searchInput.handleInput(keyData),this.applyFilter(this.searchInput.getValue())}getSelectList(){return this.selectList}};var FALLBACK_PREVIEW_LINES=10,ToolExecutionComponent=class extends Container{contentBox;contentText;selfRenderContainer;callRendererComponent;resultRendererComponent;rendererState={};imageComponents=[];imageSpacers=[];toolName;toolCallId;args;expanded=!1;showImages;imageWidthCells;isPartial=!0;toolDefinition;builtInToolDefinition;ui;cwd;executionStarted=!1;argsComplete=!1;result;convertedImages=new Map;hideComponent=!1;constructor(toolName,toolCallId,args,options={},toolDefinition,ui,cwd){super(),this.toolName=toolName,this.toolCallId=toolCallId,this.args=args,this.toolDefinition=toolDefinition,this.builtInToolDefinition=createAllToolDefinitions(cwd)[toolName],this.showImages=options.showImages??!0,this.imageWidthCells=options.imageWidthCells??60,this.ui=ui,this.cwd=cwd,this.addChild(new Spacer(1)),this.contentBox=new Box(1,1,text=>theme.bg("toolPendingBg",text)),this.contentText=new Text("",1,1,text=>theme.bg("toolPendingBg",text)),this.selfRenderContainer=new Container,this.hasRendererDefinition()?this.addChild(this.getRenderShell()==="self"?this.selfRenderContainer:this.contentBox):this.addChild(this.contentText),this.updateDisplay()}getCallRenderer(){return this.builtInToolDefinition?this.toolDefinition?this.toolDefinition.renderCall??this.builtInToolDefinition.renderCall:this.builtInToolDefinition.renderCall:this.toolDefinition?.renderCall}getResultRenderer(){return this.builtInToolDefinition?this.toolDefinition?this.toolDefinition.renderResult??this.builtInToolDefinition.renderResult:this.builtInToolDefinition.renderResult:this.toolDefinition?.renderResult}hasRendererDefinition(){return this.builtInToolDefinition!==void 0||this.toolDefinition!==void 0}getRenderShell(){return this.builtInToolDefinition?this.toolDefinition?this.toolDefinition.renderShell??this.builtInToolDefinition.renderShell??"default":this.builtInToolDefinition.renderShell??"default":this.toolDefinition?.renderShell??"default"}getRenderContext(lastComponent){return{args:this.args,toolCallId:this.toolCallId,invalidate:()=>{this.invalidate(),this.ui.requestRender()},lastComponent,state:this.rendererState,cwd:this.cwd,executionStarted:this.executionStarted,argsComplete:this.argsComplete,isPartial:this.isPartial,expanded:this.expanded,showImages:this.showImages,isError:this.result?.isError??!1}}createCallFallback(){return new Text(theme.fg("toolTitle",theme.bold(this.toolName)),0,0)}createResultFallback(){let output=this.getTextOutput();if(!output)return;let lines=output.split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
3
|
-
import{APP_NAME,configureHttpDispatcher,main}from"./chunks/chunk-
|
|
3
|
+
import{APP_NAME,configureHttpDispatcher,main}from"./chunks/chunk-BRL3MDQL.js";import"./chunks/chunk-XDUWOHPL.js";import"./chunks/chunk-JUUC5AZY.js";import"./chunks/chunk-DRQDKNXA.js";import"./chunks/chunk-TRDNDS6A.js";import"./chunks/chunk-MNAIPA3J.js";import"./chunks/chunk-UAQELI3K.js";import"./chunks/chunk-4L3WN2XY.js";process.title=APP_NAME;process.env.PI_CODING_AGENT="true";process.env.AI_AGENT="pi";process.emitWarning=(()=>{});configureHttpDispatcher();main(process.argv.slice(2));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,ProjectTrustStore,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildSessionContext,calculateContextTokens,collectEntriesForBranchSummary,compact,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,keyHint,keyText,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,rawKeyHint,readStoredCredential,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-
|
|
2
|
+
import{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,ProjectTrustStore,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildSessionContext,calculateContextTokens,collectEntriesForBranchSummary,compact,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,keyHint,keyText,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,rawKeyHint,readStoredCredential,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-BRL3MDQL.js";import"./chunks/chunk-XDUWOHPL.js";import"./chunks/chunk-JUUC5AZY.js";import"./chunks/chunk-DRQDKNXA.js";import"./chunks/chunk-TRDNDS6A.js";import"./chunks/chunk-MNAIPA3J.js";import"./chunks/chunk-UAQELI3K.js";import"./chunks/chunk-4L3WN2XY.js";export{AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthSelectorComponent,ProjectTrustStore,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,VERSION,buildContextEntries,buildSessionContext,calculateContextTokens,collectEntriesForBranchSummary,compact,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSyntheticSourceInfo,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAndLoadExtensions,estimateTokens,findCutPoint,findTurnStartIndex,formatDimensionNote,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,keyHint,keyText,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseSessionEntries,parseSkillBlock,prepareBranchEntries,rawKeyHint,readStoredCredential,renderDiff,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
3
|
-
import{APP_NAME,configureHttpDispatcher,main}from"./chunks/chunk-
|
|
3
|
+
import{APP_NAME,configureHttpDispatcher,main}from"./chunks/chunk-BRL3MDQL.js";import"./chunks/chunk-XDUWOHPL.js";import"./chunks/chunk-JUUC5AZY.js";import"./chunks/chunk-DRQDKNXA.js";import"./chunks/chunk-TRDNDS6A.js";import"./chunks/chunk-MNAIPA3J.js";import"./chunks/chunk-UAQELI3K.js";import"./chunks/chunk-4L3WN2XY.js";process.title=`${APP_NAME}-rpc`;process.env.PI_CODING_AGENT="true";process.env.AI_AGENT="pi";process.emitWarning=(()=>{});configureHttpDispatcher();main(["--mode","rpc",...process.argv.slice(2)]);
|
|
@@ -1,10 +1,66 @@
|
|
|
1
1
|
import { modelsAreEqual } from "@earendil-works/pi-ai";
|
|
2
|
-
import { Container, fuzzyFilter, getKeybindings, Input, matchesKey, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
2
|
+
import { Container, fuzzyFilter, getKeybindings, Input, matchesKey, Spacer, Text, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
|
|
3
3
|
import { refreshModelCatalogs } from "../model-catalog-refresh.js";
|
|
4
4
|
import { getModelSelectorSearchText } from "../model-search.js";
|
|
5
5
|
import { theme } from "../theme/theme.js";
|
|
6
6
|
import { DynamicBorder } from "./dynamic-border.js";
|
|
7
7
|
import { keyHint } from "./keybinding-hints.js";
|
|
8
|
+
class ModelRow {
|
|
9
|
+
modelText;
|
|
10
|
+
details;
|
|
11
|
+
constructor(modelText, details) {
|
|
12
|
+
this.modelText = modelText;
|
|
13
|
+
this.details = details;
|
|
14
|
+
}
|
|
15
|
+
invalidate() { }
|
|
16
|
+
render(width) {
|
|
17
|
+
const details = truncateToWidth(this.details, Math.max(1, width - 1), "…");
|
|
18
|
+
const availableModelWidth = Math.max(1, width - visibleWidth(details) - 1);
|
|
19
|
+
const model = truncateToWidth(this.modelText, availableModelWidth, "…");
|
|
20
|
+
return [truncateToWidth(`${model} ${details}`, width, "…")];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function getModelCostBucket(model) {
|
|
24
|
+
const cost = model.cost;
|
|
25
|
+
if (!cost)
|
|
26
|
+
return "unknown";
|
|
27
|
+
const { input, output } = cost;
|
|
28
|
+
if (![input, output].every((price) => Number.isFinite(price) && price > 0))
|
|
29
|
+
return "unknown";
|
|
30
|
+
const highestRate = Math.max(input, output);
|
|
31
|
+
if (highestRate < 5)
|
|
32
|
+
return "low";
|
|
33
|
+
if (highestRate < 20)
|
|
34
|
+
return "medium";
|
|
35
|
+
return "high";
|
|
36
|
+
}
|
|
37
|
+
function getModelDetails(model) {
|
|
38
|
+
return `cost: ${getModelCostBucket(model)} · thinking: ${model.reasoning ? "yes" : "no"}`;
|
|
39
|
+
}
|
|
40
|
+
function parseModelSearchQuery(query) {
|
|
41
|
+
const textTokens = [];
|
|
42
|
+
const filters = {};
|
|
43
|
+
for (const token of query.trim().split(/\s+/u).filter(Boolean)) {
|
|
44
|
+
const [key, value] = token.toLowerCase().split(":", 2);
|
|
45
|
+
if (key === "cost" && (value === "low" || value === "medium" || value === "high" || value === "unknown")) {
|
|
46
|
+
filters.cost = value;
|
|
47
|
+
}
|
|
48
|
+
else if (key === "thinking" && (value === "yes" || value === "no")) {
|
|
49
|
+
filters.thinking = value === "yes";
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
textTokens.push(token);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { text: textTokens.join(" "), filters };
|
|
56
|
+
}
|
|
57
|
+
function matchesModelFilters(model, filters) {
|
|
58
|
+
if (filters.cost !== undefined && getModelCostBucket(model) !== filters.cost)
|
|
59
|
+
return false;
|
|
60
|
+
if (filters.thinking !== undefined && model.reasoning !== filters.thinking)
|
|
61
|
+
return false;
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
8
64
|
/**
|
|
9
65
|
* Component that renders a model selector with search
|
|
10
66
|
*/
|
|
@@ -67,6 +123,7 @@ export class ModelSelectorComponent extends Container {
|
|
|
67
123
|
const hintText = "Only showing models from configured providers. Use /login to add providers.";
|
|
68
124
|
this.addChild(new Text(theme.fg("warning", hintText), 0, 0));
|
|
69
125
|
}
|
|
126
|
+
this.addChild(new Text(theme.fg("muted", "Filters: cost:low|medium|high|unknown · thinking:yes|no"), 0, 0));
|
|
70
127
|
this.addChild(new Spacer(1));
|
|
71
128
|
// Create search input
|
|
72
129
|
this.searchInput = new Input();
|
|
@@ -225,30 +282,30 @@ export class ModelSelectorComponent extends Container {
|
|
|
225
282
|
}
|
|
226
283
|
}
|
|
227
284
|
filterModels(query) {
|
|
228
|
-
|
|
229
|
-
|
|
285
|
+
const parsed = parseModelSearchQuery(query);
|
|
286
|
+
const hasQuery = parsed.text.length > 0 || parsed.filters.cost !== undefined || parsed.filters.thinking !== undefined;
|
|
287
|
+
const capabilityMatches = this.activeModels.filter((item) => matchesModelFilters(item.model, parsed.filters));
|
|
288
|
+
const filtered = parsed.text
|
|
289
|
+
? fuzzyFilter(capabilityMatches, parsed.text, (item) => {
|
|
230
290
|
const defaultText = this.isDefaultModel(item.model) ? " default" : "";
|
|
231
291
|
return `${getModelSelectorSearchText({ id: item.id, provider: item.provider, name: item.model.name })}${defaultText}`;
|
|
232
|
-
})
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
else {
|
|
242
|
-
this.filteredModels = filtered;
|
|
243
|
-
}
|
|
292
|
+
})
|
|
293
|
+
: capabilityMatches;
|
|
294
|
+
if (this.isDefaultSearch(parsed.text)) {
|
|
295
|
+
const defaultItems = capabilityMatches.filter((item) => this.isDefaultModel(item.model));
|
|
296
|
+
const defaultKeys = new Set(defaultItems.map((item) => `${item.provider}\0${item.id}`));
|
|
297
|
+
this.filteredModels = [
|
|
298
|
+
...defaultItems,
|
|
299
|
+
...filtered.filter((item) => !defaultKeys.has(`${item.provider}\0${item.id}`)),
|
|
300
|
+
];
|
|
244
301
|
}
|
|
245
302
|
else {
|
|
246
|
-
this.filteredModels =
|
|
303
|
+
this.filteredModels = filtered;
|
|
247
304
|
}
|
|
248
305
|
// When filtering by a query, move the selector to the top row so the best
|
|
249
306
|
// match is highlighted. When the query is cleared, keep the current position
|
|
250
307
|
// clamped to the (restored) list length.
|
|
251
|
-
this.selectedIndex =
|
|
308
|
+
this.selectedIndex = hasQuery ? 0 : Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
|
|
252
309
|
this.updateList();
|
|
253
310
|
}
|
|
254
311
|
updateList() {
|
|
@@ -265,21 +322,11 @@ export class ModelSelectorComponent extends Container {
|
|
|
265
322
|
const isCurrent = modelsAreEqual(this.currentModel, item.model);
|
|
266
323
|
const isDefault = this.isDefaultModel(item.model);
|
|
267
324
|
const defaultBadge = isDefault ? theme.fg("muted", " · default") : "";
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const checkmark = isCurrent ? theme.fg("success", " ✓") : "";
|
|
274
|
-
line = `${prefix + theme.fg("accent", modelText)} ${providerBadge}${defaultBadge}${checkmark}`;
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
const modelText = ` ${item.id}`;
|
|
278
|
-
const providerBadge = theme.fg("muted", `[${item.provider}]`);
|
|
279
|
-
const checkmark = isCurrent ? theme.fg("success", " ✓") : "";
|
|
280
|
-
line = `${modelText} ${providerBadge}${defaultBadge}${checkmark}`;
|
|
281
|
-
}
|
|
282
|
-
this.listContainer.addChild(new Text(line, 0, 0));
|
|
325
|
+
const modelText = isSelected ? `${theme.fg("accent", "→ ")}${theme.fg("accent", item.id)}` : ` ${item.id}`;
|
|
326
|
+
const providerBadge = theme.fg("muted", `[${item.provider}]`);
|
|
327
|
+
const checkmark = isCurrent ? theme.fg("success", " ✓") : "";
|
|
328
|
+
const details = `${providerBadge}${defaultBadge}${checkmark} ${theme.fg("muted", getModelDetails(item.model))}`;
|
|
329
|
+
this.listContainer.addChild(new ModelRow(modelText, details));
|
|
283
330
|
}
|
|
284
331
|
// Add scroll indicator if needed
|
|
285
332
|
if (startIndex > 0 || endIndex < this.filteredModels.length) {
|
|
@@ -1170,6 +1170,8 @@ const getAwsChunkedEncodingStream = (readableStream, options) => {
|
|
|
1170
1170
|
checksumLocationName !== undefined &&
|
|
1171
1171
|
streamHasher !== undefined;
|
|
1172
1172
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
|
|
1173
|
+
Promise.resolve(digest).catch(() => {
|
|
1174
|
+
});
|
|
1173
1175
|
const reader = readableStream.getReader();
|
|
1174
1176
|
return new ReadableStream({
|
|
1175
1177
|
async pull(controller) {
|
|
@@ -1352,6 +1352,8 @@ const getAwsChunkedEncodingStream$1 = (readableStream, options) => {
|
|
|
1352
1352
|
checksumLocationName !== undefined &&
|
|
1353
1353
|
streamHasher !== undefined;
|
|
1354
1354
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
|
|
1355
|
+
Promise.resolve(digest).catch(() => {
|
|
1356
|
+
});
|
|
1355
1357
|
const reader = readableStream.getReader();
|
|
1356
1358
|
return new ReadableStream({
|
|
1357
1359
|
async pull(controller) {
|
|
@@ -1384,8 +1386,12 @@ function getAwsChunkedEncodingStream(stream, options) {
|
|
|
1384
1386
|
checksumLocationName !== undefined &&
|
|
1385
1387
|
streamHasher !== undefined;
|
|
1386
1388
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined;
|
|
1389
|
+
Promise.resolve(digest).catch(() => {
|
|
1390
|
+
});
|
|
1387
1391
|
const awsChunkedEncodingStream = new Readable({
|
|
1388
|
-
read
|
|
1392
|
+
read() {
|
|
1393
|
+
readable.resume();
|
|
1394
|
+
},
|
|
1389
1395
|
});
|
|
1390
1396
|
readable.on("data", (data) => {
|
|
1391
1397
|
const length = bodyLengthChecker(data) || 0;
|
|
@@ -1394,16 +1400,27 @@ function getAwsChunkedEncodingStream(stream, options) {
|
|
|
1394
1400
|
}
|
|
1395
1401
|
awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`);
|
|
1396
1402
|
awsChunkedEncodingStream.push(data);
|
|
1397
|
-
awsChunkedEncodingStream.push("\r\n")
|
|
1403
|
+
if (!awsChunkedEncodingStream.push("\r\n")) {
|
|
1404
|
+
readable.pause();
|
|
1405
|
+
}
|
|
1398
1406
|
});
|
|
1407
|
+
readable.on("error", (err) => {
|
|
1408
|
+
awsChunkedEncodingStream.destroy(err);
|
|
1409
|
+
});
|
|
1410
|
+
readable.pause();
|
|
1399
1411
|
readable.on("end", async () => {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1412
|
+
try {
|
|
1413
|
+
awsChunkedEncodingStream.push(`0\r\n`);
|
|
1414
|
+
if (checksumRequired) {
|
|
1415
|
+
const checksum = base64Encoder(await digest);
|
|
1416
|
+
awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`);
|
|
1417
|
+
awsChunkedEncodingStream.push(`\r\n`);
|
|
1418
|
+
}
|
|
1419
|
+
awsChunkedEncodingStream.push(null);
|
|
1420
|
+
}
|
|
1421
|
+
catch (err) {
|
|
1422
|
+
awsChunkedEncodingStream.destroy(err);
|
|
1405
1423
|
}
|
|
1406
|
-
awsChunkedEncodingStream.push(null);
|
|
1407
1424
|
});
|
|
1408
1425
|
return awsChunkedEncodingStream;
|
|
1409
1426
|
}
|
|
@@ -1170,6 +1170,8 @@ const getAwsChunkedEncodingStream = (readableStream, options) => {
|
|
|
1170
1170
|
checksumLocationName !== undefined &&
|
|
1171
1171
|
streamHasher !== undefined;
|
|
1172
1172
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
|
|
1173
|
+
Promise.resolve(digest).catch(() => {
|
|
1174
|
+
});
|
|
1173
1175
|
const reader = readableStream.getReader();
|
|
1174
1176
|
return new ReadableStream({
|
|
1175
1177
|
async pull(controller) {
|
|
@@ -6,6 +6,8 @@ export const getAwsChunkedEncodingStream = (readableStream, options) => {
|
|
|
6
6
|
checksumLocationName !== undefined &&
|
|
7
7
|
streamHasher !== undefined;
|
|
8
8
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
|
|
9
|
+
Promise.resolve(digest).catch(() => {
|
|
10
|
+
});
|
|
9
11
|
const reader = readableStream.getReader();
|
|
10
12
|
return new ReadableStream({
|
|
11
13
|
async pull(controller) {
|
|
@@ -13,8 +13,12 @@ export function getAwsChunkedEncodingStream(stream, options) {
|
|
|
13
13
|
checksumLocationName !== undefined &&
|
|
14
14
|
streamHasher !== undefined;
|
|
15
15
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined;
|
|
16
|
+
Promise.resolve(digest).catch(() => {
|
|
17
|
+
});
|
|
16
18
|
const awsChunkedEncodingStream = new Readable({
|
|
17
|
-
read
|
|
19
|
+
read() {
|
|
20
|
+
readable.resume();
|
|
21
|
+
},
|
|
18
22
|
});
|
|
19
23
|
readable.on("data", (data) => {
|
|
20
24
|
const length = bodyLengthChecker(data) || 0;
|
|
@@ -23,16 +27,27 @@ export function getAwsChunkedEncodingStream(stream, options) {
|
|
|
23
27
|
}
|
|
24
28
|
awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`);
|
|
25
29
|
awsChunkedEncodingStream.push(data);
|
|
26
|
-
awsChunkedEncodingStream.push("\r\n")
|
|
30
|
+
if (!awsChunkedEncodingStream.push("\r\n")) {
|
|
31
|
+
readable.pause();
|
|
32
|
+
}
|
|
27
33
|
});
|
|
34
|
+
readable.on("error", (err) => {
|
|
35
|
+
awsChunkedEncodingStream.destroy(err);
|
|
36
|
+
});
|
|
37
|
+
readable.pause();
|
|
28
38
|
readable.on("end", async () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
try {
|
|
40
|
+
awsChunkedEncodingStream.push(`0\r\n`);
|
|
41
|
+
if (checksumRequired) {
|
|
42
|
+
const checksum = base64Encoder(await digest);
|
|
43
|
+
awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`);
|
|
44
|
+
awsChunkedEncodingStream.push(`\r\n`);
|
|
45
|
+
}
|
|
46
|
+
awsChunkedEncodingStream.push(null);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
awsChunkedEncodingStream.destroy(err);
|
|
34
50
|
}
|
|
35
|
-
awsChunkedEncodingStream.push(null);
|
|
36
51
|
});
|
|
37
52
|
return awsChunkedEncodingStream;
|
|
38
53
|
}
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
This package contains type definitions for node (https://nodejs.org/).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
11
|
* Last updated: Wed, 09 Sep 2026 18:05:03 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky),
|
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig).
|