@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,472 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { setKittyProtocolActive } from "./keys.js";
|
|
6
|
-
import { isNativeModifierPressed } from "./native-modifiers.js";
|
|
7
|
-
import { StdinBuffer } from "./stdin-buffer.js";
|
|
8
|
-
const cjsRequire = createRequire(import.meta.url);
|
|
9
|
-
const TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;
|
|
10
|
-
const TERMINAL_PROGRESS_ACTIVE_SEQUENCE = "\x1b]9;4;3\x07";
|
|
11
|
-
const TERMINAL_PROGRESS_CLEAR_SEQUENCE = "\x1b]9;4;0;\x07";
|
|
12
|
-
const APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE = "\x1b[13;2u";
|
|
13
|
-
const DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;
|
|
14
|
-
const KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS = 150;
|
|
15
|
-
const KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;
|
|
16
|
-
const KITTY_KEYBOARD_PROTOCOL_QUERY = `\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\x1b[?u\x1b[c`;
|
|
17
|
-
export function parseKeyboardProtocolNegotiationSequence(sequence) {
|
|
18
|
-
const kittyFlags = sequence.match(/^\x1b\[\?(\d+)u$/);
|
|
19
|
-
if (kittyFlags) {
|
|
20
|
-
return { type: "kitty-flags", flags: Number.parseInt(kittyFlags[1], 10) };
|
|
21
|
-
}
|
|
22
|
-
if (/^\x1b\[\?[\d;]*c$/.test(sequence)) {
|
|
23
|
-
return { type: "device-attributes" };
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
function isKeyboardProtocolNegotiationSequencePrefix(sequence, allowBareEscapePrefix) {
|
|
28
|
-
return (allowBareEscapePrefix && sequence === "\x1b") || sequence === "\x1b[" || /^\x1b\[\?[\d;]*$/.test(sequence);
|
|
29
|
-
}
|
|
30
|
-
export function isAppleTerminalSession() {
|
|
31
|
-
return process.platform === "darwin" && process.env.TERM_PROGRAM === "Apple_Terminal";
|
|
32
|
-
}
|
|
33
|
-
export function normalizeAppleTerminalInput(data, isAppleTerminal, isShiftPressed) {
|
|
34
|
-
if (isAppleTerminal && data === "\r" && isShiftPressed)
|
|
35
|
-
return APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE;
|
|
36
|
-
return data;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Real terminal using process.stdin/stdout
|
|
40
|
-
*/
|
|
41
|
-
export class ProcessTerminal {
|
|
42
|
-
wasRaw = false;
|
|
43
|
-
inputHandler;
|
|
44
|
-
resizeHandler;
|
|
45
|
-
_kittyProtocolActive = false;
|
|
46
|
-
_modifyOtherKeysActive = false;
|
|
47
|
-
keyboardProtocolPushed = false;
|
|
48
|
-
keyboardProtocolNegotiationPending = false;
|
|
49
|
-
keyboardProtocolLateResponsePending = false;
|
|
50
|
-
keyboardProtocolNegotiationBuffer = "";
|
|
51
|
-
keyboardProtocolFallbackTimer;
|
|
52
|
-
keyboardProtocolBufferFlushTimer;
|
|
53
|
-
stdinBuffer;
|
|
54
|
-
stdinDataHandler;
|
|
55
|
-
progressInterval;
|
|
56
|
-
writeLogPath = (() => {
|
|
57
|
-
const env = process.env.PI_TUI_WRITE_LOG || "";
|
|
58
|
-
if (!env)
|
|
59
|
-
return "";
|
|
60
|
-
try {
|
|
61
|
-
if (fs.statSync(env).isDirectory()) {
|
|
62
|
-
const now = new Date();
|
|
63
|
-
const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`;
|
|
64
|
-
return path.join(env, `tui-${ts}-${process.pid}.log`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// Not an existing directory - use as-is (file path)
|
|
69
|
-
}
|
|
70
|
-
return env;
|
|
71
|
-
})();
|
|
72
|
-
get kittyProtocolActive() {
|
|
73
|
-
return this._kittyProtocolActive;
|
|
74
|
-
}
|
|
75
|
-
start(onInput, onResize) {
|
|
76
|
-
this.inputHandler = onInput;
|
|
77
|
-
this.resizeHandler = onResize;
|
|
78
|
-
// Save previous state and enable raw mode
|
|
79
|
-
this.wasRaw = process.stdin.isRaw || false;
|
|
80
|
-
if (process.stdin.setRawMode) {
|
|
81
|
-
process.stdin.setRawMode(true);
|
|
82
|
-
}
|
|
83
|
-
process.stdin.setEncoding("utf8");
|
|
84
|
-
process.stdin.resume();
|
|
85
|
-
// Enable bracketed paste mode - terminal will wrap pastes in \x1b[200~ ... \x1b[201~
|
|
86
|
-
process.stdout.write("\x1b[?2004h");
|
|
87
|
-
// Set up resize handler immediately
|
|
88
|
-
process.stdout.on("resize", this.resizeHandler);
|
|
89
|
-
// Refresh terminal dimensions - they may be stale after suspend/resume
|
|
90
|
-
// (SIGWINCH is lost while process is stopped). Unix only.
|
|
91
|
-
if (process.platform !== "win32") {
|
|
92
|
-
process.kill(process.pid, "SIGWINCH");
|
|
93
|
-
}
|
|
94
|
-
// On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends
|
|
95
|
-
// VT escape sequences (e.g. \x1b[Z for Shift+Tab) instead of raw console
|
|
96
|
-
// events that lose modifier information. Must run AFTER setRawMode(true)
|
|
97
|
-
// since that resets console mode flags.
|
|
98
|
-
this.enableWindowsVTInput();
|
|
99
|
-
// Query and enable Kitty keyboard protocol
|
|
100
|
-
// The query handler intercepts input temporarily, then installs the user's handler
|
|
101
|
-
// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
|
|
102
|
-
this.queryAndEnableKittyProtocol();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Set up StdinBuffer to split batched input into individual sequences.
|
|
106
|
-
* This ensures components receive single events, making matchesKey/isKeyRelease work correctly.
|
|
107
|
-
*
|
|
108
|
-
* Also watches for Kitty protocol response and enables it when detected.
|
|
109
|
-
* This is done here (after stdinBuffer parsing) rather than on raw stdin
|
|
110
|
-
* to handle the case where the response arrives split across multiple events.
|
|
111
|
-
*/
|
|
112
|
-
setupStdinBuffer() {
|
|
113
|
-
this.stdinBuffer = new StdinBuffer({ timeout: 10 });
|
|
114
|
-
// Forward individual sequences to the input handler
|
|
115
|
-
this.stdinBuffer.on("data", (sequence) => {
|
|
116
|
-
if (this.keyboardProtocolNegotiationPending) {
|
|
117
|
-
const negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, true);
|
|
118
|
-
if (negotiationSequence === "pending") {
|
|
119
|
-
return; // Wait for the rest of a split negotiation response.
|
|
120
|
-
}
|
|
121
|
-
if (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (this.keyboardProtocolLateResponsePending) {
|
|
126
|
-
const negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, false);
|
|
127
|
-
if (negotiationSequence === "pending") {
|
|
128
|
-
this.scheduleKeyboardProtocolNegotiationBufferFlush();
|
|
129
|
-
return; // Wait for the rest of a split late negotiation response.
|
|
130
|
-
}
|
|
131
|
-
if (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
this.forwardInputSequence(sequence);
|
|
136
|
-
});
|
|
137
|
-
// Re-wrap paste content with bracketed paste markers for existing editor handling
|
|
138
|
-
this.stdinBuffer.on("paste", (content) => {
|
|
139
|
-
if (this.inputHandler) {
|
|
140
|
-
this.inputHandler(`\x1b[200~${content}\x1b[201~`);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
// Handler that pipes stdin data through the buffer
|
|
144
|
-
this.stdinDataHandler = (data) => {
|
|
145
|
-
this.stdinBuffer.process(data);
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Query terminal for Kitty keyboard protocol support and enable it if available.
|
|
150
|
-
*
|
|
151
|
-
* Kitty's progressive enhancement detection requires requesting the desired
|
|
152
|
-
* flags before querying them. The trailing DA query is a sentinel supported by
|
|
153
|
-
* terminals that do not know Kitty keyboard protocol. A short timeout remains
|
|
154
|
-
* as a backup for terminals, PTYs, and SSH sessions that delay, split, or drop
|
|
155
|
-
* the DA response.
|
|
156
|
-
*
|
|
157
|
-
* The requested flags are:
|
|
158
|
-
* - 1 = disambiguate escape codes
|
|
159
|
-
* - 2 = report event types (press/repeat/release)
|
|
160
|
-
* - 4 = report alternate keys (shifted key, base layout key)
|
|
161
|
-
*/
|
|
162
|
-
queryAndEnableKittyProtocol() {
|
|
163
|
-
this.setupStdinBuffer();
|
|
164
|
-
process.stdin.on("data", this.stdinDataHandler);
|
|
165
|
-
this.keyboardProtocolPushed = true;
|
|
166
|
-
this.keyboardProtocolNegotiationPending = true;
|
|
167
|
-
this.keyboardProtocolLateResponsePending = false;
|
|
168
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
169
|
-
process.stdout.write(KITTY_KEYBOARD_PROTOCOL_QUERY);
|
|
170
|
-
this.keyboardProtocolFallbackTimer = setTimeout(() => {
|
|
171
|
-
this.keyboardProtocolFallbackTimer = undefined;
|
|
172
|
-
this.keyboardProtocolNegotiationPending = false;
|
|
173
|
-
this.keyboardProtocolLateResponsePending = true;
|
|
174
|
-
if (this.keyboardProtocolNegotiationBuffer === "\x1b") {
|
|
175
|
-
this.flushKeyboardProtocolNegotiationBufferAsInput();
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
this.scheduleKeyboardProtocolNegotiationBufferFlush();
|
|
179
|
-
}
|
|
180
|
-
this.enableModifyOtherKeys();
|
|
181
|
-
}, KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS);
|
|
182
|
-
}
|
|
183
|
-
handleKeyboardProtocolNegotiationSequence(negotiationSequence) {
|
|
184
|
-
if (!negotiationSequence)
|
|
185
|
-
return false;
|
|
186
|
-
if (negotiationSequence.type === "kitty-flags") {
|
|
187
|
-
if (negotiationSequence.flags !== 0 && !this._kittyProtocolActive) {
|
|
188
|
-
this._kittyProtocolActive = true;
|
|
189
|
-
setKittyProtocolActive(true);
|
|
190
|
-
this.keyboardProtocolNegotiationPending = false;
|
|
191
|
-
this.keyboardProtocolLateResponsePending = true;
|
|
192
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
193
|
-
this.clearKeyboardProtocolFallbackTimer();
|
|
194
|
-
}
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
this.keyboardProtocolNegotiationPending = false;
|
|
198
|
-
this.keyboardProtocolLateResponsePending = true;
|
|
199
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
200
|
-
this.clearKeyboardProtocolFallbackTimer();
|
|
201
|
-
this.enableModifyOtherKeys();
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
readKeyboardProtocolNegotiationSequence(sequence, allowBareEscapePrefix) {
|
|
205
|
-
if (this.keyboardProtocolNegotiationBuffer) {
|
|
206
|
-
const bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;
|
|
207
|
-
const negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);
|
|
208
|
-
if (negotiationSequence) {
|
|
209
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
210
|
-
return negotiationSequence;
|
|
211
|
-
}
|
|
212
|
-
if (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence, allowBareEscapePrefix)) {
|
|
213
|
-
this.setKeyboardProtocolNegotiationBuffer(bufferedSequence);
|
|
214
|
-
return "pending";
|
|
215
|
-
}
|
|
216
|
-
this.flushKeyboardProtocolNegotiationBufferAsInput();
|
|
217
|
-
}
|
|
218
|
-
const negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);
|
|
219
|
-
if (negotiationSequence)
|
|
220
|
-
return negotiationSequence;
|
|
221
|
-
if (isKeyboardProtocolNegotiationSequencePrefix(sequence, allowBareEscapePrefix)) {
|
|
222
|
-
this.setKeyboardProtocolNegotiationBuffer(sequence);
|
|
223
|
-
return "pending";
|
|
224
|
-
}
|
|
225
|
-
return undefined;
|
|
226
|
-
}
|
|
227
|
-
setKeyboardProtocolNegotiationBuffer(sequence) {
|
|
228
|
-
this.clearKeyboardProtocolNegotiationBufferFlushTimer();
|
|
229
|
-
this.keyboardProtocolNegotiationBuffer = sequence;
|
|
230
|
-
}
|
|
231
|
-
clearKeyboardProtocolNegotiationBuffer() {
|
|
232
|
-
this.clearKeyboardProtocolNegotiationBufferFlushTimer();
|
|
233
|
-
this.keyboardProtocolNegotiationBuffer = "";
|
|
234
|
-
}
|
|
235
|
-
flushKeyboardProtocolNegotiationBufferAsInput() {
|
|
236
|
-
if (!this.keyboardProtocolNegotiationBuffer)
|
|
237
|
-
return;
|
|
238
|
-
const sequence = this.keyboardProtocolNegotiationBuffer;
|
|
239
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
240
|
-
this.forwardInputSequence(sequence);
|
|
241
|
-
}
|
|
242
|
-
scheduleKeyboardProtocolNegotiationBufferFlush() {
|
|
243
|
-
if (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer)
|
|
244
|
-
return;
|
|
245
|
-
this.keyboardProtocolBufferFlushTimer = setTimeout(() => {
|
|
246
|
-
this.keyboardProtocolBufferFlushTimer = undefined;
|
|
247
|
-
this.flushKeyboardProtocolNegotiationBufferAsInput();
|
|
248
|
-
}, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);
|
|
249
|
-
}
|
|
250
|
-
clearKeyboardProtocolNegotiationBufferFlushTimer() {
|
|
251
|
-
if (!this.keyboardProtocolBufferFlushTimer)
|
|
252
|
-
return;
|
|
253
|
-
clearTimeout(this.keyboardProtocolBufferFlushTimer);
|
|
254
|
-
this.keyboardProtocolBufferFlushTimer = undefined;
|
|
255
|
-
}
|
|
256
|
-
forwardInputSequence(sequence) {
|
|
257
|
-
if (!this.inputHandler)
|
|
258
|
-
return;
|
|
259
|
-
const isAppleTerminal = sequence === "\r" && isAppleTerminalSession();
|
|
260
|
-
const input = normalizeAppleTerminalInput(sequence, isAppleTerminal, isAppleTerminal && isNativeModifierPressed("shift"));
|
|
261
|
-
this.inputHandler(input);
|
|
262
|
-
}
|
|
263
|
-
enableModifyOtherKeys() {
|
|
264
|
-
if (this._kittyProtocolActive || this._modifyOtherKeysActive)
|
|
265
|
-
return;
|
|
266
|
-
process.stdout.write("\x1b[>4;2m");
|
|
267
|
-
this._modifyOtherKeysActive = true;
|
|
268
|
-
}
|
|
269
|
-
clearKeyboardProtocolFallbackTimer() {
|
|
270
|
-
if (!this.keyboardProtocolFallbackTimer)
|
|
271
|
-
return;
|
|
272
|
-
clearTimeout(this.keyboardProtocolFallbackTimer);
|
|
273
|
-
this.keyboardProtocolFallbackTimer = undefined;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin
|
|
277
|
-
* console handle so the terminal sends VT sequences for modified keys
|
|
278
|
-
* (e.g. \x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW
|
|
279
|
-
* discards modifier state and Shift+Tab arrives as plain \t.
|
|
280
|
-
*/
|
|
281
|
-
enableWindowsVTInput() {
|
|
282
|
-
if (process.platform !== "win32")
|
|
283
|
-
return;
|
|
284
|
-
try {
|
|
285
|
-
const arch = process.arch;
|
|
286
|
-
if (arch !== "x64" && arch !== "arm64")
|
|
287
|
-
return;
|
|
288
|
-
// Dynamic require so non-Windows and bundled/browser paths never load the
|
|
289
|
-
// native helper. In the npm package native/ is next to dist/; in compiled
|
|
290
|
-
// binary archives native/ is copied next to the executable.
|
|
291
|
-
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
292
|
-
const nativePath = path.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
|
|
293
|
-
const candidates = [
|
|
294
|
-
path.join(moduleDir, "..", nativePath),
|
|
295
|
-
path.join(moduleDir, nativePath),
|
|
296
|
-
path.join(path.dirname(process.execPath), nativePath),
|
|
297
|
-
];
|
|
298
|
-
for (const modulePath of candidates) {
|
|
299
|
-
try {
|
|
300
|
-
const helper = cjsRequire(modulePath);
|
|
301
|
-
helper.enableVirtualTerminalInput?.();
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
catch {
|
|
305
|
-
// Try the next possible packaging location.
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
catch {
|
|
310
|
-
// Native helper not available — Shift+Tab won't be distinguishable from Tab.
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
async drainInput(maxMs = 1000, idleMs = 50) {
|
|
314
|
-
const shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;
|
|
315
|
-
this.keyboardProtocolLateResponsePending = false;
|
|
316
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
317
|
-
this.clearKeyboardProtocolFallbackTimer();
|
|
318
|
-
if (shouldDisableKittyProtocol) {
|
|
319
|
-
// Disable Kitty keyboard protocol first so any late key releases
|
|
320
|
-
// do not generate new Kitty escape sequences.
|
|
321
|
-
process.stdout.write("\x1b[<u");
|
|
322
|
-
this.keyboardProtocolPushed = false;
|
|
323
|
-
this._kittyProtocolActive = false;
|
|
324
|
-
setKittyProtocolActive(false);
|
|
325
|
-
}
|
|
326
|
-
this.keyboardProtocolNegotiationPending = false;
|
|
327
|
-
if (this._modifyOtherKeysActive) {
|
|
328
|
-
process.stdout.write("\x1b[>4;0m");
|
|
329
|
-
this._modifyOtherKeysActive = false;
|
|
330
|
-
}
|
|
331
|
-
const previousHandler = this.inputHandler;
|
|
332
|
-
this.inputHandler = undefined;
|
|
333
|
-
let lastDataTime = Date.now();
|
|
334
|
-
const onData = () => {
|
|
335
|
-
lastDataTime = Date.now();
|
|
336
|
-
};
|
|
337
|
-
process.stdin.on("data", onData);
|
|
338
|
-
const endTime = Date.now() + maxMs;
|
|
339
|
-
try {
|
|
340
|
-
while (true) {
|
|
341
|
-
const now = Date.now();
|
|
342
|
-
const timeLeft = endTime - now;
|
|
343
|
-
if (timeLeft <= 0)
|
|
344
|
-
break;
|
|
345
|
-
if (now - lastDataTime >= idleMs)
|
|
346
|
-
break;
|
|
347
|
-
await new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
finally {
|
|
351
|
-
process.stdin.removeListener("data", onData);
|
|
352
|
-
this.inputHandler = previousHandler;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
stop() {
|
|
356
|
-
if (this.clearProgressInterval()) {
|
|
357
|
-
process.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);
|
|
358
|
-
}
|
|
359
|
-
// Disable bracketed paste mode
|
|
360
|
-
process.stdout.write("\x1b[?2004l");
|
|
361
|
-
const shouldDisableKittyProtocol = this.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;
|
|
362
|
-
this.keyboardProtocolLateResponsePending = false;
|
|
363
|
-
this.clearKeyboardProtocolNegotiationBuffer();
|
|
364
|
-
this.clearKeyboardProtocolFallbackTimer();
|
|
365
|
-
// Disable Kitty keyboard protocol if not already done by drainInput()
|
|
366
|
-
if (shouldDisableKittyProtocol) {
|
|
367
|
-
process.stdout.write("\x1b[<u");
|
|
368
|
-
this.keyboardProtocolPushed = false;
|
|
369
|
-
this._kittyProtocolActive = false;
|
|
370
|
-
setKittyProtocolActive(false);
|
|
371
|
-
}
|
|
372
|
-
this.keyboardProtocolNegotiationPending = false;
|
|
373
|
-
if (this._modifyOtherKeysActive) {
|
|
374
|
-
process.stdout.write("\x1b[>4;0m");
|
|
375
|
-
this._modifyOtherKeysActive = false;
|
|
376
|
-
}
|
|
377
|
-
// Clean up StdinBuffer
|
|
378
|
-
if (this.stdinBuffer) {
|
|
379
|
-
this.stdinBuffer.destroy();
|
|
380
|
-
this.stdinBuffer = undefined;
|
|
381
|
-
}
|
|
382
|
-
// Remove event handlers
|
|
383
|
-
if (this.stdinDataHandler) {
|
|
384
|
-
process.stdin.removeListener("data", this.stdinDataHandler);
|
|
385
|
-
this.stdinDataHandler = undefined;
|
|
386
|
-
}
|
|
387
|
-
this.inputHandler = undefined;
|
|
388
|
-
if (this.resizeHandler) {
|
|
389
|
-
process.stdout.removeListener("resize", this.resizeHandler);
|
|
390
|
-
this.resizeHandler = undefined;
|
|
391
|
-
}
|
|
392
|
-
// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being
|
|
393
|
-
// re-interpreted after raw mode is disabled. This fixes a race condition
|
|
394
|
-
// where Ctrl+D could close the parent shell over SSH.
|
|
395
|
-
process.stdin.pause();
|
|
396
|
-
// Restore raw mode state
|
|
397
|
-
if (process.stdin.setRawMode) {
|
|
398
|
-
process.stdin.setRawMode(this.wasRaw);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
write(data) {
|
|
402
|
-
process.stdout.write(data);
|
|
403
|
-
if (this.writeLogPath) {
|
|
404
|
-
try {
|
|
405
|
-
fs.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
|
|
406
|
-
}
|
|
407
|
-
catch {
|
|
408
|
-
// Ignore logging errors
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
get columns() {
|
|
413
|
-
return process.stdout.columns || Number(process.env.COLUMNS) || 80;
|
|
414
|
-
}
|
|
415
|
-
get rows() {
|
|
416
|
-
return process.stdout.rows || Number(process.env.LINES) || 24;
|
|
417
|
-
}
|
|
418
|
-
moveBy(lines) {
|
|
419
|
-
if (lines > 0) {
|
|
420
|
-
// Move down
|
|
421
|
-
process.stdout.write(`\x1b[${lines}B`);
|
|
422
|
-
}
|
|
423
|
-
else if (lines < 0) {
|
|
424
|
-
// Move up
|
|
425
|
-
process.stdout.write(`\x1b[${-lines}A`);
|
|
426
|
-
}
|
|
427
|
-
// lines === 0: no movement
|
|
428
|
-
}
|
|
429
|
-
hideCursor() {
|
|
430
|
-
process.stdout.write("\x1b[?25l");
|
|
431
|
-
}
|
|
432
|
-
showCursor() {
|
|
433
|
-
process.stdout.write("\x1b[?25h");
|
|
434
|
-
}
|
|
435
|
-
clearLine() {
|
|
436
|
-
process.stdout.write("\x1b[K");
|
|
437
|
-
}
|
|
438
|
-
clearFromCursor() {
|
|
439
|
-
process.stdout.write("\x1b[J");
|
|
440
|
-
}
|
|
441
|
-
clearScreen() {
|
|
442
|
-
process.stdout.write("\x1b[2J\x1b[H"); // Clear screen and move to home (1,1)
|
|
443
|
-
}
|
|
444
|
-
setTitle(title) {
|
|
445
|
-
// OSC 0;title BEL - set terminal window title
|
|
446
|
-
process.stdout.write(`\x1b]0;${title}\x07`);
|
|
447
|
-
}
|
|
448
|
-
setProgress(active) {
|
|
449
|
-
if (active) {
|
|
450
|
-
// OSC 9;4;3 - indeterminate progress
|
|
451
|
-
process.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);
|
|
452
|
-
if (!this.progressInterval) {
|
|
453
|
-
this.progressInterval = setInterval(() => {
|
|
454
|
-
process.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);
|
|
455
|
-
}, TERMINAL_PROGRESS_KEEPALIVE_MS);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
this.clearProgressInterval();
|
|
460
|
-
// OSC 9;4;0 - clear progress
|
|
461
|
-
process.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
clearProgressInterval() {
|
|
465
|
-
if (!this.progressInterval)
|
|
466
|
-
return false;
|
|
467
|
-
clearInterval(this.progressInterval);
|
|
468
|
-
this.progressInterval = undefined;
|
|
469
|
-
return true;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
//# sourceMappingURL=terminal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,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qCAAqC;YACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAC5B,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;oBACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;gBAAA,CACxD,EAAE,8BAA8B,CAAC,CAAC;YACpC,CAAC;QACF,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC7B,6BAA6B;YAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACxD,CAAC;IAAA,CACD;IAEO,qBAAqB,GAAY;QACxC,IAAI,CAAC,IAAI,CAAC,gBAAgB;YAAE,OAAO,KAAK,CAAC;QACzC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,OAAO,IAAI,CAAC;IAAA,CACZ;CACD","sourcesContent":["import * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { setKittyProtocolActive } from \"./keys.ts\";\nimport { isNativeModifierPressed } from \"./native-modifiers.ts\";\nimport { StdinBuffer } from \"./stdin-buffer.ts\";\n\nconst cjsRequire = createRequire(import.meta.url);\n\nconst TERMINAL_PROGRESS_KEEPALIVE_MS = 1000;\nconst TERMINAL_PROGRESS_ACTIVE_SEQUENCE = \"\\x1b]9;4;3\\x07\";\nconst TERMINAL_PROGRESS_CLEAR_SEQUENCE = \"\\x1b]9;4;0;\\x07\";\nconst APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE = \"\\x1b[13;2u\";\nconst DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS = 7;\nconst KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS = 150;\nconst KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS = 150;\nconst KITTY_KEYBOARD_PROTOCOL_QUERY = `\\x1b[>${DESIRED_KITTY_KEYBOARD_PROTOCOL_FLAGS}u\\x1b[?u\\x1b[c`;\n\nexport type KeyboardProtocolNegotiationSequence =\n\t| { type: \"kitty-flags\"; flags: number }\n\t| { type: \"device-attributes\" };\n\nexport function parseKeyboardProtocolNegotiationSequence(\n\tsequence: string,\n): KeyboardProtocolNegotiationSequence | undefined {\n\tconst kittyFlags = sequence.match(/^\\x1b\\[\\?(\\d+)u$/);\n\tif (kittyFlags) {\n\t\treturn { type: \"kitty-flags\", flags: Number.parseInt(kittyFlags[1]!, 10) };\n\t}\n\tif (/^\\x1b\\[\\?[\\d;]*c$/.test(sequence)) {\n\t\treturn { type: \"device-attributes\" };\n\t}\n\treturn undefined;\n}\n\nfunction isKeyboardProtocolNegotiationSequencePrefix(sequence: string, allowBareEscapePrefix: boolean): boolean {\n\treturn (allowBareEscapePrefix && sequence === \"\\x1b\") || sequence === \"\\x1b[\" || /^\\x1b\\[\\?[\\d;]*$/.test(sequence);\n}\n\nexport function isAppleTerminalSession(): boolean {\n\treturn process.platform === \"darwin\" && process.env.TERM_PROGRAM === \"Apple_Terminal\";\n}\n\nexport function normalizeAppleTerminalInput(data: string, isAppleTerminal: boolean, isShiftPressed: boolean): string {\n\tif (isAppleTerminal && data === \"\\r\" && isShiftPressed) return APPLE_TERMINAL_SHIFT_ENTER_SEQUENCE;\n\treturn data;\n}\n\n/**\n * Minimal terminal interface for TUI\n */\nexport interface Terminal {\n\t// Start the terminal with input and resize handlers\n\tstart(onInput: (data: string) => void, onResize: () => void): void;\n\n\t// Stop the terminal and restore state\n\tstop(): void;\n\n\t/**\n\t * Drain stdin before exiting to prevent Kitty key release events from\n\t * leaking to the parent shell over slow SSH connections.\n\t * @param maxMs - Maximum time to drain (default: 1000ms)\n\t * @param idleMs - Exit early if no input arrives within this time (default: 50ms)\n\t */\n\tdrainInput(maxMs?: number, idleMs?: number): Promise<void>;\n\n\t// Write output to terminal\n\twrite(data: string): void;\n\n\t// Get terminal dimensions\n\tget columns(): number;\n\tget rows(): number;\n\n\t// Whether Kitty keyboard protocol is active\n\tget kittyProtocolActive(): boolean;\n\n\t// Cursor positioning (relative to current position)\n\tmoveBy(lines: number): void; // Move cursor up (negative) or down (positive) by N lines\n\n\t// Cursor visibility\n\thideCursor(): void; // Hide the cursor\n\tshowCursor(): void; // Show the cursor\n\n\t// Clear operations\n\tclearLine(): void; // Clear current line\n\tclearFromCursor(): void; // Clear from cursor to end of screen\n\tclearScreen(): void; // Clear entire screen and move cursor to (0,0)\n\n\t// Title operations\n\tsetTitle(title: string): void; // Set terminal window title\n\n\t// Progress indicator (OSC 9;4)\n\tsetProgress(active: boolean): void;\n}\n\n/**\n * Real terminal using process.stdin/stdout\n */\nexport class ProcessTerminal implements Terminal {\n\tprivate wasRaw = false;\n\tprivate inputHandler?: (data: string) => void;\n\tprivate resizeHandler?: () => void;\n\tprivate _kittyProtocolActive = false;\n\tprivate _modifyOtherKeysActive = false;\n\tprivate keyboardProtocolPushed = false;\n\tprivate keyboardProtocolNegotiationPending = false;\n\tprivate keyboardProtocolLateResponsePending = false;\n\tprivate keyboardProtocolNegotiationBuffer = \"\";\n\tprivate keyboardProtocolFallbackTimer?: ReturnType<typeof setTimeout>;\n\tprivate keyboardProtocolBufferFlushTimer?: ReturnType<typeof setTimeout>;\n\tprivate stdinBuffer?: StdinBuffer;\n\tprivate stdinDataHandler?: (data: string) => void;\n\tprivate progressInterval?: ReturnType<typeof setInterval>;\n\tprivate writeLogPath = (() => {\n\t\tconst env = process.env.PI_TUI_WRITE_LOG || \"\";\n\t\tif (!env) return \"\";\n\t\ttry {\n\t\t\tif (fs.statSync(env).isDirectory()) {\n\t\t\t\tconst now = new Date();\n\t\t\t\tconst ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\n\t\t\t\treturn path.join(env, `tui-${ts}-${process.pid}.log`);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Not an existing directory - use as-is (file path)\n\t\t}\n\t\treturn env;\n\t})();\n\n\tget kittyProtocolActive(): boolean {\n\t\treturn this._kittyProtocolActive;\n\t}\n\n\tstart(onInput: (data: string) => void, onResize: () => void): void {\n\t\tthis.inputHandler = onInput;\n\t\tthis.resizeHandler = onResize;\n\n\t\t// Save previous state and enable raw mode\n\t\tthis.wasRaw = process.stdin.isRaw || false;\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(true);\n\t\t}\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.resume();\n\n\t\t// Enable bracketed paste mode - terminal will wrap pastes in \\x1b[200~ ... \\x1b[201~\n\t\tprocess.stdout.write(\"\\x1b[?2004h\");\n\n\t\t// Set up resize handler immediately\n\t\tprocess.stdout.on(\"resize\", this.resizeHandler);\n\n\t\t// Refresh terminal dimensions - they may be stale after suspend/resume\n\t\t// (SIGWINCH is lost while process is stopped). Unix only.\n\t\tif (process.platform !== \"win32\") {\n\t\t\tprocess.kill(process.pid, \"SIGWINCH\");\n\t\t}\n\n\t\t// On Windows, enable ENABLE_VIRTUAL_TERMINAL_INPUT so the console sends\n\t\t// VT escape sequences (e.g. \\x1b[Z for Shift+Tab) instead of raw console\n\t\t// events that lose modifier information. Must run AFTER setRawMode(true)\n\t\t// since that resets console mode flags.\n\t\tthis.enableWindowsVTInput();\n\n\t\t// Query and enable Kitty keyboard protocol\n\t\t// The query handler intercepts input temporarily, then installs the user's handler\n\t\t// See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/\n\t\tthis.queryAndEnableKittyProtocol();\n\t}\n\n\t/**\n\t * Set up StdinBuffer to split batched input into individual sequences.\n\t * This ensures components receive single events, making matchesKey/isKeyRelease work correctly.\n\t *\n\t * Also watches for Kitty protocol response and enables it when detected.\n\t * This is done here (after stdinBuffer parsing) rather than on raw stdin\n\t * to handle the case where the response arrives split across multiple events.\n\t */\n\tprivate setupStdinBuffer(): void {\n\t\tthis.stdinBuffer = new StdinBuffer({ timeout: 10 });\n\n\t\t// Forward individual sequences to the input handler\n\t\tthis.stdinBuffer.on(\"data\", (sequence) => {\n\t\t\tif (this.keyboardProtocolNegotiationPending) {\n\t\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, true);\n\t\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\t\treturn; // Wait for the rest of a split negotiation response.\n\t\t\t\t}\n\t\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.keyboardProtocolLateResponsePending) {\n\t\t\t\tconst negotiationSequence = this.readKeyboardProtocolNegotiationSequence(sequence, false);\n\t\t\t\tif (negotiationSequence === \"pending\") {\n\t\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t\t\treturn; // Wait for the rest of a split late negotiation response.\n\t\t\t\t}\n\t\t\t\tif (this.handleKeyboardProtocolNegotiationSequence(negotiationSequence)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.forwardInputSequence(sequence);\n\t\t});\n\n\t\t// Re-wrap paste content with bracketed paste markers for existing editor handling\n\t\tthis.stdinBuffer.on(\"paste\", (content) => {\n\t\t\tif (this.inputHandler) {\n\t\t\t\tthis.inputHandler(`\\x1b[200~${content}\\x1b[201~`);\n\t\t\t}\n\t\t});\n\n\t\t// Handler that pipes stdin data through the buffer\n\t\tthis.stdinDataHandler = (data: string) => {\n\t\t\tthis.stdinBuffer!.process(data);\n\t\t};\n\t}\n\n\t/**\n\t * Query terminal for Kitty keyboard protocol support and enable it if available.\n\t *\n\t * Kitty's progressive enhancement detection requires requesting the desired\n\t * flags before querying them. The trailing DA query is a sentinel supported by\n\t * terminals that do not know Kitty keyboard protocol. A short timeout remains\n\t * as a backup for terminals, PTYs, and SSH sessions that delay, split, or drop\n\t * the DA response.\n\t *\n\t * The requested flags are:\n\t * - 1 = disambiguate escape codes\n\t * - 2 = report event types (press/repeat/release)\n\t * - 4 = report alternate keys (shifted key, base layout key)\n\t */\n\tprivate queryAndEnableKittyProtocol(): void {\n\t\tthis.setupStdinBuffer();\n\t\tprocess.stdin.on(\"data\", this.stdinDataHandler!);\n\t\tthis.keyboardProtocolPushed = true;\n\t\tthis.keyboardProtocolNegotiationPending = true;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tprocess.stdout.write(KITTY_KEYBOARD_PROTOCOL_QUERY);\n\t\tthis.keyboardProtocolFallbackTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolFallbackTimer = undefined;\n\t\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\t\tif (this.keyboardProtocolNegotiationBuffer === \"\\x1b\") {\n\t\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t\t} else {\n\t\t\t\tthis.scheduleKeyboardProtocolNegotiationBufferFlush();\n\t\t\t}\n\t\t\tthis.enableModifyOtherKeys();\n\t\t}, KITTY_KEYBOARD_PROTOCOL_FALLBACK_TIMEOUT_MS);\n\t}\n\n\tprivate handleKeyboardProtocolNegotiationSequence(\n\t\tnegotiationSequence: KeyboardProtocolNegotiationSequence | undefined,\n\t): boolean {\n\t\tif (!negotiationSequence) return false;\n\t\tif (negotiationSequence.type === \"kitty-flags\") {\n\t\t\tif (negotiationSequence.flags !== 0 && !this._kittyProtocolActive) {\n\t\t\t\tthis._kittyProtocolActive = true;\n\t\t\t\tsetKittyProtocolActive(true);\n\t\t\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\t\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tthis.keyboardProtocolLateResponsePending = true;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\tthis.enableModifyOtherKeys();\n\t\treturn true;\n\t}\n\n\tprivate readKeyboardProtocolNegotiationSequence(\n\t\tsequence: string,\n\t\tallowBareEscapePrefix: boolean,\n\t): KeyboardProtocolNegotiationSequence | \"pending\" | undefined {\n\t\tif (this.keyboardProtocolNegotiationBuffer) {\n\t\t\tconst bufferedSequence = this.keyboardProtocolNegotiationBuffer + sequence;\n\t\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(bufferedSequence);\n\t\t\tif (negotiationSequence) {\n\t\t\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\t\t\treturn negotiationSequence;\n\t\t\t}\n\t\t\tif (isKeyboardProtocolNegotiationSequencePrefix(bufferedSequence, allowBareEscapePrefix)) {\n\t\t\t\tthis.setKeyboardProtocolNegotiationBuffer(bufferedSequence);\n\t\t\t\treturn \"pending\";\n\t\t\t}\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}\n\n\t\tconst negotiationSequence = parseKeyboardProtocolNegotiationSequence(sequence);\n\t\tif (negotiationSequence) return negotiationSequence;\n\t\tif (isKeyboardProtocolNegotiationSequencePrefix(sequence, allowBareEscapePrefix)) {\n\t\t\tthis.setKeyboardProtocolNegotiationBuffer(sequence);\n\t\t\treturn \"pending\";\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate setKeyboardProtocolNegotiationBuffer(sequence: string): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = sequence;\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBuffer(): void {\n\t\tthis.clearKeyboardProtocolNegotiationBufferFlushTimer();\n\t\tthis.keyboardProtocolNegotiationBuffer = \"\";\n\t}\n\n\tprivate flushKeyboardProtocolNegotiationBufferAsInput(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer) return;\n\t\tconst sequence = this.keyboardProtocolNegotiationBuffer;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.forwardInputSequence(sequence);\n\t}\n\n\tprivate scheduleKeyboardProtocolNegotiationBufferFlush(): void {\n\t\tif (!this.keyboardProtocolNegotiationBuffer || this.keyboardProtocolBufferFlushTimer) return;\n\t\tthis.keyboardProtocolBufferFlushTimer = setTimeout(() => {\n\t\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t\t\tthis.flushKeyboardProtocolNegotiationBufferAsInput();\n\t\t}, KEYBOARD_PROTOCOL_RESPONSE_FRAGMENT_TIMEOUT_MS);\n\t}\n\n\tprivate clearKeyboardProtocolNegotiationBufferFlushTimer(): void {\n\t\tif (!this.keyboardProtocolBufferFlushTimer) return;\n\t\tclearTimeout(this.keyboardProtocolBufferFlushTimer);\n\t\tthis.keyboardProtocolBufferFlushTimer = undefined;\n\t}\n\n\tprivate forwardInputSequence(sequence: string): void {\n\t\tif (!this.inputHandler) return;\n\t\tconst isAppleTerminal = sequence === \"\\r\" && isAppleTerminalSession();\n\t\tconst input = normalizeAppleTerminalInput(\n\t\t\tsequence,\n\t\t\tisAppleTerminal,\n\t\t\tisAppleTerminal && isNativeModifierPressed(\"shift\"),\n\t\t);\n\t\tthis.inputHandler(input);\n\t}\n\n\tprivate enableModifyOtherKeys(): void {\n\t\tif (this._kittyProtocolActive || this._modifyOtherKeysActive) return;\n\t\tprocess.stdout.write(\"\\x1b[>4;2m\");\n\t\tthis._modifyOtherKeysActive = true;\n\t}\n\n\tprivate clearKeyboardProtocolFallbackTimer(): void {\n\t\tif (!this.keyboardProtocolFallbackTimer) return;\n\t\tclearTimeout(this.keyboardProtocolFallbackTimer);\n\t\tthis.keyboardProtocolFallbackTimer = undefined;\n\t}\n\n\t/**\n\t * On Windows, add ENABLE_VIRTUAL_TERMINAL_INPUT (0x0200) to the stdin\n\t * console handle so the terminal sends VT sequences for modified keys\n\t * (e.g. \\x1b[Z for Shift+Tab). Without this, libuv's ReadConsoleInputW\n\t * discards modifier state and Shift+Tab arrives as plain \\t.\n\t */\n\tprivate enableWindowsVTInput(): void {\n\t\tif (process.platform !== \"win32\") return;\n\t\ttry {\n\t\t\tconst arch = process.arch;\n\t\t\tif (arch !== \"x64\" && arch !== \"arm64\") return;\n\n\t\t\t// Dynamic require so non-Windows and bundled/browser paths never load the\n\t\t\t// native helper. In the npm package native/ is next to dist/; in compiled\n\t\t\t// binary archives native/ is copied next to the executable.\n\t\t\tconst moduleDir = path.dirname(fileURLToPath(import.meta.url));\n\t\t\tconst nativePath = path.join(\"native\", \"win32\", \"prebuilds\", `win32-${arch}`, \"win32-console-mode.node\");\n\t\t\tconst candidates = [\n\t\t\t\tpath.join(moduleDir, \"..\", nativePath),\n\t\t\t\tpath.join(moduleDir, nativePath),\n\t\t\t\tpath.join(path.dirname(process.execPath), nativePath),\n\t\t\t];\n\t\t\tfor (const modulePath of candidates) {\n\t\t\t\ttry {\n\t\t\t\t\tconst helper = cjsRequire(modulePath) as { enableVirtualTerminalInput?: () => boolean };\n\t\t\t\t\thelper.enableVirtualTerminalInput?.();\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// Try the next possible packaging location.\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\t// Native helper not available — Shift+Tab won't be distinguishable from Tab.\n\t\t}\n\t}\n\n\tasync drainInput(maxMs = 1000, idleMs = 50): Promise<void> {\n\t\tconst shouldDisableKittyProtocol =\n\t\t\tthis.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\t// Disable Kitty keyboard protocol first so any late key releases\n\t\t\t// do not generate new Kitty escape sequences.\n\t\t\tprocess.stdout.write(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tif (this._modifyOtherKeysActive) {\n\t\t\tprocess.stdout.write(\"\\x1b[>4;0m\");\n\t\t\tthis._modifyOtherKeysActive = false;\n\t\t}\n\n\t\tconst previousHandler = this.inputHandler;\n\t\tthis.inputHandler = undefined;\n\n\t\tlet lastDataTime = Date.now();\n\t\tconst onData = () => {\n\t\t\tlastDataTime = Date.now();\n\t\t};\n\n\t\tprocess.stdin.on(\"data\", onData);\n\t\tconst endTime = Date.now() + maxMs;\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst now = Date.now();\n\t\t\t\tconst timeLeft = endTime - now;\n\t\t\t\tif (timeLeft <= 0) break;\n\t\t\t\tif (now - lastDataTime >= idleMs) break;\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, Math.min(idleMs, timeLeft)));\n\t\t\t}\n\t\t} finally {\n\t\t\tprocess.stdin.removeListener(\"data\", onData);\n\t\t\tthis.inputHandler = previousHandler;\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tif (this.clearProgressInterval()) {\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\n\t\t// Disable bracketed paste mode\n\t\tprocess.stdout.write(\"\\x1b[?2004l\");\n\n\t\tconst shouldDisableKittyProtocol =\n\t\t\tthis.keyboardProtocolPushed || this._kittyProtocolActive || this.keyboardProtocolNegotiationPending;\n\t\tthis.keyboardProtocolLateResponsePending = false;\n\t\tthis.clearKeyboardProtocolNegotiationBuffer();\n\t\tthis.clearKeyboardProtocolFallbackTimer();\n\n\t\t// Disable Kitty keyboard protocol if not already done by drainInput()\n\t\tif (shouldDisableKittyProtocol) {\n\t\t\tprocess.stdout.write(\"\\x1b[<u\");\n\t\t\tthis.keyboardProtocolPushed = false;\n\t\t\tthis._kittyProtocolActive = false;\n\t\t\tsetKittyProtocolActive(false);\n\t\t}\n\t\tthis.keyboardProtocolNegotiationPending = false;\n\t\tif (this._modifyOtherKeysActive) {\n\t\t\tprocess.stdout.write(\"\\x1b[>4;0m\");\n\t\t\tthis._modifyOtherKeysActive = false;\n\t\t}\n\n\t\t// Clean up StdinBuffer\n\t\tif (this.stdinBuffer) {\n\t\t\tthis.stdinBuffer.destroy();\n\t\t\tthis.stdinBuffer = undefined;\n\t\t}\n\n\t\t// Remove event handlers\n\t\tif (this.stdinDataHandler) {\n\t\t\tprocess.stdin.removeListener(\"data\", this.stdinDataHandler);\n\t\t\tthis.stdinDataHandler = undefined;\n\t\t}\n\t\tthis.inputHandler = undefined;\n\t\tif (this.resizeHandler) {\n\t\t\tprocess.stdout.removeListener(\"resize\", this.resizeHandler);\n\t\t\tthis.resizeHandler = undefined;\n\t\t}\n\n\t\t// Pause stdin to prevent any buffered input (e.g., Ctrl+D) from being\n\t\t// re-interpreted after raw mode is disabled. This fixes a race condition\n\t\t// where Ctrl+D could close the parent shell over SSH.\n\t\tprocess.stdin.pause();\n\n\t\t// Restore raw mode state\n\t\tif (process.stdin.setRawMode) {\n\t\t\tprocess.stdin.setRawMode(this.wasRaw);\n\t\t}\n\t}\n\n\twrite(data: string): void {\n\t\tprocess.stdout.write(data);\n\t\tif (this.writeLogPath) {\n\t\t\ttry {\n\t\t\t\tfs.appendFileSync(this.writeLogPath, data, { encoding: \"utf8\" });\n\t\t\t} catch {\n\t\t\t\t// Ignore logging errors\n\t\t\t}\n\t\t}\n\t}\n\n\tget columns(): number {\n\t\treturn process.stdout.columns || Number(process.env.COLUMNS) || 80;\n\t}\n\n\tget rows(): number {\n\t\treturn process.stdout.rows || Number(process.env.LINES) || 24;\n\t}\n\n\tmoveBy(lines: number): void {\n\t\tif (lines > 0) {\n\t\t\t// Move down\n\t\t\tprocess.stdout.write(`\\x1b[${lines}B`);\n\t\t} else if (lines < 0) {\n\t\t\t// Move up\n\t\t\tprocess.stdout.write(`\\x1b[${-lines}A`);\n\t\t}\n\t\t// lines === 0: no movement\n\t}\n\n\thideCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[?25l\");\n\t}\n\n\tshowCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[?25h\");\n\t}\n\n\tclearLine(): void {\n\t\tprocess.stdout.write(\"\\x1b[K\");\n\t}\n\n\tclearFromCursor(): void {\n\t\tprocess.stdout.write(\"\\x1b[J\");\n\t}\n\n\tclearScreen(): void {\n\t\tprocess.stdout.write(\"\\x1b[2J\\x1b[H\"); // Clear screen and move to home (1,1)\n\t}\n\n\tsetTitle(title: string): void {\n\t\t// OSC 0;title BEL - set terminal window title\n\t\tprocess.stdout.write(`\\x1b]0;${title}\\x07`);\n\t}\n\n\tsetProgress(active: boolean): void {\n\t\tif (active) {\n\t\t\t// OSC 9;4;3 - indeterminate progress\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\tif (!this.progressInterval) {\n\t\t\t\tthis.progressInterval = setInterval(() => {\n\t\t\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_ACTIVE_SEQUENCE);\n\t\t\t\t}, TERMINAL_PROGRESS_KEEPALIVE_MS);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.clearProgressInterval();\n\t\t\t// OSC 9;4;0 - clear progress\n\t\t\tprocess.stdout.write(TERMINAL_PROGRESS_CLEAR_SEQUENCE);\n\t\t}\n\t}\n\n\tprivate clearProgressInterval(): boolean {\n\t\tif (!this.progressInterval) return false;\n\t\tclearInterval(this.progressInterval);\n\t\tthis.progressInterval = undefined;\n\t\treturn true;\n\t}\n}\n"]}
|