2026-06-06 20:12:40 +07:00
parent de84b2bf48
commit 97ac0f71f5
13682 changed files with 1125938 additions and 0 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cf5fb591e771b479385ed0cb2ef5e023
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
export interface FileLike {
/**
* Name of the file referenced by the File object.
*/
readonly name: string;
/**
* Returns the media type ([`MIME`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) of the file represented by a `File` object.
*/
readonly type: string;
/**
* Size of the file parts in bytes
*/
readonly size: number;
/**
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
*/
readonly lastModified: number;
/**
* Returns a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) which upon reading returns the data contained within the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
*/
stream(): AsyncIterable<Uint8Array>;
readonly [Symbol.toStringTag]: string;
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 8f4823b1e16fa475197974dbf1a662fb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/FileLike.d.ts
uploadId: 920982
@@ -0,0 +1,160 @@
import { FormDataLike } from "./FormDataLike";
import { FileLike } from "./FileLike";
export interface FormDataEncoderOptions {
/**
* When enabled, the encoder will emit additional per part headers, such as `Content-Length`.
*
* Please note that the web clients do not include these, so when enabled this option might cause an error if `multipart/form-data` does not consider additional headers.
*
* Defaults to `false`.
*/
enableAdditionalHeaders?: boolean;
}
/**
* Implements [`multipart/form-data` encoding algorithm](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm),
* allowing to add support for spec-comliant [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) to an HTTP client.
*/
export declare class FormDataEncoder {
#private;
/**
* Returns boundary string
*/
readonly boundary: string;
/**
* Returns Content-Type header
*/
readonly contentType: string;
/**
* Returns Content-Length header
*/
readonly contentLength: string;
/**
* Returns headers object with Content-Type and Content-Length header
*/
readonly headers: {
"Content-Type": string;
"Content-Length": string;
};
/**
* Creates a multipart/form-data encoder.
*
* @param form FormData object to encode. This object must be a spec-compatible FormData implementation.
* @param boundary An optional boundary string that will be used by the encoder. If there's no boundary string is present, Encoder will generate it automatically.
*
* @example
*
* import {Readable} from "stream"
*
* import {FormData, File, fileFromPath} from "formdata-node"
* import {FormDataEncoder} from "form-data-encoder"
*
* import fetch from "node-fetch"
*
* const form = new FormData()
*
* form.set("field", "Just a random string")
* form.set("file", new File(["Using files is class amazing"], "file.txt"))
* form.set("fileFromPath", await fileFromPath("path/to/a/file.txt"))
*
* const encoder = new FormDataEncoder(form)
*
* const options = {
* method: "post",
* headers: encoder.headers,
* body: Readable.from(encoder)
* }
*
* const response = await fetch("https://httpbin.org/post", options)
*
* console.log(await response.json())
*/
constructor(form: FormDataLike);
constructor(form: FormDataLike, boundary: string);
constructor(form: FormDataLike, options: FormDataEncoderOptions);
constructor(form: FormDataLike, boundary: string, options?: FormDataEncoderOptions);
/**
* Returns form-data content length
*/
getContentLength(): number;
/**
* Creates an iterator allowing to go through form-data parts (with metadata).
* This method **will not** read the files.
*
* Using this method, you can convert form-data content into Blob:
*
* @example
*
* import {Readable} from "stream"
*
* import {FormDataEncoder} from "form-data-encoder"
*
* import {FormData} from "formdata-polyfill/esm-min.js"
* import {fileFrom} from "fetch-blob/form.js"
* import {File} from "fetch-blob/file.js"
* import {Blob} from "fetch-blob"
*
* import fetch from "node-fetch"
*
* const form = new FormData()
*
* form.set("field", "Just a random string")
* form.set("file", new File(["Using files is class amazing"]))
* form.set("fileFromPath", await fileFrom("path/to/a/file.txt"))
*
* const encoder = new FormDataEncoder(form)
*
* const options = {
* method: "post",
* body: new Blob(encoder, {type: encoder.contentType})
* }
*
* const response = await fetch("https://httpbin.org/post", options)
*
* console.log(await response.json())
*/
values(): Generator<Uint8Array | FileLike, void, undefined>;
/**
* Creates an async iterator allowing to perform the encoding by portions.
* This method **will** also read files.
*
* @example
*
* import {Readable} from "stream"
*
* import {FormData, File, fileFromPath} from "formdata-node"
* import {FormDataEncoder} from "form-data-encoder"
*
* import fetch from "node-fetch"
*
* const form = new FormData()
*
* form.set("field", "Just a random string")
* form.set("file", new File(["Using files is class amazing"], "file.txt"))
* form.set("fileFromPath", await fileFromPath("path/to/a/file.txt"))
*
* const encoder = new FormDataEncoder(form)
*
* const options = {
* method: "post",
* headers: encoder.headers,
* body: Readable.from(encoder.encode()) // or Readable.from(encoder)
* }
*
* const response = await fetch("https://httpbin.org/post", options)
*
* console.log(await response.json())
*/
encode(): AsyncGenerator<Uint8Array, void, undefined>;
/**
* Creates an iterator allowing to read through the encoder data using for...of loops
*/
[Symbol.iterator](): Generator<Uint8Array | FileLike, void, undefined>;
/**
* Creates an **async** iterator allowing to read through the encoder data using for-await...of loops
*/
[Symbol.asyncIterator](): AsyncGenerator<Uint8Array, void, undefined>;
}
/**
* @deprecated Use FormDataEncoder to import the encoder class instead
*/
export declare const Encoder: typeof FormDataEncoder;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: f637d0d6320664180946fad4633b48c8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts
uploadId: 920982
@@ -0,0 +1,40 @@
import { FileLike } from "./FileLike";
/**
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
*/
export declare type FormDataEntryValue = string | FileLike;
/**
* This interface reflects minimal shape of the FormData
*/
export interface FormDataLike {
/**
* Appends a new value onto an existing key inside a FormData object,
* or adds the key if it does not already exist.
*
* The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
*
* @param name The name of the field whose data is contained in `value`.
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
*/
append(name: string, value: unknown, fileName?: string): void;
/**
* Returns all the values associated with a given key from within a `FormData` object.
*
* @param {string} name A name of the value you want to retrieve.
*
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
*/
getAll(name: string): FormDataEntryValue[];
/**
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
* The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
*/
entries(): Generator<[string, FormDataEntryValue]>;
/**
* An alias for FormDataLike#entries()
*/
[Symbol.iterator](): Generator<[string, FormDataEntryValue]>;
readonly [Symbol.toStringTag]: string;
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: b991bdf2baab74b40a0be7c2ded36020
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/FormDataLike.d.ts
uploadId: 920982
@@ -0,0 +1,5 @@
export * from "./FormDataEncoder";
export * from "./FileLike";
export * from "./FormDataLike";
export * from "./util/isFileLike";
export * from "./util/isFormData";
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: af9b8773e90c9455eb7439c41f573006
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/index.d.ts
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bef3cd0b4668240f497d202befce369b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
/**
* Generates a boundary string for FormData encoder.
*
* @api private
*
* ```js
* import createBoundary from "./util/createBoundary"
*
* createBoundary() // -> n2vw38xdagaq6lrv
* ```
*/
declare function createBoundary(): string;
export default createBoundary;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 5d2bbaadba9954e5c965ddd3d53d2d6f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/createBoundary.d.ts
uploadId: 920982
@@ -0,0 +1,11 @@
/**
* Escape fieldname following the spec requirements.
*
* See: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data
*
* @param name A fieldname to escape
*
* @api private
*/
declare const escapeName: (name: unknown) => string;
export default escapeName;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 86878f5cc3152466a88b78aa5e898006
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/escapeName.d.ts
uploadId: 920982
@@ -0,0 +1,28 @@
import { FileLike } from "../FileLike";
/**
* Check if given object is `File`.
*
* Note that this function will return `false` for Blob, because the FormDataEncoder expects FormData to return File when a value is binary data.
*
* @param value an object to test
*
* @api public
*
* This function will return `true` for FileAPI compatible `File` objects:
*
* ```
* import {isFileLike} from "form-data-encoder"
*
* isFileLike(new File(["Content"], "file.txt")) // -> true
* ```
*
* However, if you pass a Node.js `Buffer` or `ReadStream`, it will return `false`:
*
* ```js
* import {isFileLike} from "form-data-encoder"
*
* isFileLike(Buffer.from("Content")) // -> false
* isFileLike(fs.createReadStream("path/to/a/file.txt")) // -> false
* ```
*/
export declare const isFileLike: (value?: unknown) => value is FileLike;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 7aad3dfdd36ff4040b3608aac9795529
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/isFileLike.d.ts
uploadId: 920982
@@ -0,0 +1,15 @@
import { FormDataLike } from "../FormDataLike";
/**
* Check if given object is FormData
*
* @param value an object to test
*/
export declare const isFormData: (value?: unknown) => value is FormDataLike;
/**
* Check if given object is FormData
*
* @param value an object to test
*
* @deprecated use `isFormData` instead.
*/
export declare const isFormDataLike: (value?: unknown) => value is FormDataLike;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 01ad150c870d046ef976f248380c33e4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/isFormData.d.ts
uploadId: 920982
@@ -0,0 +1,7 @@
/**
* Checks if given value is a function.
*
* @api private
*/
declare const isFunction: (value: unknown) => value is Function;
export default isFunction;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: a29cb784f84b8450980b91f737672c65
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/isFunction.d.ts
uploadId: 920982
@@ -0,0 +1,2 @@
declare function isPlainObject(value: unknown): value is object;
export default isPlainObject;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 56779a1be673946789d22011cff67fc7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts
uploadId: 920982
@@ -0,0 +1,11 @@
/**
* Normalize non-File value following the spec requirements.
*
* See: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data
*
* @param value A value to normalize
*
* @api private
*/
declare const normalizeValue: (value: unknown) => string;
export default normalizeValue;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: dcdb4a9e907c249899a3fbcee8b94cec
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e7ec4fd13e64c4af9b8b92d5748b33b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c38edd10f6514e92a18a79bbe8ea8a2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: dee191bef1ac0489daa3055439a155a4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/FileLike.js
uploadId: 920982
@@ -0,0 +1,126 @@
"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _FormDataEncoder_instances, _FormDataEncoder_CRLF, _FormDataEncoder_CRLF_BYTES, _FormDataEncoder_CRLF_BYTES_LENGTH, _FormDataEncoder_DASHES, _FormDataEncoder_encoder, _FormDataEncoder_footer, _FormDataEncoder_form, _FormDataEncoder_options, _FormDataEncoder_getFieldHeader;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Encoder = exports.FormDataEncoder = void 0;
const createBoundary_1 = __importDefault(require("./util/createBoundary"));
const isPlainObject_1 = __importDefault(require("./util/isPlainObject"));
const normalizeValue_1 = __importDefault(require("./util/normalizeValue"));
const escapeName_1 = __importDefault(require("./util/escapeName"));
const isFileLike_1 = require("./util/isFileLike");
const isFormData_1 = require("./util/isFormData");
const defaultOptions = {
enableAdditionalHeaders: false
};
class FormDataEncoder {
constructor(form, boundaryOrOptions, options) {
_FormDataEncoder_instances.add(this);
_FormDataEncoder_CRLF.set(this, "\r\n");
_FormDataEncoder_CRLF_BYTES.set(this, void 0);
_FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0);
_FormDataEncoder_DASHES.set(this, "-".repeat(2));
_FormDataEncoder_encoder.set(this, new TextEncoder());
_FormDataEncoder_footer.set(this, void 0);
_FormDataEncoder_form.set(this, void 0);
_FormDataEncoder_options.set(this, void 0);
if (!(0, isFormData_1.isFormData)(form)) {
throw new TypeError("Expected first argument to be a FormData instance.");
}
let boundary;
if ((0, isPlainObject_1.default)(boundaryOrOptions)) {
options = boundaryOrOptions;
}
else {
boundary = boundaryOrOptions;
}
if (!boundary) {
boundary = (0, createBoundary_1.default)();
}
if (typeof boundary !== "string") {
throw new TypeError("Expected boundary argument to be a string.");
}
if (options && !(0, isPlainObject_1.default)(options)) {
throw new TypeError("Expected options argument to be an object.");
}
__classPrivateFieldSet(this, _FormDataEncoder_form, form, "f");
__classPrivateFieldSet(this, _FormDataEncoder_options, { ...defaultOptions, ...options }, "f");
__classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")), "f");
__classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f");
this.boundary = `form-data-boundary-${boundary}`;
this.contentType = `multipart/form-data; boundary=${this.boundary}`;
__classPrivateFieldSet(this, _FormDataEncoder_footer, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f");
this.contentLength = String(this.getContentLength());
this.headers = Object.freeze({
"Content-Type": this.contentType,
"Content-Length": this.contentLength
});
Object.defineProperties(this, {
boundary: { writable: false, configurable: false },
contentType: { writable: false, configurable: false },
contentLength: { writable: false, configurable: false },
headers: { writable: false, configurable: false }
});
}
getContentLength() {
let length = 0;
for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f")) {
const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw));
length += __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value).byteLength;
length += (0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength;
length += __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f");
}
return length + __classPrivateFieldGet(this, _FormDataEncoder_footer, "f").byteLength;
}
*values() {
for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f").entries()) {
const value = (0, isFileLike_1.isFileLike)(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode((0, normalizeValue_1.default)(raw));
yield __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value);
yield value;
yield __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f");
}
yield __classPrivateFieldGet(this, _FormDataEncoder_footer, "f");
}
async *encode() {
for (const part of this.values()) {
if ((0, isFileLike_1.isFileLike)(part)) {
yield* part.stream();
}
else {
yield part;
}
}
}
[(_FormDataEncoder_CRLF = new WeakMap(), _FormDataEncoder_CRLF_BYTES = new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = new WeakMap(), _FormDataEncoder_DASHES = new WeakMap(), _FormDataEncoder_encoder = new WeakMap(), _FormDataEncoder_footer = new WeakMap(), _FormDataEncoder_form = new WeakMap(), _FormDataEncoder_options = new WeakMap(), _FormDataEncoder_instances = new WeakSet(), _FormDataEncoder_getFieldHeader = function _FormDataEncoder_getFieldHeader(name, value) {
let header = "";
header += `${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`;
header += `Content-Disposition: form-data; name="${(0, escapeName_1.default)(name)}"`;
if ((0, isFileLike_1.isFileLike)(value)) {
header += `; filename="${(0, escapeName_1.default)(value.name)}"${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`;
header += `Content-Type: ${value.type || "application/octet-stream"}`;
}
if (__classPrivateFieldGet(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true) {
header += `${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${(0, isFileLike_1.isFileLike)(value) ? value.size : value.byteLength}`;
}
return __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`);
}, Symbol.iterator)]() {
return this.values();
}
[Symbol.asyncIterator]() {
return this.encode();
}
}
exports.FormDataEncoder = FormDataEncoder;
exports.Encoder = FormDataEncoder;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 7c79a4549eeec40039c2051b8c1960a9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/FormDataEncoder.js
uploadId: 920982
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 19ce3b731f3ee46338ec4b232acb943c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/FormDataLike.js
uploadId: 920982
@@ -0,0 +1,17 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./FormDataEncoder"), exports);
__exportStar(require("./FileLike"), exports);
__exportStar(require("./FormDataLike"), exports);
__exportStar(require("./util/isFileLike"), exports);
__exportStar(require("./util/isFormData"), exports);
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: ab33a66ad86994bf8a236afcf9b87591
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/index.js
uploadId: 920982
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 3b5a07d94bb9b4038bbde070340a6ae4
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/package.json
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 41477e6b4ee744c19a0e19a85a2e6696
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
function createBoundary() {
let size = 16;
let res = "";
while (size--) {
res += alphabet[(Math.random() * alphabet.length) << 0];
}
return res;
}
exports.default = createBoundary;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 69804b67ed5544bda9c3be1da3f7dea9
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/createBoundary.js
uploadId: 920982
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const escapeName = (name) => String(name)
.replace(/\r/g, "%0D")
.replace(/\n/g, "%0A")
.replace(/"/g, "%22");
exports.default = escapeName;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 3c54ab35f1b124cf491d87ce0614dbbb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/escapeName.js
uploadId: 920982
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFileLike = void 0;
const isFunction_1 = __importDefault(require("./isFunction"));
const isFileLike = (value) => Boolean(value
&& typeof value === "object"
&& (0, isFunction_1.default)(value.constructor)
&& value[Symbol.toStringTag] === "File"
&& (0, isFunction_1.default)(value.stream)
&& value.name != null
&& value.size != null
&& value.lastModified != null);
exports.isFileLike = isFileLike;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: a3b840819446a4b0485eda15461f331f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/isFileLike.js
uploadId: 920982
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFormDataLike = exports.isFormData = void 0;
const isFunction_1 = __importDefault(require("./isFunction"));
const isFormData = (value) => Boolean(value
&& (0, isFunction_1.default)(value.constructor)
&& value[Symbol.toStringTag] === "FormData"
&& (0, isFunction_1.default)(value.append)
&& (0, isFunction_1.default)(value.getAll)
&& (0, isFunction_1.default)(value.entries)
&& (0, isFunction_1.default)(value[Symbol.iterator]));
exports.isFormData = isFormData;
exports.isFormDataLike = exports.isFormData;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: d9c8d814be8a24373a44742d725ef1c8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/isFormData.js
uploadId: 920982
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const isFunction = (value) => (typeof value === "function");
exports.default = isFunction;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 04fb42954e5884f2c8aa780d76e7f30a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/isFunction.js
uploadId: 920982
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());
function isPlainObject(value) {
if (getType(value) !== "object") {
return false;
}
const pp = Object.getPrototypeOf(value);
if (pp === null || pp === undefined) {
return true;
}
const Ctor = pp.constructor && pp.constructor.toString();
return Ctor === Object.toString();
}
exports.default = isPlainObject;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 392175b2733ab40268192f30a774e2c7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/isPlainObject.js
uploadId: 920982
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const normalizeValue = (value) => String(value)
.replace(/\r|\n/g, (match, i, str) => {
if ((match === "\r" && str[i + 1] !== "\n")
|| (match === "\n" && str[i - 1] !== "\r")) {
return "\r\n";
}
return match;
});
exports.default = normalizeValue;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 9901e4347ffbf4ca994eb92e333c1186
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/cjs/util/normalizeValue.js
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 56fc8eaa6d6334c61a3ca279cb1770e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 3a0706e8e0d1a4ae79e83c88c42a98fa
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/FileLike.js
uploadId: 920982
@@ -0,0 +1,119 @@
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _FormDataEncoder_instances, _FormDataEncoder_CRLF, _FormDataEncoder_CRLF_BYTES, _FormDataEncoder_CRLF_BYTES_LENGTH, _FormDataEncoder_DASHES, _FormDataEncoder_encoder, _FormDataEncoder_footer, _FormDataEncoder_form, _FormDataEncoder_options, _FormDataEncoder_getFieldHeader;
import createBoundary from "./util/createBoundary.js";
import isPlainObject from "./util/isPlainObject.js";
import normalize from "./util/normalizeValue.js";
import escape from "./util/escapeName.js";
import { isFileLike } from "./util/isFileLike.js";
import { isFormData } from "./util/isFormData.js";
const defaultOptions = {
enableAdditionalHeaders: false
};
export class FormDataEncoder {
constructor(form, boundaryOrOptions, options) {
_FormDataEncoder_instances.add(this);
_FormDataEncoder_CRLF.set(this, "\r\n");
_FormDataEncoder_CRLF_BYTES.set(this, void 0);
_FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0);
_FormDataEncoder_DASHES.set(this, "-".repeat(2));
_FormDataEncoder_encoder.set(this, new TextEncoder());
_FormDataEncoder_footer.set(this, void 0);
_FormDataEncoder_form.set(this, void 0);
_FormDataEncoder_options.set(this, void 0);
if (!isFormData(form)) {
throw new TypeError("Expected first argument to be a FormData instance.");
}
let boundary;
if (isPlainObject(boundaryOrOptions)) {
options = boundaryOrOptions;
}
else {
boundary = boundaryOrOptions;
}
if (!boundary) {
boundary = createBoundary();
}
if (typeof boundary !== "string") {
throw new TypeError("Expected boundary argument to be a string.");
}
if (options && !isPlainObject(options)) {
throw new TypeError("Expected options argument to be an object.");
}
__classPrivateFieldSet(this, _FormDataEncoder_form, form, "f");
__classPrivateFieldSet(this, _FormDataEncoder_options, { ...defaultOptions, ...options }, "f");
__classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")), "f");
__classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f");
this.boundary = `form-data-boundary-${boundary}`;
this.contentType = `multipart/form-data; boundary=${this.boundary}`;
__classPrivateFieldSet(this, _FormDataEncoder_footer, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f");
this.contentLength = String(this.getContentLength());
this.headers = Object.freeze({
"Content-Type": this.contentType,
"Content-Length": this.contentLength
});
Object.defineProperties(this, {
boundary: { writable: false, configurable: false },
contentType: { writable: false, configurable: false },
contentLength: { writable: false, configurable: false },
headers: { writable: false, configurable: false }
});
}
getContentLength() {
let length = 0;
for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f")) {
const value = isFileLike(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(normalize(raw));
length += __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value).byteLength;
length += isFileLike(value) ? value.size : value.byteLength;
length += __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f");
}
return length + __classPrivateFieldGet(this, _FormDataEncoder_footer, "f").byteLength;
}
*values() {
for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f").entries()) {
const value = isFileLike(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(normalize(raw));
yield __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value);
yield value;
yield __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f");
}
yield __classPrivateFieldGet(this, _FormDataEncoder_footer, "f");
}
async *encode() {
for (const part of this.values()) {
if (isFileLike(part)) {
yield* part.stream();
}
else {
yield part;
}
}
}
[(_FormDataEncoder_CRLF = new WeakMap(), _FormDataEncoder_CRLF_BYTES = new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = new WeakMap(), _FormDataEncoder_DASHES = new WeakMap(), _FormDataEncoder_encoder = new WeakMap(), _FormDataEncoder_footer = new WeakMap(), _FormDataEncoder_form = new WeakMap(), _FormDataEncoder_options = new WeakMap(), _FormDataEncoder_instances = new WeakSet(), _FormDataEncoder_getFieldHeader = function _FormDataEncoder_getFieldHeader(name, value) {
let header = "";
header += `${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`;
header += `Content-Disposition: form-data; name="${escape(name)}"`;
if (isFileLike(value)) {
header += `; filename="${escape(value.name)}"${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`;
header += `Content-Type: ${value.type || "application/octet-stream"}`;
}
if (__classPrivateFieldGet(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true) {
header += `${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${isFileLike(value) ? value.size : value.byteLength}`;
}
return __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`);
}, Symbol.iterator)]() {
return this.values();
}
[Symbol.asyncIterator]() {
return this.encode();
}
}
export const Encoder = FormDataEncoder;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 61e3f6d5f6ed840318da0619779f8b9c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/FormDataEncoder.js
uploadId: 920982
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 4444989fd38464871a402228d54313e1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/FormDataLike.js
uploadId: 920982
@@ -0,0 +1,5 @@
export * from "./FormDataEncoder.js";
export * from "./FileLike.js";
export * from "./FormDataLike.js";
export * from "./util/isFileLike.js";
export * from "./util/isFormData.js";
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 1ab9769de2dd94bc097247ca013b0d9f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/index.js
uploadId: 920982
@@ -0,0 +1,3 @@
{
"type": "module"
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 30c626c874f3c42a09d439b256df9d46
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/package.json
uploadId: 920982
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9cdc59262938f4612b27fbc558867f04
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
function createBoundary() {
let size = 16;
let res = "";
while (size--) {
res += alphabet[(Math.random() * alphabet.length) << 0];
}
return res;
}
export default createBoundary;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 220de517c87d14d26bc9443126ea6a04
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/createBoundary.js
uploadId: 920982
@@ -0,0 +1,5 @@
const escapeName = (name) => String(name)
.replace(/\r/g, "%0D")
.replace(/\n/g, "%0A")
.replace(/"/g, "%22");
export default escapeName;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 55b68153608a44deca059b9121f842bb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/escapeName.js
uploadId: 920982
@@ -0,0 +1,9 @@
import isFunction from "./isFunction.js";
export const isFileLike = (value) => Boolean(value
&& typeof value === "object"
&& isFunction(value.constructor)
&& value[Symbol.toStringTag] === "File"
&& isFunction(value.stream)
&& value.name != null
&& value.size != null
&& value.lastModified != null);
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 6c1af118d50f446cdaafa8876ffcee76
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/isFileLike.js
uploadId: 920982
@@ -0,0 +1,9 @@
import isFunction from "./isFunction.js";
export const isFormData = (value) => Boolean(value
&& isFunction(value.constructor)
&& value[Symbol.toStringTag] === "FormData"
&& isFunction(value.append)
&& isFunction(value.getAll)
&& isFunction(value.entries)
&& isFunction(value[Symbol.iterator]));
export const isFormDataLike = isFormData;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 728975fa105f54978b913d4e8a46931d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/isFormData.js
uploadId: 920982
@@ -0,0 +1,2 @@
const isFunction = (value) => (typeof value === "function");
export default isFunction;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: ea364ea9f42a840c2beeb5fa68a395ae
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/isFunction.js
uploadId: 920982
@@ -0,0 +1,13 @@
const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());
function isPlainObject(value) {
if (getType(value) !== "object") {
return false;
}
const pp = Object.getPrototypeOf(value);
if (pp === null || pp === undefined) {
return true;
}
const Ctor = pp.constructor && pp.constructor.toString();
return Ctor === Object.toString();
}
export default isPlainObject;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 194807ef7c174477b9610420a535fbc2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
uploadId: 920982
@@ -0,0 +1,9 @@
const normalizeValue = (value) => String(value)
.replace(/\r|\n/g, (match, i, str) => {
if ((match === "\r" && str[i + 1] !== "\n")
|| (match === "\n" && str[i - 1] !== "\r")) {
return "\r\n";
}
return match;
});
export default normalizeValue;
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: bfb80266df6904b659ef19776be09d10
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/lib/esm/util/normalizeValue.js
uploadId: 920982
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2021-present Nick K.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 2cbfd9b73cc814cd0b269c1115c9acb0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/license
uploadId: 920982
@@ -0,0 +1,63 @@
{
"name": "form-data-encoder",
"version": "1.7.2",
"description": "Encode FormData content into the multipart/form-data format",
"repository": "octet-stream/form-data-encoder",
"sideEffects": false,
"keywords": [
"form-data",
"encoder",
"multipart",
"files-upload",
"async-iterator",
"spec-compatible",
"form"
],
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
"types": "./@type/index.d.ts",
"exports": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
},
"scripts": {
"eslint": "eslint lib/**/*.ts",
"staged": "lint-staged",
"coverage": "c8 npm test",
"ci": "c8 npm test && c8 report --reporter=json",
"build:esm": "ttsc --project tsconfig.esm.json",
"build:cjs": "ttsc --project tsconfig.cjs.json",
"build:types": "ttsc --project tsconfig.d.ts.json",
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"test": "ava --fail-fast",
"cleanup": "npx rimraf @type \"lib/**/*.js\"",
"prepare": "npm run cleanup && npm run build",
"_postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
},
"author": "Nick K.",
"license": "MIT",
"devDependencies": {
"@octetstream/eslint-config": "5.0.0",
"@types/mime-types": "2.1.1",
"@types/node": "17.0.21",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"@zoltu/typescript-transformer-append-js-extension": "1.0.1",
"ava": "4.1.0",
"c8": "7.11.0",
"eslint": "7.32.0",
"eslint-config-airbnb-typescript": "12.3.1",
"eslint-plugin-ava": "12.0.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.26.1",
"formdata-node": "4.3.2",
"husky": "7.0.4",
"lint-staged": "12.3.7",
"pinst": "2.1.6",
"ts-node": "10.7.0",
"ttypescript": "1.5.13",
"typescript": "4.4.4"
}
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 7e03e8d3c43014bd6bde4c281cfa84f3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/package.json
uploadId: 920982
@@ -0,0 +1,366 @@
# form-data-encoder
Encode `FormData` content into the `multipart/form-data` format
[![Code Coverage](https://codecov.io/github/octet-stream/form-data-encoder/coverage.svg?branch=master)](https://codecov.io/github/octet-stream/form-data-encoder?branch=master)
[![CI](https://github.com/octet-stream/form-data-encoder/workflows/CI/badge.svg)](https://github.com/octet-stream/form-data-encoder/actions/workflows/ci.yml)
[![ESLint](https://github.com/octet-stream/form-data-encoder/workflows/ESLint/badge.svg)](https://github.com/octet-stream/form-data-encoder/actions/workflows/eslint.yml)
## Installation
You can install this package using npm:
```sh
npm install form-data-encoder
```
Or yarn:
```sh
yarn add form-data-encoder
```
Or pnpm:
```sh
pnpm add form-data-encoder
```
## ESM/CJS support
This package is targeting ESM and CJS for backwards compatibility reasons and smoothen transition period while you convert your projects to ESM only. Note that CJS support will be removed as [Node.js v12 will reach its EOL](https://github.com/nodejs/release#release-schedule). This change will be released as major version update, so you won't miss it.
## Usage
1. To start the encoding process, you need to create a new Encoder instance with the FormData you want to encode:
```js
import {Readable} from "stream"
import {FormData, File} from "formdata-node"
import {FormDataEncoder} from "form-data-encoder"
import fetch from "node-fetch"
const form = new FormData()
form.set("greeting", "Hello, World!")
form.set("file", new File(["On Soviet Moon landscape see binoculars through YOU"], "file.txt"))
const encoder = new FormDataEncoder(form)
const options = {
method: "post",
// Set request headers provided by the Encoder.
// The `headers` property has `Content-Type` and `Content-Length` headers.
headers: encoder.headers,
// Create a Readable stream from the Encoder.
// You can omit usage of `Readable.from` for HTTP clients whose support async iterables in request body.
// The Encoder will yield FormData content portions encoded into the multipart/form-data format as node-fetch consumes the stream.
body: Readable.from(encoder.encode()) // or just Readable.from(encoder)
}
const response = await fetch("https://httpbin.org/post", options)
console.log(await response.json())
```
2. Encoder support different spec-compatible FormData implementations. Let's try it with [`formdata-polyfill`](https://github.com/jimmywarting/FormData):
```js
import {Readable} from "stream"
import {FormDataEncoder} from "form-data-encoder"
import {FormData} from "formdata-polyfill/esm-min.js"
import {File} from "fetch-blob" // v3
const form = new FormData()
form.set("field", "Some value")
form.set("file", new File(["File content goes here"], "file.txt"))
const encoder = new FormDataEncoder(form)
const options = {
method: "post",
headers: encoder.headers,
body: Readable.from(encoder)
}
await fetch("https://httpbin.org/post", options)
```
3. Because the Encoder is iterable (it has both Symbol.asyncIterator and Symbol.iterator methods), you can use it with different targets. Let's say you want to convert FormData content into `Blob`, for that you can write a function like this:
```js
import {Readable} from "stream"
import {FormDataEncoder} from "form-data-encoder"
import {FormData, File, Blob, fileFromPath} from "formdata-node"
import fetch from "node-fetch"
const form = new FormData()
form.set("field", "Just a random string")
form.set("file", new File(["Using files is class amazing"], "file.txt"))
form.set("fileFromPath", await fileFromPath("path/to/a/file.txt"))
// Note 1: When using with native Blob or fetch-blob@2 you might also need to generate boundary string for your FormDataEncoder instance
// because Blob will lowercase value of the `type` option and default boundary generator produces a string with both lower and upper cased alphabetical characters. Math.random() should be enough to fix this:
// const encoder = new FormDataEncoder(form, String(Math.random()))
const encoder = new FormDataEncoder(form)
const options = {
method: "post",
// Note 2: To use this approach with fetch-blob@2 you probably gonna need to convert the encoder parts output to an array first:
// new Blob([...encoder], {type: encoder.contentType})
body: new Blob(encoder, {type: encoder.contentType})
}
const response = await fetch("https://httpbin.org/post", options)
console.log(await response.json())
```
4. Here's FormData to Blob conversion with async-iterator approach:
```js
import {FormData} from "formdata-polyfill/esm-min.js"
import {blobFrom} from "fetch-blob/from.js"
import {FormDataEncoder} from "form-data-encoder"
import Blob from "fetch-blob"
import fetch from "node-fetch"
// This approach may require much more RAM compared to the previous one, but it works too.
async function toBlob(form) {
const encoder = new Encoder(form)
const chunks = []
for await (const chunk of encoder) {
chunks.push(chunk)
}
return new Blob(chunks, {type: encoder.contentType})
}
const form = new FormData()
form.set("name", "John Doe")
form.set("avatar", await blobFrom("path/to/an/avatar.png"), "avatar.png")
const options = {
method: "post",
body: await toBlob(form)
}
await fetch("https://httpbin.org/post", options)
```
5. Another way to convert FormData parts to blob using `form-data-encoder` is making a Blob-ish class:
```js
import {Readable} from "stream"
import {FormDataEncoder} from "form-data-encoder"
import {FormData} from "formdata-polyfill/esm-min.js"
import {blobFrom} from "fetch-blob/from.js"
import Blob from "fetch-blob"
import fetch from "node-fetch"
class BlobDataItem {
constructor(encoder) {
this.#encoder = encoder
this.#size = encoder.headers["Content-Length"]
this.#type = encoder.headers["Content-Type"]
}
get type() {
return this.#type
}
get size() {
return this.#size
}
stream() {
return Readable.from(this.#encoder)
}
get [Symbol.toStringTag]() {
return "Blob"
}
}
const form = new FormData()
form.set("name", "John Doe")
form.set("avatar", await blobFrom("path/to/an/avatar.png"), "avatar.png")
const encoder = new FormDataEncoder(form)
// Note that node-fetch@2 performs more strictness tests for Blob objects, so you may need to do extra steps before you set up request body (like, maybe you'll need to instaniate a Blob with BlobDataItem as one of its blobPart)
const blob = new BlobDataItem(enocoder) // or new Blob([new BlobDataItem(enocoder)], {type: encoder.contentType})
const options = {
method: "post",
body: blob
}
await fetch("https://httpbin.org/post", options)
```
6. In this example we will pull FormData content into the ReadableStream:
```js
// This module is only necessary when you targeting Node.js or need web streams that implement Symbol.asyncIterator
import {ReadableStream} from "web-streams-polyfill/ponyfill/es2018"
import {FormDataEncoder} from "form-data-encoder"
import {FormData} from "formdata-node"
import fetch from "node-fetch"
function toReadableStream(encoder) {
const iterator = encoder.encode()
return new ReadableStream({
async pull(controller) {
const {value, done} = await iterator.next()
if (done) {
return controller.close()
}
controller.enqueue(value)
}
})
}
const form = new FormData()
form.set("field", "My hovercraft is full of eels")
const encoder = new FormDataEncoder(form)
const options = {
method: "post",
headers: encoder.headers,
body: toReadableStream(encoder)
}
// Note that this example requires `fetch` to support Symbol.asyncIterator, which node-fetch lacks of (but will support eventually)
await fetch("https://httpbin.org/post", options)
```
7. Speaking of async iterables - if HTTP client supports them, you can use encoder like this:
```js
import {FormDataEncoder} from "form-data-encoder"
import {FormData} from "formdata-node"
import fetch from "node-fetch"
const form = new FormData()
form.set("field", "My hovercraft is full of eels")
const encoder = new FormDataEncoder(form)
const options = {
method: "post",
headers: encoder.headers,
body: encoder
}
await fetch("https://httpbin.org/post", options)
```
8. ...And for those client whose supporting form-data-encoder out of the box, the usage will be much, much more simpler:
```js
import {FormData} from "formdata-node" // Or any other spec-compatible implementation
import fetch from "node-fetch"
const form = new FormData()
form.set("field", "My hovercraft is full of eels")
const options = {
method: "post",
body: form
}
// Note that node-fetch does NOT support form-data-encoder
await fetch("https://httpbin.org/post", options)
```
## API
### `class FormDataEncoder`
##### `constructor(form[, boundary, options]) -> {Encoder}`
- **{FormDataLike}** form - FormData object to encode. This object must be a spec-compatible FormData implementation.
- **{string}** [boundary] - An optional boundary string that will be used by the encoder. If there's no boundary string is present, Encoder will generate it automatically.
- **{object}** [options] - Encoder options.
- **{boolean}** [options.enableAdditionalHeaders = false] - When enabled, the encoder will emit additional per part headers, such as `Content-Length`. Please note that the web clients do not include these, so when enabled this option might cause an error if `multipart/form-data` does not consider additional headers.
Creates a multipart/form-data encoder.
#### Instance properties
##### `boundary -> {string}`
Returns boundary string.
##### `contentType -> {string}`
Returns Content-Type header.
##### `contentLength -> {string}`
Return Content-Length header.
##### `headers -> {object}`
Returns headers object with Content-Type and Content-Length header.
#### Instance methods
##### `values() -> {Generator<Uint8Array | FileLike, void, undefined>}`
Creates an iterator allowing to go through form-data parts (with metadata).
This method **will not** read the files.
##### `encode() -> {AsyncGenerator<Uint8Array, void, undefined>}`
Creates an async iterator allowing to perform the encoding by portions.
This method **will** also read files.
##### `[Symbol.iterator]() -> {Generator<Uint8Array | FileLike, void, undefined>}`
An alias for `Encoder#values()` method.
##### `[Symbol.asyncIterator]() -> {AsyncGenerator<Uint8Array, void, undefined>}`
An alias for `Encoder#encode()` method.
### `isFileLike(value) -> {boolean}`
Check if a value is File-ish object.
- **{unknown}** value - a value to test
### `isFormDataLike(value) -> {boolean}`
Check if a value is FormData-ish object.
- **{unknown}** value - a value to test
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: c35755b52abf64f138654ab9c465b7fc
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 336030
packageName: Synaptic AI Pro - Natural Language Control for Unity
packageVersion: 1.2.23
assetPath: Assets/Synaptic AI Pro/MCPServer/node_modules/form-data-encoder/readme.md
uploadId: 920982