[Add] Synaptic AI Pro
https://assetstore.unity.com/packages/tools/generative-ai/synaptic-ai-pro-natural-language-control-for-unity-336030
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d299ae4f99b104e998ec3a6d01e991d3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export class MultipartBody {
|
||||
constructor(public body: any) {}
|
||||
get [Symbol.toStringTag](): string {
|
||||
return 'MultipartBody';
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ddd61343cbe514631b8a065a7a298e63
|
||||
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/openai/src/_shims/MultipartBody.ts
|
||||
uploadId: 920982
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
# 👋 Wondering what everything in here does?
|
||||
|
||||
`openai` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
|
||||
edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
|
||||
|
||||
To do this, `openai` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
|
||||
|
||||
It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
|
||||
automatically select the correct shims for each environment. However, conditional exports are a fairly new
|
||||
feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
|
||||
|
||||
setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
|
||||
Unfortunately that's still the default setting, and it can result in errors like
|
||||
getting the wrong raw `Response` type from `.asResponse()`, for example.
|
||||
|
||||
The user can work around these issues by manually importing one of:
|
||||
|
||||
- `import 'openai/shims/node'`
|
||||
- `import 'openai/shims/web'`
|
||||
|
||||
All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
|
||||
|
||||
### How it works - Runtime
|
||||
|
||||
Runtime shims get installed by calling `setShims` exported by `openai/_shims/registry`.
|
||||
|
||||
Manually importing `openai/shims/node` or `openai/shims/web`, calls `setShims` with the respective runtime shims.
|
||||
|
||||
All client code imports shims from `openai/_shims/index`, which:
|
||||
|
||||
- checks if shims have been set manually
|
||||
- if not, calls `setShims` with the shims from `openai/_shims/auto/runtime`
|
||||
- re-exports the installed shims from `openai/_shims/registry`.
|
||||
|
||||
`openai/_shims/auto/runtime` exports web runtime shims.
|
||||
If the `node` export condition is set, the export map replaces it with `openai/_shims/auto/runtime-node`.
|
||||
|
||||
### How it works - Type time
|
||||
|
||||
All client code imports shim types from `openai/_shims/index`, which selects the manual types from `openai/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `openai/_shims/auto/types`.
|
||||
|
||||
`openai/_shims/manual-types` exports an empty namespace.
|
||||
Manually importing `openai/shims/node` or `openai/shims/web` merges declarations into this empty namespace, so they get picked up by `openai/_shims/index`.
|
||||
|
||||
`openai/_shims/auto/types` exports web type definitions.
|
||||
If the `node` export condition is set, the export map replaces it with `openai/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c67fa719691344e9da53e456433aacc9
|
||||
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/openai/src/_shims/README.md
|
||||
uploadId: 920982
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6693e679830a944b4aed6ff3fb500a69
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export * from '../bun-runtime';
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f1f08f3c19b842029b13384f2627adc
|
||||
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/openai/src/_shims/auto/runtime-bun.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export * from '../node-runtime';
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dca64ef001c845cfbcc2b825830915d
|
||||
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/openai/src/_shims/auto/runtime-node.ts
|
||||
uploadId: 920982
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export * from '../web-runtime';
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69743e7ceaa41437481b3f08de4278e4
|
||||
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/openai/src/_shims/auto/runtime.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export * from '../node-types';
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e768e424335c44818d58483f2bfdb86
|
||||
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/openai/src/_shims/auto/types-node.ts
|
||||
uploadId: 920982
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export type Agent = any;
|
||||
|
||||
// @ts-ignore
|
||||
declare const _fetch: typeof fetch;
|
||||
export { _fetch as fetch };
|
||||
|
||||
// @ts-ignore
|
||||
type _Request = Request;
|
||||
export { _Request as Request };
|
||||
|
||||
// @ts-ignore
|
||||
type _RequestInfo = RequestInfo;
|
||||
export { type _RequestInfo as RequestInfo };
|
||||
|
||||
// @ts-ignore
|
||||
type _RequestInit = RequestInit;
|
||||
export { type _RequestInit as RequestInit };
|
||||
|
||||
// @ts-ignore
|
||||
type _Response = Response;
|
||||
export { _Response as Response };
|
||||
|
||||
// @ts-ignore
|
||||
type _ResponseInit = ResponseInit;
|
||||
export { type _ResponseInit as ResponseInit };
|
||||
|
||||
// @ts-ignore
|
||||
type _ResponseType = ResponseType;
|
||||
export { type _ResponseType as ResponseType };
|
||||
|
||||
// @ts-ignore
|
||||
type _BodyInit = BodyInit;
|
||||
export { type _BodyInit as BodyInit };
|
||||
|
||||
// @ts-ignore
|
||||
type _Headers = Headers;
|
||||
export { _Headers as Headers };
|
||||
|
||||
// @ts-ignore
|
||||
type _HeadersInit = HeadersInit;
|
||||
export { type _HeadersInit as HeadersInit };
|
||||
|
||||
type EndingType = 'native' | 'transparent';
|
||||
|
||||
export interface BlobPropertyBag {
|
||||
endings?: EndingType;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface FilePropertyBag extends BlobPropertyBag {
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
||||
|
||||
// @ts-ignore
|
||||
type _FormData = FormData;
|
||||
// @ts-ignore
|
||||
declare const _FormData: typeof FormData;
|
||||
export { _FormData as FormData };
|
||||
|
||||
// @ts-ignore
|
||||
type _File = File;
|
||||
// @ts-ignore
|
||||
declare const _File: typeof File;
|
||||
export { _File as File };
|
||||
|
||||
// @ts-ignore
|
||||
type _Blob = Blob;
|
||||
// @ts-ignore
|
||||
declare const _Blob: typeof Blob;
|
||||
export { _Blob as Blob };
|
||||
|
||||
export declare class Readable {
|
||||
readable: boolean;
|
||||
readonly readableEnded: boolean;
|
||||
readonly readableFlowing: boolean | null;
|
||||
readonly readableHighWaterMark: number;
|
||||
readonly readableLength: number;
|
||||
readonly readableObjectMode: boolean;
|
||||
destroyed: boolean;
|
||||
read(size?: number): any;
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
isPaused(): boolean;
|
||||
destroy(error?: Error): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
||||
}
|
||||
|
||||
export declare class FsReadStream extends Readable {
|
||||
path: {}; // node type is string | Buffer
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
type _ReadableStream<R = any> = ReadableStream<R>;
|
||||
// @ts-ignore
|
||||
declare const _ReadableStream: typeof ReadableStream;
|
||||
export { _ReadableStream as ReadableStream };
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d804d5db85be44088f3a07e94bbf981
|
||||
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/openai/src/_shims/auto/types.d.ts
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc29857ea8b8543928b658295df737a7
|
||||
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/openai/src/_shims/auto/types.js
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36d6d4de24e7e4d5cb8c78e5dc633e72
|
||||
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/openai/src/_shims/auto/types.mjs
|
||||
uploadId: 920982
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import { type Shims } from './registry';
|
||||
import { getRuntime as getWebRuntime } from './web-runtime';
|
||||
import { ReadStream as FsReadStream } from 'node:fs';
|
||||
|
||||
export function getRuntime(): Shims {
|
||||
const runtime = getWebRuntime();
|
||||
function isFsReadStream(value: any): value is FsReadStream {
|
||||
return value instanceof FsReadStream;
|
||||
}
|
||||
return { ...runtime, isFsReadStream };
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cab935a91f1b46528f4d6288e14137b
|
||||
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/openai/src/_shims/bun-runtime.ts
|
||||
uploadId: 920982
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import { manual } from './manual-types';
|
||||
import * as auto from "./auto/types";
|
||||
import { type RequestOptions } from '../core';
|
||||
|
||||
type SelectType<Manual, Auto> = unknown extends Manual ? Auto : Manual;
|
||||
|
||||
export const kind: string;
|
||||
|
||||
// @ts-ignore
|
||||
export type Agent = SelectType<manual.Agent, auto.Agent>;
|
||||
|
||||
// @ts-ignore
|
||||
export const fetch: SelectType<typeof manual.fetch, typeof auto.fetch>;
|
||||
|
||||
// @ts-ignore
|
||||
export type Request = SelectType<manual.Request, auto.Request>;
|
||||
// @ts-ignore
|
||||
export type RequestInfo = SelectType<manual.RequestInfo, auto.RequestInfo>;
|
||||
// @ts-ignore
|
||||
export type RequestInit = SelectType<manual.RequestInit, auto.RequestInit>;
|
||||
|
||||
// @ts-ignore
|
||||
export type Response = SelectType<manual.Response, auto.Response>;
|
||||
// @ts-ignore
|
||||
export type ResponseInit = SelectType<manual.ResponseInit, auto.ResponseInit>;
|
||||
// @ts-ignore
|
||||
export type ResponseType = SelectType<manual.ResponseType, auto.ResponseType>;
|
||||
// @ts-ignore
|
||||
export type BodyInit = SelectType<manual.BodyInit, auto.BodyInit>;
|
||||
// @ts-ignore
|
||||
export type Headers = SelectType<manual.Headers, auto.Headers>;
|
||||
// @ts-ignore
|
||||
export const Headers: SelectType<typeof manual.Headers, typeof auto.Headers>;
|
||||
// @ts-ignore
|
||||
export type HeadersInit = SelectType<manual.HeadersInit, auto.HeadersInit>;
|
||||
|
||||
// @ts-ignore
|
||||
export type BlobPropertyBag = SelectType<manual.BlobPropertyBag, auto.BlobPropertyBag>;
|
||||
// @ts-ignore
|
||||
export type FilePropertyBag = SelectType<manual.FilePropertyBag, auto.FilePropertyBag>;
|
||||
// @ts-ignore
|
||||
export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
|
||||
// @ts-ignore
|
||||
export type FormData = SelectType<manual.FormData, auto.FormData>;
|
||||
// @ts-ignore
|
||||
export const FormData: SelectType<typeof manual.FormData, typeof auto.FormData>;
|
||||
// @ts-ignore
|
||||
export type File = SelectType<manual.File, auto.File>;
|
||||
// @ts-ignore
|
||||
export const File: SelectType<typeof manual.File, typeof auto.File>;
|
||||
// @ts-ignore
|
||||
export type Blob = SelectType<manual.Blob, auto.Blob>;
|
||||
// @ts-ignore
|
||||
export const Blob: SelectType<typeof manual.Blob, typeof auto.Blob>;
|
||||
|
||||
// @ts-ignore
|
||||
export type Readable = SelectType<manual.Readable, auto.Readable>;
|
||||
// @ts-ignore
|
||||
export type FsReadStream = SelectType<manual.FsReadStream, auto.FsReadStream>;
|
||||
// @ts-ignore
|
||||
export type ReadableStream = SelectType<manual.ReadableStream, auto.ReadableStream>;
|
||||
// @ts-ignore
|
||||
export const ReadableStream: SelectType<typeof manual.ReadableStream, typeof auto.ReadableStream>;
|
||||
|
||||
export function getMultipartRequestOptions<T = Record<string, unknown>>(
|
||||
form: FormData,
|
||||
opts: RequestOptions<T>,
|
||||
): Promise<RequestOptions<T>>;
|
||||
|
||||
export function getDefaultAgent(url: string): any;
|
||||
|
||||
// @ts-ignore
|
||||
export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
|
||||
|
||||
export function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
||||
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
|
||||
|
||||
export function isFsReadStream(value: any): value is FsReadStream;
|
||||
|
||||
export const init: () => void;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49af825ea70184ab88091232c2f81533
|
||||
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/openai/src/_shims/index.d.ts
|
||||
uploadId: 920982
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
const shims = require('./registry');
|
||||
const auto = require('openai/_shims/auto/runtime');
|
||||
exports.init = () => {
|
||||
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
||||
};
|
||||
for (const property of Object.keys(shims)) {
|
||||
Object.defineProperty(exports, property, {
|
||||
get() {
|
||||
return shims[property];
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
exports.init();
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 686285e0e47be476bb593125ce2bbd4a
|
||||
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/openai/src/_shims/index.js
|
||||
uploadId: 920982
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import * as shims from './registry.mjs';
|
||||
import * as auto from "./auto/runtime";
|
||||
export const init = () => {
|
||||
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
|
||||
};
|
||||
export * from './registry.mjs';
|
||||
|
||||
init();
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a3feee442d10494188e8188df6a05f2
|
||||
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/openai/src/_shims/index.mjs
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
/**
|
||||
* Types will get added to this namespace when you import one of the following:
|
||||
*
|
||||
* import 'openai/shims/node'
|
||||
* import 'openai/shims/web'
|
||||
*
|
||||
* Importing more than one will cause type and runtime errors.
|
||||
*/
|
||||
export namespace manual {}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab7ae0b4579294ad591fd663cdc32e05
|
||||
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/openai/src/_shims/manual-types.d.ts
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 815e12e06ed4a446089d17a3dff0df46
|
||||
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/openai/src/_shims/manual-types.js
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eefe01d3db74b4b5aabbb828cd716c31
|
||||
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/openai/src/_shims/manual-types.mjs
|
||||
uploadId: 920982
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import * as nf from 'node-fetch';
|
||||
import * as fd from 'formdata-node';
|
||||
import { type File, type FilePropertyBag } from 'formdata-node';
|
||||
import KeepAliveAgent from 'agentkeepalive';
|
||||
import { AbortController as AbortControllerPolyfill } from 'abort-controller';
|
||||
import { ReadStream as FsReadStream } from 'node:fs';
|
||||
import { type Agent } from 'node:http';
|
||||
import { FormDataEncoder } from 'form-data-encoder';
|
||||
import { Readable } from 'node:stream';
|
||||
import { type RequestOptions } from '../core';
|
||||
import { MultipartBody } from './MultipartBody';
|
||||
import { type Shims } from './registry';
|
||||
import { ReadableStream } from 'node:stream/web';
|
||||
|
||||
type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
||||
|
||||
let fileFromPathWarned = false;
|
||||
|
||||
/**
|
||||
* @deprecated use fs.createReadStream('./my/file.txt') instead
|
||||
*/
|
||||
async function fileFromPath(path: string): Promise<File>;
|
||||
async function fileFromPath(path: string, filename?: string): Promise<File>;
|
||||
async function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
||||
async function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
|
||||
async function fileFromPath(path: string, ...args: any[]): Promise<File> {
|
||||
// this import fails in environments that don't handle export maps correctly, like old versions of Jest
|
||||
const { fileFromPath: _fileFromPath } = await import('formdata-node/file-from-path');
|
||||
|
||||
if (!fileFromPathWarned) {
|
||||
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
||||
fileFromPathWarned = true;
|
||||
}
|
||||
// @ts-ignore
|
||||
return await _fileFromPath(path, ...args);
|
||||
}
|
||||
|
||||
const defaultHttpAgent: Agent = new KeepAliveAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
||||
const defaultHttpsAgent: Agent = new KeepAliveAgent.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
||||
|
||||
async function getMultipartRequestOptions<T = Record<string, unknown>>(
|
||||
form: fd.FormData,
|
||||
opts: RequestOptions<T>,
|
||||
): Promise<RequestOptions<T>> {
|
||||
const encoder = new FormDataEncoder(form);
|
||||
const readable = Readable.from(encoder);
|
||||
const body = new MultipartBody(readable);
|
||||
const headers = {
|
||||
...opts.headers,
|
||||
...encoder.headers,
|
||||
'Content-Length': encoder.contentLength,
|
||||
};
|
||||
|
||||
return { ...opts, body: body as any, headers };
|
||||
}
|
||||
|
||||
export function getRuntime(): Shims {
|
||||
// Polyfill global object if needed.
|
||||
if (typeof AbortController === 'undefined') {
|
||||
// @ts-expect-error (the types are subtly different, but compatible in practice)
|
||||
globalThis.AbortController = AbortControllerPolyfill;
|
||||
}
|
||||
return {
|
||||
kind: 'node',
|
||||
fetch: nf.default,
|
||||
Request: nf.Request,
|
||||
Response: nf.Response,
|
||||
Headers: nf.Headers,
|
||||
FormData: fd.FormData,
|
||||
Blob: fd.Blob,
|
||||
File: fd.File,
|
||||
ReadableStream,
|
||||
getMultipartRequestOptions,
|
||||
getDefaultAgent: (url: string): Agent => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
|
||||
fileFromPath,
|
||||
isFsReadStream: (value: any): value is FsReadStream => value instanceof FsReadStream,
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83d881f8fd5b1431aad3d1285ccc1fd0
|
||||
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/openai/src/_shims/node-runtime.ts
|
||||
uploadId: 920982
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import * as nf from 'node-fetch';
|
||||
import * as fd from 'formdata-node';
|
||||
|
||||
export { type Agent } from 'node:http';
|
||||
export { type Readable } from 'node:stream';
|
||||
export { type ReadStream as FsReadStream } from 'node:fs';
|
||||
export { ReadableStream } from 'node:stream/web';
|
||||
|
||||
export const fetch: typeof nf.default;
|
||||
|
||||
export type Request = nf.Request;
|
||||
export type RequestInfo = nf.RequestInfo;
|
||||
export type RequestInit = nf.RequestInit;
|
||||
|
||||
export type Response = nf.Response;
|
||||
export type ResponseInit = nf.ResponseInit;
|
||||
export type ResponseType = nf.ResponseType;
|
||||
export type BodyInit = nf.BodyInit;
|
||||
export type Headers = nf.Headers;
|
||||
export type HeadersInit = nf.HeadersInit;
|
||||
|
||||
type EndingType = 'native' | 'transparent';
|
||||
export interface BlobPropertyBag {
|
||||
endings?: EndingType;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface FilePropertyBag extends BlobPropertyBag {
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
||||
|
||||
export type FormData = fd.FormData;
|
||||
export const FormData: typeof fd.FormData;
|
||||
export type File = fd.File;
|
||||
export const File: typeof fd.File;
|
||||
export type Blob = fd.Blob;
|
||||
export const Blob: typeof fd.Blob;
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00ae089c2c20e485e9509fa99c20822e
|
||||
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/openai/src/_shims/node-types.d.ts
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47c9122f749424de9bf4f242e6f87925
|
||||
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/openai/src/_shims/node-types.js
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60c944762c08a4c3c9b1afb1f10da37e
|
||||
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/openai/src/_shims/node-types.mjs
|
||||
uploadId: 920982
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import { type RequestOptions } from '../core';
|
||||
|
||||
export interface Shims {
|
||||
kind: string;
|
||||
fetch: any;
|
||||
Request: any;
|
||||
Response: any;
|
||||
Headers: any;
|
||||
FormData: any;
|
||||
Blob: any;
|
||||
File: any;
|
||||
ReadableStream: any;
|
||||
getMultipartRequestOptions: <T = Record<string, unknown>>(
|
||||
form: Shims['FormData'],
|
||||
opts: RequestOptions<T>,
|
||||
) => Promise<RequestOptions<T>>;
|
||||
getDefaultAgent: (url: string) => any;
|
||||
fileFromPath:
|
||||
| ((path: string, filename?: string, options?: {}) => Promise<Shims['File']>)
|
||||
| ((path: string, options?: {}) => Promise<Shims['File']>);
|
||||
isFsReadStream: (value: any) => boolean;
|
||||
}
|
||||
|
||||
export let auto = false;
|
||||
export let kind: Shims['kind'] | undefined = undefined;
|
||||
export let fetch: Shims['fetch'] | undefined = undefined;
|
||||
export let Request: Shims['Request'] | undefined = undefined;
|
||||
export let Response: Shims['Response'] | undefined = undefined;
|
||||
export let Headers: Shims['Headers'] | undefined = undefined;
|
||||
export let FormData: Shims['FormData'] | undefined = undefined;
|
||||
export let Blob: Shims['Blob'] | undefined = undefined;
|
||||
export let File: Shims['File'] | undefined = undefined;
|
||||
export let ReadableStream: Shims['ReadableStream'] | undefined = undefined;
|
||||
export let getMultipartRequestOptions: Shims['getMultipartRequestOptions'] | undefined = undefined;
|
||||
export let getDefaultAgent: Shims['getDefaultAgent'] | undefined = undefined;
|
||||
export let fileFromPath: Shims['fileFromPath'] | undefined = undefined;
|
||||
export let isFsReadStream: Shims['isFsReadStream'] | undefined = undefined;
|
||||
|
||||
export function setShims(shims: Shims, options: { auto: boolean } = { auto: false }) {
|
||||
if (auto) {
|
||||
throw new Error(
|
||||
`you must \`import 'openai/shims/${shims.kind}'\` before importing anything else from openai`,
|
||||
);
|
||||
}
|
||||
if (kind) {
|
||||
throw new Error(`can't \`import 'openai/shims/${shims.kind}'\` after \`import 'openai/shims/${kind}'\``);
|
||||
}
|
||||
auto = options.auto;
|
||||
kind = shims.kind;
|
||||
fetch = shims.fetch;
|
||||
Request = shims.Request;
|
||||
Response = shims.Response;
|
||||
Headers = shims.Headers;
|
||||
FormData = shims.FormData;
|
||||
Blob = shims.Blob;
|
||||
File = shims.File;
|
||||
ReadableStream = shims.ReadableStream;
|
||||
getMultipartRequestOptions = shims.getMultipartRequestOptions;
|
||||
getDefaultAgent = shims.getDefaultAgent;
|
||||
fileFromPath = shims.fileFromPath;
|
||||
isFsReadStream = shims.isFsReadStream;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1abaf9a6b3ae7411897cbfc0b5b1bcce
|
||||
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/openai/src/_shims/registry.ts
|
||||
uploadId: 920982
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
import { MultipartBody } from './MultipartBody';
|
||||
import { type RequestOptions } from '../core';
|
||||
import { type Shims } from './registry';
|
||||
|
||||
export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } = {}): Shims {
|
||||
const recommendation =
|
||||
manuallyImported ?
|
||||
`You may need to use polyfills`
|
||||
: `Add one of these imports before your first \`import … from 'openai'\`:
|
||||
- \`import 'openai/shims/node'\` (if you're running on Node)
|
||||
- \`import 'openai/shims/web'\` (otherwise)
|
||||
`;
|
||||
|
||||
let _fetch, _Request, _Response, _Headers;
|
||||
try {
|
||||
// @ts-ignore
|
||||
_fetch = fetch;
|
||||
// @ts-ignore
|
||||
_Request = Request;
|
||||
// @ts-ignore
|
||||
_Response = Response;
|
||||
// @ts-ignore
|
||||
_Headers = Headers;
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`this environment is missing the following Web Fetch API type: ${
|
||||
(error as any).message
|
||||
}. ${recommendation}`,
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
kind: 'web',
|
||||
fetch: _fetch,
|
||||
Request: _Request,
|
||||
Response: _Response,
|
||||
Headers: _Headers,
|
||||
FormData:
|
||||
// @ts-ignore
|
||||
typeof FormData !== 'undefined' ? FormData : (
|
||||
class FormData {
|
||||
// @ts-ignore
|
||||
constructor() {
|
||||
throw new Error(
|
||||
`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
Blob:
|
||||
typeof Blob !== 'undefined' ? Blob : (
|
||||
class Blob {
|
||||
constructor() {
|
||||
throw new Error(
|
||||
`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
File:
|
||||
// @ts-ignore
|
||||
typeof File !== 'undefined' ? File : (
|
||||
class File {
|
||||
// @ts-ignore
|
||||
constructor() {
|
||||
throw new Error(
|
||||
`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
ReadableStream:
|
||||
// @ts-ignore
|
||||
typeof ReadableStream !== 'undefined' ? ReadableStream : (
|
||||
class ReadableStream {
|
||||
// @ts-ignore
|
||||
constructor() {
|
||||
throw new Error(
|
||||
`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${recommendation}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
getMultipartRequestOptions: async <T = Record<string, unknown>>(
|
||||
// @ts-ignore
|
||||
form: FormData,
|
||||
opts: RequestOptions<T>,
|
||||
): Promise<RequestOptions<T>> => ({
|
||||
...opts,
|
||||
body: new MultipartBody(form) as any,
|
||||
}),
|
||||
getDefaultAgent: (url: string) => undefined,
|
||||
fileFromPath: () => {
|
||||
throw new Error(
|
||||
'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads',
|
||||
);
|
||||
},
|
||||
isFsReadStream: (value: any) => false,
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4d53e1b8d7824674857845549eab533
|
||||
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/openai/src/_shims/web-runtime.ts
|
||||
uploadId: 920982
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
export type Agent = any;
|
||||
|
||||
declare const _fetch: typeof fetch;
|
||||
export { _fetch as fetch };
|
||||
|
||||
type _Request = Request;
|
||||
export { _Request as Request };
|
||||
|
||||
type _RequestInfo = RequestInfo;
|
||||
export { type _RequestInfo as RequestInfo };
|
||||
|
||||
type _RequestInit = RequestInit;
|
||||
export { type _RequestInit as RequestInit };
|
||||
|
||||
type _Response = Response;
|
||||
export { _Response as Response };
|
||||
|
||||
type _ResponseInit = ResponseInit;
|
||||
export { type _ResponseInit as ResponseInit };
|
||||
|
||||
type _ResponseType = ResponseType;
|
||||
export { type _ResponseType as ResponseType };
|
||||
|
||||
type _BodyInit = BodyInit;
|
||||
export { type _BodyInit as BodyInit };
|
||||
|
||||
type _Headers = Headers;
|
||||
export { _Headers as Headers };
|
||||
|
||||
type _HeadersInit = HeadersInit;
|
||||
export { type _HeadersInit as HeadersInit };
|
||||
|
||||
type EndingType = 'native' | 'transparent';
|
||||
|
||||
export interface BlobPropertyBag {
|
||||
endings?: EndingType;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface FilePropertyBag extends BlobPropertyBag {
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
||||
|
||||
type _FormData = FormData;
|
||||
declare const _FormData: typeof FormData;
|
||||
export { _FormData as FormData };
|
||||
|
||||
type _File = File;
|
||||
declare const _File: typeof File;
|
||||
export { _File as File };
|
||||
|
||||
type _Blob = Blob;
|
||||
declare const _Blob: typeof Blob;
|
||||
export { _Blob as Blob };
|
||||
|
||||
export declare class Readable {
|
||||
readable: boolean;
|
||||
readonly readableEnded: boolean;
|
||||
readonly readableFlowing: boolean | null;
|
||||
readonly readableHighWaterMark: number;
|
||||
readonly readableLength: number;
|
||||
readonly readableObjectMode: boolean;
|
||||
destroyed: boolean;
|
||||
read(size?: number): any;
|
||||
pause(): this;
|
||||
resume(): this;
|
||||
isPaused(): boolean;
|
||||
destroy(error?: Error): this;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
||||
}
|
||||
|
||||
export declare class FsReadStream extends Readable {
|
||||
path: {}; // node type is string | Buffer
|
||||
}
|
||||
|
||||
type _ReadableStream<R = any> = ReadableStream<R>;
|
||||
declare const _ReadableStream: typeof ReadableStream;
|
||||
export { _ReadableStream as ReadableStream };
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bacb9a5177124723b6c15487cb6cef3
|
||||
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/openai/src/_shims/web-types.d.ts
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fba6a8c56ae248d48950932c5174c76
|
||||
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/openai/src/_shims/web-types.js
|
||||
uploadId: 920982
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
||||
*/
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: adeb35807b9134c3a80d33ae24bca646
|
||||
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/openai/src/_shims/web-types.mjs
|
||||
uploadId: 920982
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0166ca6dd5dcf4ea1b62653f913d363d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80da49f9761924ed989161976a89f855
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
# Partial JSON Parser
|
||||
|
||||
Vendored from https://www.npmjs.com/package/partial-json with some modifications
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89c128f7c847d44c3aacdc7a712141f1
|
||||
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/openai/src/_vendor/partial-json-parser/README.md
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+247
@@ -0,0 +1,247 @@
|
||||
const STR = 0b000000001;
|
||||
const NUM = 0b000000010;
|
||||
const ARR = 0b000000100;
|
||||
const OBJ = 0b000001000;
|
||||
const NULL = 0b000010000;
|
||||
const BOOL = 0b000100000;
|
||||
const NAN = 0b001000000;
|
||||
const INFINITY = 0b010000000;
|
||||
const MINUS_INFINITY = 0b100000000;
|
||||
|
||||
const INF = INFINITY | MINUS_INFINITY;
|
||||
const SPECIAL = NULL | BOOL | INF | NAN;
|
||||
const ATOM = STR | NUM | SPECIAL;
|
||||
const COLLECTION = ARR | OBJ;
|
||||
const ALL = ATOM | COLLECTION;
|
||||
|
||||
const Allow = {
|
||||
STR,
|
||||
NUM,
|
||||
ARR,
|
||||
OBJ,
|
||||
NULL,
|
||||
BOOL,
|
||||
NAN,
|
||||
INFINITY,
|
||||
MINUS_INFINITY,
|
||||
INF,
|
||||
SPECIAL,
|
||||
ATOM,
|
||||
COLLECTION,
|
||||
ALL,
|
||||
};
|
||||
|
||||
// The JSON string segment was unable to be parsed completely
|
||||
class PartialJSON extends Error {}
|
||||
|
||||
class MalformedJSON extends Error {}
|
||||
|
||||
/**
|
||||
* Parse incomplete JSON
|
||||
* @param {string} jsonString Partial JSON to be parsed
|
||||
* @param {number} allowPartial Specify what types are allowed to be partial, see {@link Allow} for details
|
||||
* @returns The parsed JSON
|
||||
* @throws {PartialJSON} If the JSON is incomplete (related to the `allow` parameter)
|
||||
* @throws {MalformedJSON} If the JSON is malformed
|
||||
*/
|
||||
function parseJSON(jsonString: string, allowPartial: number = Allow.ALL): any {
|
||||
if (typeof jsonString !== 'string') {
|
||||
throw new TypeError(`expecting str, got ${typeof jsonString}`);
|
||||
}
|
||||
if (!jsonString.trim()) {
|
||||
throw new Error(`${jsonString} is empty`);
|
||||
}
|
||||
return _parseJSON(jsonString.trim(), allowPartial);
|
||||
}
|
||||
|
||||
const _parseJSON = (jsonString: string, allow: number) => {
|
||||
const length = jsonString.length;
|
||||
let index = 0;
|
||||
|
||||
const markPartialJSON = (msg: string) => {
|
||||
throw new PartialJSON(`${msg} at position ${index}`);
|
||||
};
|
||||
|
||||
const throwMalformedError = (msg: string) => {
|
||||
throw new MalformedJSON(`${msg} at position ${index}`);
|
||||
};
|
||||
|
||||
const parseAny: () => any = () => {
|
||||
skipBlank();
|
||||
if (index >= length) markPartialJSON('Unexpected end of input');
|
||||
if (jsonString[index] === '"') return parseStr();
|
||||
if (jsonString[index] === '{') return parseObj();
|
||||
if (jsonString[index] === '[') return parseArr();
|
||||
if (
|
||||
jsonString.substring(index, index + 4) === 'null' ||
|
||||
(Allow.NULL & allow && length - index < 4 && 'null'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 4;
|
||||
return null;
|
||||
}
|
||||
if (
|
||||
jsonString.substring(index, index + 4) === 'true' ||
|
||||
(Allow.BOOL & allow && length - index < 4 && 'true'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 4;
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
jsonString.substring(index, index + 5) === 'false' ||
|
||||
(Allow.BOOL & allow && length - index < 5 && 'false'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 5;
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
jsonString.substring(index, index + 8) === 'Infinity' ||
|
||||
(Allow.INFINITY & allow && length - index < 8 && 'Infinity'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 8;
|
||||
return Infinity;
|
||||
}
|
||||
if (
|
||||
jsonString.substring(index, index + 9) === '-Infinity' ||
|
||||
(Allow.MINUS_INFINITY & allow &&
|
||||
1 < length - index &&
|
||||
length - index < 9 &&
|
||||
'-Infinity'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 9;
|
||||
return -Infinity;
|
||||
}
|
||||
if (
|
||||
jsonString.substring(index, index + 3) === 'NaN' ||
|
||||
(Allow.NAN & allow && length - index < 3 && 'NaN'.startsWith(jsonString.substring(index)))
|
||||
) {
|
||||
index += 3;
|
||||
return NaN;
|
||||
}
|
||||
return parseNum();
|
||||
};
|
||||
|
||||
const parseStr: () => string = () => {
|
||||
const start = index;
|
||||
let escape = false;
|
||||
index++; // skip initial quote
|
||||
while (index < length && (jsonString[index] !== '"' || (escape && jsonString[index - 1] === '\\'))) {
|
||||
escape = jsonString[index] === '\\' ? !escape : false;
|
||||
index++;
|
||||
}
|
||||
if (jsonString.charAt(index) == '"') {
|
||||
try {
|
||||
return JSON.parse(jsonString.substring(start, ++index - Number(escape)));
|
||||
} catch (e) {
|
||||
throwMalformedError(String(e));
|
||||
}
|
||||
} else if (Allow.STR & allow) {
|
||||
try {
|
||||
return JSON.parse(jsonString.substring(start, index - Number(escape)) + '"');
|
||||
} catch (e) {
|
||||
// SyntaxError: Invalid escape sequence
|
||||
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf('\\')) + '"');
|
||||
}
|
||||
}
|
||||
markPartialJSON('Unterminated string literal');
|
||||
};
|
||||
|
||||
const parseObj = () => {
|
||||
index++; // skip initial brace
|
||||
skipBlank();
|
||||
const obj: Record<string, any> = {};
|
||||
try {
|
||||
while (jsonString[index] !== '}') {
|
||||
skipBlank();
|
||||
if (index >= length && Allow.OBJ & allow) return obj;
|
||||
const key = parseStr();
|
||||
skipBlank();
|
||||
index++; // skip colon
|
||||
try {
|
||||
const value = parseAny();
|
||||
Object.defineProperty(obj, key, { value, writable: true, enumerable: true, configurable: true });
|
||||
} catch (e) {
|
||||
if (Allow.OBJ & allow) return obj;
|
||||
else throw e;
|
||||
}
|
||||
skipBlank();
|
||||
if (jsonString[index] === ',') index++; // skip comma
|
||||
}
|
||||
} catch (e) {
|
||||
if (Allow.OBJ & allow) return obj;
|
||||
else markPartialJSON("Expected '}' at end of object");
|
||||
}
|
||||
index++; // skip final brace
|
||||
return obj;
|
||||
};
|
||||
|
||||
const parseArr = () => {
|
||||
index++; // skip initial bracket
|
||||
const arr = [];
|
||||
try {
|
||||
while (jsonString[index] !== ']') {
|
||||
arr.push(parseAny());
|
||||
skipBlank();
|
||||
if (jsonString[index] === ',') {
|
||||
index++; // skip comma
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (Allow.ARR & allow) {
|
||||
return arr;
|
||||
}
|
||||
markPartialJSON("Expected ']' at end of array");
|
||||
}
|
||||
index++; // skip final bracket
|
||||
return arr;
|
||||
};
|
||||
|
||||
const parseNum = () => {
|
||||
if (index === 0) {
|
||||
if (jsonString === '-' && Allow.NUM & allow) markPartialJSON("Not sure what '-' is");
|
||||
try {
|
||||
return JSON.parse(jsonString);
|
||||
} catch (e) {
|
||||
if (Allow.NUM & allow) {
|
||||
try {
|
||||
if ('.' === jsonString[jsonString.length - 1])
|
||||
return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf('.')));
|
||||
return JSON.parse(jsonString.substring(0, jsonString.lastIndexOf('e')));
|
||||
} catch (e) {}
|
||||
}
|
||||
throwMalformedError(String(e));
|
||||
}
|
||||
}
|
||||
|
||||
const start = index;
|
||||
|
||||
if (jsonString[index] === '-') index++;
|
||||
while (jsonString[index] && !',]}'.includes(jsonString[index]!)) index++;
|
||||
|
||||
if (index == length && !(Allow.NUM & allow)) markPartialJSON('Unterminated number literal');
|
||||
|
||||
try {
|
||||
return JSON.parse(jsonString.substring(start, index));
|
||||
} catch (e) {
|
||||
if (jsonString.substring(start, index) === '-' && Allow.NUM & allow)
|
||||
markPartialJSON("Not sure what '-' is");
|
||||
try {
|
||||
return JSON.parse(jsonString.substring(start, jsonString.lastIndexOf('e')));
|
||||
} catch (e) {
|
||||
throwMalformedError(String(e));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const skipBlank = () => {
|
||||
while (index < length && ' \n\r\t'.includes(jsonString[index]!)) {
|
||||
index++;
|
||||
}
|
||||
};
|
||||
|
||||
return parseAny();
|
||||
};
|
||||
|
||||
// using this function with malformed JSON is undefined behavior
|
||||
const partialParse = (input: string) => parseJSON(input, Allow.ALL ^ Allow.NUM);
|
||||
|
||||
export { partialParse, PartialJSON, MalformedJSON };
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 904f9f2a43cab460da433304a8eb6d3a
|
||||
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/openai/src/_vendor/partial-json-parser/parser.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06956e643a613466487a908206b4eaaf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2020, Stefan Terdell
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b421a22513ff4460a8cbef5ef25806ac
|
||||
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/openai/src/_vendor/zod-to-json-schema/LICENSE
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+80
@@ -0,0 +1,80 @@
|
||||
import { ZodSchema, ZodTypeDef } from 'zod';
|
||||
import { Refs, Seen } from './Refs';
|
||||
import { JsonSchema7Type } from './parseDef';
|
||||
|
||||
export type Targets = 'jsonSchema7' | 'jsonSchema2019-09' | 'openApi3';
|
||||
|
||||
export type DateStrategy = 'format:date-time' | 'format:date' | 'string' | 'integer';
|
||||
|
||||
export const ignoreOverride = Symbol('Let zodToJsonSchema decide on which parser to use');
|
||||
|
||||
export type Options<Target extends Targets = 'jsonSchema7'> = {
|
||||
name: string | undefined;
|
||||
$refStrategy: 'root' | 'relative' | 'none' | 'seen' | 'extract-to-root';
|
||||
basePath: string[];
|
||||
effectStrategy: 'input' | 'any';
|
||||
pipeStrategy: 'input' | 'output' | 'all';
|
||||
dateStrategy: DateStrategy | DateStrategy[];
|
||||
mapStrategy: 'entries' | 'record';
|
||||
removeAdditionalStrategy: 'passthrough' | 'strict';
|
||||
nullableStrategy: 'from-target' | 'property';
|
||||
target: Target;
|
||||
strictUnions: boolean;
|
||||
definitionPath: string;
|
||||
definitions: Record<string, ZodSchema | ZodTypeDef>;
|
||||
errorMessages: boolean;
|
||||
markdownDescription: boolean;
|
||||
patternStrategy: 'escape' | 'preserve';
|
||||
applyRegexFlags: boolean;
|
||||
emailStrategy: 'format:email' | 'format:idn-email' | 'pattern:zod';
|
||||
base64Strategy: 'format:binary' | 'contentEncoding:base64' | 'pattern:zod';
|
||||
nameStrategy: 'ref' | 'duplicate-ref' | 'title';
|
||||
override?: (
|
||||
def: ZodTypeDef,
|
||||
refs: Refs,
|
||||
seen: Seen | undefined,
|
||||
forceResolution?: boolean,
|
||||
) => JsonSchema7Type | undefined | typeof ignoreOverride;
|
||||
openaiStrictMode?: boolean;
|
||||
};
|
||||
|
||||
const defaultOptions: Omit<Options, 'definitions' | 'basePath'> = {
|
||||
name: undefined,
|
||||
$refStrategy: 'root',
|
||||
effectStrategy: 'input',
|
||||
pipeStrategy: 'all',
|
||||
dateStrategy: 'format:date-time',
|
||||
mapStrategy: 'entries',
|
||||
nullableStrategy: 'from-target',
|
||||
removeAdditionalStrategy: 'passthrough',
|
||||
definitionPath: 'definitions',
|
||||
target: 'jsonSchema7',
|
||||
strictUnions: false,
|
||||
errorMessages: false,
|
||||
markdownDescription: false,
|
||||
patternStrategy: 'escape',
|
||||
applyRegexFlags: false,
|
||||
emailStrategy: 'format:email',
|
||||
base64Strategy: 'contentEncoding:base64',
|
||||
nameStrategy: 'ref',
|
||||
};
|
||||
|
||||
export const getDefaultOptions = <Target extends Targets>(
|
||||
options: Partial<Options<Target>> | string | undefined,
|
||||
) => {
|
||||
// We need to add `definitions` here as we may mutate it
|
||||
return (
|
||||
typeof options === 'string' ?
|
||||
{
|
||||
...defaultOptions,
|
||||
basePath: ['#'],
|
||||
definitions: {},
|
||||
name: options,
|
||||
}
|
||||
: {
|
||||
...defaultOptions,
|
||||
basePath: ['#'],
|
||||
definitions: {},
|
||||
...options,
|
||||
}) as Options<Target>;
|
||||
};
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a144464da869470898efb2f2d69544c
|
||||
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/openai/src/_vendor/zod-to-json-schema/Options.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
# Zod to Json Schema
|
||||
|
||||
Vendored version of https://github.com/StefanTerdell/zod-to-json-schema that has been updated to generate JSON Schemas that are compatible with OpenAI's [strict mode](https://platform.openai.com/docs/guides/structured-outputs/supported-schemas)
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a402442c56464e2783b60c38f728f4c
|
||||
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/openai/src/_vendor/zod-to-json-schema/README.md
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+47
@@ -0,0 +1,47 @@
|
||||
import type { ZodTypeDef } from 'zod';
|
||||
import { getDefaultOptions, Options, Targets } from './Options';
|
||||
import { JsonSchema7Type } from './parseDef';
|
||||
import { zodDef } from './util';
|
||||
|
||||
export type Refs = {
|
||||
seen: Map<ZodTypeDef, Seen>;
|
||||
/**
|
||||
* Set of all the `$ref`s we created, e.g. `Set(['#/$defs/ui'])`
|
||||
* this notable does not include any `definitions` that were
|
||||
* explicitly given as an option.
|
||||
*/
|
||||
seenRefs: Set<string>;
|
||||
currentPath: string[];
|
||||
propertyPath: string[] | undefined;
|
||||
} & Options<Targets>;
|
||||
|
||||
export type Seen = {
|
||||
def: ZodTypeDef;
|
||||
path: string[];
|
||||
jsonSchema: JsonSchema7Type | undefined;
|
||||
};
|
||||
|
||||
export const getRefs = (options?: string | Partial<Options<Targets>>): Refs => {
|
||||
const _options = getDefaultOptions(options);
|
||||
const currentPath =
|
||||
_options.name !== undefined ?
|
||||
[..._options.basePath, _options.definitionPath, _options.name]
|
||||
: _options.basePath;
|
||||
return {
|
||||
..._options,
|
||||
currentPath: currentPath,
|
||||
propertyPath: undefined,
|
||||
seenRefs: new Set(),
|
||||
seen: new Map(
|
||||
Object.entries(_options.definitions).map(([name, def]) => [
|
||||
zodDef(def),
|
||||
{
|
||||
def: zodDef(def),
|
||||
path: [..._options.basePath, _options.definitionPath, name],
|
||||
// Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
|
||||
jsonSchema: undefined,
|
||||
},
|
||||
]),
|
||||
),
|
||||
};
|
||||
};
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 824a212a0bfa54fa681e1489a21b2cda
|
||||
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/openai/src/_vendor/zod-to-json-schema/Refs.ts
|
||||
uploadId: 920982
|
||||
Assets/Synaptic AI Pro/MCPServer/node_modules/openai/src/_vendor/zod-to-json-schema/errorMessages.ts
Generated
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
import { JsonSchema7TypeUnion } from './parseDef';
|
||||
import { Refs } from './Refs';
|
||||
|
||||
export type ErrorMessages<T extends JsonSchema7TypeUnion, OmitProperties extends string = ''> = Partial<
|
||||
Omit<{ [key in keyof T]: string }, OmitProperties | 'type' | 'errorMessages'>
|
||||
>;
|
||||
|
||||
export function addErrorMessage<T extends { errorMessage?: ErrorMessages<any> }>(
|
||||
res: T,
|
||||
key: keyof T,
|
||||
errorMessage: string | undefined,
|
||||
refs: Refs,
|
||||
) {
|
||||
if (!refs?.errorMessages) return;
|
||||
if (errorMessage) {
|
||||
res.errorMessage = {
|
||||
...res.errorMessage,
|
||||
[key]: errorMessage,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export function setResponseValueAndErrors<
|
||||
Json7Type extends JsonSchema7TypeUnion & {
|
||||
errorMessage?: ErrorMessages<Json7Type>;
|
||||
},
|
||||
Key extends keyof Omit<Json7Type, 'errorMessage'>,
|
||||
>(res: Json7Type, key: Key, value: Json7Type[Key], errorMessage: string | undefined, refs: Refs) {
|
||||
res[key] = value;
|
||||
addErrorMessage(res, key, errorMessage, refs);
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d294476c1f0e94f95846b64b3d75008c
|
||||
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/openai/src/_vendor/zod-to-json-schema/errorMessages.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
export * from './Options';
|
||||
export * from './Refs';
|
||||
export * from './errorMessages';
|
||||
export * from './parseDef';
|
||||
export * from './parsers/any';
|
||||
export * from './parsers/array';
|
||||
export * from './parsers/bigint';
|
||||
export * from './parsers/boolean';
|
||||
export * from './parsers/branded';
|
||||
export * from './parsers/catch';
|
||||
export * from './parsers/date';
|
||||
export * from './parsers/default';
|
||||
export * from './parsers/effects';
|
||||
export * from './parsers/enum';
|
||||
export * from './parsers/intersection';
|
||||
export * from './parsers/literal';
|
||||
export * from './parsers/map';
|
||||
export * from './parsers/nativeEnum';
|
||||
export * from './parsers/never';
|
||||
export * from './parsers/null';
|
||||
export * from './parsers/nullable';
|
||||
export * from './parsers/number';
|
||||
export * from './parsers/object';
|
||||
export * from './parsers/optional';
|
||||
export * from './parsers/pipeline';
|
||||
export * from './parsers/promise';
|
||||
export * from './parsers/readonly';
|
||||
export * from './parsers/record';
|
||||
export * from './parsers/set';
|
||||
export * from './parsers/string';
|
||||
export * from './parsers/tuple';
|
||||
export * from './parsers/undefined';
|
||||
export * from './parsers/union';
|
||||
export * from './parsers/unknown';
|
||||
export * from './zodToJsonSchema';
|
||||
import { zodToJsonSchema } from './zodToJsonSchema';
|
||||
export default zodToJsonSchema;
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e5a6d55120f24ee8a5ae3b33383c9d0
|
||||
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/openai/src/_vendor/zod-to-json-schema/index.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+258
@@ -0,0 +1,258 @@
|
||||
import { ZodFirstPartyTypeKind, ZodTypeDef } from 'zod';
|
||||
import { JsonSchema7AnyType, parseAnyDef } from './parsers/any';
|
||||
import { JsonSchema7ArrayType, parseArrayDef } from './parsers/array';
|
||||
import { JsonSchema7BigintType, parseBigintDef } from './parsers/bigint';
|
||||
import { JsonSchema7BooleanType, parseBooleanDef } from './parsers/boolean';
|
||||
import { parseBrandedDef } from './parsers/branded';
|
||||
import { parseCatchDef } from './parsers/catch';
|
||||
import { JsonSchema7DateType, parseDateDef } from './parsers/date';
|
||||
import { parseDefaultDef } from './parsers/default';
|
||||
import { parseEffectsDef } from './parsers/effects';
|
||||
import { JsonSchema7EnumType, parseEnumDef } from './parsers/enum';
|
||||
import { JsonSchema7AllOfType, parseIntersectionDef } from './parsers/intersection';
|
||||
import { JsonSchema7LiteralType, parseLiteralDef } from './parsers/literal';
|
||||
import { JsonSchema7MapType, parseMapDef } from './parsers/map';
|
||||
import { JsonSchema7NativeEnumType, parseNativeEnumDef } from './parsers/nativeEnum';
|
||||
import { JsonSchema7NeverType, parseNeverDef } from './parsers/never';
|
||||
import { JsonSchema7NullType, parseNullDef } from './parsers/null';
|
||||
import { JsonSchema7NullableType, parseNullableDef } from './parsers/nullable';
|
||||
import { JsonSchema7NumberType, parseNumberDef } from './parsers/number';
|
||||
import { JsonSchema7ObjectType, parseObjectDef } from './parsers/object';
|
||||
import { parseOptionalDef } from './parsers/optional';
|
||||
import { parsePipelineDef } from './parsers/pipeline';
|
||||
import { parsePromiseDef } from './parsers/promise';
|
||||
import { JsonSchema7RecordType, parseRecordDef } from './parsers/record';
|
||||
import { JsonSchema7SetType, parseSetDef } from './parsers/set';
|
||||
import { JsonSchema7StringType, parseStringDef } from './parsers/string';
|
||||
import { JsonSchema7TupleType, parseTupleDef } from './parsers/tuple';
|
||||
import { JsonSchema7UndefinedType, parseUndefinedDef } from './parsers/undefined';
|
||||
import { JsonSchema7UnionType, parseUnionDef } from './parsers/union';
|
||||
import { JsonSchema7UnknownType, parseUnknownDef } from './parsers/unknown';
|
||||
import { Refs, Seen } from './Refs';
|
||||
import { parseReadonlyDef } from './parsers/readonly';
|
||||
import { ignoreOverride } from './Options';
|
||||
|
||||
type JsonSchema7RefType = { $ref: string };
|
||||
type JsonSchema7Meta = {
|
||||
title?: string;
|
||||
default?: any;
|
||||
description?: string;
|
||||
markdownDescription?: string;
|
||||
};
|
||||
|
||||
export type JsonSchema7TypeUnion =
|
||||
| JsonSchema7StringType
|
||||
| JsonSchema7ArrayType
|
||||
| JsonSchema7NumberType
|
||||
| JsonSchema7BigintType
|
||||
| JsonSchema7BooleanType
|
||||
| JsonSchema7DateType
|
||||
| JsonSchema7EnumType
|
||||
| JsonSchema7LiteralType
|
||||
| JsonSchema7NativeEnumType
|
||||
| JsonSchema7NullType
|
||||
| JsonSchema7NumberType
|
||||
| JsonSchema7ObjectType
|
||||
| JsonSchema7RecordType
|
||||
| JsonSchema7TupleType
|
||||
| JsonSchema7UnionType
|
||||
| JsonSchema7UndefinedType
|
||||
| JsonSchema7RefType
|
||||
| JsonSchema7NeverType
|
||||
| JsonSchema7MapType
|
||||
| JsonSchema7AnyType
|
||||
| JsonSchema7NullableType
|
||||
| JsonSchema7AllOfType
|
||||
| JsonSchema7UnknownType
|
||||
| JsonSchema7SetType;
|
||||
|
||||
export type JsonSchema7Type = JsonSchema7TypeUnion & JsonSchema7Meta;
|
||||
|
||||
export function parseDef(
|
||||
def: ZodTypeDef,
|
||||
refs: Refs,
|
||||
forceResolution = false, // Forces a new schema to be instantiated even though its def has been seen. Used for improving refs in definitions. See https://github.com/StefanTerdell/zod-to-json-schema/pull/61.
|
||||
): JsonSchema7Type | undefined {
|
||||
const seenItem = refs.seen.get(def);
|
||||
|
||||
if (refs.override) {
|
||||
const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
|
||||
|
||||
if (overrideResult !== ignoreOverride) {
|
||||
return overrideResult;
|
||||
}
|
||||
}
|
||||
|
||||
if (seenItem && !forceResolution) {
|
||||
const seenSchema = get$ref(seenItem, refs);
|
||||
|
||||
if (seenSchema !== undefined) {
|
||||
if ('$ref' in seenSchema) {
|
||||
refs.seenRefs.add(seenSchema.$ref);
|
||||
}
|
||||
|
||||
return seenSchema;
|
||||
}
|
||||
}
|
||||
|
||||
const newItem: Seen = { def, path: refs.currentPath, jsonSchema: undefined };
|
||||
|
||||
refs.seen.set(def, newItem);
|
||||
|
||||
const jsonSchema = selectParser(def, (def as any).typeName, refs, forceResolution);
|
||||
|
||||
if (jsonSchema) {
|
||||
addMeta(def, refs, jsonSchema);
|
||||
}
|
||||
|
||||
newItem.jsonSchema = jsonSchema;
|
||||
|
||||
return jsonSchema;
|
||||
}
|
||||
|
||||
const get$ref = (
|
||||
item: Seen,
|
||||
refs: Refs,
|
||||
):
|
||||
| {
|
||||
$ref: string;
|
||||
}
|
||||
| {}
|
||||
| undefined => {
|
||||
switch (refs.$refStrategy) {
|
||||
case 'root':
|
||||
return { $ref: item.path.join('/') };
|
||||
// this case is needed as OpenAI strict mode doesn't support top-level `$ref`s, i.e.
|
||||
// the top-level schema *must* be `{"type": "object", "properties": {...}}` but if we ever
|
||||
// need to define a `$ref`, relative `$ref`s aren't supported, so we need to extract
|
||||
// the schema to `#/definitions/` and reference that.
|
||||
//
|
||||
// e.g. if we need to reference a schema at
|
||||
// `["#","definitions","contactPerson","properties","person1","properties","name"]`
|
||||
// then we'll extract it out to `contactPerson_properties_person1_properties_name`
|
||||
case 'extract-to-root':
|
||||
const name = item.path.slice(refs.basePath.length + 1).join('_');
|
||||
|
||||
// we don't need to extract the root schema in this case, as it's already
|
||||
// been added to the definitions
|
||||
if (name !== refs.name && refs.nameStrategy === 'duplicate-ref') {
|
||||
refs.definitions[name] = item.def;
|
||||
}
|
||||
|
||||
return { $ref: [...refs.basePath, refs.definitionPath, name].join('/') };
|
||||
case 'relative':
|
||||
return { $ref: getRelativePath(refs.currentPath, item.path) };
|
||||
case 'none':
|
||||
case 'seen': {
|
||||
if (
|
||||
item.path.length < refs.currentPath.length &&
|
||||
item.path.every((value, index) => refs.currentPath[index] === value)
|
||||
) {
|
||||
console.warn(`Recursive reference detected at ${refs.currentPath.join('/')}! Defaulting to any`);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
return refs.$refStrategy === 'seen' ? {} : undefined;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getRelativePath = (pathA: string[], pathB: string[]) => {
|
||||
let i = 0;
|
||||
for (; i < pathA.length && i < pathB.length; i++) {
|
||||
if (pathA[i] !== pathB[i]) break;
|
||||
}
|
||||
return [(pathA.length - i).toString(), ...pathB.slice(i)].join('/');
|
||||
};
|
||||
|
||||
const selectParser = (
|
||||
def: any,
|
||||
typeName: ZodFirstPartyTypeKind,
|
||||
refs: Refs,
|
||||
forceResolution: boolean,
|
||||
): JsonSchema7Type | undefined => {
|
||||
switch (typeName) {
|
||||
case ZodFirstPartyTypeKind.ZodString:
|
||||
return parseStringDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodNumber:
|
||||
return parseNumberDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodObject:
|
||||
return parseObjectDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodBigInt:
|
||||
return parseBigintDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodBoolean:
|
||||
return parseBooleanDef();
|
||||
case ZodFirstPartyTypeKind.ZodDate:
|
||||
return parseDateDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodUndefined:
|
||||
return parseUndefinedDef();
|
||||
case ZodFirstPartyTypeKind.ZodNull:
|
||||
return parseNullDef(refs);
|
||||
case ZodFirstPartyTypeKind.ZodArray:
|
||||
return parseArrayDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodUnion:
|
||||
case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
||||
return parseUnionDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodIntersection:
|
||||
return parseIntersectionDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodTuple:
|
||||
return parseTupleDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodRecord:
|
||||
return parseRecordDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodLiteral:
|
||||
return parseLiteralDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodEnum:
|
||||
return parseEnumDef(def);
|
||||
case ZodFirstPartyTypeKind.ZodNativeEnum:
|
||||
return parseNativeEnumDef(def);
|
||||
case ZodFirstPartyTypeKind.ZodNullable:
|
||||
return parseNullableDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodOptional:
|
||||
return parseOptionalDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodMap:
|
||||
return parseMapDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodSet:
|
||||
return parseSetDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodLazy:
|
||||
return parseDef(def.getter()._def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodPromise:
|
||||
return parsePromiseDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodNaN:
|
||||
case ZodFirstPartyTypeKind.ZodNever:
|
||||
return parseNeverDef();
|
||||
case ZodFirstPartyTypeKind.ZodEffects:
|
||||
return parseEffectsDef(def, refs, forceResolution);
|
||||
case ZodFirstPartyTypeKind.ZodAny:
|
||||
return parseAnyDef();
|
||||
case ZodFirstPartyTypeKind.ZodUnknown:
|
||||
return parseUnknownDef();
|
||||
case ZodFirstPartyTypeKind.ZodDefault:
|
||||
return parseDefaultDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodBranded:
|
||||
return parseBrandedDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodReadonly:
|
||||
return parseReadonlyDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodCatch:
|
||||
return parseCatchDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodPipeline:
|
||||
return parsePipelineDef(def, refs);
|
||||
case ZodFirstPartyTypeKind.ZodFunction:
|
||||
case ZodFirstPartyTypeKind.ZodVoid:
|
||||
case ZodFirstPartyTypeKind.ZodSymbol:
|
||||
return undefined;
|
||||
default:
|
||||
return ((_: never) => undefined)(typeName);
|
||||
}
|
||||
};
|
||||
|
||||
const addMeta = (def: ZodTypeDef, refs: Refs, jsonSchema: JsonSchema7Type): JsonSchema7Type => {
|
||||
if (def.description) {
|
||||
jsonSchema.description = def.description;
|
||||
|
||||
if (refs.markdownDescription) {
|
||||
jsonSchema.markdownDescription = def.description;
|
||||
}
|
||||
}
|
||||
return jsonSchema;
|
||||
};
|
||||
Assets/Synaptic AI Pro/MCPServer/node_modules/openai/src/_vendor/zod-to-json-schema/parseDef.ts.meta
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5016e1bc985db4b88a78caf5b327b5d8
|
||||
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/openai/src/_vendor/zod-to-json-schema/parseDef.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07ce88a5d39934e5b9c8f9e04a515e8f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Generated
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
export type JsonSchema7AnyType = {};
|
||||
|
||||
export function parseAnyDef(): JsonSchema7AnyType {
|
||||
return {};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acb3cf62e6ab247bc925357fa6620960
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/any.ts
|
||||
uploadId: 920982
|
||||
Assets/Synaptic AI Pro/MCPServer/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/array.ts
Generated
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
import { ZodArrayDef, ZodFirstPartyTypeKind } from 'zod';
|
||||
import { ErrorMessages, setResponseValueAndErrors } from '../errorMessages';
|
||||
import { JsonSchema7Type, parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export type JsonSchema7ArrayType = {
|
||||
type: 'array';
|
||||
items?: JsonSchema7Type | undefined;
|
||||
minItems?: number;
|
||||
maxItems?: number;
|
||||
errorMessages?: ErrorMessages<JsonSchema7ArrayType, 'items'>;
|
||||
};
|
||||
|
||||
export function parseArrayDef(def: ZodArrayDef, refs: Refs) {
|
||||
const res: JsonSchema7ArrayType = {
|
||||
type: 'array',
|
||||
};
|
||||
if (def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
|
||||
res.items = parseDef(def.type._def, {
|
||||
...refs,
|
||||
currentPath: [...refs.currentPath, 'items'],
|
||||
});
|
||||
}
|
||||
|
||||
if (def.minLength) {
|
||||
setResponseValueAndErrors(res, 'minItems', def.minLength.value, def.minLength.message, refs);
|
||||
}
|
||||
if (def.maxLength) {
|
||||
setResponseValueAndErrors(res, 'maxItems', def.maxLength.value, def.maxLength.message, refs);
|
||||
}
|
||||
if (def.exactLength) {
|
||||
setResponseValueAndErrors(res, 'minItems', def.exactLength.value, def.exactLength.message, refs);
|
||||
setResponseValueAndErrors(res, 'maxItems', def.exactLength.value, def.exactLength.message, refs);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fb588e0f3b714f50ae8626f570d04bc
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/array.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+60
@@ -0,0 +1,60 @@
|
||||
import { ZodBigIntDef } from 'zod';
|
||||
import { Refs } from '../Refs';
|
||||
import { ErrorMessages, setResponseValueAndErrors } from '../errorMessages';
|
||||
|
||||
export type JsonSchema7BigintType = {
|
||||
type: 'integer';
|
||||
format: 'int64';
|
||||
minimum?: BigInt;
|
||||
exclusiveMinimum?: BigInt;
|
||||
maximum?: BigInt;
|
||||
exclusiveMaximum?: BigInt;
|
||||
multipleOf?: BigInt;
|
||||
errorMessage?: ErrorMessages<JsonSchema7BigintType>;
|
||||
};
|
||||
|
||||
export function parseBigintDef(def: ZodBigIntDef, refs: Refs): JsonSchema7BigintType {
|
||||
const res: JsonSchema7BigintType = {
|
||||
type: 'integer',
|
||||
format: 'int64',
|
||||
};
|
||||
|
||||
if (!def.checks) return res;
|
||||
|
||||
for (const check of def.checks) {
|
||||
switch (check.kind) {
|
||||
case 'min':
|
||||
if (refs.target === 'jsonSchema7') {
|
||||
if (check.inclusive) {
|
||||
setResponseValueAndErrors(res, 'minimum', check.value, check.message, refs);
|
||||
} else {
|
||||
setResponseValueAndErrors(res, 'exclusiveMinimum', check.value, check.message, refs);
|
||||
}
|
||||
} else {
|
||||
if (!check.inclusive) {
|
||||
res.exclusiveMinimum = true as any;
|
||||
}
|
||||
setResponseValueAndErrors(res, 'minimum', check.value, check.message, refs);
|
||||
}
|
||||
break;
|
||||
case 'max':
|
||||
if (refs.target === 'jsonSchema7') {
|
||||
if (check.inclusive) {
|
||||
setResponseValueAndErrors(res, 'maximum', check.value, check.message, refs);
|
||||
} else {
|
||||
setResponseValueAndErrors(res, 'exclusiveMaximum', check.value, check.message, refs);
|
||||
}
|
||||
} else {
|
||||
if (!check.inclusive) {
|
||||
res.exclusiveMaximum = true as any;
|
||||
}
|
||||
setResponseValueAndErrors(res, 'maximum', check.value, check.message, refs);
|
||||
}
|
||||
break;
|
||||
case 'multipleOf':
|
||||
setResponseValueAndErrors(res, 'multipleOf', check.value, check.message, refs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4468dc72c6ebf47eab3ce99dc583d3b7
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/bigint.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
export type JsonSchema7BooleanType = {
|
||||
type: 'boolean';
|
||||
};
|
||||
|
||||
export function parseBooleanDef(): JsonSchema7BooleanType {
|
||||
return {
|
||||
type: 'boolean',
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2815efbaa502c4c0b844921c675eb4ef
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/boolean.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
import { ZodBrandedDef } from 'zod';
|
||||
import { parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export function parseBrandedDef(_def: ZodBrandedDef<any>, refs: Refs) {
|
||||
return parseDef(_def.type._def, refs);
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 366ed8c3626c74d04a4b5248ae44a413
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/branded.ts
|
||||
uploadId: 920982
|
||||
Assets/Synaptic AI Pro/MCPServer/node_modules/openai/src/_vendor/zod-to-json-schema/parsers/catch.ts
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
import { ZodCatchDef } from 'zod';
|
||||
import { parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export const parseCatchDef = (def: ZodCatchDef<any>, refs: Refs) => {
|
||||
return parseDef(def.innerType._def, refs);
|
||||
};
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1901302c115294653bd4c50e78160acb
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/catch.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
import { ZodDateDef } from 'zod';
|
||||
import { Refs } from '../Refs';
|
||||
import { ErrorMessages, setResponseValueAndErrors } from '../errorMessages';
|
||||
import { JsonSchema7NumberType } from './number';
|
||||
import { DateStrategy } from '../Options';
|
||||
|
||||
export type JsonSchema7DateType =
|
||||
| {
|
||||
type: 'integer' | 'string';
|
||||
format: 'unix-time' | 'date-time' | 'date';
|
||||
minimum?: number;
|
||||
maximum?: number;
|
||||
errorMessage?: ErrorMessages<JsonSchema7NumberType>;
|
||||
}
|
||||
| {
|
||||
anyOf: JsonSchema7DateType[];
|
||||
};
|
||||
|
||||
export function parseDateDef(
|
||||
def: ZodDateDef,
|
||||
refs: Refs,
|
||||
overrideDateStrategy?: DateStrategy,
|
||||
): JsonSchema7DateType {
|
||||
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
||||
|
||||
if (Array.isArray(strategy)) {
|
||||
return {
|
||||
anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)),
|
||||
};
|
||||
}
|
||||
|
||||
switch (strategy) {
|
||||
case 'string':
|
||||
case 'format:date-time':
|
||||
return {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
};
|
||||
case 'format:date':
|
||||
return {
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
};
|
||||
case 'integer':
|
||||
return integerDateParser(def, refs);
|
||||
}
|
||||
}
|
||||
|
||||
const integerDateParser = (def: ZodDateDef, refs: Refs) => {
|
||||
const res: JsonSchema7DateType = {
|
||||
type: 'integer',
|
||||
format: 'unix-time',
|
||||
};
|
||||
|
||||
if (refs.target === 'openApi3') {
|
||||
return res;
|
||||
}
|
||||
|
||||
for (const check of def.checks) {
|
||||
switch (check.kind) {
|
||||
case 'min':
|
||||
setResponseValueAndErrors(
|
||||
res,
|
||||
'minimum',
|
||||
check.value, // This is in milliseconds
|
||||
check.message,
|
||||
refs,
|
||||
);
|
||||
break;
|
||||
case 'max':
|
||||
setResponseValueAndErrors(
|
||||
res,
|
||||
'maximum',
|
||||
check.value, // This is in milliseconds
|
||||
check.message,
|
||||
refs,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d71c0479350384dde96d74dd5fc047a8
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/date.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import { ZodDefaultDef } from 'zod';
|
||||
import { JsonSchema7Type, parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export function parseDefaultDef(_def: ZodDefaultDef, refs: Refs): JsonSchema7Type & { default: any } {
|
||||
return {
|
||||
...parseDef(_def.innerType._def, refs),
|
||||
default: _def.defaultValue(),
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0fc605e4dc5a4b3c80463412276705e
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/default.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
import { ZodEffectsDef } from 'zod';
|
||||
import { JsonSchema7Type, parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export function parseEffectsDef(
|
||||
_def: ZodEffectsDef,
|
||||
refs: Refs,
|
||||
forceResolution: boolean,
|
||||
): JsonSchema7Type | undefined {
|
||||
return refs.effectStrategy === 'input' ? parseDef(_def.schema._def, refs, forceResolution) : {};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d0c84df875094f31a7db1b1b7fb3485
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/effects.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import { ZodEnumDef } from 'zod';
|
||||
|
||||
export type JsonSchema7EnumType = {
|
||||
type: 'string';
|
||||
enum: string[];
|
||||
};
|
||||
|
||||
export function parseEnumDef(def: ZodEnumDef): JsonSchema7EnumType {
|
||||
return {
|
||||
type: 'string',
|
||||
enum: [...def.values],
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9447757631c354f6aa3619536653067e
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/enum.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+64
@@ -0,0 +1,64 @@
|
||||
import { ZodIntersectionDef } from 'zod';
|
||||
import { JsonSchema7Type, parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
import { JsonSchema7StringType } from './string';
|
||||
|
||||
export type JsonSchema7AllOfType = {
|
||||
allOf: JsonSchema7Type[];
|
||||
unevaluatedProperties?: boolean;
|
||||
};
|
||||
|
||||
const isJsonSchema7AllOfType = (
|
||||
type: JsonSchema7Type | JsonSchema7StringType,
|
||||
): type is JsonSchema7AllOfType => {
|
||||
if ('type' in type && type.type === 'string') return false;
|
||||
return 'allOf' in type;
|
||||
};
|
||||
|
||||
export function parseIntersectionDef(
|
||||
def: ZodIntersectionDef,
|
||||
refs: Refs,
|
||||
): JsonSchema7AllOfType | JsonSchema7Type | undefined {
|
||||
const allOf = [
|
||||
parseDef(def.left._def, {
|
||||
...refs,
|
||||
currentPath: [...refs.currentPath, 'allOf', '0'],
|
||||
}),
|
||||
parseDef(def.right._def, {
|
||||
...refs,
|
||||
currentPath: [...refs.currentPath, 'allOf', '1'],
|
||||
}),
|
||||
].filter((x): x is JsonSchema7Type => !!x);
|
||||
|
||||
let unevaluatedProperties: Pick<JsonSchema7AllOfType, 'unevaluatedProperties'> | undefined =
|
||||
refs.target === 'jsonSchema2019-09' ? { unevaluatedProperties: false } : undefined;
|
||||
|
||||
const mergedAllOf: JsonSchema7Type[] = [];
|
||||
// If either of the schemas is an allOf, merge them into a single allOf
|
||||
allOf.forEach((schema) => {
|
||||
if (isJsonSchema7AllOfType(schema)) {
|
||||
mergedAllOf.push(...schema.allOf);
|
||||
if (schema.unevaluatedProperties === undefined) {
|
||||
// If one of the schemas has no unevaluatedProperties set,
|
||||
// the merged schema should also have no unevaluatedProperties set
|
||||
unevaluatedProperties = undefined;
|
||||
}
|
||||
} else {
|
||||
let nestedSchema: JsonSchema7Type = schema;
|
||||
if ('additionalProperties' in schema && schema.additionalProperties === false) {
|
||||
const { additionalProperties, ...rest } = schema;
|
||||
nestedSchema = rest;
|
||||
} else {
|
||||
// As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
|
||||
unevaluatedProperties = undefined;
|
||||
}
|
||||
mergedAllOf.push(nestedSchema);
|
||||
}
|
||||
});
|
||||
return mergedAllOf.length ?
|
||||
{
|
||||
allOf: mergedAllOf,
|
||||
...unevaluatedProperties,
|
||||
}
|
||||
: undefined;
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28b92953d5e3647dd9a9d5d0b0d5fa91
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/intersection.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
import { ZodLiteralDef } from 'zod';
|
||||
import { Refs } from '../Refs';
|
||||
|
||||
export type JsonSchema7LiteralType =
|
||||
| {
|
||||
type: 'string' | 'number' | 'integer' | 'boolean';
|
||||
const: string | number | boolean;
|
||||
}
|
||||
| {
|
||||
type: 'object' | 'array';
|
||||
};
|
||||
|
||||
export function parseLiteralDef(def: ZodLiteralDef, refs: Refs): JsonSchema7LiteralType {
|
||||
const parsedType = typeof def.value;
|
||||
if (
|
||||
parsedType !== 'bigint' &&
|
||||
parsedType !== 'number' &&
|
||||
parsedType !== 'boolean' &&
|
||||
parsedType !== 'string'
|
||||
) {
|
||||
return {
|
||||
type: Array.isArray(def.value) ? 'array' : 'object',
|
||||
};
|
||||
}
|
||||
|
||||
if (refs.target === 'openApi3') {
|
||||
return {
|
||||
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
||||
enum: [def.value],
|
||||
} as any;
|
||||
}
|
||||
|
||||
return {
|
||||
type: parsedType === 'bigint' ? 'integer' : parsedType,
|
||||
const: def.value,
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee7dc56ec41564fcba95659975dcec09
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/literal.ts
|
||||
uploadId: 920982
|
||||
Generated
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
import { ZodMapDef } from 'zod';
|
||||
import { JsonSchema7Type, parseDef } from '../parseDef';
|
||||
import { Refs } from '../Refs';
|
||||
import { JsonSchema7RecordType, parseRecordDef } from './record';
|
||||
|
||||
export type JsonSchema7MapType = {
|
||||
type: 'array';
|
||||
maxItems: 125;
|
||||
items: {
|
||||
type: 'array';
|
||||
items: [JsonSchema7Type, JsonSchema7Type];
|
||||
minItems: 2;
|
||||
maxItems: 2;
|
||||
};
|
||||
};
|
||||
|
||||
export function parseMapDef(def: ZodMapDef, refs: Refs): JsonSchema7MapType | JsonSchema7RecordType {
|
||||
if (refs.mapStrategy === 'record') {
|
||||
return parseRecordDef(def, refs);
|
||||
}
|
||||
|
||||
const keys =
|
||||
parseDef(def.keyType._def, {
|
||||
...refs,
|
||||
currentPath: [...refs.currentPath, 'items', 'items', '0'],
|
||||
}) || {};
|
||||
const values =
|
||||
parseDef(def.valueType._def, {
|
||||
...refs,
|
||||
currentPath: [...refs.currentPath, 'items', 'items', '1'],
|
||||
}) || {};
|
||||
return {
|
||||
type: 'array',
|
||||
maxItems: 125,
|
||||
items: {
|
||||
type: 'array',
|
||||
items: [keys, values],
|
||||
minItems: 2,
|
||||
maxItems: 2,
|
||||
},
|
||||
};
|
||||
}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7de2753c4bc434f078db103ad93c41ae
|
||||
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/openai/src/_vendor/zod-to-json-schema/parsers/map.ts
|
||||
uploadId: 920982
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user