@kevinwang15/byok-ai 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/lib/AskAI.js +383 -0
- package/dist/lib/AskAIHistory.js +120 -0
- package/dist/lib/AskAIProvider.js +255 -0
- package/dist/lib/Markdown.js +111 -0
- package/dist/lib/PageElements.js +127 -0
- package/dist/lib/agent.js +223 -0
- package/dist/lib/answer-components.js +49 -0
- package/dist/lib/connection.d.ts +15 -0
- package/dist/lib/connection.js +32 -0
- package/dist/lib/context.js +9 -0
- package/dist/lib/conversation-files.js +164 -0
- package/dist/lib/entries/agent.d.ts +9 -0
- package/dist/lib/entries/agent.js +5 -0
- package/dist/lib/entries/connection.d.ts +2 -0
- package/dist/lib/entries/connection.js +1 -0
- package/dist/lib/entries/script-engine.d.ts +3 -0
- package/dist/lib/entries/script-engine.js +5 -0
- package/dist/lib/history.js +16 -0
- package/dist/lib/images.js +79 -0
- package/dist/lib/index.d.ts +6 -2
- package/dist/lib/index.js +18 -2326
- package/dist/lib/local-storage.d.ts +8 -0
- package/dist/lib/local-storage.js +23 -0
- package/dist/lib/mcp-result.js +11 -0
- package/dist/lib/mount.js +9 -0
- package/dist/lib/node_modules/@jitl/quickjs-ffi-types/dist/index.js +46 -0
- package/dist/lib/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.js +330 -0
- package/dist/lib/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +76 -0
- package/dist/lib/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +7 -0
- package/dist/lib/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.js +1142 -0
- package/dist/lib/node_modules/quickjs-emscripten-core/dist/index.js +21 -0
- package/dist/lib/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.js +1 -0
- package/dist/lib/page-context.js +168 -0
- package/dist/lib/page-picker.js +119 -0
- package/dist/lib/providers.js +84 -0
- package/dist/lib/rendering-context.js +4 -0
- package/dist/lib/sandbox.js +102 -0
- package/dist/lib/script-runner.js +26 -0
- package/dist/lib/script.js +9 -0
- package/dist/lib/storage.d.ts +0 -13
- package/dist/lib/storage.js +67 -0
- package/dist/lib/useAskAIImage.js +26 -0
- package/dist/lib/usePanelLayout.js +168 -0
- package/dist/lib/workspace-tools.js +182 -0
- package/package.json +14 -1
- /package/dist/lib/{sandbox-worker-BdFlhTIS.js → sandbox-worker.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
2
|
+
/** The key's value as JSON (null when unset); `error` when storage can't be read or holds no JSON. */
|
|
3
|
+
export declare function readStored(key: string): {
|
|
4
|
+
value: unknown;
|
|
5
|
+
error: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Saves the value as JSON, or removes the key when it is undefined. Whether that worked. */
|
|
8
|
+
export declare function writeStored(key: string, value: unknown): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// frontend/byok/local-storage.ts
|
|
2
|
+
var e = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
3
|
+
function t(e) {
|
|
4
|
+
try {
|
|
5
|
+
return {
|
|
6
|
+
value: JSON.parse(localStorage.getItem(e) ?? "null"),
|
|
7
|
+
error: !1
|
|
8
|
+
};
|
|
9
|
+
} catch {
|
|
10
|
+
return {
|
|
11
|
+
value: null,
|
|
12
|
+
error: !0
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function n(e, t) {
|
|
17
|
+
try {
|
|
18
|
+
return t === void 0 ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify(t)), !0;
|
|
19
|
+
} catch {
|
|
20
|
+
return !1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export { e as isRecord, t as readStored, n as writeStored };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// frontend/byok/mcp-result.ts
|
|
2
|
+
var e = (e) => typeof e == "object" && !!e && !Array.isArray(e), t = (e) => Array.isArray(e) ? e.map((e) => e?.type === "text" && typeof e.text == "string" ? e.text : JSON.stringify(e)).join("\n") : JSON.stringify(e) ?? "";
|
|
3
|
+
function n(n) {
|
|
4
|
+
if (e(n) && n.isError) return "The tool reported an error: " + t(n.content).slice(0, 2e3);
|
|
5
|
+
}
|
|
6
|
+
function r(r) {
|
|
7
|
+
let i = n(r);
|
|
8
|
+
if (i) throw Error(i);
|
|
9
|
+
return e(r) ? r.structuredContent === void 0 ? t(r.content) : r.structuredContent : r;
|
|
10
|
+
}
|
|
11
|
+
export { n as mcpError, t as mcpText, r as mcpValue };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AskAI as e } from "./AskAI.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { createRoot as n } from "react-dom/client";
|
|
4
|
+
// frontend/byok/mount.tsx
|
|
5
|
+
function r(r, i = {}) {
|
|
6
|
+
let a = n(r);
|
|
7
|
+
return a.render(/* @__PURE__ */ t(e, { ...i })), { unmount: () => a.unmount() };
|
|
8
|
+
}
|
|
9
|
+
export { r as mountAskAI };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// node_modules/@jitl/quickjs-ffi-types/dist/index.mjs
|
|
2
|
+
var e = {
|
|
3
|
+
JS_EVAL_TYPE_GLOBAL: 0,
|
|
4
|
+
JS_EVAL_TYPE_MODULE: 1,
|
|
5
|
+
JS_EVAL_TYPE_DIRECT: 2,
|
|
6
|
+
JS_EVAL_TYPE_INDIRECT: 3,
|
|
7
|
+
JS_EVAL_TYPE_MASK: 3,
|
|
8
|
+
JS_EVAL_FLAG_STRICT: 8,
|
|
9
|
+
JS_EVAL_FLAG_STRIP: 16,
|
|
10
|
+
JS_EVAL_FLAG_COMPILE_ONLY: 32,
|
|
11
|
+
JS_EVAL_FLAG_BACKTRACE_BARRIER: 64
|
|
12
|
+
}, t = {
|
|
13
|
+
BaseObjects: 1,
|
|
14
|
+
Date: 2,
|
|
15
|
+
Eval: 4,
|
|
16
|
+
StringNormalize: 8,
|
|
17
|
+
RegExp: 16,
|
|
18
|
+
RegExpCompiler: 32,
|
|
19
|
+
JSON: 64,
|
|
20
|
+
Proxy: 128,
|
|
21
|
+
MapSet: 256,
|
|
22
|
+
TypedArrays: 512,
|
|
23
|
+
Promise: 1024,
|
|
24
|
+
BigInt: 2048,
|
|
25
|
+
BigFloat: 4096,
|
|
26
|
+
BigDecimal: 8192,
|
|
27
|
+
OperatorOverloading: 16384,
|
|
28
|
+
BignumExt: 32768
|
|
29
|
+
}, n = {
|
|
30
|
+
Pending: 0,
|
|
31
|
+
Fulfilled: 1,
|
|
32
|
+
Rejected: 2
|
|
33
|
+
}, r = {
|
|
34
|
+
JS_GPN_STRING_MASK: 1,
|
|
35
|
+
JS_GPN_SYMBOL_MASK: 2,
|
|
36
|
+
JS_GPN_PRIVATE_MASK: 4,
|
|
37
|
+
JS_GPN_ENUM_ONLY: 16,
|
|
38
|
+
JS_GPN_SET_ENUM: 32,
|
|
39
|
+
QTS_GPN_NUMBER_MASK: 64,
|
|
40
|
+
QTS_STANDARD_COMPLIANT_NUMBER: 128
|
|
41
|
+
}, i = {
|
|
42
|
+
IsStrictlyEqual: 0,
|
|
43
|
+
IsSameValue: 1,
|
|
44
|
+
IsSameValueZero: 2
|
|
45
|
+
};
|
|
46
|
+
export { e as EvalFlags, r as GetOwnPropertyNamesFlags, t as IntrinsicsFlags, i as IsEqualOp, n as JSPromiseStateEnum };
|