@dimivelev/chimera 0.78.1 → 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/npm-shrinkwrap.json +2 -2
- package/package.json +1 -6
- 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,39 +0,0 @@
|
|
|
1
|
-
import { SessionError, } from "../types.js";
|
|
2
|
-
import { Session } from "./session.js";
|
|
3
|
-
import { uuidv7 } from "./uuid.js";
|
|
4
|
-
export function createSessionId() {
|
|
5
|
-
return uuidv7();
|
|
6
|
-
}
|
|
7
|
-
export function createTimestamp() {
|
|
8
|
-
return new Date().toISOString();
|
|
9
|
-
}
|
|
10
|
-
export function toSession(storage) {
|
|
11
|
-
return new Session(storage);
|
|
12
|
-
}
|
|
13
|
-
export function getFileSystemResultOrThrow(result, message) {
|
|
14
|
-
if (!result.ok) {
|
|
15
|
-
const code = result.error.code === "not_found" ? "not_found" : "storage";
|
|
16
|
-
throw new SessionError(code, `${message}: ${result.error.message}`, result.error);
|
|
17
|
-
}
|
|
18
|
-
return result.value;
|
|
19
|
-
}
|
|
20
|
-
export async function getEntriesToFork(storage, options) {
|
|
21
|
-
if (!options.entryId)
|
|
22
|
-
return storage.getEntries();
|
|
23
|
-
const target = await storage.getEntry(options.entryId);
|
|
24
|
-
if (!target) {
|
|
25
|
-
throw new SessionError("invalid_fork_target", `Entry ${options.entryId} not found`);
|
|
26
|
-
}
|
|
27
|
-
let effectiveLeafId;
|
|
28
|
-
if ((options.position ?? "before") === "at") {
|
|
29
|
-
effectiveLeafId = target.id;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
if (target.type !== "message" || target.message.role !== "user") {
|
|
33
|
-
throw new SessionError("invalid_fork_target", `Entry ${options.entryId} is not a user message`);
|
|
34
|
-
}
|
|
35
|
-
effectiveLeafId = target.parentId;
|
|
36
|
-
}
|
|
37
|
-
return storage.getPathToRoot(effectiveLeafId);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=repo-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo-utils.js","sourceRoot":"","sources":["../../../src/harness/session/repo-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,YAAY,GAIZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,UAAU,eAAe,GAAW;IACzC,OAAO,MAAM,EAAE,CAAC;AAAA,CAChB;AAED,MAAM,UAAU,eAAe,GAAW;IACzC,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAAA,CAChC;AAED,MAAM,UAAU,SAAS,CAAoC,OAAkC,EAAsB;IACpH,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;AAAA,CAC5B;AAED,MAAM,UAAU,0BAA0B,CAAS,MAAiC,EAAE,OAAe,EAAU;IAC9G,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,MAAM,IAAI,YAAY,CAAC,IAAI,EAAE,GAAG,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC;AAAA,CACpB;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAAuB,EACvB,OAAyD,EAC3B;IAC9B,IAAI,CAAC,OAAO,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,YAAY,CAAC,qBAAqB,EAAE,SAAS,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,eAA8B,CAAC;IACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7B,CAAC;SAAM,CAAC;QACP,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACjE,MAAM,IAAI,YAAY,CAAC,qBAAqB,EAAE,SAAS,OAAO,CAAC,OAAO,wBAAwB,CAAC,CAAC;QACjG,CAAC;QACD,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;AAAA,CAC9C","sourcesContent":["import {\n\ttype FileError,\n\ttype Result,\n\tSessionError,\n\ttype SessionMetadata,\n\ttype SessionStorage,\n\ttype SessionTreeEntry,\n} from \"../types.ts\";\nimport { Session } from \"./session.ts\";\nimport { uuidv7 } from \"./uuid.ts\";\n\nexport function createSessionId(): string {\n\treturn uuidv7();\n}\n\nexport function createTimestamp(): string {\n\treturn new Date().toISOString();\n}\n\nexport function toSession<TMetadata extends SessionMetadata>(storage: SessionStorage<TMetadata>): Session<TMetadata> {\n\treturn new Session(storage);\n}\n\nexport function getFileSystemResultOrThrow<TValue>(result: Result<TValue, FileError>, message: string): TValue {\n\tif (!result.ok) {\n\t\tconst code = result.error.code === \"not_found\" ? \"not_found\" : \"storage\";\n\t\tthrow new SessionError(code, `${message}: ${result.error.message}`, result.error);\n\t}\n\treturn result.value;\n}\n\nexport async function getEntriesToFork(\n\tstorage: SessionStorage,\n\toptions: { entryId?: string; position?: \"before\" | \"at\" },\n): Promise<SessionTreeEntry[]> {\n\tif (!options.entryId) return storage.getEntries();\n\tconst target = await storage.getEntry(options.entryId);\n\tif (!target) {\n\t\tthrow new SessionError(\"invalid_fork_target\", `Entry ${options.entryId} not found`);\n\t}\n\tlet effectiveLeafId: string | null;\n\tif ((options.position ?? \"before\") === \"at\") {\n\t\teffectiveLeafId = target.id;\n\t} else {\n\t\tif (target.type !== \"message\" || target.message.role !== \"user\") {\n\t\t\tthrow new SessionError(\"invalid_fork_target\", `Entry ${options.entryId} is not a user message`);\n\t\t}\n\t\teffectiveLeafId = target.parentId;\n\t}\n\treturn storage.getPathToRoot(effectiveLeafId);\n}\n"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ImageContent, TextContent } from "@dimivelev/chimera-ai";
|
|
2
|
-
import type { AgentMessage } from "../../types.ts";
|
|
3
|
-
import type { SessionContext, SessionMetadata, SessionStorage, SessionTreeEntry } from "../types.ts";
|
|
4
|
-
export declare function buildSessionContext(pathEntries: SessionTreeEntry[]): SessionContext;
|
|
5
|
-
export declare class Session<TMetadata extends SessionMetadata = SessionMetadata> {
|
|
6
|
-
private storage;
|
|
7
|
-
constructor(storage: SessionStorage<TMetadata>);
|
|
8
|
-
getMetadata(): Promise<TMetadata>;
|
|
9
|
-
getStorage(): SessionStorage<TMetadata>;
|
|
10
|
-
getLeafId(): Promise<string | null>;
|
|
11
|
-
getEntry(id: string): Promise<SessionTreeEntry | undefined>;
|
|
12
|
-
getEntries(): Promise<SessionTreeEntry[]>;
|
|
13
|
-
getBranch(fromId?: string): Promise<SessionTreeEntry[]>;
|
|
14
|
-
buildContext(): Promise<SessionContext>;
|
|
15
|
-
getLabel(id: string): Promise<string | undefined>;
|
|
16
|
-
getSessionName(): Promise<string | undefined>;
|
|
17
|
-
private appendTypedEntry;
|
|
18
|
-
appendMessage(message: AgentMessage): Promise<string>;
|
|
19
|
-
appendThinkingLevelChange(thinkingLevel: string): Promise<string>;
|
|
20
|
-
appendModelChange(provider: string, modelId: string): Promise<string>;
|
|
21
|
-
appendActiveToolsChange(activeToolNames: string[]): Promise<string>;
|
|
22
|
-
appendCompaction<T = unknown>(summary: string, firstKeptEntryId: string, tokensBefore: number, details?: T, fromHook?: boolean): Promise<string>;
|
|
23
|
-
appendCustomEntry(customType: string, data?: unknown): Promise<string>;
|
|
24
|
-
appendCustomMessageEntry<T = unknown>(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details?: T): Promise<string>;
|
|
25
|
-
appendLabel(targetId: string, label: string | undefined): Promise<string>;
|
|
26
|
-
appendSessionName(name: string): Promise<string>;
|
|
27
|
-
moveTo(entryId: string | null, summary?: {
|
|
28
|
-
summary: string;
|
|
29
|
-
details?: unknown;
|
|
30
|
-
fromHook?: boolean;
|
|
31
|
-
}): Promise<string | undefined>;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/harness/session/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EASX,cAAc,EAEd,eAAe,EACf,cAAc,EACd,gBAAgB,EAEhB,MAAM,aAAa,CAAC;AAGrB,wBAAgB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AY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,CAAC,EACX,QAAQ,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,MAAM,CAAC,CAYjB;IAEK,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAS3E;IAEK,wBAAwB,CAAC,CAAC,GAAG,OAAO,EACzC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,CAAC,GACT,OAAO,CAAC,MAAM,CAAC,CAWjB;IAEK,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAY9E;IAEK,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQrD;IAEK,MAAM,CACX,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAClE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB7B;CACD","sourcesContent":["import type { ImageContent, TextContent } from \"@dimivelev/chimera-ai\";\nimport type { AgentMessage } from \"../../types.ts\";\nimport { createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage } from \"../messages.ts\";\nimport type {\n\tActiveToolsChangeEntry,\n\tBranchSummaryEntry,\n\tCompactionEntry,\n\tCustomEntry,\n\tCustomMessageEntry,\n\tLabelEntry,\n\tMessageEntry,\n\tModelChangeEntry,\n\tSessionContext,\n\tSessionInfoEntry,\n\tSessionMetadata,\n\tSessionStorage,\n\tSessionTreeEntry,\n\tThinkingLevelChangeEntry,\n} from \"../types.ts\";\nimport { SessionError } from \"../types.ts\";\n\nexport function buildSessionContext(pathEntries: SessionTreeEntry[]): SessionContext {\n\tlet thinkingLevel = \"off\";\n\tlet model: { provider: string; modelId: string } | null = null;\n\tlet activeToolNames: string[] | null = null;\n\tlet compaction: CompactionEntry | null = null;\n\n\tfor (const entry of pathEntries) {\n\t\tif (entry.type === \"thinking_level_change\") {\n\t\t\tthinkingLevel = entry.thinkingLevel;\n\t\t} else if (entry.type === \"model_change\") {\n\t\t\tmodel = { provider: entry.provider, modelId: entry.modelId };\n\t\t} else if (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tmodel = { provider: entry.message.provider, modelId: entry.message.model };\n\t\t} else if (entry.type === \"active_tools_change\") {\n\t\t\tactiveToolNames = [...entry.activeToolNames];\n\t\t} else if (entry.type === \"compaction\") {\n\t\t\tcompaction = entry;\n\t\t}\n\t}\n\n\tconst messages: AgentMessage[] = [];\n\tconst appendMessage = (entry: SessionTreeEntry) => {\n\t\tif (entry.type === \"message\") {\n\t\t\tmessages.push(entry.message as AgentMessage);\n\t\t} else if (entry.type === \"custom_message\") {\n\t\t\tmessages.push(\n\t\t\t\tcreateCustomMessage(\n\t\t\t\t\tentry.customType,\n\t\t\t\t\tentry.content as string | (TextContent | ImageContent)[],\n\t\t\t\t\tentry.display,\n\t\t\t\t\tentry.details,\n\t\t\t\t\tentry.timestamp,\n\t\t\t\t),\n\t\t\t);\n\t\t} else if (entry.type === \"branch_summary\" && entry.summary) {\n\t\t\tmessages.push(createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp));\n\t\t}\n\t};\n\n\tif (compaction) {\n\t\tmessages.push(createCompactionSummaryMessage(compaction.summary, compaction.tokensBefore, compaction.timestamp));\n\t\tconst compactionIdx = pathEntries.findIndex((e) => e.type === \"compaction\" && e.id === compaction.id);\n\t\tlet foundFirstKept = false;\n\t\tfor (let i = 0; i < compactionIdx; i++) {\n\t\t\tconst entry = pathEntries[i]!;\n\t\t\tif (entry.id === compaction.firstKeptEntryId) foundFirstKept = true;\n\t\t\tif (foundFirstKept) appendMessage(entry);\n\t\t}\n\t\tfor (let i = compactionIdx + 1; i < pathEntries.length; i++) {\n\t\t\tappendMessage(pathEntries[i]!);\n\t\t}\n\t} else {\n\t\tfor (const entry of pathEntries) {\n\t\t\tappendMessage(entry);\n\t\t}\n\t}\n\n\treturn { messages, thinkingLevel, model, activeToolNames };\n}\n\nexport class Session<TMetadata extends SessionMetadata = SessionMetadata> {\n\tprivate storage: SessionStorage<TMetadata>;\n\n\tconstructor(storage: SessionStorage<TMetadata>) {\n\t\tthis.storage = storage;\n\t}\n\n\tgetMetadata(): Promise<TMetadata> {\n\t\treturn this.storage.getMetadata();\n\t}\n\n\tgetStorage(): SessionStorage<TMetadata> {\n\t\treturn this.storage;\n\t}\n\n\tgetLeafId(): Promise<string | null> {\n\t\treturn this.storage.getLeafId();\n\t}\n\n\tgetEntry(id: string): Promise<SessionTreeEntry | undefined> {\n\t\treturn this.storage.getEntry(id);\n\t}\n\n\tgetEntries(): Promise<SessionTreeEntry[]> {\n\t\treturn this.storage.getEntries();\n\t}\n\n\tasync getBranch(fromId?: string): Promise<SessionTreeEntry[]> {\n\t\tconst leafId = fromId ?? (await this.storage.getLeafId());\n\t\treturn this.storage.getPathToRoot(leafId);\n\t}\n\n\tasync buildContext(): Promise<SessionContext> {\n\t\treturn buildSessionContext(await this.getBranch());\n\t}\n\n\tgetLabel(id: string): Promise<string | undefined> {\n\t\treturn this.storage.getLabel(id);\n\t}\n\n\tasync getSessionName(): Promise<string | undefined> {\n\t\tconst entries = await this.storage.findEntries(\"session_info\");\n\t\treturn entries[entries.length - 1]?.name?.trim() || undefined;\n\t}\n\n\tprivate async appendTypedEntry<TEntry extends SessionTreeEntry>(entry: TEntry): Promise<string> {\n\t\tawait this.storage.appendEntry(entry);\n\t\treturn entry.id;\n\t}\n\n\tasync appendMessage(message: AgentMessage): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"message\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tmessage,\n\t\t} satisfies MessageEntry);\n\t}\n\n\tasync appendThinkingLevelChange(thinkingLevel: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"thinking_level_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tthinkingLevel,\n\t\t} satisfies ThinkingLevelChangeEntry);\n\t}\n\n\tasync appendModelChange(provider: string, modelId: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"model_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tprovider,\n\t\t\tmodelId,\n\t\t} satisfies ModelChangeEntry);\n\t}\n\n\tasync appendActiveToolsChange(activeToolNames: string[]): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"active_tools_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tactiveToolNames: [...activeToolNames],\n\t\t} satisfies ActiveToolsChangeEntry);\n\t}\n\n\tasync appendCompaction<T = unknown>(\n\t\tsummary: string,\n\t\tfirstKeptEntryId: string,\n\t\ttokensBefore: number,\n\t\tdetails?: T,\n\t\tfromHook?: boolean,\n\t): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"compaction\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tsummary,\n\t\t\tfirstKeptEntryId,\n\t\t\ttokensBefore,\n\t\t\tdetails,\n\t\t\tfromHook,\n\t\t} satisfies CompactionEntry<T>);\n\t}\n\n\tasync appendCustomEntry(customType: string, data?: unknown): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"custom\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcustomType,\n\t\t\tdata,\n\t\t} satisfies CustomEntry);\n\t}\n\n\tasync appendCustomMessageEntry<T = unknown>(\n\t\tcustomType: string,\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\tdisplay: boolean,\n\t\tdetails?: T,\n\t): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"custom_message\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcustomType,\n\t\t\tcontent,\n\t\t\tdisplay,\n\t\t\tdetails,\n\t\t} satisfies CustomMessageEntry<T>);\n\t}\n\n\tasync appendLabel(targetId: string, label: string | undefined): Promise<string> {\n\t\tif (!(await this.storage.getEntry(targetId))) {\n\t\t\tthrow new SessionError(\"not_found\", `Entry ${targetId} not found`);\n\t\t}\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"label\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\ttargetId,\n\t\t\tlabel,\n\t\t} satisfies LabelEntry);\n\t}\n\n\tasync appendSessionName(name: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"session_info\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tname: name.trim(),\n\t\t} satisfies SessionInfoEntry);\n\t}\n\n\tasync moveTo(\n\t\tentryId: string | null,\n\t\tsummary?: { summary: string; details?: unknown; fromHook?: boolean },\n\t): Promise<string | undefined> {\n\t\tif (entryId !== null && !(await this.storage.getEntry(entryId))) {\n\t\t\tthrow new SessionError(\"not_found\", `Entry ${entryId} not found`);\n\t\t}\n\t\tawait this.storage.setLeafId(entryId);\n\t\tif (!summary) return undefined;\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"branch_summary\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: entryId,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tfromId: entryId ?? \"root\",\n\t\t\tsummary: summary.summary,\n\t\t\tdetails: summary.details,\n\t\t\tfromHook: summary.fromHook,\n\t\t} satisfies BranchSummaryEntry);\n\t}\n}\n"]}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage } from "../messages.js";
|
|
2
|
-
import { SessionError } from "../types.js";
|
|
3
|
-
export function buildSessionContext(pathEntries) {
|
|
4
|
-
let thinkingLevel = "off";
|
|
5
|
-
let model = null;
|
|
6
|
-
let activeToolNames = null;
|
|
7
|
-
let compaction = null;
|
|
8
|
-
for (const entry of pathEntries) {
|
|
9
|
-
if (entry.type === "thinking_level_change") {
|
|
10
|
-
thinkingLevel = entry.thinkingLevel;
|
|
11
|
-
}
|
|
12
|
-
else if (entry.type === "model_change") {
|
|
13
|
-
model = { provider: entry.provider, modelId: entry.modelId };
|
|
14
|
-
}
|
|
15
|
-
else if (entry.type === "message" && entry.message.role === "assistant") {
|
|
16
|
-
model = { provider: entry.message.provider, modelId: entry.message.model };
|
|
17
|
-
}
|
|
18
|
-
else if (entry.type === "active_tools_change") {
|
|
19
|
-
activeToolNames = [...entry.activeToolNames];
|
|
20
|
-
}
|
|
21
|
-
else if (entry.type === "compaction") {
|
|
22
|
-
compaction = entry;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const messages = [];
|
|
26
|
-
const appendMessage = (entry) => {
|
|
27
|
-
if (entry.type === "message") {
|
|
28
|
-
messages.push(entry.message);
|
|
29
|
-
}
|
|
30
|
-
else if (entry.type === "custom_message") {
|
|
31
|
-
messages.push(createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp));
|
|
32
|
-
}
|
|
33
|
-
else if (entry.type === "branch_summary" && entry.summary) {
|
|
34
|
-
messages.push(createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
if (compaction) {
|
|
38
|
-
messages.push(createCompactionSummaryMessage(compaction.summary, compaction.tokensBefore, compaction.timestamp));
|
|
39
|
-
const compactionIdx = pathEntries.findIndex((e) => e.type === "compaction" && e.id === compaction.id);
|
|
40
|
-
let foundFirstKept = false;
|
|
41
|
-
for (let i = 0; i < compactionIdx; i++) {
|
|
42
|
-
const entry = pathEntries[i];
|
|
43
|
-
if (entry.id === compaction.firstKeptEntryId)
|
|
44
|
-
foundFirstKept = true;
|
|
45
|
-
if (foundFirstKept)
|
|
46
|
-
appendMessage(entry);
|
|
47
|
-
}
|
|
48
|
-
for (let i = compactionIdx + 1; i < pathEntries.length; i++) {
|
|
49
|
-
appendMessage(pathEntries[i]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
for (const entry of pathEntries) {
|
|
54
|
-
appendMessage(entry);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return { messages, thinkingLevel, model, activeToolNames };
|
|
58
|
-
}
|
|
59
|
-
export class Session {
|
|
60
|
-
storage;
|
|
61
|
-
constructor(storage) {
|
|
62
|
-
this.storage = storage;
|
|
63
|
-
}
|
|
64
|
-
getMetadata() {
|
|
65
|
-
return this.storage.getMetadata();
|
|
66
|
-
}
|
|
67
|
-
getStorage() {
|
|
68
|
-
return this.storage;
|
|
69
|
-
}
|
|
70
|
-
getLeafId() {
|
|
71
|
-
return this.storage.getLeafId();
|
|
72
|
-
}
|
|
73
|
-
getEntry(id) {
|
|
74
|
-
return this.storage.getEntry(id);
|
|
75
|
-
}
|
|
76
|
-
getEntries() {
|
|
77
|
-
return this.storage.getEntries();
|
|
78
|
-
}
|
|
79
|
-
async getBranch(fromId) {
|
|
80
|
-
const leafId = fromId ?? (await this.storage.getLeafId());
|
|
81
|
-
return this.storage.getPathToRoot(leafId);
|
|
82
|
-
}
|
|
83
|
-
async buildContext() {
|
|
84
|
-
return buildSessionContext(await this.getBranch());
|
|
85
|
-
}
|
|
86
|
-
getLabel(id) {
|
|
87
|
-
return this.storage.getLabel(id);
|
|
88
|
-
}
|
|
89
|
-
async getSessionName() {
|
|
90
|
-
const entries = await this.storage.findEntries("session_info");
|
|
91
|
-
return entries[entries.length - 1]?.name?.trim() || undefined;
|
|
92
|
-
}
|
|
93
|
-
async appendTypedEntry(entry) {
|
|
94
|
-
await this.storage.appendEntry(entry);
|
|
95
|
-
return entry.id;
|
|
96
|
-
}
|
|
97
|
-
async appendMessage(message) {
|
|
98
|
-
return this.appendTypedEntry({
|
|
99
|
-
type: "message",
|
|
100
|
-
id: await this.storage.createEntryId(),
|
|
101
|
-
parentId: await this.storage.getLeafId(),
|
|
102
|
-
timestamp: new Date().toISOString(),
|
|
103
|
-
message,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
async appendThinkingLevelChange(thinkingLevel) {
|
|
107
|
-
return this.appendTypedEntry({
|
|
108
|
-
type: "thinking_level_change",
|
|
109
|
-
id: await this.storage.createEntryId(),
|
|
110
|
-
parentId: await this.storage.getLeafId(),
|
|
111
|
-
timestamp: new Date().toISOString(),
|
|
112
|
-
thinkingLevel,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async appendModelChange(provider, modelId) {
|
|
116
|
-
return this.appendTypedEntry({
|
|
117
|
-
type: "model_change",
|
|
118
|
-
id: await this.storage.createEntryId(),
|
|
119
|
-
parentId: await this.storage.getLeafId(),
|
|
120
|
-
timestamp: new Date().toISOString(),
|
|
121
|
-
provider,
|
|
122
|
-
modelId,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
async appendActiveToolsChange(activeToolNames) {
|
|
126
|
-
return this.appendTypedEntry({
|
|
127
|
-
type: "active_tools_change",
|
|
128
|
-
id: await this.storage.createEntryId(),
|
|
129
|
-
parentId: await this.storage.getLeafId(),
|
|
130
|
-
timestamp: new Date().toISOString(),
|
|
131
|
-
activeToolNames: [...activeToolNames],
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
async appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook) {
|
|
135
|
-
return this.appendTypedEntry({
|
|
136
|
-
type: "compaction",
|
|
137
|
-
id: await this.storage.createEntryId(),
|
|
138
|
-
parentId: await this.storage.getLeafId(),
|
|
139
|
-
timestamp: new Date().toISOString(),
|
|
140
|
-
summary,
|
|
141
|
-
firstKeptEntryId,
|
|
142
|
-
tokensBefore,
|
|
143
|
-
details,
|
|
144
|
-
fromHook,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
async appendCustomEntry(customType, data) {
|
|
148
|
-
return this.appendTypedEntry({
|
|
149
|
-
type: "custom",
|
|
150
|
-
id: await this.storage.createEntryId(),
|
|
151
|
-
parentId: await this.storage.getLeafId(),
|
|
152
|
-
timestamp: new Date().toISOString(),
|
|
153
|
-
customType,
|
|
154
|
-
data,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
async appendCustomMessageEntry(customType, content, display, details) {
|
|
158
|
-
return this.appendTypedEntry({
|
|
159
|
-
type: "custom_message",
|
|
160
|
-
id: await this.storage.createEntryId(),
|
|
161
|
-
parentId: await this.storage.getLeafId(),
|
|
162
|
-
timestamp: new Date().toISOString(),
|
|
163
|
-
customType,
|
|
164
|
-
content,
|
|
165
|
-
display,
|
|
166
|
-
details,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
async appendLabel(targetId, label) {
|
|
170
|
-
if (!(await this.storage.getEntry(targetId))) {
|
|
171
|
-
throw new SessionError("not_found", `Entry ${targetId} not found`);
|
|
172
|
-
}
|
|
173
|
-
return this.appendTypedEntry({
|
|
174
|
-
type: "label",
|
|
175
|
-
id: await this.storage.createEntryId(),
|
|
176
|
-
parentId: await this.storage.getLeafId(),
|
|
177
|
-
timestamp: new Date().toISOString(),
|
|
178
|
-
targetId,
|
|
179
|
-
label,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
async appendSessionName(name) {
|
|
183
|
-
return this.appendTypedEntry({
|
|
184
|
-
type: "session_info",
|
|
185
|
-
id: await this.storage.createEntryId(),
|
|
186
|
-
parentId: await this.storage.getLeafId(),
|
|
187
|
-
timestamp: new Date().toISOString(),
|
|
188
|
-
name: name.trim(),
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
async moveTo(entryId, summary) {
|
|
192
|
-
if (entryId !== null && !(await this.storage.getEntry(entryId))) {
|
|
193
|
-
throw new SessionError("not_found", `Entry ${entryId} not found`);
|
|
194
|
-
}
|
|
195
|
-
await this.storage.setLeafId(entryId);
|
|
196
|
-
if (!summary)
|
|
197
|
-
return undefined;
|
|
198
|
-
return this.appendTypedEntry({
|
|
199
|
-
type: "branch_summary",
|
|
200
|
-
id: await this.storage.createEntryId(),
|
|
201
|
-
parentId: entryId,
|
|
202
|
-
timestamp: new Date().toISOString(),
|
|
203
|
-
fromId: entryId ?? "root",
|
|
204
|
-
summary: summary.summary,
|
|
205
|
-
details: summary.details,
|
|
206
|
-
fromHook: summary.fromHook,
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/harness/session/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAiBjH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,mBAAmB,CAAC,WAA+B,EAAkB;IACpF,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,KAAK,GA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SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;SACU,CAAC,CAAC;IAAA,CAC9B;IAED,KAAK,CAAC,MAAM,CACX,OAAsB,EACtB,OAAoE,EACtC;QAC9B,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,YAAY,CAAC,WAAW,EAAE,SAAS,OAAO,YAAY,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAC/B,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC5B,IAAI,EAAE,gBAAgB;YACtB,EAAE,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YACtC,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,MAAM,EAAE,OAAO,IAAI,MAAM;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SACG,CAAC,CAAC;IAAA,CAChC;CACD","sourcesContent":["import type { ImageContent, TextContent } from \"@dimivelev/chimera-ai\";\nimport type { AgentMessage } from \"../../types.ts\";\nimport { createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage } from \"../messages.ts\";\nimport type {\n\tActiveToolsChangeEntry,\n\tBranchSummaryEntry,\n\tCompactionEntry,\n\tCustomEntry,\n\tCustomMessageEntry,\n\tLabelEntry,\n\tMessageEntry,\n\tModelChangeEntry,\n\tSessionContext,\n\tSessionInfoEntry,\n\tSessionMetadata,\n\tSessionStorage,\n\tSessionTreeEntry,\n\tThinkingLevelChangeEntry,\n} from \"../types.ts\";\nimport { SessionError } from \"../types.ts\";\n\nexport function buildSessionContext(pathEntries: SessionTreeEntry[]): SessionContext {\n\tlet thinkingLevel = \"off\";\n\tlet model: { provider: string; modelId: string } | null = null;\n\tlet activeToolNames: string[] | null = null;\n\tlet compaction: CompactionEntry | null = null;\n\n\tfor (const entry of pathEntries) {\n\t\tif (entry.type === \"thinking_level_change\") {\n\t\t\tthinkingLevel = entry.thinkingLevel;\n\t\t} else if (entry.type === \"model_change\") {\n\t\t\tmodel = { provider: entry.provider, modelId: entry.modelId };\n\t\t} else if (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tmodel = { provider: entry.message.provider, modelId: entry.message.model };\n\t\t} else if (entry.type === \"active_tools_change\") {\n\t\t\tactiveToolNames = [...entry.activeToolNames];\n\t\t} else if (entry.type === \"compaction\") {\n\t\t\tcompaction = entry;\n\t\t}\n\t}\n\n\tconst messages: AgentMessage[] = [];\n\tconst appendMessage = (entry: SessionTreeEntry) => {\n\t\tif (entry.type === \"message\") {\n\t\t\tmessages.push(entry.message as AgentMessage);\n\t\t} else if (entry.type === \"custom_message\") {\n\t\t\tmessages.push(\n\t\t\t\tcreateCustomMessage(\n\t\t\t\t\tentry.customType,\n\t\t\t\t\tentry.content as string | (TextContent | ImageContent)[],\n\t\t\t\t\tentry.display,\n\t\t\t\t\tentry.details,\n\t\t\t\t\tentry.timestamp,\n\t\t\t\t),\n\t\t\t);\n\t\t} else if (entry.type === \"branch_summary\" && entry.summary) {\n\t\t\tmessages.push(createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp));\n\t\t}\n\t};\n\n\tif (compaction) {\n\t\tmessages.push(createCompactionSummaryMessage(compaction.summary, compaction.tokensBefore, compaction.timestamp));\n\t\tconst compactionIdx = pathEntries.findIndex((e) => e.type === \"compaction\" && e.id === compaction.id);\n\t\tlet foundFirstKept = false;\n\t\tfor (let i = 0; i < compactionIdx; i++) {\n\t\t\tconst entry = pathEntries[i]!;\n\t\t\tif (entry.id === compaction.firstKeptEntryId) foundFirstKept = true;\n\t\t\tif (foundFirstKept) appendMessage(entry);\n\t\t}\n\t\tfor (let i = compactionIdx + 1; i < pathEntries.length; i++) {\n\t\t\tappendMessage(pathEntries[i]!);\n\t\t}\n\t} else {\n\t\tfor (const entry of pathEntries) {\n\t\t\tappendMessage(entry);\n\t\t}\n\t}\n\n\treturn { messages, thinkingLevel, model, activeToolNames };\n}\n\nexport class Session<TMetadata extends SessionMetadata = SessionMetadata> {\n\tprivate storage: SessionStorage<TMetadata>;\n\n\tconstructor(storage: SessionStorage<TMetadata>) {\n\t\tthis.storage = storage;\n\t}\n\n\tgetMetadata(): Promise<TMetadata> {\n\t\treturn this.storage.getMetadata();\n\t}\n\n\tgetStorage(): SessionStorage<TMetadata> {\n\t\treturn this.storage;\n\t}\n\n\tgetLeafId(): Promise<string | null> {\n\t\treturn this.storage.getLeafId();\n\t}\n\n\tgetEntry(id: string): Promise<SessionTreeEntry | undefined> {\n\t\treturn this.storage.getEntry(id);\n\t}\n\n\tgetEntries(): Promise<SessionTreeEntry[]> {\n\t\treturn this.storage.getEntries();\n\t}\n\n\tasync getBranch(fromId?: string): Promise<SessionTreeEntry[]> {\n\t\tconst leafId = fromId ?? (await this.storage.getLeafId());\n\t\treturn this.storage.getPathToRoot(leafId);\n\t}\n\n\tasync buildContext(): Promise<SessionContext> {\n\t\treturn buildSessionContext(await this.getBranch());\n\t}\n\n\tgetLabel(id: string): Promise<string | undefined> {\n\t\treturn this.storage.getLabel(id);\n\t}\n\n\tasync getSessionName(): Promise<string | undefined> {\n\t\tconst entries = await this.storage.findEntries(\"session_info\");\n\t\treturn entries[entries.length - 1]?.name?.trim() || undefined;\n\t}\n\n\tprivate async appendTypedEntry<TEntry extends SessionTreeEntry>(entry: TEntry): Promise<string> {\n\t\tawait this.storage.appendEntry(entry);\n\t\treturn entry.id;\n\t}\n\n\tasync appendMessage(message: AgentMessage): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"message\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tmessage,\n\t\t} satisfies MessageEntry);\n\t}\n\n\tasync appendThinkingLevelChange(thinkingLevel: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"thinking_level_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tthinkingLevel,\n\t\t} satisfies ThinkingLevelChangeEntry);\n\t}\n\n\tasync appendModelChange(provider: string, modelId: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"model_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tprovider,\n\t\t\tmodelId,\n\t\t} satisfies ModelChangeEntry);\n\t}\n\n\tasync appendActiveToolsChange(activeToolNames: string[]): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"active_tools_change\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tactiveToolNames: [...activeToolNames],\n\t\t} satisfies ActiveToolsChangeEntry);\n\t}\n\n\tasync appendCompaction<T = unknown>(\n\t\tsummary: string,\n\t\tfirstKeptEntryId: string,\n\t\ttokensBefore: number,\n\t\tdetails?: T,\n\t\tfromHook?: boolean,\n\t): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"compaction\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tsummary,\n\t\t\tfirstKeptEntryId,\n\t\t\ttokensBefore,\n\t\t\tdetails,\n\t\t\tfromHook,\n\t\t} satisfies CompactionEntry<T>);\n\t}\n\n\tasync appendCustomEntry(customType: string, data?: unknown): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"custom\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcustomType,\n\t\t\tdata,\n\t\t} satisfies CustomEntry);\n\t}\n\n\tasync appendCustomMessageEntry<T = unknown>(\n\t\tcustomType: string,\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\tdisplay: boolean,\n\t\tdetails?: T,\n\t): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"custom_message\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tcustomType,\n\t\t\tcontent,\n\t\t\tdisplay,\n\t\t\tdetails,\n\t\t} satisfies CustomMessageEntry<T>);\n\t}\n\n\tasync appendLabel(targetId: string, label: string | undefined): Promise<string> {\n\t\tif (!(await this.storage.getEntry(targetId))) {\n\t\t\tthrow new SessionError(\"not_found\", `Entry ${targetId} not found`);\n\t\t}\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"label\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\ttargetId,\n\t\t\tlabel,\n\t\t} satisfies LabelEntry);\n\t}\n\n\tasync appendSessionName(name: string): Promise<string> {\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"session_info\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: await this.storage.getLeafId(),\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tname: name.trim(),\n\t\t} satisfies SessionInfoEntry);\n\t}\n\n\tasync moveTo(\n\t\tentryId: string | null,\n\t\tsummary?: { summary: string; details?: unknown; fromHook?: boolean },\n\t): Promise<string | undefined> {\n\t\tif (entryId !== null && !(await this.storage.getEntry(entryId))) {\n\t\t\tthrow new SessionError(\"not_found\", `Entry ${entryId} not found`);\n\t\t}\n\t\tawait this.storage.setLeafId(entryId);\n\t\tif (!summary) return undefined;\n\t\treturn this.appendTypedEntry({\n\t\t\ttype: \"branch_summary\",\n\t\t\tid: await this.storage.createEntryId(),\n\t\t\tparentId: entryId,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tfromId: entryId ?? \"root\",\n\t\t\tsummary: summary.summary,\n\t\t\tdetails: summary.details,\n\t\t\tfromHook: summary.fromHook,\n\t\t} satisfies BranchSummaryEntry);\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../src/harness/session/uuid.ts"],"names":[],"mappings":"AAcA,wBAAgB,MAAM,IAAI,MAAM,CAkC/B","sourcesContent":["let lastTimestamp = -Infinity;\nlet sequence = 0;\n\nfunction fillRandomBytes(bytes: Uint8Array): void {\n\tconst crypto = globalThis.crypto;\n\tif (crypto?.getRandomValues) {\n\t\tcrypto.getRandomValues(bytes);\n\t\treturn;\n\t}\n\tfor (let i = 0; i < bytes.length; i++) {\n\t\tbytes[i] = Math.floor(Math.random() * 256);\n\t}\n}\n\nexport function uuidv7(): string {\n\tconst random = new Uint8Array(16);\n\tfillRandomBytes(random);\n\tconst timestamp = Date.now();\n\n\tif (timestamp > lastTimestamp) {\n\t\tsequence = random[6] * 0x1000000 + random[7] * 0x10000 + random[8] * 0x100 + random[9];\n\t\tlastTimestamp = timestamp;\n\t} else {\n\t\tsequence = (sequence + 1) >>> 0;\n\t\tif (sequence === 0) {\n\t\t\tlastTimestamp++;\n\t\t}\n\t}\n\n\tconst bytes = new Uint8Array(16);\n\tbytes[0] = (lastTimestamp / 0x10000000000) & 0xff;\n\tbytes[1] = (lastTimestamp / 0x100000000) & 0xff;\n\tbytes[2] = (lastTimestamp / 0x1000000) & 0xff;\n\tbytes[3] = (lastTimestamp / 0x10000) & 0xff;\n\tbytes[4] = (lastTimestamp / 0x100) & 0xff;\n\tbytes[5] = lastTimestamp & 0xff;\n\tbytes[6] = 0x70 | ((sequence >>> 28) & 0x0f);\n\tbytes[7] = (sequence >>> 20) & 0xff;\n\tbytes[8] = 0x80 | ((sequence >>> 14) & 0x3f);\n\tbytes[9] = (sequence >>> 6) & 0xff;\n\tbytes[10] = ((sequence & 0x3f) << 2) | (random[10] & 0x03);\n\tbytes[11] = random[11];\n\tbytes[12] = random[12];\n\tbytes[13] = random[13];\n\tbytes[14] = random[14];\n\tbytes[15] = random[15];\n\n\treturn formatUuid(bytes);\n}\n\nfunction formatUuid(bytes: Uint8Array): string {\n\tconst hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\"));\n\treturn `${hex.slice(0, 4).join(\"\")}-${hex.slice(4, 6).join(\"\")}-${hex.slice(6, 8).join(\"\")}-${hex.slice(8, 10).join(\"\")}-${hex.slice(10, 16).join(\"\")}`;\n}\n"]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
let lastTimestamp = -Infinity;
|
|
2
|
-
let sequence = 0;
|
|
3
|
-
function fillRandomBytes(bytes) {
|
|
4
|
-
const crypto = globalThis.crypto;
|
|
5
|
-
if (crypto?.getRandomValues) {
|
|
6
|
-
crypto.getRandomValues(bytes);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
10
|
-
bytes[i] = Math.floor(Math.random() * 256);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export function uuidv7() {
|
|
14
|
-
const random = new Uint8Array(16);
|
|
15
|
-
fillRandomBytes(random);
|
|
16
|
-
const timestamp = Date.now();
|
|
17
|
-
if (timestamp > lastTimestamp) {
|
|
18
|
-
sequence = random[6] * 0x1000000 + random[7] * 0x10000 + random[8] * 0x100 + random[9];
|
|
19
|
-
lastTimestamp = timestamp;
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
sequence = (sequence + 1) >>> 0;
|
|
23
|
-
if (sequence === 0) {
|
|
24
|
-
lastTimestamp++;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const bytes = new Uint8Array(16);
|
|
28
|
-
bytes[0] = (lastTimestamp / 0x10000000000) & 0xff;
|
|
29
|
-
bytes[1] = (lastTimestamp / 0x100000000) & 0xff;
|
|
30
|
-
bytes[2] = (lastTimestamp / 0x1000000) & 0xff;
|
|
31
|
-
bytes[3] = (lastTimestamp / 0x10000) & 0xff;
|
|
32
|
-
bytes[4] = (lastTimestamp / 0x100) & 0xff;
|
|
33
|
-
bytes[5] = lastTimestamp & 0xff;
|
|
34
|
-
bytes[6] = 0x70 | ((sequence >>> 28) & 0x0f);
|
|
35
|
-
bytes[7] = (sequence >>> 20) & 0xff;
|
|
36
|
-
bytes[8] = 0x80 | ((sequence >>> 14) & 0x3f);
|
|
37
|
-
bytes[9] = (sequence >>> 6) & 0xff;
|
|
38
|
-
bytes[10] = ((sequence & 0x3f) << 2) | (random[10] & 0x03);
|
|
39
|
-
bytes[11] = random[11];
|
|
40
|
-
bytes[12] = random[12];
|
|
41
|
-
bytes[13] = random[13];
|
|
42
|
-
bytes[14] = random[14];
|
|
43
|
-
bytes[15] = random[15];
|
|
44
|
-
return formatUuid(bytes);
|
|
45
|
-
}
|
|
46
|
-
function formatUuid(bytes) {
|
|
47
|
-
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
|
48
|
-
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10, 16).join("")}`;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=uuid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../src/harness/session/uuid.ts"],"names":[],"mappings":"AAAA,IAAI,aAAa,GAAG,CAAC,QAAQ,CAAC;AAC9B,IA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AG,MAAM,CAAC,EAAE,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAAA,CACzB;AAED,SAAS,UAAU,CAAC,KAAiB,EAAU;IAC9C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5E,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAAA,CACxJ","sourcesContent":["let lastTimestamp = -Infinity;\nlet sequence = 0;\n\nfunction fillRandomBytes(bytes: Uint8Array): void {\n\tconst crypto = globalThis.crypto;\n\tif (crypto?.getRandomValues) {\n\t\tcrypto.getRandomValues(bytes);\n\t\treturn;\n\t}\n\tfor (let i = 0; i < bytes.length; i++) {\n\t\tbytes[i] = Math.floor(Math.random() * 256);\n\t}\n}\n\nexport function uuidv7(): string {\n\tconst random = new Uint8Array(16);\n\tfillRandomBytes(random);\n\tconst timestamp = Date.now();\n\n\tif (timestamp > lastTimestamp) {\n\t\tsequence = random[6] * 0x1000000 + random[7] * 0x10000 + random[8] * 0x100 + random[9];\n\t\tlastTimestamp = timestamp;\n\t} else {\n\t\tsequence = (sequence + 1) >>> 0;\n\t\tif (sequence === 0) {\n\t\t\tlastTimestamp++;\n\t\t}\n\t}\n\n\tconst bytes = new Uint8Array(16);\n\tbytes[0] = (lastTimestamp / 0x10000000000) & 0xff;\n\tbytes[1] = (lastTimestamp / 0x100000000) & 0xff;\n\tbytes[2] = (lastTimestamp / 0x1000000) & 0xff;\n\tbytes[3] = (lastTimestamp / 0x10000) & 0xff;\n\tbytes[4] = (lastTimestamp / 0x100) & 0xff;\n\tbytes[5] = lastTimestamp & 0xff;\n\tbytes[6] = 0x70 | ((sequence >>> 28) & 0x0f);\n\tbytes[7] = (sequence >>> 20) & 0xff;\n\tbytes[8] = 0x80 | ((sequence >>> 14) & 0x3f);\n\tbytes[9] = (sequence >>> 6) & 0xff;\n\tbytes[10] = ((sequence & 0x3f) << 2) | (random[10] & 0x03);\n\tbytes[11] = random[11];\n\tbytes[12] = random[12];\n\tbytes[13] = random[13];\n\tbytes[14] = random[14];\n\tbytes[15] = random[15];\n\n\treturn formatUuid(bytes);\n}\n\nfunction formatUuid(bytes: Uint8Array): string {\n\tconst hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\"));\n\treturn `${hex.slice(0, 4).join(\"\")}-${hex.slice(4, 6).join(\"\")}-${hex.slice(6, 8).join(\"\")}-${hex.slice(8, 10).join(\"\")}-${hex.slice(10, 16).join(\"\")}`;\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { type ExecutionEnv, type Skill } from "./types.ts";
|
|
2
|
-
export type SkillDiagnosticCode = "file_info_failed" | "list_failed" | "read_failed" | "parse_failed" | "invalid_metadata";
|
|
3
|
-
/** Warning produced while loading skills. */
|
|
4
|
-
export interface SkillDiagnostic {
|
|
5
|
-
/** Diagnostic severity. Currently only warnings are emitted. */
|
|
6
|
-
type: "warning";
|
|
7
|
-
/** Stable diagnostic code. */
|
|
8
|
-
code: SkillDiagnosticCode;
|
|
9
|
-
/** Human-readable diagnostic message. */
|
|
10
|
-
message: string;
|
|
11
|
-
/** Path associated with the diagnostic. */
|
|
12
|
-
path: string;
|
|
13
|
-
}
|
|
14
|
-
/** Format a skill invocation prompt, optionally appending additional user instructions. */
|
|
15
|
-
export declare function formatSkillInvocation(skill: Skill, additionalInstructions?: string): string;
|
|
16
|
-
/**
|
|
17
|
-
* Load skills from one or more directories.
|
|
18
|
-
*
|
|
19
|
-
* Traverses directories recursively, loads `SKILL.md` files, loads direct root `.md` files as skills, honors ignore files,
|
|
20
|
-
* and returns diagnostics for invalid skill files. Missing input directories are skipped.
|
|
21
|
-
*/
|
|
22
|
-
export declare function loadSkills(env: ExecutionEnv, dirs: string | string[]): Promise<{
|
|
23
|
-
skills: Skill[];
|
|
24
|
-
diagnostics: SkillDiagnostic[];
|
|
25
|
-
}>;
|
|
26
|
-
/**
|
|
27
|
-
* Load skills from source-tagged directories.
|
|
28
|
-
*
|
|
29
|
-
* Source values are preserved exactly and attached to every loaded skill and diagnostic. The agent package does not
|
|
30
|
-
* interpret source values; applications define their own provenance shape.
|
|
31
|
-
*/
|
|
32
|
-
export declare function loadSourcedSkills<TSource, TSkill extends Skill = Skill>(env: ExecutionEnv, inputs: Array<{
|
|
33
|
-
path: string;
|
|
34
|
-
source: TSource;
|
|
35
|
-
}>, mapSkill?: (skill: Skill, source: TSource) => TSkill): Promise<{
|
|
36
|
-
skills: Array<{
|
|
37
|
-
skill: TSkill;
|
|
38
|
-
source: TSource;
|
|
39
|
-
}>;
|
|
40
|
-
diagnostics: Array<SkillDiagnostic & {
|
|
41
|
-
source: TSource;
|
|
42
|
-
}>;
|
|
43
|
-
}>;
|
|
44
|
-
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/harness/skills.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAA8B,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAQhG,MAAM,MAAM,mBAAmB,GAC5B,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,cAAc,GACd,kBAAkB,CAAC;AAEtB,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC/B,gEAAgE;IAChE,IAAI,EAAE,SAAS,CAAC;IAChB,8BAA8B;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;CACb;AASD,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3F;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC/B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GACrB,OAAO,CAAC;IAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAAC,WAAW,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC,CAuB9D;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,SAAS,KAAK,GAAG,KAAK,EAC5E,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,EAChD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,MAAM,GAClD,OAAO,CAAC;IACV,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAClD,WAAW,EAAE,KAAK,CAAC,eAAe,GAAG;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC1D,CAAC,CAWD","sourcesContent":["import ignore from \"ignore\";\nimport { parse } from \"yaml\";\nimport { type ExecutionEnv, type FileInfo, type Result, type Skill, toError } from \"./types.ts\";\n\nconst MAX_NAME_LENGTH = 64;\nconst MAX_DESCRIPTION_LENGTH = 1024;\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\n\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nexport type SkillDiagnosticCode =\n\t| \"file_info_failed\"\n\t| \"list_failed\"\n\t| \"read_failed\"\n\t| \"parse_failed\"\n\t| \"invalid_metadata\";\n\n/** Warning produced while loading skills. */\nexport interface SkillDiagnostic {\n\t/** Diagnostic severity. Currently only warnings are emitted. */\n\ttype: \"warning\";\n\t/** Stable diagnostic code. */\n\tcode: SkillDiagnosticCode;\n\t/** Human-readable diagnostic message. */\n\tmessage: string;\n\t/** Path associated with the diagnostic. */\n\tpath: string;\n}\n\ninterface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\n\n/** Format a skill invocation prompt, optionally appending additional user instructions. */\nexport function formatSkillInvocation(skill: Skill, additionalInstructions?: string): string {\n\tconst skillBlock = `<skill name=\"${skill.name}\" location=\"${skill.filePath}\">\\nReferences are relative to ${dirnameEnvPath(skill.filePath)}.\\n\\n${skill.content}\\n</skill>`;\n\treturn additionalInstructions ? `${skillBlock}\\n\\n${additionalInstructions}` : skillBlock;\n}\n\n/**\n * Load skills from one or more directories.\n *\n * Traverses directories recursively, loads `SKILL.md` files, loads direct root `.md` files as skills, honors ignore files,\n * and returns diagnostics for invalid skill files. Missing input directories are skipped.\n */\nexport async function loadSkills(\n\tenv: ExecutionEnv,\n\tdirs: string | string[],\n): Promise<{ skills: Skill[]; diagnostics: SkillDiagnostic[] }> {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: SkillDiagnostic[] = [];\n\tfor (const dir of Array.isArray(dirs) ? dirs : [dirs]) {\n\t\tconst rootInfoResult = await env.fileInfo(dir);\n\t\tif (!rootInfoResult.ok) {\n\t\t\tif (rootInfoResult.error.code !== \"not_found\") {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tcode: \"file_info_failed\",\n\t\t\t\t\tmessage: rootInfoResult.error.message,\n\t\t\t\t\tpath: dir,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tconst rootInfo = rootInfoResult.value;\n\t\tif ((await resolveKind(env, rootInfo, diagnostics)) !== \"directory\") continue;\n\t\tconst result = await loadSkillsFromDirInternal(env, rootInfo.path, true, ignore(), rootInfo.path);\n\t\tskills.push(...result.skills);\n\t\tdiagnostics.push(...result.diagnostics);\n\t}\n\treturn { skills, diagnostics };\n}\n\n/**\n * Load skills from source-tagged directories.\n *\n * Source values are preserved exactly and attached to every loaded skill and diagnostic. The agent package does not\n * interpret source values; applications define their own provenance shape.\n */\nexport async function loadSourcedSkills<TSource, TSkill extends Skill = Skill>(\n\tenv: ExecutionEnv,\n\tinputs: Array<{ path: string; source: TSource }>,\n\tmapSkill?: (skill: Skill, source: TSource) => TSkill,\n): Promise<{\n\tskills: Array<{ skill: TSkill; source: TSource }>;\n\tdiagnostics: Array<SkillDiagnostic & { source: TSource }>;\n}> {\n\tconst skills: Array<{ skill: TSkill; source: TSource }> = [];\n\tconst diagnostics: Array<SkillDiagnostic & { source: TSource }> = [];\n\tfor (const input of inputs) {\n\t\tconst result = await loadSkills(env, input.path);\n\t\tfor (const skill of result.skills) {\n\t\t\tskills.push({ skill: mapSkill ? mapSkill(skill, input.source) : (skill as TSkill), source: input.source });\n\t\t}\n\t\tfor (const diagnostic of result.diagnostics) diagnostics.push({ ...diagnostic, source: input.source });\n\t}\n\treturn { skills, diagnostics };\n}\n\nasync function loadSkillsFromDirInternal(\n\tenv: ExecutionEnv,\n\tdir: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher: IgnoreMatcher,\n\trootDir: string,\n): Promise<{ skills: Skill[]; diagnostics: SkillDiagnostic[] }> {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: SkillDiagnostic[] = [];\n\n\tconst dirInfoResult = await env.fileInfo(dir);\n\tif (!dirInfoResult.ok) {\n\t\tif (dirInfoResult.error.code !== \"not_found\") {\n\t\t\tdiagnostics.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tcode: \"file_info_failed\",\n\t\t\t\tmessage: dirInfoResult.error.message,\n\t\t\t\tpath: dir,\n\t\t\t});\n\t\t}\n\t\treturn { skills, diagnostics };\n\t}\n\tconst dirInfo = dirInfoResult.value;\n\tif ((await resolveKind(env, dirInfo, diagnostics)) !== \"directory\") return { skills, diagnostics };\n\n\tawait addIgnoreRules(env, ignoreMatcher, dir, rootDir, diagnostics);\n\n\tconst entriesResult = await env.listDir(dir);\n\tif (!entriesResult.ok) {\n\t\tdiagnostics.push({ type: \"warning\", code: \"list_failed\", message: entriesResult.error.message, path: dir });\n\t\treturn { skills, diagnostics };\n\t}\n\tconst entries = entriesResult.value;\n\n\tfor (const entry of entries) {\n\t\tif (entry.name !== \"SKILL.md\") continue;\n\t\tconst fullPath = entry.path;\n\t\tconst kind = await resolveKind(env, entry, diagnostics);\n\t\tif (kind !== \"file\") continue;\n\t\tconst relPath = relativeEnvPath(rootDir, fullPath);\n\t\tif (ignoreMatcher.ignores(relPath)) continue;\n\n\t\tconst result = await loadSkillFromFile(env, fullPath);\n\t\tif (result.skill) skills.push(result.skill);\n\t\tdiagnostics.push(...result.diagnostics);\n\t\treturn { skills, diagnostics };\n\t}\n\n\tfor (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {\n\t\tif (entry.name.startsWith(\".\") || entry.name === \"node_modules\") continue;\n\t\tconst fullPath = entry.path;\n\t\tconst kind = await resolveKind(env, entry, diagnostics);\n\t\tif (!kind) continue;\n\n\t\tconst relPath = relativeEnvPath(rootDir, fullPath);\n\t\tconst ignorePath = kind === \"directory\" ? `${relPath}/` : relPath;\n\t\tif (ignoreMatcher.ignores(ignorePath)) continue;\n\n\t\tif (kind === \"directory\") {\n\t\t\tconst result = await loadSkillsFromDirInternal(env, fullPath, false, ignoreMatcher, rootDir);\n\t\t\tskills.push(...result.skills);\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (kind !== \"file\" || !includeRootFiles || !entry.name.endsWith(\".md\")) continue;\n\t\tconst result = await loadSkillFromFile(env, fullPath);\n\t\tif (result.skill) skills.push(result.skill);\n\t\tdiagnostics.push(...result.diagnostics);\n\t}\n\n\treturn { skills, diagnostics };\n}\n\nasync function addIgnoreRules(\n\tenv: ExecutionEnv,\n\tig: IgnoreMatcher,\n\tdir: string,\n\trootDir: string,\n\tdiagnostics: SkillDiagnostic[],\n): Promise<void> {\n\tconst relativeDir = relativeEnvPath(rootDir, dir);\n\tconst prefix = relativeDir ? `${relativeDir}/` : \"\";\n\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = joinEnvPath(dir, filename);\n\t\tconst info = await env.fileInfo(ignorePath);\n\t\tif (!info.ok) {\n\t\t\tif (info.error.code !== \"not_found\") {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tcode: \"file_info_failed\",\n\t\t\t\t\tmessage: info.error.message,\n\t\t\t\t\tpath: ignorePath,\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (info.value.kind !== \"file\") continue;\n\t\tconst content = await env.readTextFile(ignorePath);\n\t\tif (!content.ok) {\n\t\t\tdiagnostics.push({ type: \"warning\", code: \"read_failed\", message: content.error.message, path: ignorePath });\n\t\t\tcontinue;\n\t\t}\n\t\tconst patterns = content.value\n\t\t\t.split(/\\r?\\n/)\n\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t.filter((line): line is string => Boolean(line));\n\t\tif (patterns.length > 0) ig.add(patterns);\n\t}\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\n\tlet pattern = line;\n\tlet negated = false;\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tif (pattern.startsWith(\"/\")) pattern = pattern.slice(1);\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nasync function loadSkillFromFile(\n\tenv: ExecutionEnv,\n\tfilePath: string,\n): Promise<{ skill: Skill | null; diagnostics: SkillDiagnostic[] }> {\n\tconst diagnostics: SkillDiagnostic[] = [];\n\tconst rawContent = await env.readTextFile(filePath);\n\tif (!rawContent.ok) {\n\t\tdiagnostics.push({ type: \"warning\", code: \"read_failed\", message: rawContent.error.message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n\n\tconst parsed = parseFrontmatter<SkillFrontmatter>(rawContent.value);\n\tif (!parsed.ok) {\n\t\tdiagnostics.push({ type: \"warning\", code: \"parse_failed\", message: parsed.error.message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n\n\tconst { frontmatter, body } = parsed.value;\n\tconst skillDir = dirnameEnvPath(filePath);\n\tconst parentDirName = basenameEnvPath(skillDir);\n\tconst description = typeof frontmatter.description === \"string\" ? frontmatter.description : undefined;\n\n\tfor (const error of validateDescription(description)) {\n\t\tdiagnostics.push({ type: \"warning\", code: \"invalid_metadata\", message: error, path: filePath });\n\t}\n\n\tconst frontmatterName = typeof frontmatter.name === \"string\" ? frontmatter.name : undefined;\n\tconst name = frontmatterName || parentDirName;\n\tfor (const error of validateName(name, parentDirName)) {\n\t\tdiagnostics.push({ type: \"warning\", code: \"invalid_metadata\", message: error, path: filePath });\n\t}\n\n\tif (!description || description.trim() === \"\") {\n\t\treturn { skill: null, diagnostics };\n\t}\n\n\treturn {\n\t\tskill: {\n\t\t\tname,\n\t\t\tdescription,\n\t\t\tcontent: body,\n\t\t\tfilePath,\n\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t},\n\t\tdiagnostics,\n\t};\n}\n\nfunction validateName(name: string, parentDirName: string): string[] {\n\tconst errors: string[] = [];\n\tif (name !== parentDirName) errors.push(`name \"${name}\" does not match parent directory \"${parentDirName}\"`);\n\tif (name.length > MAX_NAME_LENGTH) errors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(\"name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)\");\n\t}\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) errors.push(\"name must not start or end with a hyphen\");\n\tif (name.includes(\"--\")) errors.push(\"name must not contain consecutive hyphens\");\n\treturn errors;\n}\n\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\treturn errors;\n}\n\nfunction parseFrontmatter<T extends Record<string, unknown>>(\n\tcontent: string,\n): Result<{ frontmatter: T; body: string }, Error> {\n\ttry {\n\t\tconst normalized = content.replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\");\n\t\tif (!normalized.startsWith(\"---\")) return { ok: true, value: { frontmatter: {} as T, body: normalized } };\n\t\tconst endIndex = normalized.indexOf(\"\\n---\", 3);\n\t\tif (endIndex === -1) return { ok: true, value: { frontmatter: {} as T, body: normalized } };\n\t\tconst yamlString = normalized.slice(4, endIndex);\n\t\tconst body = normalized.slice(endIndex + 4).trim();\n\t\treturn { ok: true, value: { frontmatter: (parse(yamlString) ?? {}) as T, body } };\n\t} catch (error) {\n\t\treturn { ok: false, error: toError(error) };\n\t}\n}\n\nasync function resolveKind(\n\tenv: ExecutionEnv,\n\tinfo: FileInfo,\n\tdiagnostics: SkillDiagnostic[],\n): Promise<\"file\" | \"directory\" | undefined> {\n\tif (info.kind === \"file\" || info.kind === \"directory\") return info.kind;\n\tconst canonicalPath = await env.canonicalPath(info.path);\n\tif (!canonicalPath.ok) {\n\t\tif (canonicalPath.error.code !== \"not_found\") {\n\t\t\tdiagnostics.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tcode: \"file_info_failed\",\n\t\t\t\tmessage: canonicalPath.error.message,\n\t\t\t\tpath: info.path,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\tconst target = await env.fileInfo(canonicalPath.value);\n\tif (!target.ok) {\n\t\tif (target.error.code !== \"not_found\") {\n\t\t\tdiagnostics.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tcode: \"file_info_failed\",\n\t\t\t\tmessage: target.error.message,\n\t\t\t\tpath: info.path,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\treturn target.value.kind === \"file\" || target.value.kind === \"directory\" ? target.value.kind : undefined;\n}\n\nfunction joinEnvPath(base: string, child: string): string {\n\treturn `${base.replace(/\\/+$/, \"\")}/${child.replace(/^\\/+/, \"\")}`;\n}\n\nfunction dirnameEnvPath(path: string): string {\n\tconst normalized = path.replace(/\\/+$/, \"\");\n\tconst slashIndex = normalized.lastIndexOf(\"/\");\n\treturn slashIndex <= 0 ? \"/\" : normalized.slice(0, slashIndex);\n}\n\nfunction basenameEnvPath(path: string): string {\n\tconst normalized = path.replace(/\\/+$/, \"\");\n\tconst slashIndex = normalized.lastIndexOf(\"/\");\n\treturn slashIndex === -1 ? normalized : normalized.slice(slashIndex + 1);\n}\n\nfunction relativeEnvPath(root: string, path: string): string {\n\tconst normalizedRoot = root.replace(/\\/+$/, \"\");\n\tconst normalizedPath = path.replace(/\\/+$/, \"\");\n\tif (normalizedPath === normalizedRoot) return \"\";\n\treturn normalizedPath.startsWith(`${normalizedRoot}/`)\n\t\t? normalizedPath.slice(normalizedRoot.length + 1)\n\t\t: normalizedPath.replace(/^\\/+/, \"\");\n}\n"]}
|