alchemylab-opencode 1.0.5 → 1.0.7
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/build.mjs +31 -2
- package/dist/arktype-aI7TBD0R-HX4BR3RX.js +21 -0
- package/dist/arktype-aI7TBD0R-HX4BR3RX.js.map +7 -0
- package/dist/{chunk-UWZSRZHA.js → chunk-23UYOGZG.js} +817 -315
- package/dist/chunk-23UYOGZG.js.map +7 -0
- package/dist/chunk-3AF5MXLF.js +49 -0
- package/dist/chunk-3AF5MXLF.js.map +7 -0
- package/dist/chunk-FMP3YLWX.js +30 -0
- package/dist/chunk-FMP3YLWX.js.map +7 -0
- package/dist/{chunk-ANDTK76Q.js → chunk-GSE2T5UY.js} +3 -3
- package/dist/{chunk-CYXMV3J3.js → chunk-LU5XVQUD.js} +4 -4
- package/dist/chunk-O5VWOPCL.js +106 -0
- package/dist/chunk-O5VWOPCL.js.map +7 -0
- package/dist/chunk-PWFRMDDF.js +12 -0
- package/dist/{chunk-DSPC5QIG.js → chunk-SM6WZDN6.js} +9 -9
- package/dist/{chunk-MCWTARFP.js → chunk-TASPMBUL.js} +4 -4
- package/dist/chunk-VL3RSEZ2.js +160 -0
- package/dist/chunk-VL3RSEZ2.js.map +7 -0
- package/dist/default-u_dwuiYb-WOFHQQ3K.js +22 -0
- package/dist/effect-QlVUlMFu-UERLUUQW.js +29 -0
- package/dist/effect-QlVUlMFu-UERLUUQW.js.map +7 -0
- package/dist/{mcp-VAU4RMWH.js → mcp-XFGN3FWW.js} +2 -2
- package/dist/{registry-PYMN6L3G.js → registry-W4MBVBYD.js} +3 -3
- package/dist/{run-YFVCQJQM.js → run-73HUV4H3.js} +9 -6
- package/dist/{run-YFVCQJQM.js.map → run-73HUV4H3.js.map} +1 -1
- package/dist/run.js +1 -1
- package/dist/serve.js +1 -1
- package/dist/{server-K3UGWASP.js → server-2CPOG3LS.js} +9 -6
- package/dist/{session-HJFWTM7C.js → session-M6HOZ56B.js} +3 -3
- package/dist/session-M6HOZ56B.js.map +7 -0
- package/dist/{share-next-55VCIMUH.js → share-next-QRBVSD37.js} +4 -4
- package/dist/share-next-QRBVSD37.js.map +7 -0
- package/dist/sury-CWZTCd75-XC3NCMTP.js +29 -0
- package/dist/sury-CWZTCd75-XC3NCMTP.js.map +7 -0
- package/dist/typebox-Dei93FPO-QOBKW4L7.js +21 -0
- package/dist/typebox-Dei93FPO-QOBKW4L7.js.map +7 -0
- package/dist/valibot--1zFm7rT-LHHLSLYY.js +29 -0
- package/dist/valibot--1zFm7rT-LHHLSLYY.js.map +7 -0
- package/dist/valibot-D_HTw1Gn-UR62BIDY.js +60 -0
- package/dist/valibot-D_HTw1Gn-UR62BIDY.js.map +7 -0
- package/dist/{worktree-6GGDLADY.js → worktree-3GUHT2P7.js} +5 -5
- package/dist/zod-Bwrt9trS-J2GOMA2R.js +43 -0
- package/dist/zod-Bwrt9trS-J2GOMA2R.js.map +7 -0
- package/dist/zod-DSgpEGAE-VTXQW6SB.js +56 -0
- package/dist/zod-DSgpEGAE-VTXQW6SB.js.map +7 -0
- package/package.json +2 -8
- package/dist/chunk-UWZSRZHA.js.map +0 -7
- /package/dist/{chunk-ANDTK76Q.js.map → chunk-GSE2T5UY.js.map} +0 -0
- /package/dist/{chunk-CYXMV3J3.js.map → chunk-LU5XVQUD.js.map} +0 -0
- /package/dist/{mcp-VAU4RMWH.js.map → chunk-PWFRMDDF.js.map} +0 -0
- /package/dist/{chunk-DSPC5QIG.js.map → chunk-SM6WZDN6.js.map} +0 -0
- /package/dist/{chunk-MCWTARFP.js.map → chunk-TASPMBUL.js.map} +0 -0
- /package/dist/{registry-PYMN6L3G.js.map → default-u_dwuiYb-WOFHQQ3K.js.map} +0 -0
- /package/dist/{server-K3UGWASP.js.map → mcp-XFGN3FWW.js.map} +0 -0
- /package/dist/{session-HJFWTM7C.js.map → registry-W4MBVBYD.js.map} +0 -0
- /package/dist/{share-next-55VCIMUH.js.map → server-2CPOG3LS.js.map} +0 -0
- /package/dist/{worktree-6GGDLADY.js.map → worktree-3GUHT2P7.js.map} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// node_modules/@standard-community/standard-openapi/dist/index-DZEfthgZ.js
|
|
14
|
+
var errorMessageWrapper = (message) => `standard-openapi: ${message}`;
|
|
15
|
+
var openapiVendorMap = /* @__PURE__ */ new Map();
|
|
16
|
+
var getToOpenAPISchemaFn = async (vendor) => {
|
|
17
|
+
const cached = openapiVendorMap.get(vendor);
|
|
18
|
+
if (cached) {
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
21
|
+
let vendorFn;
|
|
22
|
+
switch (vendor) {
|
|
23
|
+
case "valibot":
|
|
24
|
+
vendorFn = (await import("./valibot-D_HTw1Gn-UR62BIDY.js")).default();
|
|
25
|
+
break;
|
|
26
|
+
case "zod":
|
|
27
|
+
vendorFn = (await import("./zod-DSgpEGAE-VTXQW6SB.js")).default();
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
vendorFn = (await import("./default-u_dwuiYb-WOFHQQ3K.js")).default();
|
|
31
|
+
}
|
|
32
|
+
openapiVendorMap.set(vendor, vendorFn);
|
|
33
|
+
return vendorFn;
|
|
34
|
+
};
|
|
35
|
+
var toOpenAPISchema = async (schema, context = {}) => {
|
|
36
|
+
const fn = await getToOpenAPISchemaFn(schema["~standard"].vendor);
|
|
37
|
+
const { components = {}, options } = context;
|
|
38
|
+
const _schema = await fn(schema, { components, options });
|
|
39
|
+
return {
|
|
40
|
+
schema: _schema,
|
|
41
|
+
components: Object.keys(components).length > 0 ? components : void 0
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
errorMessageWrapper,
|
|
47
|
+
toOpenAPISchema
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=chunk-3AF5MXLF.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@standard-community/standard-openapi/dist/index-DZEfthgZ.js"],
|
|
4
|
+
"sourcesContent": ["const errorMessageWrapper = (message) => `standard-openapi: ${message}`;\nconst openapiVendorMap = /* @__PURE__ */ new Map();\n\nconst getToOpenAPISchemaFn = async (vendor) => {\n const cached = openapiVendorMap.get(vendor);\n if (cached) {\n return cached;\n }\n let vendorFn;\n switch (vendor) {\n case \"valibot\":\n vendorFn = (await import('./valibot-D_HTw1Gn.js')).default();\n break;\n case \"zod\":\n vendorFn = (await import('./zod-DSgpEGAE.js')).default();\n break;\n default:\n vendorFn = (await import('./default-u_dwuiYb.js')).default();\n }\n openapiVendorMap.set(vendor, vendorFn);\n return vendorFn;\n};\n\nconst toOpenAPISchema = async (schema, context = {}) => {\n const fn = await getToOpenAPISchemaFn(schema[\"~standard\"].vendor);\n const { components = {}, options } = context;\n const _schema = await fn(schema, { components, options });\n return {\n schema: _schema,\n components: Object.keys(components).length > 0 ? components : void 0\n };\n};\nfunction loadVendor(vendor, fn) {\n openapiVendorMap.set(vendor, fn);\n}\n\nexport { errorMessageWrapper as e, loadVendor as l, toOpenAPISchema as t };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA,IAAM,sBAAsB,CAAC,YAAY,qBAAqB,OAAO;AACrE,IAAM,mBAAmC,oBAAI,IAAI;AAEjD,IAAM,uBAAuB,OAAO,WAAW;AAC7C,QAAM,SAAS,iBAAiB,IAAI,MAAM;AAC1C,MAAI,QAAQ;AACV,WAAO;AAAA,EACT;AACA,MAAI;AACJ,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,kBAAY,MAAM,OAAO,gCAAuB,GAAG,QAAQ;AAC3D;AAAA,IACF,KAAK;AACH,kBAAY,MAAM,OAAO,4BAAmB,GAAG,QAAQ;AACvD;AAAA,IACF;AACE,kBAAY,MAAM,OAAO,gCAAuB,GAAG,QAAQ;AAAA,EAC/D;AACA,mBAAiB,IAAI,QAAQ,QAAQ;AACrC,SAAO;AACT;AAEA,IAAM,kBAAkB,OAAO,QAAQ,UAAU,CAAC,MAAM;AACtD,QAAM,KAAK,MAAM,qBAAqB,OAAO,WAAW,EAAE,MAAM;AAChE,QAAM,EAAE,aAAa,CAAC,GAAG,QAAQ,IAAI;AACrC,QAAM,UAAU,MAAM,GAAG,QAAQ,EAAE,YAAY,QAAQ,CAAC;AACxD,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,YAAY,OAAO,KAAK,UAAU,EAAE,SAAS,IAAI,aAAa;AAAA,EAChE;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
convertToOpenAPISchema
|
|
14
|
+
} from "./chunk-O5VWOPCL.js";
|
|
15
|
+
import {
|
|
16
|
+
toJsonSchema
|
|
17
|
+
} from "./chunk-VL3RSEZ2.js";
|
|
18
|
+
|
|
19
|
+
// node_modules/@standard-community/standard-openapi/dist/default-u_dwuiYb.js
|
|
20
|
+
function getToOpenAPISchemaFn() {
|
|
21
|
+
return async (schema, context) => convertToOpenAPISchema(
|
|
22
|
+
await toJsonSchema(schema, context.options),
|
|
23
|
+
context
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
getToOpenAPISchemaFn
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-FMP3YLWX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@standard-community/standard-openapi/dist/default-u_dwuiYb.js"],
|
|
4
|
+
"sourcesContent": ["import { toJsonSchema } from '@standard-community/standard-json';\nimport { convertToOpenAPISchema } from './vendors/convert.js';\n\nfunction getToOpenAPISchemaFn() {\n return async (schema, context) => convertToOpenAPISchema(\n await toJsonSchema(schema, context.options),\n context\n );\n}\n\nexport { getToOpenAPISchemaFn as default };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAGA,SAAS,uBAAuB;AAC9B,SAAO,OAAO,QAAQ,YAAY;AAAA,IAChC,MAAM,aAAa,QAAQ,QAAQ,OAAO;AAAA,IAC1C;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
Provider,
|
|
16
16
|
ProviderID,
|
|
17
17
|
Session
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SM6WZDN6.js";
|
|
19
19
|
import {
|
|
20
20
|
Account,
|
|
21
21
|
Bus,
|
|
22
22
|
Config
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LU5XVQUD.js";
|
|
24
24
|
import {
|
|
25
25
|
Database,
|
|
26
26
|
InstanceState,
|
|
@@ -316,4 +316,4 @@ var ShareNext;
|
|
|
316
316
|
export {
|
|
317
317
|
ShareNext
|
|
318
318
|
};
|
|
319
|
-
//# sourceMappingURL=chunk-
|
|
319
|
+
//# sourceMappingURL=chunk-GSE2T5UY.js.map
|
|
@@ -4306,7 +4306,7 @@ var Config;
|
|
|
4306
4306
|
})) {
|
|
4307
4307
|
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
|
4308
4308
|
const message = ConfigMarkdown.FrontmatterError.isInstance(err) ? err.data.message : `Failed to parse command ${item}`;
|
|
4309
|
-
const { Session } = await import("./session-
|
|
4309
|
+
const { Session } = await import("./session-M6HOZ56B.js");
|
|
4310
4310
|
Bus.publish(Session.Event.Error, { error: new NamedError.Unknown({ message }).toObject() });
|
|
4311
4311
|
log3.error("failed to load command", { command: item, err });
|
|
4312
4312
|
return void 0;
|
|
@@ -4339,7 +4339,7 @@ var Config;
|
|
|
4339
4339
|
})) {
|
|
4340
4340
|
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
|
4341
4341
|
const message = ConfigMarkdown.FrontmatterError.isInstance(err) ? err.data.message : `Failed to parse agent ${item}`;
|
|
4342
|
-
const { Session } = await import("./session-
|
|
4342
|
+
const { Session } = await import("./session-M6HOZ56B.js");
|
|
4343
4343
|
Bus.publish(Session.Event.Error, { error: new NamedError.Unknown({ message }).toObject() });
|
|
4344
4344
|
log3.error("failed to load agent", { agent: item, err });
|
|
4345
4345
|
return void 0;
|
|
@@ -4372,7 +4372,7 @@ var Config;
|
|
|
4372
4372
|
})) {
|
|
4373
4373
|
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
|
|
4374
4374
|
const message = ConfigMarkdown.FrontmatterError.isInstance(err) ? err.data.message : `Failed to parse mode ${item}`;
|
|
4375
|
-
const { Session } = await import("./session-
|
|
4375
|
+
const { Session } = await import("./session-M6HOZ56B.js");
|
|
4376
4376
|
Bus.publish(Session.Event.Error, { error: new NamedError.Unknown({ message }).toObject() });
|
|
4377
4377
|
log3.error("failed to load mode", { mode: item, err });
|
|
4378
4378
|
return void 0;
|
|
@@ -6532,4 +6532,4 @@ export {
|
|
|
6532
6532
|
MCP,
|
|
6533
6533
|
Config
|
|
6534
6534
|
};
|
|
6535
|
-
//# sourceMappingURL=chunk-
|
|
6535
|
+
//# sourceMappingURL=chunk-LU5XVQUD.js.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// node_modules/@standard-community/standard-openapi/dist/vendors/convert.js
|
|
14
|
+
function convertToOpenAPISchema(jsonSchema, context) {
|
|
15
|
+
const _jsonSchema = JSON.parse(JSON.stringify(jsonSchema));
|
|
16
|
+
if ("nullable" in _jsonSchema && _jsonSchema.nullable === true) {
|
|
17
|
+
if (_jsonSchema.type) {
|
|
18
|
+
if (Array.isArray(_jsonSchema.type)) {
|
|
19
|
+
if (!_jsonSchema.type.includes("null")) {
|
|
20
|
+
_jsonSchema.type.push("null");
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
_jsonSchema.type = [_jsonSchema.type, "null"];
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
_jsonSchema.type = ["null"];
|
|
27
|
+
}
|
|
28
|
+
delete _jsonSchema.nullable;
|
|
29
|
+
}
|
|
30
|
+
if (_jsonSchema.$schema) {
|
|
31
|
+
delete _jsonSchema.$schema;
|
|
32
|
+
}
|
|
33
|
+
const nestedSchemaKeys = [
|
|
34
|
+
"properties",
|
|
35
|
+
"additionalProperties",
|
|
36
|
+
"items",
|
|
37
|
+
"additionalItems",
|
|
38
|
+
"allOf",
|
|
39
|
+
"anyOf",
|
|
40
|
+
"oneOf",
|
|
41
|
+
"not",
|
|
42
|
+
"if",
|
|
43
|
+
"then",
|
|
44
|
+
"else",
|
|
45
|
+
"definitions",
|
|
46
|
+
"$defs",
|
|
47
|
+
"patternProperties",
|
|
48
|
+
"propertyNames",
|
|
49
|
+
"contains"
|
|
50
|
+
// "unevaluatedProperties",
|
|
51
|
+
// "unevaluatedItems",
|
|
52
|
+
];
|
|
53
|
+
nestedSchemaKeys.forEach((key) => {
|
|
54
|
+
if (_jsonSchema[key] && (typeof _jsonSchema[key] === "object" || Array.isArray(_jsonSchema[key]))) {
|
|
55
|
+
if (key === "properties" || key === "definitions" || key === "$defs" || key === "patternProperties") {
|
|
56
|
+
for (const subKey in _jsonSchema[key]) {
|
|
57
|
+
_jsonSchema[key][subKey] = convertToOpenAPISchema(
|
|
58
|
+
_jsonSchema[key][subKey],
|
|
59
|
+
context
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
} else if (key === "allOf" || key === "anyOf" || key === "oneOf") {
|
|
63
|
+
_jsonSchema[key] = _jsonSchema[key].map(
|
|
64
|
+
(item) => convertToOpenAPISchema(item, context)
|
|
65
|
+
);
|
|
66
|
+
} else if (key === "items") {
|
|
67
|
+
if (Array.isArray(_jsonSchema[key])) {
|
|
68
|
+
_jsonSchema[key] = _jsonSchema[key].map(
|
|
69
|
+
(item) => convertToOpenAPISchema(item, context)
|
|
70
|
+
);
|
|
71
|
+
} else {
|
|
72
|
+
_jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
_jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
if (_jsonSchema.ref || _jsonSchema.$id) {
|
|
80
|
+
const { ref, $id, ...component } = _jsonSchema;
|
|
81
|
+
const id = ref || $id;
|
|
82
|
+
context.components.schemas = {
|
|
83
|
+
...context.components.schemas,
|
|
84
|
+
[id]: component
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
$ref: `#/components/schemas/${id}`
|
|
88
|
+
};
|
|
89
|
+
} else if (_jsonSchema.$ref) {
|
|
90
|
+
const { $ref, $defs } = _jsonSchema;
|
|
91
|
+
const ref = $ref.split("/").pop();
|
|
92
|
+
context.components.schemas = {
|
|
93
|
+
...context.components.schemas,
|
|
94
|
+
...$defs
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
$ref: `#/components/schemas/${ref}`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return _jsonSchema;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
convertToOpenAPISchema
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=chunk-O5VWOPCL.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@standard-community/standard-openapi/dist/vendors/convert.js"],
|
|
4
|
+
"sourcesContent": ["function convertToOpenAPISchema(jsonSchema, context) {\n const _jsonSchema = JSON.parse(JSON.stringify(jsonSchema));\n if (\"nullable\" in _jsonSchema && _jsonSchema.nullable === true) {\n if (_jsonSchema.type) {\n if (Array.isArray(_jsonSchema.type)) {\n if (!_jsonSchema.type.includes(\"null\")) {\n _jsonSchema.type.push(\"null\");\n }\n } else {\n _jsonSchema.type = [_jsonSchema.type, \"null\"];\n }\n } else {\n _jsonSchema.type = [\"null\"];\n }\n delete _jsonSchema.nullable;\n }\n if (_jsonSchema.$schema) {\n delete _jsonSchema.$schema;\n }\n const nestedSchemaKeys = [\n \"properties\",\n \"additionalProperties\",\n \"items\",\n \"additionalItems\",\n \"allOf\",\n \"anyOf\",\n \"oneOf\",\n \"not\",\n \"if\",\n \"then\",\n \"else\",\n \"definitions\",\n \"$defs\",\n \"patternProperties\",\n \"propertyNames\",\n \"contains\"\n // \"unevaluatedProperties\",\n // \"unevaluatedItems\",\n ];\n nestedSchemaKeys.forEach((key) => {\n if (_jsonSchema[key] && (typeof _jsonSchema[key] === \"object\" || Array.isArray(_jsonSchema[key]))) {\n if (key === \"properties\" || key === \"definitions\" || key === \"$defs\" || key === \"patternProperties\") {\n for (const subKey in _jsonSchema[key]) {\n _jsonSchema[key][subKey] = convertToOpenAPISchema(\n _jsonSchema[key][subKey],\n context\n );\n }\n } else if (key === \"allOf\" || key === \"anyOf\" || key === \"oneOf\") {\n _jsonSchema[key] = _jsonSchema[key].map(\n (item) => convertToOpenAPISchema(item, context)\n );\n } else if (key === \"items\") {\n if (Array.isArray(_jsonSchema[key])) {\n _jsonSchema[key] = _jsonSchema[key].map(\n (item) => convertToOpenAPISchema(item, context)\n );\n } else {\n _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);\n }\n } else {\n _jsonSchema[key] = convertToOpenAPISchema(_jsonSchema[key], context);\n }\n }\n });\n if (_jsonSchema.ref || _jsonSchema.$id) {\n const { ref, $id, ...component } = _jsonSchema;\n const id = ref || $id;\n context.components.schemas = {\n ...context.components.schemas,\n [id]: component\n };\n return {\n $ref: `#/components/schemas/${id}`\n };\n } else if (_jsonSchema.$ref) {\n const { $ref, $defs } = _jsonSchema;\n const ref = $ref.split(\"/\").pop();\n context.components.schemas = {\n ...context.components.schemas,\n ...$defs\n };\n return {\n $ref: `#/components/schemas/${ref}`\n };\n }\n return _jsonSchema;\n}\n\nexport { convertToOpenAPISchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA,SAAS,uBAAuB,YAAY,SAAS;AACnD,QAAM,cAAc,KAAK,MAAM,KAAK,UAAU,UAAU,CAAC;AACzD,MAAI,cAAc,eAAe,YAAY,aAAa,MAAM;AAC9D,QAAI,YAAY,MAAM;AACpB,UAAI,MAAM,QAAQ,YAAY,IAAI,GAAG;AACnC,YAAI,CAAC,YAAY,KAAK,SAAS,MAAM,GAAG;AACtC,sBAAY,KAAK,KAAK,MAAM;AAAA,QAC9B;AAAA,MACF,OAAO;AACL,oBAAY,OAAO,CAAC,YAAY,MAAM,MAAM;AAAA,MAC9C;AAAA,IACF,OAAO;AACL,kBAAY,OAAO,CAAC,MAAM;AAAA,IAC5B;AACA,WAAO,YAAY;AAAA,EACrB;AACA,MAAI,YAAY,SAAS;AACvB,WAAO,YAAY;AAAA,EACrB;AACA,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,EAGF;AACA,mBAAiB,QAAQ,CAAC,QAAQ;AAChC,QAAI,YAAY,GAAG,MAAM,OAAO,YAAY,GAAG,MAAM,YAAY,MAAM,QAAQ,YAAY,GAAG,CAAC,IAAI;AACjG,UAAI,QAAQ,gBAAgB,QAAQ,iBAAiB,QAAQ,W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AAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=chunk-PWFRMDDF.js.map
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
spawn,
|
|
37
37
|
withTimeout,
|
|
38
38
|
withTransientReadRetry
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LU5XVQUD.js";
|
|
40
40
|
import {
|
|
41
41
|
AppFileSystem,
|
|
42
42
|
BusEvent,
|
|
@@ -6776,7 +6776,7 @@ var Plugin;
|
|
|
6776
6776
|
const state = yield* InstanceState.make(
|
|
6777
6777
|
Effect11.fn("Plugin.state")(function* (ctx) {
|
|
6778
6778
|
const hooks = [];
|
|
6779
|
-
const { Server } = yield* Effect11.promise(() => import("./server-
|
|
6779
|
+
const { Server } = yield* Effect11.promise(() => import("./server-2CPOG3LS.js"));
|
|
6780
6780
|
const client2 = createOpencodeClient({
|
|
6781
6781
|
baseUrl: "http://localhost:4096",
|
|
6782
6782
|
directory: ctx.directory,
|
|
@@ -12742,7 +12742,7 @@ var Skill;
|
|
|
12742
12742
|
Effect15.catch(
|
|
12743
12743
|
Effect15.fnUntraced(function* (err) {
|
|
12744
12744
|
const message = ConfigMarkdown.FrontmatterError.isInstance(err) ? err.data.message : `Failed to parse skill ${match}`;
|
|
12745
|
-
const { Session: Session3 } = yield* Effect15.promise(() => import("./session-
|
|
12745
|
+
const { Session: Session3 } = yield* Effect15.promise(() => import("./session-M6HOZ56B.js"));
|
|
12746
12746
|
yield* bus.publish(Session3.Event.Error, { error: new NamedError.Unknown({ message }).toObject() });
|
|
12747
12747
|
log5.error("failed to load skill", { skill: match, err });
|
|
12748
12748
|
return void 0;
|
|
@@ -16353,7 +16353,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
|
|
16353
16353
|
item.execute = (args, opts) => Effect26.runPromise(
|
|
16354
16354
|
Effect26.gen(function* () {
|
|
16355
16355
|
const ctx = context(args, opts);
|
|
16356
|
-
const mcpModule = yield* Effect26.promise(() => import("./mcp-
|
|
16356
|
+
const mcpModule = yield* Effect26.promise(() => import("./mcp-XFGN3FWW.js"));
|
|
16357
16357
|
mcpModule.MCP.currentToolContext = { sessionId: ctx.sessionID, messageId: ctx.messageID };
|
|
16358
16358
|
yield* plugin.trigger(
|
|
16359
16359
|
"tool.execute.before",
|
|
@@ -17909,7 +17909,7 @@ var Session;
|
|
|
17909
17909
|
const cfg = yield* config.get();
|
|
17910
17910
|
if (cfg.share === "disabled") throw new Error("Sharing is disabled in configuration");
|
|
17911
17911
|
const result = yield* Effect27.promise(async () => {
|
|
17912
|
-
const { ShareNext } = await import("./share-next-
|
|
17912
|
+
const { ShareNext } = await import("./share-next-QRBVSD37.js");
|
|
17913
17913
|
return ShareNext.create(id);
|
|
17914
17914
|
});
|
|
17915
17915
|
yield* Effect27.sync(() => SyncEvent.run(Session3.Event.Updated, { sessionID: id, info: { share: { url: result.url } } }));
|
|
@@ -17917,7 +17917,7 @@ var Session;
|
|
|
17917
17917
|
});
|
|
17918
17918
|
const unshare2 = Effect27.fn("Session.unshare")(function* (id) {
|
|
17919
17919
|
yield* Effect27.promise(async () => {
|
|
17920
|
-
const { ShareNext } = await import("./share-next-
|
|
17920
|
+
const { ShareNext } = await import("./share-next-QRBVSD37.js");
|
|
17921
17921
|
await ShareNext.remove(id);
|
|
17922
17922
|
});
|
|
17923
17923
|
yield* Effect27.sync(() => SyncEvent.run(Session3.Event.Updated, { sessionID: id, info: { share: { url: null } } }));
|
|
@@ -21211,11 +21211,11 @@ Expected payload format:
|
|
|
21211
21211
|
[{"tool": "tool_name", "parameters": {...}}, {...}]`;
|
|
21212
21212
|
},
|
|
21213
21213
|
async execute(params, ctx) {
|
|
21214
|
-
const { Session: Session3 } = await import("./session-
|
|
21214
|
+
const { Session: Session3 } = await import("./session-M6HOZ56B.js");
|
|
21215
21215
|
const { PartID: PartID2 } = await import("./schema-32EBFLEO.js");
|
|
21216
21216
|
const toolCalls = params.tool_calls.slice(0, 25);
|
|
21217
21217
|
const discardedCalls = params.tool_calls.slice(25);
|
|
21218
|
-
const { ToolRegistry: ToolRegistry2 } = await import("./registry-
|
|
21218
|
+
const { ToolRegistry: ToolRegistry2 } = await import("./registry-W4MBVBYD.js");
|
|
21219
21219
|
const availableTools = await ToolRegistry2.tools({ modelID: ModelID.make(""), providerID: ProviderID.make("") });
|
|
21220
21220
|
const toolMap = new Map(availableTools.map((t) => [t.id, t]));
|
|
21221
21221
|
const executeCall = async (call) => {
|
|
@@ -23728,4 +23728,4 @@ export {
|
|
|
23728
23728
|
Session,
|
|
23729
23729
|
Plugin
|
|
23730
23730
|
};
|
|
23731
|
-
//# sourceMappingURL=chunk-
|
|
23731
|
+
//# sourceMappingURL=chunk-SM6WZDN6.js.map
|
|
@@ -11,7 +11,7 @@ if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) =
|
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
ShareNext
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GSE2T5UY.js";
|
|
15
15
|
import {
|
|
16
16
|
Command,
|
|
17
17
|
File,
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
Slug,
|
|
24
24
|
Snapshot,
|
|
25
25
|
WorkspaceID
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SM6WZDN6.js";
|
|
27
27
|
import {
|
|
28
28
|
Bus,
|
|
29
29
|
errorMessage
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LU5XVQUD.js";
|
|
31
31
|
import {
|
|
32
32
|
AppFileSystem,
|
|
33
33
|
BusEvent,
|
|
@@ -725,4 +725,4 @@ export {
|
|
|
725
725
|
Worktree,
|
|
726
726
|
WorkspaceInfo
|
|
727
727
|
};
|
|
728
|
-
//# sourceMappingURL=chunk-
|
|
728
|
+
//# sourceMappingURL=chunk-TASPMBUL.js.map
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// node_modules/quansync/dist/src-C2Pm6gXo.js
|
|
14
|
+
var GET_IS_ASYNC = /* @__PURE__ */ Symbol.for("quansync.getIsAsync");
|
|
15
|
+
var QuansyncError = class extends Error {
|
|
16
|
+
constructor(message = "Unexpected promise in sync context") {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = "QuansyncError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function isThenable(value) {
|
|
22
|
+
return value && typeof value === "object" && typeof value.then === "function";
|
|
23
|
+
}
|
|
24
|
+
function isQuansyncGenerator(value) {
|
|
25
|
+
return value && typeof value === "object" && typeof value[Symbol.iterator] === "function" && "__quansync" in value;
|
|
26
|
+
}
|
|
27
|
+
function fromObject(options) {
|
|
28
|
+
const generator = function* (...args) {
|
|
29
|
+
if (yield GET_IS_ASYNC) return yield options.async.apply(this, args);
|
|
30
|
+
return options.sync.apply(this, args);
|
|
31
|
+
};
|
|
32
|
+
function fn(...args) {
|
|
33
|
+
const iter = generator.apply(this, args);
|
|
34
|
+
iter.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);
|
|
35
|
+
iter.__quansync = true;
|
|
36
|
+
return iter;
|
|
37
|
+
}
|
|
38
|
+
fn.sync = options.sync;
|
|
39
|
+
fn.async = options.async;
|
|
40
|
+
return fn;
|
|
41
|
+
}
|
|
42
|
+
function fromPromise(promise) {
|
|
43
|
+
return fromObject({
|
|
44
|
+
async: () => Promise.resolve(promise),
|
|
45
|
+
sync: () => {
|
|
46
|
+
if (isThenable(promise)) throw new QuansyncError();
|
|
47
|
+
return promise;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function unwrapYield(value, isAsync) {
|
|
52
|
+
if (value === GET_IS_ASYNC) return isAsync;
|
|
53
|
+
if (isQuansyncGenerator(value)) return isAsync ? iterateAsync(value) : iterateSync(value);
|
|
54
|
+
if (!isAsync && isThenable(value)) throw new QuansyncError();
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
var DEFAULT_ON_YIELD = (value) => value;
|
|
58
|
+
function iterateSync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
59
|
+
let current = generator.next();
|
|
60
|
+
while (!current.done) try {
|
|
61
|
+
current = generator.next(unwrapYield(onYield(current.value, false)));
|
|
62
|
+
} catch (err) {
|
|
63
|
+
current = generator.throw(err);
|
|
64
|
+
}
|
|
65
|
+
return unwrapYield(current.value);
|
|
66
|
+
}
|
|
67
|
+
async function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {
|
|
68
|
+
let current = generator.next();
|
|
69
|
+
while (!current.done) try {
|
|
70
|
+
current = generator.next(await unwrapYield(onYield(current.value, true), true));
|
|
71
|
+
} catch (err) {
|
|
72
|
+
current = generator.throw(err);
|
|
73
|
+
}
|
|
74
|
+
return current.value;
|
|
75
|
+
}
|
|
76
|
+
function fromGeneratorFn(generatorFn, options) {
|
|
77
|
+
return fromObject({
|
|
78
|
+
name: generatorFn.name,
|
|
79
|
+
async(...args) {
|
|
80
|
+
return iterateAsync(generatorFn.apply(this, args), options?.onYield);
|
|
81
|
+
},
|
|
82
|
+
sync(...args) {
|
|
83
|
+
return iterateSync(generatorFn.apply(this, args), options?.onYield);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function quansync(input, options) {
|
|
88
|
+
if (isThenable(input)) return fromPromise(input);
|
|
89
|
+
if (typeof input === "function") return fromGeneratorFn(input, options);
|
|
90
|
+
else return fromObject(input);
|
|
91
|
+
}
|
|
92
|
+
var getIsAsync = quansync({
|
|
93
|
+
async: () => Promise.resolve(true),
|
|
94
|
+
sync: () => false
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// node_modules/@standard-community/standard-json/dist/index-CLddUTqr.js
|
|
98
|
+
var validationMapper = /* @__PURE__ */ new Map();
|
|
99
|
+
var UnsupportedVendorError = class extends Error {
|
|
100
|
+
constructor(vendor) {
|
|
101
|
+
super(`standard-json: Unsupported schema vendor "${vendor}".`);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var MissingDependencyError = class extends Error {
|
|
105
|
+
constructor(packageName) {
|
|
106
|
+
super(`standard-json: Missing dependencies "${packageName}".`);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var getToJsonSchemaFn = async (vendor) => {
|
|
110
|
+
const cached = validationMapper.get(vendor);
|
|
111
|
+
if (cached) {
|
|
112
|
+
return cached;
|
|
113
|
+
}
|
|
114
|
+
let vendorFnPromise;
|
|
115
|
+
switch (vendor) {
|
|
116
|
+
case "arktype":
|
|
117
|
+
vendorFnPromise = (await import("./arktype-aI7TBD0R-HX4BR3RX.js")).default();
|
|
118
|
+
break;
|
|
119
|
+
case "effect":
|
|
120
|
+
vendorFnPromise = (await import("./effect-QlVUlMFu-UERLUUQW.js")).default();
|
|
121
|
+
break;
|
|
122
|
+
case "sury":
|
|
123
|
+
vendorFnPromise = (await import("./sury-CWZTCd75-XC3NCMTP.js")).default();
|
|
124
|
+
break;
|
|
125
|
+
case "typebox":
|
|
126
|
+
vendorFnPromise = (await import("./typebox-Dei93FPO-QOBKW4L7.js")).default();
|
|
127
|
+
break;
|
|
128
|
+
case "valibot":
|
|
129
|
+
vendorFnPromise = (await import("./valibot--1zFm7rT-LHHLSLYY.js")).default();
|
|
130
|
+
break;
|
|
131
|
+
case "zod":
|
|
132
|
+
vendorFnPromise = (await import("./zod-Bwrt9trS-J2GOMA2R.js")).default();
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
throw new UnsupportedVendorError(vendor);
|
|
136
|
+
}
|
|
137
|
+
const vendorFn = await vendorFnPromise;
|
|
138
|
+
validationMapper.set(vendor, vendorFn);
|
|
139
|
+
return vendorFn;
|
|
140
|
+
};
|
|
141
|
+
var toJsonSchema = quansync({
|
|
142
|
+
sync: (schema, options) => {
|
|
143
|
+
const vendor = schema["~standard"].vendor;
|
|
144
|
+
const fn = validationMapper.get(vendor);
|
|
145
|
+
if (!fn) {
|
|
146
|
+
throw new UnsupportedVendorError(vendor);
|
|
147
|
+
}
|
|
148
|
+
return fn(schema, options);
|
|
149
|
+
},
|
|
150
|
+
async: async (schema, options) => {
|
|
151
|
+
const fn = await getToJsonSchemaFn(schema["~standard"].vendor);
|
|
152
|
+
return fn(schema, options);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export {
|
|
157
|
+
MissingDependencyError,
|
|
158
|
+
toJsonSchema
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=chunk-VL3RSEZ2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/quansync/dist/src-C2Pm6gXo.js", "../node_modules/@standard-community/standard-json/dist/index-CLddUTqr.js"],
|
|
4
|
+
"sourcesContent": ["//#region src/index.ts\nconst GET_IS_ASYNC = Symbol.for(\"quansync.getIsAsync\");\nvar QuansyncError = class extends Error {\n\tconstructor(message = \"Unexpected promise in sync context\") {\n\t\tsuper(message);\n\t\tthis.name = \"QuansyncError\";\n\t}\n};\nfunction isThenable(value) {\n\treturn value && typeof value === \"object\" && typeof value.then === \"function\";\n}\nfunction isQuansyncGenerator(value) {\n\treturn value && typeof value === \"object\" && typeof value[Symbol.iterator] === \"function\" && \"__quansync\" in value;\n}\nfunction fromObject(options) {\n\tconst generator = function* (...args) {\n\t\tif (yield GET_IS_ASYNC) return yield options.async.apply(this, args);\n\t\treturn options.sync.apply(this, args);\n\t};\n\tfunction fn(...args) {\n\t\tconst iter = generator.apply(this, args);\n\t\titer.then = (...thenArgs) => options.async.apply(this, args).then(...thenArgs);\n\t\titer.__quansync = true;\n\t\treturn iter;\n\t}\n\tfn.sync = options.sync;\n\tfn.async = options.async;\n\treturn fn;\n}\nfunction fromPromise(promise) {\n\treturn fromObject({\n\t\tasync: () => Promise.resolve(promise),\n\t\tsync: () => {\n\t\t\tif (isThenable(promise)) throw new QuansyncError();\n\t\t\treturn promise;\n\t\t}\n\t});\n}\nfunction unwrapYield(value, isAsync) {\n\tif (value === GET_IS_ASYNC) return isAsync;\n\tif (isQuansyncGenerator(value)) return isAsync ? iterateAsync(value) : iterateSync(value);\n\tif (!isAsync && isThenable(value)) throw new QuansyncError();\n\treturn value;\n}\nconst DEFAULT_ON_YIELD = (value) => value;\nfunction iterateSync(generator, onYield = DEFAULT_ON_YIELD) {\n\tlet current = generator.next();\n\twhile (!current.done) try {\n\t\tcurrent = generator.next(unwrapYield(onYield(current.value, false)));\n\t} catch (err) {\n\t\tcurrent = generator.throw(err);\n\t}\n\treturn unwrapYield(current.value);\n}\nasync function iterateAsync(generator, onYield = DEFAULT_ON_YIELD) {\n\tlet current = generator.next();\n\twhile (!current.done) try {\n\t\tcurrent = generator.next(await unwrapYield(onYield(current.value, true), true));\n\t} catch (err) {\n\t\tcurrent = generator.throw(err);\n\t}\n\treturn current.value;\n}\nfunction fromGeneratorFn(generatorFn, options) {\n\treturn fromObject({\n\t\tname: generatorFn.name,\n\t\tasync(...args) {\n\t\t\treturn iterateAsync(generatorFn.apply(this, args), options?.onYield);\n\t\t},\n\t\tsync(...args) {\n\t\t\treturn iterateSync(generatorFn.apply(this, args), options?.onYield);\n\t\t}\n\t});\n}\nfunction quansync(input, options) {\n\tif (isThenable(input)) return fromPromise(input);\n\tif (typeof input === \"function\") return fromGeneratorFn(input, options);\n\telse return fromObject(input);\n}\n/**\n* Converts a promise to a Quansync generator.\n*/\nfunction toGenerator(promise) {\n\tif (isQuansyncGenerator(promise)) return promise;\n\treturn fromPromise(promise)();\n}\n/**\n* @returns `true` if the current context is async, `false` otherwise.\n*/\nconst getIsAsync = quansync({\n\tasync: () => Promise.resolve(true),\n\tsync: () => false\n});\n\n//#endregion\nexport { toGenerator as a, quansync as i, QuansyncError as n, getIsAsync as r, GET_IS_ASYNC as t };", "import { quansync } from 'quansync';\n\nconst validationMapper = /* @__PURE__ */ new Map();\nclass UnsupportedVendorError extends Error {\n constructor(vendor) {\n super(`standard-json: Unsupported schema vendor \"${vendor}\".`);\n }\n}\nclass MissingDependencyError extends Error {\n constructor(packageName) {\n super(`standard-json: Missing dependencies \"${packageName}\".`);\n }\n}\n\nconst getToJsonSchemaFn = async (vendor) => {\n const cached = validationMapper.get(vendor);\n if (cached) {\n return cached;\n }\n let vendorFnPromise;\n switch (vendor) {\n case \"arktype\":\n vendorFnPromise = (await import('./arktype-aI7TBD0R.js')).default();\n break;\n case \"effect\":\n vendorFnPromise = (await import('./effect-QlVUlMFu.js')).default();\n break;\n case \"sury\":\n vendorFnPromise = (await import('./sury-CWZTCd75.js')).default();\n break;\n case \"typebox\":\n vendorFnPromise = (await import('./typebox-Dei93FPO.js')).default();\n break;\n case \"valibot\":\n vendorFnPromise = (await import('./valibot--1zFm7rT.js')).default();\n break;\n case \"zod\":\n vendorFnPromise = (await import('./zod-Bwrt9trS.js')).default();\n break;\n default:\n throw new UnsupportedVendorError(vendor);\n }\n const vendorFn = await vendorFnPromise;\n validationMapper.set(vendor, vendorFn);\n return vendorFn;\n};\n\nconst toJsonSchema = quansync({\n sync: (schema, options) => {\n const vendor = schema[\"~standard\"].vendor;\n const fn = validationMapper.get(vendor);\n if (!fn) {\n throw new UnsupportedVendorError(vendor);\n }\n return fn(schema, options);\n },\n async: async (schema, options) => {\n const fn = await getToJsonSchemaFn(schema[\"~standard\"].vendor);\n return fn(schema, options);\n }\n});\nfunction loadVendor(vendor, fn) {\n validationMapper.set(vendor, fn);\n}\n\nexport { MissingDependencyError as M, loadVendor as l, toJsonSchema as t };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AACA,IAAM,eAAe,uBAAO,IAAI,qBAAqB;AACrD,IAAI,gBAAgB,cAAc,MAAM;AAAA,EACvC,YAAY,UAAU,sCAAsC;AAC3D,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACb;AACD;AACA,SAAS,WAAW,OAAO;AAC1B,SAAO,SAAS,OAAO,UAAU,YAAY,OAAO,MAAM,SAAS;AACpE;AACA,SAAS,oBAAoB,OAAO;AACnC,SAAO,SAAS,OAAO,UAAU,YAAY,OAAO,MAAM,OAAO,QAAQ,MAAM,cAAc,gBAAgB;AAC9G;AACA,SAAS,WAAW,SAAS;AAC5B,QAAM,YAAY,cAAc,MAAM;A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,GAAG,QAAQ;AACjE;AAAA,IACF,KAAK;AACH,yBAAmB,MAAM,OAAO,6BAAoB,GAAG,QAAQ;AAC/D;AAAA,IACF,KAAK;AACH,yBAAmB,MAAM,OAAO,gCAAuB,GAAG,QAAQ;AAClE;AAAA,IACF,KAAK;AACH,yBAAmB,MAAM,OAAO,gCAAuB,GAAG,QAAQ;AAClE;AAAA,IACF,KAAK;AACH,yBAAmB,MAAM,OAAO,4BAAmB,GAAG,QAAQ;AAC9D;AAAA,IACF;AACE,YAAM,IAAI,uBAAuB,MAAM;AAAA,EAC3C;AACA,QAAM,WAAW,MAAM;AACvB,mBAAiB,IAAI,QAAQ,QAAQ;AACrC,SAAO;AACT;AAEA,IAAM,eAAe,SAAS;AAAA,EAC5B,MAAM,CAAC,QAAQ,YAAY;AACzB,UAAM,SAAS,OAAO,WAAW,EAAE;AACnC,UAAM,KAAK,iBAAiB,IAAI,MAAM;AACtC,QAAI,CAAC,IAAI;AACP,YAAM,IAAI,uBAAuB,MAAM;AAAA,IACzC;AACA,WAAO,GAAG,QAAQ,OAAO;AAAA,EAC3B;AAAA,EACA,OAAO,OAAO,QAAQ,YAAY;AAChC,UAAM,KAAK,MAAM,kBAAkB,OAAO,WAAW,EAAE,MAAM;AAC7D,WAAO,GAAG,QAAQ,OAAO;AAAA,EAC3B;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
getToOpenAPISchemaFn
|
|
14
|
+
} from "./chunk-FMP3YLWX.js";
|
|
15
|
+
import "./chunk-O5VWOPCL.js";
|
|
16
|
+
import "./chunk-PWFRMDDF.js";
|
|
17
|
+
import "./chunk-VL3RSEZ2.js";
|
|
18
|
+
import "./chunk-HORZKFCR.js";
|
|
19
|
+
export {
|
|
20
|
+
getToOpenAPISchemaFn as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=default-u_dwuiYb-WOFHQQ3K.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Built by esbuild from opencode-server source
|
|
2
|
+
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
+
globalThis.Bun = {
|
|
4
|
+
version: '0.0.0-node-compat',
|
|
5
|
+
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
+
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
+
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
MissingDependencyError
|
|
14
|
+
} from "./chunk-VL3RSEZ2.js";
|
|
15
|
+
import "./chunk-HORZKFCR.js";
|
|
16
|
+
|
|
17
|
+
// node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js
|
|
18
|
+
async function getToJsonSchemaFn() {
|
|
19
|
+
try {
|
|
20
|
+
const { JSONSchema } = await import("effect");
|
|
21
|
+
return (schema) => JSONSchema.make(schema);
|
|
22
|
+
} catch {
|
|
23
|
+
throw new MissingDependencyError("effect");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getToJsonSchemaFn as default
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=effect-QlVUlMFu-UERLUUQW.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@standard-community/standard-json/dist/effect-QlVUlMFu.js"],
|
|
4
|
+
"sourcesContent": ["import { M as MissingDependencyError } from './index-CLddUTqr.js';\nimport 'quansync';\n\nasync function getToJsonSchemaFn() {\n try {\n const { JSONSchema } = await import('effect');\n return (schema) => JSONSchema.make(schema);\n } catch {\n throw new MissingDependencyError(\"effect\");\n }\n}\n\nexport { getToJsonSchemaFn as default };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAGA,eAAe,oBAAoB;AACjC,MAAI;AACF,UAAM,EAAE,WAAW,IAAI,MAAM,OAAO,QAAQ;AAC5C,WAAO,CAAC,WAAW,WAAW,KAAK,MAAM;AAAA,EAC3C,QAAQ;AACN,UAAM,IAAI,uBAAuB,QAAQ;AAAA,EAC3C;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|