@nine-lab/nine-mu 0.1.179 → 0.1.180
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 +505 -486
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +3 -3
- 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 +26 -0
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.
|
|
@@ -13513,9 +13513,22 @@ class NineChatManager {
|
|
|
13513
13513
|
__privateAdd(this, _owner);
|
|
13514
13514
|
__privateAdd(this, _routeUrl);
|
|
13515
13515
|
__publicField(this, "handleChatSubmit", async (v) => {
|
|
13516
|
-
const
|
|
13516
|
+
const routes2 = await __privateMethod(this, _NineChatManager_instances, getRoutes_fn).call(this);
|
|
13517
13517
|
return await __privateMethod(this, _NineChatManager_instances, callTool_fn).call(this, "system-brain", {
|
|
13518
13518
|
user_input: v,
|
|
13519
|
+
routes: routes2,
|
|
13520
|
+
current_path: "/group_member/student_management"
|
|
13521
|
+
});
|
|
13522
|
+
});
|
|
13523
|
+
__privateAdd(this, _chatHistory, []);
|
|
13524
|
+
__publicField(this, "handleChatSubmit", async (v) => {
|
|
13525
|
+
__privateGet(this, _chatHistory).push({ role: "user", text: v });
|
|
13526
|
+
const formattedHistory = __privateGet(this, _chatHistory).map((chat) => {
|
|
13527
|
+
return chat.role === "user" ? `User: ${chat.text}` : `AI: ${chat.text}`;
|
|
13528
|
+
}).join("\n");
|
|
13529
|
+
return await __privateMethod(this, _NineChatManager_instances, callTool_fn).call(this, "system-brain", {
|
|
13530
|
+
user_input: v,
|
|
13531
|
+
chat_history: formattedHistory,
|
|
13519
13532
|
routes,
|
|
13520
13533
|
current_path: "/group_member/student_management"
|
|
13521
13534
|
});
|
|
@@ -13534,20 +13547,20 @@ class NineChatManager {
|
|
|
13534
13547
|
}
|
|
13535
13548
|
try {
|
|
13536
13549
|
__privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "user", userInput);
|
|
13537
|
-
const
|
|
13550
|
+
const routes2 = await __privateMethod(this, _NineChatManager_instances, fetchRoutes_fn).call(this);
|
|
13538
13551
|
const response = await __privateGet(this, _mcpClient).callTool({
|
|
13539
13552
|
name: "system-brain",
|
|
13540
13553
|
arguments: {
|
|
13541
13554
|
user_input: userInput,
|
|
13542
|
-
routes,
|
|
13555
|
+
routes: routes2,
|
|
13543
13556
|
current_path: window.location.pathname
|
|
13544
13557
|
// 실시간 경로 주입
|
|
13545
13558
|
}
|
|
13546
13559
|
});
|
|
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,
|
|
13560
|
+
const result2 = JSON.parse(response.content[0].text);
|
|
13561
|
+
console.log("AI Response:", result2);
|
|
13562
|
+
__privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "assistant", result2.message, result2);
|
|
13563
|
+
if (__privateGet(this, _onAction)) __privateGet(this, _onAction).call(this, result2);
|
|
13551
13564
|
__privateMethod(this, _NineChatManager_instances, updateStatus_fn).call(this, "준비 완료");
|
|
13552
13565
|
} catch (err) {
|
|
13553
13566
|
trace.error("❌ Ask Error:", err);
|
|
@@ -13568,6 +13581,10 @@ class NineChatManager {
|
|
|
13568
13581
|
return "";
|
|
13569
13582
|
}
|
|
13570
13583
|
}
|
|
13584
|
+
// 💡 이전 대화들을 저장할 메모리 창고
|
|
13585
|
+
addChatHistory(message) {
|
|
13586
|
+
__privateGet(this, _chatHistory).push({ role: "ai", text: result.message });
|
|
13587
|
+
}
|
|
13571
13588
|
}
|
|
13572
13589
|
_mcpClient = new WeakMap();
|
|
13573
13590
|
_onAction = new WeakMap();
|
|
@@ -13596,15 +13613,15 @@ fetchRoutes_fn = async function() {
|
|
|
13596
13613
|
const r = await fetch("/admin/prompts/data/routes.json");
|
|
13597
13614
|
return r.ok ? await r.json() : [];
|
|
13598
13615
|
};
|
|
13599
|
-
pushMessage_fn = function(role, content2,
|
|
13616
|
+
pushMessage_fn = function(role, content2, result2 = null) {
|
|
13600
13617
|
var _a2;
|
|
13601
13618
|
if (__privateGet(this, _onMessage)) {
|
|
13602
13619
|
__privateGet(this, _onMessage).call(this, {
|
|
13603
13620
|
role,
|
|
13604
13621
|
content: content2,
|
|
13605
|
-
intent:
|
|
13606
|
-
required_args: (_a2 =
|
|
13607
|
-
action:
|
|
13622
|
+
intent: result2 == null ? void 0 : result2.intent,
|
|
13623
|
+
required_args: (_a2 = result2 == null ? void 0 : result2.action) == null ? void 0 : _a2.required_args,
|
|
13624
|
+
action: result2 == null ? void 0 : result2.action
|
|
13608
13625
|
});
|
|
13609
13626
|
}
|
|
13610
13627
|
};
|
|
@@ -13622,6 +13639,7 @@ getRoutes_fn = async function(toolName, args = {}) {
|
|
|
13622
13639
|
}
|
|
13623
13640
|
return await res.json();
|
|
13624
13641
|
};
|
|
13642
|
+
_chatHistory = new WeakMap();
|
|
13625
13643
|
class NineMuService {
|
|
13626
13644
|
constructor(connectorUrl) {
|
|
13627
13645
|
__privateAdd(this, _getSourcePath, (menuUrl) => {
|
|
@@ -13648,11 +13666,11 @@ class NineMuService {
|
|
|
13648
13666
|
currentRoutes
|
|
13649
13667
|
})
|
|
13650
13668
|
});
|
|
13651
|
-
const
|
|
13652
|
-
if (!
|
|
13653
|
-
throw new Error(
|
|
13669
|
+
const result2 = await response.json();
|
|
13670
|
+
if (!result2.success) {
|
|
13671
|
+
throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
|
|
13654
13672
|
}
|
|
13655
|
-
return
|
|
13673
|
+
return result2;
|
|
13656
13674
|
} catch (error) {
|
|
13657
13675
|
trace.error("NineMu Service Error:", error);
|
|
13658
13676
|
throw error;
|
|
@@ -13685,11 +13703,11 @@ class NineMuService {
|
|
|
13685
13703
|
})
|
|
13686
13704
|
});
|
|
13687
13705
|
trace.log(response);
|
|
13688
|
-
const
|
|
13689
|
-
if (!
|
|
13690
|
-
throw new Error(
|
|
13706
|
+
const result2 = await response.json();
|
|
13707
|
+
if (!result2.success) {
|
|
13708
|
+
throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
|
|
13691
13709
|
}
|
|
13692
|
-
return
|
|
13710
|
+
return result2;
|
|
13693
13711
|
} catch (error) {
|
|
13694
13712
|
trace.error("NineMu Service Error:", error);
|
|
13695
13713
|
throw error;
|
|
@@ -13742,10 +13760,10 @@ class NineChat extends HTMLElement {
|
|
|
13742
13760
|
const command2 = "";
|
|
13743
13761
|
const targets = "";
|
|
13744
13762
|
try {
|
|
13745
|
-
const
|
|
13763
|
+
const result2 = await __privateGet(this, _service).generateAll(command2, targets, __privateGet(this, _routes));
|
|
13746
13764
|
$status.textContent = "✅ 완료";
|
|
13747
13765
|
nine.alert("소스 생성 성공").rgb();
|
|
13748
|
-
this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail:
|
|
13766
|
+
this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail: result2, bubbles: true }));
|
|
13749
13767
|
} catch (err) {
|
|
13750
13768
|
$status.textContent = "❌ 실패";
|
|
13751
13769
|
nine.alert(err.message).rgb().shake();
|
|
@@ -13808,7 +13826,7 @@ initActions_fn = function() {
|
|
|
13808
13826
|
target.setAttribute("disabled", "disabled");
|
|
13809
13827
|
__privateGet(this, _$nineChatMessage).add("me", userInput);
|
|
13810
13828
|
__privateGet(this, _$nineChatMessage).add("ing", "");
|
|
13811
|
-
const [
|
|
13829
|
+
const [result2, err] = await nine.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
|
|
13812
13830
|
setTimeout(() => {
|
|
13813
13831
|
target.value = "";
|
|
13814
13832
|
});
|
|
@@ -13818,8 +13836,9 @@ initActions_fn = function() {
|
|
|
13818
13836
|
trace.error(err);
|
|
13819
13837
|
__privateGet(this, _$nineChatMessage).add("ai", err.message || "알 수 없는 오류가 발생했습니다. 다시 시도해주세요.");
|
|
13820
13838
|
} else {
|
|
13821
|
-
trace.log(
|
|
13822
|
-
__privateGet(this,
|
|
13839
|
+
trace.log(result2);
|
|
13840
|
+
__privateGet(this, _manager).addChatHistory(result2.message);
|
|
13841
|
+
__privateGet(this, _$nineChatMessage).add("ai", result2.message);
|
|
13823
13842
|
}
|
|
13824
13843
|
}
|
|
13825
13844
|
});
|
|
@@ -13829,7 +13848,7 @@ render_fn = function() {
|
|
|
13829
13848
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
13830
13849
|
this.shadowRoot.innerHTML = `
|
|
13831
13850
|
<style>
|
|
13832
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
13851
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.179"}/dist/css/nine-mu.css";
|
|
13833
13852
|
${customImport}
|
|
13834
13853
|
</style>
|
|
13835
13854
|
<div class="wrapper">
|
|
@@ -14142,16 +14161,16 @@ class TextLeaf extends Text {
|
|
|
14142
14161
|
}
|
|
14143
14162
|
sliceString(from, to = this.length, lineSep = "\n") {
|
|
14144
14163
|
[from, to] = clip(this, from, to);
|
|
14145
|
-
let
|
|
14164
|
+
let result2 = "";
|
|
14146
14165
|
for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {
|
|
14147
14166
|
let line = this.text[i], end = pos + line.length;
|
|
14148
14167
|
if (pos > from && i)
|
|
14149
|
-
|
|
14168
|
+
result2 += lineSep;
|
|
14150
14169
|
if (from < end && to > pos)
|
|
14151
|
-
|
|
14170
|
+
result2 += line.slice(Math.max(0, from - pos), to - pos);
|
|
14152
14171
|
pos = end + 1;
|
|
14153
14172
|
}
|
|
14154
|
-
return
|
|
14173
|
+
return result2;
|
|
14155
14174
|
}
|
|
14156
14175
|
flatten(target) {
|
|
14157
14176
|
for (let line of this.text)
|
|
@@ -14228,16 +14247,16 @@ class TextNode extends Text {
|
|
|
14228
14247
|
}
|
|
14229
14248
|
sliceString(from, to = this.length, lineSep = "\n") {
|
|
14230
14249
|
[from, to] = clip(this, from, to);
|
|
14231
|
-
let
|
|
14250
|
+
let result2 = "";
|
|
14232
14251
|
for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {
|
|
14233
14252
|
let child = this.children[i], end = pos + child.length;
|
|
14234
14253
|
if (pos > from && i)
|
|
14235
|
-
|
|
14254
|
+
result2 += lineSep;
|
|
14236
14255
|
if (from < end && to > pos)
|
|
14237
|
-
|
|
14256
|
+
result2 += child.sliceString(from - pos, to - pos, lineSep);
|
|
14238
14257
|
pos = end + 1;
|
|
14239
14258
|
}
|
|
14240
|
-
return
|
|
14259
|
+
return result2;
|
|
14241
14260
|
}
|
|
14242
14261
|
flatten(target) {
|
|
14243
14262
|
for (let child of this.children)
|
|
@@ -14546,21 +14565,21 @@ class ChangeDesc {
|
|
|
14546
14565
|
The length of the document before the change.
|
|
14547
14566
|
*/
|
|
14548
14567
|
get length() {
|
|
14549
|
-
let
|
|
14568
|
+
let result2 = 0;
|
|
14550
14569
|
for (let i = 0; i < this.sections.length; i += 2)
|
|
14551
|
-
|
|
14552
|
-
return
|
|
14570
|
+
result2 += this.sections[i];
|
|
14571
|
+
return result2;
|
|
14553
14572
|
}
|
|
14554
14573
|
/**
|
|
14555
14574
|
The length of the document after the change.
|
|
14556
14575
|
*/
|
|
14557
14576
|
get newLength() {
|
|
14558
|
-
let
|
|
14577
|
+
let result2 = 0;
|
|
14559
14578
|
for (let i = 0; i < this.sections.length; i += 2) {
|
|
14560
14579
|
let ins = this.sections[i + 1];
|
|
14561
|
-
|
|
14580
|
+
result2 += ins < 0 ? this.sections[i] : ins;
|
|
14562
14581
|
}
|
|
14563
|
-
return
|
|
14582
|
+
return result2;
|
|
14564
14583
|
}
|
|
14565
14584
|
/**
|
|
14566
14585
|
False when there are actual changes in this set.
|
|
@@ -14670,12 +14689,12 @@ class ChangeDesc {
|
|
|
14670
14689
|
@internal
|
|
14671
14690
|
*/
|
|
14672
14691
|
toString() {
|
|
14673
|
-
let
|
|
14692
|
+
let result2 = "";
|
|
14674
14693
|
for (let i = 0; i < this.sections.length; ) {
|
|
14675
14694
|
let len = this.sections[i++], ins = this.sections[i++];
|
|
14676
|
-
|
|
14695
|
+
result2 += (result2 ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
|
|
14677
14696
|
}
|
|
14678
|
-
return
|
|
14697
|
+
return result2;
|
|
14679
14698
|
}
|
|
14680
14699
|
/**
|
|
14681
14700
|
Serialize this change desc to a JSON-representable value.
|
|
@@ -15743,16 +15762,16 @@ class Configuration {
|
|
|
15743
15762
|
}
|
|
15744
15763
|
}
|
|
15745
15764
|
function flatten(extension, compartments, newCompartments) {
|
|
15746
|
-
let
|
|
15765
|
+
let result2 = [[], [], [], [], []];
|
|
15747
15766
|
let seen = /* @__PURE__ */ new Map();
|
|
15748
15767
|
function inner(ext, prec2) {
|
|
15749
15768
|
let known = seen.get(ext);
|
|
15750
15769
|
if (known != null) {
|
|
15751
15770
|
if (known <= prec2)
|
|
15752
15771
|
return;
|
|
15753
|
-
let found =
|
|
15772
|
+
let found = result2[known].indexOf(ext);
|
|
15754
15773
|
if (found > -1)
|
|
15755
|
-
|
|
15774
|
+
result2[known].splice(found, 1);
|
|
15756
15775
|
if (ext instanceof CompartmentInstance)
|
|
15757
15776
|
newCompartments.delete(ext.compartment);
|
|
15758
15777
|
}
|
|
@@ -15769,11 +15788,11 @@ function flatten(extension, compartments, newCompartments) {
|
|
|
15769
15788
|
} else if (ext instanceof PrecExtension) {
|
|
15770
15789
|
inner(ext.inner, ext.prec);
|
|
15771
15790
|
} else if (ext instanceof StateField) {
|
|
15772
|
-
|
|
15791
|
+
result2[prec2].push(ext);
|
|
15773
15792
|
if (ext.provides)
|
|
15774
15793
|
inner(ext.provides, prec2);
|
|
15775
15794
|
} else if (ext instanceof FacetProvider) {
|
|
15776
|
-
|
|
15795
|
+
result2[prec2].push(ext);
|
|
15777
15796
|
if (ext.facet.extensions)
|
|
15778
15797
|
inner(ext.facet.extensions, Prec_.default);
|
|
15779
15798
|
} else {
|
|
@@ -15784,7 +15803,7 @@ function flatten(extension, compartments, newCompartments) {
|
|
|
15784
15803
|
}
|
|
15785
15804
|
}
|
|
15786
15805
|
inner(extension, Prec_.default);
|
|
15787
|
-
return
|
|
15806
|
+
return result2.reduce((a, b) => a.concat(b));
|
|
15788
15807
|
}
|
|
15789
15808
|
function ensureAddr(state, addr) {
|
|
15790
15809
|
if (addr & 1)
|
|
@@ -15894,13 +15913,13 @@ class StateEffect {
|
|
|
15894
15913
|
static mapEffects(effects, mapping) {
|
|
15895
15914
|
if (!effects.length)
|
|
15896
15915
|
return effects;
|
|
15897
|
-
let
|
|
15916
|
+
let result2 = [];
|
|
15898
15917
|
for (let effect of effects) {
|
|
15899
15918
|
let mapped = effect.map(mapping);
|
|
15900
15919
|
if (mapped)
|
|
15901
|
-
|
|
15920
|
+
result2.push(mapped);
|
|
15902
15921
|
}
|
|
15903
|
-
return
|
|
15922
|
+
return result2;
|
|
15904
15923
|
}
|
|
15905
15924
|
}
|
|
15906
15925
|
StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
|
|
@@ -15998,7 +16017,7 @@ Transaction.userEvent = /* @__PURE__ */ Annotation.define();
|
|
|
15998
16017
|
Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
|
|
15999
16018
|
Transaction.remote = /* @__PURE__ */ Annotation.define();
|
|
16000
16019
|
function joinRanges(a, b) {
|
|
16001
|
-
let
|
|
16020
|
+
let result2 = [];
|
|
16002
16021
|
for (let iA = 0, iB = 0; ; ) {
|
|
16003
16022
|
let from, to;
|
|
16004
16023
|
if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
|
|
@@ -16008,11 +16027,11 @@ function joinRanges(a, b) {
|
|
|
16008
16027
|
from = b[iB++];
|
|
16009
16028
|
to = b[iB++];
|
|
16010
16029
|
} else
|
|
16011
|
-
return
|
|
16012
|
-
if (!
|
|
16013
|
-
|
|
16014
|
-
else if (
|
|
16015
|
-
|
|
16030
|
+
return result2;
|
|
16031
|
+
if (!result2.length || result2[result2.length - 1] < from)
|
|
16032
|
+
result2.push(from, to);
|
|
16033
|
+
else if (result2[result2.length - 1] < to)
|
|
16034
|
+
result2[result2.length - 1] = to;
|
|
16016
16035
|
}
|
|
16017
16036
|
}
|
|
16018
16037
|
function mergeTransaction(a, b, sequential) {
|
|
@@ -16062,23 +16081,23 @@ function resolveTransaction(state, specs, filter) {
|
|
|
16062
16081
|
}
|
|
16063
16082
|
function filterTransaction(tr) {
|
|
16064
16083
|
let state = tr.startState;
|
|
16065
|
-
let
|
|
16084
|
+
let result2 = true;
|
|
16066
16085
|
for (let filter of state.facet(changeFilter)) {
|
|
16067
16086
|
let value = filter(tr);
|
|
16068
16087
|
if (value === false) {
|
|
16069
|
-
|
|
16088
|
+
result2 = false;
|
|
16070
16089
|
break;
|
|
16071
16090
|
}
|
|
16072
16091
|
if (Array.isArray(value))
|
|
16073
|
-
|
|
16092
|
+
result2 = result2 === true ? value : joinRanges(result2, value);
|
|
16074
16093
|
}
|
|
16075
|
-
if (
|
|
16094
|
+
if (result2 !== true) {
|
|
16076
16095
|
let changes, back;
|
|
16077
|
-
if (
|
|
16096
|
+
if (result2 === false) {
|
|
16078
16097
|
back = tr.changes.invertedDesc;
|
|
16079
16098
|
changes = ChangeSet.empty(state.doc.length);
|
|
16080
16099
|
} else {
|
|
16081
|
-
let filtered = tr.changes.filter(
|
|
16100
|
+
let filtered = tr.changes.filter(result2);
|
|
16082
16101
|
changes = filtered.changes;
|
|
16083
16102
|
back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
|
|
16084
16103
|
}
|
|
@@ -16246,14 +16265,14 @@ class EditorState {
|
|
|
16246
16265
|
let changes = this.changes(result1.changes), ranges = [result1.range];
|
|
16247
16266
|
let effects = asArray$1(result1.effects);
|
|
16248
16267
|
for (let i = 1; i < sel.ranges.length; i++) {
|
|
16249
|
-
let
|
|
16250
|
-
let newChanges = this.changes(
|
|
16268
|
+
let result2 = f(sel.ranges[i]);
|
|
16269
|
+
let newChanges = this.changes(result2.changes), newMapped = newChanges.map(changes);
|
|
16251
16270
|
for (let j = 0; j < i; j++)
|
|
16252
16271
|
ranges[j] = ranges[j].map(newMapped);
|
|
16253
16272
|
let mapBy = changes.mapDesc(newChanges, true);
|
|
16254
|
-
ranges.push(
|
|
16273
|
+
ranges.push(result2.range.map(mapBy));
|
|
16255
16274
|
changes = changes.compose(newMapped);
|
|
16256
|
-
effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(
|
|
16275
|
+
effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result2.effects), mapBy));
|
|
16257
16276
|
}
|
|
16258
16277
|
return {
|
|
16259
16278
|
changes,
|
|
@@ -16302,7 +16321,7 @@ class EditorState {
|
|
|
16302
16321
|
not use `doc` or `selection`) to fields.
|
|
16303
16322
|
*/
|
|
16304
16323
|
toJSON(fields) {
|
|
16305
|
-
let
|
|
16324
|
+
let result2 = {
|
|
16306
16325
|
doc: this.sliceDoc(),
|
|
16307
16326
|
selection: this.selection.toJSON()
|
|
16308
16327
|
};
|
|
@@ -16310,9 +16329,9 @@ class EditorState {
|
|
|
16310
16329
|
for (let prop in fields) {
|
|
16311
16330
|
let value = fields[prop];
|
|
16312
16331
|
if (value instanceof StateField && this.config.address[value.id] != null)
|
|
16313
|
-
|
|
16332
|
+
result2[prop] = value.spec.toJSON(this.field(fields[prop]), this);
|
|
16314
16333
|
}
|
|
16315
|
-
return
|
|
16334
|
+
return result2;
|
|
16316
16335
|
}
|
|
16317
16336
|
/**
|
|
16318
16337
|
Deserialize a state from its JSON representation. When custom
|
|
@@ -16416,9 +16435,9 @@ class EditorState {
|
|
|
16416
16435
|
languageDataAt(name2, pos, side = -1) {
|
|
16417
16436
|
let values = [];
|
|
16418
16437
|
for (let provider of this.facet(languageData)) {
|
|
16419
|
-
for (let
|
|
16420
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
16421
|
-
values.push(
|
|
16438
|
+
for (let result2 of provider(this, pos, side)) {
|
|
16439
|
+
if (Object.prototype.hasOwnProperty.call(result2, name2))
|
|
16440
|
+
values.push(result2[name2]);
|
|
16422
16441
|
}
|
|
16423
16442
|
}
|
|
16424
16443
|
return values;
|
|
@@ -16481,22 +16500,22 @@ EditorState.transactionFilter = transactionFilter;
|
|
|
16481
16500
|
EditorState.transactionExtender = transactionExtender;
|
|
16482
16501
|
Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
|
|
16483
16502
|
function combineConfig(configs, defaults2, combine = {}) {
|
|
16484
|
-
let
|
|
16503
|
+
let result2 = {};
|
|
16485
16504
|
for (let config2 of configs)
|
|
16486
16505
|
for (let key of Object.keys(config2)) {
|
|
16487
|
-
let value = config2[key], current =
|
|
16506
|
+
let value = config2[key], current = result2[key];
|
|
16488
16507
|
if (current === void 0)
|
|
16489
|
-
|
|
16508
|
+
result2[key] = value;
|
|
16490
16509
|
else if (current === value || value === void 0) ;
|
|
16491
16510
|
else if (Object.hasOwnProperty.call(combine, key))
|
|
16492
|
-
|
|
16511
|
+
result2[key] = combine[key](current, value);
|
|
16493
16512
|
else
|
|
16494
16513
|
throw new Error("Config merge conflict for field " + key);
|
|
16495
16514
|
}
|
|
16496
16515
|
for (let key in defaults2)
|
|
16497
|
-
if (
|
|
16498
|
-
|
|
16499
|
-
return
|
|
16516
|
+
if (result2[key] === void 0)
|
|
16517
|
+
result2[key] = defaults2[key];
|
|
16518
|
+
return result2;
|
|
16500
16519
|
}
|
|
16501
16520
|
class RangeValue {
|
|
16502
16521
|
/**
|
|
@@ -16823,12 +16842,12 @@ class RangeSet {
|
|
|
16823
16842
|
static join(sets) {
|
|
16824
16843
|
if (!sets.length)
|
|
16825
16844
|
return RangeSet.empty;
|
|
16826
|
-
let
|
|
16845
|
+
let result2 = sets[sets.length - 1];
|
|
16827
16846
|
for (let i = sets.length - 2; i >= 0; i--) {
|
|
16828
16847
|
for (let layer2 = sets[i]; layer2 != RangeSet.empty; layer2 = layer2.nextLayer)
|
|
16829
|
-
|
|
16848
|
+
result2 = new RangeSet(layer2.chunkPos, layer2.chunk, result2, Math.max(layer2.maxPoint, result2.maxPoint));
|
|
16830
16849
|
}
|
|
16831
|
-
return
|
|
16850
|
+
return result2;
|
|
16832
16851
|
}
|
|
16833
16852
|
}
|
|
16834
16853
|
RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
|
|
@@ -16936,9 +16955,9 @@ class RangeSetBuilder {
|
|
|
16936
16955
|
this.finishChunk(false);
|
|
16937
16956
|
if (this.chunks.length == 0)
|
|
16938
16957
|
return next;
|
|
16939
|
-
let
|
|
16958
|
+
let result2 = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
|
|
16940
16959
|
this.from = null;
|
|
16941
|
-
return
|
|
16960
|
+
return result2;
|
|
16942
16961
|
}
|
|
16943
16962
|
}
|
|
16944
16963
|
function findSharedChunks(a, b, textDiff) {
|
|
@@ -18295,10 +18314,10 @@ var Direction = /* @__PURE__ */ (function(Direction2) {
|
|
|
18295
18314
|
})(Direction || (Direction = {}));
|
|
18296
18315
|
const LTR = Direction.LTR, RTL = Direction.RTL;
|
|
18297
18316
|
function dec(str) {
|
|
18298
|
-
let
|
|
18317
|
+
let result2 = [];
|
|
18299
18318
|
for (let i = 0; i < str.length; i++)
|
|
18300
|
-
|
|
18301
|
-
return
|
|
18319
|
+
result2.push(1 << +str[i]);
|
|
18320
|
+
return result2;
|
|
18302
18321
|
}
|
|
18303
18322
|
const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
|
|
18304
18323
|
const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
|
|
@@ -18811,13 +18830,13 @@ function getIsolatedRanges(view, line) {
|
|
|
18811
18830
|
if (!isolates.length)
|
|
18812
18831
|
return isolates;
|
|
18813
18832
|
let sets = isolates.map((i) => i instanceof Function ? i(view) : i);
|
|
18814
|
-
let
|
|
18833
|
+
let result2 = [];
|
|
18815
18834
|
RangeSet.spans(sets, line.from, line.to, {
|
|
18816
18835
|
point() {
|
|
18817
18836
|
},
|
|
18818
18837
|
span(fromDoc, toDoc, active, open) {
|
|
18819
18838
|
let from = fromDoc - line.from, to = toDoc - line.from;
|
|
18820
|
-
let level =
|
|
18839
|
+
let level = result2;
|
|
18821
18840
|
for (let i = active.length - 1; i >= 0; i--, open--) {
|
|
18822
18841
|
let direction = active[i].spec.bidiIsolate, update;
|
|
18823
18842
|
if (direction == null)
|
|
@@ -18833,7 +18852,7 @@ function getIsolatedRanges(view, line) {
|
|
|
18833
18852
|
}
|
|
18834
18853
|
}
|
|
18835
18854
|
});
|
|
18836
|
-
return
|
|
18855
|
+
return result2;
|
|
18837
18856
|
}
|
|
18838
18857
|
const scrollMargins = /* @__PURE__ */ Facet.define();
|
|
18839
18858
|
function getScrollMargins(view) {
|
|
@@ -18886,7 +18905,7 @@ class ChangedRange {
|
|
|
18886
18905
|
static extendWithRanges(diff, ranges) {
|
|
18887
18906
|
if (ranges.length == 0)
|
|
18888
18907
|
return diff;
|
|
18889
|
-
let
|
|
18908
|
+
let result2 = [];
|
|
18890
18909
|
for (let dI = 0, rI = 0, off = 0; ; ) {
|
|
18891
18910
|
let nextD = dI < diff.length ? diff[dI].fromB : 1e9;
|
|
18892
18911
|
let nextR = rI < ranges.length ? ranges[rI] : 1e9;
|
|
@@ -18911,9 +18930,9 @@ class ChangedRange {
|
|
|
18911
18930
|
break;
|
|
18912
18931
|
}
|
|
18913
18932
|
}
|
|
18914
|
-
|
|
18933
|
+
result2.push(new ChangedRange(fromA, toA, fromB, toB));
|
|
18915
18934
|
}
|
|
18916
|
-
return
|
|
18935
|
+
return result2;
|
|
18917
18936
|
}
|
|
18918
18937
|
}
|
|
18919
18938
|
class ViewUpdate {
|
|
@@ -19189,9 +19208,9 @@ class DocTile extends CompositeTile {
|
|
|
19189
19208
|
i = 0;
|
|
19190
19209
|
} else {
|
|
19191
19210
|
let end = pos + next.length;
|
|
19192
|
-
let
|
|
19193
|
-
if (
|
|
19194
|
-
return
|
|
19211
|
+
let result2 = f(next, pos);
|
|
19212
|
+
if (result2 !== void 0)
|
|
19213
|
+
return result2;
|
|
19195
19214
|
pos = end + next.breakAfter;
|
|
19196
19215
|
}
|
|
19197
19216
|
}
|
|
@@ -20536,7 +20555,7 @@ class DocView {
|
|
|
20536
20555
|
return scan(tile, offset);
|
|
20537
20556
|
}
|
|
20538
20557
|
measureVisibleLineHeights(viewport) {
|
|
20539
|
-
let
|
|
20558
|
+
let result2 = [], { from, to } = viewport;
|
|
20540
20559
|
let contentWidth = this.view.contentDOM.clientWidth;
|
|
20541
20560
|
let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
|
|
20542
20561
|
let widest = -1, ltr = this.view.textDirection == Direction.LTR;
|
|
@@ -20554,8 +20573,8 @@ class DocView {
|
|
|
20554
20573
|
scan(child, pos, childRect);
|
|
20555
20574
|
} else if (pos >= from) {
|
|
20556
20575
|
if (spaceAbove > 0)
|
|
20557
|
-
|
|
20558
|
-
|
|
20576
|
+
result2.push(-spaceAbove);
|
|
20577
|
+
result2.push(height + spaceAbove);
|
|
20559
20578
|
spaceAbove = 0;
|
|
20560
20579
|
if (isWider) {
|
|
20561
20580
|
let last = child.dom.lastChild;
|
|
@@ -20578,7 +20597,7 @@ class DocView {
|
|
|
20578
20597
|
}
|
|
20579
20598
|
};
|
|
20580
20599
|
scan(this.tile, 0, null);
|
|
20581
|
-
return
|
|
20600
|
+
return result2;
|
|
20582
20601
|
}
|
|
20583
20602
|
textDirectionAt(pos) {
|
|
20584
20603
|
let { tile } = this.tile.resolveBlock(pos, 1);
|
|
@@ -21598,16 +21617,16 @@ function findDiff(a, b, preferredPos, preferredSide) {
|
|
|
21598
21617
|
return { from, toA, toB };
|
|
21599
21618
|
}
|
|
21600
21619
|
function selectionPoints(view) {
|
|
21601
|
-
let
|
|
21620
|
+
let result2 = [];
|
|
21602
21621
|
if (view.root.activeElement != view.contentDOM)
|
|
21603
|
-
return
|
|
21622
|
+
return result2;
|
|
21604
21623
|
let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
|
|
21605
21624
|
if (anchorNode) {
|
|
21606
|
-
|
|
21625
|
+
result2.push(new DOMPoint(anchorNode, anchorOffset));
|
|
21607
21626
|
if (focusNode != anchorNode || focusOffset != anchorOffset)
|
|
21608
|
-
|
|
21627
|
+
result2.push(new DOMPoint(focusNode, focusOffset));
|
|
21609
21628
|
}
|
|
21610
|
-
return
|
|
21629
|
+
return result2;
|
|
21611
21630
|
}
|
|
21612
21631
|
function selectionFromPoints(points, base2) {
|
|
21613
21632
|
if (points.length == 0)
|
|
@@ -21770,9 +21789,9 @@ function bindHandler(plugin, handler) {
|
|
|
21770
21789
|
};
|
|
21771
21790
|
}
|
|
21772
21791
|
function computeHandlers(plugins) {
|
|
21773
|
-
let
|
|
21792
|
+
let result2 = /* @__PURE__ */ Object.create(null);
|
|
21774
21793
|
function record2(type2) {
|
|
21775
|
-
return
|
|
21794
|
+
return result2[type2] || (result2[type2] = { observers: [], handlers: [] });
|
|
21776
21795
|
}
|
|
21777
21796
|
for (let plugin of plugins) {
|
|
21778
21797
|
let spec = plugin.spec, handlers2 = spec && spec.plugin.domEventHandlers, observers2 = spec && spec.plugin.domEventObservers;
|
|
@@ -21793,7 +21812,7 @@ function computeHandlers(plugins) {
|
|
|
21793
21812
|
record2(type2).handlers.push(handlers[type2]);
|
|
21794
21813
|
for (let type2 in observers)
|
|
21795
21814
|
record2(type2).observers.push(observers[type2]);
|
|
21796
|
-
return
|
|
21815
|
+
return result2;
|
|
21797
21816
|
}
|
|
21798
21817
|
const PendingKeys = [
|
|
21799
21818
|
{ key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
|
|
@@ -22536,11 +22555,11 @@ class HeightMap {
|
|
|
22536
22555
|
return HeightMap.of(nodes);
|
|
22537
22556
|
}
|
|
22538
22557
|
// Again, these are base cases, and are overridden for branch and gap nodes.
|
|
22539
|
-
decomposeLeft(_to,
|
|
22540
|
-
|
|
22558
|
+
decomposeLeft(_to, result2) {
|
|
22559
|
+
result2.push(this);
|
|
22541
22560
|
}
|
|
22542
|
-
decomposeRight(_from,
|
|
22543
|
-
|
|
22561
|
+
decomposeRight(_from, result2) {
|
|
22562
|
+
result2.push(this);
|
|
22544
22563
|
}
|
|
22545
22564
|
applyChanges(decorations2, oldDoc, oracle, changes) {
|
|
22546
22565
|
let me = this, doc2 = oracle.doc;
|
|
@@ -22783,11 +22802,11 @@ class HeightMapGap extends HeightMap {
|
|
|
22783
22802
|
}
|
|
22784
22803
|
return HeightMap.of(nodes);
|
|
22785
22804
|
}
|
|
22786
|
-
decomposeLeft(to,
|
|
22787
|
-
|
|
22805
|
+
decomposeLeft(to, result2) {
|
|
22806
|
+
result2.push(new HeightMapGap(to - 1), null);
|
|
22788
22807
|
}
|
|
22789
|
-
decomposeRight(from,
|
|
22790
|
-
|
|
22808
|
+
decomposeRight(from, result2) {
|
|
22809
|
+
result2.push(null, new HeightMapGap(this.length - from - 1));
|
|
22791
22810
|
}
|
|
22792
22811
|
updateHeight(oracle, offset = 0, force = false, measured) {
|
|
22793
22812
|
let end = offset + this.length;
|
|
@@ -22815,10 +22834,10 @@ class HeightMapGap extends HeightMap {
|
|
|
22815
22834
|
}
|
|
22816
22835
|
if (pos <= end)
|
|
22817
22836
|
nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
|
|
22818
|
-
let
|
|
22819
|
-
if (singleHeight < 0 || Math.abs(
|
|
22837
|
+
let result2 = HeightMap.of(nodes);
|
|
22838
|
+
if (singleHeight < 0 || Math.abs(result2.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
|
|
22820
22839
|
heightChangeFlag = true;
|
|
22821
|
-
return replace(this,
|
|
22840
|
+
return replace(this, result2);
|
|
22822
22841
|
} else if (force || this.outdated) {
|
|
22823
22842
|
this.setHeight(oracle.heightForGap(offset, offset + this.length));
|
|
22824
22843
|
this.outdated = false;
|
|
@@ -22878,43 +22897,43 @@ class HeightMapBranch extends HeightMap {
|
|
|
22878
22897
|
return this.balanced(this.left.replace(from, to, nodes), this.right);
|
|
22879
22898
|
if (from > this.left.length)
|
|
22880
22899
|
return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));
|
|
22881
|
-
let
|
|
22900
|
+
let result2 = [];
|
|
22882
22901
|
if (from > 0)
|
|
22883
|
-
this.decomposeLeft(from,
|
|
22884
|
-
let left =
|
|
22902
|
+
this.decomposeLeft(from, result2);
|
|
22903
|
+
let left = result2.length;
|
|
22885
22904
|
for (let node of nodes)
|
|
22886
|
-
|
|
22905
|
+
result2.push(node);
|
|
22887
22906
|
if (from > 0)
|
|
22888
|
-
mergeGaps(
|
|
22907
|
+
mergeGaps(result2, left - 1);
|
|
22889
22908
|
if (to < this.length) {
|
|
22890
|
-
let right =
|
|
22891
|
-
this.decomposeRight(to,
|
|
22892
|
-
mergeGaps(
|
|
22909
|
+
let right = result2.length;
|
|
22910
|
+
this.decomposeRight(to, result2);
|
|
22911
|
+
mergeGaps(result2, right);
|
|
22893
22912
|
}
|
|
22894
|
-
return HeightMap.of(
|
|
22913
|
+
return HeightMap.of(result2);
|
|
22895
22914
|
}
|
|
22896
|
-
decomposeLeft(to,
|
|
22915
|
+
decomposeLeft(to, result2) {
|
|
22897
22916
|
let left = this.left.length;
|
|
22898
22917
|
if (to <= left)
|
|
22899
|
-
return this.left.decomposeLeft(to,
|
|
22900
|
-
|
|
22918
|
+
return this.left.decomposeLeft(to, result2);
|
|
22919
|
+
result2.push(this.left);
|
|
22901
22920
|
if (this.break) {
|
|
22902
22921
|
left++;
|
|
22903
22922
|
if (to >= left)
|
|
22904
|
-
|
|
22923
|
+
result2.push(null);
|
|
22905
22924
|
}
|
|
22906
22925
|
if (to > left)
|
|
22907
|
-
this.right.decomposeLeft(to - left,
|
|
22926
|
+
this.right.decomposeLeft(to - left, result2);
|
|
22908
22927
|
}
|
|
22909
|
-
decomposeRight(from,
|
|
22928
|
+
decomposeRight(from, result2) {
|
|
22910
22929
|
let left = this.left.length, right = left + this.break;
|
|
22911
22930
|
if (from >= right)
|
|
22912
|
-
return this.right.decomposeRight(from - right,
|
|
22931
|
+
return this.right.decomposeRight(from - right, result2);
|
|
22913
22932
|
if (from < left)
|
|
22914
|
-
this.left.decomposeRight(from,
|
|
22933
|
+
this.left.decomposeRight(from, result2);
|
|
22915
22934
|
if (this.break && from < right)
|
|
22916
|
-
|
|
22917
|
-
|
|
22935
|
+
result2.push(null);
|
|
22936
|
+
result2.push(this.right);
|
|
22918
22937
|
}
|
|
22919
22938
|
balanced(left, right) {
|
|
22920
22939
|
if (left.size > 2 * right.size || right.size > 2 * left.size)
|
|
@@ -23287,13 +23306,13 @@ class ViewState {
|
|
|
23287
23306
|
let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
|
|
23288
23307
|
this.contentDOMHeight = domRect.height;
|
|
23289
23308
|
this.mustMeasureContent = false;
|
|
23290
|
-
let
|
|
23309
|
+
let result2 = 0, bias = 0;
|
|
23291
23310
|
if (domRect.width && domRect.height) {
|
|
23292
23311
|
let { scaleX, scaleY } = getScale(dom, domRect);
|
|
23293
23312
|
if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
|
|
23294
23313
|
this.scaleX = scaleX;
|
|
23295
23314
|
this.scaleY = scaleY;
|
|
23296
|
-
|
|
23315
|
+
result2 |= 16;
|
|
23297
23316
|
refresh = measureContent = true;
|
|
23298
23317
|
}
|
|
23299
23318
|
}
|
|
@@ -23302,13 +23321,13 @@ class ViewState {
|
|
|
23302
23321
|
if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
|
|
23303
23322
|
this.paddingTop = paddingTop;
|
|
23304
23323
|
this.paddingBottom = paddingBottom;
|
|
23305
|
-
|
|
23324
|
+
result2 |= 16 | 2;
|
|
23306
23325
|
}
|
|
23307
23326
|
if (this.editorWidth != view.scrollDOM.clientWidth) {
|
|
23308
23327
|
if (oracle.lineWrapping)
|
|
23309
23328
|
measureContent = true;
|
|
23310
23329
|
this.editorWidth = view.scrollDOM.clientWidth;
|
|
23311
|
-
|
|
23330
|
+
result2 |= 16;
|
|
23312
23331
|
}
|
|
23313
23332
|
let scrollParent = scrollableParents(this.view.contentDOM, false).y;
|
|
23314
23333
|
if (scrollParent != this.scrollParent) {
|
|
@@ -23337,7 +23356,7 @@ class ViewState {
|
|
|
23337
23356
|
if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
|
|
23338
23357
|
this.contentDOMWidth = domRect.width;
|
|
23339
23358
|
this.editorHeight = view.scrollDOM.clientHeight;
|
|
23340
|
-
|
|
23359
|
+
result2 |= 16;
|
|
23341
23360
|
}
|
|
23342
23361
|
if (measureContent) {
|
|
23343
23362
|
let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
|
|
@@ -23348,7 +23367,7 @@ class ViewState {
|
|
|
23348
23367
|
refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, Math.max(5, contentWidth / charWidth), lineHeights);
|
|
23349
23368
|
if (refresh) {
|
|
23350
23369
|
view.docView.minWidth = 0;
|
|
23351
|
-
|
|
23370
|
+
result2 |= 16;
|
|
23352
23371
|
}
|
|
23353
23372
|
}
|
|
23354
23373
|
if (dTop > 0 && dBottom > 0)
|
|
@@ -23361,25 +23380,25 @@ class ViewState {
|
|
|
23361
23380
|
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
23381
|
}
|
|
23363
23382
|
if (heightChangeFlag)
|
|
23364
|
-
|
|
23383
|
+
result2 |= 2;
|
|
23365
23384
|
}
|
|
23366
23385
|
let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
|
|
23367
23386
|
if (viewportChange) {
|
|
23368
|
-
if (
|
|
23369
|
-
|
|
23387
|
+
if (result2 & 2)
|
|
23388
|
+
result2 |= this.updateScaler();
|
|
23370
23389
|
this.viewport = this.getViewport(bias, this.scrollTarget);
|
|
23371
|
-
|
|
23390
|
+
result2 |= this.updateForViewport();
|
|
23372
23391
|
}
|
|
23373
|
-
if (
|
|
23392
|
+
if (result2 & 2 || viewportChange)
|
|
23374
23393
|
this.updateViewportLines();
|
|
23375
23394
|
if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
|
|
23376
23395
|
this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
|
|
23377
|
-
|
|
23396
|
+
result2 |= this.computeVisibleRanges();
|
|
23378
23397
|
if (this.mustEnforceCursorAssoc) {
|
|
23379
23398
|
this.mustEnforceCursorAssoc = false;
|
|
23380
23399
|
view.docView.enforceCursorAssoc();
|
|
23381
23400
|
}
|
|
23382
|
-
return
|
|
23401
|
+
return result2;
|
|
23383
23402
|
}
|
|
23384
23403
|
get visibleTop() {
|
|
23385
23404
|
return this.scaler.fromDOM(this.pixelViewport.top);
|
|
@@ -25576,10 +25595,10 @@ class EditorView {
|
|
|
25576
25595
|
*/
|
|
25577
25596
|
static theme(spec, options) {
|
|
25578
25597
|
let prefix = StyleModule.newName();
|
|
25579
|
-
let
|
|
25598
|
+
let result2 = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
|
|
25580
25599
|
if (options && options.dark)
|
|
25581
|
-
|
|
25582
|
-
return
|
|
25600
|
+
result2.push(darkTheme.of(true));
|
|
25601
|
+
return result2;
|
|
25583
25602
|
}
|
|
25584
25603
|
/**
|
|
25585
25604
|
Create an extension that adds styles to the base theme. Like
|
|
@@ -25653,13 +25672,13 @@ class CachedOrder {
|
|
|
25653
25672
|
static update(cache2, changes) {
|
|
25654
25673
|
if (changes.empty && !cache2.some((c) => c.fresh))
|
|
25655
25674
|
return cache2;
|
|
25656
|
-
let
|
|
25675
|
+
let result2 = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
|
|
25657
25676
|
for (let i = Math.max(0, cache2.length - 10); i < cache2.length; i++) {
|
|
25658
25677
|
let entry = cache2[i];
|
|
25659
25678
|
if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
|
|
25660
|
-
|
|
25679
|
+
result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
|
|
25661
25680
|
}
|
|
25662
|
-
return
|
|
25681
|
+
return result2;
|
|
25663
25682
|
}
|
|
25664
25683
|
}
|
|
25665
25684
|
function attrsFromFacet(view, facet, base2) {
|
|
@@ -25673,9 +25692,9 @@ function attrsFromFacet(view, facet, base2) {
|
|
|
25673
25692
|
const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
|
|
25674
25693
|
function normalizeKeyName(name2, platform) {
|
|
25675
25694
|
const parts = name2.split(/-(?!$)/);
|
|
25676
|
-
let
|
|
25677
|
-
if (
|
|
25678
|
-
|
|
25695
|
+
let result2 = parts[parts.length - 1];
|
|
25696
|
+
if (result2 == "Space")
|
|
25697
|
+
result2 = " ";
|
|
25679
25698
|
let alt, ctrl, shift2, meta2;
|
|
25680
25699
|
for (let i = 0; i < parts.length - 1; ++i) {
|
|
25681
25700
|
const mod = parts[i];
|
|
@@ -25696,14 +25715,14 @@ function normalizeKeyName(name2, platform) {
|
|
|
25696
25715
|
throw new Error("Unrecognized modifier name: " + mod);
|
|
25697
25716
|
}
|
|
25698
25717
|
if (alt)
|
|
25699
|
-
|
|
25718
|
+
result2 = "Alt-" + result2;
|
|
25700
25719
|
if (ctrl)
|
|
25701
|
-
|
|
25720
|
+
result2 = "Ctrl-" + result2;
|
|
25702
25721
|
if (meta2)
|
|
25703
|
-
|
|
25722
|
+
result2 = "Meta-" + result2;
|
|
25704
25723
|
if (shift2)
|
|
25705
|
-
|
|
25706
|
-
return
|
|
25724
|
+
result2 = "Shift-" + result2;
|
|
25725
|
+
return result2;
|
|
25707
25726
|
}
|
|
25708
25727
|
function modifiers(name2, event, shift2) {
|
|
25709
25728
|
if (event.altKey)
|
|
@@ -26290,16 +26309,16 @@ function matchRanges(view, maxLength) {
|
|
|
26290
26309
|
let visible = view.visibleRanges;
|
|
26291
26310
|
if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
|
|
26292
26311
|
return visible;
|
|
26293
|
-
let
|
|
26312
|
+
let result2 = [];
|
|
26294
26313
|
for (let { from, to } of visible) {
|
|
26295
26314
|
from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
|
|
26296
26315
|
to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
|
|
26297
|
-
if (
|
|
26298
|
-
|
|
26316
|
+
if (result2.length && result2[result2.length - 1].to >= from)
|
|
26317
|
+
result2[result2.length - 1].to = to;
|
|
26299
26318
|
else
|
|
26300
|
-
|
|
26319
|
+
result2.push({ from, to });
|
|
26301
26320
|
}
|
|
26302
|
-
return
|
|
26321
|
+
return result2;
|
|
26303
26322
|
}
|
|
26304
26323
|
class MatchDecorator {
|
|
26305
26324
|
/**
|
|
@@ -27097,10 +27116,10 @@ class HoverPlugin {
|
|
|
27097
27116
|
};
|
|
27098
27117
|
if (open && "then" in open) {
|
|
27099
27118
|
let pending = this.pending = { pos };
|
|
27100
|
-
open.then((
|
|
27119
|
+
open.then((result2) => {
|
|
27101
27120
|
if (this.pending == pending) {
|
|
27102
27121
|
this.pending = null;
|
|
27103
|
-
done(
|
|
27122
|
+
done(result2);
|
|
27104
27123
|
}
|
|
27105
27124
|
}, (e) => logException(view.state, e, "hover tooltip"));
|
|
27106
27125
|
} else {
|
|
@@ -27444,7 +27463,7 @@ const dialogField = /* @__PURE__ */ StateField.define({
|
|
|
27444
27463
|
});
|
|
27445
27464
|
const openDialogEffect = /* @__PURE__ */ StateEffect.define();
|
|
27446
27465
|
const closeDialogEffect = /* @__PURE__ */ StateEffect.define();
|
|
27447
|
-
function createDialog(view, config2,
|
|
27466
|
+
function createDialog(view, config2, result2) {
|
|
27448
27467
|
let content2 = config2.content ? config2.content(view, () => done(null)) : null;
|
|
27449
27468
|
if (!content2) {
|
|
27450
27469
|
content2 = crelt("form");
|
|
@@ -27490,7 +27509,7 @@ function createDialog(view, config2, result) {
|
|
|
27490
27509
|
function done(form) {
|
|
27491
27510
|
if (panel.contains(panel.ownerDocument.activeElement))
|
|
27492
27511
|
view.focus();
|
|
27493
|
-
|
|
27512
|
+
result2(form);
|
|
27494
27513
|
}
|
|
27495
27514
|
return {
|
|
27496
27515
|
dom: panel,
|
|
@@ -27542,10 +27561,10 @@ const unfixGutters = /* @__PURE__ */ Facet.define({
|
|
|
27542
27561
|
combine: (values) => values.some((x) => x)
|
|
27543
27562
|
});
|
|
27544
27563
|
function gutters(config2) {
|
|
27545
|
-
let
|
|
27564
|
+
let result2 = [
|
|
27546
27565
|
gutterView
|
|
27547
27566
|
];
|
|
27548
|
-
return
|
|
27567
|
+
return result2;
|
|
27549
27568
|
}
|
|
27550
27569
|
const gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
27551
27570
|
constructor(view) {
|
|
@@ -27879,12 +27898,12 @@ const lineNumberConfig = /* @__PURE__ */ Facet.define({
|
|
|
27879
27898
|
combine(values) {
|
|
27880
27899
|
return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {
|
|
27881
27900
|
domEventHandlers(a, b) {
|
|
27882
|
-
let
|
|
27901
|
+
let result2 = Object.assign({}, a);
|
|
27883
27902
|
for (let event in b) {
|
|
27884
|
-
let exists =
|
|
27885
|
-
|
|
27903
|
+
let exists = result2[event], add2 = b[event];
|
|
27904
|
+
result2[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
|
|
27886
27905
|
}
|
|
27887
|
-
return
|
|
27906
|
+
return result2;
|
|
27888
27907
|
}
|
|
27889
27908
|
});
|
|
27890
27909
|
}
|
|
@@ -27917,9 +27936,9 @@ const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig
|
|
|
27917
27936
|
},
|
|
27918
27937
|
widgetMarker: (view, widget, block) => {
|
|
27919
27938
|
for (let m of view.state.facet(lineNumberWidgetMarker)) {
|
|
27920
|
-
let
|
|
27921
|
-
if (
|
|
27922
|
-
return
|
|
27939
|
+
let result2 = m(view, widget, block);
|
|
27940
|
+
if (result2)
|
|
27941
|
+
return result2;
|
|
27923
27942
|
}
|
|
27924
27943
|
return null;
|
|
27925
27944
|
},
|
|
@@ -28002,8 +28021,8 @@ class NodeProp {
|
|
|
28002
28021
|
if (typeof match != "function")
|
|
28003
28022
|
match = NodeType.match(match);
|
|
28004
28023
|
return (type2) => {
|
|
28005
|
-
let
|
|
28006
|
-
return
|
|
28024
|
+
let result2 = match(type2);
|
|
28025
|
+
return result2 === void 0 ? null : [this, result2];
|
|
28007
28026
|
};
|
|
28008
28027
|
}
|
|
28009
28028
|
}
|
|
@@ -28321,11 +28340,11 @@ class Tree {
|
|
|
28321
28340
|
constructor.
|
|
28322
28341
|
*/
|
|
28323
28342
|
get propValues() {
|
|
28324
|
-
let
|
|
28343
|
+
let result2 = [];
|
|
28325
28344
|
if (this.props)
|
|
28326
28345
|
for (let id2 in this.props)
|
|
28327
|
-
|
|
28328
|
-
return
|
|
28346
|
+
result2.push([+id2, this.props[id2]]);
|
|
28347
|
+
return result2;
|
|
28329
28348
|
}
|
|
28330
28349
|
/**
|
|
28331
28350
|
Balance the direct children of this tree, producing a copy of
|
|
@@ -28390,30 +28409,30 @@ class TreeBuffer {
|
|
|
28390
28409
|
@internal
|
|
28391
28410
|
*/
|
|
28392
28411
|
toString() {
|
|
28393
|
-
let
|
|
28412
|
+
let result2 = [];
|
|
28394
28413
|
for (let index = 0; index < this.buffer.length; ) {
|
|
28395
|
-
|
|
28414
|
+
result2.push(this.childString(index));
|
|
28396
28415
|
index = this.buffer[index + 3];
|
|
28397
28416
|
}
|
|
28398
|
-
return
|
|
28417
|
+
return result2.join(",");
|
|
28399
28418
|
}
|
|
28400
28419
|
/**
|
|
28401
28420
|
@internal
|
|
28402
28421
|
*/
|
|
28403
28422
|
childString(index) {
|
|
28404
28423
|
let id2 = this.buffer[index], endIndex = this.buffer[index + 3];
|
|
28405
|
-
let type2 = this.set.types[id2],
|
|
28406
|
-
if (/\W/.test(
|
|
28407
|
-
|
|
28424
|
+
let type2 = this.set.types[id2], result2 = type2.name;
|
|
28425
|
+
if (/\W/.test(result2) && !type2.isError)
|
|
28426
|
+
result2 = JSON.stringify(result2);
|
|
28408
28427
|
index += 4;
|
|
28409
28428
|
if (endIndex == index)
|
|
28410
|
-
return
|
|
28429
|
+
return result2;
|
|
28411
28430
|
let children = [];
|
|
28412
28431
|
while (index < endIndex) {
|
|
28413
28432
|
children.push(this.childString(index));
|
|
28414
28433
|
index = this.buffer[index + 3];
|
|
28415
28434
|
}
|
|
28416
|
-
return
|
|
28435
|
+
return result2 + "(" + children.join(",") + ")";
|
|
28417
28436
|
}
|
|
28418
28437
|
/**
|
|
28419
28438
|
@internal
|
|
@@ -28663,22 +28682,22 @@ class TreeNode extends BaseNode {
|
|
|
28663
28682
|
}
|
|
28664
28683
|
}
|
|
28665
28684
|
function getChildren(node, type2, before, after) {
|
|
28666
|
-
let cur2 = node.cursor(),
|
|
28685
|
+
let cur2 = node.cursor(), result2 = [];
|
|
28667
28686
|
if (!cur2.firstChild())
|
|
28668
|
-
return
|
|
28687
|
+
return result2;
|
|
28669
28688
|
if (before != null)
|
|
28670
28689
|
for (let found = false; !found; ) {
|
|
28671
28690
|
found = cur2.type.is(before);
|
|
28672
28691
|
if (!cur2.nextSibling())
|
|
28673
|
-
return
|
|
28692
|
+
return result2;
|
|
28674
28693
|
}
|
|
28675
28694
|
for (; ; ) {
|
|
28676
28695
|
if (after != null && cur2.type.is(after))
|
|
28677
|
-
return
|
|
28696
|
+
return result2;
|
|
28678
28697
|
if (cur2.type.is(type2))
|
|
28679
|
-
|
|
28698
|
+
result2.push(cur2.node);
|
|
28680
28699
|
if (!cur2.nextSibling())
|
|
28681
|
-
return after == null ?
|
|
28700
|
+
return after == null ? result2 : [];
|
|
28682
28701
|
}
|
|
28683
28702
|
}
|
|
28684
28703
|
function matchNodeContext(node, context, i = context.length - 1) {
|
|
@@ -29125,14 +29144,14 @@ class TreeCursor {
|
|
|
29125
29144
|
get node() {
|
|
29126
29145
|
if (!this.buffer)
|
|
29127
29146
|
return this._tree;
|
|
29128
|
-
let cache2 = this.bufferNode,
|
|
29147
|
+
let cache2 = this.bufferNode, result2 = null, depth = 0;
|
|
29129
29148
|
if (cache2 && cache2.context == this.buffer) {
|
|
29130
29149
|
scan: for (let index = this.index, d = this.stack.length; d >= 0; ) {
|
|
29131
29150
|
for (let c = cache2; c; c = c._parent)
|
|
29132
29151
|
if (c.index == index) {
|
|
29133
29152
|
if (index == this.index)
|
|
29134
29153
|
return c;
|
|
29135
|
-
|
|
29154
|
+
result2 = c;
|
|
29136
29155
|
depth = d + 1;
|
|
29137
29156
|
break scan;
|
|
29138
29157
|
}
|
|
@@ -29140,8 +29159,8 @@ class TreeCursor {
|
|
|
29140
29159
|
}
|
|
29141
29160
|
}
|
|
29142
29161
|
for (let i = depth; i < this.stack.length; i++)
|
|
29143
|
-
|
|
29144
|
-
return this.bufferNode = new BufferNode(this.buffer,
|
|
29162
|
+
result2 = new BufferNode(this.buffer, result2, this.stack[i]);
|
|
29163
|
+
return this.bufferNode = new BufferNode(this.buffer, result2, this.index);
|
|
29145
29164
|
}
|
|
29146
29165
|
/**
|
|
29147
29166
|
Get the [tree](#common.Tree) that represents the current node, if
|
|
@@ -29341,13 +29360,13 @@ function buildTree(data) {
|
|
|
29341
29360
|
function findBufferSize(maxSize, inRepeat) {
|
|
29342
29361
|
let fork = cursor.fork();
|
|
29343
29362
|
let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
|
|
29344
|
-
let
|
|
29363
|
+
let result2 = { size: 0, start: 0, skip: 0 };
|
|
29345
29364
|
scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
|
|
29346
29365
|
let nodeSize2 = fork.size;
|
|
29347
29366
|
if (fork.id == inRepeat && nodeSize2 >= 0) {
|
|
29348
|
-
|
|
29349
|
-
|
|
29350
|
-
|
|
29367
|
+
result2.size = size;
|
|
29368
|
+
result2.start = start;
|
|
29369
|
+
result2.skip = skip;
|
|
29351
29370
|
skip += 4;
|
|
29352
29371
|
size += 4;
|
|
29353
29372
|
fork.next();
|
|
@@ -29375,11 +29394,11 @@ function buildTree(data) {
|
|
|
29375
29394
|
skip += localSkipped;
|
|
29376
29395
|
}
|
|
29377
29396
|
if (inRepeat < 0 || size == maxSize) {
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29397
|
+
result2.size = size;
|
|
29398
|
+
result2.start = start;
|
|
29399
|
+
result2.skip = skip;
|
|
29381
29400
|
}
|
|
29382
|
-
return
|
|
29401
|
+
return result2.size > 4 ? result2 : void 0;
|
|
29383
29402
|
}
|
|
29384
29403
|
function copyToBuffer(bufferStart, buffer2, index) {
|
|
29385
29404
|
let { id: id2, start, end, size } = cursor;
|
|
@@ -29547,11 +29566,11 @@ class TreeFragment {
|
|
|
29547
29566
|
true.
|
|
29548
29567
|
*/
|
|
29549
29568
|
static addTree(tree, fragments = [], partial2 = false) {
|
|
29550
|
-
let
|
|
29569
|
+
let result2 = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
|
|
29551
29570
|
for (let f of fragments)
|
|
29552
29571
|
if (f.to > tree.length)
|
|
29553
|
-
|
|
29554
|
-
return
|
|
29572
|
+
result2.push(f);
|
|
29573
|
+
return result2;
|
|
29555
29574
|
}
|
|
29556
29575
|
/**
|
|
29557
29576
|
Apply a set of edits to an array of fragments, removing or
|
|
@@ -29561,7 +29580,7 @@ class TreeFragment {
|
|
|
29561
29580
|
static applyChanges(fragments, changes, minGap = 128) {
|
|
29562
29581
|
if (!changes.length)
|
|
29563
29582
|
return fragments;
|
|
29564
|
-
let
|
|
29583
|
+
let result2 = [];
|
|
29565
29584
|
let fI = 1, nextF = fragments.length ? fragments[0] : null;
|
|
29566
29585
|
for (let cI = 0, pos = 0, off = 0; ; cI++) {
|
|
29567
29586
|
let nextC = cI < changes.length ? changes[cI] : null;
|
|
@@ -29574,7 +29593,7 @@ class TreeFragment {
|
|
|
29574
29593
|
cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
|
|
29575
29594
|
}
|
|
29576
29595
|
if (cut)
|
|
29577
|
-
|
|
29596
|
+
result2.push(cut);
|
|
29578
29597
|
if (nextF.to > nextPos)
|
|
29579
29598
|
break;
|
|
29580
29599
|
nextF = fI < fragments.length ? fragments[fI++] : null;
|
|
@@ -29584,7 +29603,7 @@ class TreeFragment {
|
|
|
29584
29603
|
pos = nextC.toA;
|
|
29585
29604
|
off = nextC.toA - nextC.toB;
|
|
29586
29605
|
}
|
|
29587
|
-
return
|
|
29606
|
+
return result2;
|
|
29588
29607
|
}
|
|
29589
29608
|
}
|
|
29590
29609
|
class Parser {
|
|
@@ -29839,13 +29858,13 @@ function tagHighlighter(tags2, options) {
|
|
|
29839
29858
|
};
|
|
29840
29859
|
}
|
|
29841
29860
|
function highlightTags(highlighters, tags2) {
|
|
29842
|
-
let
|
|
29861
|
+
let result2 = null;
|
|
29843
29862
|
for (let highlighter of highlighters) {
|
|
29844
29863
|
let value = highlighter.style(tags2);
|
|
29845
29864
|
if (value)
|
|
29846
|
-
|
|
29865
|
+
result2 = result2 ? result2 + " " + value : value;
|
|
29847
29866
|
}
|
|
29848
|
-
return
|
|
29867
|
+
return result2;
|
|
29849
29868
|
}
|
|
29850
29869
|
function highlightTree(tree, highlighter, putStyle, from = 0, to = tree.length) {
|
|
29851
29870
|
let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
|
|
@@ -30403,10 +30422,10 @@ class Language {
|
|
|
30403
30422
|
return [{ from: 0, to: state.doc.length }];
|
|
30404
30423
|
if (!lang || !lang.allowsNesting)
|
|
30405
30424
|
return [];
|
|
30406
|
-
let
|
|
30425
|
+
let result2 = [];
|
|
30407
30426
|
let explore = (tree, from) => {
|
|
30408
30427
|
if (tree.prop(languageDataProp) == this.data) {
|
|
30409
|
-
|
|
30428
|
+
result2.push({ from, to: from + tree.length });
|
|
30410
30429
|
return;
|
|
30411
30430
|
}
|
|
30412
30431
|
let mount = tree.prop(NodeProp.mounted);
|
|
@@ -30414,14 +30433,14 @@ class Language {
|
|
|
30414
30433
|
if (mount.tree.prop(languageDataProp) == this.data) {
|
|
30415
30434
|
if (mount.overlay)
|
|
30416
30435
|
for (let r of mount.overlay)
|
|
30417
|
-
|
|
30436
|
+
result2.push({ from: r.from + from, to: r.to + from });
|
|
30418
30437
|
else
|
|
30419
|
-
|
|
30438
|
+
result2.push({ from, to: from + tree.length });
|
|
30420
30439
|
return;
|
|
30421
30440
|
} else if (mount.overlay) {
|
|
30422
|
-
let size =
|
|
30441
|
+
let size = result2.length;
|
|
30423
30442
|
explore(mount.tree, mount.overlay[0].from + from);
|
|
30424
|
-
if (
|
|
30443
|
+
if (result2.length > size)
|
|
30425
30444
|
return;
|
|
30426
30445
|
}
|
|
30427
30446
|
}
|
|
@@ -30432,7 +30451,7 @@ class Language {
|
|
|
30432
30451
|
}
|
|
30433
30452
|
};
|
|
30434
30453
|
explore(syntaxTree(state), 0);
|
|
30435
|
-
return
|
|
30454
|
+
return result2;
|
|
30436
30455
|
}
|
|
30437
30456
|
/**
|
|
30438
30457
|
Indicates whether this language allows nested languages. The
|
|
@@ -30891,25 +30910,25 @@ function getIndentUnit(state) {
|
|
|
30891
30910
|
return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
|
|
30892
30911
|
}
|
|
30893
30912
|
function indentString(state, cols) {
|
|
30894
|
-
let
|
|
30913
|
+
let result2 = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
|
|
30895
30914
|
if (ch == " ") {
|
|
30896
30915
|
while (cols >= ts) {
|
|
30897
|
-
|
|
30916
|
+
result2 += " ";
|
|
30898
30917
|
cols -= ts;
|
|
30899
30918
|
}
|
|
30900
30919
|
ch = " ";
|
|
30901
30920
|
}
|
|
30902
30921
|
for (let i = 0; i < cols; i++)
|
|
30903
|
-
|
|
30904
|
-
return
|
|
30922
|
+
result2 += ch;
|
|
30923
|
+
return result2;
|
|
30905
30924
|
}
|
|
30906
30925
|
function getIndentation(context, pos) {
|
|
30907
30926
|
if (context instanceof EditorState)
|
|
30908
30927
|
context = new IndentContext(context);
|
|
30909
30928
|
for (let service of context.state.facet(indentService)) {
|
|
30910
|
-
let
|
|
30911
|
-
if (
|
|
30912
|
-
return
|
|
30929
|
+
let result2 = service(context, pos);
|
|
30930
|
+
if (result2 !== void 0)
|
|
30931
|
+
return result2;
|
|
30913
30932
|
}
|
|
30914
30933
|
let tree = syntaxTree(context.state);
|
|
30915
30934
|
return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;
|
|
@@ -30959,11 +30978,11 @@ class IndentContext {
|
|
|
30959
30978
|
*/
|
|
30960
30979
|
column(pos, bias = 1) {
|
|
30961
30980
|
let { text, from } = this.lineAt(pos, bias);
|
|
30962
|
-
let
|
|
30981
|
+
let result2 = this.countColumn(text, pos - from);
|
|
30963
30982
|
let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
|
|
30964
30983
|
if (override > -1)
|
|
30965
|
-
|
|
30966
|
-
return
|
|
30984
|
+
result2 += override - this.countColumn(text, text.search(/\S|$/));
|
|
30985
|
+
return result2;
|
|
30967
30986
|
}
|
|
30968
30987
|
/**
|
|
30969
30988
|
Find the column position (taking tabs into account) of the given
|
|
@@ -31841,9 +31860,9 @@ class HistEvent {
|
|
|
31841
31860
|
static fromTransaction(tr, selection) {
|
|
31842
31861
|
let effects = none$1;
|
|
31843
31862
|
for (let invert of tr.startState.facet(invertedEffects)) {
|
|
31844
|
-
let
|
|
31845
|
-
if (
|
|
31846
|
-
effects = effects.concat(
|
|
31863
|
+
let result2 = invert(tr);
|
|
31864
|
+
if (result2.length)
|
|
31865
|
+
effects = effects.concat(result2);
|
|
31847
31866
|
}
|
|
31848
31867
|
if (!effects.length && tr.changes.empty)
|
|
31849
31868
|
return null;
|
|
@@ -31904,9 +31923,9 @@ function addMappingToBranch(branch, mapping) {
|
|
|
31904
31923
|
while (length) {
|
|
31905
31924
|
let event = mapEvent(branch[length - 1], mapping, selections);
|
|
31906
31925
|
if (event.changes && !event.changes.empty || event.effects.length) {
|
|
31907
|
-
let
|
|
31908
|
-
|
|
31909
|
-
return
|
|
31926
|
+
let result2 = branch.slice(0, length);
|
|
31927
|
+
result2[length - 1] = event;
|
|
31928
|
+
return result2;
|
|
31910
31929
|
} else {
|
|
31911
31930
|
mapping = event.mapped;
|
|
31912
31931
|
length--;
|
|
@@ -32922,13 +32941,13 @@ function toCharEnd(text, pos) {
|
|
|
32922
32941
|
const gotoLine = (view) => {
|
|
32923
32942
|
let { state } = view;
|
|
32924
32943
|
let line = String(state.doc.lineAt(view.state.selection.main.head).number);
|
|
32925
|
-
let { close, result } = showDialog(view, {
|
|
32944
|
+
let { close, result: result2 } = showDialog(view, {
|
|
32926
32945
|
label: state.phrase("Go to line"),
|
|
32927
32946
|
input: { type: "text", name: "line", value: line },
|
|
32928
32947
|
focus: true,
|
|
32929
32948
|
submitLabel: state.phrase("go")
|
|
32930
32949
|
});
|
|
32931
|
-
|
|
32950
|
+
result2.then((form) => {
|
|
32932
32951
|
let match = form && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(form.elements["line"].value);
|
|
32933
32952
|
if (!match) {
|
|
32934
32953
|
view.dispatch({ effects: close });
|
|
@@ -33275,16 +33294,16 @@ class RegExpQuery extends QueryType {
|
|
|
33275
33294
|
prevMatch(state, curFrom, curTo) {
|
|
33276
33295
|
return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
|
|
33277
33296
|
}
|
|
33278
|
-
getReplacement(
|
|
33297
|
+
getReplacement(result2) {
|
|
33279
33298
|
return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (m, i) => {
|
|
33280
33299
|
if (i == "&")
|
|
33281
|
-
return
|
|
33300
|
+
return result2.match[0];
|
|
33282
33301
|
if (i == "$")
|
|
33283
33302
|
return "$";
|
|
33284
33303
|
for (let l = i.length; l > 0; l--) {
|
|
33285
33304
|
let n = +i.slice(0, l);
|
|
33286
|
-
if (n > 0 && n <
|
|
33287
|
-
return
|
|
33305
|
+
if (n > 0 && n < result2.match.length)
|
|
33306
|
+
return result2.match[n] + i.slice(l);
|
|
33288
33307
|
}
|
|
33289
33308
|
return m;
|
|
33290
33309
|
});
|
|
@@ -34005,8 +34024,8 @@ class Stack {
|
|
|
34005
34024
|
}
|
|
34006
34025
|
nextStates = best;
|
|
34007
34026
|
}
|
|
34008
|
-
let
|
|
34009
|
-
for (let i = 0; i < nextStates.length &&
|
|
34027
|
+
let result2 = [];
|
|
34028
|
+
for (let i = 0; i < nextStates.length && result2.length < 4; i += 2) {
|
|
34010
34029
|
let s = nextStates[i + 1];
|
|
34011
34030
|
if (s == this.state)
|
|
34012
34031
|
continue;
|
|
@@ -34016,9 +34035,9 @@ class Stack {
|
|
|
34016
34035
|
stack.shiftContext(nextStates[i], this.pos);
|
|
34017
34036
|
stack.reducePos = this.pos;
|
|
34018
34037
|
stack.score -= 200;
|
|
34019
|
-
|
|
34038
|
+
result2.push(stack);
|
|
34020
34039
|
}
|
|
34021
|
-
return
|
|
34040
|
+
return result2;
|
|
34022
34041
|
}
|
|
34023
34042
|
// Force a reduce, if possible. Return false if that can't
|
|
34024
34043
|
// be done.
|
|
@@ -34379,17 +34398,17 @@ class InputStream {
|
|
|
34379
34398
|
units, since the library does not track lookbehind.
|
|
34380
34399
|
*/
|
|
34381
34400
|
peek(offset) {
|
|
34382
|
-
let idx = this.chunkOff + offset, pos,
|
|
34401
|
+
let idx = this.chunkOff + offset, pos, result2;
|
|
34383
34402
|
if (idx >= 0 && idx < this.chunk.length) {
|
|
34384
34403
|
pos = this.pos + offset;
|
|
34385
|
-
|
|
34404
|
+
result2 = this.chunk.charCodeAt(idx);
|
|
34386
34405
|
} else {
|
|
34387
34406
|
let resolved = this.resolveOffset(offset, 1);
|
|
34388
34407
|
if (resolved == null)
|
|
34389
34408
|
return -1;
|
|
34390
34409
|
pos = resolved;
|
|
34391
34410
|
if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
|
|
34392
|
-
|
|
34411
|
+
result2 = this.chunk2.charCodeAt(pos - this.chunk2Pos);
|
|
34393
34412
|
} else {
|
|
34394
34413
|
let i = this.rangeIndex, range = this.range;
|
|
34395
34414
|
while (range.to <= pos)
|
|
@@ -34397,12 +34416,12 @@ class InputStream {
|
|
|
34397
34416
|
this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
|
|
34398
34417
|
if (pos + this.chunk2.length > range.to)
|
|
34399
34418
|
this.chunk2 = this.chunk2.slice(0, range.to - pos);
|
|
34400
|
-
|
|
34419
|
+
result2 = this.chunk2.charCodeAt(0);
|
|
34401
34420
|
}
|
|
34402
34421
|
}
|
|
34403
34422
|
if (pos >= this.token.lookAhead)
|
|
34404
34423
|
this.token.lookAhead = pos + 1;
|
|
34405
|
-
return
|
|
34424
|
+
return result2;
|
|
34406
34425
|
}
|
|
34407
34426
|
/**
|
|
34408
34427
|
Accept a token. By default, the end of the token is set to the
|
|
@@ -34515,14 +34534,14 @@ class InputStream {
|
|
|
34515
34534
|
return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
|
|
34516
34535
|
if (from >= this.range.from && to <= this.range.to)
|
|
34517
34536
|
return this.input.read(from, to);
|
|
34518
|
-
let
|
|
34537
|
+
let result2 = "";
|
|
34519
34538
|
for (let r of this.ranges) {
|
|
34520
34539
|
if (r.from >= to)
|
|
34521
34540
|
break;
|
|
34522
34541
|
if (r.to > from)
|
|
34523
|
-
|
|
34542
|
+
result2 += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
|
|
34524
34543
|
}
|
|
34525
|
-
return
|
|
34544
|
+
return result2;
|
|
34526
34545
|
}
|
|
34527
34546
|
}
|
|
34528
34547
|
class TokenGroup {
|
|
@@ -34805,12 +34824,12 @@ class TokenCache {
|
|
|
34805
34824
|
let { parser: parser2 } = stack.p;
|
|
34806
34825
|
for (let i = 0; i < parser2.specialized.length; i++)
|
|
34807
34826
|
if (parser2.specialized[i] == token.value) {
|
|
34808
|
-
let
|
|
34809
|
-
if (
|
|
34810
|
-
if ((
|
|
34811
|
-
token.value =
|
|
34827
|
+
let result2 = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
|
|
34828
|
+
if (result2 >= 0 && stack.p.parser.dialect.allows(result2 >> 1)) {
|
|
34829
|
+
if ((result2 & 1) == 0)
|
|
34830
|
+
token.value = result2 >> 1;
|
|
34812
34831
|
else
|
|
34813
|
-
token.extended =
|
|
34832
|
+
token.extended = result2 >> 1;
|
|
34814
34833
|
break;
|
|
34815
34834
|
}
|
|
34816
34835
|
}
|
|
@@ -35312,28 +35331,28 @@ class LRParser extends Parser {
|
|
|
35312
35331
|
4
|
|
35313
35332
|
/* ParseState.DefaultReduce */
|
|
35314
35333
|
);
|
|
35315
|
-
let
|
|
35334
|
+
let result2 = deflt ? action(deflt) : void 0;
|
|
35316
35335
|
for (let i = this.stateSlot(
|
|
35317
35336
|
state,
|
|
35318
35337
|
1
|
|
35319
35338
|
/* ParseState.Actions */
|
|
35320
|
-
);
|
|
35339
|
+
); result2 == null; i += 3) {
|
|
35321
35340
|
if (this.data[i] == 65535) {
|
|
35322
35341
|
if (this.data[i + 1] == 1)
|
|
35323
35342
|
i = pair(this.data, i + 2);
|
|
35324
35343
|
else
|
|
35325
35344
|
break;
|
|
35326
35345
|
}
|
|
35327
|
-
|
|
35346
|
+
result2 = action(pair(this.data, i + 1));
|
|
35328
35347
|
}
|
|
35329
|
-
return
|
|
35348
|
+
return result2;
|
|
35330
35349
|
}
|
|
35331
35350
|
/**
|
|
35332
35351
|
Get the states that can follow this one through shift actions or
|
|
35333
35352
|
goto jumps. @internal
|
|
35334
35353
|
*/
|
|
35335
35354
|
nextStates(state) {
|
|
35336
|
-
let
|
|
35355
|
+
let result2 = [];
|
|
35337
35356
|
for (let i = this.stateSlot(
|
|
35338
35357
|
state,
|
|
35339
35358
|
1
|
|
@@ -35347,11 +35366,11 @@ class LRParser extends Parser {
|
|
|
35347
35366
|
}
|
|
35348
35367
|
if ((this.data[i + 2] & 65536 >> 16) == 0) {
|
|
35349
35368
|
let value = this.data[i + 1];
|
|
35350
|
-
if (!
|
|
35351
|
-
|
|
35369
|
+
if (!result2.some((v, i2) => i2 & 1 && v == value))
|
|
35370
|
+
result2.push(this.data[i], value);
|
|
35352
35371
|
}
|
|
35353
35372
|
}
|
|
35354
|
-
return
|
|
35373
|
+
return result2;
|
|
35355
35374
|
}
|
|
35356
35375
|
/**
|
|
35357
35376
|
Configure the parser. Returns a new parser instance that has the
|
|
@@ -35926,17 +35945,17 @@ class FuzzyMatcher {
|
|
|
35926
35945
|
return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
|
|
35927
35946
|
}
|
|
35928
35947
|
result(score2, positions, word) {
|
|
35929
|
-
let
|
|
35948
|
+
let result2 = [], i = 0;
|
|
35930
35949
|
for (let pos of positions) {
|
|
35931
35950
|
let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
|
|
35932
|
-
if (i &&
|
|
35933
|
-
|
|
35951
|
+
if (i && result2[i - 1] == pos)
|
|
35952
|
+
result2[i - 1] = to;
|
|
35934
35953
|
else {
|
|
35935
|
-
|
|
35936
|
-
|
|
35954
|
+
result2[i++] = pos;
|
|
35955
|
+
result2[i++] = to;
|
|
35937
35956
|
}
|
|
35938
35957
|
}
|
|
35939
|
-
return this.ret(score2 - word.length,
|
|
35958
|
+
return this.ret(score2 - word.length, result2);
|
|
35940
35959
|
}
|
|
35941
35960
|
}
|
|
35942
35961
|
class StrictMatcher {
|
|
@@ -36394,17 +36413,17 @@ function sortOptions(active, state) {
|
|
|
36394
36413
|
option.score += sectionOrder[typeof section == "string" ? section : section.name];
|
|
36395
36414
|
}
|
|
36396
36415
|
}
|
|
36397
|
-
let
|
|
36416
|
+
let result2 = [], prev = null;
|
|
36398
36417
|
let compare2 = conf.compareCompletions;
|
|
36399
36418
|
for (let opt of options.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
|
|
36400
36419
|
let cur2 = opt.completion;
|
|
36401
36420
|
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
|
-
|
|
36421
|
+
result2.push(opt);
|
|
36403
36422
|
else if (score(opt.completion) > score(prev))
|
|
36404
|
-
|
|
36423
|
+
result2[result2.length - 1] = opt;
|
|
36405
36424
|
prev = opt.completion;
|
|
36406
36425
|
}
|
|
36407
|
-
return
|
|
36426
|
+
return result2;
|
|
36408
36427
|
}
|
|
36409
36428
|
class CompletionDialog {
|
|
36410
36429
|
constructor(options, attrs, tooltip, timestamp, selected, disabled) {
|
|
@@ -36516,14 +36535,14 @@ const baseAttrs = {
|
|
|
36516
36535
|
};
|
|
36517
36536
|
const noAttrs = {};
|
|
36518
36537
|
function makeAttrs(id2, selected) {
|
|
36519
|
-
let
|
|
36538
|
+
let result2 = {
|
|
36520
36539
|
"aria-autocomplete": "list",
|
|
36521
36540
|
"aria-haspopup": "listbox",
|
|
36522
36541
|
"aria-controls": id2
|
|
36523
36542
|
};
|
|
36524
36543
|
if (selected > -1)
|
|
36525
|
-
|
|
36526
|
-
return
|
|
36544
|
+
result2["aria-activedescendant"] = id2 + "-" + selected;
|
|
36545
|
+
return result2;
|
|
36527
36546
|
}
|
|
36528
36547
|
const none = [];
|
|
36529
36548
|
function getUpdateType(tr, conf) {
|
|
@@ -36590,10 +36609,10 @@ class ActiveSource {
|
|
|
36590
36609
|
}
|
|
36591
36610
|
}
|
|
36592
36611
|
class ActiveResult extends ActiveSource {
|
|
36593
|
-
constructor(source, explicit, limit2,
|
|
36612
|
+
constructor(source, explicit, limit2, result2, from, to) {
|
|
36594
36613
|
super(source, 3, explicit);
|
|
36595
36614
|
this.limit = limit2;
|
|
36596
|
-
this.result =
|
|
36615
|
+
this.result = result2;
|
|
36597
36616
|
this.from = from;
|
|
36598
36617
|
this.to = to;
|
|
36599
36618
|
}
|
|
@@ -36604,29 +36623,29 @@ class ActiveResult extends ActiveSource {
|
|
|
36604
36623
|
var _a2;
|
|
36605
36624
|
if (!(type2 & 3))
|
|
36606
36625
|
return this.map(tr.changes);
|
|
36607
|
-
let
|
|
36608
|
-
if (
|
|
36609
|
-
|
|
36626
|
+
let result2 = this.result;
|
|
36627
|
+
if (result2.map && !tr.changes.empty)
|
|
36628
|
+
result2 = result2.map(result2, tr.changes);
|
|
36610
36629
|
let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
|
|
36611
36630
|
let pos = cur(tr.state);
|
|
36612
|
-
if (pos > to || !
|
|
36631
|
+
if (pos > to || !result2 || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
|
|
36613
36632
|
return new ActiveSource(
|
|
36614
36633
|
this.source,
|
|
36615
36634
|
type2 & 4 ? 1 : 0
|
|
36616
36635
|
/* State.Inactive */
|
|
36617
36636
|
);
|
|
36618
36637
|
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,
|
|
36638
|
+
if (checkValid(result2.validFor, tr.state, from, to))
|
|
36639
|
+
return new ActiveResult(this.source, this.explicit, limit2, result2, from, to);
|
|
36640
|
+
if (result2.update && (result2 = result2.update(result2, from, to, new CompletionContext(tr.state, pos, false))))
|
|
36641
|
+
return new ActiveResult(this.source, this.explicit, limit2, result2, result2.from, (_a2 = result2.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
|
|
36623
36642
|
return new ActiveSource(this.source, 1, this.explicit);
|
|
36624
36643
|
}
|
|
36625
36644
|
map(mapping) {
|
|
36626
36645
|
if (mapping.empty)
|
|
36627
36646
|
return this;
|
|
36628
|
-
let
|
|
36629
|
-
if (!
|
|
36647
|
+
let result2 = this.result.map ? this.result.map(this.result, mapping) : this.result;
|
|
36648
|
+
if (!result2)
|
|
36630
36649
|
return new ActiveSource(
|
|
36631
36650
|
this.source,
|
|
36632
36651
|
0
|
|
@@ -36663,16 +36682,16 @@ const completionState = /* @__PURE__ */ StateField.define({
|
|
|
36663
36682
|
});
|
|
36664
36683
|
function applyCompletion(view, option) {
|
|
36665
36684
|
const apply = option.completion.apply || option.completion.label;
|
|
36666
|
-
let
|
|
36667
|
-
if (!(
|
|
36685
|
+
let result2 = view.state.field(completionState).active.find((a) => a.source == option.source);
|
|
36686
|
+
if (!(result2 instanceof ActiveResult))
|
|
36668
36687
|
return false;
|
|
36669
36688
|
if (typeof apply == "string")
|
|
36670
36689
|
view.dispatch({
|
|
36671
|
-
...insertCompletionText(view.state, apply,
|
|
36690
|
+
...insertCompletionText(view.state, apply, result2.from, result2.to),
|
|
36672
36691
|
annotations: pickedCompletion.of(option.completion)
|
|
36673
36692
|
});
|
|
36674
36693
|
else
|
|
36675
|
-
apply(view, option.completion,
|
|
36694
|
+
apply(view, option.completion, result2.from, result2.to);
|
|
36676
36695
|
return true;
|
|
36677
36696
|
}
|
|
36678
36697
|
const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
|
|
@@ -36794,9 +36813,9 @@ const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
|
36794
36813
|
let context = new CompletionContext(state, pos, active.explicit, this.view);
|
|
36795
36814
|
let pending = new RunningQuery(active, context);
|
|
36796
36815
|
this.running.push(pending);
|
|
36797
|
-
Promise.resolve(active.source(context)).then((
|
|
36816
|
+
Promise.resolve(active.source(context)).then((result2) => {
|
|
36798
36817
|
if (!pending.context.aborted) {
|
|
36799
|
-
pending.done =
|
|
36818
|
+
pending.done = result2 || null;
|
|
36800
36819
|
this.scheduleAccept();
|
|
36801
36820
|
}
|
|
36802
36821
|
}, (err) => {
|
|
@@ -36883,8 +36902,8 @@ const commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView
|
|
|
36883
36902
|
if (!field || !field.open || field.open.disabled || field.open.selected < 0 || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
|
|
36884
36903
|
return false;
|
|
36885
36904
|
let option = field.open.options[field.open.selected];
|
|
36886
|
-
let
|
|
36887
|
-
let commitChars = option.completion.commitCharacters ||
|
|
36905
|
+
let result2 = field.active.find((a) => a.source == option.source);
|
|
36906
|
+
let commitChars = option.completion.commitCharacters || result2.result.commitCharacters;
|
|
36888
36907
|
if (commitChars && commitChars.indexOf(event.key) > -1)
|
|
36889
36908
|
applyCompletion(view, option);
|
|
36890
36909
|
return false;
|
|
@@ -37679,9 +37698,9 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
|
|
|
37679
37698
|
}
|
|
37680
37699
|
function hideTooltip(tr, tooltip) {
|
|
37681
37700
|
let from = tooltip.pos, to = tooltip.end || from;
|
|
37682
|
-
let
|
|
37683
|
-
if (
|
|
37684
|
-
return
|
|
37701
|
+
let result2 = tr.state.facet(lintConfig).hideOn(tr, from, to);
|
|
37702
|
+
if (result2 != null)
|
|
37703
|
+
return result2;
|
|
37685
37704
|
let line = tr.startState.doc.lineAt(tooltip.pos);
|
|
37686
37705
|
return !!(tr.effects.some((e) => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, Math.max(line.to, to)));
|
|
37687
37706
|
}
|
|
@@ -40048,7 +40067,7 @@ class NineDiff extends HTMLElement {
|
|
|
40048
40067
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40049
40068
|
this.shadowRoot.innerHTML = `
|
|
40050
40069
|
<style>
|
|
40051
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40070
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.179"}/dist/css/nine-mu.css";
|
|
40052
40071
|
${customImport}
|
|
40053
40072
|
</style>
|
|
40054
40073
|
|
|
@@ -40158,7 +40177,7 @@ render_fn2 = function() {
|
|
|
40158
40177
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40159
40178
|
this.shadowRoot.innerHTML = `
|
|
40160
40179
|
<style>
|
|
40161
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40180
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.179"}/dist/css/nine-mu.css";
|
|
40162
40181
|
${customImport}
|
|
40163
40182
|
</style>
|
|
40164
40183
|
|
|
@@ -40485,7 +40504,7 @@ class ChatMessageBody extends HTMLElement {
|
|
|
40485
40504
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40486
40505
|
this.shadowRoot.innerHTML = `
|
|
40487
40506
|
<style>
|
|
40488
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40507
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.179"}/dist/css/nine-mu.css";
|
|
40489
40508
|
${customImport}
|
|
40490
40509
|
</style>
|
|
40491
40510
|
|
|
@@ -40579,7 +40598,7 @@ if (!customElements.get("nine-chat-progress")) {
|
|
|
40579
40598
|
customElements.define("nine-chat-progress", ProgressMessage);
|
|
40580
40599
|
}
|
|
40581
40600
|
const NineMu = {
|
|
40582
|
-
version: "0.1.
|
|
40601
|
+
version: "0.1.179",
|
|
40583
40602
|
init: (config2) => {
|
|
40584
40603
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
40585
40604
|
}
|