chore: clean up lint and scratchpad
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
# send-refactor scratchpad
|
|
||||||
|
|
||||||
- [x] Commit + push current outbound refactor changes
|
|
||||||
- [x] Step 1: centralize outbound target validation
|
|
||||||
- [ ] Step 2: normalize payloads + single delivery call
|
|
||||||
- [ ] Step 3: unify outbound JSON/result formatting
|
|
||||||
- [ ] Cleanup: delete scratchpad, final lint + tests, commit + push
|
|
||||||
@@ -28,8 +28,8 @@ import { registerBrowserCli } from "./browser-cli.js";
|
|||||||
import { registerCanvasCli } from "./canvas-cli.js";
|
import { registerCanvasCli } from "./canvas-cli.js";
|
||||||
import { registerCronCli } from "./cron-cli.js";
|
import { registerCronCli } from "./cron-cli.js";
|
||||||
import { createDefaultDeps } from "./deps.js";
|
import { createDefaultDeps } from "./deps.js";
|
||||||
import { registerDocsCli } from "./docs-cli.js";
|
|
||||||
import { registerDnsCli } from "./dns-cli.js";
|
import { registerDnsCli } from "./dns-cli.js";
|
||||||
|
import { registerDocsCli } from "./docs-cli.js";
|
||||||
import { registerGatewayCli } from "./gateway-cli.js";
|
import { registerGatewayCli } from "./gateway-cli.js";
|
||||||
import { registerHooksCli } from "./hooks-cli.js";
|
import { registerHooksCli } from "./hooks-cli.js";
|
||||||
import { registerModelsCli } from "./models-cli.js";
|
import { registerModelsCli } from "./models-cli.js";
|
||||||
|
|||||||
@@ -818,22 +818,22 @@ export async function runConfigureWizard(
|
|||||||
runtime.error(controlUiAssets.message);
|
runtime.error(controlUiAssets.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
note(
|
note(
|
||||||
(() => {
|
(() => {
|
||||||
const bind = nextConfig.gateway?.bind ?? "loopback";
|
const bind = nextConfig.gateway?.bind ?? "loopback";
|
||||||
const links = resolveControlUiLinks({
|
const links = resolveControlUiLinks({
|
||||||
bind,
|
bind,
|
||||||
port: gatewayPort,
|
port: gatewayPort,
|
||||||
basePath: nextConfig.gateway?.controlUi?.basePath,
|
basePath: nextConfig.gateway?.controlUi?.basePath,
|
||||||
});
|
});
|
||||||
return [
|
return [
|
||||||
`Web UI: ${links.httpUrl}`,
|
`Web UI: ${links.httpUrl}`,
|
||||||
`Gateway WS: ${links.wsUrl}`,
|
`Gateway WS: ${links.wsUrl}`,
|
||||||
"Docs: https://docs.clawd.bot/web/control-ui",
|
"Docs: https://docs.clawd.bot/web/control-ui",
|
||||||
].join("\n");
|
].join("\n");
|
||||||
})(),
|
})(),
|
||||||
"Control UI",
|
"Control UI",
|
||||||
);
|
);
|
||||||
|
|
||||||
const browserSupport = await detectBrowserOpenSupport();
|
const browserSupport = await detectBrowserOpenSupport();
|
||||||
if (!browserSupport.ok) {
|
if (!browserSupport.ok) {
|
||||||
|
|||||||
@@ -94,7 +94,12 @@ function parseSearchOutput(raw: string): DocResult[] {
|
|||||||
const content = extractLine(lines, "Content:");
|
const content = extractLine(lines, "Content:");
|
||||||
const contentIndex = lines.findIndex((line) => line.startsWith("Content:"));
|
const contentIndex = lines.findIndex((line) => line.startsWith("Content:"));
|
||||||
const body =
|
const body =
|
||||||
contentIndex >= 0 ? lines.slice(contentIndex + 1).join("\n").trim() : "";
|
contentIndex >= 0
|
||||||
|
? lines
|
||||||
|
.slice(contentIndex + 1)
|
||||||
|
.join("\n")
|
||||||
|
.trim()
|
||||||
|
: "";
|
||||||
const snippet = normalizeSnippet(content, firstParagraph(body));
|
const snippet = normalizeSnippet(content, firstParagraph(body));
|
||||||
results.push({ title, link, snippet: snippet || undefined });
|
results.push({ title, link, snippet: snippet || undefined });
|
||||||
}
|
}
|
||||||
@@ -102,7 +107,7 @@ function parseSearchOutput(raw: string): DocResult[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeMarkdown(text: string): string {
|
function escapeMarkdown(text: string): string {
|
||||||
return text.replace(/[\[\]()]/g, "\\$&");
|
return text.replace(/[()[\]]/g, "\\$&");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildMarkdown(query: string, results: DocResult[]): string {
|
function buildMarkdown(query: string, results: DocResult[]): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user