omp-fabric 1.26.13 → 1.26.15
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/CHANGELOG.md +35 -0
- package/dist/chunks/{chunk-7KKE52AS.js → chunk-673LUJCK.js} +2 -2
- package/dist/chunks/{chunk-JHKOG5GS.js → chunk-BV3EDWSX.js} +50 -3
- package/dist/chunks/chunk-BV3EDWSX.js.map +7 -0
- package/dist/chunks/{chunk-RFTAEH2R.js → chunk-EZWJ5GBW.js} +93 -3
- package/dist/chunks/{chunk-RFTAEH2R.js.map → chunk-EZWJ5GBW.js.map} +2 -2
- package/dist/chunks/{chunk-AVSEXLZ7.js → chunk-O5SZML2M.js} +434 -3
- package/dist/chunks/chunk-O5SZML2M.js.map +7 -0
- package/dist/chunks/{chunk-2T6EHZ5G.js → chunk-S3URDR4K.js} +1 -1
- package/dist/fabric-runtime-state.js +124 -18
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/index.js +60 -1
- package/dist/index.js.map +3 -3
- package/dist/providers/image-provider.d.ts +1 -0
- package/dist/providers/image-provider.d.ts.map +1 -1
- package/dist/residency/host.js +2 -2
- package/dist/residency/omp-entry.js +2 -2
- package/dist/runtime/core-override-guest-types.js +1 -1
- package/dist/runtime/guest-host-sync.d.ts +5 -0
- package/dist/runtime/guest-host-sync.d.ts.map +1 -0
- package/dist/runtime/guest-types.d.ts +1 -1
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/guest-web-globals.d.ts +2 -0
- package/dist/runtime/guest-web-globals.d.ts.map +1 -0
- package/dist/runtime/node-process-child-source.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +12 -2
- package/dist/runtime/node-process-runtime.js.map +2 -2
- package/dist/runtime/quickjs-runtime.d.ts +1 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +2 -2
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +1 -1
- package/dist/type-error-guidance.d.ts.map +1 -1
- package/docs/architecture.md +1 -1
- package/docs/image.md +24 -3
- package/package.json +1 -1
- package/skills/fabric-exec/SKILL.md +4 -1
- package/dist/chunks/chunk-AVSEXLZ7.js.map +0 -7
- package/dist/chunks/chunk-JHKOG5GS.js.map +0 -7
- /package/dist/chunks/{chunk-7KKE52AS.js.map → chunk-673LUJCK.js.map} +0 -0
- /package/dist/chunks/{chunk-2T6EHZ5G.js.map → chunk-S3URDR4K.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.26.15
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `image.generate` and `image.edit` speak the Muse images API for a `muse-image-*` model. `aspectRatio` goes out as a `WxH` `size` (`16:9` sends `1024x576`), `count` goes out as `n` up to 10, and edits post JSON to `/images/edits` with one `images[].image_url` data URL per source, so two sources compose. The request body carries only fields Muse accepts. Before this release every Muse call failed: `aspect_ratio` and `input_references` drew `400 unknown parameter`.
|
|
8
|
+
- Three Muse-only options: `outputFormat` (`png`, `jpeg`, `webp`), `reasoningStrength` (`low`, `high`) and `toolEnablement` (`imageSearch`, `webSearch`, `shell` booleans, sent as `tool_enablement.enable_*`). Other models drop them and list them in `ignored`.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `size` accepts any `WxH` string. The three gpt-image sizes still work; a gateway that refuses another size answers with its own error in `failures`.
|
|
13
|
+
- A Muse result reports `sizeHonoured: false` only when the returned ratio differs from the requested one by more than 1 percent, because Muse renders at its own resolution.
|
|
14
|
+
- A `muse-image-*` model on a chat-completions provider infers the `images` dialect.
|
|
15
|
+
|
|
16
|
+
### Notes
|
|
17
|
+
|
|
18
|
+
- Live against sub2api 0.2.30 on 15 November: `aspectRatio: "16:9"` on 1.26.14 returned `400 unknown parameter aspect_ratio`; on this build `count: 2` with `outputFormat: "png"` returned two 2048x1152 PNGs in 10.0 s, a one-image edit returned a 2096x1184 WebP in 11.2 s, and a two-image compose at `2:1` returned a 2240x1120 WebP in 15.8 s. Each image cost $0.01.
|
|
19
|
+
|
|
20
|
+
## 1.26.14
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Both executors (QuickJS and the Node process) give guest code `TextEncoder`, `TextDecoder` (UTF-8 only), `atob`, `btoa`, `URL`, `URLSearchParams` and a `crypto` subset: `randomUUID()`, `getRandomValues()`, `subtle.digest` (SHA-1, SHA-256, SHA-384, SHA-512) and HMAC through `subtle.importKey("raw", ...)`, `subtle.sign` and `subtle.verify`. The globals compile on first use and call a synchronous host bridge that runs Node's URL parser, UTF-8 codec and `node:crypto` on the bytes the guest passes; the bridge keeps no key between calls and reads no host file, environment variable or network. Other `crypto.subtle` methods reject with `NotSupportedError`. At the default 256 MB `executor.memoryLimitBytes`, digest, HMAC and `TextDecoder` inputs stop at about 32 MB. The guest declarations and the `fabric-exec` skill describe the same surface.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- An arity error (TS2554, TS2555) on a call to a function the guest program declares itself no longer rejects the program; the call runs and the function sees the arguments it got. Arity errors on host calls such as `omp.read` still reject.
|
|
29
|
+
- `Cannot find name` for `process`, `Buffer`, `fs` and `require`, and the Node type-definition errors (TS2580, TS2591), now name the `omp.*` call or web global that does the job, for example `omp.bash({ cmd: "printenv NAME" })` for an environment variable.
|
|
30
|
+
- A template literal passed to `omp.bash`, `omp.write` or `omp.edit` that ends early at an inner backtick, or that holds a shell `${VAR}` expansion, gets a recovery hint naming the line and column and pointing to `payloads`.
|
|
31
|
+
|
|
32
|
+
### Notes
|
|
33
|
+
|
|
34
|
+
- Replaying the 407 programs the type checker rejected in session logs from 9 to 11 November: 391 still reject on 1.26.13 and 315 on this release. Rejections that carry a recovery hint rise from 67 to 108.
|
|
35
|
+
- Cost for code that uses no web global: a `return 1` program changes by +0.00 to +0.07 ms median on QuickJS and +0.08 to +0.40 ms on the Node process (five interleaved rounds). An 8 MB SHA-256 digest on QuickJS takes 492 ms after chunked hex encoding, down from 1196 ms in the first draft of the bridge.
|
|
36
|
+
- Reviewed in ZHA-5739 at 00ebe589; CI run 43133823675 passed typecheck, build, dead-code lint and the full suite on ubuntu and windows at 830a0ec.
|
|
37
|
+
|
|
3
38
|
## 1.26.13
|
|
4
39
|
|
|
5
40
|
### Fixed
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
lifecycleSourceIdentity,
|
|
11
11
|
loadModelUsage,
|
|
12
12
|
useBudgetLedger
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-S3URDR4K.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeModelAliases,
|
|
16
16
|
resolveAvailableOmpModel
|
|
@@ -685,4 +685,4 @@ if (isMain) {
|
|
|
685
685
|
export {
|
|
686
686
|
runResidentHostFromConfigPath
|
|
687
687
|
};
|
|
688
|
-
//# sourceMappingURL=chunk-
|
|
688
|
+
//# sourceMappingURL=chunk-673LUJCK.js.map
|
|
@@ -37,6 +37,53 @@ var TYPE_CORRECTNESS_CODES = /* @__PURE__ */ new Set([
|
|
|
37
37
|
7033,
|
|
38
38
|
7034
|
|
39
39
|
]);
|
|
40
|
+
var ARITY_CODES = /* @__PURE__ */ new Set([2554, 2555]);
|
|
41
|
+
var NODE_TYPES_CODES = /* @__PURE__ */ new Set([2580, 2591]);
|
|
42
|
+
var NODE_GLOBAL_HINTS = {
|
|
43
|
+
process: 'fabric_exec has no Node globals; read an environment variable with omp.bash({ cmd: "printenv NAME" }).',
|
|
44
|
+
Buffer: "fabric_exec has no Buffer; use TextEncoder, TextDecoder, atob, btoa or Uint8Array.",
|
|
45
|
+
require: "fabric_exec cannot load modules; use omp.read, omp.write and omp.bash for files and commands, and crypto.subtle for hashes.",
|
|
46
|
+
fs: "fabric_exec has no file system module; use omp.read, omp.write and omp.find."
|
|
47
|
+
};
|
|
48
|
+
var NODE_RUNTIME_HINT = "fabric_exec has no Node runtime; use the omp.* tools.";
|
|
49
|
+
var diagnosticMessage = (diagnostic) => {
|
|
50
|
+
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
51
|
+
if (diagnostic.code !== 2304 && !NODE_TYPES_CODES.has(diagnostic.code)) return message;
|
|
52
|
+
const name = /^Cannot find name '([^']+)'/.exec(message)?.[1];
|
|
53
|
+
if (name === void 0) return message;
|
|
54
|
+
const hint = Object.prototype.hasOwnProperty.call(NODE_GLOBAL_HINTS, name) ? NODE_GLOBAL_HINTS[name] : NODE_TYPES_CODES.has(diagnostic.code) ? NODE_RUNTIME_HINT : void 0;
|
|
55
|
+
return hint === void 0 ? message : `Cannot find name '${name}'. ${hint}`;
|
|
56
|
+
};
|
|
57
|
+
var enclosingCall = (sourceFile, start, end, argumentCount) => {
|
|
58
|
+
let found;
|
|
59
|
+
const visit = (node) => {
|
|
60
|
+
if (node.getStart(sourceFile) > start || node.end < end) return;
|
|
61
|
+
if ((ts.isCallExpression(node) || ts.isNewExpression(node)) && (node.arguments?.length ?? 0) === argumentCount) {
|
|
62
|
+
found = node;
|
|
63
|
+
}
|
|
64
|
+
ts.forEachChild(node, visit);
|
|
65
|
+
};
|
|
66
|
+
visit(sourceFile);
|
|
67
|
+
return found;
|
|
68
|
+
};
|
|
69
|
+
var callsGuestDeclaredFunction = (program, sourceFile, diagnostic) => {
|
|
70
|
+
if (diagnostic.start === void 0) return false;
|
|
71
|
+
const got = /but got (\d+)/.exec(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"))?.[1];
|
|
72
|
+
if (got === void 0) return false;
|
|
73
|
+
const call = enclosingCall(
|
|
74
|
+
sourceFile,
|
|
75
|
+
diagnostic.start,
|
|
76
|
+
diagnostic.start + (diagnostic.length ?? 0),
|
|
77
|
+
Number(got)
|
|
78
|
+
);
|
|
79
|
+
if (!call) return false;
|
|
80
|
+
const callee = ts.isPropertyAccessExpression(call.expression) ? call.expression.name : call.expression;
|
|
81
|
+
const checker = program.getTypeChecker();
|
|
82
|
+
let symbol = checker.getSymbolAtLocation(callee);
|
|
83
|
+
if (symbol && symbol.flags & ts.SymbolFlags.Alias) symbol = checker.getAliasedSymbol(symbol);
|
|
84
|
+
const declarations = symbol?.declarations ?? [];
|
|
85
|
+
return declarations.length > 0 && declarations.every((declaration) => declaration.getSourceFile() === sourceFile);
|
|
86
|
+
};
|
|
40
87
|
var nextCheckerId = 0;
|
|
41
88
|
var normalizeTypeScriptPath = (fileName) => fileName.replaceAll("\\", "/");
|
|
42
89
|
var OMP_GUEST_ENTRYPOINT = "__ompFabricMain";
|
|
@@ -116,10 +163,10 @@ var FabricTypeChecker = class {
|
|
|
116
163
|
this.#program = program;
|
|
117
164
|
const diagnostics = [
|
|
118
165
|
...program.getSyntacticDiagnostics(this.#sourceFile),
|
|
119
|
-
...program.getSemanticDiagnostics(this.#sourceFile).filter((diagnostic) => !TYPE_CORRECTNESS_CODES.has(diagnostic.code))
|
|
166
|
+
...program.getSemanticDiagnostics(this.#sourceFile).filter((diagnostic) => !TYPE_CORRECTNESS_CODES.has(diagnostic.code) && !(ARITY_CODES.has(diagnostic.code) && callsGuestDeclaredFunction(program, this.#sourceFile, diagnostic)))
|
|
120
167
|
];
|
|
121
168
|
const errors = diagnostics.map((diagnostic) => {
|
|
122
|
-
const message =
|
|
169
|
+
const message = diagnosticMessage(diagnostic);
|
|
123
170
|
if (!diagnostic.file || diagnostic.start === void 0) {
|
|
124
171
|
return { line: 0, column: 0, message };
|
|
125
172
|
}
|
|
@@ -184,4 +231,4 @@ export {
|
|
|
184
231
|
transpileFabricCodeWithSourceMap,
|
|
185
232
|
typeCheckFabricCode
|
|
186
233
|
};
|
|
187
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-BV3EDWSX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/runtime/type-checker.ts"],
|
|
4
|
+
"sourcesContent": ["import path from \"node:path\";\nimport ts from \"typescript\";\n\nexport interface FabricTypeError {\n line: number;\n column: number;\n message: string;\n}\n\nexport interface FabricTypeCheckResult {\n errors: FabricTypeError[];\n javascript?: string;\n sourceMap?: string;\n}\n\nconst compilerOptions: ts.CompilerOptions = {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n strict: false,\n noImplicitAny: false,\n strictNullChecks: false,\n strictFunctionTypes: false,\n strictBindCallApply: false,\n alwaysStrict: false,\n strictPropertyInitialization: false,\n noImplicitThis: false,\n useUnknownInCatchVariables: false,\n noEmit: false,\n sourceMap: true,\n skipLibCheck: true,\n lib: [\"lib.es2022.d.ts\"],\n};\n\nconst TYPE_CORRECTNESS_CODES = new Set<number>([\n 2339, 2551,\n 2322, 2345, 2367,\n 2531, 2532, 18047, 18048,\n 7006, 7008, 7019, 7031, 7032, 7033, 7034,\n]);\n\nconst ARITY_CODES = new Set<number>([2554, 2555]);\n\nconst NODE_TYPES_CODES = new Set<number>([2580, 2591]);\n\nconst NODE_GLOBAL_HINTS: Readonly<Record<string, string>> = {\n process: \"fabric_exec has no Node globals; read an environment variable with omp.bash({ cmd: \\\"printenv NAME\\\" }).\",\n Buffer: \"fabric_exec has no Buffer; use TextEncoder, TextDecoder, atob, btoa or Uint8Array.\",\n require: \"fabric_exec cannot load modules; use omp.read, omp.write and omp.bash for files and commands, and crypto.subtle for hashes.\",\n fs: \"fabric_exec has no file system module; use omp.read, omp.write and omp.find.\",\n};\n\nconst NODE_RUNTIME_HINT = \"fabric_exec has no Node runtime; use the omp.* tools.\";\n\nconst diagnosticMessage = (diagnostic: ts.Diagnostic): string => {\n const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, \"\\n\");\n if (diagnostic.code !== 2304 && !NODE_TYPES_CODES.has(diagnostic.code)) return message;\n const name = /^Cannot find name '([^']+)'/.exec(message)?.[1];\n if (name === undefined) return message;\n const hint = Object.prototype.hasOwnProperty.call(NODE_GLOBAL_HINTS, name)\n ? NODE_GLOBAL_HINTS[name]\n : NODE_TYPES_CODES.has(diagnostic.code) ? NODE_RUNTIME_HINT : undefined;\n return hint === undefined ? message : `Cannot find name '${name}'. ${hint}`;\n};\n\nconst enclosingCall = (\n sourceFile: ts.SourceFile,\n start: number,\n end: number,\n argumentCount: number,\n): ts.CallExpression | ts.NewExpression | undefined => {\n let found: ts.CallExpression | ts.NewExpression | undefined;\n const visit = (node: ts.Node): void => {\n if (node.getStart(sourceFile) > start || node.end < end) return;\n if (\n (ts.isCallExpression(node) || ts.isNewExpression(node)) &&\n (node.arguments?.length ?? 0) === argumentCount\n ) {\n found = node;\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n return found;\n};\n\nconst callsGuestDeclaredFunction = (\n program: ts.Program,\n sourceFile: ts.SourceFile,\n diagnostic: ts.Diagnostic,\n): boolean => {\n if (diagnostic.start === undefined) return false;\n const got = /but got (\\d+)/.exec(ts.flattenDiagnosticMessageText(diagnostic.messageText, \"\\n\"))?.[1];\n if (got === undefined) return false;\n const call = enclosingCall(\n sourceFile,\n diagnostic.start,\n diagnostic.start + (diagnostic.length ?? 0),\n Number(got),\n );\n if (!call) return false;\n const callee = ts.isPropertyAccessExpression(call.expression) ? call.expression.name : call.expression;\n const checker = program.getTypeChecker();\n let symbol = checker.getSymbolAtLocation(callee);\n if (symbol && symbol.flags & ts.SymbolFlags.Alias) symbol = checker.getAliasedSymbol(symbol);\n const declarations = symbol?.declarations ?? [];\n return declarations.length > 0 && declarations.every((declaration) => declaration.getSourceFile() === sourceFile);\n};\n\nlet nextCheckerId = 0;\n\nexport const normalizeTypeScriptPath = (fileName: string): string =>\n fileName.replaceAll(\"\\\\\", \"/\");\n\nexport const OMP_GUEST_ENTRYPOINT = \"__ompFabricMain\";\n\n/** Guest programs execute inside this wrapper; user code starts on wrapped line 2. */\nexport const wrapFabricGuestCode = (code: string): string =>\n `async function ${OMP_GUEST_ENTRYPOINT}() {\\n${code}\\n}\\n`;\n\nclass FabricTypeChecker {\n readonly #guestFile: string;\n readonly #declarationFile: string;\n readonly #baseHost = ts.createCompilerHost(compilerOptions, true);\n readonly #stableFiles = new Map<string, ts.SourceFile>();\n readonly #declarationSource: ts.SourceFile;\n readonly #host: ts.CompilerHost;\n #sourceText = \"\";\n #sourceFile: ts.SourceFile;\n #program: ts.Program | undefined;\n\n constructor(readonly declarations: string) {\n const id = ++nextCheckerId;\n this.#guestFile = normalizeTypeScriptPath(path.resolve(`/__omp_fabric_guest_${id}.ts`));\n this.#declarationFile = normalizeTypeScriptPath(\n path.resolve(`/__omp_fabric_globals_${id}.d.ts`),\n );\n this.#sourceFile = ts.createSourceFile(\n this.#guestFile,\n \"\",\n ts.ScriptTarget.ES2022,\n true,\n );\n this.#declarationSource = ts.createSourceFile(\n this.#declarationFile,\n declarations,\n ts.ScriptTarget.ES2022,\n true,\n );\n const isGuestFile = (fileName: string): boolean =>\n this.#baseHost.getCanonicalFileName(normalizeTypeScriptPath(fileName)) ===\n this.#baseHost.getCanonicalFileName(this.#guestFile);\n const isDeclarationFile = (fileName: string): boolean =>\n this.#baseHost.getCanonicalFileName(normalizeTypeScriptPath(fileName)) ===\n this.#baseHost.getCanonicalFileName(this.#declarationFile);\n this.#host = {\n ...this.#baseHost,\n fileExists: (fileName) =>\n isGuestFile(fileName) ||\n isDeclarationFile(fileName) ||\n this.#baseHost.fileExists(fileName),\n readFile: (fileName) => {\n if (isGuestFile(fileName)) return this.#sourceText;\n if (isDeclarationFile(fileName)) return this.declarations;\n return this.#baseHost.readFile(fileName);\n },\n getSourceFile: (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n if (isGuestFile(fileName)) return this.#sourceFile;\n if (isDeclarationFile(fileName)) return this.#declarationSource;\n const cached = this.#stableFiles.get(fileName);\n if (cached) return cached;\n const source = this.#baseHost.getSourceFile(\n fileName,\n languageVersion,\n onError,\n shouldCreateNewSourceFile,\n );\n if (source) this.#stableFiles.set(fileName, source);\n return source;\n },\n };\n }\n\n check(code: string): FabricTypeCheckResult {\n this.#sourceText = wrapFabricGuestCode(code);\n this.#sourceFile = ts.createSourceFile(\n this.#guestFile,\n this.#sourceText,\n ts.ScriptTarget.ES2022,\n true,\n );\n const program = ts.createProgram({\n rootNames: [this.#declarationFile, this.#guestFile],\n options: compilerOptions,\n host: this.#host,\n ...(this.#program ? { oldProgram: this.#program } : {}),\n });\n this.#program = program;\n const diagnostics = [\n ...program.getSyntacticDiagnostics(this.#sourceFile),\n ...program\n .getSemanticDiagnostics(this.#sourceFile)\n .filter((diagnostic) =>\n !TYPE_CORRECTNESS_CODES.has(diagnostic.code) &&\n !(ARITY_CODES.has(diagnostic.code) && callsGuestDeclaredFunction(program, this.#sourceFile, diagnostic))),\n ];\n const errors = diagnostics.map((diagnostic) => {\n const message = diagnosticMessage(diagnostic);\n if (!diagnostic.file || diagnostic.start === undefined) {\n return { line: 0, column: 0, message };\n }\n const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n return {\n line: Math.max(1, position.line),\n column: position.character + 1,\n message,\n };\n });\n if (errors.length > 0) return { errors };\n\n let javascript: string | undefined;\n let sourceMap: string | undefined;\n program.emit(this.#sourceFile, (fileName, content) => {\n if (fileName.endsWith(\".js.map\")) sourceMap = content;\n else if (fileName.endsWith(\".js\")) javascript = content;\n });\n return {\n errors,\n ...(javascript ? { javascript } : {}),\n ...(sourceMap ? { sourceMap } : {}),\n };\n }\n}\n\nconst checkerCache = new Map<string, FabricTypeChecker>();\nconst MAX_CHECKERS = 4;\n\nconst checkerFor = (declarations: string): FabricTypeChecker => {\n const cached = checkerCache.get(declarations);\n if (cached) {\n checkerCache.delete(declarations);\n checkerCache.set(declarations, cached);\n return cached;\n }\n const checker = new FabricTypeChecker(declarations);\n checkerCache.set(declarations, checker);\n while (checkerCache.size > MAX_CHECKERS) {\n const oldest = checkerCache.keys().next().value as string | undefined;\n if (oldest === undefined) break;\n checkerCache.delete(oldest);\n }\n return checker;\n};\n\nexport interface FabricTranspileResult {\n code: string;\n sourceMap?: string;\n}\n\nexport const transpileFabricCodeWithSourceMap = (code: string): FabricTranspileResult => {\n const result = ts.transpileModule(wrapFabricGuestCode(code), {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ESNext,\n sourceMap: true,\n },\n });\n return {\n code: result.outputText,\n ...(result.sourceMapText ? { sourceMap: result.sourceMapText } : {}),\n };\n};\n\nexport const typeCheckFabricCode = (\n code: string,\n declarations: string,\n): FabricTypeCheckResult => checkerFor(declarations).check(code);\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AAcf,IAAM,kBAAsC;AAAA,EAC1C,QAAQ,GAAG,aAAa;AAAA,EACxB,QAAQ,GAAG,WAAW;AAAA,EACtB,kBAAkB,GAAG,qBAAqB;AAAA,EAC1C,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,8BAA8B;AAAA,EAC9B,gBAAgB;AAAA,EAChB,4BAA4B;AAAA,EAC5B,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,cAAc;AAAA,EACd,KAAK,CAAC,iBAAiB;AACzB;AAEA,IAAM,yBAAyB,oBAAI,IAAY;AAAA,EAC7C;AAAA,EAAM;AAAA,EACN;AAAA,EAAM;AAAA,EAAM;AAAA,EACZ;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EACnB;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AACtC,CAAC;AAED,IAAM,cAAc,oBAAI,IAAY,CAAC,MAAM,IAAI,CAAC;AAEhD,IAAM,mBAAmB,oBAAI,IAAY,CAAC,MAAM,IAAI,CAAC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D,eAAa,IAAI,cAAc,OAAO;AACtC,SAAO,aAAa,OAAO,cAAc;AACvC,UAAM,SAAS,aAAa,KAAK,EAAE,KAAK,EAAE;AAC1C,QAAI,WAAW,OAAW;AAC1B,iBAAa,OAAO,MAAM;AAAA,EAC5B;AACA,SAAO;AACT;AAOO,IAAM,mCAAmC,CAAC,SAAwC;AACvF,QAAM,SAAS,GAAG,gBAAgB,oBAAoB,IAAI,GAAG;AAAA,IAC3D,iBAAiB;AAAA,MACf,QAAQ,GAAG,aAAa;AAAA,MACxB,QAAQ,GAAG,WAAW;AAAA,MACtB,WAAW;AAAA,IACb;AAAA,EACF,CAAC;AACD,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb,GAAI,OAAO,gBAAgB,EAAE,WAAW,OAAO,cAAc,IAAI,CAAC;AAAA,EACpE;AACF;AAEO,IAAM,sBAAsB,CACjC,MACA,iBAC0B,WAAW,YAAY,EAAE,MAAM,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -993,6 +993,7 @@ interface FabricMemorySessionInfo {
|
|
|
993
993
|
lineageFingerprint: string | null;
|
|
994
994
|
}
|
|
995
995
|
interface FabricMemoryApi {
|
|
996
|
+
recall(query: string): Promise<FabricMemoryRecallResult>;
|
|
996
997
|
recall(args?: FabricMemoryRecallArgs): Promise<FabricMemoryRecallResult>;
|
|
997
998
|
expand(args: FabricMemoryExpandArgs): Promise<FabricMemoryExpandResult>;
|
|
998
999
|
walk(
|
|
@@ -1406,18 +1407,29 @@ interface FabricImageResult {
|
|
|
1406
1407
|
ignored?: string[];
|
|
1407
1408
|
failures?: FabricImageAttempt[];
|
|
1408
1409
|
}
|
|
1410
|
+
interface FabricImageMuseToolEnablement {
|
|
1411
|
+
imageSearch?: boolean;
|
|
1412
|
+
webSearch?: boolean;
|
|
1413
|
+
shell?: boolean;
|
|
1414
|
+
}
|
|
1409
1415
|
interface FabricImageGenerateOptions {
|
|
1410
1416
|
model?: string;
|
|
1411
1417
|
aspectRatio?: string;
|
|
1412
|
-
size?:
|
|
1418
|
+
size?: string;
|
|
1413
1419
|
count?: number;
|
|
1414
1420
|
saveTo?: string;
|
|
1421
|
+
outputFormat?: "png" | "jpeg" | "webp";
|
|
1422
|
+
reasoningStrength?: "low" | "high";
|
|
1423
|
+
toolEnablement?: FabricImageMuseToolEnablement;
|
|
1415
1424
|
}
|
|
1416
1425
|
interface FabricImageEditOptions {
|
|
1417
1426
|
model?: string;
|
|
1418
1427
|
aspectRatio?: string;
|
|
1419
|
-
size?:
|
|
1428
|
+
size?: string;
|
|
1420
1429
|
saveTo?: string;
|
|
1430
|
+
outputFormat?: "png" | "jpeg" | "webp";
|
|
1431
|
+
reasoningStrength?: "low" | "high";
|
|
1432
|
+
toolEnablement?: FabricImageMuseToolEnablement;
|
|
1421
1433
|
}
|
|
1422
1434
|
interface FabricImageModelEntry {
|
|
1423
1435
|
selector: string;
|
|
@@ -1574,6 +1586,84 @@ declare function setTimeout(handler: (...args: any[]) => void, timeout?: number)
|
|
|
1574
1586
|
declare function clearTimeout(handle: number): void;
|
|
1575
1587
|
declare function setInterval(handler: (...args: any[]) => void, timeout?: number): number;
|
|
1576
1588
|
declare function clearInterval(handle: number): void;
|
|
1589
|
+
type FabricBufferSource = ArrayBuffer | ArrayBufferView;
|
|
1590
|
+
declare class TextEncoder {
|
|
1591
|
+
readonly encoding: "utf-8";
|
|
1592
|
+
encode(input?: string): Uint8Array;
|
|
1593
|
+
encodeInto(source: string, destination: Uint8Array): { read: number; written: number };
|
|
1594
|
+
}
|
|
1595
|
+
declare class TextDecoder {
|
|
1596
|
+
constructor(label?: string, options?: { fatal?: boolean; ignoreBOM?: boolean });
|
|
1597
|
+
readonly encoding: "utf-8";
|
|
1598
|
+
readonly fatal: boolean;
|
|
1599
|
+
readonly ignoreBOM: boolean;
|
|
1600
|
+
decode(input?: FabricBufferSource): string;
|
|
1601
|
+
}
|
|
1602
|
+
declare function atob(data: string): string;
|
|
1603
|
+
declare function btoa(data: string): string;
|
|
1604
|
+
declare class URLSearchParams {
|
|
1605
|
+
constructor(init?: string | URLSearchParams | Record<string, string> | Iterable<readonly [string, string]>);
|
|
1606
|
+
readonly size: number;
|
|
1607
|
+
append(name: string, value: string): void;
|
|
1608
|
+
delete(name: string, value?: string): void;
|
|
1609
|
+
get(name: string): string | null;
|
|
1610
|
+
getAll(name: string): string[];
|
|
1611
|
+
has(name: string, value?: string): boolean;
|
|
1612
|
+
set(name: string, value: string): void;
|
|
1613
|
+
sort(): void;
|
|
1614
|
+
forEach(callback: (value: string, name: string, parent: URLSearchParams) => void, thisArg?: unknown): void;
|
|
1615
|
+
keys(): IterableIterator<string>;
|
|
1616
|
+
values(): IterableIterator<string>;
|
|
1617
|
+
entries(): IterableIterator<[string, string]>;
|
|
1618
|
+
[Symbol.iterator](): IterableIterator<[string, string]>;
|
|
1619
|
+
toString(): string;
|
|
1620
|
+
}
|
|
1621
|
+
declare class URL {
|
|
1622
|
+
constructor(url: string | URL, base?: string | URL);
|
|
1623
|
+
static canParse(url: string | URL, base?: string | URL): boolean;
|
|
1624
|
+
href: string;
|
|
1625
|
+
readonly origin: string;
|
|
1626
|
+
protocol: string;
|
|
1627
|
+
username: string;
|
|
1628
|
+
password: string;
|
|
1629
|
+
host: string;
|
|
1630
|
+
hostname: string;
|
|
1631
|
+
port: string;
|
|
1632
|
+
pathname: string;
|
|
1633
|
+
search: string;
|
|
1634
|
+
readonly searchParams: URLSearchParams;
|
|
1635
|
+
hash: string;
|
|
1636
|
+
toString(): string;
|
|
1637
|
+
toJSON(): string;
|
|
1638
|
+
}
|
|
1639
|
+
type FabricDigestAlgorithm = "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512";
|
|
1640
|
+
type FabricHmacAlgorithm = "HMAC" | { name: "HMAC" };
|
|
1641
|
+
type FabricKeyUsage = "sign" | "verify";
|
|
1642
|
+
interface FabricCryptoKey {
|
|
1643
|
+
readonly type: "secret";
|
|
1644
|
+
readonly extractable: boolean;
|
|
1645
|
+
readonly algorithm: { readonly name: "HMAC"; readonly hash: { readonly name: FabricDigestAlgorithm }; readonly length: number };
|
|
1646
|
+
readonly usages: readonly FabricKeyUsage[];
|
|
1647
|
+
}
|
|
1648
|
+
interface FabricSubtleCrypto {
|
|
1649
|
+
digest(algorithm: FabricDigestAlgorithm | { name: FabricDigestAlgorithm }, data: FabricBufferSource): Promise<ArrayBuffer>;
|
|
1650
|
+
importKey(
|
|
1651
|
+
format: "raw",
|
|
1652
|
+
keyData: FabricBufferSource,
|
|
1653
|
+
algorithm: { name: "HMAC"; hash: FabricDigestAlgorithm | { name: FabricDigestAlgorithm } },
|
|
1654
|
+
extractable: boolean,
|
|
1655
|
+
keyUsages: readonly FabricKeyUsage[],
|
|
1656
|
+
): Promise<FabricCryptoKey>;
|
|
1657
|
+
sign(algorithm: FabricHmacAlgorithm, key: FabricCryptoKey, data: FabricBufferSource): Promise<ArrayBuffer>;
|
|
1658
|
+
verify(algorithm: FabricHmacAlgorithm, key: FabricCryptoKey, signature: FabricBufferSource, data: FabricBufferSource): Promise<boolean>;
|
|
1659
|
+
}
|
|
1660
|
+
type FabricIntegerArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array;
|
|
1661
|
+
interface FabricCryptoApi {
|
|
1662
|
+
readonly subtle: FabricSubtleCrypto;
|
|
1663
|
+
randomUUID(): string;
|
|
1664
|
+
getRandomValues<T extends FabricIntegerArray>(array: T): T;
|
|
1665
|
+
}
|
|
1666
|
+
declare const crypto: FabricCryptoApi;
|
|
1577
1667
|
`;
|
|
1578
1668
|
var FULL_CODE_GLOBAL_DECLARATIONS = [
|
|
1579
1669
|
"declare const omp: OmpToolsApi;\n",
|
|
@@ -1621,4 +1711,4 @@ export {
|
|
|
1621
1711
|
GUEST_TYPE_DECLARATIONS,
|
|
1622
1712
|
guestTypeDeclarations
|
|
1623
1713
|
};
|
|
1624
|
-
//# sourceMappingURL=chunk-
|
|
1714
|
+
//# sourceMappingURL=chunk-EZWJ5GBW.js.map
|