@a-t-h-i/bot-lobby 0.7.1 → 0.7.3
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/THIRD_PARTY_NOTICES.md +17 -0
- package/package.json +1 -1
- package/prompts/global.md +13 -0
- package/prompts/lobby-chat.md +2 -2
- package/prompts/master.md +8 -8
- package/prompts/planner.md +14 -0
- package/src/classifier/knowledge.ts +22 -3
- package/src/classifier/lobby.ts +4 -3
- package/src/execution/lint-setup.ts +409 -0
- package/src/execution/lint.ts +25 -13
- package/src/execution/verification.ts +65 -13
- package/src/index.ts +3 -0
- package/src/lobby/host.ts +5 -0
- package/src/lobby/keys.ts +1 -0
- package/src/lobby/planner.ts +2 -2
- package/src/lobby/runtime.ts +12 -0
- package/src/lobby/service.ts +23 -0
- package/src/master/master.ts +30 -13
- package/src/pi/commands.ts +23 -2
- package/src/pi/events.ts +3 -1
- package/src/pi/start-task-tool.ts +80 -0
- package/src/pi/tools.ts +1 -1
- package/src/schemas/configuration.ts +14 -1
- package/src/schemas/lint.ts +50 -0
- package/src/text.ts +22 -0
- package/src/webui/api/index.ts +14 -2
- package/src/webui/api/sessions.ts +6 -0
- package/src/webui/api/settings.ts +39 -0
- package/src/webui/dev/fake-service.ts +1 -0
- package/src/webui/protocol.ts +6 -0
- package/src/workflow/workflow.ts +22 -7
- package/webui/dist/apple-touch-icon.png +0 -0
- package/webui/dist/assets/{CodeSurface-Bdkhh84z.js → CodeSurface-CL7RbdNJ.js} +1 -1
- package/webui/dist/assets/{TerminalView-CsDNheS9.js → TerminalView-BrZ9qW_T.js} +1 -1
- package/webui/dist/assets/index-5eWi36H6.js +117 -0
- package/webui/dist/assets/index-Crl5pWLp.css +2 -0
- package/webui/dist/build.json +51 -31
- package/webui/dist/icon-192.png +0 -0
- package/webui/dist/icon-512.png +0 -0
- package/webui/dist/icon-maskable-192.png +0 -0
- package/webui/dist/icon-maskable-512.png +0 -0
- package/webui/dist/index.html +2 -2
- package/webui/dist/licenses/sounds.txt +33 -0
- package/webui/dist/sounds/attention.mp3 +0 -0
- package/webui/dist/sounds/done.mp3 +0 -0
- package/webui/dist/sounds/error.mp3 +0 -0
- package/webui/dist/sounds/question.mp3 +0 -0
- package/webui/dist/sounds/sent.mp3 +0 -0
- package/webui/dist/assets/index-Bt0RLI3l.css +0 -2
- package/webui/dist/assets/index-C3Bn07Vr.js +0 -115
package/src/schemas/lint.ts
CHANGED
|
@@ -53,3 +53,53 @@ export interface LintReport {
|
|
|
53
53
|
/** The touched files as they stood and the settings: an equal key means an equal result. */
|
|
54
54
|
fingerprint: string;
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
// The Settings page's linting wizard (`settings.lintSetup`).
|
|
58
|
+
|
|
59
|
+
export type LintRuleLevel = "off" | "warn" | "error";
|
|
60
|
+
/** A rule's level as the page shows it: `default` is whatever the project's config (or the linter) already says. */
|
|
61
|
+
export type RuleChoice = "default" | LintRuleLevel;
|
|
62
|
+
|
|
63
|
+
export interface LintRuleInfo {
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
help: string;
|
|
67
|
+
level: RuleChoice;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface LintSetupLinter {
|
|
71
|
+
tool: string;
|
|
72
|
+
/** Repository-relative ("" at the top). */
|
|
73
|
+
folder: string;
|
|
74
|
+
installed: boolean;
|
|
75
|
+
/** The file the rules are read from and written to, repository-relative, when there is one. */
|
|
76
|
+
config?: string;
|
|
77
|
+
/** file: switches edit `config`; gate: they are the lint gate's `--rule` flags; read: shown, not switchable (see `note`). */
|
|
78
|
+
rulesAt: "file" | "gate" | "read";
|
|
79
|
+
/** The levels a rule can take: Ruff has no warnings, so its rules are on (error) or off. */
|
|
80
|
+
levels: LintRuleLevel[];
|
|
81
|
+
rules: LintRuleInfo[];
|
|
82
|
+
/** Commands that install it in its folder, when it is not installed. */
|
|
83
|
+
install: string[];
|
|
84
|
+
note?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** A step of setting up a linter the project does not have yet: a command to run, or a starter config the page writes. */
|
|
88
|
+
export interface LintSetupStep {
|
|
89
|
+
label: string;
|
|
90
|
+
command?: string;
|
|
91
|
+
/** The config file the page creates for this step (`ruff.toml`). */
|
|
92
|
+
create?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface LintSetupOffer {
|
|
96
|
+
tool: string;
|
|
97
|
+
blurb: string;
|
|
98
|
+
steps: LintSetupStep[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface LintSetup {
|
|
102
|
+
linters: LintSetupLinter[];
|
|
103
|
+
offers: LintSetupOffer[];
|
|
104
|
+
}
|
|
105
|
+
|
package/src/text.ts
CHANGED
|
@@ -57,6 +57,28 @@ export function shortTitle(request: string, maxWords = 3): string {
|
|
|
57
57
|
return (content.length > 0 ? content : words).slice(0, maxWords).join(" ").replace(/[:;,]+$/, "");
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* A session's name from its first prompt, read like a chat title: the prompt's
|
|
62
|
+
* opening words with polite lead-ins (`can you`, `please`) dropped, at most
|
|
63
|
+
* `maxWords` words and `maxChars` characters, cut between words, first letter
|
|
64
|
+
* capitalised (`Fix the flaky login test`). Empty when the prompt has no words.
|
|
65
|
+
*/
|
|
66
|
+
export function sessionTitle(prompt: string, maxWords = 7, maxChars = 48): string {
|
|
67
|
+
const words = titleText(prompt).split(/\s+/).filter((word) => /[\p{L}\p{N}]/u.test(word));
|
|
68
|
+
let start = 0;
|
|
69
|
+
// Polite lead-ins and leading @mentions (`@Design does…`) are not what the session is about.
|
|
70
|
+
while (start < words.length - 1 && (FILLER_WORDS.has(fillerKey(words[start]!)) || words[start]!.startsWith("@"))) start += 1;
|
|
71
|
+
const kept: string[] = [];
|
|
72
|
+
for (const word of words.slice(start, start + maxWords)) {
|
|
73
|
+
if ([...kept, word].join(" ").length > maxChars && kept.length > 0) break;
|
|
74
|
+
kept.push(word);
|
|
75
|
+
}
|
|
76
|
+
// A title ends on a word that matters, not on `and`, `the` or a comma.
|
|
77
|
+
while (kept.length > 1 && (NAME_CONNECTORS.has(fillerKey(kept.at(-1)!)) || FILLER_WORDS.has(fillerKey(kept.at(-1)!)))) kept.pop();
|
|
78
|
+
const title = kept.join(" ").replace(/[\s:;,.!?…-]+$/u, "").replace(/^[^\p{L}\p{N}]+/u, "");
|
|
79
|
+
return title.charAt(0).toLocaleUpperCase() + title.slice(1);
|
|
80
|
+
}
|
|
81
|
+
|
|
60
82
|
/** Words a task's name leaves out: they join the words that matter without being any of them. */
|
|
61
83
|
const NAME_CONNECTORS = new Set(["and", "or", "but", "with", "without", "on", "in", "at", "of", "by", "from", "into", "so", "as", "is", "are", "be", "it", "its", "that", "this", "then", "also", "just", "some"]);
|
|
62
84
|
|
package/src/webui/api/index.ts
CHANGED
|
@@ -17,8 +17,8 @@ import { plannerAnswer, plannerCommentLine, plannerGet, plannerNew, plannerRetry
|
|
|
17
17
|
import { tasksArchive, tasksArchived, tasksAuto, tasksComment, tasksComments, tasksDelete, tasksEditComment, tasksGet, tasksList, tasksMessage, tasksRestore, tasksOpen, tasksResume, tasksDeliveryReview, tasksDeliveryDefer, tasksDeliver, tasksAccept, tasksSkipStep, tasksForceClose, tasksResolveApproval } from "./tasks.ts";
|
|
18
18
|
import { knowledgeAccept, knowledgeAdd, knowledgeAsk, knowledgeComment, knowledgeDismiss, knowledgeEdit, knowledgeFiles, knowledgeLedger, knowledgeMove, knowledgeOpen, knowledgePin, knowledgeRemove, knowledgeReplaceFile, knowledgeRestore, knowledgeUnnote } from "./knowledge.ts";
|
|
19
19
|
import { plansDiscard, plansGet, plansStart } from "./plans.ts";
|
|
20
|
-
import { sessionsAnswer, sessionsArchive, sessionsChat, sessionsDelete, sessionsList, sessionsMessage, sessionsRename, sessionsStart, sessionsStop, sessionsSwitch } from "./sessions.ts";
|
|
21
|
-
import { settingsGet, settingsGrants, settingsHarnesses, settingsLinters, settingsSet } from "./settings.ts";
|
|
20
|
+
import { sessionsAnswer, sessionsArchive, sessionsChat, sessionsDelete, sessionsList, sessionsMessage, sessionsNew, sessionsRename, sessionsStart, sessionsStop, sessionsSwitch } from "./sessions.ts";
|
|
21
|
+
import { settingsGet, settingsGrants, settingsHarnesses, settingsLintCreate, settingsLinters, settingsLintRule, settingsLintSetup, settingsSet } from "./settings.ts";
|
|
22
22
|
import { lobbyRetention, lobbySetRetention } from "./retention.ts";
|
|
23
23
|
import { terminalClose, terminalInput, terminalList, terminalOpen, terminalResize } from "./terminal.ts";
|
|
24
24
|
import { MAX_INPUT_CHARS } from "../terminal.ts";
|
|
@@ -224,6 +224,7 @@ function buildRoutes(): Record<string, Route> {
|
|
|
224
224
|
schema: Type.Object({ key: Type.Optional(TaskId), sessionId: Type.Optional(TaskId), text: NoticeText, attachments: Attachments }, { additionalProperties: false }),
|
|
225
225
|
run: (body, ctx) => sessionsMessage(body as { key?: string; sessionId?: string; text: string; attachments?: string[] }, ctx),
|
|
226
226
|
};
|
|
227
|
+
routes["sessions.new"] = { schema: Empty, run: (_body, ctx) => sessionsNew(ctx) };
|
|
227
228
|
routes["sessions.switch"] = {
|
|
228
229
|
schema: Type.Object({ key: Type.Optional(TaskId), sessionId: Type.Optional(TaskId), claimTaskId: Type.Optional(TaskId) }, { additionalProperties: false }),
|
|
229
230
|
run: (body, ctx) => sessionsSwitch(body as { key?: string; sessionId?: string; claimTaskId?: string }, ctx),
|
|
@@ -377,6 +378,17 @@ function buildRoutes(): Record<string, Route> {
|
|
|
377
378
|
run: (body, ctx) => settingsSet(body as { patch: Record<string, unknown> }, ctx),
|
|
378
379
|
};
|
|
379
380
|
routes["settings.linters"] = { schema: Empty, run: (_body, ctx) => settingsLinters(ctx) };
|
|
381
|
+
routes["settings.lintSetup"] = { schema: Empty, run: (_body, ctx) => settingsLintSetup(ctx) };
|
|
382
|
+
routes["settings.lintRule"] = {
|
|
383
|
+
schema: Type.Object({
|
|
384
|
+
tool: Type.String({ minLength: 1, maxLength: 40 }),
|
|
385
|
+
folder: Type.String({ maxLength: 4096 }),
|
|
386
|
+
rule: Type.String({ minLength: 1, maxLength: 120 }),
|
|
387
|
+
level: Type.Union([Type.Literal("default"), Type.Literal("off"), Type.Literal("warn"), Type.Literal("error")]),
|
|
388
|
+
}, { additionalProperties: false }),
|
|
389
|
+
run: (body, ctx) => settingsLintRule(body as { tool: string; folder: string; rule: string; level: "default" | "off" | "warn" | "error" }, ctx),
|
|
390
|
+
};
|
|
391
|
+
routes["settings.lintCreate"] = { schema: Type.Object({ name: Type.String({ minLength: 1, maxLength: 60 }) }, { additionalProperties: false }), run: (body, ctx) => settingsLintCreate(body as { name: string }, ctx) };
|
|
380
392
|
routes["settings.grants"] = { schema: Empty, run: (_body, ctx) => settingsGrants(ctx) };
|
|
381
393
|
routes["settings.harnesses"] = { schema: Empty, run: (_body, ctx) => settingsHarnesses(ctx) };
|
|
382
394
|
const ThemeId = Type.String({ minLength: 1, maxLength: 40 });
|
|
@@ -89,6 +89,12 @@ export function sessionsMessage(body: { key?: string; sessionId?: string; text:
|
|
|
89
89
|
return { notice: ctx.service.sendToSession(body.sessionId!, text) };
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/** Open a fresh, empty session in this window; it is named after its first prompt. */
|
|
93
|
+
export function sessionsNew(ctx: ApiContext): { opened: boolean; notice?: string } {
|
|
94
|
+
if (!ctx.service.newSession) fail(501, "unsupported", "this lobby cannot open a new session");
|
|
95
|
+
return ctx.service.newSession!();
|
|
96
|
+
}
|
|
97
|
+
|
|
92
98
|
/** Run a session in this window (stopping its background process first); a window at work carries its own session on in the background. */
|
|
93
99
|
export async function sessionsSwitch(body: { key?: string; sessionId?: string; claimTaskId?: string }, ctx: ApiContext): Promise<{ notice: string }> {
|
|
94
100
|
if (!body.key && !body.sessionId && !body.claimTaskId) fail(400, "bad_request", "a session key, id or task is required");
|
|
@@ -12,6 +12,8 @@ import { kindLabel } from "../../pi/model-support.ts";
|
|
|
12
12
|
import { pushNotice } from "../notices.ts";
|
|
13
13
|
import type { SettingsGrants, SettingsHarnesses, SettingsInfo, SettingsLinter } from "../protocol.ts";
|
|
14
14
|
import { harnessStatuses } from "../../harness/status.ts";
|
|
15
|
+
import { createLintConfig, lintSetup, LintSetupError, setLintRule } from "../../execution/lint-setup.ts";
|
|
16
|
+
import type { LintSetup, RuleChoice } from "../../schemas/lint.ts";
|
|
15
17
|
import type { ApiContext } from "./index.ts";
|
|
16
18
|
import { fail } from "./index.ts";
|
|
17
19
|
|
|
@@ -84,6 +86,43 @@ export function settingsLinters(ctx: ApiContext): { linters: SettingsLinter[] }
|
|
|
84
86
|
return { linters: ctx.service.linters?.() ?? [] };
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
const lintRoot = (ctx: ApiContext) => ctx.service.projectRoot?.() ?? process.cwd();
|
|
90
|
+
|
|
91
|
+
/** The linting wizard: the linters found, their common rules, and how to install or add one. */
|
|
92
|
+
export function settingsLintSetup(ctx: ApiContext): LintSetup {
|
|
93
|
+
return lintSetup(lintRoot(ctx), readConfig(ctx).lint, ctx.service.linters?.());
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Switch one of a linter's common rules: in its config file, or (ESLint) in the gate's own rules. */
|
|
97
|
+
export function settingsLintRule(body: { tool: string; folder: string; rule: string; level: RuleChoice }, ctx: ApiContext): LintSetup {
|
|
98
|
+
const config = readConfig(ctx);
|
|
99
|
+
try {
|
|
100
|
+
const result = setLintRule(lintRoot(ctx), config.lint, body);
|
|
101
|
+
if (result.eslintRules) {
|
|
102
|
+
// Replaced whole, not merged, so a rule set back to the project's default is gone.
|
|
103
|
+
const next = resolveConfig({ ...config, lint: { ...config.lint, eslintRules: result.eslintRules } });
|
|
104
|
+
writeConfig(ctx, next);
|
|
105
|
+
ctx.service.configChanged?.();
|
|
106
|
+
lobbyTopics.bump("status");
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof LintSetupError) fail(409, "conflict", error.message);
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
return settingsLintSetup(ctx);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Write a starter config the wizard offers (ruff.toml). */
|
|
116
|
+
export function settingsLintCreate(body: { name: string }, ctx: ApiContext): LintSetup {
|
|
117
|
+
try {
|
|
118
|
+
createLintConfig(lintRoot(ctx), body.name);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
if (error instanceof LintSetupError) fail(409, "conflict", error.message);
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
return settingsLintSetup(ctx);
|
|
124
|
+
}
|
|
125
|
+
|
|
87
126
|
/** The MCP tools and skills pi offers now, for each agent's grants. */
|
|
88
127
|
export function settingsGrants(ctx: ApiContext): SettingsGrants {
|
|
89
128
|
return ctx.service.grants?.() ?? { mcpTools: [], skills: [] };
|
|
@@ -486,6 +486,7 @@ export function createFixtureService(name: string, feed = new LobbyFeed()): Lobb
|
|
|
486
486
|
planningRounds: () => 5,
|
|
487
487
|
sessionChat: () => [],
|
|
488
488
|
hasOlderChat: () => false,
|
|
489
|
+
newSession: () => (fixture.status.busy ? { opened: true, notice: `${sessionName ?? "this window's session"} carries on in the background` } : { opened: true }),
|
|
489
490
|
switchTo: async (target: { name: string }) => (fixture.status.busy ? `${sessionName ?? "this window's session"} carries on in the background; switching this window to ${target.name}…` : `switching this window to ${target.name}…`),
|
|
490
491
|
} as unknown as LobbyService;
|
|
491
492
|
seedPrompts(service, fixture);
|
package/src/webui/protocol.ts
CHANGED
|
@@ -13,6 +13,8 @@ import type { TaskRow } from "../lobby/task-rows.ts";
|
|
|
13
13
|
import type { PlanComment } from "../state/comments.ts";
|
|
14
14
|
import type { BotLobbyConfig, PanelMember } from "../schemas/configuration.ts";
|
|
15
15
|
import type { QaRiskAssessment } from "../schemas/task.ts";
|
|
16
|
+
import type { LintSetup } from "../schemas/lint.ts";
|
|
17
|
+
export type { LintRuleInfo, LintSetup, LintSetupLinter, LintSetupOffer, LintSetupStep, RuleChoice } from "../schemas/lint.ts";
|
|
16
18
|
import type { MemberState, PanelNote, PanelQuestion, PlannerMessage } from "../lobby/planner.ts";
|
|
17
19
|
import type { HarnessStatus } from "../harness/status.ts";
|
|
18
20
|
import type { HarnessModel } from "../harness/catalog.ts";
|
|
@@ -511,6 +513,7 @@ export interface Api {
|
|
|
511
513
|
"sessions.start": { request: { request?: string; planId?: string; auto?: boolean; attachments?: string[] }; result: { notice: string; key?: string } };
|
|
512
514
|
"sessions.stop": { request: { key: string }; result: { notice: string } };
|
|
513
515
|
"sessions.message": { request: { key?: string; sessionId?: string; text: string; attachments?: string[] }; result: { notice?: string } };
|
|
516
|
+
"sessions.new": { request: Record<string, never>; result: { opened: boolean; notice?: string } };
|
|
514
517
|
"sessions.switch": { request: { key?: string; sessionId?: string; claimTaskId?: string }; result: { notice: string } };
|
|
515
518
|
"sessions.answer": { request: { key: string; dialogId: string; answer: DialogAnswer }; result: { notice: string } };
|
|
516
519
|
"sessions.rename": { request: { key?: string; name: string }; result: { notice: string } };
|
|
@@ -561,6 +564,9 @@ export interface Api {
|
|
|
561
564
|
"settings.get": { request: Record<string, never>; result: SettingsInfo };
|
|
562
565
|
"settings.set": { request: { patch: Record<string, unknown> }; result: { config: BotLobbyConfig } };
|
|
563
566
|
"settings.linters": { request: Record<string, never>; result: { linters: SettingsLinter[] } };
|
|
567
|
+
"settings.lintSetup": { request: Record<string, never>; result: LintSetup };
|
|
568
|
+
"settings.lintRule": { request: { tool: string; folder: string; rule: string; level: "default" | "off" | "warn" | "error" }; result: LintSetup };
|
|
569
|
+
"settings.lintCreate": { request: { name: string }; result: LintSetup };
|
|
564
570
|
"settings.grants": { request: Record<string, never>; result: SettingsGrants };
|
|
565
571
|
"settings.harnesses": { request: Record<string, never>; result: SettingsHarnesses };
|
|
566
572
|
"themes.get": { request: Record<string, never>; result: ThemeStoreInfo };
|
package/src/workflow/workflow.ts
CHANGED
|
@@ -31,8 +31,8 @@ import { loadTask, ownerlessTask, readTaskArtifact, removeTaskScratchpads, saveT
|
|
|
31
31
|
import { dataRoot, readDataRoots } from "../state/project.ts";
|
|
32
32
|
import { appendCompletedTask, appendDecision, applyKnowledge, readFileOr, writeFileEnsured, type KnowledgeKind } from "../knowledge/store.ts";
|
|
33
33
|
import { proposalParts, propose } from "../knowledge/ledger.ts";
|
|
34
|
-
import { compactKnowledgeFile, overThreshold, scheduleKnowledgeMaintenance } from "../knowledge/compactor.ts";
|
|
35
|
-
import { finalChecks, runVerification, verificationSummary } from "../execution/verification.ts";
|
|
34
|
+
import { compactKnowledgeFile, overThreshold, scheduleKnowledgeMaintenance, type MaintenanceSchedule } from "../knowledge/compactor.ts";
|
|
35
|
+
import { finalChecks, runVerification, staleVerification, verificationSummary } from "../execution/verification.ts";
|
|
36
36
|
import { oracleBookmarkOp, retireBookmarks, type OracleBookmarkOp } from "../knowledge/bookmarks.ts";
|
|
37
37
|
import { knowledgeDir, type KnowledgeAgent } from "../knowledge/paths.ts";
|
|
38
38
|
import { lobbyTopics } from "../lobby/topics.ts";
|
|
@@ -1895,6 +1895,17 @@ function handleCompact(task: Task | undefined, params: OrchestrateParams, deps:
|
|
|
1895
1895
|
}
|
|
1896
1896
|
|
|
1897
1897
|
/** §63: record history, drop scratchpads, then mark the task completed. */
|
|
1898
|
+
/** Scheduled knowledge maintenance reports back: a failed or busy run is visible and says what to do, never dropped. */
|
|
1899
|
+
function reportMaintenance(deps: WorkflowDeps, schedule: MaintenanceSchedule): void {
|
|
1900
|
+
void schedule.done.then((result) => {
|
|
1901
|
+
const file = `${result.agent}/${result.file}`;
|
|
1902
|
+
if (result.status === "unchanged") deps.notify(`Knowledge maintenance: ${file} has nothing clearly duplicate or historical to archive, so it stays over the compaction threshold. Rewrite it with action=compact if it should shrink.`, "info");
|
|
1903
|
+
if (result.status === "maintained") deps.notify(`Knowledge maintenance: ${file} archived ${result.before - result.after} characters to ${result.history}.`, "info");
|
|
1904
|
+
else if (result.status === "busy") deps.notify(`Knowledge maintenance: ${file} was already being maintained; it is retried at the next completion.`, "warning");
|
|
1905
|
+
else if (result.status === "failed") deps.notify(`Knowledge maintenance failed for ${file}: ${result.error ?? "unknown error"} Maintenance left the active file as it was; it is retried at the next completion, or rewrite it with action=compact.`, "warning");
|
|
1906
|
+
}).catch(() => undefined);
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1898
1909
|
async function handleComplete(task: Task, params: OrchestrateParams, deps: WorkflowDeps): Promise<string> {
|
|
1899
1910
|
// The fast track (and a plan QA sat out) completes straight from its work; the full workflow from review.
|
|
1900
1911
|
requireState(task, onFastTrack(task) || !qaRequired(task) ? ["implementing", "reviewing", "blocked"] : ["reviewing", "blocked"]);
|
|
@@ -1915,20 +1926,24 @@ async function handleComplete(task: Task, params: OrchestrateParams, deps: Workf
|
|
|
1915
1926
|
// fast tasks included) must pass on the tree as it stands before anything is committed. Recorded
|
|
1916
1927
|
// passes are reused while their inputs are unchanged; missing, stale, failed, cancelled and
|
|
1917
1928
|
// unavailable results are not passes. Heavy checks run here only, never between worker steps.
|
|
1918
|
-
const
|
|
1929
|
+
const checks = finalChecks(deps.cwd);
|
|
1930
|
+
const verification = await runVerification({ top: deps.cwd, checks, previous: task.verification, ...(deps.signal ? { signal: deps.signal } : {}) });
|
|
1919
1931
|
deps.signal?.throwIfAborted();
|
|
1920
1932
|
task.verification = verification;
|
|
1921
1933
|
saveTask(deps.root, deps.configDir, task);
|
|
1922
|
-
appendMetrics(deps.root, deps.configDir, [{ id: randomUUID(), kind: "master", agent: "
|
|
1934
|
+
appendMetrics(deps.root, deps.configDir, [{ id: randomUUID(), kind: "master", agent: "MASTER", status: "success", startedAt: verification.at, durationMs: verification.results.reduce((total, result) => total + result.ms, 0), purpose: `final verification (${verification.results.length} checks)`, cacheHits: verification.results.filter((result) => result.reused).length, ...(task.id ? { taskId: task.id } : {}) }]);
|
|
1923
1935
|
if (verification.state !== "passing") throw new Error(`cannot complete: final verification failed — ${verificationSummary(verification)}. Fix the failing checks and call complete again; unchanged passes are kept.`);
|
|
1924
1936
|
// The gate refuses before any side effect, so a refusal leaves the task untouched. Oversized knowledge no
|
|
1925
1937
|
// longer holds completion: automatic maintenance is scheduled and runs after this response.
|
|
1926
1938
|
const oversized = overThreshold(readDataRoots(deps.root, deps.configDir), deps.config.knowledge.compactionThreshold);
|
|
1927
|
-
for (const entry of oversized) {
|
|
1928
|
-
scheduleKnowledgeMaintenance({ dataRoot: dataRoot(deps.root, deps.configDir), agent: entry.agent, file: entry.file, backupCount: deps.config.knowledge.backupCount });
|
|
1929
|
-
}
|
|
1930
1939
|
const maintenance = oversized.length > 0 ? ` Automatic knowledge maintenance scheduled for ${oversized.map((entry) => `${entry.agent}/${entry.file}`).join(", ")}; it archives duplicate and historical material after this response.` : "";
|
|
1931
1940
|
deps.signal?.throwIfAborted();
|
|
1941
|
+
// An edit made after the checks ran never inherits their success: re-key the passes right before the commit.
|
|
1942
|
+
const stale = staleVerification(deps.cwd, checks, verification);
|
|
1943
|
+
if (stale.length > 0) throw new Error(`cannot complete: ${stale.join(", ")} inputs changed after final verification passed; call complete again to verify the current tree.`);
|
|
1944
|
+
for (const entry of oversized) {
|
|
1945
|
+
reportMaintenance(deps, scheduleKnowledgeMaintenance({ dataRoot: dataRoot(deps.root, deps.configDir), agent: entry.agent, file: entry.file, backupCount: deps.config.knowledge.backupCount }));
|
|
1946
|
+
}
|
|
1932
1947
|
const committed = await commitTaskWork(task, params, deps);
|
|
1933
1948
|
deps.signal?.throwIfAborted();
|
|
1934
1949
|
const summary = params.text?.trim() || task.proposal || task.title;
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/astro-p42oEArs.js","assets/json-qhed-kSA.js","assets/javascript-BgS3c2Ky.js","assets/typescript-BydbNFcO.js","assets/rolldown-runtime-hePW80VL.js","assets/css-C8fQr_0Q.js","assets/postcss-D_Wz94rJ.js","assets/tsx-CUOciP0b.js","assets/graphql-AVu4aKQX.js","assets/jsx-gTgmArGx.js","assets/html-wSbaAAK3.js","assets/java-DdHNQ9hk.js","assets/kts-DFAlwc6n.js","assets/kotlin-DhhofPvG.js","assets/lua-xZcbXUE9.js","assets/c-DaO8xguW.js","assets/php-C6PDnbTe.js","assets/xml-CeXJrFlG.js","assets/sql-CEbI0hMM.js","assets/properties-CxAuzHS9.js","assets/ini-B5eOa1yu.js","assets/ruby-CPL7DL0w.js","assets/shellscript-CLZ0U2zV.js","assets/yaml-rwi0_p6S.js","assets/scss-CHVQqdPx.js","assets/svelte-DKhxH1PN.js","assets/vue-kBwcnTZb.js","assets/yml-s9iVJXCw.js","assets/zsh-B7CDPTg5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u}from"./ccount-DQxSH8e6.js";import{t as d}from"./index-
|
|
2
|
+
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u}from"./ccount-DQxSH8e6.js";import{t as d}from"./index-5eWi36H6.js";var f={}.hasOwnProperty;function p(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&f.call(t,e)){let n=String(t[e]);i=f.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var m=10,h=13,g=4,_=40;function v(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
|
|
3
3
|
`),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
|
|
4
4
|
`,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
|
|
5
5
|
`,o)),t.push(o),++a===g){if(o-i<=_){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===m||r===h)&&(r===h&&n+1<e.length&&e.charCodeAt(n+1)===m&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function y(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===m||r===h)&&(r===h&&n+1<e.length&&e.charCodeAt(n+1)===m&&n++,t++)}return t}function b(e){let t=v(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}var x=100,S=`insert`,C=`backspace`,w=`delete`,T=class e{#e=[];#t=[];#n;#r=!1;constructor(e){this.#n=Math.max(1,e?.maxEntries??x)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}getState(){return{undoStack:this.#e.map(ee),redoStack:this.#t.map(ee),maxEntries:this.#n,canCoalesce:this.#r}}getLiveState(){return Object.defineProperties({},{undoStack:{enumerable:!0,get:()=>this.#e},redoStack:{enumerable:!0,get:()=>this.#t},maxEntries:{enumerable:!0,get:()=>this.#n},canCoalesce:{enumerable:!0,get:()=>this.#r}})}static fromState(t){let n=new e({maxEntries:t.maxEntries});return n.#e=t.undoStack,n.#t=t.redoStack,n.#r=t.canCoalesce,n}clear(){this.#e.length=0,this.#t.length=0,this.#r=!1}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#r=!0,this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#r?this.peekUndo():void 0}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo(),this.#r=!0}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),this.#r=!1,e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),this.#r=!1,e}};function E(e){return{...e,forwardEdits:e.forwardEdits.map(e=>({...e})),inverseEdits:e.inverseEdits.map(e=>({...e})),selectionsBefore:e.selectionsBefore?.map(D),selectionsAfter:e.selectionsAfter?.map(D),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice()}}function ee(e){return{...E(e),lineAnnotationsBefore:e.lineAnnotationsBefore?.map(e=>({...e})),lineAnnotationsAfter:e.lineAnnotationsAfter?.map(e=>({...e}))}}function D(e){return{...e,start:{...e.start},end:{...e.end}}}function O(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[],u;if(i?.length===c.length){let t=[];for(let n of i){if(n.start.line!==n.end.line||n.start.character!==n.end.character)break;t.push(e.offsetAt(n.start))}if(t.length===c.length){t.sort((e,t)=>e-t);let e=!0,n=!0;for(let r=0;r<c.length;r++){let i=c[r];if(i.text.length>0||i.start===i.end){e=!1,n=!1;break}e&&=t[r]===i.end,n&&=t[r]===i.start}u=e?C:n?w:void 0}}for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice(),coalescingMode:u}}function k(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=ne(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n}from"./ccount-DQxSH8e6.js";import{i as r,n as i,r as a}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n}from"./ccount-DQxSH8e6.js";import{i as r,n as i,r as a}from"./index-5eWi36H6.js";var o=e(n(),1),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{for(var i=r>1?void 0:r?c(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&s(t,n,i),i},d=(e,t)=>(n,r)=>t(n,r,e),f=`Terminal input`,p={get:()=>f,set:e=>f=e},m=`Too much output to announce, navigate to rows manually to read`,h={get:()=>m,set:e=>m=e};function g(e){return e.replace(/\r?\n/g,`\r`)}function _(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function ee(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function te(e,t,n,r){e.stopPropagation(),e.clipboardData&&ne(e.clipboardData.getData(`text/plain`),t,n,r)}function ne(e,t,n,r){e=g(e),e=_(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function re(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ie(e,t,n,r,i){re(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ae(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function oe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var se=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ce=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},v=``,le=` `,ue=class e{constructor(){this.fg=0,this.bg=0,this.extended=new de}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},de=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},y=class e extends ue{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new de,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ae(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},fe=`di$target`,pe=`di$dependencies`,me=new Map;function b(e){return e[pe]||[]}function x(e){if(me.has(e))return me.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);he(t,e,r)};return t._id=e,me.set(e,t),t}function he(e,t,n){t[fe]===t?t[pe].push({id:e,index:n}):(t[pe]=[{id:e,index:n}],t[fe]=t)}var S=x(`BufferService`),ge=x(`CoreMouseService`),_e=x(`CoreService`),C=x(`CharsetService`),ve=x(`InstantiationService`),w=x(`LogService`),T=x(`OptionsService`),ye=x(`OscLinkService`),be=x(`UnicodeService`),xe=x(`DecorationService`),Se=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new y,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Ce(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Se=u([d(0,S),d(1,T),d(2,ye)],Se);function Ce(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var we=x(`CharSizeService`),Te=x(`CoreBrowserService`),Ee=x(`MouseService`),De=x(`RenderService`),Oe=x(`SelectionService`),ke=x(`CharacterJoinerService`),Ae=x(`ThemeService`),je=x(`LinkProviderService`),Me=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Re.isErrorNoTelemetry(e)?new Re(e.message+`
|
|
4
4
|
|