@dimivelev/chimera 0.78.0 → 0.78.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +6 -10
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -9
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +0 -1677
- package/node_modules/@anthropic-ai/sdk/LICENSE +0 -8
- package/node_modules/@anthropic-ai/sdk/README.md +0 -674
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +0 -226
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +0 -223
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.js +0 -6
- package/node_modules/@anthropic-ai/sdk/api-promise.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/bin/cli +0 -53
- package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +0 -7
- package/node_modules/@anthropic-ai/sdk/client.d.mts +0 -225
- package/node_modules/@anthropic-ai/sdk/client.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/client.d.ts +0 -225
- package/node_modules/@anthropic-ai/sdk/client.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/client.js +0 -536
- package/node_modules/@anthropic-ai/sdk/client.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/client.mjs +0 -531
- package/node_modules/@anthropic-ai/sdk/client.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +0 -49
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +0 -49
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +0 -76
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +0 -72
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts +0 -47
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts +0 -47
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/error.js +0 -114
- package/node_modules/@anthropic-ai/sdk/core/error.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +0 -98
- package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +0 -63
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +0 -63
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +0 -123
- package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +0 -117
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts +0 -6
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts +0 -6
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.js +0 -11
- package/node_modules/@anthropic-ai/sdk/core/resource.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs +0 -7
- package/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +0 -31
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +0 -31
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +0 -282
- package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +0 -277
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.js +0 -6
- package/node_modules/@anthropic-ai/sdk/core/uploads.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/error.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/error.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/error.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/error.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/error.js +0 -6
- package/node_modules/@anthropic-ai/sdk/error.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/error.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/error.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/index.d.mts +0 -7
- package/node_modules/@anthropic-ai/sdk/index.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/index.d.ts +0 -7
- package/node_modules/@anthropic-ai/sdk/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/index.js +0 -35
- package/node_modules/@anthropic-ai/sdk/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/index.mjs +0 -8
- package/node_modules/@anthropic-ai/sdk/index.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts +0 -73
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts +0 -73
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +0 -4
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +0 -12
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts +0 -10
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts +0 -10
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +0 -39
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +0 -35
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts +0 -17
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts +0 -17
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +0 -113
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +0 -108
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +0 -162
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +0 -157
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +0 -41
- package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +0 -36
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +0 -22
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +0 -22
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +0 -79
- package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +0 -74
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +0 -17
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +0 -17
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +0 -55
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +0 -51
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +0 -34
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +0 -34
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +0 -14
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +0 -10
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.mts +0 -28
- package/node_modules/@anthropic-ai/sdk/internal/shim-types.d.ts +0 -28
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +0 -20
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +0 -20
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.js +0 -92
- package/node_modules/@anthropic-ai/sdk/internal/shims.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs +0 -85
- package/node_modules/@anthropic-ai/sdk/internal/shims.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts +0 -8
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts +0 -8
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js +0 -38
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs +0 -35
- package/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts +0 -45
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts +0 -45
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js +0 -96
- package/node_modules/@anthropic-ai/sdk/internal/to-file.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +0 -93
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/tslib.js +0 -81
- package/node_modules/@anthropic-ai/sdk/internal/tslib.mjs +0 -17
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +0 -67
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +0 -67
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.js +0 -4
- package/node_modules/@anthropic-ai/sdk/internal/types.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/types.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts +0 -42
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts +0 -42
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +0 -146
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +0 -136
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +0 -38
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +0 -33
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts +0 -4
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts +0 -4
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +0 -31
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +0 -26
- package/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts +0 -9
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts +0 -9
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js +0 -22
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +0 -18
- package/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +0 -37
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +0 -37
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +0 -86
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +0 -80
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js +0 -58
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +0 -53
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +0 -7
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +0 -19
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +0 -15
- package/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +0 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +0 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +0 -109
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +0 -92
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts +0 -7
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts +0 -7
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.js +0 -11
- package/node_modules/@anthropic-ai/sdk/internal/utils.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs +0 -8
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +0 -114
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +0 -114
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +0 -553
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +0 -549
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +0 -114
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +0 -114
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +0 -553
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +0 -549
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/package.json +0 -185
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/pagination.js +0 -6
- package/node_modules/@anthropic-ai/sdk/pagination.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/pagination.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resource.js +0 -6
- package/node_modules/@anthropic-ai/sdk/resource.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resource.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/resource.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +0 -61
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +0 -61
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +0 -25
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +0 -20
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +0 -151
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +0 -151
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +0 -122
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +0 -118
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +0 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +0 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +0 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +0 -343
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +0 -343
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +0 -204
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +0 -200
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +0 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +0 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +0 -1561
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +0 -1561
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +0 -86
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +0 -81
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +0 -74
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +0 -74
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js +0 -60
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +0 -56
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.js +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +0 -183
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +0 -183
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.js +0 -23
- package/node_modules/@anthropic-ai/sdk/resources/completions.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs +0 -19
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js +0 -15
- package/node_modules/@anthropic-ai/sdk/resources/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +0 -7
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +0 -304
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +0 -304
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +0 -153
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +0 -149
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js +0 -9
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +0 -4
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +0 -1264
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +0 -1264
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +0 -72
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +0 -67
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.js +0 -6
- package/node_modules/@anthropic-ai/sdk/resources/messages.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts +0 -59
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts +0 -59
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.js +0 -45
- package/node_modules/@anthropic-ai/sdk/resources/models.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs +0 -41
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts +0 -42
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts +0 -42
- package/node_modules/@anthropic-ai/sdk/resources/shared.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.js +0 -4
- package/node_modules/@anthropic-ai/sdk/resources/shared.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/shared.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js +0 -4
- package/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources.js +0 -5
- package/node_modules/@anthropic-ai/sdk/resources.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/resources.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/resources.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/README.md +0 -3
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +0 -264
- package/node_modules/@anthropic-ai/sdk/src/api-promise.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/client.ts +0 -1070
- package/node_modules/@anthropic-ai/sdk/src/core/README.md +0 -3
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +0 -101
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +0 -133
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +0 -201
- package/node_modules/@anthropic-ai/sdk/src/core/resource.ts +0 -11
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +0 -331
- package/node_modules/@anthropic-ai/sdk/src/core/uploads.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/error.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/index.ts +0 -23
- package/node_modules/@anthropic-ai/sdk/src/internal/README.md +0 -3
- package/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +0 -93
- package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +0 -12
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts +0 -48
- package/node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts +0 -135
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +0 -196
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +0 -33
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +0 -99
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +0 -84
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +0 -39
- package/node_modules/@anthropic-ai/sdk/src/internal/shim-types.d.ts +0 -28
- package/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +0 -107
- package/node_modules/@anthropic-ai/sdk/src/internal/stream-utils.ts +0 -32
- package/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +0 -159
- package/node_modules/@anthropic-ai/sdk/src/internal/types.ts +0 -92
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +0 -193
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +0 -40
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +0 -32
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +0 -18
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +0 -127
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts +0 -65
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +0 -17
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +0 -102
- package/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +0 -8
- package/node_modules/@anthropic-ai/sdk/src/lib/.keep +0 -4
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +0 -683
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +0 -684
- package/node_modules/@anthropic-ai/sdk/src/pagination.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resource.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +0 -380
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +0 -258
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +0 -148
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +0 -502
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +0 -135
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +0 -2249
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +0 -118
- package/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +0 -231
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +0 -121
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +0 -396
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +0 -110
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +0 -1783
- package/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/models.ts +0 -103
- package/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +0 -72
- package/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/src/resources.ts +0 -1
- package/node_modules/@anthropic-ai/sdk/src/streaming.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/tsconfig.json +0 -11
- package/node_modules/@anthropic-ai/sdk/src/uploads.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/src/version.ts +0 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/streaming.js +0 -6
- package/node_modules/@anthropic-ai/sdk/streaming.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/streaming.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/uploads.js +0 -6
- package/node_modules/@anthropic-ai/sdk/uploads.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/uploads.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts +0 -2
- package/node_modules/@anthropic-ai/sdk/version.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts +0 -2
- package/node_modules/@anthropic-ai/sdk/version.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/version.js +0 -5
- package/node_modules/@anthropic-ai/sdk/version.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +0 -2
- package/node_modules/@anthropic-ai/sdk/version.mjs.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts +0 -24
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js +0 -502
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent-loop.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts +0 -118
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js +0 -402
- package/node_modules/@dimivelev/chimera-agent-core/dist/agent.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts +0 -95
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js +0 -963
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/agent-harness.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts +0 -53
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js +0 -175
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/branch-summarization.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts +0 -95
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js +0 -528
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/compaction.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts +0 -25
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js +0 -131
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/compaction/utils.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts +0 -51
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js +0 -486
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/env/nodejs.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts +0 -51
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js +0 -102
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/messages.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts +0 -48
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js +0 -230
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/prompt-templates.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js +0 -101
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -33
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js +0 -231
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js +0 -42
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-repo.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts +0 -25
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js +0 -114
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/memory-storage.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js +0 -39
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/repo-utils.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts +0 -33
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js +0 -210
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/session.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts +0 -2
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js +0 -50
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/session/uuid.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts +0 -44
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js +0 -311
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/skills.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js +0 -30
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/system-prompt.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts +0 -615
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js +0 -94
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/types.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts +0 -14
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js +0 -126
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/shell-output.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts +0 -70
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js +0 -290
- package/node_modules/@dimivelev/chimera-agent-core/dist/harness/utils/truncate.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts +0 -20
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js +0 -25
- package/node_modules/@dimivelev/chimera-agent-core/dist/index.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js +0 -3
- package/node_modules/@dimivelev/chimera-agent-core/dist/node.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts +0 -69
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js +0 -278
- package/node_modules/@dimivelev/chimera-agent-core/dist/proxy.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts +0 -393
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js +0 -2
- package/node_modules/@dimivelev/chimera-agent-core/dist/types.js.map +0 -1
- package/node_modules/@dimivelev/chimera-agent-core/package.json +0 -60
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts +0 -20
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js +0 -44
- package/node_modules/@dimivelev/chimera-ai/dist/api-registry.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts +0 -5
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js +0 -6
- package/node_modules/@dimivelev/chimera-ai/dist/bedrock-provider.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-ai/dist/cli.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js +0 -130
- package/node_modules/@dimivelev/chimera-ai/dist/cli.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts +0 -18
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js +0 -178
- package/node_modules/@dimivelev/chimera-ai/dist/env-api-keys.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts +0 -10
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts +0 -4
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js +0 -6
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.generated.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js +0 -23
- package/node_modules/@dimivelev/chimera-ai/dist/image-models.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts +0 -14
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js +0 -22
- package/node_modules/@dimivelev/chimera-ai/dist/images-api-registry.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts +0 -4
- package/node_modules/@dimivelev/chimera-ai/dist/images.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/images.js +0 -14
- package/node_modules/@dimivelev/chimera-ai/dist/images.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts +0 -32
- package/node_modules/@dimivelev/chimera-ai/dist/index.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/index.js +0 -20
- package/node_modules/@dimivelev/chimera-ai/dist/index.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts +0 -18
- package/node_modules/@dimivelev/chimera-ai/dist/models.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts +0 -14714
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js +0 -13379
- package/node_modules/@dimivelev/chimera-ai/dist/models.generated.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/models.js +0 -71
- package/node_modules/@dimivelev/chimera-ai/dist/models.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts +0 -2
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js +0 -2
- package/node_modules/@dimivelev/chimera-ai/dist/oauth.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts +0 -38
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js +0 -826
- package/node_modules/@dimivelev/chimera-ai/dist/providers/amazon-bedrock.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts +0 -71
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js +0 -959
- package/node_modules/@dimivelev/chimera-ai/dist/providers/anthropic.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts +0 -15
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js +0 -221
- package/node_modules/@dimivelev/chimera-ai/dist/providers/azure-openai-responses.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts +0 -13
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js +0 -26
- package/node_modules/@dimivelev/chimera-ai/dist/providers/cloudflare.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts +0 -56
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js +0 -368
- package/node_modules/@dimivelev/chimera-ai/dist/providers/faux.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts +0 -8
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js +0 -29
- package/node_modules/@dimivelev/chimera-ai/dist/providers/github-copilot-headers.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts +0 -70
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js +0 -329
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-shared.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts +0 -15
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js +0 -442
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google-vertex.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts +0 -13
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js +0 -402
- package/node_modules/@dimivelev/chimera-ai/dist/providers/google.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js +0 -128
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/openrouter.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts +0 -4
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js +0 -34
- package/node_modules/@dimivelev/chimera-ai/dist/providers/images/register-builtins.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts +0 -25
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js +0 -534
- package/node_modules/@dimivelev/chimera-ai/dist/providers/mistral.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts +0 -30
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js +0 -1171
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-codex-responses.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts +0 -19
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js +0 -956
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-completions.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js +0 -10
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-prompt-cache.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts +0 -18
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js +0 -495
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses-shared.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts +0 -13
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js +0 -233
- package/node_modules/@dimivelev/chimera-ai/dist/providers/openai-responses.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts +0 -35
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js +0 -254
- package/node_modules/@dimivelev/chimera-ai/dist/providers/register-builtins.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts +0 -8
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js +0 -42
- package/node_modules/@dimivelev/chimera-ai/dist/providers/simple-options.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts +0 -8
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js +0 -184
- package/node_modules/@dimivelev/chimera-ai/dist/providers/transform-messages.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts +0 -4
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js +0 -22
- package/node_modules/@dimivelev/chimera-ai/dist/session-resources.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts +0 -8
- package/node_modules/@dimivelev/chimera-ai/dist/stream.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js +0 -39
- package/node_modules/@dimivelev/chimera-ai/dist/stream.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts +0 -514
- package/node_modules/@dimivelev/chimera-ai/dist/types.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/types.js +0 -2
- package/node_modules/@dimivelev/chimera-ai/dist/types.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts +0 -6
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js +0 -34
- package/node_modules/@dimivelev/chimera-ai/dist/utils/abort-signals.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts +0 -19
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js +0 -25
- package/node_modules/@dimivelev/chimera-ai/dist/utils/diagnostics.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts +0 -21
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js +0 -81
- package/node_modules/@dimivelev/chimera-ai/dist/utils/event-stream.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js +0 -14
- package/node_modules/@dimivelev/chimera-ai/dist/utils/hash.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts +0 -2
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js +0 -8
- package/node_modules/@dimivelev/chimera-ai/dist/utils/headers.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts +0 -16
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js +0 -113
- package/node_modules/@dimivelev/chimera-ai/dist/utils/json-parse.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts +0 -10
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js +0 -97
- package/node_modules/@dimivelev/chimera-ai/dist/utils/node-http-proxy.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts +0 -25
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js +0 -335
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts +0 -21
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js +0 -56
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/device-code.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts +0 -30
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js +0 -268
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/github-copilot.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts +0 -58
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js +0 -122
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/index.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js +0 -105
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/oauth-page.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts +0 -43
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js +0 -485
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/openai-codex.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts +0 -13
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js +0 -31
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/pkce.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts +0 -64
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js +0 -2
- package/node_modules/@dimivelev/chimera-ai/dist/utils/oauth/types.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts +0 -57
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js +0 -154
- package/node_modules/@dimivelev/chimera-ai/dist/utils/overflow.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts +0 -22
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js +0 -26
- package/node_modules/@dimivelev/chimera-ai/dist/utils/sanitize-unicode.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts +0 -17
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js +0 -21
- package/node_modules/@dimivelev/chimera-ai/dist/utils/typebox-helpers.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts +0 -18
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js +0 -281
- package/node_modules/@dimivelev/chimera-ai/dist/utils/validation.js.map +0 -1
- package/node_modules/@dimivelev/chimera-ai/package.json +0 -106
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts +0 -54
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js +0 -632
- package/node_modules/@dimivelev/chimera-tui/dist/autocomplete.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts +0 -22
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js +0 -104
- package/node_modules/@dimivelev/chimera-tui/dist/components/box.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts +0 -22
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js +0 -35
- package/node_modules/@dimivelev/chimera-tui/dist/components/cancellable-loader.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts +0 -249
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js +0 -1857
- package/node_modules/@dimivelev/chimera-tui/dist/components/editor.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts +0 -28
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js +0 -89
- package/node_modules/@dimivelev/chimera-tui/dist/components/image.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts +0 -37
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js +0 -378
- package/node_modules/@dimivelev/chimera-tui/dist/components/input.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts +0 -31
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js +0 -69
- package/node_modules/@dimivelev/chimera-tui/dist/components/loader.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts +0 -96
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js +0 -644
- package/node_modules/@dimivelev/chimera-tui/dist/components/markdown.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts +0 -50
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js +0 -159
- package/node_modules/@dimivelev/chimera-tui/dist/components/select-list.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts +0 -50
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js +0 -185
- package/node_modules/@dimivelev/chimera-tui/dist/components/settings-list.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts +0 -12
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js +0 -23
- package/node_modules/@dimivelev/chimera-tui/dist/components/spacer.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts +0 -19
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js +0 -89
- package/node_modules/@dimivelev/chimera-tui/dist/components/text.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts +0 -13
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js +0 -51
- package/node_modules/@dimivelev/chimera-tui/dist/components/truncated-text.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts +0 -39
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js +0 -2
- package/node_modules/@dimivelev/chimera-tui/dist/editor-component.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts +0 -16
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js +0 -110
- package/node_modules/@dimivelev/chimera-tui/dist/fuzzy.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts +0 -23
- package/node_modules/@dimivelev/chimera-tui/dist/index.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/index.js +0 -32
- package/node_modules/@dimivelev/chimera-tui/dist/index.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts +0 -193
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js +0 -174
- package/node_modules/@dimivelev/chimera-tui/dist/keybindings.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts +0 -184
- package/node_modules/@dimivelev/chimera-tui/dist/keys.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js +0 -1173
- package/node_modules/@dimivelev/chimera-tui/dist/keys.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts +0 -28
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js +0 -44
- package/node_modules/@dimivelev/chimera-tui/dist/kill-ring.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts +0 -3
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js +0 -53
- package/node_modules/@dimivelev/chimera-tui/dist/native-modifiers.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts +0 -50
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js +0 -361
- package/node_modules/@dimivelev/chimera-tui/dist/stdin-buffer.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts +0 -90
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js +0 -366
- package/node_modules/@dimivelev/chimera-tui/dist/terminal-image.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts +0 -113
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js +0 -472
- package/node_modules/@dimivelev/chimera-tui/dist/terminal.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts +0 -242
- package/node_modules/@dimivelev/chimera-tui/dist/tui.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js +0 -1221
- package/node_modules/@dimivelev/chimera-tui/dist/tui.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts +0 -17
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js +0 -25
- package/node_modules/@dimivelev/chimera-tui/dist/undo-stack.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts +0 -84
- package/node_modules/@dimivelev/chimera-tui/dist/utils.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js +0 -1029
- package/node_modules/@dimivelev/chimera-tui/dist/utils.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts +0 -25
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.d.ts.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js +0 -96
- package/node_modules/@dimivelev/chimera-tui/dist/word-navigation.js.map +0 -1
- package/node_modules/@dimivelev/chimera-tui/package.json +0 -47
|
@@ -1,1221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal TUI implementation with differential rendering
|
|
3
|
-
*/
|
|
4
|
-
import * as fs from "node:fs";
|
|
5
|
-
import * as os from "node:os";
|
|
6
|
-
import * as path from "node:path";
|
|
7
|
-
import { performance } from "node:perf_hooks";
|
|
8
|
-
import { isKeyRelease, matchesKey } from "./keys.js";
|
|
9
|
-
import { deleteKittyImage, getCapabilities, isImageLine, setCellDimensions } from "./terminal-image.js";
|
|
10
|
-
import { extractSegments, normalizeTerminalOutput, sliceByColumn, sliceWithWidth, visibleWidth } from "./utils.js";
|
|
11
|
-
const KITTY_SEQUENCE_PREFIX = "\x1b_G";
|
|
12
|
-
function extractKittyImageIds(line) {
|
|
13
|
-
const sequenceStart = line.indexOf(KITTY_SEQUENCE_PREFIX);
|
|
14
|
-
if (sequenceStart === -1)
|
|
15
|
-
return [];
|
|
16
|
-
const paramsStart = sequenceStart + KITTY_SEQUENCE_PREFIX.length;
|
|
17
|
-
const paramsEnd = line.indexOf(";", paramsStart);
|
|
18
|
-
if (paramsEnd === -1)
|
|
19
|
-
return [];
|
|
20
|
-
const params = line.slice(paramsStart, paramsEnd);
|
|
21
|
-
for (const param of params.split(",")) {
|
|
22
|
-
const [key, value] = param.split("=", 2);
|
|
23
|
-
if (key !== "i" || value === undefined)
|
|
24
|
-
continue;
|
|
25
|
-
const id = Number(value);
|
|
26
|
-
if (Number.isInteger(id) && id > 0 && id <= 0xffffffff) {
|
|
27
|
-
return [id];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
/** Type guard to check if a component implements Focusable */
|
|
33
|
-
export function isFocusable(component) {
|
|
34
|
-
return component !== null && "focused" in component;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Cursor position marker - APC (Application Program Command) sequence.
|
|
38
|
-
* This is a zero-width escape sequence that terminals ignore.
|
|
39
|
-
* Components emit this at the cursor position when focused.
|
|
40
|
-
* TUI finds and strips this marker, then positions the hardware cursor there.
|
|
41
|
-
*/
|
|
42
|
-
export const CURSOR_MARKER = "\x1b_pi:c\x07";
|
|
43
|
-
export { visibleWidth };
|
|
44
|
-
/** Parse a SizeValue into absolute value given a reference size */
|
|
45
|
-
function parseSizeValue(value, referenceSize) {
|
|
46
|
-
if (value === undefined)
|
|
47
|
-
return undefined;
|
|
48
|
-
if (typeof value === "number")
|
|
49
|
-
return value;
|
|
50
|
-
// Parse percentage string like "50%"
|
|
51
|
-
const match = value.match(/^(\d+(?:\.\d+)?)%$/);
|
|
52
|
-
if (match) {
|
|
53
|
-
return Math.floor((referenceSize * parseFloat(match[1])) / 100);
|
|
54
|
-
}
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
function isTermuxSession() {
|
|
58
|
-
return Boolean(process.env.TERMUX_VERSION);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Container - a component that contains other components
|
|
62
|
-
*/
|
|
63
|
-
export class Container {
|
|
64
|
-
children = [];
|
|
65
|
-
addChild(component) {
|
|
66
|
-
this.children.push(component);
|
|
67
|
-
}
|
|
68
|
-
removeChild(component) {
|
|
69
|
-
const index = this.children.indexOf(component);
|
|
70
|
-
if (index !== -1) {
|
|
71
|
-
this.children.splice(index, 1);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
clear() {
|
|
75
|
-
this.children = [];
|
|
76
|
-
}
|
|
77
|
-
invalidate() {
|
|
78
|
-
for (const child of this.children) {
|
|
79
|
-
child.invalidate?.();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
render(width) {
|
|
83
|
-
const lines = [];
|
|
84
|
-
for (const child of this.children) {
|
|
85
|
-
const childLines = child.render(width);
|
|
86
|
-
for (const line of childLines) {
|
|
87
|
-
lines.push(line);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return lines;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* TUI - Main class for managing terminal UI with differential rendering
|
|
95
|
-
*/
|
|
96
|
-
export class TUI extends Container {
|
|
97
|
-
terminal;
|
|
98
|
-
previousLines = [];
|
|
99
|
-
previousKittyImageIds = new Set();
|
|
100
|
-
previousWidth = 0;
|
|
101
|
-
previousHeight = 0;
|
|
102
|
-
focusedComponent = null;
|
|
103
|
-
inputListeners = new Set();
|
|
104
|
-
/** Global callback for debug key (Shift+Ctrl+D). Called before input is forwarded to focused component. */
|
|
105
|
-
onDebug;
|
|
106
|
-
renderRequested = false;
|
|
107
|
-
renderTimer;
|
|
108
|
-
lastRenderAt = 0;
|
|
109
|
-
static MIN_RENDER_INTERVAL_MS = 16;
|
|
110
|
-
cursorRow = 0; // Logical cursor row (end of rendered content)
|
|
111
|
-
hardwareCursorRow = 0; // Actual terminal cursor row (may differ due to IME positioning)
|
|
112
|
-
showHardwareCursor = process.env.PI_HARDWARE_CURSOR === "1";
|
|
113
|
-
clearOnShrink = process.env.PI_CLEAR_ON_SHRINK === "1"; // Clear empty rows when content shrinks (default: off)
|
|
114
|
-
maxLinesRendered = 0; // Track terminal's working area (max lines ever rendered)
|
|
115
|
-
previousViewportTop = 0; // Track previous viewport top for resize-aware cursor moves
|
|
116
|
-
fullRedrawCount = 0;
|
|
117
|
-
stopped = false;
|
|
118
|
-
// Overlay stack for modal components rendered on top of base content
|
|
119
|
-
focusOrderCounter = 0;
|
|
120
|
-
overlayStack = [];
|
|
121
|
-
overlayFocusRestore = { status: "inactive" };
|
|
122
|
-
constructor(terminal, showHardwareCursor) {
|
|
123
|
-
super();
|
|
124
|
-
this.terminal = terminal;
|
|
125
|
-
if (showHardwareCursor !== undefined) {
|
|
126
|
-
this.showHardwareCursor = showHardwareCursor;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
get fullRedraws() {
|
|
130
|
-
return this.fullRedrawCount;
|
|
131
|
-
}
|
|
132
|
-
getShowHardwareCursor() {
|
|
133
|
-
return this.showHardwareCursor;
|
|
134
|
-
}
|
|
135
|
-
setShowHardwareCursor(enabled) {
|
|
136
|
-
if (this.showHardwareCursor === enabled)
|
|
137
|
-
return;
|
|
138
|
-
this.showHardwareCursor = enabled;
|
|
139
|
-
if (!enabled) {
|
|
140
|
-
this.terminal.hideCursor();
|
|
141
|
-
}
|
|
142
|
-
this.requestRender();
|
|
143
|
-
}
|
|
144
|
-
getClearOnShrink() {
|
|
145
|
-
return this.clearOnShrink;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Set whether to trigger full re-render when content shrinks.
|
|
149
|
-
* When true (default), empty rows are cleared when content shrinks.
|
|
150
|
-
* When false, empty rows remain (reduces redraws on slower terminals).
|
|
151
|
-
*/
|
|
152
|
-
setClearOnShrink(enabled) {
|
|
153
|
-
this.clearOnShrink = enabled;
|
|
154
|
-
}
|
|
155
|
-
setFocus(component) {
|
|
156
|
-
this.setFocusInternal({ component, overlayFocusRestore: "clear" });
|
|
157
|
-
}
|
|
158
|
-
setFocusInternal({ component, overlayFocusRestore, }) {
|
|
159
|
-
const previousFocus = this.focusedComponent;
|
|
160
|
-
let nextFocus = component;
|
|
161
|
-
const previousFocusedOverlay = previousFocus
|
|
162
|
-
? this.overlayStack.find((entry) => entry.component === previousFocus && this.isOverlayVisible(entry))
|
|
163
|
-
: undefined;
|
|
164
|
-
const nextFocusIsOverlay = nextFocus ? this.overlayStack.some((entry) => entry.component === nextFocus) : false;
|
|
165
|
-
const restoreState = this.getVisibleOverlayFocusRestore();
|
|
166
|
-
if (nextFocus && !nextFocusIsOverlay) {
|
|
167
|
-
if (restoreState.status === "blocked" && restoreState.blockedBy === previousFocus) {
|
|
168
|
-
if (restoreState.resume.status === "focus-target" || !this.isComponentMounted(restoreState.blockedBy)) {
|
|
169
|
-
nextFocus = this.resolveBlockedOverlayFocusResume(restoreState);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
this.overlayFocusRestore = {
|
|
173
|
-
status: "blocked",
|
|
174
|
-
overlay: restoreState.overlay,
|
|
175
|
-
blockedBy: nextFocus,
|
|
176
|
-
resume: restoreState.resume,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else if (previousFocusedOverlay &&
|
|
181
|
-
restoreState.status !== "inactive" &&
|
|
182
|
-
restoreState.overlay === previousFocusedOverlay &&
|
|
183
|
-
!this.isOverlayFocusAncestor(previousFocusedOverlay, nextFocus)) {
|
|
184
|
-
this.overlayFocusRestore = {
|
|
185
|
-
status: "blocked",
|
|
186
|
-
overlay: previousFocusedOverlay,
|
|
187
|
-
blockedBy: nextFocus,
|
|
188
|
-
resume: { status: "restore-overlay" },
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
else if (nextFocus === null) {
|
|
193
|
-
if (restoreState.status === "blocked" && restoreState.blockedBy === previousFocus) {
|
|
194
|
-
nextFocus = this.resolveBlockedOverlayFocusResume(restoreState);
|
|
195
|
-
}
|
|
196
|
-
else if (overlayFocusRestore === "clear") {
|
|
197
|
-
this.clearOverlayFocusRestore();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (isFocusable(this.focusedComponent)) {
|
|
201
|
-
this.focusedComponent.focused = false;
|
|
202
|
-
}
|
|
203
|
-
this.focusedComponent = nextFocus;
|
|
204
|
-
if (isFocusable(nextFocus)) {
|
|
205
|
-
nextFocus.focused = true;
|
|
206
|
-
}
|
|
207
|
-
const focusedOverlay = nextFocus
|
|
208
|
-
? this.overlayStack.find((entry) => entry.component === nextFocus && this.isOverlayVisible(entry))
|
|
209
|
-
: undefined;
|
|
210
|
-
if (focusedOverlay) {
|
|
211
|
-
this.overlayFocusRestore = { status: "eligible", overlay: focusedOverlay };
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
clearOverlayFocusRestore() {
|
|
215
|
-
this.overlayFocusRestore = { status: "inactive" };
|
|
216
|
-
}
|
|
217
|
-
clearOverlayFocusRestoreFor(overlay) {
|
|
218
|
-
if (this.overlayFocusRestore.status !== "inactive" && this.overlayFocusRestore.overlay === overlay) {
|
|
219
|
-
this.clearOverlayFocusRestore();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
resolveBlockedOverlayFocusResume(restoreState) {
|
|
223
|
-
if (restoreState.resume.status === "restore-overlay")
|
|
224
|
-
return restoreState.overlay.component;
|
|
225
|
-
this.clearOverlayFocusRestore();
|
|
226
|
-
return restoreState.resume.target;
|
|
227
|
-
}
|
|
228
|
-
getVisibleOverlayFocusRestore() {
|
|
229
|
-
const restoreState = this.overlayFocusRestore;
|
|
230
|
-
if (restoreState.status === "inactive")
|
|
231
|
-
return restoreState;
|
|
232
|
-
if (!this.overlayStack.includes(restoreState.overlay) || !this.isOverlayVisible(restoreState.overlay)) {
|
|
233
|
-
return { status: "inactive" };
|
|
234
|
-
}
|
|
235
|
-
return restoreState;
|
|
236
|
-
}
|
|
237
|
-
isOverlayFocusAncestor(entry, component) {
|
|
238
|
-
const visited = new Set();
|
|
239
|
-
let current = entry.preFocus;
|
|
240
|
-
while (current && !visited.has(current)) {
|
|
241
|
-
visited.add(current);
|
|
242
|
-
if (current === component)
|
|
243
|
-
return true;
|
|
244
|
-
current = this.overlayStack.find((overlay) => overlay.component === current)?.preFocus ?? null;
|
|
245
|
-
}
|
|
246
|
-
return false;
|
|
247
|
-
}
|
|
248
|
-
retargetOverlayPreFocus(removed) {
|
|
249
|
-
for (const overlay of this.overlayStack) {
|
|
250
|
-
if (overlay !== removed && overlay.preFocus === removed.component) {
|
|
251
|
-
overlay.preFocus = removed.preFocus;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
isComponentMounted(component) {
|
|
256
|
-
return this.children.some((child) => this.containsComponent(child, component));
|
|
257
|
-
}
|
|
258
|
-
containsComponent(root, target) {
|
|
259
|
-
if (root === target)
|
|
260
|
-
return true;
|
|
261
|
-
if (!(root instanceof Container))
|
|
262
|
-
return false;
|
|
263
|
-
return root.children.some((child) => this.containsComponent(child, target));
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Show an overlay component with configurable positioning and sizing.
|
|
267
|
-
* Returns a handle to control the overlay's visibility.
|
|
268
|
-
*/
|
|
269
|
-
showOverlay(component, options) {
|
|
270
|
-
const entry = {
|
|
271
|
-
component,
|
|
272
|
-
...(options === undefined ? {} : { options }),
|
|
273
|
-
preFocus: this.focusedComponent,
|
|
274
|
-
hidden: false,
|
|
275
|
-
focusOrder: ++this.focusOrderCounter,
|
|
276
|
-
};
|
|
277
|
-
this.overlayStack.push(entry);
|
|
278
|
-
// Only focus if overlay is actually visible
|
|
279
|
-
if (!options?.nonCapturing && this.isOverlayVisible(entry)) {
|
|
280
|
-
this.setFocus(component);
|
|
281
|
-
}
|
|
282
|
-
this.terminal.hideCursor();
|
|
283
|
-
this.requestRender();
|
|
284
|
-
// Return handle for controlling this overlay
|
|
285
|
-
return {
|
|
286
|
-
hide: () => {
|
|
287
|
-
const index = this.overlayStack.indexOf(entry);
|
|
288
|
-
if (index !== -1) {
|
|
289
|
-
this.clearOverlayFocusRestoreFor(entry);
|
|
290
|
-
this.retargetOverlayPreFocus(entry);
|
|
291
|
-
this.overlayStack.splice(index, 1);
|
|
292
|
-
// Restore focus if this overlay had focus
|
|
293
|
-
if (this.focusedComponent === component) {
|
|
294
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
295
|
-
this.setFocus(topVisible?.component ?? entry.preFocus);
|
|
296
|
-
}
|
|
297
|
-
if (this.overlayStack.length === 0)
|
|
298
|
-
this.terminal.hideCursor();
|
|
299
|
-
this.requestRender();
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
setHidden: (hidden) => {
|
|
303
|
-
if (entry.hidden === hidden)
|
|
304
|
-
return;
|
|
305
|
-
entry.hidden = hidden;
|
|
306
|
-
// Update focus when hiding/showing
|
|
307
|
-
if (hidden) {
|
|
308
|
-
this.clearOverlayFocusRestoreFor(entry);
|
|
309
|
-
// If this overlay had focus, move focus to next visible or preFocus
|
|
310
|
-
if (this.focusedComponent === component) {
|
|
311
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
312
|
-
this.setFocus(topVisible?.component ?? entry.preFocus);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
// Restore focus to this overlay when showing (if it's actually visible)
|
|
317
|
-
if (!options?.nonCapturing && this.isOverlayVisible(entry)) {
|
|
318
|
-
entry.focusOrder = ++this.focusOrderCounter;
|
|
319
|
-
this.setFocus(component);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
this.requestRender();
|
|
323
|
-
},
|
|
324
|
-
isHidden: () => entry.hidden,
|
|
325
|
-
focus: () => {
|
|
326
|
-
if (!this.overlayStack.includes(entry) || !this.isOverlayVisible(entry))
|
|
327
|
-
return;
|
|
328
|
-
entry.focusOrder = ++this.focusOrderCounter;
|
|
329
|
-
this.setFocus(component);
|
|
330
|
-
this.requestRender();
|
|
331
|
-
},
|
|
332
|
-
unfocus: (unfocusOptions) => {
|
|
333
|
-
const isFocused = this.focusedComponent === component;
|
|
334
|
-
const restoreState = this.overlayFocusRestore;
|
|
335
|
-
const hasPendingRestore = restoreState.status !== "inactive" && restoreState.overlay === entry;
|
|
336
|
-
if (!isFocused && !hasPendingRestore)
|
|
337
|
-
return;
|
|
338
|
-
if (restoreState.status === "blocked" &&
|
|
339
|
-
restoreState.overlay === entry &&
|
|
340
|
-
this.focusedComponent === restoreState.blockedBy) {
|
|
341
|
-
if (unfocusOptions) {
|
|
342
|
-
this.overlayFocusRestore = {
|
|
343
|
-
status: "blocked",
|
|
344
|
-
overlay: entry,
|
|
345
|
-
blockedBy: restoreState.blockedBy,
|
|
346
|
-
resume: { status: "focus-target", target: unfocusOptions.target },
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
this.clearOverlayFocusRestore();
|
|
351
|
-
}
|
|
352
|
-
this.requestRender();
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
this.clearOverlayFocusRestoreFor(entry);
|
|
356
|
-
if (isFocused || unfocusOptions) {
|
|
357
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
358
|
-
const fallbackTarget = topVisible && topVisible !== entry ? topVisible.component : entry.preFocus;
|
|
359
|
-
this.setFocus(unfocusOptions ? unfocusOptions.target : fallbackTarget);
|
|
360
|
-
}
|
|
361
|
-
this.requestRender();
|
|
362
|
-
},
|
|
363
|
-
isFocused: () => this.focusedComponent === component,
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
/** Hide the topmost overlay and restore previous focus. */
|
|
367
|
-
hideOverlay() {
|
|
368
|
-
const overlay = this.overlayStack[this.overlayStack.length - 1];
|
|
369
|
-
if (!overlay)
|
|
370
|
-
return;
|
|
371
|
-
this.clearOverlayFocusRestoreFor(overlay);
|
|
372
|
-
this.retargetOverlayPreFocus(overlay);
|
|
373
|
-
this.overlayStack.pop();
|
|
374
|
-
if (this.focusedComponent === overlay.component) {
|
|
375
|
-
// Find topmost visible overlay, or fall back to preFocus
|
|
376
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
377
|
-
this.setFocus(topVisible?.component ?? overlay.preFocus);
|
|
378
|
-
}
|
|
379
|
-
if (this.overlayStack.length === 0)
|
|
380
|
-
this.terminal.hideCursor();
|
|
381
|
-
this.requestRender();
|
|
382
|
-
}
|
|
383
|
-
/** Check if there are any visible overlays */
|
|
384
|
-
hasOverlay() {
|
|
385
|
-
return this.overlayStack.some((o) => this.isOverlayVisible(o));
|
|
386
|
-
}
|
|
387
|
-
/** Check if an overlay entry is currently visible */
|
|
388
|
-
isOverlayVisible(entry) {
|
|
389
|
-
if (entry.hidden)
|
|
390
|
-
return false;
|
|
391
|
-
if (entry.options?.visible) {
|
|
392
|
-
return entry.options.visible(this.terminal.columns, this.terminal.rows);
|
|
393
|
-
}
|
|
394
|
-
return true;
|
|
395
|
-
}
|
|
396
|
-
/** Find the visual-frontmost visible capturing overlay, if any */
|
|
397
|
-
getTopmostVisibleOverlay() {
|
|
398
|
-
let topmost;
|
|
399
|
-
for (const overlay of this.overlayStack) {
|
|
400
|
-
if (overlay.options?.nonCapturing || !this.isOverlayVisible(overlay))
|
|
401
|
-
continue;
|
|
402
|
-
if (!topmost || overlay.focusOrder > topmost.focusOrder) {
|
|
403
|
-
topmost = overlay;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
return topmost;
|
|
407
|
-
}
|
|
408
|
-
invalidate() {
|
|
409
|
-
super.invalidate();
|
|
410
|
-
for (const overlay of this.overlayStack)
|
|
411
|
-
overlay.component.invalidate?.();
|
|
412
|
-
}
|
|
413
|
-
start() {
|
|
414
|
-
this.stopped = false;
|
|
415
|
-
this.terminal.start((data) => this.handleInput(data), () => this.requestRender());
|
|
416
|
-
this.terminal.hideCursor();
|
|
417
|
-
this.queryCellSize();
|
|
418
|
-
this.requestRender();
|
|
419
|
-
}
|
|
420
|
-
addInputListener(listener) {
|
|
421
|
-
this.inputListeners.add(listener);
|
|
422
|
-
return () => {
|
|
423
|
-
this.inputListeners.delete(listener);
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
removeInputListener(listener) {
|
|
427
|
-
this.inputListeners.delete(listener);
|
|
428
|
-
}
|
|
429
|
-
queryCellSize() {
|
|
430
|
-
// Only query if terminal supports images (cell size is only used for image rendering)
|
|
431
|
-
if (!getCapabilities().images) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
// Query terminal for cell size in pixels: CSI 16 t
|
|
435
|
-
// Response format: CSI 6 ; height ; width t
|
|
436
|
-
this.terminal.write("\x1b[16t");
|
|
437
|
-
}
|
|
438
|
-
stop() {
|
|
439
|
-
this.stopped = true;
|
|
440
|
-
if (this.renderTimer) {
|
|
441
|
-
clearTimeout(this.renderTimer);
|
|
442
|
-
this.renderTimer = undefined;
|
|
443
|
-
}
|
|
444
|
-
// Move cursor to the end of the content to prevent overwriting/artifacts on exit
|
|
445
|
-
if (this.previousLines.length > 0) {
|
|
446
|
-
const targetRow = this.previousLines.length; // Line after the last content
|
|
447
|
-
const lineDiff = targetRow - this.hardwareCursorRow;
|
|
448
|
-
if (lineDiff > 0) {
|
|
449
|
-
this.terminal.write(`\x1b[${lineDiff}B`);
|
|
450
|
-
}
|
|
451
|
-
else if (lineDiff < 0) {
|
|
452
|
-
this.terminal.write(`\x1b[${-lineDiff}A`);
|
|
453
|
-
}
|
|
454
|
-
this.terminal.write("\r\n");
|
|
455
|
-
}
|
|
456
|
-
this.terminal.showCursor();
|
|
457
|
-
this.terminal.stop();
|
|
458
|
-
}
|
|
459
|
-
requestRender(force = false) {
|
|
460
|
-
if (force) {
|
|
461
|
-
this.previousLines = [];
|
|
462
|
-
this.previousWidth = -1; // -1 triggers widthChanged, forcing a full clear
|
|
463
|
-
this.previousHeight = -1; // -1 triggers heightChanged, forcing a full clear
|
|
464
|
-
this.cursorRow = 0;
|
|
465
|
-
this.hardwareCursorRow = 0;
|
|
466
|
-
this.maxLinesRendered = 0;
|
|
467
|
-
this.previousViewportTop = 0;
|
|
468
|
-
if (this.renderTimer) {
|
|
469
|
-
clearTimeout(this.renderTimer);
|
|
470
|
-
this.renderTimer = undefined;
|
|
471
|
-
}
|
|
472
|
-
this.renderRequested = true;
|
|
473
|
-
process.nextTick(() => {
|
|
474
|
-
if (this.stopped || !this.renderRequested) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
this.renderRequested = false;
|
|
478
|
-
this.lastRenderAt = performance.now();
|
|
479
|
-
this.doRender();
|
|
480
|
-
});
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
if (this.renderRequested)
|
|
484
|
-
return;
|
|
485
|
-
this.renderRequested = true;
|
|
486
|
-
process.nextTick(() => this.scheduleRender());
|
|
487
|
-
}
|
|
488
|
-
scheduleRender() {
|
|
489
|
-
if (this.stopped || this.renderTimer || !this.renderRequested) {
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
const elapsed = performance.now() - this.lastRenderAt;
|
|
493
|
-
const delay = Math.max(0, TUI.MIN_RENDER_INTERVAL_MS - elapsed);
|
|
494
|
-
this.renderTimer = setTimeout(() => {
|
|
495
|
-
this.renderTimer = undefined;
|
|
496
|
-
if (this.stopped || !this.renderRequested) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
this.renderRequested = false;
|
|
500
|
-
this.lastRenderAt = performance.now();
|
|
501
|
-
this.doRender();
|
|
502
|
-
if (this.renderRequested) {
|
|
503
|
-
this.scheduleRender();
|
|
504
|
-
}
|
|
505
|
-
}, delay);
|
|
506
|
-
}
|
|
507
|
-
handleInput(data) {
|
|
508
|
-
if (this.inputListeners.size > 0) {
|
|
509
|
-
let current = data;
|
|
510
|
-
for (const listener of this.inputListeners) {
|
|
511
|
-
const result = listener(current);
|
|
512
|
-
if (result?.consume) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (result?.data !== undefined) {
|
|
516
|
-
current = result.data;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
if (current.length === 0) {
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
data = current;
|
|
523
|
-
}
|
|
524
|
-
// Consume terminal cell size responses without blocking unrelated input.
|
|
525
|
-
if (this.consumeCellSizeResponse(data)) {
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
// Global debug key handler (Shift+Ctrl+D)
|
|
529
|
-
if (matchesKey(data, "shift+ctrl+d") && this.onDebug) {
|
|
530
|
-
this.onDebug();
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
// If focused component is an overlay, verify it's still visible
|
|
534
|
-
// (visibility can change due to terminal resize or visible() callback)
|
|
535
|
-
const focusedOverlay = this.overlayStack.find((o) => o.component === this.focusedComponent);
|
|
536
|
-
if (focusedOverlay && !this.isOverlayVisible(focusedOverlay)) {
|
|
537
|
-
// Focused overlay is no longer visible, redirect to topmost visible overlay
|
|
538
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
539
|
-
if (topVisible) {
|
|
540
|
-
this.setFocus(topVisible.component);
|
|
541
|
-
}
|
|
542
|
-
else {
|
|
543
|
-
this.setFocusInternal({ component: focusedOverlay.preFocus, overlayFocusRestore: "preserve" });
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
const focusIsOverlay = this.overlayStack.some((o) => o.component === this.focusedComponent);
|
|
547
|
-
if (!focusIsOverlay) {
|
|
548
|
-
const restoreState = this.getVisibleOverlayFocusRestore();
|
|
549
|
-
if (restoreState.status === "eligible") {
|
|
550
|
-
this.setFocus(restoreState.overlay.component);
|
|
551
|
-
}
|
|
552
|
-
else if (restoreState.status === "blocked" && restoreState.blockedBy !== this.focusedComponent) {
|
|
553
|
-
if (restoreState.resume.status === "restore-overlay") {
|
|
554
|
-
this.setFocus(restoreState.overlay.component);
|
|
555
|
-
}
|
|
556
|
-
else {
|
|
557
|
-
this.clearOverlayFocusRestore();
|
|
558
|
-
this.setFocus(restoreState.resume.target);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
// Pass input to focused component (including Ctrl+C)
|
|
563
|
-
// The focused component can decide how to handle Ctrl+C
|
|
564
|
-
if (this.focusedComponent?.handleInput) {
|
|
565
|
-
// Filter out key release events unless component opts in
|
|
566
|
-
if (isKeyRelease(data) && !this.focusedComponent.wantsKeyRelease) {
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
this.focusedComponent.handleInput(data);
|
|
570
|
-
this.requestRender();
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
consumeCellSizeResponse(data) {
|
|
574
|
-
// Response format: ESC [ 6 ; height ; width t
|
|
575
|
-
const match = data.match(/^\x1b\[6;(\d+);(\d+)t$/);
|
|
576
|
-
if (!match) {
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
-
const heightPx = parseInt(match[1], 10);
|
|
580
|
-
const widthPx = parseInt(match[2], 10);
|
|
581
|
-
if (heightPx <= 0 || widthPx <= 0) {
|
|
582
|
-
return true;
|
|
583
|
-
}
|
|
584
|
-
setCellDimensions({ widthPx, heightPx });
|
|
585
|
-
// Invalidate all components so images re-render with correct dimensions.
|
|
586
|
-
this.invalidate();
|
|
587
|
-
this.requestRender();
|
|
588
|
-
return true;
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* Resolve overlay layout from options.
|
|
592
|
-
* Returns { width, row, col, maxHeight } for rendering.
|
|
593
|
-
*/
|
|
594
|
-
resolveOverlayLayout(options, overlayHeight, termWidth, termHeight) {
|
|
595
|
-
const opt = options ?? {};
|
|
596
|
-
// Parse margin (clamp to non-negative)
|
|
597
|
-
const margin = typeof opt.margin === "number"
|
|
598
|
-
? { top: opt.margin, right: opt.margin, bottom: opt.margin, left: opt.margin }
|
|
599
|
-
: (opt.margin ?? {});
|
|
600
|
-
const marginTop = Math.max(0, margin.top ?? 0);
|
|
601
|
-
const marginRight = Math.max(0, margin.right ?? 0);
|
|
602
|
-
const marginBottom = Math.max(0, margin.bottom ?? 0);
|
|
603
|
-
const marginLeft = Math.max(0, margin.left ?? 0);
|
|
604
|
-
// Available space after margins
|
|
605
|
-
const availWidth = Math.max(1, termWidth - marginLeft - marginRight);
|
|
606
|
-
const availHeight = Math.max(1, termHeight - marginTop - marginBottom);
|
|
607
|
-
// === Resolve width ===
|
|
608
|
-
let width = parseSizeValue(opt.width, termWidth) ?? Math.min(80, availWidth);
|
|
609
|
-
// Apply minWidth
|
|
610
|
-
if (opt.minWidth !== undefined) {
|
|
611
|
-
width = Math.max(width, opt.minWidth);
|
|
612
|
-
}
|
|
613
|
-
// Clamp to available space
|
|
614
|
-
width = Math.max(1, Math.min(width, availWidth));
|
|
615
|
-
// === Resolve maxHeight ===
|
|
616
|
-
let maxHeight = parseSizeValue(opt.maxHeight, termHeight);
|
|
617
|
-
// Clamp to available space
|
|
618
|
-
if (maxHeight !== undefined) {
|
|
619
|
-
maxHeight = Math.max(1, Math.min(maxHeight, availHeight));
|
|
620
|
-
}
|
|
621
|
-
// Effective overlay height (may be clamped by maxHeight)
|
|
622
|
-
const effectiveHeight = maxHeight !== undefined ? Math.min(overlayHeight, maxHeight) : overlayHeight;
|
|
623
|
-
// === Resolve position ===
|
|
624
|
-
let row;
|
|
625
|
-
let col;
|
|
626
|
-
if (opt.row !== undefined) {
|
|
627
|
-
if (typeof opt.row === "string") {
|
|
628
|
-
// Percentage: 0% = top, 100% = bottom (overlay stays within bounds)
|
|
629
|
-
const match = opt.row.match(/^(\d+(?:\.\d+)?)%$/);
|
|
630
|
-
if (match) {
|
|
631
|
-
const maxRow = Math.max(0, availHeight - effectiveHeight);
|
|
632
|
-
const percent = parseFloat(match[1]) / 100;
|
|
633
|
-
row = marginTop + Math.floor(maxRow * percent);
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
// Invalid format, fall back to center
|
|
637
|
-
row = this.resolveAnchorRow("center", effectiveHeight, availHeight, marginTop);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
// Absolute row position
|
|
642
|
-
row = opt.row;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
else {
|
|
646
|
-
// Anchor-based (default: center)
|
|
647
|
-
const anchor = opt.anchor ?? "center";
|
|
648
|
-
row = this.resolveAnchorRow(anchor, effectiveHeight, availHeight, marginTop);
|
|
649
|
-
}
|
|
650
|
-
if (opt.col !== undefined) {
|
|
651
|
-
if (typeof opt.col === "string") {
|
|
652
|
-
// Percentage: 0% = left, 100% = right (overlay stays within bounds)
|
|
653
|
-
const match = opt.col.match(/^(\d+(?:\.\d+)?)%$/);
|
|
654
|
-
if (match) {
|
|
655
|
-
const maxCol = Math.max(0, availWidth - width);
|
|
656
|
-
const percent = parseFloat(match[1]) / 100;
|
|
657
|
-
col = marginLeft + Math.floor(maxCol * percent);
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
// Invalid format, fall back to center
|
|
661
|
-
col = this.resolveAnchorCol("center", width, availWidth, marginLeft);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
else {
|
|
665
|
-
// Absolute column position
|
|
666
|
-
col = opt.col;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
else {
|
|
670
|
-
// Anchor-based (default: center)
|
|
671
|
-
const anchor = opt.anchor ?? "center";
|
|
672
|
-
col = this.resolveAnchorCol(anchor, width, availWidth, marginLeft);
|
|
673
|
-
}
|
|
674
|
-
// Apply offsets
|
|
675
|
-
if (opt.offsetY !== undefined)
|
|
676
|
-
row += opt.offsetY;
|
|
677
|
-
if (opt.offsetX !== undefined)
|
|
678
|
-
col += opt.offsetX;
|
|
679
|
-
// Clamp to terminal bounds (respecting margins)
|
|
680
|
-
row = Math.max(marginTop, Math.min(row, termHeight - marginBottom - effectiveHeight));
|
|
681
|
-
col = Math.max(marginLeft, Math.min(col, termWidth - marginRight - width));
|
|
682
|
-
return { width, row, col, maxHeight };
|
|
683
|
-
}
|
|
684
|
-
resolveAnchorRow(anchor, height, availHeight, marginTop) {
|
|
685
|
-
switch (anchor) {
|
|
686
|
-
case "top-left":
|
|
687
|
-
case "top-center":
|
|
688
|
-
case "top-right":
|
|
689
|
-
return marginTop;
|
|
690
|
-
case "bottom-left":
|
|
691
|
-
case "bottom-center":
|
|
692
|
-
case "bottom-right":
|
|
693
|
-
return marginTop + availHeight - height;
|
|
694
|
-
case "left-center":
|
|
695
|
-
case "center":
|
|
696
|
-
case "right-center":
|
|
697
|
-
return marginTop + Math.floor((availHeight - height) / 2);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
resolveAnchorCol(anchor, width, availWidth, marginLeft) {
|
|
701
|
-
switch (anchor) {
|
|
702
|
-
case "top-left":
|
|
703
|
-
case "left-center":
|
|
704
|
-
case "bottom-left":
|
|
705
|
-
return marginLeft;
|
|
706
|
-
case "top-right":
|
|
707
|
-
case "right-center":
|
|
708
|
-
case "bottom-right":
|
|
709
|
-
return marginLeft + availWidth - width;
|
|
710
|
-
case "top-center":
|
|
711
|
-
case "center":
|
|
712
|
-
case "bottom-center":
|
|
713
|
-
return marginLeft + Math.floor((availWidth - width) / 2);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
/** Composite all overlays into content lines (sorted by focusOrder, higher = on top). */
|
|
717
|
-
compositeOverlays(lines, termWidth, termHeight) {
|
|
718
|
-
if (this.overlayStack.length === 0)
|
|
719
|
-
return lines;
|
|
720
|
-
const result = [...lines];
|
|
721
|
-
// Pre-render all visible overlays and calculate positions
|
|
722
|
-
const rendered = [];
|
|
723
|
-
let minLinesNeeded = result.length;
|
|
724
|
-
const visibleEntries = this.overlayStack.filter((e) => this.isOverlayVisible(e));
|
|
725
|
-
visibleEntries.sort((a, b) => a.focusOrder - b.focusOrder);
|
|
726
|
-
for (const entry of visibleEntries) {
|
|
727
|
-
const { component, options } = entry;
|
|
728
|
-
// Get layout with height=0 first to determine width and maxHeight
|
|
729
|
-
// (width and maxHeight don't depend on overlay height)
|
|
730
|
-
const { width, maxHeight } = this.resolveOverlayLayout(options, 0, termWidth, termHeight);
|
|
731
|
-
// Render component at calculated width
|
|
732
|
-
let overlayLines = component.render(width);
|
|
733
|
-
// Apply maxHeight if specified
|
|
734
|
-
if (maxHeight !== undefined && overlayLines.length > maxHeight) {
|
|
735
|
-
overlayLines = overlayLines.slice(0, maxHeight);
|
|
736
|
-
}
|
|
737
|
-
// Get final row/col with actual overlay height
|
|
738
|
-
const { row, col } = this.resolveOverlayLayout(options, overlayLines.length, termWidth, termHeight);
|
|
739
|
-
rendered.push({ overlayLines, row, col, w: width });
|
|
740
|
-
minLinesNeeded = Math.max(minLinesNeeded, row + overlayLines.length);
|
|
741
|
-
}
|
|
742
|
-
// Pad to at least terminal height so overlays have screen-relative positions.
|
|
743
|
-
// Excludes maxLinesRendered: the historical high-water mark caused self-reinforcing
|
|
744
|
-
// inflation that pushed content into scrollback on terminal widen.
|
|
745
|
-
const workingHeight = Math.max(result.length, termHeight, minLinesNeeded);
|
|
746
|
-
// Extend result with empty lines if content is too short for overlay placement or working area
|
|
747
|
-
while (result.length < workingHeight) {
|
|
748
|
-
result.push("");
|
|
749
|
-
}
|
|
750
|
-
const viewportStart = Math.max(0, workingHeight - termHeight);
|
|
751
|
-
// Composite each overlay
|
|
752
|
-
for (const { overlayLines, row, col, w } of rendered) {
|
|
753
|
-
for (let i = 0; i < overlayLines.length; i++) {
|
|
754
|
-
const idx = viewportStart + row + i;
|
|
755
|
-
if (idx >= 0 && idx < result.length) {
|
|
756
|
-
// Defensive: truncate overlay line to declared width before compositing
|
|
757
|
-
// (components should already respect width, but this ensures it)
|
|
758
|
-
const truncatedOverlayLine = visibleWidth(overlayLines[i]) > w ? sliceByColumn(overlayLines[i], 0, w, true) : overlayLines[i];
|
|
759
|
-
result[idx] = this.compositeLineAt(result[idx], truncatedOverlayLine, col, w, termWidth);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
return result;
|
|
764
|
-
}
|
|
765
|
-
static SEGMENT_RESET = "\x1b[0m\x1b]8;;\x07";
|
|
766
|
-
applyLineResets(lines) {
|
|
767
|
-
const reset = TUI.SEGMENT_RESET;
|
|
768
|
-
for (let i = 0; i < lines.length; i++) {
|
|
769
|
-
const line = lines[i];
|
|
770
|
-
if (!isImageLine(line)) {
|
|
771
|
-
lines[i] = normalizeTerminalOutput(line) + reset;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
return lines;
|
|
775
|
-
}
|
|
776
|
-
collectKittyImageIds(lines) {
|
|
777
|
-
const ids = new Set();
|
|
778
|
-
for (const line of lines) {
|
|
779
|
-
for (const id of extractKittyImageIds(line)) {
|
|
780
|
-
ids.add(id);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
return ids;
|
|
784
|
-
}
|
|
785
|
-
deleteKittyImages(ids) {
|
|
786
|
-
let buffer = "";
|
|
787
|
-
for (const id of ids) {
|
|
788
|
-
buffer += deleteKittyImage(id);
|
|
789
|
-
}
|
|
790
|
-
return buffer;
|
|
791
|
-
}
|
|
792
|
-
expandLastChangedForKittyImages(firstChanged, lastChanged) {
|
|
793
|
-
let expandedLastChanged = lastChanged;
|
|
794
|
-
for (let i = firstChanged; i < this.previousLines.length; i++) {
|
|
795
|
-
if (extractKittyImageIds(this.previousLines[i]).length > 0) {
|
|
796
|
-
expandedLastChanged = Math.max(expandedLastChanged, i);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
return expandedLastChanged;
|
|
800
|
-
}
|
|
801
|
-
deleteChangedKittyImages(firstChanged, lastChanged) {
|
|
802
|
-
if (firstChanged < 0 || lastChanged < firstChanged)
|
|
803
|
-
return "";
|
|
804
|
-
const ids = new Set();
|
|
805
|
-
const maxLine = Math.min(lastChanged, this.previousLines.length - 1);
|
|
806
|
-
for (let i = firstChanged; i <= maxLine; i++) {
|
|
807
|
-
for (const id of extractKittyImageIds(this.previousLines[i] ?? "")) {
|
|
808
|
-
ids.add(id);
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
return this.deleteKittyImages(ids);
|
|
812
|
-
}
|
|
813
|
-
/** Splice overlay content into a base line at a specific column. Single-pass optimized. */
|
|
814
|
-
compositeLineAt(baseLine, overlayLine, startCol, overlayWidth, totalWidth) {
|
|
815
|
-
if (isImageLine(baseLine))
|
|
816
|
-
return baseLine;
|
|
817
|
-
// Single pass through baseLine extracts both before and after segments
|
|
818
|
-
const afterStart = startCol + overlayWidth;
|
|
819
|
-
const base = extractSegments(baseLine, startCol, afterStart, totalWidth - afterStart, true);
|
|
820
|
-
// Extract overlay with width tracking (strict=true to exclude wide chars at boundary)
|
|
821
|
-
const overlay = sliceWithWidth(overlayLine, 0, overlayWidth, true);
|
|
822
|
-
// Pad segments to target widths
|
|
823
|
-
const beforePad = Math.max(0, startCol - base.beforeWidth);
|
|
824
|
-
const overlayPad = Math.max(0, overlayWidth - overlay.width);
|
|
825
|
-
const actualBeforeWidth = Math.max(startCol, base.beforeWidth);
|
|
826
|
-
const actualOverlayWidth = Math.max(overlayWidth, overlay.width);
|
|
827
|
-
const afterTarget = Math.max(0, totalWidth - actualBeforeWidth - actualOverlayWidth);
|
|
828
|
-
const afterPad = Math.max(0, afterTarget - base.afterWidth);
|
|
829
|
-
// Compose result
|
|
830
|
-
const r = TUI.SEGMENT_RESET;
|
|
831
|
-
const result = base.before +
|
|
832
|
-
" ".repeat(beforePad) +
|
|
833
|
-
r +
|
|
834
|
-
overlay.text +
|
|
835
|
-
" ".repeat(overlayPad) +
|
|
836
|
-
r +
|
|
837
|
-
base.after +
|
|
838
|
-
" ".repeat(afterPad);
|
|
839
|
-
// CRITICAL: Always verify and truncate to terminal width.
|
|
840
|
-
// This is the final safeguard against width overflow which would crash the TUI.
|
|
841
|
-
// Width tracking can drift from actual visible width due to:
|
|
842
|
-
// - Complex ANSI/OSC sequences (hyperlinks, colors)
|
|
843
|
-
// - Wide characters at segment boundaries
|
|
844
|
-
// - Edge cases in segment extraction
|
|
845
|
-
const resultWidth = visibleWidth(result);
|
|
846
|
-
if (resultWidth <= totalWidth) {
|
|
847
|
-
return result;
|
|
848
|
-
}
|
|
849
|
-
// Truncate with strict=true to ensure we don't exceed totalWidth
|
|
850
|
-
return sliceByColumn(result, 0, totalWidth, true);
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Find and extract cursor position from rendered lines.
|
|
854
|
-
* Searches for CURSOR_MARKER, calculates its position, and strips it from the output.
|
|
855
|
-
* Only scans the bottom terminal height lines (visible viewport).
|
|
856
|
-
* @param lines - Rendered lines to search
|
|
857
|
-
* @param height - Terminal height (visible viewport size)
|
|
858
|
-
* @returns Cursor position { row, col } or null if no marker found
|
|
859
|
-
*/
|
|
860
|
-
extractCursorPosition(lines, height) {
|
|
861
|
-
// Only scan the bottom `height` lines (visible viewport)
|
|
862
|
-
const viewportTop = Math.max(0, lines.length - height);
|
|
863
|
-
for (let row = lines.length - 1; row >= viewportTop; row--) {
|
|
864
|
-
const line = lines[row];
|
|
865
|
-
const markerIndex = line.indexOf(CURSOR_MARKER);
|
|
866
|
-
if (markerIndex !== -1) {
|
|
867
|
-
// Calculate visual column (width of text before marker)
|
|
868
|
-
const beforeMarker = line.slice(0, markerIndex);
|
|
869
|
-
const col = visibleWidth(beforeMarker);
|
|
870
|
-
// Strip marker from the line
|
|
871
|
-
lines[row] = line.slice(0, markerIndex) + line.slice(markerIndex + CURSOR_MARKER.length);
|
|
872
|
-
return { row, col };
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
return null;
|
|
876
|
-
}
|
|
877
|
-
doRender() {
|
|
878
|
-
if (this.stopped)
|
|
879
|
-
return;
|
|
880
|
-
const width = this.terminal.columns;
|
|
881
|
-
const height = this.terminal.rows;
|
|
882
|
-
const widthChanged = this.previousWidth !== 0 && this.previousWidth !== width;
|
|
883
|
-
const heightChanged = this.previousHeight !== 0 && this.previousHeight !== height;
|
|
884
|
-
const previousBufferLength = this.previousHeight > 0 ? this.previousViewportTop + this.previousHeight : height;
|
|
885
|
-
let prevViewportTop = heightChanged ? Math.max(0, previousBufferLength - height) : this.previousViewportTop;
|
|
886
|
-
let viewportTop = prevViewportTop;
|
|
887
|
-
let hardwareCursorRow = this.hardwareCursorRow;
|
|
888
|
-
const computeLineDiff = (targetRow) => {
|
|
889
|
-
const currentScreenRow = hardwareCursorRow - prevViewportTop;
|
|
890
|
-
const targetScreenRow = targetRow - viewportTop;
|
|
891
|
-
return targetScreenRow - currentScreenRow;
|
|
892
|
-
};
|
|
893
|
-
// Render all components to get new lines
|
|
894
|
-
let newLines = this.render(width);
|
|
895
|
-
// Composite overlays into the rendered lines (before differential compare)
|
|
896
|
-
if (this.overlayStack.length > 0) {
|
|
897
|
-
newLines = this.compositeOverlays(newLines, width, height);
|
|
898
|
-
}
|
|
899
|
-
// Extract cursor position before applying line resets (marker must be found first)
|
|
900
|
-
const cursorPos = this.extractCursorPosition(newLines, height);
|
|
901
|
-
newLines = this.applyLineResets(newLines);
|
|
902
|
-
// Helper to clear scrollback and viewport and render all new lines
|
|
903
|
-
const fullRender = (clear) => {
|
|
904
|
-
this.fullRedrawCount += 1;
|
|
905
|
-
let buffer = "\x1b[?2026h"; // Begin synchronized output
|
|
906
|
-
if (clear) {
|
|
907
|
-
buffer += this.deleteKittyImages(this.previousKittyImageIds);
|
|
908
|
-
buffer += "\x1b[2J\x1b[H\x1b[3J"; // Clear screen, home, then clear scrollback
|
|
909
|
-
}
|
|
910
|
-
for (let i = 0; i < newLines.length; i++) {
|
|
911
|
-
if (i > 0)
|
|
912
|
-
buffer += "\r\n";
|
|
913
|
-
buffer += newLines[i];
|
|
914
|
-
}
|
|
915
|
-
buffer += "\x1b[?2026l"; // End synchronized output
|
|
916
|
-
this.terminal.write(buffer);
|
|
917
|
-
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
918
|
-
this.hardwareCursorRow = this.cursorRow;
|
|
919
|
-
// Reset max lines when clearing, otherwise track growth
|
|
920
|
-
if (clear) {
|
|
921
|
-
this.maxLinesRendered = newLines.length;
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
924
|
-
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
925
|
-
}
|
|
926
|
-
const bufferLength = Math.max(height, newLines.length);
|
|
927
|
-
this.previousViewportTop = Math.max(0, bufferLength - height);
|
|
928
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
929
|
-
this.previousLines = newLines;
|
|
930
|
-
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
931
|
-
this.previousWidth = width;
|
|
932
|
-
this.previousHeight = height;
|
|
933
|
-
};
|
|
934
|
-
const debugRedraw = process.env.PI_DEBUG_REDRAW === "1";
|
|
935
|
-
const logRedraw = (reason) => {
|
|
936
|
-
if (!debugRedraw)
|
|
937
|
-
return;
|
|
938
|
-
const logPath = path.join(os.homedir(), ".pi", "agent", "chimera-debug.log");
|
|
939
|
-
const msg = `[${new Date().toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
|
|
940
|
-
fs.appendFileSync(logPath, msg);
|
|
941
|
-
};
|
|
942
|
-
// First render - just output everything without clearing (assumes clean screen)
|
|
943
|
-
if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
|
|
944
|
-
logRedraw("first render");
|
|
945
|
-
fullRender(false);
|
|
946
|
-
return;
|
|
947
|
-
}
|
|
948
|
-
// Width changes always need a full re-render because wrapping changes.
|
|
949
|
-
if (widthChanged) {
|
|
950
|
-
logRedraw(`terminal width changed (${this.previousWidth} -> ${width})`);
|
|
951
|
-
fullRender(true);
|
|
952
|
-
return;
|
|
953
|
-
}
|
|
954
|
-
// Height changes normally need a full re-render to keep the visible viewport aligned,
|
|
955
|
-
// but Termux changes height when the software keyboard shows or hides.
|
|
956
|
-
// In that environment, a full redraw causes the entire history to replay on every toggle.
|
|
957
|
-
if (heightChanged && !isTermuxSession()) {
|
|
958
|
-
logRedraw(`terminal height changed (${this.previousHeight} -> ${height})`);
|
|
959
|
-
fullRender(true);
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
// Content shrunk below the working area and no overlays - re-render to clear empty rows
|
|
963
|
-
// (overlays need the padding, so only do this when no overlays are active)
|
|
964
|
-
// Configurable via setClearOnShrink() or PI_CLEAR_ON_SHRINK=0 env var
|
|
965
|
-
if (this.clearOnShrink && newLines.length < this.maxLinesRendered && this.overlayStack.length === 0) {
|
|
966
|
-
logRedraw(`clearOnShrink (maxLinesRendered=${this.maxLinesRendered})`);
|
|
967
|
-
fullRender(true);
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
// Find first and last changed lines
|
|
971
|
-
let firstChanged = -1;
|
|
972
|
-
let lastChanged = -1;
|
|
973
|
-
const maxLines = Math.max(newLines.length, this.previousLines.length);
|
|
974
|
-
for (let i = 0; i < maxLines; i++) {
|
|
975
|
-
const oldLine = i < this.previousLines.length ? this.previousLines[i] : "";
|
|
976
|
-
const newLine = i < newLines.length ? newLines[i] : "";
|
|
977
|
-
if (oldLine !== newLine) {
|
|
978
|
-
if (firstChanged === -1) {
|
|
979
|
-
firstChanged = i;
|
|
980
|
-
}
|
|
981
|
-
lastChanged = i;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
const appendedLines = newLines.length > this.previousLines.length;
|
|
985
|
-
if (appendedLines) {
|
|
986
|
-
if (firstChanged === -1) {
|
|
987
|
-
firstChanged = this.previousLines.length;
|
|
988
|
-
}
|
|
989
|
-
lastChanged = newLines.length - 1;
|
|
990
|
-
}
|
|
991
|
-
if (firstChanged !== -1) {
|
|
992
|
-
lastChanged = this.expandLastChangedForKittyImages(firstChanged, lastChanged);
|
|
993
|
-
}
|
|
994
|
-
const appendStart = appendedLines && firstChanged === this.previousLines.length && firstChanged > 0;
|
|
995
|
-
// No changes - but still need to update hardware cursor position if it moved
|
|
996
|
-
if (firstChanged === -1) {
|
|
997
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
998
|
-
this.previousViewportTop = prevViewportTop;
|
|
999
|
-
this.previousHeight = height;
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
// All changes are in deleted lines (nothing to render, just clear)
|
|
1003
|
-
if (firstChanged >= newLines.length) {
|
|
1004
|
-
if (this.previousLines.length > newLines.length) {
|
|
1005
|
-
let buffer = "\x1b[?2026h";
|
|
1006
|
-
buffer += this.deleteChangedKittyImages(firstChanged, lastChanged);
|
|
1007
|
-
// Move to end of new content (clamp to 0 for empty content)
|
|
1008
|
-
const targetRow = Math.max(0, newLines.length - 1);
|
|
1009
|
-
if (targetRow < prevViewportTop) {
|
|
1010
|
-
logRedraw(`deleted lines moved viewport up (${targetRow} < ${prevViewportTop})`);
|
|
1011
|
-
fullRender(true);
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
const lineDiff = computeLineDiff(targetRow);
|
|
1015
|
-
if (lineDiff > 0)
|
|
1016
|
-
buffer += `\x1b[${lineDiff}B`;
|
|
1017
|
-
else if (lineDiff < 0)
|
|
1018
|
-
buffer += `\x1b[${-lineDiff}A`;
|
|
1019
|
-
buffer += "\r";
|
|
1020
|
-
// Clear extra lines without scrolling
|
|
1021
|
-
const extraLines = this.previousLines.length - newLines.length;
|
|
1022
|
-
if (extraLines > height) {
|
|
1023
|
-
logRedraw(`extraLines > height (${extraLines} > ${height})`);
|
|
1024
|
-
fullRender(true);
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
if (extraLines > 0) {
|
|
1028
|
-
buffer += "\x1b[1B";
|
|
1029
|
-
}
|
|
1030
|
-
for (let i = 0; i < extraLines; i++) {
|
|
1031
|
-
buffer += "\r\x1b[2K";
|
|
1032
|
-
if (i < extraLines - 1)
|
|
1033
|
-
buffer += "\x1b[1B";
|
|
1034
|
-
}
|
|
1035
|
-
if (extraLines > 0) {
|
|
1036
|
-
buffer += `\x1b[${extraLines}A`;
|
|
1037
|
-
}
|
|
1038
|
-
buffer += "\x1b[?2026l";
|
|
1039
|
-
this.terminal.write(buffer);
|
|
1040
|
-
this.cursorRow = targetRow;
|
|
1041
|
-
this.hardwareCursorRow = targetRow;
|
|
1042
|
-
}
|
|
1043
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1044
|
-
this.previousLines = newLines;
|
|
1045
|
-
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1046
|
-
this.previousWidth = width;
|
|
1047
|
-
this.previousHeight = height;
|
|
1048
|
-
this.previousViewportTop = prevViewportTop;
|
|
1049
|
-
return;
|
|
1050
|
-
}
|
|
1051
|
-
// Differential rendering can only touch what was actually visible.
|
|
1052
|
-
// If the first changed line is above the previous viewport, we need a full redraw.
|
|
1053
|
-
if (firstChanged < prevViewportTop) {
|
|
1054
|
-
logRedraw(`firstChanged < viewportTop (${firstChanged} < ${prevViewportTop})`);
|
|
1055
|
-
fullRender(true);
|
|
1056
|
-
return;
|
|
1057
|
-
}
|
|
1058
|
-
// Render from first changed line to end
|
|
1059
|
-
// Build buffer with all updates wrapped in synchronized output
|
|
1060
|
-
let buffer = "\x1b[?2026h"; // Begin synchronized output
|
|
1061
|
-
buffer += this.deleteChangedKittyImages(firstChanged, lastChanged);
|
|
1062
|
-
const prevViewportBottom = prevViewportTop + height - 1;
|
|
1063
|
-
const moveTargetRow = appendStart ? firstChanged - 1 : firstChanged;
|
|
1064
|
-
if (moveTargetRow > prevViewportBottom) {
|
|
1065
|
-
const currentScreenRow = Math.max(0, Math.min(height - 1, hardwareCursorRow - prevViewportTop));
|
|
1066
|
-
const moveToBottom = height - 1 - currentScreenRow;
|
|
1067
|
-
if (moveToBottom > 0) {
|
|
1068
|
-
buffer += `\x1b[${moveToBottom}B`;
|
|
1069
|
-
}
|
|
1070
|
-
const scroll = moveTargetRow - prevViewportBottom;
|
|
1071
|
-
buffer += "\r\n".repeat(scroll);
|
|
1072
|
-
prevViewportTop += scroll;
|
|
1073
|
-
viewportTop += scroll;
|
|
1074
|
-
hardwareCursorRow = moveTargetRow;
|
|
1075
|
-
}
|
|
1076
|
-
// Move cursor to first changed line (use hardwareCursorRow for actual position)
|
|
1077
|
-
const lineDiff = computeLineDiff(moveTargetRow);
|
|
1078
|
-
if (lineDiff > 0) {
|
|
1079
|
-
buffer += `\x1b[${lineDiff}B`; // Move down
|
|
1080
|
-
}
|
|
1081
|
-
else if (lineDiff < 0) {
|
|
1082
|
-
buffer += `\x1b[${-lineDiff}A`; // Move up
|
|
1083
|
-
}
|
|
1084
|
-
buffer += appendStart ? "\r\n" : "\r"; // Move to column 0
|
|
1085
|
-
// Only render changed lines (firstChanged to lastChanged), not all lines to end
|
|
1086
|
-
// This reduces flicker when only a single line changes (e.g., spinner animation)
|
|
1087
|
-
const renderEnd = Math.min(lastChanged, newLines.length - 1);
|
|
1088
|
-
for (let i = firstChanged; i <= renderEnd; i++) {
|
|
1089
|
-
if (i > firstChanged)
|
|
1090
|
-
buffer += "\r\n";
|
|
1091
|
-
buffer += "\x1b[2K"; // Clear current line
|
|
1092
|
-
const line = newLines[i];
|
|
1093
|
-
const isImage = isImageLine(line);
|
|
1094
|
-
if (!isImage && visibleWidth(line) > width) {
|
|
1095
|
-
// Log all lines to crash file for debugging
|
|
1096
|
-
const crashLogPath = path.join(os.homedir(), ".pi", "agent", "chimera-crash.log");
|
|
1097
|
-
const crashData = [
|
|
1098
|
-
`Crash at ${new Date().toISOString()}`,
|
|
1099
|
-
`Terminal width: ${width}`,
|
|
1100
|
-
`Line ${i} visible width: ${visibleWidth(line)}`,
|
|
1101
|
-
"",
|
|
1102
|
-
"=== All rendered lines ===",
|
|
1103
|
-
...newLines.map((l, idx) => `[${idx}] (w=${visibleWidth(l)}) ${l}`),
|
|
1104
|
-
"",
|
|
1105
|
-
].join("\n");
|
|
1106
|
-
fs.mkdirSync(path.dirname(crashLogPath), { recursive: true });
|
|
1107
|
-
fs.writeFileSync(crashLogPath, crashData);
|
|
1108
|
-
// Clean up terminal state before throwing
|
|
1109
|
-
this.stop();
|
|
1110
|
-
const errorMsg = [
|
|
1111
|
-
`Rendered line ${i} exceeds terminal width (${visibleWidth(line)} > ${width}).`,
|
|
1112
|
-
"",
|
|
1113
|
-
"This is likely caused by a custom TUI component not truncating its output.",
|
|
1114
|
-
"Use visibleWidth() to measure and truncateToWidth() to truncate lines.",
|
|
1115
|
-
"",
|
|
1116
|
-
`Debug log written to: ${crashLogPath}`,
|
|
1117
|
-
].join("\n");
|
|
1118
|
-
throw new Error(errorMsg);
|
|
1119
|
-
}
|
|
1120
|
-
buffer += line;
|
|
1121
|
-
}
|
|
1122
|
-
// Track where cursor ended up after rendering
|
|
1123
|
-
let finalCursorRow = renderEnd;
|
|
1124
|
-
// If we had more lines before, clear them and move cursor back
|
|
1125
|
-
if (this.previousLines.length > newLines.length) {
|
|
1126
|
-
// Move to end of new content first if we stopped before it
|
|
1127
|
-
if (renderEnd < newLines.length - 1) {
|
|
1128
|
-
const moveDown = newLines.length - 1 - renderEnd;
|
|
1129
|
-
buffer += `\x1b[${moveDown}B`;
|
|
1130
|
-
finalCursorRow = newLines.length - 1;
|
|
1131
|
-
}
|
|
1132
|
-
const extraLines = this.previousLines.length - newLines.length;
|
|
1133
|
-
for (let i = newLines.length; i < this.previousLines.length; i++) {
|
|
1134
|
-
buffer += "\r\n\x1b[2K";
|
|
1135
|
-
}
|
|
1136
|
-
// Move cursor back to end of new content
|
|
1137
|
-
buffer += `\x1b[${extraLines}A`;
|
|
1138
|
-
}
|
|
1139
|
-
buffer += "\x1b[?2026l"; // End synchronized output
|
|
1140
|
-
if (process.env.PI_TUI_DEBUG === "1") {
|
|
1141
|
-
const debugDir = "/tmp/tui";
|
|
1142
|
-
fs.mkdirSync(debugDir, { recursive: true });
|
|
1143
|
-
const debugPath = path.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
|
|
1144
|
-
const debugData = [
|
|
1145
|
-
`firstChanged: ${firstChanged}`,
|
|
1146
|
-
`viewportTop: ${viewportTop}`,
|
|
1147
|
-
`cursorRow: ${this.cursorRow}`,
|
|
1148
|
-
`height: ${height}`,
|
|
1149
|
-
`lineDiff: ${lineDiff}`,
|
|
1150
|
-
`hardwareCursorRow: ${hardwareCursorRow}`,
|
|
1151
|
-
`renderEnd: ${renderEnd}`,
|
|
1152
|
-
`finalCursorRow: ${finalCursorRow}`,
|
|
1153
|
-
`cursorPos: ${JSON.stringify(cursorPos)}`,
|
|
1154
|
-
`newLines.length: ${newLines.length}`,
|
|
1155
|
-
`previousLines.length: ${this.previousLines.length}`,
|
|
1156
|
-
"",
|
|
1157
|
-
"=== newLines ===",
|
|
1158
|
-
JSON.stringify(newLines, null, 2),
|
|
1159
|
-
"",
|
|
1160
|
-
"=== previousLines ===",
|
|
1161
|
-
JSON.stringify(this.previousLines, null, 2),
|
|
1162
|
-
"",
|
|
1163
|
-
"=== buffer ===",
|
|
1164
|
-
JSON.stringify(buffer),
|
|
1165
|
-
].join("\n");
|
|
1166
|
-
fs.writeFileSync(debugPath, debugData);
|
|
1167
|
-
}
|
|
1168
|
-
// Write entire buffer at once
|
|
1169
|
-
this.terminal.write(buffer);
|
|
1170
|
-
// Track cursor position for next render
|
|
1171
|
-
// cursorRow tracks end of content (for viewport calculation)
|
|
1172
|
-
// hardwareCursorRow tracks actual terminal cursor position (for movement)
|
|
1173
|
-
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
1174
|
-
this.hardwareCursorRow = finalCursorRow;
|
|
1175
|
-
// Track terminal's working area (grows but doesn't shrink unless cleared)
|
|
1176
|
-
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
1177
|
-
this.previousViewportTop = Math.max(prevViewportTop, finalCursorRow - height + 1);
|
|
1178
|
-
// Position hardware cursor for IME
|
|
1179
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
1180
|
-
this.previousLines = newLines;
|
|
1181
|
-
this.previousKittyImageIds = this.collectKittyImageIds(newLines);
|
|
1182
|
-
this.previousWidth = width;
|
|
1183
|
-
this.previousHeight = height;
|
|
1184
|
-
}
|
|
1185
|
-
/**
|
|
1186
|
-
* Position the hardware cursor for IME candidate window.
|
|
1187
|
-
* @param cursorPos The cursor position extracted from rendered output, or null
|
|
1188
|
-
* @param totalLines Total number of rendered lines
|
|
1189
|
-
*/
|
|
1190
|
-
positionHardwareCursor(cursorPos, totalLines) {
|
|
1191
|
-
if (!cursorPos || totalLines <= 0) {
|
|
1192
|
-
this.terminal.hideCursor();
|
|
1193
|
-
return;
|
|
1194
|
-
}
|
|
1195
|
-
// Clamp cursor position to valid range
|
|
1196
|
-
const targetRow = Math.max(0, Math.min(cursorPos.row, totalLines - 1));
|
|
1197
|
-
const targetCol = Math.max(0, cursorPos.col);
|
|
1198
|
-
// Move cursor from current position to target
|
|
1199
|
-
const rowDelta = targetRow - this.hardwareCursorRow;
|
|
1200
|
-
let buffer = "";
|
|
1201
|
-
if (rowDelta > 0) {
|
|
1202
|
-
buffer += `\x1b[${rowDelta}B`; // Move down
|
|
1203
|
-
}
|
|
1204
|
-
else if (rowDelta < 0) {
|
|
1205
|
-
buffer += `\x1b[${-rowDelta}A`; // Move up
|
|
1206
|
-
}
|
|
1207
|
-
// Move to absolute column (1-indexed)
|
|
1208
|
-
buffer += `\x1b[${targetCol + 1}G`;
|
|
1209
|
-
if (buffer) {
|
|
1210
|
-
this.terminal.write(buffer);
|
|
1211
|
-
}
|
|
1212
|
-
this.hardwareCursorRow = targetRow;
|
|
1213
|
-
if (this.showHardwareCursor) {
|
|
1214
|
-
this.terminal.showCursor();
|
|
1215
|
-
}
|
|
1216
|
-
else {
|
|
1217
|
-
this.terminal.hideCursor();
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
//# sourceMappingURL=tui.js.map
|