@adaptic/maestro 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/init-maestro.md +292 -29
- package/.gitignore +29 -0
- package/README.md +220 -344
- package/bin/maestro.mjs +462 -7
- package/lib/action-executor.js +225 -0
- package/lib/index.js +16 -0
- package/lib/singleton.js +116 -0
- package/lib/tool-definitions.js +510 -0
- package/package.json +12 -2
- package/scaffold/CLAUDE.md +207 -0
- package/scripts/daemon/maestro-daemon.mjs +37 -0
- package/scripts/local-triggers/generate-plists.sh +235 -0
- package/scripts/local-triggers/install-all.sh +18 -12
- package/scripts/setup/init-agent.sh +58 -27
- package/scripts/slack-events-server.mjs +10 -0
- package/scripts/huddle/node_modules/.package-lock.json +0 -50
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/CHANGELOG.md +0 -1677
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/LICENSE +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/README.md +0 -674
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +0 -226
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +0 -223
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/bin/cli +0 -53
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/bin/migration-config.json +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.mts +0 -225
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.ts +0 -225
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.js +0 -536
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.mjs +0 -531
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/client.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +0 -49
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +0 -49
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.js +0 -76
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +0 -72
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.mts +0 -47
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.ts +0 -47
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.js +0 -114
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.mjs +0 -98
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/error.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +0 -63
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +0 -63
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.js +0 -123
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.mjs +0 -117
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.mts +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.ts +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.js +0 -11
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.mjs +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/resource.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +0 -31
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +0 -31
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.js +0 -282
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.mjs +0 -277
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/error.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.mts +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.ts +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.js +0 -35
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.mjs +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/index.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts +0 -73
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts +0 -73
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.js +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/builtin-types.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.mts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.ts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.mjs +0 -12
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts +0 -10
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts +0 -10
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js +0 -39
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs +0 -35
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.js +0 -113
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs +0 -108
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +0 -162
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +0 -157
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.js +0 -41
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.mjs +0 -36
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +0 -22
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +0 -22
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.js +0 -79
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.mjs +0 -74
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.js +0 -55
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.mjs +0 -51
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +0 -34
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +0 -34
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.js +0 -14
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +0 -10
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shim-types.d.mts +0 -28
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shim-types.d.ts +0 -28
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +0 -20
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +0 -20
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.js +0 -92
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.mjs +0 -85
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/shims.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.js +0 -38
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs +0 -35
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/stream-utils.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts +0 -45
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts +0 -45
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.js +0 -96
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.mjs +0 -93
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/tslib.js +0 -81
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/tslib.mjs +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.mts +0 -67
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.ts +0 -67
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.js +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/types.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts +0 -42
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts +0 -42
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.js +0 -146
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +0 -136
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.js +0 -38
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs +0 -33
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js +0 -31
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs +0 -26
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts +0 -9
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts +0 -9
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.js +0 -22
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs +0 -18
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/env.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +0 -37
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +0 -37
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.js +0 -86
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +0 -80
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.js +0 -58
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs +0 -53
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js +0 -19
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/uuid.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +0 -16
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +0 -16
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.js +0 -109
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +0 -92
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.mts +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.ts +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.js +0 -11
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.mjs +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +0 -114
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +0 -114
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +0 -553
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +0 -549
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +0 -114
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +0 -114
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +0 -553
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +0 -549
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/package.json +0 -185
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/pagination.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resource.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +0 -61
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +0 -61
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +0 -25
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +0 -20
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +0 -151
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +0 -151
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.js +0 -122
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +0 -118
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.js +0 -13
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +0 -343
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +0 -343
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +0 -204
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +0 -200
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js +0 -9
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +0 -1561
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +0 -1561
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +0 -86
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +0 -81
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +0 -74
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +0 -74
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.js +0 -60
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs +0 -56
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +0 -183
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +0 -183
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.js +0 -23
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.mjs +0 -19
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.mts +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.ts +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.js +0 -15
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.mjs +0 -7
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +0 -304
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +0 -304
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +0 -153
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +0 -149
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.js +0 -9
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +0 -1264
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +0 -1264
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +0 -72
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +0 -67
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.mts +0 -59
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.ts +0 -59
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.js +0 -45
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.mjs +0 -41
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.mts +0 -42
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.ts +0 -42
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.js +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/shared.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.js +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.mjs +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources/top-level.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.js +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/resources.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/README.md +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +0 -264
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/api-promise.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/client.ts +0 -1070
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/README.md +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +0 -101
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/error.ts +0 -133
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +0 -201
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/resource.ts +0 -11
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +0 -331
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/core/uploads.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/error.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/index.ts +0 -23
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/README.md +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/builtin-types.ts +0 -93
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +0 -12
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts +0 -48
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts +0 -135
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +0 -196
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +0 -33
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +0 -99
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +0 -84
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +0 -39
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/shim-types.d.ts +0 -28
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/shims.ts +0 -107
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/stream-utils.ts +0 -32
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/to-file.ts +0 -159
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/types.ts +0 -92
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +0 -193
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts +0 -40
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts +0 -32
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts +0 -18
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +0 -127
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts +0 -65
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts +0 -17
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +0 -102
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/internal/utils.ts +0 -8
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/.keep +0 -4
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +0 -683
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +0 -684
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/pagination.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resource.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +0 -380
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +0 -258
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +0 -148
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +0 -502
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +0 -135
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +0 -2249
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/messages.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +0 -118
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/beta.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +0 -231
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/index.ts +0 -121
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +0 -396
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +0 -110
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +0 -1783
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/messages.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/models.ts +0 -103
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/shared.ts +0 -72
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources/top-level.ts +0 -3
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/resources.ts +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/streaming.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/tsconfig.json +0 -11
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/uploads.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/src/version.ts +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/streaming.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.js +0 -6
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/uploads.mjs.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.mts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.mts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.ts +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.d.ts.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.js +0 -5
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.js.map +0 -1
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.mjs +0 -2
- package/scripts/huddle/node_modules/@anthropic-ai/sdk/version.mjs.map +0 -1
- package/scripts/huddle/node_modules/dotenv/CHANGELOG.md +0 -520
- package/scripts/huddle/node_modules/dotenv/LICENSE +0 -23
- package/scripts/huddle/node_modules/dotenv/README-es.md +0 -411
- package/scripts/huddle/node_modules/dotenv/README.md +0 -645
- package/scripts/huddle/node_modules/dotenv/SECURITY.md +0 -1
- package/scripts/huddle/node_modules/dotenv/config.d.ts +0 -1
- package/scripts/huddle/node_modules/dotenv/config.js +0 -9
- package/scripts/huddle/node_modules/dotenv/lib/cli-options.js +0 -17
- package/scripts/huddle/node_modules/dotenv/lib/env-options.js +0 -28
- package/scripts/huddle/node_modules/dotenv/lib/main.d.ts +0 -162
- package/scripts/huddle/node_modules/dotenv/lib/main.js +0 -386
- package/scripts/huddle/node_modules/dotenv/package.json +0 -62
- package/scripts/huddle/node_modules/ws/LICENSE +0 -20
- package/scripts/huddle/node_modules/ws/README.md +0 -548
- package/scripts/huddle/node_modules/ws/browser.js +0 -8
- package/scripts/huddle/node_modules/ws/index.js +0 -22
- package/scripts/huddle/node_modules/ws/lib/buffer-util.js +0 -131
- package/scripts/huddle/node_modules/ws/lib/constants.js +0 -19
- package/scripts/huddle/node_modules/ws/lib/event-target.js +0 -292
- package/scripts/huddle/node_modules/ws/lib/extension.js +0 -203
- package/scripts/huddle/node_modules/ws/lib/limiter.js +0 -55
- package/scripts/huddle/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/scripts/huddle/node_modules/ws/lib/receiver.js +0 -706
- package/scripts/huddle/node_modules/ws/lib/sender.js +0 -602
- package/scripts/huddle/node_modules/ws/lib/stream.js +0 -161
- package/scripts/huddle/node_modules/ws/lib/subprotocol.js +0 -62
- package/scripts/huddle/node_modules/ws/lib/validation.js +0 -152
- package/scripts/huddle/node_modules/ws/lib/websocket-server.js +0 -554
- package/scripts/huddle/node_modules/ws/lib/websocket.js +0 -1393
- package/scripts/huddle/node_modules/ws/package.json +0 -70
- package/scripts/huddle/node_modules/ws/wrapper.mjs +0 -21
- package/scripts/local-triggers/plists/ai.adaptic.slack-events-server.plist +0 -45
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { BlobPart, getName, makeFile, isAsyncIterable } from './uploads';
|
|
2
|
-
import type { FilePropertyBag } from './builtin-types';
|
|
3
|
-
import { checkFileSupport } from './uploads';
|
|
4
|
-
|
|
5
|
-
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Intended to match DOM Blob, node-fetch Blob, node:buffer Blob, etc.
|
|
9
|
-
* Don't add arrayBuffer here, node-fetch doesn't have it
|
|
10
|
-
*/
|
|
11
|
-
interface BlobLike {
|
|
12
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
13
|
-
readonly size: number;
|
|
14
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
15
|
-
readonly type: string;
|
|
16
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
17
|
-
text(): Promise<string>;
|
|
18
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
19
|
-
slice(start?: number, end?: number): BlobLike;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
24
|
-
*/
|
|
25
|
-
const isBlobLike = (value: any): value is BlobLike & { arrayBuffer(): Promise<ArrayBuffer> } =>
|
|
26
|
-
value != null &&
|
|
27
|
-
typeof value === 'object' &&
|
|
28
|
-
typeof value.size === 'number' &&
|
|
29
|
-
typeof value.type === 'string' &&
|
|
30
|
-
typeof value.text === 'function' &&
|
|
31
|
-
typeof value.slice === 'function' &&
|
|
32
|
-
typeof value.arrayBuffer === 'function';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Intended to match DOM File, node:buffer File, undici File, etc.
|
|
36
|
-
*/
|
|
37
|
-
interface FileLike extends BlobLike {
|
|
38
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
39
|
-
readonly lastModified: number;
|
|
40
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
41
|
-
readonly name?: string | undefined;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* This check adds the arrayBuffer() method type because it is available and used at runtime
|
|
46
|
-
*/
|
|
47
|
-
const isFileLike = (value: any): value is FileLike & { arrayBuffer(): Promise<ArrayBuffer> } =>
|
|
48
|
-
value != null &&
|
|
49
|
-
typeof value === 'object' &&
|
|
50
|
-
typeof value.name === 'string' &&
|
|
51
|
-
typeof value.lastModified === 'number' &&
|
|
52
|
-
isBlobLike(value);
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Intended to match DOM Response, node-fetch Response, undici Response, etc.
|
|
56
|
-
*/
|
|
57
|
-
export interface ResponseLike {
|
|
58
|
-
url: string;
|
|
59
|
-
blob(): Promise<BlobLike>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const isResponseLike = (value: any): value is ResponseLike =>
|
|
63
|
-
value != null &&
|
|
64
|
-
typeof value === 'object' &&
|
|
65
|
-
typeof value.url === 'string' &&
|
|
66
|
-
typeof value.blob === 'function';
|
|
67
|
-
|
|
68
|
-
export type ToFileInput =
|
|
69
|
-
| FileLike
|
|
70
|
-
| ResponseLike
|
|
71
|
-
| Exclude<BlobLikePart, string>
|
|
72
|
-
| AsyncIterable<BlobLikePart>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
76
|
-
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
|
|
77
|
-
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
78
|
-
* @param {Object=} options additional properties
|
|
79
|
-
* @param {string=} options.type the MIME type of the content
|
|
80
|
-
* @param {number=} options.lastModified the last modified timestamp
|
|
81
|
-
* @returns a {@link File} with the given properties
|
|
82
|
-
*/
|
|
83
|
-
export async function toFile(
|
|
84
|
-
value: ToFileInput | PromiseLike<ToFileInput>,
|
|
85
|
-
name?: string | null | undefined,
|
|
86
|
-
options?: FilePropertyBag | undefined,
|
|
87
|
-
): Promise<File> {
|
|
88
|
-
checkFileSupport();
|
|
89
|
-
|
|
90
|
-
// If it's a promise, resolve it.
|
|
91
|
-
value = await value;
|
|
92
|
-
|
|
93
|
-
name ||= getName(value);
|
|
94
|
-
|
|
95
|
-
// If we've been given a `File` we don't need to do anything if the name / options
|
|
96
|
-
// have not been customised.
|
|
97
|
-
if (isFileLike(value)) {
|
|
98
|
-
if (value instanceof File && name == null && options == null) {
|
|
99
|
-
return value;
|
|
100
|
-
}
|
|
101
|
-
return makeFile([await value.arrayBuffer()], name ?? value.name, {
|
|
102
|
-
type: value.type,
|
|
103
|
-
lastModified: value.lastModified,
|
|
104
|
-
...options,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (isResponseLike(value)) {
|
|
109
|
-
const blob = await value.blob();
|
|
110
|
-
name ||= new URL(value.url).pathname.split(/[\\/]/).pop();
|
|
111
|
-
|
|
112
|
-
return makeFile(await getBytes(blob), name, options);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const parts = await getBytes(value);
|
|
116
|
-
|
|
117
|
-
if (!options?.type) {
|
|
118
|
-
const type = parts.find((part) => typeof part === 'object' && 'type' in part && part.type);
|
|
119
|
-
if (typeof type === 'string') {
|
|
120
|
-
options = { ...options, type };
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return makeFile(parts, name, options);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async function getBytes(value: BlobLikePart | AsyncIterable<BlobLikePart>): Promise<Array<BlobPart>> {
|
|
128
|
-
let parts: Array<BlobPart> = [];
|
|
129
|
-
if (
|
|
130
|
-
typeof value === 'string' ||
|
|
131
|
-
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
132
|
-
value instanceof ArrayBuffer
|
|
133
|
-
) {
|
|
134
|
-
parts.push(value);
|
|
135
|
-
} else if (isBlobLike(value)) {
|
|
136
|
-
parts.push(value instanceof Blob ? value : await value.arrayBuffer());
|
|
137
|
-
} else if (
|
|
138
|
-
isAsyncIterable(value) // includes Readable, ReadableStream, etc.
|
|
139
|
-
) {
|
|
140
|
-
for await (const chunk of value) {
|
|
141
|
-
parts.push(...(await getBytes(chunk as BlobLikePart))); // TODO, consider validating?
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
const constructor = value?.constructor?.name;
|
|
145
|
-
throw new Error(
|
|
146
|
-
`Unexpected data type: ${typeof value}${
|
|
147
|
-
constructor ? `; constructor: ${constructor}` : ''
|
|
148
|
-
}${propsForError(value)}`,
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return parts;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function propsForError(value: unknown): string {
|
|
156
|
-
if (typeof value !== 'object' || value === null) return '';
|
|
157
|
-
const props = Object.getOwnPropertyNames(value);
|
|
158
|
-
return `; props: [${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
159
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export type PromiseOrValue<T> = T | Promise<T>;
|
|
4
|
-
export type HTTPMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
5
|
-
|
|
6
|
-
export type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
|
7
|
-
|
|
8
|
-
export type FinalizedRequestInit = RequestInit & { headers: Headers };
|
|
9
|
-
|
|
10
|
-
type NotAny<T> = [unknown] extends [T] ? never : T;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Some environments overload the global fetch function, and Parameters<T> only gets the last signature.
|
|
14
|
-
*/
|
|
15
|
-
type OverloadedParameters<T> =
|
|
16
|
-
T extends (
|
|
17
|
-
{
|
|
18
|
-
(...args: infer A): unknown;
|
|
19
|
-
(...args: infer B): unknown;
|
|
20
|
-
(...args: infer C): unknown;
|
|
21
|
-
(...args: infer D): unknown;
|
|
22
|
-
}
|
|
23
|
-
) ?
|
|
24
|
-
A | B | C | D
|
|
25
|
-
: T extends (
|
|
26
|
-
{
|
|
27
|
-
(...args: infer A): unknown;
|
|
28
|
-
(...args: infer B): unknown;
|
|
29
|
-
(...args: infer C): unknown;
|
|
30
|
-
}
|
|
31
|
-
) ?
|
|
32
|
-
A | B | C
|
|
33
|
-
: T extends (
|
|
34
|
-
{
|
|
35
|
-
(...args: infer A): unknown;
|
|
36
|
-
(...args: infer B): unknown;
|
|
37
|
-
}
|
|
38
|
-
) ?
|
|
39
|
-
A | B
|
|
40
|
-
: T extends (...args: infer A) => unknown ? A
|
|
41
|
-
: never;
|
|
42
|
-
|
|
43
|
-
/* eslint-disable */
|
|
44
|
-
/**
|
|
45
|
-
* These imports attempt to get types from a parent package's dependencies.
|
|
46
|
-
* Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
|
|
47
|
-
* would cause typescript to show types not present at runtime. To avoid this, we import
|
|
48
|
-
* directly from parent node_modules folders.
|
|
49
|
-
*
|
|
50
|
-
* We need to check multiple levels because we don't know what directory structure we'll be in.
|
|
51
|
-
* For example, pnpm generates directories like this:
|
|
52
|
-
* ```
|
|
53
|
-
* node_modules
|
|
54
|
-
* ├── .pnpm
|
|
55
|
-
* │ └── pkg@1.0.0
|
|
56
|
-
* │ └── node_modules
|
|
57
|
-
* │ └── pkg
|
|
58
|
-
* │ └── internal
|
|
59
|
-
* │ └── types.d.ts
|
|
60
|
-
* ├── pkg -> .pnpm/pkg@1.0.0/node_modules/pkg
|
|
61
|
-
* └── undici
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
|
|
65
|
-
*/
|
|
66
|
-
/** @ts-ignore For users with \@types/node */
|
|
67
|
-
type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types').RequestInit> | NotAny<import('../../node_modules/undici-types').RequestInit> | NotAny<import('../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types').RequestInit>;
|
|
68
|
-
/** @ts-ignore For users with undici */
|
|
69
|
-
type UndiciRequestInit = NotAny<import('../node_modules/undici').RequestInit> | NotAny<import('../../node_modules/undici').RequestInit> | NotAny<import('../../../node_modules/undici').RequestInit> | NotAny<import('../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici').RequestInit>;
|
|
70
|
-
/** @ts-ignore For users with \@types/bun */
|
|
71
|
-
type BunRequestInit = globalThis.FetchRequestInit;
|
|
72
|
-
/** @ts-ignore For users with node-fetch */
|
|
73
|
-
type NodeFetchRequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
|
|
74
|
-
/** @ts-ignore For users who use Deno */
|
|
75
|
-
type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
|
|
76
|
-
/* eslint-enable */
|
|
77
|
-
|
|
78
|
-
type RequestInits =
|
|
79
|
-
| NotAny<UndiciTypesRequestInit>
|
|
80
|
-
| NotAny<UndiciRequestInit>
|
|
81
|
-
| NotAny<BunRequestInit>
|
|
82
|
-
| NotAny<NodeFetchRequestInit>
|
|
83
|
-
| NotAny<RequestInit>
|
|
84
|
-
| NotAny<FetchRequestInit>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* This type contains `RequestInit` options that may be available on the current runtime,
|
|
88
|
-
* including per-platform extensions like `dispatcher`, `agent`, `client`, etc.
|
|
89
|
-
*/
|
|
90
|
-
export type MergedRequestInit = RequestInits &
|
|
91
|
-
/** We don't include these in the types as they'll be overridden for every request. */
|
|
92
|
-
Partial<Record<'body' | 'headers' | 'method' | 'signal', never>>;
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { type RequestOptions } from './request-options';
|
|
2
|
-
import type { FilePropertyBag, Fetch } from './builtin-types';
|
|
3
|
-
import type { BaseAnthropic } from '../client';
|
|
4
|
-
import { ReadableStreamFrom } from './shims';
|
|
5
|
-
|
|
6
|
-
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
|
|
7
|
-
type FsReadStream = AsyncIterable<Uint8Array> & { path: string | { toString(): string } };
|
|
8
|
-
|
|
9
|
-
// https://github.com/oven-sh/bun/issues/5980
|
|
10
|
-
interface BunFile extends Blob {
|
|
11
|
-
readonly name?: string | undefined;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const checkFileSupport = () => {
|
|
15
|
-
if (typeof File === 'undefined') {
|
|
16
|
-
const { process } = globalThis as any;
|
|
17
|
-
const isOldNode =
|
|
18
|
-
typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;
|
|
19
|
-
throw new Error(
|
|
20
|
-
'`File` is not defined as a global, which is required for file uploads.' +
|
|
21
|
-
(isOldNode ?
|
|
22
|
-
" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`."
|
|
23
|
-
: ''),
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Typically, this is a native "File" class.
|
|
30
|
-
*
|
|
31
|
-
* We provide the {@link toFile} utility to convert a variety of objects
|
|
32
|
-
* into the File class.
|
|
33
|
-
*
|
|
34
|
-
* For convenience, you can also pass a fetch Response, or in Node,
|
|
35
|
-
* the result of fs.createReadStream().
|
|
36
|
-
*/
|
|
37
|
-
export type Uploadable = File | Response | FsReadStream | BunFile;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Construct a `File` instance. This is used to ensure a helpful error is thrown
|
|
41
|
-
* for environments that don't define a global `File` yet.
|
|
42
|
-
*/
|
|
43
|
-
export function makeFile(
|
|
44
|
-
fileBits: BlobPart[],
|
|
45
|
-
fileName: string | undefined,
|
|
46
|
-
options?: FilePropertyBag,
|
|
47
|
-
): File {
|
|
48
|
-
checkFileSupport();
|
|
49
|
-
return new File(fileBits as any, fileName ?? 'unknown_file', options);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function getName(value: any): string | undefined {
|
|
53
|
-
return (
|
|
54
|
-
(
|
|
55
|
-
(typeof value === 'object' &&
|
|
56
|
-
value !== null &&
|
|
57
|
-
(('name' in value && value.name && String(value.name)) ||
|
|
58
|
-
('url' in value && value.url && String(value.url)) ||
|
|
59
|
-
('filename' in value && value.filename && String(value.filename)) ||
|
|
60
|
-
('path' in value && value.path && String(value.path)))) ||
|
|
61
|
-
''
|
|
62
|
-
)
|
|
63
|
-
.split(/[\\/]/)
|
|
64
|
-
.pop() || undefined
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const isAsyncIterable = (value: any): value is AsyncIterable<any> =>
|
|
69
|
-
value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
|
|
73
|
-
* Otherwise returns the request as is.
|
|
74
|
-
*/
|
|
75
|
-
export const maybeMultipartFormRequestOptions = async (
|
|
76
|
-
opts: RequestOptions,
|
|
77
|
-
fetch: BaseAnthropic | Fetch,
|
|
78
|
-
): Promise<RequestOptions> => {
|
|
79
|
-
if (!hasUploadableValue(opts.body)) return opts;
|
|
80
|
-
|
|
81
|
-
return { ...opts, body: await createForm(opts.body, fetch) };
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
type MultipartFormRequestOptions = Omit<RequestOptions, 'body'> & { body: unknown };
|
|
85
|
-
|
|
86
|
-
export const multipartFormRequestOptions = async (
|
|
87
|
-
opts: MultipartFormRequestOptions,
|
|
88
|
-
fetch: BaseAnthropic | Fetch,
|
|
89
|
-
): Promise<RequestOptions> => {
|
|
90
|
-
return { ...opts, body: await createForm(opts.body, fetch) };
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const supportsFormDataMap = new WeakMap<Fetch, Promise<boolean>>();
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
|
|
97
|
-
* properly-encoded form data, it just stringifies the object, resulting in a request body of "[object FormData]".
|
|
98
|
-
* This function detects if the fetch function provided supports the global FormData object to avoid
|
|
99
|
-
* confusing error messages later on.
|
|
100
|
-
*/
|
|
101
|
-
function supportsFormData(fetchObject: BaseAnthropic | Fetch): Promise<boolean> {
|
|
102
|
-
const fetch: Fetch = typeof fetchObject === 'function' ? fetchObject : (fetchObject as any).fetch;
|
|
103
|
-
const cached = supportsFormDataMap.get(fetch);
|
|
104
|
-
if (cached) return cached;
|
|
105
|
-
const promise = (async () => {
|
|
106
|
-
try {
|
|
107
|
-
const FetchResponse = (
|
|
108
|
-
'Response' in fetch ?
|
|
109
|
-
fetch.Response
|
|
110
|
-
: (await fetch('data:,')).constructor) as typeof Response;
|
|
111
|
-
const data = new FormData();
|
|
112
|
-
if (data.toString() === (await new FetchResponse(data).text())) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
return true;
|
|
116
|
-
} catch {
|
|
117
|
-
// avoid false negatives
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
})();
|
|
121
|
-
supportsFormDataMap.set(fetch, promise);
|
|
122
|
-
return promise;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export const createForm = async <T = Record<string, unknown>>(
|
|
126
|
-
body: T | undefined,
|
|
127
|
-
fetch: BaseAnthropic | Fetch,
|
|
128
|
-
): Promise<FormData> => {
|
|
129
|
-
if (!(await supportsFormData(fetch))) {
|
|
130
|
-
throw new TypeError(
|
|
131
|
-
'The provided fetch function does not support file uploads with the current global FormData class.',
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
const form = new FormData();
|
|
135
|
-
await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
|
|
136
|
-
return form;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
140
|
-
// but they both inherit from Blob and have a `name` property at runtime.
|
|
141
|
-
const isNamedBlob = (value: object): value is Blob => value instanceof Blob && 'name' in value;
|
|
142
|
-
|
|
143
|
-
const isUploadable = (value: unknown) =>
|
|
144
|
-
typeof value === 'object' &&
|
|
145
|
-
value !== null &&
|
|
146
|
-
(value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));
|
|
147
|
-
|
|
148
|
-
const hasUploadableValue = (value: unknown): boolean => {
|
|
149
|
-
if (isUploadable(value)) return true;
|
|
150
|
-
if (Array.isArray(value)) return value.some(hasUploadableValue);
|
|
151
|
-
if (value && typeof value === 'object') {
|
|
152
|
-
for (const k in value) {
|
|
153
|
-
if (hasUploadableValue((value as any)[k])) return true;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const addFormValue = async (form: FormData, key: string, value: unknown): Promise<void> => {
|
|
160
|
-
if (value === undefined) return;
|
|
161
|
-
if (value == null) {
|
|
162
|
-
throw new TypeError(
|
|
163
|
-
`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`,
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// TODO: make nested formats configurable
|
|
168
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
169
|
-
form.append(key, String(value));
|
|
170
|
-
} else if (value instanceof Response) {
|
|
171
|
-
let options = {} as FilePropertyBag;
|
|
172
|
-
const contentType = value.headers.get('Content-Type');
|
|
173
|
-
if (contentType) {
|
|
174
|
-
options = { type: contentType };
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
form.append(key, makeFile([await value.blob()], getName(value), options));
|
|
178
|
-
} else if (isAsyncIterable(value)) {
|
|
179
|
-
form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value)));
|
|
180
|
-
} else if (isNamedBlob(value)) {
|
|
181
|
-
form.append(key, makeFile([value], getName(value), { type: value.type }));
|
|
182
|
-
} else if (Array.isArray(value)) {
|
|
183
|
-
await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
|
|
184
|
-
} else if (typeof value === 'object') {
|
|
185
|
-
await Promise.all(
|
|
186
|
-
Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)),
|
|
187
|
-
);
|
|
188
|
-
} else {
|
|
189
|
-
throw new TypeError(
|
|
190
|
-
`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`,
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { AnthropicError } from '../../core/error';
|
|
4
|
-
import { encodeUTF8 } from './bytes';
|
|
5
|
-
|
|
6
|
-
export const toBase64 = (data: string | Uint8Array | null | undefined): string => {
|
|
7
|
-
if (!data) return '';
|
|
8
|
-
|
|
9
|
-
if (typeof (globalThis as any).Buffer !== 'undefined') {
|
|
10
|
-
return (globalThis as any).Buffer.from(data).toString('base64');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (typeof data === 'string') {
|
|
14
|
-
data = encodeUTF8(data);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (typeof btoa !== 'undefined') {
|
|
18
|
-
return btoa(String.fromCharCode.apply(null, data as any));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
throw new AnthropicError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const fromBase64 = (str: string): Uint8Array => {
|
|
25
|
-
if (typeof (globalThis as any).Buffer !== 'undefined') {
|
|
26
|
-
const buf = (globalThis as any).Buffer.from(str, 'base64');
|
|
27
|
-
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (typeof atob !== 'undefined') {
|
|
31
|
-
const bstr = atob(str);
|
|
32
|
-
const buf = new Uint8Array(bstr.length);
|
|
33
|
-
for (let i = 0; i < bstr.length; i++) {
|
|
34
|
-
buf[i] = bstr.charCodeAt(i);
|
|
35
|
-
}
|
|
36
|
-
return buf;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
throw new AnthropicError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
|
|
40
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export function concatBytes(buffers: Uint8Array[]): Uint8Array {
|
|
2
|
-
let length = 0;
|
|
3
|
-
for (const buffer of buffers) {
|
|
4
|
-
length += buffer.length;
|
|
5
|
-
}
|
|
6
|
-
const output = new Uint8Array(length);
|
|
7
|
-
let index = 0;
|
|
8
|
-
for (const buffer of buffers) {
|
|
9
|
-
output.set(buffer, index);
|
|
10
|
-
index += buffer.length;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return output;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let encodeUTF8_: (str: string) => Uint8Array;
|
|
17
|
-
export function encodeUTF8(str: string) {
|
|
18
|
-
let encoder;
|
|
19
|
-
return (
|
|
20
|
-
encodeUTF8_ ??
|
|
21
|
-
((encoder = new (globalThis as any).TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder)))
|
|
22
|
-
)(str);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let decodeUTF8_: (bytes: Uint8Array) => string;
|
|
26
|
-
export function decodeUTF8(bytes: Uint8Array) {
|
|
27
|
-
let decoder;
|
|
28
|
-
return (
|
|
29
|
-
decodeUTF8_ ??
|
|
30
|
-
((decoder = new (globalThis as any).TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder)))
|
|
31
|
-
)(bytes);
|
|
32
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Read an environment variable.
|
|
5
|
-
*
|
|
6
|
-
* Trims beginning and trailing whitespace.
|
|
7
|
-
*
|
|
8
|
-
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
9
|
-
*/
|
|
10
|
-
export const readEnv = (env: string): string | undefined => {
|
|
11
|
-
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim() ?? undefined;
|
|
13
|
-
}
|
|
14
|
-
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { hasOwn } from './values';
|
|
4
|
-
import { type BaseAnthropic } from '../../client';
|
|
5
|
-
import { RequestOptions } from '../request-options';
|
|
6
|
-
|
|
7
|
-
type LogFn = (message: string, ...rest: unknown[]) => void;
|
|
8
|
-
export type Logger = {
|
|
9
|
-
error: LogFn;
|
|
10
|
-
warn: LogFn;
|
|
11
|
-
info: LogFn;
|
|
12
|
-
debug: LogFn;
|
|
13
|
-
};
|
|
14
|
-
export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
|
|
15
|
-
|
|
16
|
-
const levelNumbers = {
|
|
17
|
-
off: 0,
|
|
18
|
-
error: 200,
|
|
19
|
-
warn: 300,
|
|
20
|
-
info: 400,
|
|
21
|
-
debug: 500,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const parseLogLevel = (
|
|
25
|
-
maybeLevel: string | undefined,
|
|
26
|
-
sourceName: string,
|
|
27
|
-
client: BaseAnthropic,
|
|
28
|
-
): LogLevel | undefined => {
|
|
29
|
-
if (!maybeLevel) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
if (hasOwn(levelNumbers, maybeLevel)) {
|
|
33
|
-
return maybeLevel;
|
|
34
|
-
}
|
|
35
|
-
loggerFor(client).warn(
|
|
36
|
-
`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(
|
|
37
|
-
Object.keys(levelNumbers),
|
|
38
|
-
)}`,
|
|
39
|
-
);
|
|
40
|
-
return undefined;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
function noop() {}
|
|
44
|
-
|
|
45
|
-
function makeLogFn(fnLevel: keyof Logger, logger: Logger | undefined, logLevel: LogLevel) {
|
|
46
|
-
if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
|
|
47
|
-
return noop;
|
|
48
|
-
} else {
|
|
49
|
-
// Don't wrap logger functions, we want the stacktrace intact!
|
|
50
|
-
return logger[fnLevel].bind(logger);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const noopLogger = {
|
|
55
|
-
error: noop,
|
|
56
|
-
warn: noop,
|
|
57
|
-
info: noop,
|
|
58
|
-
debug: noop,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
let cachedLoggers = new WeakMap<Logger, [LogLevel, Logger]>();
|
|
62
|
-
|
|
63
|
-
export function loggerFor(client: BaseAnthropic): Logger {
|
|
64
|
-
const logger = client.logger;
|
|
65
|
-
const logLevel = client.logLevel ?? 'off';
|
|
66
|
-
if (!logger) {
|
|
67
|
-
return noopLogger;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const cachedLogger = cachedLoggers.get(logger);
|
|
71
|
-
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
72
|
-
return cachedLogger[1];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const levelLogger = {
|
|
76
|
-
error: makeLogFn('error', logger, logLevel),
|
|
77
|
-
warn: makeLogFn('warn', logger, logLevel),
|
|
78
|
-
info: makeLogFn('info', logger, logLevel),
|
|
79
|
-
debug: makeLogFn('debug', logger, logLevel),
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
cachedLoggers.set(logger, [logLevel, levelLogger]);
|
|
83
|
-
|
|
84
|
-
return levelLogger;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const formatRequestDetails = (details: {
|
|
88
|
-
options?: RequestOptions | undefined;
|
|
89
|
-
headers?: Headers | Record<string, string> | undefined;
|
|
90
|
-
retryOfRequestLogID?: string | undefined;
|
|
91
|
-
retryOf?: string | undefined;
|
|
92
|
-
url?: string | undefined;
|
|
93
|
-
status?: number | undefined;
|
|
94
|
-
method?: string | undefined;
|
|
95
|
-
durationMs?: number | undefined;
|
|
96
|
-
message?: unknown;
|
|
97
|
-
body?: unknown;
|
|
98
|
-
}) => {
|
|
99
|
-
if (details.options) {
|
|
100
|
-
details.options = { ...details.options };
|
|
101
|
-
delete details.options['headers']; // redundant + leaks internals
|
|
102
|
-
}
|
|
103
|
-
if (details.headers) {
|
|
104
|
-
details.headers = Object.fromEntries(
|
|
105
|
-
(details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
|
|
106
|
-
([name, value]) => [
|
|
107
|
-
name,
|
|
108
|
-
(
|
|
109
|
-
name.toLowerCase() === 'x-api-key' ||
|
|
110
|
-
name.toLowerCase() === 'authorization' ||
|
|
111
|
-
name.toLowerCase() === 'cookie' ||
|
|
112
|
-
name.toLowerCase() === 'set-cookie'
|
|
113
|
-
) ?
|
|
114
|
-
'***'
|
|
115
|
-
: value,
|
|
116
|
-
],
|
|
117
|
-
),
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
if ('retryOfRequestLogID' in details) {
|
|
121
|
-
if (details.retryOfRequestLogID) {
|
|
122
|
-
details.retryOf = details.retryOfRequestLogID;
|
|
123
|
-
}
|
|
124
|
-
delete details.retryOfRequestLogID;
|
|
125
|
-
}
|
|
126
|
-
return details;
|
|
127
|
-
};
|