@nine-lab/nine-mu 0.1.179 → 0.1.181
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/dist/nine-mu.js +497 -486
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChat.js +1 -0
- package/src/components/NineChatManager.js +18 -1
package/dist/nine-mu.js
CHANGED
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _mcpClient, _onAction, _onStatus, _onMessage, _owner, _routeUrl, _NineChatManager_instances, connect_fn, fetchRoutes_fn, pushMessage_fn, updateStatus_fn, callTool_fn, getRoutes_fn, _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _manager, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
|
|
12
|
+
var _mcpClient, _onAction, _onStatus, _onMessage, _owner, _routeUrl, _NineChatManager_instances, connect_fn, fetchRoutes_fn, pushMessage_fn, updateStatus_fn, callTool_fn, getRoutes_fn, _chatHistory, _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _manager, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
|
|
13
13
|
import { trace as trace$1, api, nine } from "@nine-lab/nine-util";
|
|
14
14
|
class Trace extends trace$1.constructor {
|
|
15
15
|
constructor() {
|
|
@@ -455,50 +455,50 @@ function formatError(error, _mapper) {
|
|
|
455
455
|
}
|
|
456
456
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
457
457
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
458
|
+
const result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
459
|
+
if (result2 instanceof Promise) {
|
|
460
460
|
throw new $ZodAsyncError();
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
463
|
-
const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(
|
|
462
|
+
if (result2.issues.length) {
|
|
463
|
+
const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
464
464
|
captureStackTrace(e, _params == null ? void 0 : _params.callee);
|
|
465
465
|
throw e;
|
|
466
466
|
}
|
|
467
|
-
return
|
|
467
|
+
return result2.value;
|
|
468
468
|
};
|
|
469
469
|
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
470
470
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
471
|
-
let
|
|
472
|
-
if (
|
|
473
|
-
|
|
474
|
-
if (
|
|
475
|
-
const e = new ((params == null ? void 0 : params.Err) ?? _Err)(
|
|
471
|
+
let result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
472
|
+
if (result2 instanceof Promise)
|
|
473
|
+
result2 = await result2;
|
|
474
|
+
if (result2.issues.length) {
|
|
475
|
+
const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
476
476
|
captureStackTrace(e, params == null ? void 0 : params.callee);
|
|
477
477
|
throw e;
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return result2.value;
|
|
480
480
|
};
|
|
481
481
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
482
482
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
483
|
-
const
|
|
484
|
-
if (
|
|
483
|
+
const result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
484
|
+
if (result2 instanceof Promise) {
|
|
485
485
|
throw new $ZodAsyncError();
|
|
486
486
|
}
|
|
487
|
-
return
|
|
487
|
+
return result2.issues.length ? {
|
|
488
488
|
success: false,
|
|
489
|
-
error: new (_Err ?? $ZodError)(
|
|
490
|
-
} : { success: true, data:
|
|
489
|
+
error: new (_Err ?? $ZodError)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
490
|
+
} : { success: true, data: result2.value };
|
|
491
491
|
};
|
|
492
492
|
const safeParse$2 = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
493
493
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
494
494
|
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
495
|
-
let
|
|
496
|
-
if (
|
|
497
|
-
|
|
498
|
-
return
|
|
495
|
+
let result2 = schema._zod.run({ value, issues: [] }, ctx);
|
|
496
|
+
if (result2 instanceof Promise)
|
|
497
|
+
result2 = await result2;
|
|
498
|
+
return result2.issues.length ? {
|
|
499
499
|
success: false,
|
|
500
|
-
error: new _Err(
|
|
501
|
-
} : { success: true, data:
|
|
500
|
+
error: new _Err(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
501
|
+
} : { success: true, data: result2.value };
|
|
502
502
|
};
|
|
503
503
|
const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
504
504
|
const cuid = /^[cC][^\s-]{8,}$/;
|
|
@@ -1043,13 +1043,13 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1043
1043
|
return payload;
|
|
1044
1044
|
};
|
|
1045
1045
|
inst._zod.run = (payload, ctx) => {
|
|
1046
|
-
const
|
|
1047
|
-
if (
|
|
1046
|
+
const result2 = inst._zod.parse(payload, ctx);
|
|
1047
|
+
if (result2 instanceof Promise) {
|
|
1048
1048
|
if (ctx.async === false)
|
|
1049
1049
|
throw new $ZodAsyncError();
|
|
1050
|
-
return
|
|
1050
|
+
return result2.then((result3) => runChecks(result3, checks, ctx));
|
|
1051
1051
|
}
|
|
1052
|
-
return runChecks(
|
|
1052
|
+
return runChecks(result2, checks, ctx);
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
1055
|
inst["~standard"] = {
|
|
@@ -1451,11 +1451,11 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
1451
1451
|
return payload;
|
|
1452
1452
|
};
|
|
1453
1453
|
});
|
|
1454
|
-
function handleArrayResult(
|
|
1455
|
-
if (
|
|
1456
|
-
final.issues.push(...prefixIssues(index,
|
|
1454
|
+
function handleArrayResult(result2, final, index) {
|
|
1455
|
+
if (result2.issues.length) {
|
|
1456
|
+
final.issues.push(...prefixIssues(index, result2.issues));
|
|
1457
1457
|
}
|
|
1458
|
-
final.value[index] =
|
|
1458
|
+
final.value[index] = result2.value;
|
|
1459
1459
|
}
|
|
1460
1460
|
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1461
1461
|
$ZodType.init(inst, def);
|
|
@@ -1474,14 +1474,14 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1474
1474
|
const proms = [];
|
|
1475
1475
|
for (let i = 0; i < input.length; i++) {
|
|
1476
1476
|
const item = input[i];
|
|
1477
|
-
const
|
|
1477
|
+
const result2 = def.element._zod.run({
|
|
1478
1478
|
value: item,
|
|
1479
1479
|
issues: []
|
|
1480
1480
|
}, ctx);
|
|
1481
|
-
if (
|
|
1482
|
-
proms.push(
|
|
1481
|
+
if (result2 instanceof Promise) {
|
|
1482
|
+
proms.push(result2.then((result3) => handleArrayResult(result3, payload, i)));
|
|
1483
1483
|
} else {
|
|
1484
|
-
handleArrayResult(
|
|
1484
|
+
handleArrayResult(result2, payload, i);
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
if (proms.length) {
|
|
@@ -1490,28 +1490,28 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1490
1490
|
return payload;
|
|
1491
1491
|
};
|
|
1492
1492
|
});
|
|
1493
|
-
function handleObjectResult(
|
|
1494
|
-
if (
|
|
1495
|
-
final.issues.push(...prefixIssues(key,
|
|
1493
|
+
function handleObjectResult(result2, final, key) {
|
|
1494
|
+
if (result2.issues.length) {
|
|
1495
|
+
final.issues.push(...prefixIssues(key, result2.issues));
|
|
1496
1496
|
}
|
|
1497
|
-
final.value[key] =
|
|
1497
|
+
final.value[key] = result2.value;
|
|
1498
1498
|
}
|
|
1499
|
-
function handleOptionalObjectResult(
|
|
1500
|
-
if (
|
|
1499
|
+
function handleOptionalObjectResult(result2, final, key, input) {
|
|
1500
|
+
if (result2.issues.length) {
|
|
1501
1501
|
if (input[key] === void 0) {
|
|
1502
1502
|
if (key in input) {
|
|
1503
1503
|
final.value[key] = void 0;
|
|
1504
1504
|
} else {
|
|
1505
|
-
final.value[key] =
|
|
1505
|
+
final.value[key] = result2.value;
|
|
1506
1506
|
}
|
|
1507
1507
|
} else {
|
|
1508
|
-
final.issues.push(...prefixIssues(key,
|
|
1508
|
+
final.issues.push(...prefixIssues(key, result2.issues));
|
|
1509
1509
|
}
|
|
1510
|
-
} else if (
|
|
1510
|
+
} else if (result2.value === void 0) {
|
|
1511
1511
|
if (key in input)
|
|
1512
1512
|
final.value[key] = void 0;
|
|
1513
1513
|
} else {
|
|
1514
|
-
final.value[key] =
|
|
1514
|
+
final.value[key] = result2.value;
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
1517
|
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
@@ -1677,9 +1677,9 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1677
1677
|
};
|
|
1678
1678
|
});
|
|
1679
1679
|
function handleUnionResults(results, final, inst, ctx) {
|
|
1680
|
-
for (const
|
|
1681
|
-
if (
|
|
1682
|
-
final.value =
|
|
1680
|
+
for (const result2 of results) {
|
|
1681
|
+
if (result2.issues.length === 0) {
|
|
1682
|
+
final.value = result2.value;
|
|
1683
1683
|
return final;
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
@@ -1687,7 +1687,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
1687
1687
|
code: "invalid_union",
|
|
1688
1688
|
input: final.value,
|
|
1689
1689
|
inst,
|
|
1690
|
-
errors: results.map((
|
|
1690
|
+
errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1691
1691
|
});
|
|
1692
1692
|
return final;
|
|
1693
1693
|
}
|
|
@@ -1712,17 +1712,17 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
1712
1712
|
let async = false;
|
|
1713
1713
|
const results = [];
|
|
1714
1714
|
for (const option of def.options) {
|
|
1715
|
-
const
|
|
1715
|
+
const result2 = option._zod.run({
|
|
1716
1716
|
value: payload.value,
|
|
1717
1717
|
issues: []
|
|
1718
1718
|
}, ctx);
|
|
1719
|
-
if (
|
|
1720
|
-
results.push(
|
|
1719
|
+
if (result2 instanceof Promise) {
|
|
1720
|
+
results.push(result2);
|
|
1721
1721
|
async = true;
|
|
1722
1722
|
} else {
|
|
1723
|
-
if (
|
|
1724
|
-
return
|
|
1725
|
-
results.push(
|
|
1723
|
+
if (result2.issues.length === 0)
|
|
1724
|
+
return result2;
|
|
1725
|
+
results.push(result2);
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
1728
|
if (!async)
|
|
@@ -1855,21 +1855,21 @@ function mergeValues(a, b) {
|
|
|
1855
1855
|
}
|
|
1856
1856
|
return { valid: false, mergeErrorPath: [] };
|
|
1857
1857
|
}
|
|
1858
|
-
function handleIntersectionResults(
|
|
1858
|
+
function handleIntersectionResults(result2, left, right) {
|
|
1859
1859
|
if (left.issues.length) {
|
|
1860
|
-
|
|
1860
|
+
result2.issues.push(...left.issues);
|
|
1861
1861
|
}
|
|
1862
1862
|
if (right.issues.length) {
|
|
1863
|
-
|
|
1863
|
+
result2.issues.push(...right.issues);
|
|
1864
1864
|
}
|
|
1865
|
-
if (aborted(
|
|
1866
|
-
return
|
|
1865
|
+
if (aborted(result2))
|
|
1866
|
+
return result2;
|
|
1867
1867
|
const merged = mergeValues(left.value, right.value);
|
|
1868
1868
|
if (!merged.valid) {
|
|
1869
1869
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
|
1870
1870
|
}
|
|
1871
|
-
|
|
1872
|
-
return
|
|
1871
|
+
result2.value = merged.data;
|
|
1872
|
+
return result2;
|
|
1873
1873
|
}
|
|
1874
1874
|
const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
1875
1875
|
$ZodType.init(inst, def);
|
|
@@ -1890,19 +1890,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
1890
1890
|
payload.value = {};
|
|
1891
1891
|
for (const key of values) {
|
|
1892
1892
|
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1893
|
-
const
|
|
1894
|
-
if (
|
|
1895
|
-
proms.push(
|
|
1896
|
-
if (
|
|
1897
|
-
payload.issues.push(...prefixIssues(key,
|
|
1893
|
+
const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1894
|
+
if (result2 instanceof Promise) {
|
|
1895
|
+
proms.push(result2.then((result3) => {
|
|
1896
|
+
if (result3.issues.length) {
|
|
1897
|
+
payload.issues.push(...prefixIssues(key, result3.issues));
|
|
1898
1898
|
}
|
|
1899
|
-
payload.value[key] =
|
|
1899
|
+
payload.value[key] = result3.value;
|
|
1900
1900
|
}));
|
|
1901
1901
|
} else {
|
|
1902
|
-
if (
|
|
1903
|
-
payload.issues.push(...prefixIssues(key,
|
|
1902
|
+
if (result2.issues.length) {
|
|
1903
|
+
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1904
1904
|
}
|
|
1905
|
-
payload.value[key] =
|
|
1905
|
+
payload.value[key] = result2.value;
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
@@ -1942,19 +1942,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
1942
1942
|
payload.value[keyResult.value] = keyResult.value;
|
|
1943
1943
|
continue;
|
|
1944
1944
|
}
|
|
1945
|
-
const
|
|
1946
|
-
if (
|
|
1947
|
-
proms.push(
|
|
1948
|
-
if (
|
|
1949
|
-
payload.issues.push(...prefixIssues(key,
|
|
1945
|
+
const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1946
|
+
if (result2 instanceof Promise) {
|
|
1947
|
+
proms.push(result2.then((result3) => {
|
|
1948
|
+
if (result3.issues.length) {
|
|
1949
|
+
payload.issues.push(...prefixIssues(key, result3.issues));
|
|
1950
1950
|
}
|
|
1951
|
-
payload.value[keyResult.value] =
|
|
1951
|
+
payload.value[keyResult.value] = result3.value;
|
|
1952
1952
|
}));
|
|
1953
1953
|
} else {
|
|
1954
|
-
if (
|
|
1955
|
-
payload.issues.push(...prefixIssues(key,
|
|
1954
|
+
if (result2.issues.length) {
|
|
1955
|
+
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1956
1956
|
}
|
|
1957
|
-
payload.value[keyResult.value] =
|
|
1957
|
+
payload.value[keyResult.value] = result2.value;
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
1960
|
}
|
|
@@ -2066,11 +2066,11 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
2066
2066
|
payload.value = def.defaultValue;
|
|
2067
2067
|
return payload;
|
|
2068
2068
|
}
|
|
2069
|
-
const
|
|
2070
|
-
if (
|
|
2071
|
-
return
|
|
2069
|
+
const result2 = def.innerType._zod.run(payload, ctx);
|
|
2070
|
+
if (result2 instanceof Promise) {
|
|
2071
|
+
return result2.then((result3) => handleDefaultResult(result3, def));
|
|
2072
2072
|
}
|
|
2073
|
-
return handleDefaultResult(
|
|
2073
|
+
return handleDefaultResult(result2, def);
|
|
2074
2074
|
};
|
|
2075
2075
|
});
|
|
2076
2076
|
function handleDefaultResult(payload, def) {
|
|
@@ -2097,11 +2097,11 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
|
|
|
2097
2097
|
return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
|
|
2098
2098
|
});
|
|
2099
2099
|
inst._zod.parse = (payload, ctx) => {
|
|
2100
|
-
const
|
|
2101
|
-
if (
|
|
2102
|
-
return
|
|
2100
|
+
const result2 = def.innerType._zod.run(payload, ctx);
|
|
2101
|
+
if (result2 instanceof Promise) {
|
|
2102
|
+
return result2.then((result3) => handleNonOptionalResult(result3, inst));
|
|
2103
2103
|
}
|
|
2104
|
-
return handleNonOptionalResult(
|
|
2104
|
+
return handleNonOptionalResult(result2, inst);
|
|
2105
2105
|
};
|
|
2106
2106
|
});
|
|
2107
2107
|
function handleNonOptionalResult(payload, inst) {
|
|
@@ -2121,15 +2121,15 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2121
2121
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2122
2122
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2123
2123
|
inst._zod.parse = (payload, ctx) => {
|
|
2124
|
-
const
|
|
2125
|
-
if (
|
|
2126
|
-
return
|
|
2127
|
-
payload.value =
|
|
2128
|
-
if (
|
|
2124
|
+
const result2 = def.innerType._zod.run(payload, ctx);
|
|
2125
|
+
if (result2 instanceof Promise) {
|
|
2126
|
+
return result2.then((result3) => {
|
|
2127
|
+
payload.value = result3.value;
|
|
2128
|
+
if (result3.issues.length) {
|
|
2129
2129
|
payload.value = def.catchValue({
|
|
2130
2130
|
...payload,
|
|
2131
2131
|
error: {
|
|
2132
|
-
issues:
|
|
2132
|
+
issues: result3.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2133
2133
|
},
|
|
2134
2134
|
input: payload.value
|
|
2135
2135
|
});
|
|
@@ -2138,12 +2138,12 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2138
2138
|
return payload;
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
|
-
payload.value =
|
|
2142
|
-
if (
|
|
2141
|
+
payload.value = result2.value;
|
|
2142
|
+
if (result2.issues.length) {
|
|
2143
2143
|
payload.value = def.catchValue({
|
|
2144
2144
|
...payload,
|
|
2145
2145
|
error: {
|
|
2146
|
-
issues:
|
|
2146
|
+
issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2147
2147
|
},
|
|
2148
2148
|
input: payload.value
|
|
2149
2149
|
});
|
|
@@ -2178,11 +2178,11 @@ const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) =>
|
|
|
2178
2178
|
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2179
2179
|
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2180
2180
|
inst._zod.parse = (payload, ctx) => {
|
|
2181
|
-
const
|
|
2182
|
-
if (
|
|
2183
|
-
return
|
|
2181
|
+
const result2 = def.innerType._zod.run(payload, ctx);
|
|
2182
|
+
if (result2 instanceof Promise) {
|
|
2183
|
+
return result2.then(handleReadonlyResult);
|
|
2184
2184
|
}
|
|
2185
|
-
return handleReadonlyResult(
|
|
2185
|
+
return handleReadonlyResult(result2);
|
|
2186
2186
|
};
|
|
2187
2187
|
});
|
|
2188
2188
|
function handleReadonlyResult(payload) {
|
|
@@ -2205,8 +2205,8 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
2205
2205
|
return;
|
|
2206
2206
|
};
|
|
2207
2207
|
});
|
|
2208
|
-
function handleRefineResult(
|
|
2209
|
-
if (!
|
|
2208
|
+
function handleRefineResult(result2, payload, input, inst) {
|
|
2209
|
+
if (!result2) {
|
|
2210
2210
|
const _iss = {
|
|
2211
2211
|
code: "custom",
|
|
2212
2212
|
input,
|
|
@@ -2711,12 +2711,12 @@ function isZ4Schema(s) {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
function safeParse$1(schema, data) {
|
|
2713
2713
|
if (isZ4Schema(schema)) {
|
|
2714
|
-
const
|
|
2715
|
-
return
|
|
2714
|
+
const result3 = safeParse$2(schema, data);
|
|
2715
|
+
return result3;
|
|
2716
2716
|
}
|
|
2717
2717
|
const v3Schema = schema;
|
|
2718
|
-
const
|
|
2719
|
-
return
|
|
2718
|
+
const result2 = v3Schema.safeParse(data);
|
|
2719
|
+
return result2;
|
|
2720
2720
|
}
|
|
2721
2721
|
function getObjectShape(schema) {
|
|
2722
2722
|
var _a2, _b;
|
|
@@ -4976,11 +4976,11 @@ function getMethodLiteral(schema) {
|
|
|
4976
4976
|
return value;
|
|
4977
4977
|
}
|
|
4978
4978
|
function parseWithCompat(schema, data) {
|
|
4979
|
-
const
|
|
4980
|
-
if (!
|
|
4981
|
-
throw
|
|
4979
|
+
const result2 = safeParse$1(schema, data);
|
|
4980
|
+
if (!result2.success) {
|
|
4981
|
+
throw result2.error;
|
|
4982
4982
|
}
|
|
4983
|
-
return
|
|
4983
|
+
return result2.data;
|
|
4984
4984
|
}
|
|
4985
4985
|
const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
4986
4986
|
class Protocol {
|
|
@@ -5057,12 +5057,12 @@ class Protocol {
|
|
|
5057
5057
|
return await handleTaskResult();
|
|
5058
5058
|
}
|
|
5059
5059
|
if (isTerminal(task.status)) {
|
|
5060
|
-
const
|
|
5060
|
+
const result2 = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
5061
5061
|
this._clearTaskQueue(taskId);
|
|
5062
5062
|
return {
|
|
5063
|
-
...
|
|
5063
|
+
...result2,
|
|
5064
5064
|
_meta: {
|
|
5065
|
-
...
|
|
5065
|
+
...result2._meta,
|
|
5066
5066
|
[RELATED_TASK_META_KEY]: {
|
|
5067
5067
|
taskId
|
|
5068
5068
|
}
|
|
@@ -5293,12 +5293,12 @@ class Protocol {
|
|
|
5293
5293
|
if (taskCreationParams) {
|
|
5294
5294
|
this.assertTaskHandlerCapability(request.method);
|
|
5295
5295
|
}
|
|
5296
|
-
}).then(() => handler(request, fullExtra)).then(async (
|
|
5296
|
+
}).then(() => handler(request, fullExtra)).then(async (result2) => {
|
|
5297
5297
|
if (abortController.signal.aborted) {
|
|
5298
5298
|
return;
|
|
5299
5299
|
}
|
|
5300
5300
|
const response = {
|
|
5301
|
-
result,
|
|
5301
|
+
result: result2,
|
|
5302
5302
|
jsonrpc: "2.0",
|
|
5303
5303
|
id: request.id
|
|
5304
5304
|
};
|
|
@@ -5384,9 +5384,9 @@ class Protocol {
|
|
|
5384
5384
|
this._cleanupTimeout(messageId);
|
|
5385
5385
|
let isTaskResponse = false;
|
|
5386
5386
|
if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
|
|
5387
|
-
const
|
|
5388
|
-
if (
|
|
5389
|
-
const task =
|
|
5387
|
+
const result2 = response.result;
|
|
5388
|
+
if (result2.task && typeof result2.task === "object") {
|
|
5389
|
+
const task = result2.task;
|
|
5390
5390
|
if (typeof task.taskId === "string") {
|
|
5391
5391
|
isTaskResponse = true;
|
|
5392
5392
|
this._taskProgressTokens.set(task.taskId, messageId);
|
|
@@ -5445,8 +5445,8 @@ class Protocol {
|
|
|
5445
5445
|
const { task } = options ?? {};
|
|
5446
5446
|
if (!task) {
|
|
5447
5447
|
try {
|
|
5448
|
-
const
|
|
5449
|
-
yield { type: "result", result };
|
|
5448
|
+
const result2 = await this.request(request, resultSchema, options);
|
|
5449
|
+
yield { type: "result", result: result2 };
|
|
5450
5450
|
} catch (error) {
|
|
5451
5451
|
yield {
|
|
5452
5452
|
type: "error",
|
|
@@ -5469,8 +5469,8 @@ class Protocol {
|
|
|
5469
5469
|
yield { type: "taskStatus", task: task2 };
|
|
5470
5470
|
if (isTerminal(task2.status)) {
|
|
5471
5471
|
if (task2.status === "completed") {
|
|
5472
|
-
const
|
|
5473
|
-
yield { type: "result", result };
|
|
5472
|
+
const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
|
|
5473
|
+
yield { type: "result", result: result2 };
|
|
5474
5474
|
} else if (task2.status === "failed") {
|
|
5475
5475
|
yield {
|
|
5476
5476
|
type: "error",
|
|
@@ -5485,8 +5485,8 @@ class Protocol {
|
|
|
5485
5485
|
return;
|
|
5486
5486
|
}
|
|
5487
5487
|
if (task2.status === "input_required") {
|
|
5488
|
-
const
|
|
5489
|
-
yield { type: "result", result };
|
|
5488
|
+
const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
|
|
5489
|
+
yield { type: "result", result: result2 };
|
|
5490
5490
|
return;
|
|
5491
5491
|
}
|
|
5492
5492
|
const pollInterval = task2.pollInterval ?? ((_a2 = this._options) == null ? void 0 : _a2.defaultTaskPollInterval) ?? 1e3;
|
|
@@ -5888,8 +5888,8 @@ class Protocol {
|
|
|
5888
5888
|
}
|
|
5889
5889
|
return task;
|
|
5890
5890
|
},
|
|
5891
|
-
storeTaskResult: async (taskId, status,
|
|
5892
|
-
await taskStore.storeTaskResult(taskId, status,
|
|
5891
|
+
storeTaskResult: async (taskId, status, result2) => {
|
|
5892
|
+
await taskStore.storeTaskResult(taskId, status, result2, sessionId);
|
|
5893
5893
|
const task = await taskStore.getTask(taskId, sessionId);
|
|
5894
5894
|
if (task) {
|
|
5895
5895
|
const notification = TaskStatusNotificationSchema.parse({
|
|
@@ -5936,20 +5936,20 @@ function isPlainObject(value) {
|
|
|
5936
5936
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5937
5937
|
}
|
|
5938
5938
|
function mergeCapabilities(base2, additional) {
|
|
5939
|
-
const
|
|
5939
|
+
const result2 = { ...base2 };
|
|
5940
5940
|
for (const key in additional) {
|
|
5941
5941
|
const k = key;
|
|
5942
5942
|
const addValue = additional[k];
|
|
5943
5943
|
if (addValue === void 0)
|
|
5944
5944
|
continue;
|
|
5945
|
-
const baseValue =
|
|
5945
|
+
const baseValue = result2[k];
|
|
5946
5946
|
if (isPlainObject(baseValue) && isPlainObject(addValue)) {
|
|
5947
|
-
|
|
5947
|
+
result2[k] = { ...baseValue, ...addValue };
|
|
5948
5948
|
} else {
|
|
5949
|
-
|
|
5949
|
+
result2[k] = addValue;
|
|
5950
5950
|
}
|
|
5951
5951
|
}
|
|
5952
|
-
return
|
|
5952
|
+
return result2;
|
|
5953
5953
|
}
|
|
5954
5954
|
function getDefaultExportFromCjs(x) {
|
|
5955
5955
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -7858,10 +7858,10 @@ function requireKeyword() {
|
|
|
7858
7858
|
if (def.async && !schemaEnv.$async)
|
|
7859
7859
|
throw new Error("async keyword in sync schema");
|
|
7860
7860
|
}
|
|
7861
|
-
function useKeyword(gen, keyword2,
|
|
7862
|
-
if (
|
|
7861
|
+
function useKeyword(gen, keyword2, result2) {
|
|
7862
|
+
if (result2 === void 0)
|
|
7863
7863
|
throw new Error(`keyword "${keyword2}" failed to compile`);
|
|
7864
|
-
return gen.scopeValue("keyword", typeof
|
|
7864
|
+
return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1.stringify)(result2) });
|
|
7865
7865
|
}
|
|
7866
7866
|
function validSchemaType(schema, schemaType, allowUndefined = false) {
|
|
7867
7867
|
return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
|
|
@@ -12802,17 +12802,17 @@ class ExperimentalClientTasks {
|
|
|
12802
12802
|
const validator = clientInternal.getToolOutputValidator(params.name);
|
|
12803
12803
|
for await (const message of stream) {
|
|
12804
12804
|
if (message.type === "result" && validator) {
|
|
12805
|
-
const
|
|
12806
|
-
if (!
|
|
12805
|
+
const result2 = message.result;
|
|
12806
|
+
if (!result2.structuredContent && !result2.isError) {
|
|
12807
12807
|
yield {
|
|
12808
12808
|
type: "error",
|
|
12809
12809
|
error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
|
|
12810
12810
|
};
|
|
12811
12811
|
return;
|
|
12812
12812
|
}
|
|
12813
|
-
if (
|
|
12813
|
+
if (result2.structuredContent) {
|
|
12814
12814
|
try {
|
|
12815
|
-
const validationResult = validator(
|
|
12815
|
+
const validationResult = validator(result2.structuredContent);
|
|
12816
12816
|
if (!validationResult.valid) {
|
|
12817
12817
|
yield {
|
|
12818
12818
|
type: "error",
|
|
@@ -13001,20 +13001,20 @@ class Client extends Protocol {
|
|
|
13001
13001
|
var _a2, _b, _c, _d, _e, _f;
|
|
13002
13002
|
if (config2.tools && ((_b = (_a2 = this._serverCapabilities) == null ? void 0 : _a2.tools) == null ? void 0 : _b.listChanged)) {
|
|
13003
13003
|
this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config2.tools, async () => {
|
|
13004
|
-
const
|
|
13005
|
-
return
|
|
13004
|
+
const result2 = await this.listTools();
|
|
13005
|
+
return result2.tools;
|
|
13006
13006
|
});
|
|
13007
13007
|
}
|
|
13008
13008
|
if (config2.prompts && ((_d = (_c = this._serverCapabilities) == null ? void 0 : _c.prompts) == null ? void 0 : _d.listChanged)) {
|
|
13009
13009
|
this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config2.prompts, async () => {
|
|
13010
|
-
const
|
|
13011
|
-
return
|
|
13010
|
+
const result2 = await this.listPrompts();
|
|
13011
|
+
return result2.prompts;
|
|
13012
13012
|
});
|
|
13013
13013
|
}
|
|
13014
13014
|
if (config2.resources && ((_f = (_e = this._serverCapabilities) == null ? void 0 : _e.resources) == null ? void 0 : _f.listChanged)) {
|
|
13015
13015
|
this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config2.resources, async () => {
|
|
13016
|
-
const
|
|
13017
|
-
return
|
|
13016
|
+
const result2 = await this.listResources();
|
|
13017
|
+
return result2.resources;
|
|
13018
13018
|
});
|
|
13019
13019
|
}
|
|
13020
13020
|
}
|
|
@@ -13085,16 +13085,16 @@ class Client extends Protocol {
|
|
|
13085
13085
|
if (params.mode === "url" && !supportsUrlMode) {
|
|
13086
13086
|
throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
|
|
13087
13087
|
}
|
|
13088
|
-
const
|
|
13088
|
+
const result2 = await Promise.resolve(handler(request, extra));
|
|
13089
13089
|
if (params.task) {
|
|
13090
|
-
const taskValidationResult = safeParse$1(CreateTaskResultSchema,
|
|
13090
|
+
const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
|
|
13091
13091
|
if (!taskValidationResult.success) {
|
|
13092
13092
|
const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
|
|
13093
13093
|
throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
|
|
13094
13094
|
}
|
|
13095
13095
|
return taskValidationResult.data;
|
|
13096
13096
|
}
|
|
13097
|
-
const validationResult = safeParse$1(ElicitResultSchema,
|
|
13097
|
+
const validationResult = safeParse$1(ElicitResultSchema, result2);
|
|
13098
13098
|
if (!validationResult.success) {
|
|
13099
13099
|
const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
|
|
13100
13100
|
throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
|
|
@@ -13121,9 +13121,9 @@ class Client extends Protocol {
|
|
|
13121
13121
|
throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
|
|
13122
13122
|
}
|
|
13123
13123
|
const { params } = validatedRequest.data;
|
|
13124
|
-
const
|
|
13124
|
+
const result2 = await Promise.resolve(handler(request, extra));
|
|
13125
13125
|
if (params.task) {
|
|
13126
|
-
const taskValidationResult = safeParse$1(CreateTaskResultSchema,
|
|
13126
|
+
const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
|
|
13127
13127
|
if (!taskValidationResult.success) {
|
|
13128
13128
|
const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
|
|
13129
13129
|
throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
|
|
@@ -13132,7 +13132,7 @@ class Client extends Protocol {
|
|
|
13132
13132
|
}
|
|
13133
13133
|
const hasTools = params.tools || params.toolChoice;
|
|
13134
13134
|
const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
|
|
13135
|
-
const validationResult = safeParse$1(resultSchema,
|
|
13135
|
+
const validationResult = safeParse$1(resultSchema, result2);
|
|
13136
13136
|
if (!validationResult.success) {
|
|
13137
13137
|
const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
|
|
13138
13138
|
throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
|
|
@@ -13155,7 +13155,7 @@ class Client extends Protocol {
|
|
|
13155
13155
|
return;
|
|
13156
13156
|
}
|
|
13157
13157
|
try {
|
|
13158
|
-
const
|
|
13158
|
+
const result2 = await this.request({
|
|
13159
13159
|
method: "initialize",
|
|
13160
13160
|
params: {
|
|
13161
13161
|
protocolVersion: LATEST_PROTOCOL_VERSION,
|
|
@@ -13163,18 +13163,18 @@ class Client extends Protocol {
|
|
|
13163
13163
|
clientInfo: this._clientInfo
|
|
13164
13164
|
}
|
|
13165
13165
|
}, InitializeResultSchema, options);
|
|
13166
|
-
if (
|
|
13167
|
-
throw new Error(`Server sent invalid initialize result: ${
|
|
13166
|
+
if (result2 === void 0) {
|
|
13167
|
+
throw new Error(`Server sent invalid initialize result: ${result2}`);
|
|
13168
13168
|
}
|
|
13169
|
-
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(
|
|
13170
|
-
throw new Error(`Server's protocol version is not supported: ${
|
|
13169
|
+
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result2.protocolVersion)) {
|
|
13170
|
+
throw new Error(`Server's protocol version is not supported: ${result2.protocolVersion}`);
|
|
13171
13171
|
}
|
|
13172
|
-
this._serverCapabilities =
|
|
13173
|
-
this._serverVersion =
|
|
13172
|
+
this._serverCapabilities = result2.capabilities;
|
|
13173
|
+
this._serverVersion = result2.serverInfo;
|
|
13174
13174
|
if (transport.setProtocolVersion) {
|
|
13175
|
-
transport.setProtocolVersion(
|
|
13175
|
+
transport.setProtocolVersion(result2.protocolVersion);
|
|
13176
13176
|
}
|
|
13177
|
-
this._instructions =
|
|
13177
|
+
this._instructions = result2.instructions;
|
|
13178
13178
|
await this.notification({
|
|
13179
13179
|
method: "notifications/initialized"
|
|
13180
13180
|
});
|
|
@@ -13334,15 +13334,15 @@ class Client extends Protocol {
|
|
|
13334
13334
|
if (this.isToolTaskRequired(params.name)) {
|
|
13335
13335
|
throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
|
|
13336
13336
|
}
|
|
13337
|
-
const
|
|
13337
|
+
const result2 = await this.request({ method: "tools/call", params }, resultSchema, options);
|
|
13338
13338
|
const validator = this.getToolOutputValidator(params.name);
|
|
13339
13339
|
if (validator) {
|
|
13340
|
-
if (!
|
|
13340
|
+
if (!result2.structuredContent && !result2.isError) {
|
|
13341
13341
|
throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
|
|
13342
13342
|
}
|
|
13343
|
-
if (
|
|
13343
|
+
if (result2.structuredContent) {
|
|
13344
13344
|
try {
|
|
13345
|
-
const validationResult = validator(
|
|
13345
|
+
const validationResult = validator(result2.structuredContent);
|
|
13346
13346
|
if (!validationResult.valid) {
|
|
13347
13347
|
throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
|
|
13348
13348
|
}
|
|
@@ -13354,7 +13354,7 @@ class Client extends Protocol {
|
|
|
13354
13354
|
}
|
|
13355
13355
|
}
|
|
13356
13356
|
}
|
|
13357
|
-
return
|
|
13357
|
+
return result2;
|
|
13358
13358
|
}
|
|
13359
13359
|
isToolTask(toolName) {
|
|
13360
13360
|
var _a2, _b, _c, _d;
|
|
@@ -13400,9 +13400,9 @@ class Client extends Protocol {
|
|
|
13400
13400
|
return this._cachedToolOutputValidators.get(toolName);
|
|
13401
13401
|
}
|
|
13402
13402
|
async listTools(params, options) {
|
|
13403
|
-
const
|
|
13404
|
-
this.cacheToolMetadata(
|
|
13405
|
-
return
|
|
13403
|
+
const result2 = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
|
|
13404
|
+
this.cacheToolMetadata(result2.tools);
|
|
13405
|
+
return result2;
|
|
13406
13406
|
}
|
|
13407
13407
|
/**
|
|
13408
13408
|
* Set up a single list changed handler.
|
|
@@ -13512,10 +13512,15 @@ class NineChatManager {
|
|
|
13512
13512
|
// UI에 메시지를 뿌려줄 콜백 추가
|
|
13513
13513
|
__privateAdd(this, _owner);
|
|
13514
13514
|
__privateAdd(this, _routeUrl);
|
|
13515
|
+
__privateAdd(this, _chatHistory, []);
|
|
13515
13516
|
__publicField(this, "handleChatSubmit", async (v) => {
|
|
13516
|
-
|
|
13517
|
+
__privateGet(this, _chatHistory).push({ role: "user", text: v });
|
|
13518
|
+
const formattedHistory = __privateGet(this, _chatHistory).map((chat) => {
|
|
13519
|
+
return chat.role === "user" ? `User: ${chat.text}` : `AI: ${chat.text}`;
|
|
13520
|
+
}).join("\n");
|
|
13517
13521
|
return await __privateMethod(this, _NineChatManager_instances, callTool_fn).call(this, "system-brain", {
|
|
13518
13522
|
user_input: v,
|
|
13523
|
+
chat_history: formattedHistory,
|
|
13519
13524
|
routes,
|
|
13520
13525
|
current_path: "/group_member/student_management"
|
|
13521
13526
|
});
|
|
@@ -13534,20 +13539,20 @@ class NineChatManager {
|
|
|
13534
13539
|
}
|
|
13535
13540
|
try {
|
|
13536
13541
|
__privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "user", userInput);
|
|
13537
|
-
const
|
|
13542
|
+
const routes2 = await __privateMethod(this, _NineChatManager_instances, fetchRoutes_fn).call(this);
|
|
13538
13543
|
const response = await __privateGet(this, _mcpClient).callTool({
|
|
13539
13544
|
name: "system-brain",
|
|
13540
13545
|
arguments: {
|
|
13541
13546
|
user_input: userInput,
|
|
13542
|
-
routes,
|
|
13547
|
+
routes: routes2,
|
|
13543
13548
|
current_path: window.location.pathname
|
|
13544
13549
|
// 실시간 경로 주입
|
|
13545
13550
|
}
|
|
13546
13551
|
});
|
|
13547
|
-
const
|
|
13548
|
-
console.log("AI Response:",
|
|
13549
|
-
__privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "assistant",
|
|
13550
|
-
if (__privateGet(this, _onAction)) __privateGet(this, _onAction).call(this,
|
|
13552
|
+
const result2 = JSON.parse(response.content[0].text);
|
|
13553
|
+
console.log("AI Response:", result2);
|
|
13554
|
+
__privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "assistant", result2.message, result2);
|
|
13555
|
+
if (__privateGet(this, _onAction)) __privateGet(this, _onAction).call(this, result2);
|
|
13551
13556
|
__privateMethod(this, _NineChatManager_instances, updateStatus_fn).call(this, "준비 완료");
|
|
13552
13557
|
} catch (err) {
|
|
13553
13558
|
trace.error("❌ Ask Error:", err);
|
|
@@ -13568,6 +13573,10 @@ class NineChatManager {
|
|
|
13568
13573
|
return "";
|
|
13569
13574
|
}
|
|
13570
13575
|
}
|
|
13576
|
+
// 💡 이전 대화들을 저장할 메모리 창고
|
|
13577
|
+
addChatHistory(message) {
|
|
13578
|
+
__privateGet(this, _chatHistory).push({ role: "ai", text: result.message });
|
|
13579
|
+
}
|
|
13571
13580
|
}
|
|
13572
13581
|
_mcpClient = new WeakMap();
|
|
13573
13582
|
_onAction = new WeakMap();
|
|
@@ -13596,15 +13605,15 @@ fetchRoutes_fn = async function() {
|
|
|
13596
13605
|
const r = await fetch("/admin/prompts/data/routes.json");
|
|
13597
13606
|
return r.ok ? await r.json() : [];
|
|
13598
13607
|
};
|
|
13599
|
-
pushMessage_fn = function(role, content2,
|
|
13608
|
+
pushMessage_fn = function(role, content2, result2 = null) {
|
|
13600
13609
|
var _a2;
|
|
13601
13610
|
if (__privateGet(this, _onMessage)) {
|
|
13602
13611
|
__privateGet(this, _onMessage).call(this, {
|
|
13603
13612
|
role,
|
|
13604
13613
|
content: content2,
|
|
13605
|
-
intent:
|
|
13606
|
-
required_args: (_a2 =
|
|
13607
|
-
action:
|
|
13614
|
+
intent: result2 == null ? void 0 : result2.intent,
|
|
13615
|
+
required_args: (_a2 = result2 == null ? void 0 : result2.action) == null ? void 0 : _a2.required_args,
|
|
13616
|
+
action: result2 == null ? void 0 : result2.action
|
|
13608
13617
|
});
|
|
13609
13618
|
}
|
|
13610
13619
|
};
|
|
@@ -13622,6 +13631,7 @@ getRoutes_fn = async function(toolName, args = {}) {
|
|
|
13622
13631
|
}
|
|
13623
13632
|
return await res.json();
|
|
13624
13633
|
};
|
|
13634
|
+
_chatHistory = new WeakMap();
|
|
13625
13635
|
class NineMuService {
|
|
13626
13636
|
constructor(connectorUrl) {
|
|
13627
13637
|
__privateAdd(this, _getSourcePath, (menuUrl) => {
|
|
@@ -13648,11 +13658,11 @@ class NineMuService {
|
|
|
13648
13658
|
currentRoutes
|
|
13649
13659
|
})
|
|
13650
13660
|
});
|
|
13651
|
-
const
|
|
13652
|
-
if (!
|
|
13653
|
-
throw new Error(
|
|
13661
|
+
const result2 = await response.json();
|
|
13662
|
+
if (!result2.success) {
|
|
13663
|
+
throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
|
|
13654
13664
|
}
|
|
13655
|
-
return
|
|
13665
|
+
return result2;
|
|
13656
13666
|
} catch (error) {
|
|
13657
13667
|
trace.error("NineMu Service Error:", error);
|
|
13658
13668
|
throw error;
|
|
@@ -13685,11 +13695,11 @@ class NineMuService {
|
|
|
13685
13695
|
})
|
|
13686
13696
|
});
|
|
13687
13697
|
trace.log(response);
|
|
13688
|
-
const
|
|
13689
|
-
if (!
|
|
13690
|
-
throw new Error(
|
|
13698
|
+
const result2 = await response.json();
|
|
13699
|
+
if (!result2.success) {
|
|
13700
|
+
throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
|
|
13691
13701
|
}
|
|
13692
|
-
return
|
|
13702
|
+
return result2;
|
|
13693
13703
|
} catch (error) {
|
|
13694
13704
|
trace.error("NineMu Service Error:", error);
|
|
13695
13705
|
throw error;
|
|
@@ -13742,10 +13752,10 @@ class NineChat extends HTMLElement {
|
|
|
13742
13752
|
const command2 = "";
|
|
13743
13753
|
const targets = "";
|
|
13744
13754
|
try {
|
|
13745
|
-
const
|
|
13755
|
+
const result2 = await __privateGet(this, _service).generateAll(command2, targets, __privateGet(this, _routes));
|
|
13746
13756
|
$status.textContent = "✅ 완료";
|
|
13747
13757
|
nine.alert("소스 생성 성공").rgb();
|
|
13748
|
-
this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail:
|
|
13758
|
+
this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail: result2, bubbles: true }));
|
|
13749
13759
|
} catch (err) {
|
|
13750
13760
|
$status.textContent = "❌ 실패";
|
|
13751
13761
|
nine.alert(err.message).rgb().shake();
|
|
@@ -13808,7 +13818,7 @@ initActions_fn = function() {
|
|
|
13808
13818
|
target.setAttribute("disabled", "disabled");
|
|
13809
13819
|
__privateGet(this, _$nineChatMessage).add("me", userInput);
|
|
13810
13820
|
__privateGet(this, _$nineChatMessage).add("ing", "");
|
|
13811
|
-
const [
|
|
13821
|
+
const [result2, err] = await nine.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
|
|
13812
13822
|
setTimeout(() => {
|
|
13813
13823
|
target.value = "";
|
|
13814
13824
|
});
|
|
@@ -13818,8 +13828,9 @@ initActions_fn = function() {
|
|
|
13818
13828
|
trace.error(err);
|
|
13819
13829
|
__privateGet(this, _$nineChatMessage).add("ai", err.message || "알 수 없는 오류가 발생했습니다. 다시 시도해주세요.");
|
|
13820
13830
|
} else {
|
|
13821
|
-
trace.log(
|
|
13822
|
-
__privateGet(this,
|
|
13831
|
+
trace.log(result2);
|
|
13832
|
+
__privateGet(this, _manager).addChatHistory(result2.message);
|
|
13833
|
+
__privateGet(this, _$nineChatMessage).add("ai", result2.message);
|
|
13823
13834
|
}
|
|
13824
13835
|
}
|
|
13825
13836
|
});
|
|
@@ -13829,7 +13840,7 @@ render_fn = function() {
|
|
|
13829
13840
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
13830
13841
|
this.shadowRoot.innerHTML = `
|
|
13831
13842
|
<style>
|
|
13832
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
13843
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.180"}/dist/css/nine-mu.css";
|
|
13833
13844
|
${customImport}
|
|
13834
13845
|
</style>
|
|
13835
13846
|
<div class="wrapper">
|
|
@@ -14142,16 +14153,16 @@ class TextLeaf extends Text {
|
|
|
14142
14153
|
}
|
|
14143
14154
|
sliceString(from, to = this.length, lineSep = "\n") {
|
|
14144
14155
|
[from, to] = clip(this, from, to);
|
|
14145
|
-
let
|
|
14156
|
+
let result2 = "";
|
|
14146
14157
|
for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {
|
|
14147
14158
|
let line = this.text[i], end = pos + line.length;
|
|
14148
14159
|
if (pos > from && i)
|
|
14149
|
-
|
|
14160
|
+
result2 += lineSep;
|
|
14150
14161
|
if (from < end && to > pos)
|
|
14151
|
-
|
|
14162
|
+
result2 += line.slice(Math.max(0, from - pos), to - pos);
|
|
14152
14163
|
pos = end + 1;
|
|
14153
14164
|
}
|
|
14154
|
-
return
|
|
14165
|
+
return result2;
|
|
14155
14166
|
}
|
|
14156
14167
|
flatten(target) {
|
|
14157
14168
|
for (let line of this.text)
|
|
@@ -14228,16 +14239,16 @@ class TextNode extends Text {
|
|
|
14228
14239
|
}
|
|
14229
14240
|
sliceString(from, to = this.length, lineSep = "\n") {
|
|
14230
14241
|
[from, to] = clip(this, from, to);
|
|
14231
|
-
let
|
|
14242
|
+
let result2 = "";
|
|
14232
14243
|
for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {
|
|
14233
14244
|
let child = this.children[i], end = pos + child.length;
|
|
14234
14245
|
if (pos > from && i)
|
|
14235
|
-
|
|
14246
|
+
result2 += lineSep;
|
|
14236
14247
|
if (from < end && to > pos)
|
|
14237
|
-
|
|
14248
|
+
result2 += child.sliceString(from - pos, to - pos, lineSep);
|
|
14238
14249
|
pos = end + 1;
|
|
14239
14250
|
}
|
|
14240
|
-
return
|
|
14251
|
+
return result2;
|
|
14241
14252
|
}
|
|
14242
14253
|
flatten(target) {
|
|
14243
14254
|
for (let child of this.children)
|
|
@@ -14546,21 +14557,21 @@ class ChangeDesc {
|
|
|
14546
14557
|
The length of the document before the change.
|
|
14547
14558
|
*/
|
|
14548
14559
|
get length() {
|
|
14549
|
-
let
|
|
14560
|
+
let result2 = 0;
|
|
14550
14561
|
for (let i = 0; i < this.sections.length; i += 2)
|
|
14551
|
-
|
|
14552
|
-
return
|
|
14562
|
+
result2 += this.sections[i];
|
|
14563
|
+
return result2;
|
|
14553
14564
|
}
|
|
14554
14565
|
/**
|
|
14555
14566
|
The length of the document after the change.
|
|
14556
14567
|
*/
|
|
14557
14568
|
get newLength() {
|
|
14558
|
-
let
|
|
14569
|
+
let result2 = 0;
|
|
14559
14570
|
for (let i = 0; i < this.sections.length; i += 2) {
|
|
14560
14571
|
let ins = this.sections[i + 1];
|
|
14561
|
-
|
|
14572
|
+
result2 += ins < 0 ? this.sections[i] : ins;
|
|
14562
14573
|
}
|
|
14563
|
-
return
|
|
14574
|
+
return result2;
|
|
14564
14575
|
}
|
|
14565
14576
|
/**
|
|
14566
14577
|
False when there are actual changes in this set.
|
|
@@ -14670,12 +14681,12 @@ class ChangeDesc {
|
|
|
14670
14681
|
@internal
|
|
14671
14682
|
*/
|
|
14672
14683
|
toString() {
|
|
14673
|
-
let
|
|
14684
|
+
let result2 = "";
|
|
14674
14685
|
for (let i = 0; i < this.sections.length; ) {
|
|
14675
14686
|
let len = this.sections[i++], ins = this.sections[i++];
|
|
14676
|
-
|
|
14687
|
+
result2 += (result2 ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
|
|
14677
14688
|
}
|
|
14678
|
-
return
|
|
14689
|
+
return result2;
|
|
14679
14690
|
}
|
|
14680
14691
|
/**
|
|
14681
14692
|
Serialize this change desc to a JSON-representable value.
|
|
@@ -15743,16 +15754,16 @@ class Configuration {
|
|
|
15743
15754
|
}
|
|
15744
15755
|
}
|
|
15745
15756
|
function flatten(extension, compartments, newCompartments) {
|
|
15746
|
-
let
|
|
15757
|
+
let result2 = [[], [], [], [], []];
|
|
15747
15758
|
let seen = /* @__PURE__ */ new Map();
|
|
15748
15759
|
function inner(ext, prec2) {
|
|
15749
15760
|
let known = seen.get(ext);
|
|
15750
15761
|
if (known != null) {
|
|
15751
15762
|
if (known <= prec2)
|
|
15752
15763
|
return;
|
|
15753
|
-
let found =
|
|
15764
|
+
let found = result2[known].indexOf(ext);
|
|
15754
15765
|
if (found > -1)
|
|
15755
|
-
|
|
15766
|
+
result2[known].splice(found, 1);
|
|
15756
15767
|
if (ext instanceof CompartmentInstance)
|
|
15757
15768
|
newCompartments.delete(ext.compartment);
|
|
15758
15769
|
}
|
|
@@ -15769,11 +15780,11 @@ function flatten(extension, compartments, newCompartments) {
|
|
|
15769
15780
|
} else if (ext instanceof PrecExtension) {
|
|
15770
15781
|
inner(ext.inner, ext.prec);
|
|
15771
15782
|
} else if (ext instanceof StateField) {
|
|
15772
|
-
|
|
15783
|
+
result2[prec2].push(ext);
|
|
15773
15784
|
if (ext.provides)
|
|
15774
15785
|
inner(ext.provides, prec2);
|
|
15775
15786
|
} else if (ext instanceof FacetProvider) {
|
|
15776
|
-
|
|
15787
|
+
result2[prec2].push(ext);
|
|
15777
15788
|
if (ext.facet.extensions)
|
|
15778
15789
|
inner(ext.facet.extensions, Prec_.default);
|
|
15779
15790
|
} else {
|
|
@@ -15784,7 +15795,7 @@ function flatten(extension, compartments, newCompartments) {
|
|
|
15784
15795
|
}
|
|
15785
15796
|
}
|
|
15786
15797
|
inner(extension, Prec_.default);
|
|
15787
|
-
return
|
|
15798
|
+
return result2.reduce((a, b) => a.concat(b));
|
|
15788
15799
|
}
|
|
15789
15800
|
function ensureAddr(state, addr) {
|
|
15790
15801
|
if (addr & 1)
|
|
@@ -15894,13 +15905,13 @@ class StateEffect {
|
|
|
15894
15905
|
static mapEffects(effects, mapping) {
|
|
15895
15906
|
if (!effects.length)
|
|
15896
15907
|
return effects;
|
|
15897
|
-
let
|
|
15908
|
+
let result2 = [];
|
|
15898
15909
|
for (let effect of effects) {
|
|
15899
15910
|
let mapped = effect.map(mapping);
|
|
15900
15911
|
if (mapped)
|
|
15901
|
-
|
|
15912
|
+
result2.push(mapped);
|
|
15902
15913
|
}
|
|
15903
|
-
return
|
|
15914
|
+
return result2;
|
|
15904
15915
|
}
|
|
15905
15916
|
}
|
|
15906
15917
|
StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
|
|
@@ -15998,7 +16009,7 @@ Transaction.userEvent = /* @__PURE__ */ Annotation.define();
|
|
|
15998
16009
|
Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
|
|
15999
16010
|
Transaction.remote = /* @__PURE__ */ Annotation.define();
|
|
16000
16011
|
function joinRanges(a, b) {
|
|
16001
|
-
let
|
|
16012
|
+
let result2 = [];
|
|
16002
16013
|
for (let iA = 0, iB = 0; ; ) {
|
|
16003
16014
|
let from, to;
|
|
16004
16015
|
if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
|
|
@@ -16008,11 +16019,11 @@ function joinRanges(a, b) {
|
|
|
16008
16019
|
from = b[iB++];
|
|
16009
16020
|
to = b[iB++];
|
|
16010
16021
|
} else
|
|
16011
|
-
return
|
|
16012
|
-
if (!
|
|
16013
|
-
|
|
16014
|
-
else if (
|
|
16015
|
-
|
|
16022
|
+
return result2;
|
|
16023
|
+
if (!result2.length || result2[result2.length - 1] < from)
|
|
16024
|
+
result2.push(from, to);
|
|
16025
|
+
else if (result2[result2.length - 1] < to)
|
|
16026
|
+
result2[result2.length - 1] = to;
|
|
16016
16027
|
}
|
|
16017
16028
|
}
|
|
16018
16029
|
function mergeTransaction(a, b, sequential) {
|
|
@@ -16062,23 +16073,23 @@ function resolveTransaction(state, specs, filter) {
|
|
|
16062
16073
|
}
|
|
16063
16074
|
function filterTransaction(tr) {
|
|
16064
16075
|
let state = tr.startState;
|
|
16065
|
-
let
|
|
16076
|
+
let result2 = true;
|
|
16066
16077
|
for (let filter of state.facet(changeFilter)) {
|
|
16067
16078
|
let value = filter(tr);
|
|
16068
16079
|
if (value === false) {
|
|
16069
|
-
|
|
16080
|
+
result2 = false;
|
|
16070
16081
|
break;
|
|
16071
16082
|
}
|
|
16072
16083
|
if (Array.isArray(value))
|
|
16073
|
-
|
|
16084
|
+
result2 = result2 === true ? value : joinRanges(result2, value);
|
|
16074
16085
|
}
|
|
16075
|
-
if (
|
|
16086
|
+
if (result2 !== true) {
|
|
16076
16087
|
let changes, back;
|
|
16077
|
-
if (
|
|
16088
|
+
if (result2 === false) {
|
|
16078
16089
|
back = tr.changes.invertedDesc;
|
|
16079
16090
|
changes = ChangeSet.empty(state.doc.length);
|
|
16080
16091
|
} else {
|
|
16081
|
-
let filtered = tr.changes.filter(
|
|
16092
|
+
let filtered = tr.changes.filter(result2);
|
|
16082
16093
|
changes = filtered.changes;
|
|
16083
16094
|
back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
|
|
16084
16095
|
}
|
|
@@ -16246,14 +16257,14 @@ class EditorState {
|
|
|
16246
16257
|
let changes = this.changes(result1.changes), ranges = [result1.range];
|
|
16247
16258
|
let effects = asArray$1(result1.effects);
|
|
16248
16259
|
for (let i = 1; i < sel.ranges.length; i++) {
|
|
16249
|
-
let
|
|
16250
|
-
let newChanges = this.changes(
|
|
16260
|
+
let result2 = f(sel.ranges[i]);
|
|
16261
|
+
let newChanges = this.changes(result2.changes), newMapped = newChanges.map(changes);
|
|
16251
16262
|
for (let j = 0; j < i; j++)
|
|
16252
16263
|
ranges[j] = ranges[j].map(newMapped);
|
|
16253
16264
|
let mapBy = changes.mapDesc(newChanges, true);
|
|
16254
|
-
ranges.push(
|
|
16265
|
+
ranges.push(result2.range.map(mapBy));
|
|
16255
16266
|
changes = changes.compose(newMapped);
|
|
16256
|
-
effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(
|
|
16267
|
+
effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result2.effects), mapBy));
|
|
16257
16268
|
}
|
|
16258
16269
|
return {
|
|
16259
16270
|
changes,
|
|
@@ -16302,7 +16313,7 @@ class EditorState {
|
|
|
16302
16313
|
not use `doc` or `selection`) to fields.
|
|
16303
16314
|
*/
|
|
16304
16315
|
toJSON(fields) {
|
|
16305
|
-
let
|
|
16316
|
+
let result2 = {
|
|
16306
16317
|
doc: this.sliceDoc(),
|
|
16307
16318
|
selection: this.selection.toJSON()
|
|
16308
16319
|
};
|
|
@@ -16310,9 +16321,9 @@ class EditorState {
|
|
|
16310
16321
|
for (let prop in fields) {
|
|
16311
16322
|
let value = fields[prop];
|
|
16312
16323
|
if (value instanceof StateField && this.config.address[value.id] != null)
|
|
16313
|
-
|
|
16324
|
+
result2[prop] = value.spec.toJSON(this.field(fields[prop]), this);
|
|
16314
16325
|
}
|
|
16315
|
-
return
|
|
16326
|
+
return result2;
|
|
16316
16327
|
}
|
|
16317
16328
|
/**
|
|
16318
16329
|
Deserialize a state from its JSON representation. When custom
|
|
@@ -16416,9 +16427,9 @@ class EditorState {
|
|
|
16416
16427
|
languageDataAt(name2, pos, side = -1) {
|
|
16417
16428
|
let values = [];
|
|
16418
16429
|
for (let provider of this.facet(languageData)) {
|
|
16419
|
-
for (let
|
|
16420
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
16421
|
-
values.push(
|
|
16430
|
+
for (let result2 of provider(this, pos, side)) {
|
|
16431
|
+
if (Object.prototype.hasOwnProperty.call(result2, name2))
|
|
16432
|
+
values.push(result2[name2]);
|
|
16422
16433
|
}
|
|
16423
16434
|
}
|
|
16424
16435
|
return values;
|
|
@@ -16481,22 +16492,22 @@ EditorState.transactionFilter = transactionFilter;
|
|
|
16481
16492
|
EditorState.transactionExtender = transactionExtender;
|
|
16482
16493
|
Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
|
|
16483
16494
|
function combineConfig(configs, defaults2, combine = {}) {
|
|
16484
|
-
let
|
|
16495
|
+
let result2 = {};
|
|
16485
16496
|
for (let config2 of configs)
|
|
16486
16497
|
for (let key of Object.keys(config2)) {
|
|
16487
|
-
let value = config2[key], current =
|
|
16498
|
+
let value = config2[key], current = result2[key];
|
|
16488
16499
|
if (current === void 0)
|
|
16489
|
-
|
|
16500
|
+
result2[key] = value;
|
|
16490
16501
|
else if (current === value || value === void 0) ;
|
|
16491
16502
|
else if (Object.hasOwnProperty.call(combine, key))
|
|
16492
|
-
|
|
16503
|
+
result2[key] = combine[key](current, value);
|
|
16493
16504
|
else
|
|
16494
16505
|
throw new Error("Config merge conflict for field " + key);
|
|
16495
16506
|
}
|
|
16496
16507
|
for (let key in defaults2)
|
|
16497
|
-
if (
|
|
16498
|
-
|
|
16499
|
-
return
|
|
16508
|
+
if (result2[key] === void 0)
|
|
16509
|
+
result2[key] = defaults2[key];
|
|
16510
|
+
return result2;
|
|
16500
16511
|
}
|
|
16501
16512
|
class RangeValue {
|
|
16502
16513
|
/**
|
|
@@ -16823,12 +16834,12 @@ class RangeSet {
|
|
|
16823
16834
|
static join(sets) {
|
|
16824
16835
|
if (!sets.length)
|
|
16825
16836
|
return RangeSet.empty;
|
|
16826
|
-
let
|
|
16837
|
+
let result2 = sets[sets.length - 1];
|
|
16827
16838
|
for (let i = sets.length - 2; i >= 0; i--) {
|
|
16828
16839
|
for (let layer2 = sets[i]; layer2 != RangeSet.empty; layer2 = layer2.nextLayer)
|
|
16829
|
-
|
|
16840
|
+
result2 = new RangeSet(layer2.chunkPos, layer2.chunk, result2, Math.max(layer2.maxPoint, result2.maxPoint));
|
|
16830
16841
|
}
|
|
16831
|
-
return
|
|
16842
|
+
return result2;
|
|
16832
16843
|
}
|
|
16833
16844
|
}
|
|
16834
16845
|
RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
|
|
@@ -16936,9 +16947,9 @@ class RangeSetBuilder {
|
|
|
16936
16947
|
this.finishChunk(false);
|
|
16937
16948
|
if (this.chunks.length == 0)
|
|
16938
16949
|
return next;
|
|
16939
|
-
let
|
|
16950
|
+
let result2 = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
|
|
16940
16951
|
this.from = null;
|
|
16941
|
-
return
|
|
16952
|
+
return result2;
|
|
16942
16953
|
}
|
|
16943
16954
|
}
|
|
16944
16955
|
function findSharedChunks(a, b, textDiff) {
|
|
@@ -18295,10 +18306,10 @@ var Direction = /* @__PURE__ */ (function(Direction2) {
|
|
|
18295
18306
|
})(Direction || (Direction = {}));
|
|
18296
18307
|
const LTR = Direction.LTR, RTL = Direction.RTL;
|
|
18297
18308
|
function dec(str) {
|
|
18298
|
-
let
|
|
18309
|
+
let result2 = [];
|
|
18299
18310
|
for (let i = 0; i < str.length; i++)
|
|
18300
|
-
|
|
18301
|
-
return
|
|
18311
|
+
result2.push(1 << +str[i]);
|
|
18312
|
+
return result2;
|
|
18302
18313
|
}
|
|
18303
18314
|
const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
|
|
18304
18315
|
const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
|
|
@@ -18811,13 +18822,13 @@ function getIsolatedRanges(view, line) {
|
|
|
18811
18822
|
if (!isolates.length)
|
|
18812
18823
|
return isolates;
|
|
18813
18824
|
let sets = isolates.map((i) => i instanceof Function ? i(view) : i);
|
|
18814
|
-
let
|
|
18825
|
+
let result2 = [];
|
|
18815
18826
|
RangeSet.spans(sets, line.from, line.to, {
|
|
18816
18827
|
point() {
|
|
18817
18828
|
},
|
|
18818
18829
|
span(fromDoc, toDoc, active, open) {
|
|
18819
18830
|
let from = fromDoc - line.from, to = toDoc - line.from;
|
|
18820
|
-
let level =
|
|
18831
|
+
let level = result2;
|
|
18821
18832
|
for (let i = active.length - 1; i >= 0; i--, open--) {
|
|
18822
18833
|
let direction = active[i].spec.bidiIsolate, update;
|
|
18823
18834
|
if (direction == null)
|
|
@@ -18833,7 +18844,7 @@ function getIsolatedRanges(view, line) {
|
|
|
18833
18844
|
}
|
|
18834
18845
|
}
|
|
18835
18846
|
});
|
|
18836
|
-
return
|
|
18847
|
+
return result2;
|
|
18837
18848
|
}
|
|
18838
18849
|
const scrollMargins = /* @__PURE__ */ Facet.define();
|
|
18839
18850
|
function getScrollMargins(view) {
|
|
@@ -18886,7 +18897,7 @@ class ChangedRange {
|
|
|
18886
18897
|
static extendWithRanges(diff, ranges) {
|
|
18887
18898
|
if (ranges.length == 0)
|
|
18888
18899
|
return diff;
|
|
18889
|
-
let
|
|
18900
|
+
let result2 = [];
|
|
18890
18901
|
for (let dI = 0, rI = 0, off = 0; ; ) {
|
|
18891
18902
|
let nextD = dI < diff.length ? diff[dI].fromB : 1e9;
|
|
18892
18903
|
let nextR = rI < ranges.length ? ranges[rI] : 1e9;
|
|
@@ -18911,9 +18922,9 @@ class ChangedRange {
|
|
|
18911
18922
|
break;
|
|
18912
18923
|
}
|
|
18913
18924
|
}
|
|
18914
|
-
|
|
18925
|
+
result2.push(new ChangedRange(fromA, toA, fromB, toB));
|
|
18915
18926
|
}
|
|
18916
|
-
return
|
|
18927
|
+
return result2;
|
|
18917
18928
|
}
|
|
18918
18929
|
}
|
|
18919
18930
|
class ViewUpdate {
|
|
@@ -19189,9 +19200,9 @@ class DocTile extends CompositeTile {
|
|
|
19189
19200
|
i = 0;
|
|
19190
19201
|
} else {
|
|
19191
19202
|
let end = pos + next.length;
|
|
19192
|
-
let
|
|
19193
|
-
if (
|
|
19194
|
-
return
|
|
19203
|
+
let result2 = f(next, pos);
|
|
19204
|
+
if (result2 !== void 0)
|
|
19205
|
+
return result2;
|
|
19195
19206
|
pos = end + next.breakAfter;
|
|
19196
19207
|
}
|
|
19197
19208
|
}
|
|
@@ -20536,7 +20547,7 @@ class DocView {
|
|
|
20536
20547
|
return scan(tile, offset);
|
|
20537
20548
|
}
|
|
20538
20549
|
measureVisibleLineHeights(viewport) {
|
|
20539
|
-
let
|
|
20550
|
+
let result2 = [], { from, to } = viewport;
|
|
20540
20551
|
let contentWidth = this.view.contentDOM.clientWidth;
|
|
20541
20552
|
let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
|
|
20542
20553
|
let widest = -1, ltr = this.view.textDirection == Direction.LTR;
|
|
@@ -20554,8 +20565,8 @@ class DocView {
|
|
|
20554
20565
|
scan(child, pos, childRect);
|
|
20555
20566
|
} else if (pos >= from) {
|
|
20556
20567
|
if (spaceAbove > 0)
|
|
20557
|
-
|
|
20558
|
-
|
|
20568
|
+
result2.push(-spaceAbove);
|
|
20569
|
+
result2.push(height + spaceAbove);
|
|
20559
20570
|
spaceAbove = 0;
|
|
20560
20571
|
if (isWider) {
|
|
20561
20572
|
let last = child.dom.lastChild;
|
|
@@ -20578,7 +20589,7 @@ class DocView {
|
|
|
20578
20589
|
}
|
|
20579
20590
|
};
|
|
20580
20591
|
scan(this.tile, 0, null);
|
|
20581
|
-
return
|
|
20592
|
+
return result2;
|
|
20582
20593
|
}
|
|
20583
20594
|
textDirectionAt(pos) {
|
|
20584
20595
|
let { tile } = this.tile.resolveBlock(pos, 1);
|
|
@@ -21598,16 +21609,16 @@ function findDiff(a, b, preferredPos, preferredSide) {
|
|
|
21598
21609
|
return { from, toA, toB };
|
|
21599
21610
|
}
|
|
21600
21611
|
function selectionPoints(view) {
|
|
21601
|
-
let
|
|
21612
|
+
let result2 = [];
|
|
21602
21613
|
if (view.root.activeElement != view.contentDOM)
|
|
21603
|
-
return
|
|
21614
|
+
return result2;
|
|
21604
21615
|
let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
|
|
21605
21616
|
if (anchorNode) {
|
|
21606
|
-
|
|
21617
|
+
result2.push(new DOMPoint(anchorNode, anchorOffset));
|
|
21607
21618
|
if (focusNode != anchorNode || focusOffset != anchorOffset)
|
|
21608
|
-
|
|
21619
|
+
result2.push(new DOMPoint(focusNode, focusOffset));
|
|
21609
21620
|
}
|
|
21610
|
-
return
|
|
21621
|
+
return result2;
|
|
21611
21622
|
}
|
|
21612
21623
|
function selectionFromPoints(points, base2) {
|
|
21613
21624
|
if (points.length == 0)
|
|
@@ -21770,9 +21781,9 @@ function bindHandler(plugin, handler) {
|
|
|
21770
21781
|
};
|
|
21771
21782
|
}
|
|
21772
21783
|
function computeHandlers(plugins) {
|
|
21773
|
-
let
|
|
21784
|
+
let result2 = /* @__PURE__ */ Object.create(null);
|
|
21774
21785
|
function record2(type2) {
|
|
21775
|
-
return
|
|
21786
|
+
return result2[type2] || (result2[type2] = { observers: [], handlers: [] });
|
|
21776
21787
|
}
|
|
21777
21788
|
for (let plugin of plugins) {
|
|
21778
21789
|
let spec = plugin.spec, handlers2 = spec && spec.plugin.domEventHandlers, observers2 = spec && spec.plugin.domEventObservers;
|
|
@@ -21793,7 +21804,7 @@ function computeHandlers(plugins) {
|
|
|
21793
21804
|
record2(type2).handlers.push(handlers[type2]);
|
|
21794
21805
|
for (let type2 in observers)
|
|
21795
21806
|
record2(type2).observers.push(observers[type2]);
|
|
21796
|
-
return
|
|
21807
|
+
return result2;
|
|
21797
21808
|
}
|
|
21798
21809
|
const PendingKeys = [
|
|
21799
21810
|
{ key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
|
|
@@ -22536,11 +22547,11 @@ class HeightMap {
|
|
|
22536
22547
|
return HeightMap.of(nodes);
|
|
22537
22548
|
}
|
|
22538
22549
|
// Again, these are base cases, and are overridden for branch and gap nodes.
|
|
22539
|
-
decomposeLeft(_to,
|
|
22540
|
-
|
|
22550
|
+
decomposeLeft(_to, result2) {
|
|
22551
|
+
result2.push(this);
|
|
22541
22552
|
}
|
|
22542
|
-
decomposeRight(_from,
|
|
22543
|
-
|
|
22553
|
+
decomposeRight(_from, result2) {
|
|
22554
|
+
result2.push(this);
|
|
22544
22555
|
}
|
|
22545
22556
|
applyChanges(decorations2, oldDoc, oracle, changes) {
|
|
22546
22557
|
let me = this, doc2 = oracle.doc;
|
|
@@ -22783,11 +22794,11 @@ class HeightMapGap extends HeightMap {
|
|
|
22783
22794
|
}
|
|
22784
22795
|
return HeightMap.of(nodes);
|
|
22785
22796
|
}
|
|
22786
|
-
decomposeLeft(to,
|
|
22787
|
-
|
|
22797
|
+
decomposeLeft(to, result2) {
|
|
22798
|
+
result2.push(new HeightMapGap(to - 1), null);
|
|
22788
22799
|
}
|
|
22789
|
-
decomposeRight(from,
|
|
22790
|
-
|
|
22800
|
+
decomposeRight(from, result2) {
|
|
22801
|
+
result2.push(null, new HeightMapGap(this.length - from - 1));
|
|
22791
22802
|
}
|
|
22792
22803
|
updateHeight(oracle, offset = 0, force = false, measured) {
|
|
22793
22804
|
let end = offset + this.length;
|
|
@@ -22815,10 +22826,10 @@ class HeightMapGap extends HeightMap {
|
|
|
22815
22826
|
}
|
|
22816
22827
|
if (pos <= end)
|
|
22817
22828
|
nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
|
|
22818
|
-
let
|
|
22819
|
-
if (singleHeight < 0 || Math.abs(
|
|
22829
|
+
let result2 = HeightMap.of(nodes);
|
|
22830
|
+
if (singleHeight < 0 || Math.abs(result2.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
|
|
22820
22831
|
heightChangeFlag = true;
|
|
22821
|
-
return replace(this,
|
|
22832
|
+
return replace(this, result2);
|
|
22822
22833
|
} else if (force || this.outdated) {
|
|
22823
22834
|
this.setHeight(oracle.heightForGap(offset, offset + this.length));
|
|
22824
22835
|
this.outdated = false;
|
|
@@ -22878,43 +22889,43 @@ class HeightMapBranch extends HeightMap {
|
|
|
22878
22889
|
return this.balanced(this.left.replace(from, to, nodes), this.right);
|
|
22879
22890
|
if (from > this.left.length)
|
|
22880
22891
|
return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));
|
|
22881
|
-
let
|
|
22892
|
+
let result2 = [];
|
|
22882
22893
|
if (from > 0)
|
|
22883
|
-
this.decomposeLeft(from,
|
|
22884
|
-
let left =
|
|
22894
|
+
this.decomposeLeft(from, result2);
|
|
22895
|
+
let left = result2.length;
|
|
22885
22896
|
for (let node of nodes)
|
|
22886
|
-
|
|
22897
|
+
result2.push(node);
|
|
22887
22898
|
if (from > 0)
|
|
22888
|
-
mergeGaps(
|
|
22899
|
+
mergeGaps(result2, left - 1);
|
|
22889
22900
|
if (to < this.length) {
|
|
22890
|
-
let right =
|
|
22891
|
-
this.decomposeRight(to,
|
|
22892
|
-
mergeGaps(
|
|
22901
|
+
let right = result2.length;
|
|
22902
|
+
this.decomposeRight(to, result2);
|
|
22903
|
+
mergeGaps(result2, right);
|
|
22893
22904
|
}
|
|
22894
|
-
return HeightMap.of(
|
|
22905
|
+
return HeightMap.of(result2);
|
|
22895
22906
|
}
|
|
22896
|
-
decomposeLeft(to,
|
|
22907
|
+
decomposeLeft(to, result2) {
|
|
22897
22908
|
let left = this.left.length;
|
|
22898
22909
|
if (to <= left)
|
|
22899
|
-
return this.left.decomposeLeft(to,
|
|
22900
|
-
|
|
22910
|
+
return this.left.decomposeLeft(to, result2);
|
|
22911
|
+
result2.push(this.left);
|
|
22901
22912
|
if (this.break) {
|
|
22902
22913
|
left++;
|
|
22903
22914
|
if (to >= left)
|
|
22904
|
-
|
|
22915
|
+
result2.push(null);
|
|
22905
22916
|
}
|
|
22906
22917
|
if (to > left)
|
|
22907
|
-
this.right.decomposeLeft(to - left,
|
|
22918
|
+
this.right.decomposeLeft(to - left, result2);
|
|
22908
22919
|
}
|
|
22909
|
-
decomposeRight(from,
|
|
22920
|
+
decomposeRight(from, result2) {
|
|
22910
22921
|
let left = this.left.length, right = left + this.break;
|
|
22911
22922
|
if (from >= right)
|
|
22912
|
-
return this.right.decomposeRight(from - right,
|
|
22923
|
+
return this.right.decomposeRight(from - right, result2);
|
|
22913
22924
|
if (from < left)
|
|
22914
|
-
this.left.decomposeRight(from,
|
|
22925
|
+
this.left.decomposeRight(from, result2);
|
|
22915
22926
|
if (this.break && from < right)
|
|
22916
|
-
|
|
22917
|
-
|
|
22927
|
+
result2.push(null);
|
|
22928
|
+
result2.push(this.right);
|
|
22918
22929
|
}
|
|
22919
22930
|
balanced(left, right) {
|
|
22920
22931
|
if (left.size > 2 * right.size || right.size > 2 * left.size)
|
|
@@ -23287,13 +23298,13 @@ class ViewState {
|
|
|
23287
23298
|
let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
|
|
23288
23299
|
this.contentDOMHeight = domRect.height;
|
|
23289
23300
|
this.mustMeasureContent = false;
|
|
23290
|
-
let
|
|
23301
|
+
let result2 = 0, bias = 0;
|
|
23291
23302
|
if (domRect.width && domRect.height) {
|
|
23292
23303
|
let { scaleX, scaleY } = getScale(dom, domRect);
|
|
23293
23304
|
if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
|
|
23294
23305
|
this.scaleX = scaleX;
|
|
23295
23306
|
this.scaleY = scaleY;
|
|
23296
|
-
|
|
23307
|
+
result2 |= 16;
|
|
23297
23308
|
refresh = measureContent = true;
|
|
23298
23309
|
}
|
|
23299
23310
|
}
|
|
@@ -23302,13 +23313,13 @@ class ViewState {
|
|
|
23302
23313
|
if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
|
|
23303
23314
|
this.paddingTop = paddingTop;
|
|
23304
23315
|
this.paddingBottom = paddingBottom;
|
|
23305
|
-
|
|
23316
|
+
result2 |= 16 | 2;
|
|
23306
23317
|
}
|
|
23307
23318
|
if (this.editorWidth != view.scrollDOM.clientWidth) {
|
|
23308
23319
|
if (oracle.lineWrapping)
|
|
23309
23320
|
measureContent = true;
|
|
23310
23321
|
this.editorWidth = view.scrollDOM.clientWidth;
|
|
23311
|
-
|
|
23322
|
+
result2 |= 16;
|
|
23312
23323
|
}
|
|
23313
23324
|
let scrollParent = scrollableParents(this.view.contentDOM, false).y;
|
|
23314
23325
|
if (scrollParent != this.scrollParent) {
|
|
@@ -23337,7 +23348,7 @@ class ViewState {
|
|
|
23337
23348
|
if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
|
|
23338
23349
|
this.contentDOMWidth = domRect.width;
|
|
23339
23350
|
this.editorHeight = view.scrollDOM.clientHeight;
|
|
23340
|
-
|
|
23351
|
+
result2 |= 16;
|
|
23341
23352
|
}
|
|
23342
23353
|
if (measureContent) {
|
|
23343
23354
|
let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
|
|
@@ -23348,7 +23359,7 @@ class ViewState {
|
|
|
23348
23359
|
refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, Math.max(5, contentWidth / charWidth), lineHeights);
|
|
23349
23360
|
if (refresh) {
|
|
23350
23361
|
view.docView.minWidth = 0;
|
|
23351
|
-
|
|
23362
|
+
result2 |= 16;
|
|
23352
23363
|
}
|
|
23353
23364
|
}
|
|
23354
23365
|
if (dTop > 0 && dBottom > 0)
|
|
@@ -23361,25 +23372,25 @@ class ViewState {
|
|
|
23361
23372
|
this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));
|
|
23362
23373
|
}
|
|
23363
23374
|
if (heightChangeFlag)
|
|
23364
|
-
|
|
23375
|
+
result2 |= 2;
|
|
23365
23376
|
}
|
|
23366
23377
|
let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
|
|
23367
23378
|
if (viewportChange) {
|
|
23368
|
-
if (
|
|
23369
|
-
|
|
23379
|
+
if (result2 & 2)
|
|
23380
|
+
result2 |= this.updateScaler();
|
|
23370
23381
|
this.viewport = this.getViewport(bias, this.scrollTarget);
|
|
23371
|
-
|
|
23382
|
+
result2 |= this.updateForViewport();
|
|
23372
23383
|
}
|
|
23373
|
-
if (
|
|
23384
|
+
if (result2 & 2 || viewportChange)
|
|
23374
23385
|
this.updateViewportLines();
|
|
23375
23386
|
if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
|
|
23376
23387
|
this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
|
|
23377
|
-
|
|
23388
|
+
result2 |= this.computeVisibleRanges();
|
|
23378
23389
|
if (this.mustEnforceCursorAssoc) {
|
|
23379
23390
|
this.mustEnforceCursorAssoc = false;
|
|
23380
23391
|
view.docView.enforceCursorAssoc();
|
|
23381
23392
|
}
|
|
23382
|
-
return
|
|
23393
|
+
return result2;
|
|
23383
23394
|
}
|
|
23384
23395
|
get visibleTop() {
|
|
23385
23396
|
return this.scaler.fromDOM(this.pixelViewport.top);
|
|
@@ -25576,10 +25587,10 @@ class EditorView {
|
|
|
25576
25587
|
*/
|
|
25577
25588
|
static theme(spec, options) {
|
|
25578
25589
|
let prefix = StyleModule.newName();
|
|
25579
|
-
let
|
|
25590
|
+
let result2 = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
|
|
25580
25591
|
if (options && options.dark)
|
|
25581
|
-
|
|
25582
|
-
return
|
|
25592
|
+
result2.push(darkTheme.of(true));
|
|
25593
|
+
return result2;
|
|
25583
25594
|
}
|
|
25584
25595
|
/**
|
|
25585
25596
|
Create an extension that adds styles to the base theme. Like
|
|
@@ -25653,13 +25664,13 @@ class CachedOrder {
|
|
|
25653
25664
|
static update(cache2, changes) {
|
|
25654
25665
|
if (changes.empty && !cache2.some((c) => c.fresh))
|
|
25655
25666
|
return cache2;
|
|
25656
|
-
let
|
|
25667
|
+
let result2 = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
|
|
25657
25668
|
for (let i = Math.max(0, cache2.length - 10); i < cache2.length; i++) {
|
|
25658
25669
|
let entry = cache2[i];
|
|
25659
25670
|
if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
|
|
25660
|
-
|
|
25671
|
+
result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
|
|
25661
25672
|
}
|
|
25662
|
-
return
|
|
25673
|
+
return result2;
|
|
25663
25674
|
}
|
|
25664
25675
|
}
|
|
25665
25676
|
function attrsFromFacet(view, facet, base2) {
|
|
@@ -25673,9 +25684,9 @@ function attrsFromFacet(view, facet, base2) {
|
|
|
25673
25684
|
const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
|
|
25674
25685
|
function normalizeKeyName(name2, platform) {
|
|
25675
25686
|
const parts = name2.split(/-(?!$)/);
|
|
25676
|
-
let
|
|
25677
|
-
if (
|
|
25678
|
-
|
|
25687
|
+
let result2 = parts[parts.length - 1];
|
|
25688
|
+
if (result2 == "Space")
|
|
25689
|
+
result2 = " ";
|
|
25679
25690
|
let alt, ctrl, shift2, meta2;
|
|
25680
25691
|
for (let i = 0; i < parts.length - 1; ++i) {
|
|
25681
25692
|
const mod = parts[i];
|
|
@@ -25696,14 +25707,14 @@ function normalizeKeyName(name2, platform) {
|
|
|
25696
25707
|
throw new Error("Unrecognized modifier name: " + mod);
|
|
25697
25708
|
}
|
|
25698
25709
|
if (alt)
|
|
25699
|
-
|
|
25710
|
+
result2 = "Alt-" + result2;
|
|
25700
25711
|
if (ctrl)
|
|
25701
|
-
|
|
25712
|
+
result2 = "Ctrl-" + result2;
|
|
25702
25713
|
if (meta2)
|
|
25703
|
-
|
|
25714
|
+
result2 = "Meta-" + result2;
|
|
25704
25715
|
if (shift2)
|
|
25705
|
-
|
|
25706
|
-
return
|
|
25716
|
+
result2 = "Shift-" + result2;
|
|
25717
|
+
return result2;
|
|
25707
25718
|
}
|
|
25708
25719
|
function modifiers(name2, event, shift2) {
|
|
25709
25720
|
if (event.altKey)
|
|
@@ -26290,16 +26301,16 @@ function matchRanges(view, maxLength) {
|
|
|
26290
26301
|
let visible = view.visibleRanges;
|
|
26291
26302
|
if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
|
|
26292
26303
|
return visible;
|
|
26293
|
-
let
|
|
26304
|
+
let result2 = [];
|
|
26294
26305
|
for (let { from, to } of visible) {
|
|
26295
26306
|
from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
|
|
26296
26307
|
to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
|
|
26297
|
-
if (
|
|
26298
|
-
|
|
26308
|
+
if (result2.length && result2[result2.length - 1].to >= from)
|
|
26309
|
+
result2[result2.length - 1].to = to;
|
|
26299
26310
|
else
|
|
26300
|
-
|
|
26311
|
+
result2.push({ from, to });
|
|
26301
26312
|
}
|
|
26302
|
-
return
|
|
26313
|
+
return result2;
|
|
26303
26314
|
}
|
|
26304
26315
|
class MatchDecorator {
|
|
26305
26316
|
/**
|
|
@@ -27097,10 +27108,10 @@ class HoverPlugin {
|
|
|
27097
27108
|
};
|
|
27098
27109
|
if (open && "then" in open) {
|
|
27099
27110
|
let pending = this.pending = { pos };
|
|
27100
|
-
open.then((
|
|
27111
|
+
open.then((result2) => {
|
|
27101
27112
|
if (this.pending == pending) {
|
|
27102
27113
|
this.pending = null;
|
|
27103
|
-
done(
|
|
27114
|
+
done(result2);
|
|
27104
27115
|
}
|
|
27105
27116
|
}, (e) => logException(view.state, e, "hover tooltip"));
|
|
27106
27117
|
} else {
|
|
@@ -27444,7 +27455,7 @@ const dialogField = /* @__PURE__ */ StateField.define({
|
|
|
27444
27455
|
});
|
|
27445
27456
|
const openDialogEffect = /* @__PURE__ */ StateEffect.define();
|
|
27446
27457
|
const closeDialogEffect = /* @__PURE__ */ StateEffect.define();
|
|
27447
|
-
function createDialog(view, config2,
|
|
27458
|
+
function createDialog(view, config2, result2) {
|
|
27448
27459
|
let content2 = config2.content ? config2.content(view, () => done(null)) : null;
|
|
27449
27460
|
if (!content2) {
|
|
27450
27461
|
content2 = crelt("form");
|
|
@@ -27490,7 +27501,7 @@ function createDialog(view, config2, result) {
|
|
|
27490
27501
|
function done(form) {
|
|
27491
27502
|
if (panel.contains(panel.ownerDocument.activeElement))
|
|
27492
27503
|
view.focus();
|
|
27493
|
-
|
|
27504
|
+
result2(form);
|
|
27494
27505
|
}
|
|
27495
27506
|
return {
|
|
27496
27507
|
dom: panel,
|
|
@@ -27542,10 +27553,10 @@ const unfixGutters = /* @__PURE__ */ Facet.define({
|
|
|
27542
27553
|
combine: (values) => values.some((x) => x)
|
|
27543
27554
|
});
|
|
27544
27555
|
function gutters(config2) {
|
|
27545
|
-
let
|
|
27556
|
+
let result2 = [
|
|
27546
27557
|
gutterView
|
|
27547
27558
|
];
|
|
27548
|
-
return
|
|
27559
|
+
return result2;
|
|
27549
27560
|
}
|
|
27550
27561
|
const gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
27551
27562
|
constructor(view) {
|
|
@@ -27879,12 +27890,12 @@ const lineNumberConfig = /* @__PURE__ */ Facet.define({
|
|
|
27879
27890
|
combine(values) {
|
|
27880
27891
|
return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {
|
|
27881
27892
|
domEventHandlers(a, b) {
|
|
27882
|
-
let
|
|
27893
|
+
let result2 = Object.assign({}, a);
|
|
27883
27894
|
for (let event in b) {
|
|
27884
|
-
let exists =
|
|
27885
|
-
|
|
27895
|
+
let exists = result2[event], add2 = b[event];
|
|
27896
|
+
result2[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
|
|
27886
27897
|
}
|
|
27887
|
-
return
|
|
27898
|
+
return result2;
|
|
27888
27899
|
}
|
|
27889
27900
|
});
|
|
27890
27901
|
}
|
|
@@ -27917,9 +27928,9 @@ const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig
|
|
|
27917
27928
|
},
|
|
27918
27929
|
widgetMarker: (view, widget, block) => {
|
|
27919
27930
|
for (let m of view.state.facet(lineNumberWidgetMarker)) {
|
|
27920
|
-
let
|
|
27921
|
-
if (
|
|
27922
|
-
return
|
|
27931
|
+
let result2 = m(view, widget, block);
|
|
27932
|
+
if (result2)
|
|
27933
|
+
return result2;
|
|
27923
27934
|
}
|
|
27924
27935
|
return null;
|
|
27925
27936
|
},
|
|
@@ -28002,8 +28013,8 @@ class NodeProp {
|
|
|
28002
28013
|
if (typeof match != "function")
|
|
28003
28014
|
match = NodeType.match(match);
|
|
28004
28015
|
return (type2) => {
|
|
28005
|
-
let
|
|
28006
|
-
return
|
|
28016
|
+
let result2 = match(type2);
|
|
28017
|
+
return result2 === void 0 ? null : [this, result2];
|
|
28007
28018
|
};
|
|
28008
28019
|
}
|
|
28009
28020
|
}
|
|
@@ -28321,11 +28332,11 @@ class Tree {
|
|
|
28321
28332
|
constructor.
|
|
28322
28333
|
*/
|
|
28323
28334
|
get propValues() {
|
|
28324
|
-
let
|
|
28335
|
+
let result2 = [];
|
|
28325
28336
|
if (this.props)
|
|
28326
28337
|
for (let id2 in this.props)
|
|
28327
|
-
|
|
28328
|
-
return
|
|
28338
|
+
result2.push([+id2, this.props[id2]]);
|
|
28339
|
+
return result2;
|
|
28329
28340
|
}
|
|
28330
28341
|
/**
|
|
28331
28342
|
Balance the direct children of this tree, producing a copy of
|
|
@@ -28390,30 +28401,30 @@ class TreeBuffer {
|
|
|
28390
28401
|
@internal
|
|
28391
28402
|
*/
|
|
28392
28403
|
toString() {
|
|
28393
|
-
let
|
|
28404
|
+
let result2 = [];
|
|
28394
28405
|
for (let index = 0; index < this.buffer.length; ) {
|
|
28395
|
-
|
|
28406
|
+
result2.push(this.childString(index));
|
|
28396
28407
|
index = this.buffer[index + 3];
|
|
28397
28408
|
}
|
|
28398
|
-
return
|
|
28409
|
+
return result2.join(",");
|
|
28399
28410
|
}
|
|
28400
28411
|
/**
|
|
28401
28412
|
@internal
|
|
28402
28413
|
*/
|
|
28403
28414
|
childString(index) {
|
|
28404
28415
|
let id2 = this.buffer[index], endIndex = this.buffer[index + 3];
|
|
28405
|
-
let type2 = this.set.types[id2],
|
|
28406
|
-
if (/\W/.test(
|
|
28407
|
-
|
|
28416
|
+
let type2 = this.set.types[id2], result2 = type2.name;
|
|
28417
|
+
if (/\W/.test(result2) && !type2.isError)
|
|
28418
|
+
result2 = JSON.stringify(result2);
|
|
28408
28419
|
index += 4;
|
|
28409
28420
|
if (endIndex == index)
|
|
28410
|
-
return
|
|
28421
|
+
return result2;
|
|
28411
28422
|
let children = [];
|
|
28412
28423
|
while (index < endIndex) {
|
|
28413
28424
|
children.push(this.childString(index));
|
|
28414
28425
|
index = this.buffer[index + 3];
|
|
28415
28426
|
}
|
|
28416
|
-
return
|
|
28427
|
+
return result2 + "(" + children.join(",") + ")";
|
|
28417
28428
|
}
|
|
28418
28429
|
/**
|
|
28419
28430
|
@internal
|
|
@@ -28663,22 +28674,22 @@ class TreeNode extends BaseNode {
|
|
|
28663
28674
|
}
|
|
28664
28675
|
}
|
|
28665
28676
|
function getChildren(node, type2, before, after) {
|
|
28666
|
-
let cur2 = node.cursor(),
|
|
28677
|
+
let cur2 = node.cursor(), result2 = [];
|
|
28667
28678
|
if (!cur2.firstChild())
|
|
28668
|
-
return
|
|
28679
|
+
return result2;
|
|
28669
28680
|
if (before != null)
|
|
28670
28681
|
for (let found = false; !found; ) {
|
|
28671
28682
|
found = cur2.type.is(before);
|
|
28672
28683
|
if (!cur2.nextSibling())
|
|
28673
|
-
return
|
|
28684
|
+
return result2;
|
|
28674
28685
|
}
|
|
28675
28686
|
for (; ; ) {
|
|
28676
28687
|
if (after != null && cur2.type.is(after))
|
|
28677
|
-
return
|
|
28688
|
+
return result2;
|
|
28678
28689
|
if (cur2.type.is(type2))
|
|
28679
|
-
|
|
28690
|
+
result2.push(cur2.node);
|
|
28680
28691
|
if (!cur2.nextSibling())
|
|
28681
|
-
return after == null ?
|
|
28692
|
+
return after == null ? result2 : [];
|
|
28682
28693
|
}
|
|
28683
28694
|
}
|
|
28684
28695
|
function matchNodeContext(node, context, i = context.length - 1) {
|
|
@@ -29125,14 +29136,14 @@ class TreeCursor {
|
|
|
29125
29136
|
get node() {
|
|
29126
29137
|
if (!this.buffer)
|
|
29127
29138
|
return this._tree;
|
|
29128
|
-
let cache2 = this.bufferNode,
|
|
29139
|
+
let cache2 = this.bufferNode, result2 = null, depth = 0;
|
|
29129
29140
|
if (cache2 && cache2.context == this.buffer) {
|
|
29130
29141
|
scan: for (let index = this.index, d = this.stack.length; d >= 0; ) {
|
|
29131
29142
|
for (let c = cache2; c; c = c._parent)
|
|
29132
29143
|
if (c.index == index) {
|
|
29133
29144
|
if (index == this.index)
|
|
29134
29145
|
return c;
|
|
29135
|
-
|
|
29146
|
+
result2 = c;
|
|
29136
29147
|
depth = d + 1;
|
|
29137
29148
|
break scan;
|
|
29138
29149
|
}
|
|
@@ -29140,8 +29151,8 @@ class TreeCursor {
|
|
|
29140
29151
|
}
|
|
29141
29152
|
}
|
|
29142
29153
|
for (let i = depth; i < this.stack.length; i++)
|
|
29143
|
-
|
|
29144
|
-
return this.bufferNode = new BufferNode(this.buffer,
|
|
29154
|
+
result2 = new BufferNode(this.buffer, result2, this.stack[i]);
|
|
29155
|
+
return this.bufferNode = new BufferNode(this.buffer, result2, this.index);
|
|
29145
29156
|
}
|
|
29146
29157
|
/**
|
|
29147
29158
|
Get the [tree](#common.Tree) that represents the current node, if
|
|
@@ -29341,13 +29352,13 @@ function buildTree(data) {
|
|
|
29341
29352
|
function findBufferSize(maxSize, inRepeat) {
|
|
29342
29353
|
let fork = cursor.fork();
|
|
29343
29354
|
let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
|
|
29344
|
-
let
|
|
29355
|
+
let result2 = { size: 0, start: 0, skip: 0 };
|
|
29345
29356
|
scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
|
|
29346
29357
|
let nodeSize2 = fork.size;
|
|
29347
29358
|
if (fork.id == inRepeat && nodeSize2 >= 0) {
|
|
29348
|
-
|
|
29349
|
-
|
|
29350
|
-
|
|
29359
|
+
result2.size = size;
|
|
29360
|
+
result2.start = start;
|
|
29361
|
+
result2.skip = skip;
|
|
29351
29362
|
skip += 4;
|
|
29352
29363
|
size += 4;
|
|
29353
29364
|
fork.next();
|
|
@@ -29375,11 +29386,11 @@ function buildTree(data) {
|
|
|
29375
29386
|
skip += localSkipped;
|
|
29376
29387
|
}
|
|
29377
29388
|
if (inRepeat < 0 || size == maxSize) {
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29389
|
+
result2.size = size;
|
|
29390
|
+
result2.start = start;
|
|
29391
|
+
result2.skip = skip;
|
|
29381
29392
|
}
|
|
29382
|
-
return
|
|
29393
|
+
return result2.size > 4 ? result2 : void 0;
|
|
29383
29394
|
}
|
|
29384
29395
|
function copyToBuffer(bufferStart, buffer2, index) {
|
|
29385
29396
|
let { id: id2, start, end, size } = cursor;
|
|
@@ -29547,11 +29558,11 @@ class TreeFragment {
|
|
|
29547
29558
|
true.
|
|
29548
29559
|
*/
|
|
29549
29560
|
static addTree(tree, fragments = [], partial2 = false) {
|
|
29550
|
-
let
|
|
29561
|
+
let result2 = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
|
|
29551
29562
|
for (let f of fragments)
|
|
29552
29563
|
if (f.to > tree.length)
|
|
29553
|
-
|
|
29554
|
-
return
|
|
29564
|
+
result2.push(f);
|
|
29565
|
+
return result2;
|
|
29555
29566
|
}
|
|
29556
29567
|
/**
|
|
29557
29568
|
Apply a set of edits to an array of fragments, removing or
|
|
@@ -29561,7 +29572,7 @@ class TreeFragment {
|
|
|
29561
29572
|
static applyChanges(fragments, changes, minGap = 128) {
|
|
29562
29573
|
if (!changes.length)
|
|
29563
29574
|
return fragments;
|
|
29564
|
-
let
|
|
29575
|
+
let result2 = [];
|
|
29565
29576
|
let fI = 1, nextF = fragments.length ? fragments[0] : null;
|
|
29566
29577
|
for (let cI = 0, pos = 0, off = 0; ; cI++) {
|
|
29567
29578
|
let nextC = cI < changes.length ? changes[cI] : null;
|
|
@@ -29574,7 +29585,7 @@ class TreeFragment {
|
|
|
29574
29585
|
cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
|
|
29575
29586
|
}
|
|
29576
29587
|
if (cut)
|
|
29577
|
-
|
|
29588
|
+
result2.push(cut);
|
|
29578
29589
|
if (nextF.to > nextPos)
|
|
29579
29590
|
break;
|
|
29580
29591
|
nextF = fI < fragments.length ? fragments[fI++] : null;
|
|
@@ -29584,7 +29595,7 @@ class TreeFragment {
|
|
|
29584
29595
|
pos = nextC.toA;
|
|
29585
29596
|
off = nextC.toA - nextC.toB;
|
|
29586
29597
|
}
|
|
29587
|
-
return
|
|
29598
|
+
return result2;
|
|
29588
29599
|
}
|
|
29589
29600
|
}
|
|
29590
29601
|
class Parser {
|
|
@@ -29839,13 +29850,13 @@ function tagHighlighter(tags2, options) {
|
|
|
29839
29850
|
};
|
|
29840
29851
|
}
|
|
29841
29852
|
function highlightTags(highlighters, tags2) {
|
|
29842
|
-
let
|
|
29853
|
+
let result2 = null;
|
|
29843
29854
|
for (let highlighter of highlighters) {
|
|
29844
29855
|
let value = highlighter.style(tags2);
|
|
29845
29856
|
if (value)
|
|
29846
|
-
|
|
29857
|
+
result2 = result2 ? result2 + " " + value : value;
|
|
29847
29858
|
}
|
|
29848
|
-
return
|
|
29859
|
+
return result2;
|
|
29849
29860
|
}
|
|
29850
29861
|
function highlightTree(tree, highlighter, putStyle, from = 0, to = tree.length) {
|
|
29851
29862
|
let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
|
|
@@ -30403,10 +30414,10 @@ class Language {
|
|
|
30403
30414
|
return [{ from: 0, to: state.doc.length }];
|
|
30404
30415
|
if (!lang || !lang.allowsNesting)
|
|
30405
30416
|
return [];
|
|
30406
|
-
let
|
|
30417
|
+
let result2 = [];
|
|
30407
30418
|
let explore = (tree, from) => {
|
|
30408
30419
|
if (tree.prop(languageDataProp) == this.data) {
|
|
30409
|
-
|
|
30420
|
+
result2.push({ from, to: from + tree.length });
|
|
30410
30421
|
return;
|
|
30411
30422
|
}
|
|
30412
30423
|
let mount = tree.prop(NodeProp.mounted);
|
|
@@ -30414,14 +30425,14 @@ class Language {
|
|
|
30414
30425
|
if (mount.tree.prop(languageDataProp) == this.data) {
|
|
30415
30426
|
if (mount.overlay)
|
|
30416
30427
|
for (let r of mount.overlay)
|
|
30417
|
-
|
|
30428
|
+
result2.push({ from: r.from + from, to: r.to + from });
|
|
30418
30429
|
else
|
|
30419
|
-
|
|
30430
|
+
result2.push({ from, to: from + tree.length });
|
|
30420
30431
|
return;
|
|
30421
30432
|
} else if (mount.overlay) {
|
|
30422
|
-
let size =
|
|
30433
|
+
let size = result2.length;
|
|
30423
30434
|
explore(mount.tree, mount.overlay[0].from + from);
|
|
30424
|
-
if (
|
|
30435
|
+
if (result2.length > size)
|
|
30425
30436
|
return;
|
|
30426
30437
|
}
|
|
30427
30438
|
}
|
|
@@ -30432,7 +30443,7 @@ class Language {
|
|
|
30432
30443
|
}
|
|
30433
30444
|
};
|
|
30434
30445
|
explore(syntaxTree(state), 0);
|
|
30435
|
-
return
|
|
30446
|
+
return result2;
|
|
30436
30447
|
}
|
|
30437
30448
|
/**
|
|
30438
30449
|
Indicates whether this language allows nested languages. The
|
|
@@ -30891,25 +30902,25 @@ function getIndentUnit(state) {
|
|
|
30891
30902
|
return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
|
|
30892
30903
|
}
|
|
30893
30904
|
function indentString(state, cols) {
|
|
30894
|
-
let
|
|
30905
|
+
let result2 = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
|
|
30895
30906
|
if (ch == " ") {
|
|
30896
30907
|
while (cols >= ts) {
|
|
30897
|
-
|
|
30908
|
+
result2 += " ";
|
|
30898
30909
|
cols -= ts;
|
|
30899
30910
|
}
|
|
30900
30911
|
ch = " ";
|
|
30901
30912
|
}
|
|
30902
30913
|
for (let i = 0; i < cols; i++)
|
|
30903
|
-
|
|
30904
|
-
return
|
|
30914
|
+
result2 += ch;
|
|
30915
|
+
return result2;
|
|
30905
30916
|
}
|
|
30906
30917
|
function getIndentation(context, pos) {
|
|
30907
30918
|
if (context instanceof EditorState)
|
|
30908
30919
|
context = new IndentContext(context);
|
|
30909
30920
|
for (let service of context.state.facet(indentService)) {
|
|
30910
|
-
let
|
|
30911
|
-
if (
|
|
30912
|
-
return
|
|
30921
|
+
let result2 = service(context, pos);
|
|
30922
|
+
if (result2 !== void 0)
|
|
30923
|
+
return result2;
|
|
30913
30924
|
}
|
|
30914
30925
|
let tree = syntaxTree(context.state);
|
|
30915
30926
|
return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;
|
|
@@ -30959,11 +30970,11 @@ class IndentContext {
|
|
|
30959
30970
|
*/
|
|
30960
30971
|
column(pos, bias = 1) {
|
|
30961
30972
|
let { text, from } = this.lineAt(pos, bias);
|
|
30962
|
-
let
|
|
30973
|
+
let result2 = this.countColumn(text, pos - from);
|
|
30963
30974
|
let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
|
|
30964
30975
|
if (override > -1)
|
|
30965
|
-
|
|
30966
|
-
return
|
|
30976
|
+
result2 += override - this.countColumn(text, text.search(/\S|$/));
|
|
30977
|
+
return result2;
|
|
30967
30978
|
}
|
|
30968
30979
|
/**
|
|
30969
30980
|
Find the column position (taking tabs into account) of the given
|
|
@@ -31841,9 +31852,9 @@ class HistEvent {
|
|
|
31841
31852
|
static fromTransaction(tr, selection) {
|
|
31842
31853
|
let effects = none$1;
|
|
31843
31854
|
for (let invert of tr.startState.facet(invertedEffects)) {
|
|
31844
|
-
let
|
|
31845
|
-
if (
|
|
31846
|
-
effects = effects.concat(
|
|
31855
|
+
let result2 = invert(tr);
|
|
31856
|
+
if (result2.length)
|
|
31857
|
+
effects = effects.concat(result2);
|
|
31847
31858
|
}
|
|
31848
31859
|
if (!effects.length && tr.changes.empty)
|
|
31849
31860
|
return null;
|
|
@@ -31904,9 +31915,9 @@ function addMappingToBranch(branch, mapping) {
|
|
|
31904
31915
|
while (length) {
|
|
31905
31916
|
let event = mapEvent(branch[length - 1], mapping, selections);
|
|
31906
31917
|
if (event.changes && !event.changes.empty || event.effects.length) {
|
|
31907
|
-
let
|
|
31908
|
-
|
|
31909
|
-
return
|
|
31918
|
+
let result2 = branch.slice(0, length);
|
|
31919
|
+
result2[length - 1] = event;
|
|
31920
|
+
return result2;
|
|
31910
31921
|
} else {
|
|
31911
31922
|
mapping = event.mapped;
|
|
31912
31923
|
length--;
|
|
@@ -32922,13 +32933,13 @@ function toCharEnd(text, pos) {
|
|
|
32922
32933
|
const gotoLine = (view) => {
|
|
32923
32934
|
let { state } = view;
|
|
32924
32935
|
let line = String(state.doc.lineAt(view.state.selection.main.head).number);
|
|
32925
|
-
let { close, result } = showDialog(view, {
|
|
32936
|
+
let { close, result: result2 } = showDialog(view, {
|
|
32926
32937
|
label: state.phrase("Go to line"),
|
|
32927
32938
|
input: { type: "text", name: "line", value: line },
|
|
32928
32939
|
focus: true,
|
|
32929
32940
|
submitLabel: state.phrase("go")
|
|
32930
32941
|
});
|
|
32931
|
-
|
|
32942
|
+
result2.then((form) => {
|
|
32932
32943
|
let match = form && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(form.elements["line"].value);
|
|
32933
32944
|
if (!match) {
|
|
32934
32945
|
view.dispatch({ effects: close });
|
|
@@ -33275,16 +33286,16 @@ class RegExpQuery extends QueryType {
|
|
|
33275
33286
|
prevMatch(state, curFrom, curTo) {
|
|
33276
33287
|
return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
|
|
33277
33288
|
}
|
|
33278
|
-
getReplacement(
|
|
33289
|
+
getReplacement(result2) {
|
|
33279
33290
|
return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (m, i) => {
|
|
33280
33291
|
if (i == "&")
|
|
33281
|
-
return
|
|
33292
|
+
return result2.match[0];
|
|
33282
33293
|
if (i == "$")
|
|
33283
33294
|
return "$";
|
|
33284
33295
|
for (let l = i.length; l > 0; l--) {
|
|
33285
33296
|
let n = +i.slice(0, l);
|
|
33286
|
-
if (n > 0 && n <
|
|
33287
|
-
return
|
|
33297
|
+
if (n > 0 && n < result2.match.length)
|
|
33298
|
+
return result2.match[n] + i.slice(l);
|
|
33288
33299
|
}
|
|
33289
33300
|
return m;
|
|
33290
33301
|
});
|
|
@@ -34005,8 +34016,8 @@ class Stack {
|
|
|
34005
34016
|
}
|
|
34006
34017
|
nextStates = best;
|
|
34007
34018
|
}
|
|
34008
|
-
let
|
|
34009
|
-
for (let i = 0; i < nextStates.length &&
|
|
34019
|
+
let result2 = [];
|
|
34020
|
+
for (let i = 0; i < nextStates.length && result2.length < 4; i += 2) {
|
|
34010
34021
|
let s = nextStates[i + 1];
|
|
34011
34022
|
if (s == this.state)
|
|
34012
34023
|
continue;
|
|
@@ -34016,9 +34027,9 @@ class Stack {
|
|
|
34016
34027
|
stack.shiftContext(nextStates[i], this.pos);
|
|
34017
34028
|
stack.reducePos = this.pos;
|
|
34018
34029
|
stack.score -= 200;
|
|
34019
|
-
|
|
34030
|
+
result2.push(stack);
|
|
34020
34031
|
}
|
|
34021
|
-
return
|
|
34032
|
+
return result2;
|
|
34022
34033
|
}
|
|
34023
34034
|
// Force a reduce, if possible. Return false if that can't
|
|
34024
34035
|
// be done.
|
|
@@ -34379,17 +34390,17 @@ class InputStream {
|
|
|
34379
34390
|
units, since the library does not track lookbehind.
|
|
34380
34391
|
*/
|
|
34381
34392
|
peek(offset) {
|
|
34382
|
-
let idx = this.chunkOff + offset, pos,
|
|
34393
|
+
let idx = this.chunkOff + offset, pos, result2;
|
|
34383
34394
|
if (idx >= 0 && idx < this.chunk.length) {
|
|
34384
34395
|
pos = this.pos + offset;
|
|
34385
|
-
|
|
34396
|
+
result2 = this.chunk.charCodeAt(idx);
|
|
34386
34397
|
} else {
|
|
34387
34398
|
let resolved = this.resolveOffset(offset, 1);
|
|
34388
34399
|
if (resolved == null)
|
|
34389
34400
|
return -1;
|
|
34390
34401
|
pos = resolved;
|
|
34391
34402
|
if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
|
|
34392
|
-
|
|
34403
|
+
result2 = this.chunk2.charCodeAt(pos - this.chunk2Pos);
|
|
34393
34404
|
} else {
|
|
34394
34405
|
let i = this.rangeIndex, range = this.range;
|
|
34395
34406
|
while (range.to <= pos)
|
|
@@ -34397,12 +34408,12 @@ class InputStream {
|
|
|
34397
34408
|
this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
|
|
34398
34409
|
if (pos + this.chunk2.length > range.to)
|
|
34399
34410
|
this.chunk2 = this.chunk2.slice(0, range.to - pos);
|
|
34400
|
-
|
|
34411
|
+
result2 = this.chunk2.charCodeAt(0);
|
|
34401
34412
|
}
|
|
34402
34413
|
}
|
|
34403
34414
|
if (pos >= this.token.lookAhead)
|
|
34404
34415
|
this.token.lookAhead = pos + 1;
|
|
34405
|
-
return
|
|
34416
|
+
return result2;
|
|
34406
34417
|
}
|
|
34407
34418
|
/**
|
|
34408
34419
|
Accept a token. By default, the end of the token is set to the
|
|
@@ -34515,14 +34526,14 @@ class InputStream {
|
|
|
34515
34526
|
return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
|
|
34516
34527
|
if (from >= this.range.from && to <= this.range.to)
|
|
34517
34528
|
return this.input.read(from, to);
|
|
34518
|
-
let
|
|
34529
|
+
let result2 = "";
|
|
34519
34530
|
for (let r of this.ranges) {
|
|
34520
34531
|
if (r.from >= to)
|
|
34521
34532
|
break;
|
|
34522
34533
|
if (r.to > from)
|
|
34523
|
-
|
|
34534
|
+
result2 += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
|
|
34524
34535
|
}
|
|
34525
|
-
return
|
|
34536
|
+
return result2;
|
|
34526
34537
|
}
|
|
34527
34538
|
}
|
|
34528
34539
|
class TokenGroup {
|
|
@@ -34805,12 +34816,12 @@ class TokenCache {
|
|
|
34805
34816
|
let { parser: parser2 } = stack.p;
|
|
34806
34817
|
for (let i = 0; i < parser2.specialized.length; i++)
|
|
34807
34818
|
if (parser2.specialized[i] == token.value) {
|
|
34808
|
-
let
|
|
34809
|
-
if (
|
|
34810
|
-
if ((
|
|
34811
|
-
token.value =
|
|
34819
|
+
let result2 = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
|
|
34820
|
+
if (result2 >= 0 && stack.p.parser.dialect.allows(result2 >> 1)) {
|
|
34821
|
+
if ((result2 & 1) == 0)
|
|
34822
|
+
token.value = result2 >> 1;
|
|
34812
34823
|
else
|
|
34813
|
-
token.extended =
|
|
34824
|
+
token.extended = result2 >> 1;
|
|
34814
34825
|
break;
|
|
34815
34826
|
}
|
|
34816
34827
|
}
|
|
@@ -35312,28 +35323,28 @@ class LRParser extends Parser {
|
|
|
35312
35323
|
4
|
|
35313
35324
|
/* ParseState.DefaultReduce */
|
|
35314
35325
|
);
|
|
35315
|
-
let
|
|
35326
|
+
let result2 = deflt ? action(deflt) : void 0;
|
|
35316
35327
|
for (let i = this.stateSlot(
|
|
35317
35328
|
state,
|
|
35318
35329
|
1
|
|
35319
35330
|
/* ParseState.Actions */
|
|
35320
|
-
);
|
|
35331
|
+
); result2 == null; i += 3) {
|
|
35321
35332
|
if (this.data[i] == 65535) {
|
|
35322
35333
|
if (this.data[i + 1] == 1)
|
|
35323
35334
|
i = pair(this.data, i + 2);
|
|
35324
35335
|
else
|
|
35325
35336
|
break;
|
|
35326
35337
|
}
|
|
35327
|
-
|
|
35338
|
+
result2 = action(pair(this.data, i + 1));
|
|
35328
35339
|
}
|
|
35329
|
-
return
|
|
35340
|
+
return result2;
|
|
35330
35341
|
}
|
|
35331
35342
|
/**
|
|
35332
35343
|
Get the states that can follow this one through shift actions or
|
|
35333
35344
|
goto jumps. @internal
|
|
35334
35345
|
*/
|
|
35335
35346
|
nextStates(state) {
|
|
35336
|
-
let
|
|
35347
|
+
let result2 = [];
|
|
35337
35348
|
for (let i = this.stateSlot(
|
|
35338
35349
|
state,
|
|
35339
35350
|
1
|
|
@@ -35347,11 +35358,11 @@ class LRParser extends Parser {
|
|
|
35347
35358
|
}
|
|
35348
35359
|
if ((this.data[i + 2] & 65536 >> 16) == 0) {
|
|
35349
35360
|
let value = this.data[i + 1];
|
|
35350
|
-
if (!
|
|
35351
|
-
|
|
35361
|
+
if (!result2.some((v, i2) => i2 & 1 && v == value))
|
|
35362
|
+
result2.push(this.data[i], value);
|
|
35352
35363
|
}
|
|
35353
35364
|
}
|
|
35354
|
-
return
|
|
35365
|
+
return result2;
|
|
35355
35366
|
}
|
|
35356
35367
|
/**
|
|
35357
35368
|
Configure the parser. Returns a new parser instance that has the
|
|
@@ -35926,17 +35937,17 @@ class FuzzyMatcher {
|
|
|
35926
35937
|
return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
|
|
35927
35938
|
}
|
|
35928
35939
|
result(score2, positions, word) {
|
|
35929
|
-
let
|
|
35940
|
+
let result2 = [], i = 0;
|
|
35930
35941
|
for (let pos of positions) {
|
|
35931
35942
|
let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
|
|
35932
|
-
if (i &&
|
|
35933
|
-
|
|
35943
|
+
if (i && result2[i - 1] == pos)
|
|
35944
|
+
result2[i - 1] = to;
|
|
35934
35945
|
else {
|
|
35935
|
-
|
|
35936
|
-
|
|
35946
|
+
result2[i++] = pos;
|
|
35947
|
+
result2[i++] = to;
|
|
35937
35948
|
}
|
|
35938
35949
|
}
|
|
35939
|
-
return this.ret(score2 - word.length,
|
|
35950
|
+
return this.ret(score2 - word.length, result2);
|
|
35940
35951
|
}
|
|
35941
35952
|
}
|
|
35942
35953
|
class StrictMatcher {
|
|
@@ -36394,17 +36405,17 @@ function sortOptions(active, state) {
|
|
|
36394
36405
|
option.score += sectionOrder[typeof section == "string" ? section : section.name];
|
|
36395
36406
|
}
|
|
36396
36407
|
}
|
|
36397
|
-
let
|
|
36408
|
+
let result2 = [], prev = null;
|
|
36398
36409
|
let compare2 = conf.compareCompletions;
|
|
36399
36410
|
for (let opt of options.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
|
|
36400
36411
|
let cur2 = opt.completion;
|
|
36401
36412
|
if (!prev || prev.label != cur2.label || prev.detail != cur2.detail || prev.type != null && cur2.type != null && prev.type != cur2.type || prev.apply != cur2.apply || prev.boost != cur2.boost)
|
|
36402
|
-
|
|
36413
|
+
result2.push(opt);
|
|
36403
36414
|
else if (score(opt.completion) > score(prev))
|
|
36404
|
-
|
|
36415
|
+
result2[result2.length - 1] = opt;
|
|
36405
36416
|
prev = opt.completion;
|
|
36406
36417
|
}
|
|
36407
|
-
return
|
|
36418
|
+
return result2;
|
|
36408
36419
|
}
|
|
36409
36420
|
class CompletionDialog {
|
|
36410
36421
|
constructor(options, attrs, tooltip, timestamp, selected, disabled) {
|
|
@@ -36516,14 +36527,14 @@ const baseAttrs = {
|
|
|
36516
36527
|
};
|
|
36517
36528
|
const noAttrs = {};
|
|
36518
36529
|
function makeAttrs(id2, selected) {
|
|
36519
|
-
let
|
|
36530
|
+
let result2 = {
|
|
36520
36531
|
"aria-autocomplete": "list",
|
|
36521
36532
|
"aria-haspopup": "listbox",
|
|
36522
36533
|
"aria-controls": id2
|
|
36523
36534
|
};
|
|
36524
36535
|
if (selected > -1)
|
|
36525
|
-
|
|
36526
|
-
return
|
|
36536
|
+
result2["aria-activedescendant"] = id2 + "-" + selected;
|
|
36537
|
+
return result2;
|
|
36527
36538
|
}
|
|
36528
36539
|
const none = [];
|
|
36529
36540
|
function getUpdateType(tr, conf) {
|
|
@@ -36590,10 +36601,10 @@ class ActiveSource {
|
|
|
36590
36601
|
}
|
|
36591
36602
|
}
|
|
36592
36603
|
class ActiveResult extends ActiveSource {
|
|
36593
|
-
constructor(source, explicit, limit2,
|
|
36604
|
+
constructor(source, explicit, limit2, result2, from, to) {
|
|
36594
36605
|
super(source, 3, explicit);
|
|
36595
36606
|
this.limit = limit2;
|
|
36596
|
-
this.result =
|
|
36607
|
+
this.result = result2;
|
|
36597
36608
|
this.from = from;
|
|
36598
36609
|
this.to = to;
|
|
36599
36610
|
}
|
|
@@ -36604,29 +36615,29 @@ class ActiveResult extends ActiveSource {
|
|
|
36604
36615
|
var _a2;
|
|
36605
36616
|
if (!(type2 & 3))
|
|
36606
36617
|
return this.map(tr.changes);
|
|
36607
|
-
let
|
|
36608
|
-
if (
|
|
36609
|
-
|
|
36618
|
+
let result2 = this.result;
|
|
36619
|
+
if (result2.map && !tr.changes.empty)
|
|
36620
|
+
result2 = result2.map(result2, tr.changes);
|
|
36610
36621
|
let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
|
|
36611
36622
|
let pos = cur(tr.state);
|
|
36612
|
-
if (pos > to || !
|
|
36623
|
+
if (pos > to || !result2 || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
|
|
36613
36624
|
return new ActiveSource(
|
|
36614
36625
|
this.source,
|
|
36615
36626
|
type2 & 4 ? 1 : 0
|
|
36616
36627
|
/* State.Inactive */
|
|
36617
36628
|
);
|
|
36618
36629
|
let limit2 = tr.changes.mapPos(this.limit);
|
|
36619
|
-
if (checkValid(
|
|
36620
|
-
return new ActiveResult(this.source, this.explicit, limit2,
|
|
36621
|
-
if (
|
|
36622
|
-
return new ActiveResult(this.source, this.explicit, limit2,
|
|
36630
|
+
if (checkValid(result2.validFor, tr.state, from, to))
|
|
36631
|
+
return new ActiveResult(this.source, this.explicit, limit2, result2, from, to);
|
|
36632
|
+
if (result2.update && (result2 = result2.update(result2, from, to, new CompletionContext(tr.state, pos, false))))
|
|
36633
|
+
return new ActiveResult(this.source, this.explicit, limit2, result2, result2.from, (_a2 = result2.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
|
|
36623
36634
|
return new ActiveSource(this.source, 1, this.explicit);
|
|
36624
36635
|
}
|
|
36625
36636
|
map(mapping) {
|
|
36626
36637
|
if (mapping.empty)
|
|
36627
36638
|
return this;
|
|
36628
|
-
let
|
|
36629
|
-
if (!
|
|
36639
|
+
let result2 = this.result.map ? this.result.map(this.result, mapping) : this.result;
|
|
36640
|
+
if (!result2)
|
|
36630
36641
|
return new ActiveSource(
|
|
36631
36642
|
this.source,
|
|
36632
36643
|
0
|
|
@@ -36663,16 +36674,16 @@ const completionState = /* @__PURE__ */ StateField.define({
|
|
|
36663
36674
|
});
|
|
36664
36675
|
function applyCompletion(view, option) {
|
|
36665
36676
|
const apply = option.completion.apply || option.completion.label;
|
|
36666
|
-
let
|
|
36667
|
-
if (!(
|
|
36677
|
+
let result2 = view.state.field(completionState).active.find((a) => a.source == option.source);
|
|
36678
|
+
if (!(result2 instanceof ActiveResult))
|
|
36668
36679
|
return false;
|
|
36669
36680
|
if (typeof apply == "string")
|
|
36670
36681
|
view.dispatch({
|
|
36671
|
-
...insertCompletionText(view.state, apply,
|
|
36682
|
+
...insertCompletionText(view.state, apply, result2.from, result2.to),
|
|
36672
36683
|
annotations: pickedCompletion.of(option.completion)
|
|
36673
36684
|
});
|
|
36674
36685
|
else
|
|
36675
|
-
apply(view, option.completion,
|
|
36686
|
+
apply(view, option.completion, result2.from, result2.to);
|
|
36676
36687
|
return true;
|
|
36677
36688
|
}
|
|
36678
36689
|
const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
|
|
@@ -36794,9 +36805,9 @@ const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
|
36794
36805
|
let context = new CompletionContext(state, pos, active.explicit, this.view);
|
|
36795
36806
|
let pending = new RunningQuery(active, context);
|
|
36796
36807
|
this.running.push(pending);
|
|
36797
|
-
Promise.resolve(active.source(context)).then((
|
|
36808
|
+
Promise.resolve(active.source(context)).then((result2) => {
|
|
36798
36809
|
if (!pending.context.aborted) {
|
|
36799
|
-
pending.done =
|
|
36810
|
+
pending.done = result2 || null;
|
|
36800
36811
|
this.scheduleAccept();
|
|
36801
36812
|
}
|
|
36802
36813
|
}, (err) => {
|
|
@@ -36883,8 +36894,8 @@ const commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView
|
|
|
36883
36894
|
if (!field || !field.open || field.open.disabled || field.open.selected < 0 || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
|
|
36884
36895
|
return false;
|
|
36885
36896
|
let option = field.open.options[field.open.selected];
|
|
36886
|
-
let
|
|
36887
|
-
let commitChars = option.completion.commitCharacters ||
|
|
36897
|
+
let result2 = field.active.find((a) => a.source == option.source);
|
|
36898
|
+
let commitChars = option.completion.commitCharacters || result2.result.commitCharacters;
|
|
36888
36899
|
if (commitChars && commitChars.indexOf(event.key) > -1)
|
|
36889
36900
|
applyCompletion(view, option);
|
|
36890
36901
|
return false;
|
|
@@ -37679,9 +37690,9 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
|
37679
37690
|
}
|
|
37680
37691
|
function hideTooltip(tr, tooltip) {
|
|
37681
37692
|
let from = tooltip.pos, to = tooltip.end || from;
|
|
37682
|
-
let
|
|
37683
|
-
if (
|
|
37684
|
-
return
|
|
37693
|
+
let result2 = tr.state.facet(lintConfig).hideOn(tr, from, to);
|
|
37694
|
+
if (result2 != null)
|
|
37695
|
+
return result2;
|
|
37685
37696
|
let line = tr.startState.doc.lineAt(tooltip.pos);
|
|
37686
37697
|
return !!(tr.effects.some((e) => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, Math.max(line.to, to)));
|
|
37687
37698
|
}
|
|
@@ -40048,7 +40059,7 @@ class NineDiff extends HTMLElement {
|
|
|
40048
40059
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40049
40060
|
this.shadowRoot.innerHTML = `
|
|
40050
40061
|
<style>
|
|
40051
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40062
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.180"}/dist/css/nine-mu.css";
|
|
40052
40063
|
${customImport}
|
|
40053
40064
|
</style>
|
|
40054
40065
|
|
|
@@ -40158,7 +40169,7 @@ render_fn2 = function() {
|
|
|
40158
40169
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40159
40170
|
this.shadowRoot.innerHTML = `
|
|
40160
40171
|
<style>
|
|
40161
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40172
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.180"}/dist/css/nine-mu.css";
|
|
40162
40173
|
${customImport}
|
|
40163
40174
|
</style>
|
|
40164
40175
|
|
|
@@ -40485,7 +40496,7 @@ class ChatMessageBody extends HTMLElement {
|
|
|
40485
40496
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40486
40497
|
this.shadowRoot.innerHTML = `
|
|
40487
40498
|
<style>
|
|
40488
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40499
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.180"}/dist/css/nine-mu.css";
|
|
40489
40500
|
${customImport}
|
|
40490
40501
|
</style>
|
|
40491
40502
|
|
|
@@ -40579,7 +40590,7 @@ if (!customElements.get("nine-chat-progress")) {
|
|
|
40579
40590
|
customElements.define("nine-chat-progress", ProgressMessage);
|
|
40580
40591
|
}
|
|
40581
40592
|
const NineMu = {
|
|
40582
|
-
version: "0.1.
|
|
40593
|
+
version: "0.1.180",
|
|
40583
40594
|
init: (config2) => {
|
|
40584
40595
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
40585
40596
|
}
|