min-agent 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +242 -31
- package/dist/agent.js +1233 -485
- package/dist/assistant-stream.js +11 -7
- package/dist/cli/commands/chat.js +10 -0
- package/dist/cli/commands/exec.js +32 -0
- package/dist/cli/commands/history.js +58 -0
- package/dist/cli/commands/index.js +224 -0
- package/dist/cli/commands/init.js +18 -0
- package/dist/cli/commands/mcp.js +173 -0
- package/dist/cli/commands/memory.js +69 -0
- package/dist/cli/commands/models.js +21 -0
- package/dist/cli/commands/permission.js +12 -0
- package/dist/cli/commands/rules.js +33 -0
- package/dist/cli/commands/sandbox.js +13 -0
- package/dist/cli/commands/serve.js +9 -0
- package/dist/cli/commands/setup.js +4 -0
- package/dist/cli/commands/shared.js +16 -0
- package/dist/cli/commands/skills.js +119 -0
- package/dist/cli/commands/update.js +7 -0
- package/dist/cli/commands/write-config.js +30 -0
- package/dist/cli/errors.js +36 -0
- package/dist/cli/exec-prompt.js +26 -0
- package/dist/cli/option-helpers.js +53 -0
- package/dist/cli/program.js +180 -0
- package/dist/cli.js +7 -632
- package/dist/clipboard.js +59 -23
- package/dist/code-mode.js +35 -17
- package/dist/compaction.js +457 -169
- package/dist/config.js +298 -38
- package/dist/confirm.js +105 -9
- package/dist/context-window.js +156 -75
- package/dist/doom-loop.js +268 -26
- package/dist/fetch-timeout.js +152 -0
- package/dist/http-approvals.js +60 -0
- package/dist/http.js +119 -0
- package/dist/instructions.js +72 -33
- package/dist/logger.js +95 -0
- package/dist/markdown.js +35 -50
- package/dist/mcp.js +847 -102
- package/dist/memory.js +128 -45
- package/dist/output.js +42 -31
- package/dist/paste-handler.js +3 -3
- package/dist/permission-cli.js +43 -0
- package/dist/plugins.js +76 -11
- package/dist/pricing.js +119 -0
- package/dist/provider.js +34 -15
- package/dist/question-format.js +60 -0
- package/dist/sandbox-cli.js +82 -0
- package/dist/sandbox.js +403 -0
- package/dist/save-throttle.js +45 -0
- package/dist/serve/common.js +404 -0
- package/dist/serve/routes-chat.js +347 -0
- package/dist/serve/routes-mcp.js +212 -0
- package/dist/serve/routes-memory.js +66 -0
- package/dist/serve/routes-meta.js +205 -0
- package/dist/serve/routes-sessions.js +61 -0
- package/dist/serve/routes-skills.js +70 -0
- package/dist/serve.js +74 -635
- package/dist/sessions.js +197 -15
- package/dist/skills.js +531 -77
- package/dist/synthetic.js +7 -0
- package/dist/title-gen.js +9 -2
- package/dist/token-display.js +36 -0
- package/dist/tool-display.js +178 -0
- package/dist/tool-output.js +53 -46
- package/dist/tools/apply_patch.js +265 -0
- package/dist/tools/atomic-file.js +35 -0
- package/dist/tools/backend.js +61 -0
- package/dist/tools/bash.js +186 -71
- package/dist/tools/code_search.js +13 -6
- package/dist/tools/edit.js +26 -9
- package/dist/tools/explore.js +144 -16
- package/dist/tools/glob.js +7 -3
- package/dist/tools/grep.js +153 -14
- package/dist/tools/index.js +9 -24
- package/dist/tools/question.js +31 -30
- package/dist/tools/read.js +77 -15
- package/dist/tools/search-searxng.js +223 -0
- package/dist/tools/search-serper.js +189 -0
- package/dist/tools/task.js +100 -33
- package/dist/tools/todo.js +178 -67
- package/dist/tools/web_fetch.js +158 -46
- package/dist/tools/web_search.js +217 -29
- package/dist/tools/write.js +34 -11
- package/dist/tui/App.js +89 -6
- package/dist/tui/ConfirmBar.js +57 -4
- package/dist/tui/InputBar.js +504 -44
- package/dist/tui/MessageList.js +674 -20
- package/dist/tui/ModelPicker.js +113 -0
- package/dist/tui/QuestionBar.js +136 -0
- package/dist/tui/SessionPicker.js +79 -0
- package/dist/tui/StatusBar.js +14 -12
- package/dist/tui/agent-runner.js +223 -0
- package/dist/tui/caret-pos.js +177 -0
- package/dist/tui/caret.js +69 -0
- package/dist/tui/click-count.js +13 -0
- package/dist/tui/diff-view.js +61 -0
- package/dist/tui/drag-state.js +49 -0
- package/dist/tui/hydrate.js +129 -0
- package/dist/tui/index.js +189 -31
- package/dist/tui/input-history.js +125 -0
- package/dist/tui/layout.js +88 -0
- package/dist/tui/mouse.js +46 -0
- package/dist/tui/prompt-queue.js +24 -0
- package/dist/tui/selection.js +226 -0
- package/dist/tui/session-switch.js +28 -0
- package/dist/tui/slash-commands.js +106 -0
- package/dist/tui/slash-handler.js +545 -0
- package/dist/tui/text-width.js +113 -0
- package/dist/tui/theme.js +12 -0
- package/dist/tui/token-info.js +7 -0
- package/dist/tui/tool-children.js +19 -0
- package/dist/tui/undo-stack.js +14 -0
- package/dist/tui/use-sgr-mouse.js +29 -0
- package/dist/tui-chat.js +346 -330
- package/dist/updater.js +116 -0
- package/dist/xml-search.js +194 -0
- package/docs/API.md +410 -32
- package/docs/superpowers/plans/2026-08-16-batch1-tui-improvements.md +1510 -0
- package/docs/superpowers/plans/2026-08-16-batch2-cli-tools-api.md +2105 -0
- package/docs/superpowers/plans/2026-08-16-batch3-config-engineering.md +1595 -0
- package/docs/superpowers/plans/2026-08-16-input-caret.md +782 -0
- package/docs/superpowers/plans/2026-08-20-tui-completeness.md +873 -0
- package/docs/superpowers/plans/2026-08-20-unified-tui-default.md +631 -0
- package/docs/superpowers/specs/2026-08-16-batch1-tui-improvements-design.md +183 -0
- package/docs/superpowers/specs/2026-08-16-batch2-cli-tools-api-design.md +220 -0
- package/docs/superpowers/specs/2026-08-16-batch3-config-engineering-design.md +196 -0
- package/docs/superpowers/specs/2026-08-16-input-caret-design.md +63 -0
- package/docs/superpowers/specs/2026-08-17-mouse-selection-design.md +116 -0
- package/docs/superpowers/specs/2026-08-20-config-http-alignment-design.md +47 -0
- package/docs/superpowers/specs/2026-08-20-mcp-plugins-alignment-design.md +37 -0
- package/docs/superpowers/specs/2026-08-20-sandbox-permissions-design.md +68 -0
- package/docs/superpowers/specs/2026-08-20-tui-completeness-design.md +273 -0
- package/docs/superpowers/specs/2026-08-20-unified-tui-default-design.md +165 -0
- package/package.json +12 -8
- package/skills/self-config/SKILL.md +90 -0
- package/skills/self-config/reference.md +149 -0
package/dist/updater.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { readFileSync } from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { spawnSync } from "child_process";
|
|
5
|
+
export const UPDATE_PACKAGE = "min-agent";
|
|
6
|
+
export const NPM_LATEST_URL = `https://registry.npmjs.org/${UPDATE_PACKAGE}/latest`;
|
|
7
|
+
export const UPDATE_NPM_BIN = "npm";
|
|
8
|
+
export const UPDATE_NPM_ARGS = ["install", "-g", UPDATE_PACKAGE];
|
|
9
|
+
const VERSION_RE = /^\d+\.\d+\.\d+/;
|
|
10
|
+
const FETCH_TIMEOUT_MS = 10_000;
|
|
11
|
+
export function updateInstallCommand() {
|
|
12
|
+
return [UPDATE_NPM_BIN, ...UPDATE_NPM_ARGS].join(" ");
|
|
13
|
+
}
|
|
14
|
+
export function localVersion() {
|
|
15
|
+
try {
|
|
16
|
+
const pkgPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
17
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
18
|
+
return typeof pkg.version === "string" && pkg.version.length > 0 ? pkg.version : "0.0.0";
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return "0.0.0";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function compareVersions(a, b) {
|
|
25
|
+
const pa = a.split("-")[0].split(".").map(Number);
|
|
26
|
+
const pb = b.split("-")[0].split(".").map(Number);
|
|
27
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
28
|
+
const va = pa[i] ?? 0;
|
|
29
|
+
const vb = pb[i] ?? 0;
|
|
30
|
+
const na = Number.isFinite(va) ? va : 0;
|
|
31
|
+
const nb = Number.isFinite(vb) ? vb : 0;
|
|
32
|
+
if (na !== nb)
|
|
33
|
+
return na - nb;
|
|
34
|
+
}
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
function parseVersion(value) {
|
|
38
|
+
if (typeof value !== "string" || !VERSION_RE.test(value))
|
|
39
|
+
return null;
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
export async function fetchLatestVersion(fetchFn = fetch) {
|
|
43
|
+
let response;
|
|
44
|
+
try {
|
|
45
|
+
response = await fetchFn(NPM_LATEST_URL, {
|
|
46
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
47
|
+
headers: { Accept: "application/json" },
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (!response.ok)
|
|
54
|
+
return null;
|
|
55
|
+
let data;
|
|
56
|
+
try {
|
|
57
|
+
data = await response.json();
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (!data || typeof data !== "object" || !("version" in data))
|
|
63
|
+
return null;
|
|
64
|
+
return parseVersion(data.version);
|
|
65
|
+
}
|
|
66
|
+
export async function checkForUpdate(opts) {
|
|
67
|
+
const current = opts?.currentVersion ?? localVersion();
|
|
68
|
+
const latest = await fetchLatestVersion(opts?.fetchFn);
|
|
69
|
+
return {
|
|
70
|
+
current,
|
|
71
|
+
latest,
|
|
72
|
+
updateAvailable: latest !== null && compareVersions(current, latest) < 0,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function installLatest() {
|
|
76
|
+
const result = spawnSync(UPDATE_NPM_BIN, [...UPDATE_NPM_ARGS], {
|
|
77
|
+
stdio: "inherit",
|
|
78
|
+
shell: process.platform === "win32",
|
|
79
|
+
env: process.env,
|
|
80
|
+
});
|
|
81
|
+
if (result.error) {
|
|
82
|
+
const code = result.error.code;
|
|
83
|
+
return { ok: false, missing: code === "ENOENT" };
|
|
84
|
+
}
|
|
85
|
+
return { ok: result.status === 0 };
|
|
86
|
+
}
|
|
87
|
+
export async function runUpdate(io = {}) {
|
|
88
|
+
const log = io.log ?? ((msg) => console.log(msg));
|
|
89
|
+
const error = io.error ?? ((msg) => console.error(msg));
|
|
90
|
+
const current = io.currentVersion?.() ?? localVersion();
|
|
91
|
+
const cmd = updateInstallCommand();
|
|
92
|
+
log(`当前版本: ${current}`);
|
|
93
|
+
const latest = io.fetchLatest ? await io.fetchLatest() : await fetchLatestVersion();
|
|
94
|
+
if (!latest) {
|
|
95
|
+
error(`无法检查新版本(网络不可用)。请稍后重试,或手动执行: ${cmd}`);
|
|
96
|
+
return { status: "check-failed", current, latest: null };
|
|
97
|
+
}
|
|
98
|
+
if (compareVersions(current, latest) >= 0) {
|
|
99
|
+
log(`已是最新版本 (${latest})`);
|
|
100
|
+
return { status: "up-to-date", current, latest };
|
|
101
|
+
}
|
|
102
|
+
log(`发现新版本: ${latest}`);
|
|
103
|
+
log(`正在执行 ${cmd} ...`);
|
|
104
|
+
const installed = (io.install ?? installLatest)();
|
|
105
|
+
if (!installed.ok) {
|
|
106
|
+
if (installed.missing) {
|
|
107
|
+
error(`未找到 npm。请先安装 Node.js,然后执行: ${cmd}`);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
error(`自动升级失败。请手动执行: ${cmd}`);
|
|
111
|
+
}
|
|
112
|
+
return { status: "install-failed", current, latest };
|
|
113
|
+
}
|
|
114
|
+
log(`✓ 已升级到 ${latest}`);
|
|
115
|
+
return { status: "updated", current, latest };
|
|
116
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Some OpenAI-compatible gateways (and a few models) dump built-in web search
|
|
3
|
+
* into the assistant text as <web_search>…</web_search> instead of a tool call,
|
|
4
|
+
* then stop. This module splits those blocks out of the stream so the agent can
|
|
5
|
+
* turn them into search_web tool results and keep going.
|
|
6
|
+
*/
|
|
7
|
+
const OPEN_NAME = "<web_search";
|
|
8
|
+
const CLOSE_NAME = "</web_search";
|
|
9
|
+
const PARTIAL_TAG_HOLD = 80;
|
|
10
|
+
const UNCLOSED_MAX = 64 * 1024;
|
|
11
|
+
function collapse(s) {
|
|
12
|
+
return s.replace(/\s+/g, " ").trim();
|
|
13
|
+
}
|
|
14
|
+
function isNameBoundary(ch) {
|
|
15
|
+
return ch === undefined || ch === ">" || ch === "/" || ch === " " || ch === "\t" || ch === "\n" || ch === "\r";
|
|
16
|
+
}
|
|
17
|
+
function findOpen(buf) {
|
|
18
|
+
const l = buf.toLowerCase();
|
|
19
|
+
let from = 0;
|
|
20
|
+
while (from < l.length) {
|
|
21
|
+
const index = l.indexOf(OPEN_NAME, from);
|
|
22
|
+
if (index < 0)
|
|
23
|
+
return null;
|
|
24
|
+
if (!isNameBoundary(l[index + OPEN_NAME.length])) {
|
|
25
|
+
from = index + 1;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const gt = buf.indexOf(">", index);
|
|
29
|
+
if (gt < 0)
|
|
30
|
+
return null;
|
|
31
|
+
return { index, openLen: gt - index + 1, raw: buf.slice(index, gt + 1) };
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function findClose(buf, from) {
|
|
36
|
+
const l = buf.toLowerCase();
|
|
37
|
+
let start = from;
|
|
38
|
+
while (start < l.length) {
|
|
39
|
+
const index = l.indexOf(CLOSE_NAME, start);
|
|
40
|
+
if (index < 0)
|
|
41
|
+
return null;
|
|
42
|
+
if (!isNameBoundary(l[index + CLOSE_NAME.length])) {
|
|
43
|
+
start = index + 1;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const gt = buf.indexOf(">", index);
|
|
47
|
+
if (gt < 0)
|
|
48
|
+
return null;
|
|
49
|
+
return { innerEnd: index, tagEnd: gt + 1 };
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function queryFromOpenTag(raw) {
|
|
54
|
+
const m = /\bquery\s*=\s*"([^"]*)"/i.exec(raw) ?? /\bquery\s*=\s*'([^']*)'/i.exec(raw);
|
|
55
|
+
return m?.[1]?.trim() ?? "";
|
|
56
|
+
}
|
|
57
|
+
const RESULTS_HEADER = /^Search results for\s+"([^"]*)"\s*:/im;
|
|
58
|
+
export function classifyXmlSearchBody(inner, attrQuery = "") {
|
|
59
|
+
const trimmed = inner.trim();
|
|
60
|
+
if (!trimmed) {
|
|
61
|
+
const query = attrQuery.trim();
|
|
62
|
+
return query ? { kind: "invoke", query } : { kind: "results", query: "", body: "" };
|
|
63
|
+
}
|
|
64
|
+
const header = RESULTS_HEADER.exec(trimmed);
|
|
65
|
+
if (header) {
|
|
66
|
+
return { kind: "results", query: header[1].trim() || attrQuery, body: trimmed };
|
|
67
|
+
}
|
|
68
|
+
if (/^\d+\.\s+Title\s*:/m.test(trimmed) && /\bURL\s*:/m.test(trimmed)) {
|
|
69
|
+
return { kind: "results", query: attrQuery, body: trimmed };
|
|
70
|
+
}
|
|
71
|
+
const query = collapse(trimmed) || attrQuery;
|
|
72
|
+
if (query && query.length <= 500 && !/\bURL\s*:\s*https?:\/\//i.test(trimmed)) {
|
|
73
|
+
return { kind: "invoke", query };
|
|
74
|
+
}
|
|
75
|
+
return { kind: "results", query: attrQuery || query, body: trimmed };
|
|
76
|
+
}
|
|
77
|
+
function lastPotentialPartialOpen(buf) {
|
|
78
|
+
const start = Math.max(0, buf.length - PARTIAL_TAG_HOLD);
|
|
79
|
+
const tail = buf.slice(start);
|
|
80
|
+
const lt = tail.lastIndexOf("<");
|
|
81
|
+
if (lt < 0)
|
|
82
|
+
return -1;
|
|
83
|
+
const globalLt = start + lt;
|
|
84
|
+
const cand = buf.slice(globalLt).toLowerCase();
|
|
85
|
+
if (cand.length > 72)
|
|
86
|
+
return -1;
|
|
87
|
+
if (OPEN_NAME.startsWith(cand) || CLOSE_NAME.startsWith(cand))
|
|
88
|
+
return globalLt;
|
|
89
|
+
if (cand.startsWith(OPEN_NAME) && !cand.includes(">"))
|
|
90
|
+
return globalLt;
|
|
91
|
+
if (cand.startsWith(CLOSE_NAME) && !cand.includes(">"))
|
|
92
|
+
return globalLt;
|
|
93
|
+
return -1;
|
|
94
|
+
}
|
|
95
|
+
export class XmlSearchSplitter {
|
|
96
|
+
buf = "";
|
|
97
|
+
feed(chunk) {
|
|
98
|
+
this.buf += chunk;
|
|
99
|
+
return this.drain(false);
|
|
100
|
+
}
|
|
101
|
+
flush() {
|
|
102
|
+
return this.drain(true);
|
|
103
|
+
}
|
|
104
|
+
drain(isFinal) {
|
|
105
|
+
const out = [];
|
|
106
|
+
let hadBlock = false;
|
|
107
|
+
const pushDisplay = (text) => {
|
|
108
|
+
if (!text)
|
|
109
|
+
return;
|
|
110
|
+
const last = out[out.length - 1];
|
|
111
|
+
if (last?.type === "display")
|
|
112
|
+
last.text += text;
|
|
113
|
+
else
|
|
114
|
+
out.push({ type: "display", text });
|
|
115
|
+
};
|
|
116
|
+
while (this.buf.length > 0) {
|
|
117
|
+
const open = findOpen(this.buf);
|
|
118
|
+
if (!open) {
|
|
119
|
+
if (isFinal) {
|
|
120
|
+
pushDisplay(this.buf);
|
|
121
|
+
this.buf = "";
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const holdFrom = lastPotentialPartialOpen(this.buf);
|
|
125
|
+
if (holdFrom >= 0) {
|
|
126
|
+
pushDisplay(this.buf.slice(0, holdFrom));
|
|
127
|
+
this.buf = this.buf.slice(holdFrom);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
pushDisplay(this.buf);
|
|
131
|
+
this.buf = "";
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
if (open.index > 0) {
|
|
137
|
+
let pre = this.buf.slice(0, open.index);
|
|
138
|
+
pre = pre.replace(/\n+$/, "");
|
|
139
|
+
if (pre)
|
|
140
|
+
pushDisplay(pre);
|
|
141
|
+
this.buf = this.buf.slice(open.index);
|
|
142
|
+
}
|
|
143
|
+
const close = findClose(this.buf, open.openLen);
|
|
144
|
+
if (!close) {
|
|
145
|
+
const innerLen = this.buf.length - open.openLen;
|
|
146
|
+
if (isFinal || innerLen > UNCLOSED_MAX) {
|
|
147
|
+
const inner = this.buf.slice(open.openLen);
|
|
148
|
+
out.push({ type: "search", block: classifyXmlSearchBody(inner, queryFromOpenTag(open.raw)) });
|
|
149
|
+
hadBlock = true;
|
|
150
|
+
this.buf = "";
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
const inner = this.buf.slice(open.openLen, close.innerEnd);
|
|
155
|
+
out.push({ type: "search", block: classifyXmlSearchBody(inner, queryFromOpenTag(open.raw)) });
|
|
156
|
+
hadBlock = true;
|
|
157
|
+
this.buf = this.buf.slice(close.tagEnd).replace(/^\n+/, "");
|
|
158
|
+
}
|
|
159
|
+
if (hadBlock) {
|
|
160
|
+
const first = out[0];
|
|
161
|
+
if (first?.type === "display")
|
|
162
|
+
first.text = first.text.replace(/^\n+/, "");
|
|
163
|
+
}
|
|
164
|
+
return out.filter((sl) => sl.type === "search" || sl.text.length > 0);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export function extractXmlSearch(text) {
|
|
168
|
+
const splitter = new XmlSearchSplitter();
|
|
169
|
+
const slices = [...splitter.feed(text), ...splitter.flush()];
|
|
170
|
+
let display = "";
|
|
171
|
+
const blocks = [];
|
|
172
|
+
for (const sl of slices) {
|
|
173
|
+
if (sl.type === "display")
|
|
174
|
+
display += sl.text;
|
|
175
|
+
else
|
|
176
|
+
blocks.push(sl.block);
|
|
177
|
+
}
|
|
178
|
+
return { display, blocks, slices };
|
|
179
|
+
}
|
|
180
|
+
/** Drop the XML wrappers but keep the inner query/results, for sub-agent returns. */
|
|
181
|
+
export function unwrapXmlSearchTags(text) {
|
|
182
|
+
const { slices } = extractXmlSearch(text);
|
|
183
|
+
if (slices.every((sl) => sl.type === "display"))
|
|
184
|
+
return text;
|
|
185
|
+
return slices
|
|
186
|
+
.map((sl) => {
|
|
187
|
+
if (sl.type === "display")
|
|
188
|
+
return sl.text;
|
|
189
|
+
return sl.block.kind === "results" ? sl.block.body : sl.block.query;
|
|
190
|
+
})
|
|
191
|
+
.join("")
|
|
192
|
+
.replace(/^\n+/, "")
|
|
193
|
+
.replace(/\n+$/, "");
|
|
194
|
+
}
|