add .gitignore, clean up generated files from node_modules

Remove from tracking:
- dist/ (build output, regenerated by bun run build.ts)
- node_modules/.pnpm/ (pnpm internal store, 247MB)
- node_modules/.bin/ (executable symlinks)
- node_modules/.ignored/ and .ignored_* (source-map dirs moved aside by pnpm)
- 100 pnpm-installed package symlinks (regenerated by pnpm install)

Keep in tracking:
- Private package stubs not on npm (color-diff-napi, modifiers-napi,
  @ant/claude-for-chrome-mcp, @anthropic-ai/mcpb, @anthropic-ai/sandbox-runtime)
- Source-map extracted packages not installed by pnpm (@grpc/*, @protobufjs/*, etc.)
This commit is contained in:
janlaywss
2026-03-31 21:03:06 +08:00
parent 32f7ca235c
commit 0d5abe8837
35239 changed files with 91 additions and 4753480 deletions

View File

@@ -1,68 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sdkStreamMixin = void 0;
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
const util_base64_1 = require("@smithy/util-base64");
const util_hex_encoding_1 = require("@smithy/util-hex-encoding");
const util_utf8_1 = require("@smithy/util-utf8");
const stream_type_check_1 = require("./stream-type-check");
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
const sdkStreamMixin = (stream) => {
if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) {
const name = stream?.__proto__?.constructor?.name || stream;
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
}
let transformed = false;
const transformToByteArray = async () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
transformed = true;
return await (0, fetch_http_handler_1.streamCollector)(stream);
};
const blobToWebStream = (blob) => {
if (typeof blob.stream !== "function") {
throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\n" +
"If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
}
return blob.stream();
};
return Object.assign(stream, {
transformToByteArray: transformToByteArray,
transformToString: async (encoding) => {
const buf = await transformToByteArray();
if (encoding === "base64") {
return (0, util_base64_1.toBase64)(buf);
}
else if (encoding === "hex") {
return (0, util_hex_encoding_1.toHex)(buf);
}
else if (encoding === undefined || encoding === "utf8" || encoding === "utf-8") {
return (0, util_utf8_1.toUtf8)(buf);
}
else if (typeof TextDecoder === "function") {
return new TextDecoder(encoding).decode(buf);
}
else {
throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
}
},
transformToWebStream: () => {
if (transformed) {
throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
}
transformed = true;
if (isBlobInstance(stream)) {
return blobToWebStream(stream);
}
else if ((0, stream_type_check_1.isReadableStream)(stream)) {
return stream;
}
else {
throw new Error(`Cannot transform payload to web stream, got ${stream}`);
}
},
});
};
exports.sdkStreamMixin = sdkStreamMixin;
const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;