@pellux/goodvibes-agent 1.4.1 → 1.4.2
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/CHANGELOG.md +10 -0
- package/README.md +0 -1
- package/dist/package/main.js +462 -2626
- package/docs/README.md +0 -1
- package/docs/tools-and-commands.md +0 -3
- package/package.json +1 -1
- package/release/release-notes.md +7 -15
- package/src/input/agent-workspace-categories.ts +3 -20
- package/src/input/commands.ts +0 -4
- package/src/input/handler.ts +4 -1
- package/src/main.ts +1 -40
- package/src/panels/builtin/agent.ts +0 -28
- package/src/renderer/agent-workspace.ts +11 -5
- package/src/renderer/help-overlay.ts +0 -2
- package/src/version.ts +1 -1
- package/docs/project-planning.md +0 -81
- package/src/input/commands/planning-runtime.ts +0 -215
- package/src/input/commands/work-plan-runtime.ts +0 -191
- package/src/panels/plan-dashboard-panel.ts +0 -274
- package/src/panels/project-planning-panel.ts +0 -721
- package/src/panels/work-plan-panel.ts +0 -175
- package/src/planning/project-planning-coordinator.ts +0 -543
package/dist/package/main.js
CHANGED
|
@@ -817034,7 +817034,7 @@ var createStyledCell = (char, overrides = {}) => ({
|
|
|
817034
817034
|
// src/version.ts
|
|
817035
817035
|
import { readFileSync } from "fs";
|
|
817036
817036
|
import { join } from "path";
|
|
817037
|
-
var _version = "1.4.
|
|
817037
|
+
var _version = "1.4.2";
|
|
817038
817038
|
try {
|
|
817039
817039
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
|
|
817040
817040
|
_version = typeof pkg.version === "string" ? pkg.version : _version;
|
|
@@ -869441,12 +869441,6 @@ function requireWebhookNotifier(context) {
|
|
|
869441
869441
|
function requireSessionMemoryStore(context) {
|
|
869442
869442
|
return requireContextValue(context.session.sessionMemoryStore, "session.sessionMemoryStore");
|
|
869443
869443
|
}
|
|
869444
|
-
function requireSessionLineageTracker(context) {
|
|
869445
|
-
return requireContextValue(context.session.sessionLineageTracker, "session.sessionLineageTracker");
|
|
869446
|
-
}
|
|
869447
|
-
function requirePlanManager(context) {
|
|
869448
|
-
return requireContextValue(context.ops.planManager, "ops.planManager");
|
|
869449
|
-
}
|
|
869450
869444
|
function requireSessionOrchestration(context) {
|
|
869451
869445
|
return requireContextValue(context.ops.sessionOrchestration, "ops.sessionOrchestration");
|
|
869452
869446
|
}
|
|
@@ -870095,13 +870089,13 @@ init_state3();
|
|
|
870095
870089
|
|
|
870096
870090
|
// src/input/commands/recall-shared.ts
|
|
870097
870091
|
var VALID_CLASSES = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
|
|
870098
|
-
var
|
|
870092
|
+
var VALID_SCOPES = ["session", "project", "team"];
|
|
870099
870093
|
var VALID_REVIEW_STATES = ["fresh", "reviewed", "stale", "contradicted"];
|
|
870100
870094
|
function isValidClass(s4) {
|
|
870101
870095
|
return VALID_CLASSES.includes(s4);
|
|
870102
870096
|
}
|
|
870103
870097
|
function isValidScope(s4) {
|
|
870104
|
-
return
|
|
870098
|
+
return VALID_SCOPES.includes(s4);
|
|
870105
870099
|
}
|
|
870106
870100
|
function isValidReviewState(s4) {
|
|
870107
870101
|
return VALID_REVIEW_STATES.includes(s4);
|
|
@@ -870144,7 +870138,7 @@ function handleRecallSearch(args2, context) {
|
|
|
870144
870138
|
if (isValidScope(scope))
|
|
870145
870139
|
filter.scope = scope;
|
|
870146
870140
|
else {
|
|
870147
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
870141
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
|
|
870148
870142
|
return;
|
|
870149
870143
|
}
|
|
870150
870144
|
}
|
|
@@ -870319,7 +870313,7 @@ function handleRecallList(args2, context) {
|
|
|
870319
870313
|
if (scopeIdx !== -1 && args2[scopeIdx + 1]) {
|
|
870320
870314
|
const scope = args2[scopeIdx + 1];
|
|
870321
870315
|
if (!isValidScope(scope)) {
|
|
870322
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
870316
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
|
|
870323
870317
|
return;
|
|
870324
870318
|
}
|
|
870325
870319
|
filter.scope = scope;
|
|
@@ -870369,7 +870363,7 @@ async function handleRecallAdd(args2, context) {
|
|
|
870369
870363
|
const tags = tagsRaw ? tagsRaw.split(",").map((token) => token.trim()).filter(Boolean) : [];
|
|
870370
870364
|
const scope = scopeRaw && isValidScope(scopeRaw) ? scopeRaw : "project";
|
|
870371
870365
|
if (scopeRaw && !isValidScope(scopeRaw)) {
|
|
870372
|
-
context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${
|
|
870366
|
+
context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES.join(", ")}.`);
|
|
870373
870367
|
return;
|
|
870374
870368
|
}
|
|
870375
870369
|
const provenance = [];
|
|
@@ -870503,7 +870497,7 @@ function handleRecallExport(args2, context) {
|
|
|
870503
870497
|
if (scopeIdx !== -1 && commandArgs[scopeIdx + 1]) {
|
|
870504
870498
|
const scope = commandArgs[scopeIdx + 1];
|
|
870505
870499
|
if (!isValidScope(scope)) {
|
|
870506
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
870500
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
|
|
870507
870501
|
return;
|
|
870508
870502
|
}
|
|
870509
870503
|
filter.scope = scope;
|
|
@@ -870582,7 +870576,7 @@ function handleRecallHandoffExport(args2, context) {
|
|
|
870582
870576
|
const scopeIdx = commandArgs.indexOf("--scope");
|
|
870583
870577
|
const scopeRaw = scopeIdx !== -1 ? commandArgs[scopeIdx + 1] : "team";
|
|
870584
870578
|
if (!scopeRaw || !isValidScope(scopeRaw)) {
|
|
870585
|
-
context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${
|
|
870579
|
+
context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES.join(", ")}.`);
|
|
870586
870580
|
return;
|
|
870587
870581
|
}
|
|
870588
870582
|
const bundle = memory.exportBundle({ scope: scopeRaw });
|
|
@@ -870698,7 +870692,7 @@ function handleRecallPromote(args2, context) {
|
|
|
870698
870692
|
const id = parsed.rest[0];
|
|
870699
870693
|
const scope = parsed.rest[1];
|
|
870700
870694
|
if (!id || !scope || !isValidScope(scope)) {
|
|
870701
|
-
context.print(`[memory] Usage: /memory promote <id> <${
|
|
870695
|
+
context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES.join("|")}> --yes`);
|
|
870702
870696
|
return;
|
|
870703
870697
|
}
|
|
870704
870698
|
if (!parsed.yes) {
|
|
@@ -871988,193 +871982,6 @@ function registerConfigCommand(registry5) {
|
|
|
871988
871982
|
});
|
|
871989
871983
|
}
|
|
871990
871984
|
|
|
871991
|
-
// src/input/commands/planning-runtime.ts
|
|
871992
|
-
function recordNextQuestion(state3, question) {
|
|
871993
|
-
if (!question)
|
|
871994
|
-
return state3;
|
|
871995
|
-
const answered = new Set((state3.answeredQuestions ?? []).map((entry) => entry.id));
|
|
871996
|
-
if (answered.has(question.id))
|
|
871997
|
-
return state3;
|
|
871998
|
-
const openQuestions = [...state3.openQuestions ?? []];
|
|
871999
|
-
const existingIndex = openQuestions.findIndex((entry) => entry.id === question.id);
|
|
872000
|
-
const normalized = { ...question, status: question.status ?? "open" };
|
|
872001
|
-
if (existingIndex >= 0)
|
|
872002
|
-
openQuestions[existingIndex] = normalized;
|
|
872003
|
-
else
|
|
872004
|
-
openQuestions.unshift(normalized);
|
|
872005
|
-
return { ...state3, openQuestions };
|
|
872006
|
-
}
|
|
872007
|
-
async function persistEvaluatedNextQuestion(service, projectId, state3, evaluation) {
|
|
872008
|
-
if (!evaluation.nextQuestion)
|
|
872009
|
-
return { state: state3, evaluation };
|
|
872010
|
-
if (state3.openQuestions.some((question) => question.id === evaluation.nextQuestion?.id)) {
|
|
872011
|
-
return { state: state3, evaluation };
|
|
872012
|
-
}
|
|
872013
|
-
const withQuestion = recordNextQuestion(evaluation.state ?? state3, evaluation.nextQuestion);
|
|
872014
|
-
const saved = await service.upsertState({ projectId, state: withQuestion });
|
|
872015
|
-
const nextState = saved.state ?? state3;
|
|
872016
|
-
const nextEvaluation = await service.evaluate({ projectId, state: nextState });
|
|
872017
|
-
return { state: nextState, evaluation: nextEvaluation };
|
|
872018
|
-
}
|
|
872019
|
-
function formatNextQuestion(question) {
|
|
872020
|
-
if (!question)
|
|
872021
|
-
return "No next question recorded.";
|
|
872022
|
-
const lines = [`Next question: ${question.prompt}`];
|
|
872023
|
-
if (question.recommendedAnswer)
|
|
872024
|
-
lines.push(`Recommended answer: ${question.recommendedAnswer}`);
|
|
872025
|
-
lines.push("Answer in the main prompt or review planning state with /plan status.");
|
|
872026
|
-
return lines.join(`
|
|
872027
|
-
`);
|
|
872028
|
-
}
|
|
872029
|
-
function registerPlanningRuntimeCommands(registry5) {
|
|
872030
|
-
registry5.register({
|
|
872031
|
-
name: "plan",
|
|
872032
|
-
description: "Inspect or seed Agent workspace planning state",
|
|
872033
|
-
usage: "[approve --yes | list | show <id> | mode | explain | override <strategy> --yes | status | clear --yes | <planning goal>]",
|
|
872034
|
-
argsHint: "[approve|status|list|<goal>]",
|
|
872035
|
-
async handler(args2, ctx) {
|
|
872036
|
-
const planManager = requirePlanManager(ctx);
|
|
872037
|
-
const sessionLineageTracker = requireSessionLineageTracker(ctx);
|
|
872038
|
-
const plannerSubs = ["mode", "explain", "override", "status", "clear"];
|
|
872039
|
-
if (args2.length > 0 && plannerSubs.includes(args2[0].toLowerCase())) {
|
|
872040
|
-
const parsed = stripYesFlag(args2);
|
|
872041
|
-
const subcommand = parsed.rest[0]?.toLowerCase() ?? "";
|
|
872042
|
-
if ((subcommand === "override" || subcommand === "clear") && !parsed.yes) {
|
|
872043
|
-
requireYesFlag(ctx, `${subcommand} planner state`, `/plan ${subcommand}${subcommand === "override" ? " <strategy>" : ""} --yes`);
|
|
872044
|
-
return;
|
|
872045
|
-
}
|
|
872046
|
-
const result3 = ctx.ops.planRuntime ? ctx.ops.planRuntime(parsed.rest[0] ?? args2[0], parsed.rest.slice(1)) : { ok: false, output: "Plan runtime route is not available in this runtime." };
|
|
872047
|
-
ctx.print(result3.output);
|
|
872048
|
-
return;
|
|
872049
|
-
}
|
|
872050
|
-
const projectPlanningService = ctx.workspace.projectPlanningService;
|
|
872051
|
-
const projectId = ctx.workspace.projectPlanningProjectId;
|
|
872052
|
-
if (args2.length === 0) {
|
|
872053
|
-
if (projectPlanningService && projectId) {
|
|
872054
|
-
const [status3, stateResult] = await Promise.all([
|
|
872055
|
-
projectPlanningService.status({ projectId }),
|
|
872056
|
-
projectPlanningService.getState({ projectId })
|
|
872057
|
-
]);
|
|
872058
|
-
const initialEvaluation2 = await projectPlanningService.evaluate({
|
|
872059
|
-
projectId,
|
|
872060
|
-
...stateResult.state ? { state: stateResult.state } : {}
|
|
872061
|
-
});
|
|
872062
|
-
const { evaluation: evaluation2 } = stateResult.state ? await persistEvaluatedNextQuestion(projectPlanningService, projectId, stateResult.state, initialEvaluation2) : { evaluation: initialEvaluation2 };
|
|
872063
|
-
const planningNamespace = String(status3[["knowledge", "SpaceId"].join("")] ?? `project:${status3.projectId}`);
|
|
872064
|
-
ctx.print(`Project planning: ${evaluation2.readiness}
|
|
872065
|
-
` + `Project: ${status3.projectId}
|
|
872066
|
-
` + `Planning namespace: ${planningNamespace}
|
|
872067
|
-
` + `Artifacts: ${status3.counts.states} state, ${status3.counts.decisions} decisions, ${status3.counts.languageArtifacts} language
|
|
872068
|
-
` + formatNextQuestion(evaluation2.nextQuestion));
|
|
872069
|
-
return;
|
|
872070
|
-
}
|
|
872071
|
-
const active = planManager.getActive(ctx.session.runtime.sessionId);
|
|
872072
|
-
if (!active) {
|
|
872073
|
-
ctx.print("No active execution plan.");
|
|
872074
|
-
return;
|
|
872075
|
-
}
|
|
872076
|
-
const summary = planManager.getSummary(active);
|
|
872077
|
-
ctx.print(`Active plan: "${active.title}" [${active.status.toUpperCase()}]
|
|
872078
|
-
${summary}`);
|
|
872079
|
-
return;
|
|
872080
|
-
}
|
|
872081
|
-
if (args2[0] === "panel") {
|
|
872082
|
-
ctx.print("Use /plan status or /plan list for compact command output. Open Agent Workspace -> Work -> Planning status or Saved plans for the workspace view.");
|
|
872083
|
-
return;
|
|
872084
|
-
}
|
|
872085
|
-
if (args2[0] === "approve") {
|
|
872086
|
-
const parsed = stripYesFlag(args2);
|
|
872087
|
-
if (!parsed.yes) {
|
|
872088
|
-
requireYesFlag(ctx, "approve project planning state for execution", "/plan approve --yes");
|
|
872089
|
-
return;
|
|
872090
|
-
}
|
|
872091
|
-
if (!projectPlanningService || !projectId) {
|
|
872092
|
-
ctx.print("Project planning service is not available in this runtime.");
|
|
872093
|
-
return;
|
|
872094
|
-
}
|
|
872095
|
-
const current = await projectPlanningService.getState({ projectId });
|
|
872096
|
-
if (!current.state) {
|
|
872097
|
-
ctx.print("No project planning state exists to approve.");
|
|
872098
|
-
return;
|
|
872099
|
-
}
|
|
872100
|
-
const result3 = await projectPlanningService.upsertState({
|
|
872101
|
-
projectId,
|
|
872102
|
-
state: {
|
|
872103
|
-
...current.state,
|
|
872104
|
-
executionApproved: true,
|
|
872105
|
-
metadata: {
|
|
872106
|
-
...current.state.metadata ?? {},
|
|
872107
|
-
approvedFrom: "plan-command",
|
|
872108
|
-
approvedAt: Date.now()
|
|
872109
|
-
}
|
|
872110
|
-
}
|
|
872111
|
-
});
|
|
872112
|
-
const evaluation2 = await projectPlanningService.evaluate({ projectId });
|
|
872113
|
-
ctx.print(`Project planning approved. Readiness: ${evaluation2.readiness}. State: ${result3.state?.id ?? "current"}.`);
|
|
872114
|
-
return;
|
|
872115
|
-
}
|
|
872116
|
-
if (args2[0] === "list") {
|
|
872117
|
-
const plans = planManager.list();
|
|
872118
|
-
if (plans.length === 0) {
|
|
872119
|
-
ctx.print("No plans found.");
|
|
872120
|
-
return;
|
|
872121
|
-
}
|
|
872122
|
-
ctx.print(`Plans (${plans.length}):
|
|
872123
|
-
${plans.map((plan) => {
|
|
872124
|
-
const marker = plan.status === "active" ? "\u25B6" : " ";
|
|
872125
|
-
return ` ${marker} ${plan.id.slice(0, 8)} [${plan.status.padEnd(8)}] ${plan.title}`;
|
|
872126
|
-
}).join(`
|
|
872127
|
-
`)}`);
|
|
872128
|
-
return;
|
|
872129
|
-
}
|
|
872130
|
-
if (args2[0] === "show") {
|
|
872131
|
-
const id = args2[1];
|
|
872132
|
-
if (!id) {
|
|
872133
|
-
ctx.print("Usage: /plan show <plan-id>");
|
|
872134
|
-
return;
|
|
872135
|
-
}
|
|
872136
|
-
const plans = planManager.list();
|
|
872137
|
-
const plan = plans.find((entry) => entry.id === id || entry.id.startsWith(id));
|
|
872138
|
-
if (!plan) {
|
|
872139
|
-
ctx.print(`Plan not found: ${id}`);
|
|
872140
|
-
return;
|
|
872141
|
-
}
|
|
872142
|
-
ctx.print(planManager.toMarkdown(plan));
|
|
872143
|
-
return;
|
|
872144
|
-
}
|
|
872145
|
-
const taskDescription = args2.join(" ");
|
|
872146
|
-
if (!projectPlanningService || !projectId) {
|
|
872147
|
-
ctx.print("Project planning service is not available in this runtime.");
|
|
872148
|
-
return;
|
|
872149
|
-
}
|
|
872150
|
-
const result2 = await projectPlanningService.upsertState({
|
|
872151
|
-
projectId,
|
|
872152
|
-
state: {
|
|
872153
|
-
goal: taskDescription,
|
|
872154
|
-
knownContext: [
|
|
872155
|
-
`Workspace planning was seeded from the Agent /plan command.`
|
|
872156
|
-
],
|
|
872157
|
-
metadata: {
|
|
872158
|
-
active: true,
|
|
872159
|
-
owner: "agent",
|
|
872160
|
-
source: "plan-command",
|
|
872161
|
-
lastPromptAt: Date.now()
|
|
872162
|
-
}
|
|
872163
|
-
}
|
|
872164
|
-
});
|
|
872165
|
-
const initialEvaluation = await projectPlanningService.evaluate({
|
|
872166
|
-
projectId,
|
|
872167
|
-
...result2.state ? { state: result2.state } : {}
|
|
872168
|
-
});
|
|
872169
|
-
const { state: state3, evaluation } = result2.state ? await persistEvaluatedNextQuestion(projectPlanningService, projectId, result2.state, initialEvaluation) : { state: result2.state, evaluation: initialEvaluation };
|
|
872170
|
-
sessionLineageTracker.setOriginalTask(taskDescription.slice(0, 200));
|
|
872171
|
-
ctx.print(`Project planning seeded: "${state3?.goal ?? taskDescription}"
|
|
872172
|
-
` + `Readiness: ${evaluation.readiness}
|
|
872173
|
-
` + formatNextQuestion(evaluation.nextQuestion));
|
|
872174
|
-
}
|
|
872175
|
-
});
|
|
872176
|
-
}
|
|
872177
|
-
|
|
872178
871985
|
// src/input/commands/schedule-runtime.ts
|
|
872179
871986
|
init_automation2();
|
|
872180
871987
|
|
|
@@ -878060,196 +877867,6 @@ function registerTtsRuntimeCommands(registry5) {
|
|
|
878060
877867
|
});
|
|
878061
877868
|
}
|
|
878062
877869
|
|
|
878063
|
-
// src/input/commands/work-plan-runtime.ts
|
|
878064
|
-
var STATUS_COMMANDS = {
|
|
878065
|
-
pending: "pending",
|
|
878066
|
-
todo: "pending",
|
|
878067
|
-
start: "in_progress",
|
|
878068
|
-
active: "in_progress",
|
|
878069
|
-
progress: "in_progress",
|
|
878070
|
-
block: "blocked",
|
|
878071
|
-
blocked: "blocked",
|
|
878072
|
-
done: "done",
|
|
878073
|
-
complete: "done",
|
|
878074
|
-
fail: "failed",
|
|
878075
|
-
failed: "failed",
|
|
878076
|
-
cancel: "cancelled",
|
|
878077
|
-
cancelled: "cancelled"
|
|
878078
|
-
};
|
|
878079
|
-
function getStore(ctx) {
|
|
878080
|
-
return ctx.workspace.workPlanStore ?? null;
|
|
878081
|
-
}
|
|
878082
|
-
function formatList4(store) {
|
|
878083
|
-
const items = store.listItems();
|
|
878084
|
-
if (items.length === 0) {
|
|
878085
|
-
return [
|
|
878086
|
-
"Work plan is empty",
|
|
878087
|
-
" next /workplan add <title>"
|
|
878088
|
-
].join(`
|
|
878089
|
-
`);
|
|
878090
|
-
}
|
|
878091
|
-
return [
|
|
878092
|
-
`Work Plan (${items.length})`,
|
|
878093
|
-
...items.map((item) => {
|
|
878094
|
-
const owner = item.owner ? ` @${item.owner}` : "";
|
|
878095
|
-
return ` ${item.id} ${item.status.padEnd(11)} ${item.title}${owner}`;
|
|
878096
|
-
})
|
|
878097
|
-
].join(`
|
|
878098
|
-
`);
|
|
878099
|
-
}
|
|
878100
|
-
function parseAddArgs(args2) {
|
|
878101
|
-
const titleParts = [];
|
|
878102
|
-
let owner;
|
|
878103
|
-
let source;
|
|
878104
|
-
let notes;
|
|
878105
|
-
for (let i5 = 0;i5 < args2.length; i5++) {
|
|
878106
|
-
const part = args2[i5] ?? "";
|
|
878107
|
-
if (part === "--owner" && args2[i5 + 1]) {
|
|
878108
|
-
owner = args2[++i5];
|
|
878109
|
-
continue;
|
|
878110
|
-
}
|
|
878111
|
-
if (part === "--source" && args2[i5 + 1]) {
|
|
878112
|
-
source = args2[++i5];
|
|
878113
|
-
continue;
|
|
878114
|
-
}
|
|
878115
|
-
if (part === "--notes" && args2[i5 + 1]) {
|
|
878116
|
-
notes = args2.slice(i5 + 1).join(" ").trim();
|
|
878117
|
-
break;
|
|
878118
|
-
}
|
|
878119
|
-
titleParts.push(part);
|
|
878120
|
-
}
|
|
878121
|
-
return {
|
|
878122
|
-
title: titleParts.join(" ").trim(),
|
|
878123
|
-
...owner ? { owner } : {},
|
|
878124
|
-
...source ? { source } : {},
|
|
878125
|
-
...notes ? { notes } : {}
|
|
878126
|
-
};
|
|
878127
|
-
}
|
|
878128
|
-
function registerWorkPlanRuntimeCommands(registry5) {
|
|
878129
|
-
registry5.register({
|
|
878130
|
-
name: "workplan",
|
|
878131
|
-
aliases: ["wp", "todo"],
|
|
878132
|
-
description: "Track a persistent workspace-scoped work plan",
|
|
878133
|
-
usage: "[list|show|add <title> [--owner name] [--source label] [--notes text]|done <id>|start <id>|block <id>|fail <id>|cancel <id>|pending <id>|remove <id> --yes|clear-done --yes]",
|
|
878134
|
-
argsHint: "[list|add|show|done]",
|
|
878135
|
-
handler(args2, ctx) {
|
|
878136
|
-
const parsed = stripYesFlag(args2);
|
|
878137
|
-
const commandArgs = [...parsed.rest];
|
|
878138
|
-
const store = getStore(ctx);
|
|
878139
|
-
if (!store) {
|
|
878140
|
-
ctx.print("Work plan store is not available in this runtime.");
|
|
878141
|
-
return;
|
|
878142
|
-
}
|
|
878143
|
-
const subcommand = (commandArgs[0] ?? "list").toLowerCase();
|
|
878144
|
-
try {
|
|
878145
|
-
if (subcommand === "panel" || subcommand === "open") {
|
|
878146
|
-
ctx.print("Open Agent Workspace -> Work -> Work plan for the workspace view, or run /workplan list for compact command output.");
|
|
878147
|
-
return;
|
|
878148
|
-
}
|
|
878149
|
-
if (subcommand === "list") {
|
|
878150
|
-
ctx.print(formatList4(store));
|
|
878151
|
-
return;
|
|
878152
|
-
}
|
|
878153
|
-
if (subcommand === "show" || subcommand === "markdown") {
|
|
878154
|
-
ctx.print(store.toMarkdown());
|
|
878155
|
-
return;
|
|
878156
|
-
}
|
|
878157
|
-
if (subcommand === "add") {
|
|
878158
|
-
const addArgs = parseAddArgs(commandArgs.slice(1));
|
|
878159
|
-
if (!addArgs.title) {
|
|
878160
|
-
ctx.print("Usage: /workplan add <title> [--owner name] [--source label] [--notes text]");
|
|
878161
|
-
return;
|
|
878162
|
-
}
|
|
878163
|
-
const addOptions = {
|
|
878164
|
-
...addArgs.owner ? { owner: addArgs.owner } : {},
|
|
878165
|
-
source: addArgs.source ?? "manual",
|
|
878166
|
-
...addArgs.notes ? { notes: addArgs.notes } : {}
|
|
878167
|
-
};
|
|
878168
|
-
const item = store.addItem(addArgs.title, addOptions);
|
|
878169
|
-
ctx.print([
|
|
878170
|
-
"Added work plan item",
|
|
878171
|
-
` id ${item.id}`,
|
|
878172
|
-
` title ${item.title}`,
|
|
878173
|
-
" next open Agent Workspace -> Work -> Work plan to review"
|
|
878174
|
-
].join(`
|
|
878175
|
-
`));
|
|
878176
|
-
return;
|
|
878177
|
-
}
|
|
878178
|
-
if (subcommand === "remove" || subcommand === "delete" || subcommand === "rm") {
|
|
878179
|
-
const id = commandArgs[1];
|
|
878180
|
-
if (!id) {
|
|
878181
|
-
ctx.print(`Usage: /workplan ${subcommand} <id> --yes`);
|
|
878182
|
-
return;
|
|
878183
|
-
}
|
|
878184
|
-
if (!parsed.yes) {
|
|
878185
|
-
requireYesFlag(ctx, `remove work plan item ${id}`, `/workplan ${subcommand} <id> --yes`);
|
|
878186
|
-
return;
|
|
878187
|
-
}
|
|
878188
|
-
const item = store.removeItem(id);
|
|
878189
|
-
ctx.print([
|
|
878190
|
-
"Removed work plan item",
|
|
878191
|
-
` id ${item.id}`,
|
|
878192
|
-
` title ${item.title}`
|
|
878193
|
-
].join(`
|
|
878194
|
-
`));
|
|
878195
|
-
return;
|
|
878196
|
-
}
|
|
878197
|
-
if (subcommand === "clear-done" || subcommand === "clear-completed") {
|
|
878198
|
-
if (!parsed.yes) {
|
|
878199
|
-
requireYesFlag(ctx, "clear completed work plan items", `/workplan ${subcommand} --yes`);
|
|
878200
|
-
return;
|
|
878201
|
-
}
|
|
878202
|
-
const count = store.clearCompleted();
|
|
878203
|
-
ctx.print([
|
|
878204
|
-
"Cleared completed/cancelled work plan items",
|
|
878205
|
-
` count ${count}`
|
|
878206
|
-
].join(`
|
|
878207
|
-
`));
|
|
878208
|
-
return;
|
|
878209
|
-
}
|
|
878210
|
-
if (subcommand === "cycle" || subcommand === "toggle") {
|
|
878211
|
-
const id = commandArgs[1];
|
|
878212
|
-
if (!id) {
|
|
878213
|
-
ctx.print(`Usage: /workplan ${subcommand} <id>`);
|
|
878214
|
-
return;
|
|
878215
|
-
}
|
|
878216
|
-
const item = store.cycleItemStatus(id);
|
|
878217
|
-
ctx.print([
|
|
878218
|
-
"Updated work plan item",
|
|
878219
|
-
` id ${item.id}`,
|
|
878220
|
-
` status ${item.status}`
|
|
878221
|
-
].join(`
|
|
878222
|
-
`));
|
|
878223
|
-
return;
|
|
878224
|
-
}
|
|
878225
|
-
const status3 = STATUS_COMMANDS[subcommand];
|
|
878226
|
-
if (status3) {
|
|
878227
|
-
const id = commandArgs[1];
|
|
878228
|
-
if (!id) {
|
|
878229
|
-
ctx.print(`Usage: /workplan ${subcommand} <id>`);
|
|
878230
|
-
return;
|
|
878231
|
-
}
|
|
878232
|
-
const item = store.setItemStatus(id, status3);
|
|
878233
|
-
ctx.print([
|
|
878234
|
-
"Updated work plan item",
|
|
878235
|
-
` id ${item.id}`,
|
|
878236
|
-
` status ${item.status}`
|
|
878237
|
-
].join(`
|
|
878238
|
-
`));
|
|
878239
|
-
return;
|
|
878240
|
-
}
|
|
878241
|
-
if (WORK_PLAN_STATUSES.includes(subcommand)) {
|
|
878242
|
-
ctx.print(`Usage: /workplan ${subcommand} <id>`);
|
|
878243
|
-
return;
|
|
878244
|
-
}
|
|
878245
|
-
ctx.print(`Unknown workplan subcommand ${subcommand}`);
|
|
878246
|
-
} catch (error51) {
|
|
878247
|
-
ctx.print(summarizeError(error51));
|
|
878248
|
-
}
|
|
878249
|
-
}
|
|
878250
|
-
});
|
|
878251
|
-
}
|
|
878252
|
-
|
|
878253
877870
|
// src/input/agent-workspace-types.ts
|
|
878254
877871
|
var AGENT_WORKSPACE_CATEGORY_IDS = [
|
|
878255
877872
|
"home",
|
|
@@ -884108,7 +883725,7 @@ import { mkdirSync as mkdirSync74, readFileSync as readFileSync97, writeFileSync
|
|
|
884108
883725
|
import { dirname as dirname74, resolve as resolve43 } from "path";
|
|
884109
883726
|
init_state3();
|
|
884110
883727
|
var VALID_CLASSES2 = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
|
|
884111
|
-
var
|
|
883728
|
+
var VALID_SCOPES3 = ["session", "project", "team"];
|
|
884112
883729
|
var VALID_REVIEW_STATES3 = ["fresh", "reviewed", "stale", "contradicted"];
|
|
884113
883730
|
var VALID_PROVENANCE_KINDS = ["session", "turn", "task", "event", "file"];
|
|
884114
883731
|
var VALUE_OPTIONS = new Set([
|
|
@@ -884208,7 +883825,7 @@ function isMemoryClass2(value) {
|
|
|
884208
883825
|
return VALID_CLASSES2.includes(value);
|
|
884209
883826
|
}
|
|
884210
883827
|
function isMemoryScope2(value) {
|
|
884211
|
-
return
|
|
883828
|
+
return VALID_SCOPES3.includes(value);
|
|
884212
883829
|
}
|
|
884213
883830
|
function isReviewState(value) {
|
|
884214
883831
|
return VALID_REVIEW_STATES3.includes(value);
|
|
@@ -884223,7 +883840,7 @@ function requireClass(value) {
|
|
|
884223
883840
|
}
|
|
884224
883841
|
function requireScope(value) {
|
|
884225
883842
|
if (!value || !isMemoryScope2(value))
|
|
884226
|
-
throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${
|
|
883843
|
+
throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES3.join(", ")}`);
|
|
884227
883844
|
return value;
|
|
884228
883845
|
}
|
|
884229
883846
|
function optionalScope(value) {
|
|
@@ -886989,10 +886606,8 @@ function registerBuiltinCommands(registry5) {
|
|
|
886989
886606
|
registerQrcodeRuntimeCommands(registry5);
|
|
886990
886607
|
registerOnboardingRuntimeCommands(registry5);
|
|
886991
886608
|
registerTtsRuntimeCommands(registry5);
|
|
886992
|
-
registerWorkPlanRuntimeCommands(registry5);
|
|
886993
886609
|
registerLocalRuntimeCommands(registry5);
|
|
886994
886610
|
registerSessionWorkflowCommands(registry5);
|
|
886995
|
-
registerPlanningRuntimeCommands(registry5);
|
|
886996
886611
|
registerScheduleRuntimeCommands(registry5);
|
|
886997
886612
|
registerSessionContentCommands(registry5);
|
|
886998
886613
|
registerAgentMemoryCommand(registry5);
|
|
@@ -891440,765 +891055,6 @@ class SchedulePanel extends BasePanel {
|
|
|
891440
891055
|
}
|
|
891441
891056
|
}
|
|
891442
891057
|
|
|
891443
|
-
// src/panels/project-planning-panel.ts
|
|
891444
|
-
var C14 = extendPalette(DEFAULT_PANEL_PALETTE, {
|
|
891445
|
-
planning: "#38bdf8",
|
|
891446
|
-
blocked: "#f97316",
|
|
891447
|
-
approved: "#22c55e",
|
|
891448
|
-
rejected: "#ef4444"
|
|
891449
|
-
});
|
|
891450
|
-
|
|
891451
|
-
class ProjectPlanningPanel extends BasePanel {
|
|
891452
|
-
service;
|
|
891453
|
-
projectId;
|
|
891454
|
-
requestRender;
|
|
891455
|
-
submitAnswer;
|
|
891456
|
-
dismissPlanning;
|
|
891457
|
-
snapshot = null;
|
|
891458
|
-
loading = false;
|
|
891459
|
-
scrollOffset = 0;
|
|
891460
|
-
selectedActionIndex = 0;
|
|
891461
|
-
draftAnswer = "";
|
|
891462
|
-
constructor(options) {
|
|
891463
|
-
super("project-planning", "Planning", "P", "agent");
|
|
891464
|
-
this.service = options.service;
|
|
891465
|
-
this.projectId = options.projectId;
|
|
891466
|
-
this.requestRender = options.requestRender ?? (() => {});
|
|
891467
|
-
this.submitAnswer = options.submitAnswer;
|
|
891468
|
-
this.dismissPlanning = options.dismissPlanning;
|
|
891469
|
-
}
|
|
891470
|
-
onActivate() {
|
|
891471
|
-
super.onActivate();
|
|
891472
|
-
this.refresh();
|
|
891473
|
-
}
|
|
891474
|
-
handleInput(key) {
|
|
891475
|
-
if (this.lastError !== null)
|
|
891476
|
-
this.clearError();
|
|
891477
|
-
const question = this.getCurrentQuestion();
|
|
891478
|
-
if (question) {
|
|
891479
|
-
const actions = this.getAnswerActions(question);
|
|
891480
|
-
this.selectedActionIndex = this.clampActionIndex(actions.length);
|
|
891481
|
-
if (key === "up") {
|
|
891482
|
-
this.selectedActionIndex = Math.max(0, this.selectedActionIndex - 1);
|
|
891483
|
-
this.markDirty();
|
|
891484
|
-
return true;
|
|
891485
|
-
}
|
|
891486
|
-
if (key === "down") {
|
|
891487
|
-
this.selectedActionIndex = Math.min(Math.max(0, actions.length - 1), this.selectedActionIndex + 1);
|
|
891488
|
-
this.markDirty();
|
|
891489
|
-
return true;
|
|
891490
|
-
}
|
|
891491
|
-
if (key === "enter" || key === "return") {
|
|
891492
|
-
this.submitSelectedAction(question, actions);
|
|
891493
|
-
return true;
|
|
891494
|
-
}
|
|
891495
|
-
if (key === "backspace") {
|
|
891496
|
-
this.draftAnswer = this.draftAnswer.slice(0, -1);
|
|
891497
|
-
this.markDirty();
|
|
891498
|
-
return true;
|
|
891499
|
-
}
|
|
891500
|
-
if (key === "delete") {
|
|
891501
|
-
this.draftAnswer = "";
|
|
891502
|
-
this.markDirty();
|
|
891503
|
-
return true;
|
|
891504
|
-
}
|
|
891505
|
-
if (key === "space") {
|
|
891506
|
-
this.draftAnswer += " ";
|
|
891507
|
-
this.markDirty();
|
|
891508
|
-
return true;
|
|
891509
|
-
}
|
|
891510
|
-
if (key === "pageup") {
|
|
891511
|
-
this.scrollOffset = Math.max(0, this.scrollOffset - 6);
|
|
891512
|
-
this.markDirty();
|
|
891513
|
-
return true;
|
|
891514
|
-
}
|
|
891515
|
-
if (key === "pagedown") {
|
|
891516
|
-
this.scrollOffset += 6;
|
|
891517
|
-
this.markDirty();
|
|
891518
|
-
return true;
|
|
891519
|
-
}
|
|
891520
|
-
if (this.isPrintableKey(key)) {
|
|
891521
|
-
this.draftAnswer += key;
|
|
891522
|
-
this.markDirty();
|
|
891523
|
-
return true;
|
|
891524
|
-
}
|
|
891525
|
-
return false;
|
|
891526
|
-
}
|
|
891527
|
-
if (key === "r" || key === "R") {
|
|
891528
|
-
this.refresh(true);
|
|
891529
|
-
return true;
|
|
891530
|
-
}
|
|
891531
|
-
if (key === "a" || key === "A") {
|
|
891532
|
-
this.approveExecution();
|
|
891533
|
-
return true;
|
|
891534
|
-
}
|
|
891535
|
-
if (key === "up" || key === "k") {
|
|
891536
|
-
this.scrollOffset = Math.max(0, this.scrollOffset - 1);
|
|
891537
|
-
this.markDirty();
|
|
891538
|
-
return true;
|
|
891539
|
-
}
|
|
891540
|
-
if (key === "down" || key === "j") {
|
|
891541
|
-
this.scrollOffset += 1;
|
|
891542
|
-
this.markDirty();
|
|
891543
|
-
return true;
|
|
891544
|
-
}
|
|
891545
|
-
return false;
|
|
891546
|
-
}
|
|
891547
|
-
render(width, height) {
|
|
891548
|
-
return this.trackedRender(() => {
|
|
891549
|
-
if (!this.snapshot && !this.loading)
|
|
891550
|
-
this.refresh();
|
|
891551
|
-
const sections = [];
|
|
891552
|
-
const status3 = this.snapshot?.status;
|
|
891553
|
-
const state3 = this.snapshot?.state;
|
|
891554
|
-
const evaluation = this.snapshot?.evaluation ?? null;
|
|
891555
|
-
const language = this.snapshot?.language ?? null;
|
|
891556
|
-
const decisions = this.snapshot?.decisions ?? [];
|
|
891557
|
-
const planningNamespace = status3 ? String(status3[["knowledge", "SpaceId"].join("")] ?? `project:${this.projectId}`) : `project:${this.projectId}`;
|
|
891558
|
-
sections.push({
|
|
891559
|
-
title: "Workspace",
|
|
891560
|
-
lines: [
|
|
891561
|
-
buildKeyValueLine(width, [
|
|
891562
|
-
{ label: "project", value: this.projectId, valueColor: C14.planning },
|
|
891563
|
-
{ label: "store", value: planningNamespace, valueColor: C14.value },
|
|
891564
|
-
{ label: "mode", value: "Agent-owned workspace planning state", valueColor: C14.info }
|
|
891565
|
-
], C14),
|
|
891566
|
-
buildPanelLine(width, [
|
|
891567
|
-
[" Planning stays in the Agent main conversation; build/fix/review execution is delegated explicitly to GoodVibes TUI.", C14.dim]
|
|
891568
|
-
])
|
|
891569
|
-
]
|
|
891570
|
-
});
|
|
891571
|
-
if (!state3) {
|
|
891572
|
-
sections.push({
|
|
891573
|
-
title: "No Active Planning State",
|
|
891574
|
-
lines: buildEmptyState(width, "No project planning state has been saved for this workspace.", "Describe the intended operator outcome in normal chat to let the Agent start the planning interview. The planning artifact service stores and evaluates artifacts; it does not start execution.", [], C14)
|
|
891575
|
-
});
|
|
891576
|
-
} else {
|
|
891577
|
-
sections.push(this.buildStateSection(width, state3, evaluation));
|
|
891578
|
-
const question = this.getCurrentQuestion();
|
|
891579
|
-
if (question)
|
|
891580
|
-
sections.push(this.buildQuestionSection(width, question));
|
|
891581
|
-
sections.push(this.buildGapsSection(width, evaluation));
|
|
891582
|
-
sections.push(this.buildTasksSection(width, state3));
|
|
891583
|
-
sections.push(this.buildDecisionsSection(width, state3, decisions));
|
|
891584
|
-
sections.push(this.buildLanguageSection(width, language));
|
|
891585
|
-
}
|
|
891586
|
-
if (this.lastError) {
|
|
891587
|
-
const line = this.renderErrorLine(width);
|
|
891588
|
-
if (line)
|
|
891589
|
-
sections.push({ title: "Error", lines: [line] });
|
|
891590
|
-
}
|
|
891591
|
-
const { lines: flattened, selectedIndex } = this.flattenSections(width, sections);
|
|
891592
|
-
const scroll = resolveScrollablePanelSection(width, height, {
|
|
891593
|
-
intro: "Project planning state, open gaps, decisions, language, task graph, completion checks, and handoff candidates.",
|
|
891594
|
-
footerLines: this.footerLines(width),
|
|
891595
|
-
palette: C14,
|
|
891596
|
-
section: {
|
|
891597
|
-
title: "Project Planning",
|
|
891598
|
-
scrollableLines: flattened,
|
|
891599
|
-
selectedIndex,
|
|
891600
|
-
scrollOffset: this.scrollOffset,
|
|
891601
|
-
appendWindowSummary: {},
|
|
891602
|
-
minRows: 8
|
|
891603
|
-
}
|
|
891604
|
-
});
|
|
891605
|
-
this.scrollOffset = scroll.scrollOffset;
|
|
891606
|
-
const sectionLines = [...scroll.section.lines];
|
|
891607
|
-
const footerSummary = flattened.length > sectionLines.length ? `showing ${scroll.window.start + 1}-${scroll.window.end} of ${flattened.length}` : undefined;
|
|
891608
|
-
return buildPanelWorkspace(width, height, {
|
|
891609
|
-
title: this.loading ? "Project Planning - loading" : "Project Planning",
|
|
891610
|
-
intro: "Planning artifacts for the current Agent workspace. Conversation control stays in the main Agent turn.",
|
|
891611
|
-
sections: [{ ...scroll.section, lines: sectionLines }],
|
|
891612
|
-
footerLines: this.footerLines(width, footerSummary),
|
|
891613
|
-
palette: C14
|
|
891614
|
-
});
|
|
891615
|
-
});
|
|
891616
|
-
}
|
|
891617
|
-
footerLines(width, scrollSummary) {
|
|
891618
|
-
const hasQuestion = this.getCurrentQuestion() !== null;
|
|
891619
|
-
const summaryParts = scrollSummary ? [[` ${scrollSummary} `, C14.dim]] : [];
|
|
891620
|
-
if (hasQuestion) {
|
|
891621
|
-
return [
|
|
891622
|
-
buildPanelLine(width, [
|
|
891623
|
-
...summaryParts,
|
|
891624
|
-
[" Up/Down", C14.info],
|
|
891625
|
-
[" choose answer ", C14.dim],
|
|
891626
|
-
["type", C14.info],
|
|
891627
|
-
[" draft ", C14.dim],
|
|
891628
|
-
["Backspace/Delete", C14.info],
|
|
891629
|
-
[" edit ", C14.dim],
|
|
891630
|
-
["Enter", C14.info],
|
|
891631
|
-
[" submit Esc prompt focus Ctrl+X close panel", C14.dim]
|
|
891632
|
-
])
|
|
891633
|
-
];
|
|
891634
|
-
}
|
|
891635
|
-
return [
|
|
891636
|
-
buildPanelLine(width, [
|
|
891637
|
-
...summaryParts,
|
|
891638
|
-
[" Up/Down", C14.info],
|
|
891639
|
-
[" scroll ", C14.dim],
|
|
891640
|
-
["r", C14.info],
|
|
891641
|
-
[" refresh ", C14.dim],
|
|
891642
|
-
["a", C14.info],
|
|
891643
|
-
[" mark planning ready Esc prompt focus Ctrl+X close panel", C14.dim]
|
|
891644
|
-
])
|
|
891645
|
-
];
|
|
891646
|
-
}
|
|
891647
|
-
flattenSections(width, sections) {
|
|
891648
|
-
const lines = [];
|
|
891649
|
-
let selectedIndex = 0;
|
|
891650
|
-
for (const section of sections) {
|
|
891651
|
-
const sectionStart = lines.length;
|
|
891652
|
-
const titleOffset = section.title ? 1 : 0;
|
|
891653
|
-
if (section.title)
|
|
891654
|
-
lines.push(buildPanelLine(width, [[` ${section.title}`, C14.label]]));
|
|
891655
|
-
lines.push(...section.lines);
|
|
891656
|
-
if (section.selectedLineIndex !== undefined) {
|
|
891657
|
-
selectedIndex = sectionStart + titleOffset + section.selectedLineIndex;
|
|
891658
|
-
}
|
|
891659
|
-
}
|
|
891660
|
-
return { lines, selectedIndex };
|
|
891661
|
-
}
|
|
891662
|
-
buildQuestionSection(width, question) {
|
|
891663
|
-
const actions = this.getAnswerActions(question);
|
|
891664
|
-
this.selectedActionIndex = this.clampActionIndex(actions.length);
|
|
891665
|
-
const lines = [
|
|
891666
|
-
...buildBodyText(width, question.prompt, C14, C14.planning)
|
|
891667
|
-
];
|
|
891668
|
-
if (question.whyItMatters) {
|
|
891669
|
-
lines.push(...buildBodyText(width, `Why this matters: ${question.whyItMatters}`, C14, C14.dim));
|
|
891670
|
-
}
|
|
891671
|
-
if (question.recommendedAnswer && !this.isGenericRecommendation(question.recommendedAnswer)) {
|
|
891672
|
-
lines.push(...buildBodyText(width, `Recommendation: ${question.recommendedAnswer}`, C14, C14.good));
|
|
891673
|
-
}
|
|
891674
|
-
lines.push(...buildBodyText(width, `Typed answer: ${this.draftAnswer || "(type here while this panel is focused)"}`, C14, this.draftAnswer ? C14.value : C14.dim));
|
|
891675
|
-
lines.push(buildPanelLine(width, [[
|
|
891676
|
-
" Select an answer below or type your own. Enter sends it through the normal planning chat path.",
|
|
891677
|
-
C14.dim
|
|
891678
|
-
]]));
|
|
891679
|
-
const selectedLineIndex = lines.length + this.selectedActionIndex;
|
|
891680
|
-
actions.forEach((action2, index) => {
|
|
891681
|
-
const selected = index === this.selectedActionIndex;
|
|
891682
|
-
lines.push(buildPanelListRow(width, [
|
|
891683
|
-
{ text: action2.label, fg: action2.disabled ? C14.dim : C14.value, bold: selected },
|
|
891684
|
-
{ text: ` ${action2.detail}`, fg: C14.dim }
|
|
891685
|
-
], C14, {
|
|
891686
|
-
selected,
|
|
891687
|
-
marker: selected ? "\u25B6" : " "
|
|
891688
|
-
}));
|
|
891689
|
-
});
|
|
891690
|
-
return { title: "Answer Current Question", lines, selectedLineIndex };
|
|
891691
|
-
}
|
|
891692
|
-
buildStateSection(width, state3, evaluation) {
|
|
891693
|
-
const readiness = evaluation?.readiness ?? state3.readiness;
|
|
891694
|
-
const readinessColor = readiness === "executable" ? C14.approved : readiness === "needs-user-input" ? C14.blocked : C14.dim;
|
|
891695
|
-
const lines = [
|
|
891696
|
-
buildKeyValueLine(width, [
|
|
891697
|
-
{ label: "readiness", value: readiness, valueColor: readinessColor },
|
|
891698
|
-
{ label: "approved", value: state3.executionApproved ? "yes" : "no", valueColor: state3.executionApproved ? C14.approved : C14.blocked },
|
|
891699
|
-
{ label: "questions", value: `${state3.openQuestions.length} open / ${state3.answeredQuestions.length} answered`, valueColor: C14.value }
|
|
891700
|
-
], C14),
|
|
891701
|
-
...buildBodyText(width, `Goal: ${state3.goal || "(not set)"}`, C14, state3.goal ? C14.value : C14.blocked)
|
|
891702
|
-
];
|
|
891703
|
-
if (state3.scope)
|
|
891704
|
-
lines.push(...buildBodyText(width, `Scope: ${state3.scope}`, C14, C14.value));
|
|
891705
|
-
if (state3.knownContext.length) {
|
|
891706
|
-
lines.push(...buildBodyText(width, `Known context: ${state3.knownContext.join(" | ")}`, C14, C14.dim));
|
|
891707
|
-
}
|
|
891708
|
-
if (evaluation?.nextQuestion) {
|
|
891709
|
-
lines.push(...buildBodyText(width, `Next question: ${evaluation.nextQuestion.prompt}`, C14, C14.planning));
|
|
891710
|
-
if (evaluation.nextQuestion.whyItMatters) {
|
|
891711
|
-
lines.push(...buildBodyText(width, `Why it matters: ${evaluation.nextQuestion.whyItMatters}`, C14, C14.dim));
|
|
891712
|
-
}
|
|
891713
|
-
if (evaluation.nextQuestion.recommendedAnswer && !this.isGenericRecommendation(evaluation.nextQuestion.recommendedAnswer)) {
|
|
891714
|
-
lines.push(...buildBodyText(width, `Recommended answer: ${evaluation.nextQuestion.recommendedAnswer}`, C14, C14.good));
|
|
891715
|
-
}
|
|
891716
|
-
}
|
|
891717
|
-
return { title: "State", lines };
|
|
891718
|
-
}
|
|
891719
|
-
buildGapsSection(width, evaluation) {
|
|
891720
|
-
const gaps = evaluation?.gaps ?? [];
|
|
891721
|
-
if (gaps.length === 0) {
|
|
891722
|
-
return {
|
|
891723
|
-
title: "Open Gaps",
|
|
891724
|
-
lines: [buildPanelLine(width, [[" No open gaps.", C14.good]])]
|
|
891725
|
-
};
|
|
891726
|
-
}
|
|
891727
|
-
return {
|
|
891728
|
-
title: "Open Gaps",
|
|
891729
|
-
lines: gaps.slice(0, 12).flatMap((gap) => buildBodyText(width, `${gap.severity.toUpperCase()} ${gap.kind}: ${gap.message}`, C14, gap.severity === "blocking" ? C14.blocked : C14.warn))
|
|
891730
|
-
};
|
|
891731
|
-
}
|
|
891732
|
-
buildTasksSection(width, state3) {
|
|
891733
|
-
const lines = [];
|
|
891734
|
-
if (state3.tasks.length === 0) {
|
|
891735
|
-
lines.push(buildPanelLine(width, [[" No decomposed tasks recorded yet.", C14.dim]]));
|
|
891736
|
-
} else {
|
|
891737
|
-
for (const task of state3.tasks) {
|
|
891738
|
-
lines.push(...buildBodyText(width, `${task.id}: ${task.title} [${task.status ?? "pending"}]${task.canRunConcurrently ? " - concurrent" : ""}`, C14, task.blockedOnUserInput ? C14.blocked : C14.value));
|
|
891739
|
-
if (task.dependencies?.length)
|
|
891740
|
-
lines.push(...buildBodyText(width, `Dependencies: ${task.dependencies.join(", ")}`, C14, C14.dim));
|
|
891741
|
-
if (task.verification?.length)
|
|
891742
|
-
lines.push(...buildBodyText(width, `Verification: ${task.verification.join(" | ")}`, C14, C14.good));
|
|
891743
|
-
}
|
|
891744
|
-
}
|
|
891745
|
-
if (state3.verificationGates.length) {
|
|
891746
|
-
lines.push(buildPanelLine(width, [[" Completion checks:", C14.label]]));
|
|
891747
|
-
for (const gate of state3.verificationGates) {
|
|
891748
|
-
lines.push(...buildBodyText(width, `${gate.id}: ${gate.description} [${gate.status ?? "pending"}]`, C14, gate.required === false ? C14.dim : C14.good));
|
|
891749
|
-
}
|
|
891750
|
-
}
|
|
891751
|
-
if (state3.agentAssignments.length) {
|
|
891752
|
-
lines.push(buildPanelLine(width, [[" Agent handoff candidates:", C14.label]]));
|
|
891753
|
-
for (const assignment of state3.agentAssignments) {
|
|
891754
|
-
lines.push(...buildBodyText(width, `${assignment.taskId}: ${assignment.agentType ?? "none"}${assignment.canRunConcurrently ? " - can run concurrently" : ""}`, C14, C14.info));
|
|
891755
|
-
}
|
|
891756
|
-
}
|
|
891757
|
-
return { title: "Task Graph", lines };
|
|
891758
|
-
}
|
|
891759
|
-
buildDecisionsSection(width, state3, storedDecisions) {
|
|
891760
|
-
const byId = new Map;
|
|
891761
|
-
for (const decision of [...storedDecisions, ...state3.decisions])
|
|
891762
|
-
byId.set(decision.id, decision);
|
|
891763
|
-
const decisions = [...byId.values()];
|
|
891764
|
-
if (decisions.length === 0) {
|
|
891765
|
-
return {
|
|
891766
|
-
title: "Decisions",
|
|
891767
|
-
lines: [buildPanelLine(width, [[" No durable planning decisions recorded yet.", C14.dim]])]
|
|
891768
|
-
};
|
|
891769
|
-
}
|
|
891770
|
-
return {
|
|
891771
|
-
title: "Decisions",
|
|
891772
|
-
lines: decisions.slice(0, 12).flatMap((decision) => buildBodyText(width, `${decision.title}: ${decision.decision} [${decision.status ?? "accepted"}]`, C14, decision.status === "rejected" ? C14.rejected : C14.value))
|
|
891773
|
-
};
|
|
891774
|
-
}
|
|
891775
|
-
buildLanguageSection(width, language) {
|
|
891776
|
-
if (!language || language.terms.length === 0 && language.ambiguities.length === 0) {
|
|
891777
|
-
return {
|
|
891778
|
-
title: "Project Language",
|
|
891779
|
-
lines: [buildPanelLine(width, [[" No project language terms or ambiguity resolutions recorded yet.", C14.dim]])]
|
|
891780
|
-
};
|
|
891781
|
-
}
|
|
891782
|
-
const lines = [];
|
|
891783
|
-
for (const term of language.terms.slice(0, 8)) {
|
|
891784
|
-
lines.push(...buildBodyText(width, `${term.term}: ${term.definition}`, C14, C14.value));
|
|
891785
|
-
if (term.avoid?.length)
|
|
891786
|
-
lines.push(...buildBodyText(width, `Avoid: ${term.avoid.join(", ")}`, C14, C14.blocked));
|
|
891787
|
-
}
|
|
891788
|
-
for (const ambiguity of language.ambiguities.slice(0, 8)) {
|
|
891789
|
-
lines.push(...buildBodyText(width, `Resolved ambiguity - ${ambiguity.phrase}: ${ambiguity.resolution}`, C14, C14.info));
|
|
891790
|
-
}
|
|
891791
|
-
return { title: "Project Language", lines };
|
|
891792
|
-
}
|
|
891793
|
-
refresh(force = false) {
|
|
891794
|
-
if (this.loading && !force)
|
|
891795
|
-
return;
|
|
891796
|
-
this.loading = true;
|
|
891797
|
-
this.markDirty();
|
|
891798
|
-
this.requestRender();
|
|
891799
|
-
(async () => {
|
|
891800
|
-
try {
|
|
891801
|
-
const [status3, stateResult, decisionsResult, languageResult] = await Promise.all([
|
|
891802
|
-
this.service.status({ projectId: this.projectId }),
|
|
891803
|
-
this.service.getState({ projectId: this.projectId }),
|
|
891804
|
-
this.service.listDecisions({ projectId: this.projectId }),
|
|
891805
|
-
this.service.getLanguage({ projectId: this.projectId })
|
|
891806
|
-
]);
|
|
891807
|
-
const evaluation = await this.service.evaluate({ projectId: this.projectId });
|
|
891808
|
-
this.snapshot = {
|
|
891809
|
-
status: status3,
|
|
891810
|
-
state: stateResult.state,
|
|
891811
|
-
evaluation,
|
|
891812
|
-
decisions: decisionsResult.decisions,
|
|
891813
|
-
language: languageResult.language
|
|
891814
|
-
};
|
|
891815
|
-
this.clearError();
|
|
891816
|
-
} catch (err2) {
|
|
891817
|
-
this.setError(err2 instanceof Error ? err2.message : String(err2));
|
|
891818
|
-
} finally {
|
|
891819
|
-
this.loading = false;
|
|
891820
|
-
this.markDirty();
|
|
891821
|
-
this.requestRender();
|
|
891822
|
-
}
|
|
891823
|
-
})();
|
|
891824
|
-
}
|
|
891825
|
-
getCurrentQuestion() {
|
|
891826
|
-
const state3 = this.snapshot?.state;
|
|
891827
|
-
const open2 = state3?.openQuestions.find((question) => (question.status ?? "open") === "open");
|
|
891828
|
-
return open2 ?? this.snapshot?.evaluation?.nextQuestion ?? null;
|
|
891829
|
-
}
|
|
891830
|
-
getAnswerActions(question) {
|
|
891831
|
-
const actions = [];
|
|
891832
|
-
const prompt = question.prompt.toLowerCase();
|
|
891833
|
-
const isScopeQuestion = prompt.includes("scope") || prompt.includes("in or out");
|
|
891834
|
-
const isTaskQuestion = prompt.includes("task") || prompt.includes("dependency") || prompt.includes("work breakdown");
|
|
891835
|
-
const isVerificationQuestion = prompt.includes("verification") || prompt.includes("test") || prompt.includes("prove");
|
|
891836
|
-
const isApprovalQuestion = prompt.includes("approved") || prompt.includes("approve") || prompt.includes("execution");
|
|
891837
|
-
if (isApprovalQuestion) {
|
|
891838
|
-
actions.push({
|
|
891839
|
-
id: "approve-execution",
|
|
891840
|
-
label: "Approve execution",
|
|
891841
|
-
detail: "Mark this plan approved so execution may proceed.",
|
|
891842
|
-
answer: "Approve this planning state for execution.",
|
|
891843
|
-
kind: "approve"
|
|
891844
|
-
});
|
|
891845
|
-
}
|
|
891846
|
-
if (isScopeQuestion) {
|
|
891847
|
-
actions.push({
|
|
891848
|
-
id: "scope-focused-first-pass",
|
|
891849
|
-
label: "Use focused first-pass scope",
|
|
891850
|
-
detail: "Fill a concrete end-to-end scope for this goal and keep unrelated work out.",
|
|
891851
|
-
answer: "Use a focused first-pass scope for this goal."
|
|
891852
|
-
});
|
|
891853
|
-
}
|
|
891854
|
-
if (isTaskQuestion) {
|
|
891855
|
-
actions.push({
|
|
891856
|
-
id: "tasks-default-breakdown",
|
|
891857
|
-
label: "Create default task breakdown",
|
|
891858
|
-
detail: "Create inspect, implement, wire, and verify tasks with dependencies.",
|
|
891859
|
-
answer: "Create the default task breakdown for this goal."
|
|
891860
|
-
});
|
|
891861
|
-
}
|
|
891862
|
-
if (isVerificationQuestion) {
|
|
891863
|
-
actions.push({
|
|
891864
|
-
id: "verification-default-gates",
|
|
891865
|
-
label: "Use standard completion checks",
|
|
891866
|
-
detail: "Require focused regression coverage, typecheck/build validation, and a runtime smoke where feasible.",
|
|
891867
|
-
answer: "Use standard completion checks for this goal."
|
|
891868
|
-
});
|
|
891869
|
-
}
|
|
891870
|
-
if (question.recommendedAnswer?.trim() && !this.isGenericRecommendation(question.recommendedAnswer)) {
|
|
891871
|
-
actions.push({
|
|
891872
|
-
id: "recommended",
|
|
891873
|
-
label: "Use recommended answer",
|
|
891874
|
-
detail: this.compact(question.recommendedAnswer),
|
|
891875
|
-
answer: question.recommendedAnswer
|
|
891876
|
-
});
|
|
891877
|
-
}
|
|
891878
|
-
if (isScopeQuestion) {
|
|
891879
|
-
actions.push({
|
|
891880
|
-
id: "scope-end-to-end",
|
|
891881
|
-
label: "End-to-end required scope",
|
|
891882
|
-
detail: "Let the plan include every component needed to make this work, but avoid unrelated cleanup.",
|
|
891883
|
-
answer: "Scope is everything required to make the requested outcome work end-to-end. Include TUI, runtime composition, configuration, docs, and tests if they are required. Do not include unrelated cleanup or broad refactors unless they are necessary for this task."
|
|
891884
|
-
});
|
|
891885
|
-
actions.push({
|
|
891886
|
-
id: "scope-agent-first",
|
|
891887
|
-
label: "Agent-first scope",
|
|
891888
|
-
detail: "Fix Agent behavior here; report public-runtime blockers instead of patching around external runtime bugs.",
|
|
891889
|
-
answer: "Scope is Agent-owned behavior first. If a blocker belongs to the public runtime, report the exact contract/runtime issue instead of patching around it locally. Include runtime contracts only where Agent consumes public runtime routes."
|
|
891890
|
-
});
|
|
891891
|
-
}
|
|
891892
|
-
actions.push({
|
|
891893
|
-
id: "ask-narrower",
|
|
891894
|
-
label: "I am not sure yet",
|
|
891895
|
-
detail: "Break this into smaller concrete choices with examples and a recommended default.",
|
|
891896
|
-
answer: `I do not know enough to answer "${question.prompt}" as asked. Break it into smaller concrete questions with 2-4 specific choices, explain the tradeoffs, recommend a default, and ask me the first one.`
|
|
891897
|
-
});
|
|
891898
|
-
actions.push({
|
|
891899
|
-
id: "custom",
|
|
891900
|
-
label: "Submit typed answer",
|
|
891901
|
-
detail: this.draftAnswer ? this.compact(this.draftAnswer) : "Type an answer first; this row becomes the custom answer.",
|
|
891902
|
-
answer: this.draftAnswer.trim(),
|
|
891903
|
-
disabled: !this.draftAnswer.trim()
|
|
891904
|
-
});
|
|
891905
|
-
actions.push({
|
|
891906
|
-
id: "dismiss-planning",
|
|
891907
|
-
label: "Close planning and continue without it",
|
|
891908
|
-
detail: "Pause project planning for this workspace. Normal chat continues; /plan can reopen it later.",
|
|
891909
|
-
answer: "Pause project planning for this workspace and continue without the planning panel.",
|
|
891910
|
-
kind: "dismiss"
|
|
891911
|
-
});
|
|
891912
|
-
return actions;
|
|
891913
|
-
}
|
|
891914
|
-
isGenericRecommendation(value) {
|
|
891915
|
-
return /\bdefine the first-pass scope\b/i.test(value) || /\bcreate task records\b/i.test(value) || /\brecord concrete tests\b/i.test(value) || /\bseparate out-of-scope work\b/i.test(value);
|
|
891916
|
-
}
|
|
891917
|
-
submitSelectedAction(question, actions) {
|
|
891918
|
-
const action2 = actions[this.clampActionIndex(actions.length)];
|
|
891919
|
-
if (!action2 || action2.disabled || !action2.answer.trim()) {
|
|
891920
|
-
this.setError("Type an answer or choose a non-empty answer option.");
|
|
891921
|
-
this.requestRender();
|
|
891922
|
-
return;
|
|
891923
|
-
}
|
|
891924
|
-
if (action2.kind === "approve") {
|
|
891925
|
-
this.approveExecution();
|
|
891926
|
-
return;
|
|
891927
|
-
}
|
|
891928
|
-
if (action2.kind === "dismiss") {
|
|
891929
|
-
this.pausePlanning(question);
|
|
891930
|
-
return;
|
|
891931
|
-
}
|
|
891932
|
-
if (!this.submitAnswer) {
|
|
891933
|
-
this.setError("Planning answer submission is unavailable in this Agent runtime. Return to the composer and answer there.");
|
|
891934
|
-
this.requestRender();
|
|
891935
|
-
return;
|
|
891936
|
-
}
|
|
891937
|
-
(async () => {
|
|
891938
|
-
try {
|
|
891939
|
-
await this.persistQuestionIfNeeded(question);
|
|
891940
|
-
this.draftAnswer = "";
|
|
891941
|
-
this.submitAnswer?.(action2.answer.trim());
|
|
891942
|
-
this.refresh(true);
|
|
891943
|
-
this.registerTimer(setTimeout(() => this.refresh(true), 250));
|
|
891944
|
-
} catch (err2) {
|
|
891945
|
-
this.setError(err2 instanceof Error ? err2.message : String(err2));
|
|
891946
|
-
this.requestRender();
|
|
891947
|
-
}
|
|
891948
|
-
})();
|
|
891949
|
-
}
|
|
891950
|
-
async persistQuestionIfNeeded(question) {
|
|
891951
|
-
const state3 = this.snapshot?.state;
|
|
891952
|
-
if (!state3)
|
|
891953
|
-
return;
|
|
891954
|
-
if (state3.openQuestions.some((entry) => entry.id === question.id))
|
|
891955
|
-
return;
|
|
891956
|
-
await this.service.upsertState({
|
|
891957
|
-
projectId: this.projectId,
|
|
891958
|
-
state: {
|
|
891959
|
-
...state3,
|
|
891960
|
-
openQuestions: [
|
|
891961
|
-
{ ...question, status: question.status ?? "open" },
|
|
891962
|
-
...state3.openQuestions
|
|
891963
|
-
]
|
|
891964
|
-
}
|
|
891965
|
-
});
|
|
891966
|
-
}
|
|
891967
|
-
pausePlanning(question) {
|
|
891968
|
-
const state3 = this.snapshot?.state;
|
|
891969
|
-
if (!state3) {
|
|
891970
|
-
this.dismissPlanning?.();
|
|
891971
|
-
this.requestRender();
|
|
891972
|
-
return;
|
|
891973
|
-
}
|
|
891974
|
-
(async () => {
|
|
891975
|
-
try {
|
|
891976
|
-
await this.service.upsertState({
|
|
891977
|
-
projectId: this.projectId,
|
|
891978
|
-
state: {
|
|
891979
|
-
...state3,
|
|
891980
|
-
openQuestions: state3.openQuestions.map((entry) => entry.id === question.id ? { ...entry, status: entry.status ?? "open" } : entry),
|
|
891981
|
-
metadata: {
|
|
891982
|
-
...state3.metadata ?? {},
|
|
891983
|
-
active: false,
|
|
891984
|
-
pausedAt: Date.now(),
|
|
891985
|
-
pausedFrom: "project-planning-panel"
|
|
891986
|
-
}
|
|
891987
|
-
}
|
|
891988
|
-
});
|
|
891989
|
-
this.dismissPlanning?.();
|
|
891990
|
-
this.refresh(true);
|
|
891991
|
-
} catch (err2) {
|
|
891992
|
-
this.setError(err2 instanceof Error ? err2.message : String(err2));
|
|
891993
|
-
this.requestRender();
|
|
891994
|
-
}
|
|
891995
|
-
})();
|
|
891996
|
-
}
|
|
891997
|
-
clampActionIndex(count) {
|
|
891998
|
-
if (count <= 0)
|
|
891999
|
-
return 0;
|
|
892000
|
-
return Math.max(0, Math.min(count - 1, this.selectedActionIndex));
|
|
892001
|
-
}
|
|
892002
|
-
isPrintableKey(key) {
|
|
892003
|
-
return key.length === 1 && key >= " ";
|
|
892004
|
-
}
|
|
892005
|
-
compact(text) {
|
|
892006
|
-
const normalized = text.replace(/\s+/g, " ").trim();
|
|
892007
|
-
return normalized.length > 86 ? `${normalized.slice(0, 83)}...` : normalized;
|
|
892008
|
-
}
|
|
892009
|
-
approveExecution() {
|
|
892010
|
-
const state3 = this.snapshot?.state;
|
|
892011
|
-
if (!state3) {
|
|
892012
|
-
this.setError("No planning state exists to approve.");
|
|
892013
|
-
this.requestRender();
|
|
892014
|
-
return;
|
|
892015
|
-
}
|
|
892016
|
-
(async () => {
|
|
892017
|
-
try {
|
|
892018
|
-
await this.service.upsertState({
|
|
892019
|
-
projectId: this.projectId,
|
|
892020
|
-
state: {
|
|
892021
|
-
...state3,
|
|
892022
|
-
executionApproved: true,
|
|
892023
|
-
metadata: {
|
|
892024
|
-
...state3.metadata ?? {},
|
|
892025
|
-
approvedFrom: "project-planning-panel",
|
|
892026
|
-
approvedAt: Date.now()
|
|
892027
|
-
}
|
|
892028
|
-
}
|
|
892029
|
-
});
|
|
892030
|
-
this.refresh(true);
|
|
892031
|
-
} catch (err2) {
|
|
892032
|
-
this.setError(err2 instanceof Error ? err2.message : String(err2));
|
|
892033
|
-
this.requestRender();
|
|
892034
|
-
}
|
|
892035
|
-
})();
|
|
892036
|
-
}
|
|
892037
|
-
}
|
|
892038
|
-
|
|
892039
|
-
// src/panels/work-plan-panel.ts
|
|
892040
|
-
var STATUS_LABEL2 = {
|
|
892041
|
-
pending: "[ ]",
|
|
892042
|
-
in_progress: "[>]",
|
|
892043
|
-
blocked: "[!]",
|
|
892044
|
-
done: "[x]",
|
|
892045
|
-
failed: "[x]",
|
|
892046
|
-
cancelled: "[-]"
|
|
892047
|
-
};
|
|
892048
|
-
var STATUS_COLOR = {
|
|
892049
|
-
pending: "#94a3b8",
|
|
892050
|
-
in_progress: "#38bdf8",
|
|
892051
|
-
blocked: "#f59e0b",
|
|
892052
|
-
done: "#22c55e",
|
|
892053
|
-
failed: "#ef4444",
|
|
892054
|
-
cancelled: "#64748b"
|
|
892055
|
-
};
|
|
892056
|
-
function line(text, width, style = {}) {
|
|
892057
|
-
return UIFactory.stringToLine(text.padEnd(width).slice(0, width), width, style);
|
|
892058
|
-
}
|
|
892059
|
-
function compactDate(value) {
|
|
892060
|
-
return new Date(value).toISOString().replace("T", " ").slice(0, 16);
|
|
892061
|
-
}
|
|
892062
|
-
function statusName(status3) {
|
|
892063
|
-
return status3.replace(/_/g, " ");
|
|
892064
|
-
}
|
|
892065
|
-
|
|
892066
|
-
class WorkPlanPanel extends ScrollableListPanel {
|
|
892067
|
-
store;
|
|
892068
|
-
items = [];
|
|
892069
|
-
lastPlanUpdatedAt = 0;
|
|
892070
|
-
constructor(store) {
|
|
892071
|
-
super("work-plan", "Work Plan", "L", "agent");
|
|
892072
|
-
this.store = store;
|
|
892073
|
-
this.showSelectionGutter = true;
|
|
892074
|
-
}
|
|
892075
|
-
onActivate() {
|
|
892076
|
-
super.onActivate();
|
|
892077
|
-
this.refresh();
|
|
892078
|
-
}
|
|
892079
|
-
render(width, height) {
|
|
892080
|
-
this.refresh();
|
|
892081
|
-
return this.renderList(width, height, {
|
|
892082
|
-
title: "Work Plan",
|
|
892083
|
-
header: this.renderHeader(width),
|
|
892084
|
-
footer: this.renderFooter(width),
|
|
892085
|
-
emptyMessage: "No work plan items yet"
|
|
892086
|
-
});
|
|
892087
|
-
}
|
|
892088
|
-
handleInput(key) {
|
|
892089
|
-
if (this.lastError !== null)
|
|
892090
|
-
this.clearError();
|
|
892091
|
-
const item = this.items[this.selectedIndex];
|
|
892092
|
-
try {
|
|
892093
|
-
switch (key) {
|
|
892094
|
-
case " ":
|
|
892095
|
-
case "return":
|
|
892096
|
-
case "enter":
|
|
892097
|
-
if (!item)
|
|
892098
|
-
return false;
|
|
892099
|
-
this.store.cycleItemStatus(item.id);
|
|
892100
|
-
this.refresh();
|
|
892101
|
-
return true;
|
|
892102
|
-
case "1":
|
|
892103
|
-
return this.setSelectedStatus("pending");
|
|
892104
|
-
case "2":
|
|
892105
|
-
return this.setSelectedStatus("in_progress");
|
|
892106
|
-
case "3":
|
|
892107
|
-
return this.setSelectedStatus("blocked");
|
|
892108
|
-
case "4":
|
|
892109
|
-
return this.setSelectedStatus("done");
|
|
892110
|
-
case "5":
|
|
892111
|
-
return this.setSelectedStatus("failed");
|
|
892112
|
-
case "6":
|
|
892113
|
-
return this.setSelectedStatus("cancelled");
|
|
892114
|
-
case "d":
|
|
892115
|
-
case "delete":
|
|
892116
|
-
if (!item)
|
|
892117
|
-
return false;
|
|
892118
|
-
this.store.removeItem(item.id);
|
|
892119
|
-
this.refresh();
|
|
892120
|
-
return true;
|
|
892121
|
-
case "c":
|
|
892122
|
-
this.store.clearCompleted();
|
|
892123
|
-
this.refresh();
|
|
892124
|
-
return true;
|
|
892125
|
-
case "r":
|
|
892126
|
-
this.refresh(true);
|
|
892127
|
-
return true;
|
|
892128
|
-
default:
|
|
892129
|
-
return super.handleInput(key);
|
|
892130
|
-
}
|
|
892131
|
-
} catch (error51) {
|
|
892132
|
-
this.setError(error51 instanceof Error ? error51.message : String(error51));
|
|
892133
|
-
return true;
|
|
892134
|
-
}
|
|
892135
|
-
}
|
|
892136
|
-
getItems() {
|
|
892137
|
-
return this.items;
|
|
892138
|
-
}
|
|
892139
|
-
getEmptyStateActions() {
|
|
892140
|
-
return [
|
|
892141
|
-
{ command: "/workplan add <title>", summary: "add a persistent item" },
|
|
892142
|
-
{ command: "/workplan list", summary: "print the current plan" }
|
|
892143
|
-
];
|
|
892144
|
-
}
|
|
892145
|
-
renderItem(item, _index, selected, width) {
|
|
892146
|
-
const status3 = STATUS_LABEL2[item.status];
|
|
892147
|
-
const owner = item.owner ? ` @${item.owner}` : "";
|
|
892148
|
-
const source = item.source ? ` (${item.source})` : "";
|
|
892149
|
-
const text = `${status3} ${item.title}${owner}${source}`;
|
|
892150
|
-
return line(text, width, {
|
|
892151
|
-
fg: selected ? "#e2e8f0" : STATUS_COLOR[item.status],
|
|
892152
|
-
bg: selected ? "#1e293b" : undefined,
|
|
892153
|
-
bold: selected || item.status === "in_progress"
|
|
892154
|
-
});
|
|
892155
|
-
}
|
|
892156
|
-
setSelectedStatus(status3) {
|
|
892157
|
-
const item = this.items[this.selectedIndex];
|
|
892158
|
-
if (!item)
|
|
892159
|
-
return false;
|
|
892160
|
-
this.store.setItemStatus(item.id, status3);
|
|
892161
|
-
this.refresh();
|
|
892162
|
-
return true;
|
|
892163
|
-
}
|
|
892164
|
-
refresh(force = false) {
|
|
892165
|
-
const plan = this.store.getActivePlan();
|
|
892166
|
-
if (!force && plan.updatedAt === this.lastPlanUpdatedAt && this.items.length === plan.items.length)
|
|
892167
|
-
return;
|
|
892168
|
-
this.items = plan.items;
|
|
892169
|
-
this.lastPlanUpdatedAt = plan.updatedAt;
|
|
892170
|
-
this.clampSelection();
|
|
892171
|
-
this.needsRender = true;
|
|
892172
|
-
}
|
|
892173
|
-
renderHeader(width) {
|
|
892174
|
-
const plan = this.store.getActivePlan();
|
|
892175
|
-
const counts = new Map;
|
|
892176
|
-
for (const status3 of Object.keys(STATUS_LABEL2))
|
|
892177
|
-
counts.set(status3, 0);
|
|
892178
|
-
for (const item of plan.items)
|
|
892179
|
-
counts.set(item.status, (counts.get(item.status) ?? 0) + 1);
|
|
892180
|
-
const active = this.items[this.selectedIndex];
|
|
892181
|
-
const header = [
|
|
892182
|
-
line(`Persistent Work Plan`, width, { fg: "#22d3ee", bold: true }),
|
|
892183
|
-
line(`Project ${plan.projectRoot}`, width, { fg: "#cbd5e1" }),
|
|
892184
|
-
line(`Items ${plan.items.length} pending ${counts.get("pending") ?? 0} active ${counts.get("in_progress") ?? 0} blocked ${counts.get("blocked") ?? 0} done ${counts.get("done") ?? 0}`, width, { fg: "#94a3b8" }),
|
|
892185
|
-
line(`Saved ${this.store.filePath}`, width, { fg: "#64748b" })
|
|
892186
|
-
];
|
|
892187
|
-
if (active) {
|
|
892188
|
-
header.push(line("", width));
|
|
892189
|
-
header.push(line(`Selected ${active.id} ${statusName(active.status)} updated ${compactDate(active.updatedAt)}`, width, { fg: "#a5b4fc" }));
|
|
892190
|
-
if (active.notes)
|
|
892191
|
-
header.push(line(`Notes ${active.notes}`, width, { fg: "#cbd5e1" }));
|
|
892192
|
-
}
|
|
892193
|
-
return header;
|
|
892194
|
-
}
|
|
892195
|
-
renderFooter(width) {
|
|
892196
|
-
return [
|
|
892197
|
-
line("Enter/Space cycle 1 pending 2 active 3 blocked 4 done 5 failed 6 cancelled d delete c clear done r refresh", width, { fg: "#94a3b8" })
|
|
892198
|
-
];
|
|
892199
|
-
}
|
|
892200
|
-
}
|
|
892201
|
-
|
|
892202
891058
|
// src/panels/builtin/agent.ts
|
|
892203
891059
|
function registerAgentPanels(manager5, deps) {
|
|
892204
891060
|
manager5.registerType({
|
|
@@ -892231,30 +891087,6 @@ function registerAgentPanels(manager5, deps) {
|
|
|
892231
891087
|
preload: true,
|
|
892232
891088
|
factory: () => new ContextVisualizerPanel(requireUiServices(deps).events.turns, deps.sessionMemoryStore, deps.configManager, deps.getOrchestratorUsage, deps.contextWindow, requireUiServices(deps).readModels.session)
|
|
892233
891089
|
});
|
|
892234
|
-
manager5.registerType({
|
|
892235
|
-
id: "work-plan",
|
|
892236
|
-
name: "Work Plan",
|
|
892237
|
-
icon: "L",
|
|
892238
|
-
category: "agent",
|
|
892239
|
-
description: "Persistent workspace checklist for multi-step work and cross-session task tracking",
|
|
892240
|
-
preload: true,
|
|
892241
|
-
factory: () => new WorkPlanPanel(deps.workPlanStore)
|
|
892242
|
-
});
|
|
892243
|
-
manager5.registerType({
|
|
892244
|
-
id: "project-planning",
|
|
892245
|
-
name: "Planning",
|
|
892246
|
-
icon: "P",
|
|
892247
|
-
category: "agent",
|
|
892248
|
-
description: "Passive project planning artifacts: readiness, questions, decisions, language, task graph, and agent handoff metadata",
|
|
892249
|
-
preload: true,
|
|
892250
|
-
factory: () => new ProjectPlanningPanel({
|
|
892251
|
-
service: deps.projectPlanningService,
|
|
892252
|
-
projectId: deps.projectPlanningProjectId,
|
|
892253
|
-
requestRender: deps.requestRender,
|
|
892254
|
-
submitAnswer: deps.submitPlanningAnswer,
|
|
892255
|
-
dismissPlanning: deps.dismissPlanning
|
|
892256
|
-
})
|
|
892257
|
-
});
|
|
892258
891090
|
manager5.registerType({
|
|
892259
891091
|
id: "schedule",
|
|
892260
891092
|
name: "Schedule",
|
|
@@ -892296,7 +891128,7 @@ function renderConfirmLines(width, state3) {
|
|
|
892296
891128
|
}
|
|
892297
891129
|
|
|
892298
891130
|
// src/panels/session-browser-panel.ts
|
|
892299
|
-
var
|
|
891131
|
+
var C14 = {
|
|
892300
891132
|
headerBg: "#1a1a2e",
|
|
892301
891133
|
headerFg: "#ffffff",
|
|
892302
891134
|
statusBar: "#222233",
|
|
@@ -892524,7 +891356,7 @@ class SessionBrowserPanel extends BasePanel {
|
|
|
892524
891356
|
[" Saved Panels ", DEFAULT_PANEL_PALETTE.label],
|
|
892525
891357
|
[String(selected.returnContext?.openPanels?.length ?? 0), (selected.returnContext?.openPanels?.length ?? 0) > 0 ? DEFAULT_PANEL_PALETTE.warn : DEFAULT_PANEL_PALETTE.dim]
|
|
892526
891358
|
]),
|
|
892527
|
-
...formatReturnContextLines(selected.returnContext).map((
|
|
891359
|
+
...formatReturnContextLines(selected.returnContext).map((line) => buildPanelLine(width, [[" ", DEFAULT_PANEL_PALETTE.dim], [truncateDisplay(line, Math.max(0, width - 2)), DEFAULT_PANEL_PALETTE.dim]])),
|
|
892528
891360
|
buildPanelLine(width, [[" Next ", DEFAULT_PANEL_PALETTE.label], ["/session resume", DEFAULT_PANEL_PALETTE.dim]])
|
|
892529
891361
|
]
|
|
892530
891362
|
} : { title: "Selected", lines: [] };
|
|
@@ -892556,19 +891388,19 @@ class SessionBrowserPanel extends BasePanel {
|
|
|
892556
891388
|
});
|
|
892557
891389
|
}
|
|
892558
891390
|
_renderSession(width, sess, isCursor) {
|
|
892559
|
-
const bg = isCursor ?
|
|
891391
|
+
const bg = isCursor ? C14.selectedBg : "";
|
|
892560
891392
|
const date5 = shortDate(sess.timestamp);
|
|
892561
891393
|
const cnt = String(sess.messageCount).padStart(3) + "m ";
|
|
892562
891394
|
const model = (sess.model || "unknown").slice(0, 18).padEnd(18) + " ";
|
|
892563
891395
|
const prefixLength = 1 + 16 + 1 + 4 + 19;
|
|
892564
891396
|
const title = truncateDisplay(sess.title || sess.name || "(untitled)", Math.max(0, width - prefixLength));
|
|
892565
891397
|
return buildStyledPanelLine(width, [
|
|
892566
|
-
{ text: isCursor ? "\u25B8" : " ", fg:
|
|
892567
|
-
{ text: date5, fg:
|
|
892568
|
-
{ text: " ", fg:
|
|
892569
|
-
{ text: cnt, fg:
|
|
892570
|
-
{ text: model, fg:
|
|
892571
|
-
{ text: title, fg: isCursor ?
|
|
891398
|
+
{ text: isCursor ? "\u25B8" : " ", fg: C14.selected, bg, bold: isCursor },
|
|
891399
|
+
{ text: date5, fg: C14.dateFg, bg },
|
|
891400
|
+
{ text: " ", fg: C14.normal, bg },
|
|
891401
|
+
{ text: cnt, fg: C14.countFg, bg },
|
|
891402
|
+
{ text: model, fg: C14.modelFg, bg },
|
|
891403
|
+
{ text: title, fg: isCursor ? C14.selected : C14.normal, bg, bold: isCursor }
|
|
892572
891404
|
]);
|
|
892573
891405
|
}
|
|
892574
891406
|
_load() {
|
|
@@ -892664,9 +891496,9 @@ function renderQrMatrix(modules, width, options) {
|
|
|
892664
891496
|
const matrixRowBot = termRow * 2 + 1;
|
|
892665
891497
|
const topRow = modules[matrixRowTop];
|
|
892666
891498
|
const botRow = matrixRowBot < rows ? modules[matrixRowBot] : null;
|
|
892667
|
-
const
|
|
891499
|
+
const line = createEmptyLine(width);
|
|
892668
891500
|
for (let col = 0;col < leftPad && col < width; col++) {
|
|
892669
|
-
|
|
891501
|
+
line[col] = createStyledCell(" ", { fg, bg });
|
|
892670
891502
|
}
|
|
892671
891503
|
for (let col = 0;col < cols; col++) {
|
|
892672
891504
|
const termCol = leftPad + col;
|
|
@@ -892696,21 +891528,21 @@ function renderQrMatrix(modules, width, options) {
|
|
|
892696
891528
|
}
|
|
892697
891529
|
const charWidth = getDisplayWidth(char);
|
|
892698
891530
|
if (charWidth <= 0) {
|
|
892699
|
-
|
|
891531
|
+
line[termCol] = createStyledCell(" ", { fg: cellFg, bg: cellBg });
|
|
892700
891532
|
} else {
|
|
892701
|
-
|
|
891533
|
+
line[termCol] = createStyledCell(char, { fg: cellFg, bg: cellBg });
|
|
892702
891534
|
}
|
|
892703
891535
|
}
|
|
892704
891536
|
for (let col = leftPad + cols;col < leftPad + cols + 1 && col < width; col++) {
|
|
892705
|
-
|
|
891537
|
+
line[col] = createStyledCell(" ", { fg, bg });
|
|
892706
891538
|
}
|
|
892707
|
-
lines.push(
|
|
891539
|
+
lines.push(line);
|
|
892708
891540
|
}
|
|
892709
891541
|
return lines;
|
|
892710
891542
|
}
|
|
892711
891543
|
|
|
892712
891544
|
// src/panels/qr-panel.ts
|
|
892713
|
-
var
|
|
891545
|
+
var C15 = {
|
|
892714
891546
|
...DEFAULT_PANEL_PALETTE,
|
|
892715
891547
|
url: "#38bdf8",
|
|
892716
891548
|
token: "#a78bfa",
|
|
@@ -892761,21 +891593,21 @@ class QrPanel extends BasePanel {
|
|
|
892761
891593
|
const { url: url2, token, username, password } = this.connectionInfo;
|
|
892762
891594
|
lines.push(createEmptyLine(width));
|
|
892763
891595
|
lines.push(buildPanelLine(width, [
|
|
892764
|
-
[" URL ",
|
|
892765
|
-
[url2.slice(0, Math.max(0, width - 12)),
|
|
891596
|
+
[" URL ", C15.label],
|
|
891597
|
+
[url2.slice(0, Math.max(0, width - 12)), C15.url]
|
|
892766
891598
|
]));
|
|
892767
891599
|
lines.push(buildPanelLine(width, [
|
|
892768
|
-
[" Token ",
|
|
892769
|
-
[token,
|
|
891600
|
+
[" Token ", C15.label],
|
|
891601
|
+
[token, C15.token]
|
|
892770
891602
|
]));
|
|
892771
891603
|
lines.push(buildPanelLine(width, [
|
|
892772
|
-
[" Username ",
|
|
892773
|
-
[username.slice(0, Math.max(0, width - 12)),
|
|
891604
|
+
[" Username ", C15.label],
|
|
891605
|
+
[username.slice(0, Math.max(0, width - 12)), C15.value]
|
|
892774
891606
|
]));
|
|
892775
891607
|
if (password !== undefined) {
|
|
892776
891608
|
lines.push(buildPanelLine(width, [
|
|
892777
|
-
[" Password ",
|
|
892778
|
-
[password,
|
|
891609
|
+
[" Password ", C15.label],
|
|
891610
|
+
[password, C15.value]
|
|
892779
891611
|
]));
|
|
892780
891612
|
}
|
|
892781
891613
|
lines.push(createEmptyLine(width));
|
|
@@ -892789,33 +891621,33 @@ class QrPanel extends BasePanel {
|
|
|
892789
891621
|
surface: this.connectionInfo.surface ?? GOODVIBES_AGENT_PAIRING_SURFACE
|
|
892790
891622
|
});
|
|
892791
891623
|
const matrix = generateQrMatrix(payload);
|
|
892792
|
-
const qrLines = renderQrMatrix(matrix.modules, width, { fg:
|
|
891624
|
+
const qrLines = renderQrMatrix(matrix.modules, width, { fg: C15.qrFg, bg: C15.qrBg });
|
|
892793
891625
|
for (const qrLine of qrLines) {
|
|
892794
891626
|
lines.push(qrLine);
|
|
892795
891627
|
}
|
|
892796
891628
|
} else {
|
|
892797
891629
|
lines.push(buildPanelLine(width, [
|
|
892798
|
-
[" Pairing unavailable ",
|
|
891630
|
+
[" Pairing unavailable ", C15.hint]
|
|
892799
891631
|
]));
|
|
892800
891632
|
lines.push(buildPanelLine(width, [
|
|
892801
|
-
[" Connected-host operator token is missing. Use confirmed setup to create or repair it. ",
|
|
891633
|
+
[" Connected-host operator token is missing. Use confirmed setup to create or repair it. ", C15.dim]
|
|
892802
891634
|
]));
|
|
892803
891635
|
lines.push(buildPanelLine(width, [
|
|
892804
|
-
[' agent_harness mode:"provision_connected_host_token" then reopen this panel. ',
|
|
891636
|
+
[' agent_harness mode:"provision_connected_host_token" then reopen this panel. ', C15.dim]
|
|
892805
891637
|
]));
|
|
892806
891638
|
}
|
|
892807
891639
|
lines.push(createEmptyLine(width));
|
|
892808
891640
|
if (this.lastStatus) {
|
|
892809
891641
|
lines.push(buildPanelLine(width, [
|
|
892810
|
-
[` ${this.lastStatus} `,
|
|
891642
|
+
[` ${this.lastStatus} `, C15.hint]
|
|
892811
891643
|
]));
|
|
892812
891644
|
}
|
|
892813
891645
|
const hintParts = this.connectionInfo.token ? [
|
|
892814
|
-
[" c ",
|
|
892815
|
-
["copy token",
|
|
891646
|
+
[" c ", C15.hint],
|
|
891647
|
+
["copy token", C15.dim]
|
|
892816
891648
|
] : [
|
|
892817
|
-
[" h ",
|
|
892818
|
-
["host auth required",
|
|
891649
|
+
[" h ", C15.hint],
|
|
891650
|
+
["host auth required", C15.dim]
|
|
892819
891651
|
];
|
|
892820
891652
|
const hintsLine = buildPanelLine(width, hintParts);
|
|
892821
891653
|
const remaining = height - lines.length;
|
|
@@ -892831,7 +891663,7 @@ class QrPanel extends BasePanel {
|
|
|
892831
891663
|
}
|
|
892832
891664
|
|
|
892833
891665
|
// src/panels/docs-panel.ts
|
|
892834
|
-
var
|
|
891666
|
+
var C16 = {
|
|
892835
891667
|
headerBg: "#1a1a2e",
|
|
892836
891668
|
headerFg: "#ffffff",
|
|
892837
891669
|
statusBar: "#222233",
|
|
@@ -892872,10 +891704,10 @@ var SHORTCUTS = [
|
|
|
892872
891704
|
{ key: "F2", desc: "Toggle shortcuts overlay" }
|
|
892873
891705
|
];
|
|
892874
891706
|
function renderRow(width, row, isCursor) {
|
|
892875
|
-
const bg = isCursor ?
|
|
891707
|
+
const bg = isCursor ? C16.selectedBg : row.bg;
|
|
892876
891708
|
return buildPanelLine(width, [
|
|
892877
|
-
[isCursor ? "\u25B8" : " ",
|
|
892878
|
-
[row.text, isCursor ?
|
|
891709
|
+
[isCursor ? "\u25B8" : " ", C16.selected, bg],
|
|
891710
|
+
[row.text, isCursor ? C16.selected : row.fg, bg]
|
|
892879
891711
|
]);
|
|
892880
891712
|
}
|
|
892881
891713
|
|
|
@@ -893026,13 +891858,13 @@ class DocsPanel extends BasePanel {
|
|
|
893026
891858
|
const tools3 = this.toolRegistry?.list() ?? [];
|
|
893027
891859
|
const filtered = q3 ? tools3.filter((t4) => t4.definition.name.toLowerCase().includes(q3) || (t4.definition.description ?? "").toLowerCase().includes(q3)) : tools3;
|
|
893028
891860
|
if (filtered.length === 0) {
|
|
893029
|
-
rows.push({ kind: "empty", text: " No tools match.", fg:
|
|
891861
|
+
rows.push({ kind: "empty", text: " No tools match.", fg: C16.dimFg, bg: "" });
|
|
893030
891862
|
} else {
|
|
893031
|
-
rows.push({ kind: "header", text: ` Tools (${filtered.length})`, fg:
|
|
891863
|
+
rows.push({ kind: "header", text: ` Tools (${filtered.length})`, fg: C16.sectionFg, bg: C16.sectionBg, bold: true });
|
|
893032
891864
|
for (const tool2 of filtered) {
|
|
893033
|
-
rows.push({ kind: "item", text: ` ${tool2.definition.name}`, fg:
|
|
891865
|
+
rows.push({ kind: "item", text: ` ${tool2.definition.name}`, fg: C16.toolFg, bg: "", bold: true });
|
|
893034
891866
|
if (tool2.definition.description) {
|
|
893035
|
-
rows.push({ kind: "detail", text: ` ${tool2.definition.description}`, fg:
|
|
891867
|
+
rows.push({ kind: "detail", text: ` ${tool2.definition.description}`, fg: C16.descFg, bg: "" });
|
|
893036
891868
|
}
|
|
893037
891869
|
const metadata2 = [];
|
|
893038
891870
|
if (tool2.definition.sideEffects && tool2.definition.sideEffects.length > 0) {
|
|
@@ -893048,7 +891880,7 @@ class DocsPanel extends BasePanel {
|
|
|
893048
891880
|
metadata2.push("streaming");
|
|
893049
891881
|
}
|
|
893050
891882
|
if (metadata2.length > 0) {
|
|
893051
|
-
rows.push({ kind: "detail", text: ` ${metadata2.join(" | ")}`, fg:
|
|
891883
|
+
rows.push({ kind: "detail", text: ` ${metadata2.join(" | ")}`, fg: C16.dimFg, bg: "" });
|
|
893052
891884
|
}
|
|
893053
891885
|
}
|
|
893054
891886
|
}
|
|
@@ -893056,7 +891888,7 @@ class DocsPanel extends BasePanel {
|
|
|
893056
891888
|
const models = this.providerRegistry?.listModels() ?? [];
|
|
893057
891889
|
const filtered = q3 ? models.filter((m3) => m3.id.toLowerCase().includes(q3) || m3.displayName.toLowerCase().includes(q3) || m3.provider.toLowerCase().includes(q3)) : models;
|
|
893058
891890
|
if (filtered.length === 0) {
|
|
893059
|
-
rows.push({ kind: "empty", text: " No models match.", fg:
|
|
891891
|
+
rows.push({ kind: "empty", text: " No models match.", fg: C16.dimFg, bg: "" });
|
|
893060
891892
|
} else {
|
|
893061
891893
|
const byProvider = new Map;
|
|
893062
891894
|
for (const m3 of filtered) {
|
|
@@ -893068,21 +891900,21 @@ class DocsPanel extends BasePanel {
|
|
|
893068
891900
|
arr.push(m3);
|
|
893069
891901
|
}
|
|
893070
891902
|
for (const [provider5, pModels] of byProvider) {
|
|
893071
|
-
rows.push({ kind: "header", text: ` ${provider5} (${pModels.length})`, fg:
|
|
891903
|
+
rows.push({ kind: "header", text: ` ${provider5} (${pModels.length})`, fg: C16.sectionFg, bg: C16.sectionBg, bold: true });
|
|
893072
891904
|
for (const m3 of pModels) {
|
|
893073
891905
|
const ctxK = m3.contextWindow > 0 ? `${(m3.contextWindow / 1000).toFixed(0)}k` : "?";
|
|
893074
891906
|
const caps = [m3.contextWindow > 0 ? `ctx:${ctxK}` : ""].filter(Boolean).join(" ");
|
|
893075
|
-
rows.push({ kind: "item", text: ` ${m3.displayName} ${caps}`, fg:
|
|
893076
|
-
rows.push({ kind: "detail", text: ` ${m3.id}`, fg:
|
|
891907
|
+
rows.push({ kind: "item", text: ` ${m3.displayName} ${caps}`, fg: C16.toolFg, bg: "" });
|
|
891908
|
+
rows.push({ kind: "detail", text: ` ${m3.id}`, fg: C16.descFg, bg: "" });
|
|
893077
891909
|
}
|
|
893078
891910
|
}
|
|
893079
891911
|
}
|
|
893080
891912
|
} else {
|
|
893081
891913
|
const filtered = q3 ? SHORTCUTS.filter((s4) => s4.key.toLowerCase().includes(q3) || s4.desc.toLowerCase().includes(q3)) : SHORTCUTS;
|
|
893082
|
-
rows.push({ kind: "header", text: " Keyboard Shortcuts", fg:
|
|
891914
|
+
rows.push({ kind: "header", text: " Keyboard Shortcuts", fg: C16.sectionFg, bg: C16.sectionBg, bold: true });
|
|
893083
891915
|
for (const s4 of filtered) {
|
|
893084
891916
|
const key = s4.key.padEnd(16);
|
|
893085
|
-
rows.push({ kind: "item", text: ` ${key} ${s4.desc}`, fg:
|
|
891917
|
+
rows.push({ kind: "item", text: ` ${key} ${s4.desc}`, fg: C16.valueFg, bg: "" });
|
|
893086
891918
|
}
|
|
893087
891919
|
}
|
|
893088
891920
|
this.rows = rows;
|
|
@@ -893096,10 +891928,10 @@ function wrapWithHangingIndent(text, width, indent2, maxLines) {
|
|
|
893096
891928
|
const safeWidth = Math.max(1, width);
|
|
893097
891929
|
const indentWidth = getDisplayWidth(indent2);
|
|
893098
891930
|
const wrapped = wrapText(text, safeWidth);
|
|
893099
|
-
const lines = wrapped.map((
|
|
891931
|
+
const lines = wrapped.map((line, index) => {
|
|
893100
891932
|
if (index === 0)
|
|
893101
|
-
return truncateDisplay(
|
|
893102
|
-
return `${indent2}${truncateDisplay(
|
|
891933
|
+
return truncateDisplay(line, safeWidth);
|
|
891934
|
+
return `${indent2}${truncateDisplay(line, Math.max(1, safeWidth - indentWidth))}`;
|
|
893103
891935
|
});
|
|
893104
891936
|
return typeof maxLines === "number" ? lines.slice(0, maxLines) : lines;
|
|
893105
891937
|
}
|
|
@@ -893152,7 +891984,7 @@ function agentWorkspaceCommandForPanel(panelId) {
|
|
|
893152
891984
|
}
|
|
893153
891985
|
|
|
893154
891986
|
// src/panels/panel-list-panel.ts
|
|
893155
|
-
var
|
|
891987
|
+
var C17 = {
|
|
893156
891988
|
...DEFAULT_PANEL_PALETTE,
|
|
893157
891989
|
header: "#94a3b8",
|
|
893158
891990
|
headerBg: "#1e293b",
|
|
@@ -893185,7 +892017,7 @@ function wrapPanelDescription(text, width, maxLines = 2) {
|
|
|
893185
892017
|
if (width <= 0)
|
|
893186
892018
|
return [""];
|
|
893187
892019
|
const lines = wrapWithHangingIndent(text, width, "", maxLines);
|
|
893188
|
-
return lines.length > 0 ? lines.map((
|
|
892020
|
+
return lines.length > 0 ? lines.map((line) => truncateDisplay(line, width)) : [""];
|
|
893189
892021
|
}
|
|
893190
892022
|
|
|
893191
892023
|
class PanelListPanel extends BasePanel {
|
|
@@ -893326,16 +892158,16 @@ class PanelListPanel extends BasePanel {
|
|
|
893326
892158
|
intro,
|
|
893327
892159
|
sections: [{
|
|
893328
892160
|
title: "Filter",
|
|
893329
|
-
lines: [buildSearchInputLine(width, "Filter: ", `${this._query}${this._filterFocused ? "_" : ""}`,
|
|
892161
|
+
lines: [buildSearchInputLine(width, "Filter: ", `${this._query}${this._filterFocused ? "_" : ""}`, C17, {
|
|
893330
892162
|
active: this._filterFocused,
|
|
893331
|
-
bg:
|
|
892163
|
+
bg: C17.searchBg,
|
|
893332
892164
|
emptyLabel: this._filterFocused ? "(type to filter)" : "(/ or up at top)",
|
|
893333
|
-
valueColor:
|
|
892165
|
+
valueColor: C17.search
|
|
893334
892166
|
})]
|
|
893335
892167
|
}, {
|
|
893336
|
-
lines: buildEmptyState(width, " No panels match filter.", "Clear the filter or search for another panel by id, name, description, or category.", [{ command: "/agent", summary: "open the Agent workspace" }],
|
|
892168
|
+
lines: buildEmptyState(width, " No panels match filter.", "Clear the filter or search for another panel by id, name, description, or category.", [{ command: "/agent", summary: "open the Agent workspace" }], C17)
|
|
893337
892169
|
}],
|
|
893338
|
-
palette:
|
|
892170
|
+
palette: C17
|
|
893339
892171
|
});
|
|
893340
892172
|
while (lines2.length < height)
|
|
893341
892173
|
lines2.push(createEmptyLine(width));
|
|
@@ -893351,22 +892183,22 @@ class PanelListPanel extends BasePanel {
|
|
|
893351
892183
|
const selectedPanel = this._getSelectedPanelEntry(entries);
|
|
893352
892184
|
const selectedRoute = selectedPanel ? agentWorkspaceCommandForPanel(selectedPanel.reg.id) : "/agent";
|
|
893353
892185
|
const selectedArea = selectedPanel ? agentWorkspaceCategoryForPanel(selectedPanel.reg.id) : "home";
|
|
893354
|
-
const footerLines = [buildPanelLine(width, [[` [${this._selectedIndex + 1}/${panelEntries.length}] \u2191/\u2193 nav Enter route / filter Esc clear`.slice(0, width),
|
|
892186
|
+
const footerLines = [buildPanelLine(width, [[` [${this._selectedIndex + 1}/${panelEntries.length}] \u2191/\u2193 nav Enter route / filter Esc clear`.slice(0, width), C17.hint]])];
|
|
893355
892187
|
const postureLines = [
|
|
893356
892188
|
buildKeyValueLine(width, [
|
|
893357
|
-
{ label: "copied open", value: String(pm.getAllOpen().length), valueColor: pm.getAllOpen().length > 0 ?
|
|
893358
|
-
{ label: "agent route", value: selectedRoute, valueColor:
|
|
893359
|
-
{ label: "area", value: selectedArea, valueColor:
|
|
893360
|
-
{ label: "results", value: String(panelEntries.length), valueColor:
|
|
893361
|
-
],
|
|
893362
|
-
buildPanelLine(width, [[` ${truncateDisplay(this._routeMessage, Math.max(0, width - 1))}`,
|
|
892189
|
+
{ label: "copied open", value: String(pm.getAllOpen().length), valueColor: pm.getAllOpen().length > 0 ? C17.name : C17.dim },
|
|
892190
|
+
{ label: "agent route", value: selectedRoute, valueColor: C17.info },
|
|
892191
|
+
{ label: "area", value: selectedArea, valueColor: C17.value },
|
|
892192
|
+
{ label: "results", value: String(panelEntries.length), valueColor: C17.value }
|
|
892193
|
+
], C17),
|
|
892194
|
+
buildPanelLine(width, [[` ${truncateDisplay(this._routeMessage, Math.max(0, width - 1))}`, C17.intro]])
|
|
893363
892195
|
];
|
|
893364
892196
|
const entryLines = [
|
|
893365
|
-
buildSearchInputLine(width, "Filter: ", `${this._query}${this._filterFocused ? "_" : ""}`,
|
|
892197
|
+
buildSearchInputLine(width, "Filter: ", `${this._query}${this._filterFocused ? "_" : ""}`, C17, {
|
|
893366
892198
|
active: this._filterFocused,
|
|
893367
|
-
bg:
|
|
892199
|
+
bg: C17.searchBg,
|
|
893368
892200
|
emptyLabel: this._filterFocused ? "(type to filter)" : "(/ or up at top)",
|
|
893369
|
-
valueColor:
|
|
892201
|
+
valueColor: C17.search
|
|
893370
892202
|
})
|
|
893371
892203
|
];
|
|
893372
892204
|
const renderedBlocks = [];
|
|
@@ -893376,7 +892208,7 @@ class PanelListPanel extends BasePanel {
|
|
|
893376
892208
|
const label = ` \u2500\u2500 ${CATEGORY_LABELS[entry.category]} ${"\u2500".repeat(Math.max(0, width - 6 - CATEGORY_LABELS[entry.category].length))}`;
|
|
893377
892209
|
renderedBlocks.push({
|
|
893378
892210
|
entry,
|
|
893379
|
-
lines: [buildPanelLine(width, [[label.slice(0, width),
|
|
892211
|
+
lines: [buildPanelLine(width, [[label.slice(0, width), C17.category, C17.categoryBg]])]
|
|
893380
892212
|
});
|
|
893381
892213
|
} else {
|
|
893382
892214
|
const flatIdx = flatPanelIndex++;
|
|
@@ -893384,8 +892216,8 @@ class PanelListPanel extends BasePanel {
|
|
|
893384
892216
|
const isTopOpen = topIds.has(entry.reg.id);
|
|
893385
892217
|
const isBottomOpen = bottomIds.has(entry.reg.id);
|
|
893386
892218
|
const dot = isTopOpen || isBottomOpen ? "\u25CF" : "\u25CB";
|
|
893387
|
-
const dotColor = isTopOpen || isBottomOpen ?
|
|
893388
|
-
const nameColor = isSelected ?
|
|
892219
|
+
const dotColor = isTopOpen || isBottomOpen ? C17.openDot : C17.closedDot;
|
|
892220
|
+
const nameColor = isSelected ? C17.selected : C17.name;
|
|
893389
892221
|
const nameStr = entry.reg.name.padEnd(NAME_COL_WIDTH, " ").slice(0, NAME_COL_WIDTH);
|
|
893390
892222
|
const descStartCol = PREFIX_WIDTH + NAME_COL_WIDTH + 1;
|
|
893391
892223
|
const descWidth = Math.max(1, width - descStartCol);
|
|
@@ -893394,18 +892226,18 @@ class PanelListPanel extends BasePanel {
|
|
|
893394
892226
|
const blockLines = [
|
|
893395
892227
|
buildPanelListRow(width, [
|
|
893396
892228
|
{ text: dot, fg: dotColor },
|
|
893397
|
-
{ text: routeCategory.charAt(0).toUpperCase(), fg: isSelected ?
|
|
893398
|
-
{ text: " ", fg:
|
|
892229
|
+
{ text: routeCategory.charAt(0).toUpperCase(), fg: isSelected ? C17.selIcon : C17.icon },
|
|
892230
|
+
{ text: " ", fg: C17.dim },
|
|
893399
892231
|
{ text: `${nameStr} `, fg: nameColor },
|
|
893400
|
-
{ text: descLines[0] ?? "", fg:
|
|
893401
|
-
],
|
|
892232
|
+
{ text: descLines[0] ?? "", fg: C17.desc }
|
|
892233
|
+
], C17, { selected: isSelected, selectedBg: C17.selectedBg, markerColor: C17.selIcon })
|
|
893402
892234
|
];
|
|
893403
892235
|
if ((descLines[1] ?? "").length > 0) {
|
|
893404
892236
|
blockLines.push(buildPanelLine(width, [
|
|
893405
|
-
[" ".repeat(PREFIX_WIDTH),
|
|
893406
|
-
[" ".repeat(NAME_COL_WIDTH),
|
|
893407
|
-
[" ",
|
|
893408
|
-
[descLines[1] ?? "",
|
|
892237
|
+
[" ".repeat(PREFIX_WIDTH), C17.dim, isSelected ? C17.selectedBg : C17.surfaceBg],
|
|
892238
|
+
[" ".repeat(NAME_COL_WIDTH), C17.dim, isSelected ? C17.selectedBg : C17.surfaceBg],
|
|
892239
|
+
[" ", C17.dim, isSelected ? C17.selectedBg : C17.surfaceBg],
|
|
892240
|
+
[descLines[1] ?? "", C17.desc, isSelected ? C17.selectedBg : C17.surfaceBg]
|
|
893409
892241
|
]));
|
|
893410
892242
|
}
|
|
893411
892243
|
renderedBlocks.push({ entry, lines: blockLines, panelFlatIndex: flatIdx });
|
|
@@ -893419,11 +892251,11 @@ class PanelListPanel extends BasePanel {
|
|
|
893419
892251
|
}
|
|
893420
892252
|
const selectedEntryIndex = renderedBlocks.findIndex((block2) => block2.panelFlatIndex === this._selectedIndex);
|
|
893421
892253
|
const selectedRow = selectedEntryIndex >= 0 ? blockStarts[selectedEntryIndex] ?? 0 : 0;
|
|
893422
|
-
const postureSection = { lines: buildSummaryBlock(width, "Route posture", postureLines,
|
|
892254
|
+
const postureSection = { lines: buildSummaryBlock(width, "Route posture", postureLines, C17) };
|
|
893423
892255
|
const resolvedSection = resolvePrimaryScrollableSection(width, height, {
|
|
893424
892256
|
intro,
|
|
893425
892257
|
footerLines,
|
|
893426
|
-
palette:
|
|
892258
|
+
palette: C17,
|
|
893427
892259
|
beforeSections: [postureSection],
|
|
893428
892260
|
section: {
|
|
893429
892261
|
title: "Panels",
|
|
@@ -893434,7 +892266,7 @@ class PanelListPanel extends BasePanel {
|
|
|
893434
892266
|
guardRows: 1,
|
|
893435
892267
|
minRows: 1,
|
|
893436
892268
|
appendWindowSummary: {
|
|
893437
|
-
dimColor:
|
|
892269
|
+
dimColor: C17.dim
|
|
893438
892270
|
}
|
|
893439
892271
|
}
|
|
893440
892272
|
});
|
|
@@ -893448,7 +892280,7 @@ class PanelListPanel extends BasePanel {
|
|
|
893448
892280
|
intro,
|
|
893449
892281
|
sections,
|
|
893450
892282
|
footerLines,
|
|
893451
|
-
palette:
|
|
892283
|
+
palette: C17
|
|
893452
892284
|
});
|
|
893453
892285
|
while (lines.length < height)
|
|
893454
892286
|
lines.push(createEmptyLine(width));
|
|
@@ -893520,7 +892352,7 @@ class PanelListPanel extends BasePanel {
|
|
|
893520
892352
|
}
|
|
893521
892353
|
|
|
893522
892354
|
// src/panels/token-budget-panel.ts
|
|
893523
|
-
var
|
|
892355
|
+
var C18 = {
|
|
893524
892356
|
title: "#00ffff",
|
|
893525
892357
|
input: "#00ffff",
|
|
893526
892358
|
output: "#d000ff",
|
|
@@ -893680,10 +892512,10 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893680
892512
|
session: sessionSnapshot?.session
|
|
893681
892513
|
});
|
|
893682
892514
|
const lines = [
|
|
893683
|
-
this.paintTextLine(` ${status3.summary}`, width,
|
|
892515
|
+
this.paintTextLine(` ${status3.summary}`, width, C18.label)
|
|
893684
892516
|
];
|
|
893685
892517
|
if (status3.reasons[0]) {
|
|
893686
|
-
lines.push(this.paintTextLine(` ${status3.reasons[0]}`, width,
|
|
892518
|
+
lines.push(this.paintTextLine(` ${status3.reasons[0]}`, width, C18.dim, { dim: true }));
|
|
893687
892519
|
}
|
|
893688
892520
|
if (status3.guidanceMode !== "off" && status3.nextSteps.length > 0) {
|
|
893689
892521
|
lines.push(buildGuidanceLine(width, status3.nextSteps[0], "open the next maintenance action directly", DEFAULT_PANEL_PALETTE));
|
|
@@ -893692,19 +892524,19 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893692
892524
|
}
|
|
893693
892525
|
renderStackedBar(width, u4, label) {
|
|
893694
892526
|
const lines = [];
|
|
893695
|
-
const labelLine = this.paintTextLine(` ${label}:`, width,
|
|
892527
|
+
const labelLine = this.paintTextLine(` ${label}:`, width, C18.label);
|
|
893696
892528
|
lines.push(labelLine);
|
|
893697
892529
|
const total = u4.input + u4.output + u4.cacheRead + u4.cacheWrite;
|
|
893698
892530
|
if (total === 0) {
|
|
893699
|
-
lines.push(this.paintTextLine(" (no data)", width,
|
|
892531
|
+
lines.push(this.paintTextLine(" (no data)", width, C18.dim, { dim: true }));
|
|
893700
892532
|
return lines;
|
|
893701
892533
|
}
|
|
893702
892534
|
const BAR_W = Math.max(10, Math.min(40, width - 4));
|
|
893703
892535
|
const segments = [
|
|
893704
|
-
{ color:
|
|
893705
|
-
{ color:
|
|
893706
|
-
{ color:
|
|
893707
|
-
{ color:
|
|
892536
|
+
{ color: C18.input, label: "In", count: u4.input, cells: 0 },
|
|
892537
|
+
{ color: C18.output, label: "Out", count: u4.output, cells: 0 },
|
|
892538
|
+
{ color: C18.cacheRead, label: "CR", count: u4.cacheRead, cells: 0 },
|
|
892539
|
+
{ color: C18.cacheWrite, label: "CW", count: u4.cacheWrite, cells: 0 }
|
|
893708
892540
|
].filter((s4) => s4.count > 0);
|
|
893709
892541
|
let assigned = 0;
|
|
893710
892542
|
for (const seg of segments) {
|
|
@@ -893718,24 +892550,24 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893718
892550
|
}
|
|
893719
892551
|
const usedCells = segments.reduce((sum, seg) => sum + seg.cells, 0);
|
|
893720
892552
|
lines.push(buildStyledPanelLine(width, [
|
|
893721
|
-
{ text: " [", fg:
|
|
892553
|
+
{ text: " [", fg: C18.label },
|
|
893722
892554
|
...segments.map((seg) => ({ text: "#".repeat(seg.cells), fg: seg.color })),
|
|
893723
|
-
{ text: ".".repeat(Math.max(0, BAR_W - usedCells)), fg:
|
|
893724
|
-
{ text: "]", fg:
|
|
892555
|
+
{ text: ".".repeat(Math.max(0, BAR_W - usedCells)), fg: C18.barBg },
|
|
892556
|
+
{ text: "]", fg: C18.label }
|
|
893725
892557
|
]));
|
|
893726
892558
|
const allSegs = [
|
|
893727
|
-
{ color:
|
|
893728
|
-
{ color:
|
|
893729
|
-
{ color:
|
|
893730
|
-
{ color:
|
|
892559
|
+
{ color: C18.input, label: "In", count: u4.input },
|
|
892560
|
+
{ color: C18.output, label: "Out", count: u4.output },
|
|
892561
|
+
{ color: C18.cacheRead, label: "CR", count: u4.cacheRead },
|
|
892562
|
+
{ color: C18.cacheWrite, label: "CW", count: u4.cacheWrite }
|
|
893731
892563
|
];
|
|
893732
892564
|
lines.push(buildStyledPanelLine(width, [
|
|
893733
|
-
{ text: " ", fg:
|
|
892565
|
+
{ text: " ", fg: C18.dim },
|
|
893734
892566
|
...allSegs.flatMap((seg) => [
|
|
893735
892567
|
{ text: `${seg.label}:`, fg: seg.color },
|
|
893736
|
-
{ text: `${fmtTok(seg.count)} `, fg:
|
|
892568
|
+
{ text: `${fmtTok(seg.count)} `, fg: C18.value }
|
|
893737
892569
|
]),
|
|
893738
|
-
{ text: ` Total:${fmtTok(total)}`, fg:
|
|
892570
|
+
{ text: ` Total:${fmtTok(total)}`, fg: C18.value, bold: true }
|
|
893739
892571
|
]));
|
|
893740
892572
|
return lines;
|
|
893741
892573
|
}
|
|
@@ -893746,43 +892578,43 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893746
892578
|
let barColor;
|
|
893747
892579
|
let warnSuffix = "";
|
|
893748
892580
|
if (pct >= WARN_RED) {
|
|
893749
|
-
barColor =
|
|
892581
|
+
barColor = C18.warnRed;
|
|
893750
892582
|
warnSuffix = " ! CRITICAL";
|
|
893751
892583
|
} else if (pct >= WARN_YELLOW) {
|
|
893752
|
-
barColor =
|
|
892584
|
+
barColor = C18.warnYellow;
|
|
893753
892585
|
warnSuffix = " ! HIGH";
|
|
893754
892586
|
} else {
|
|
893755
|
-
barColor =
|
|
892587
|
+
barColor = C18.good;
|
|
893756
892588
|
}
|
|
893757
892589
|
const label = " Context: ";
|
|
893758
892590
|
const suffix = ` ${fmtTok(this.lastInputTokens)}/${fmtTok(this.contextWindow)} (${pctInt}%)${warnSuffix}`;
|
|
893759
892591
|
const BAR_W = Math.max(8, width - label.length - suffix.length - 2);
|
|
893760
892592
|
const filled = Math.round(pct * BAR_W);
|
|
893761
892593
|
lines.push(buildStyledPanelLine(width, [
|
|
893762
|
-
{ text: label, fg:
|
|
892594
|
+
{ text: label, fg: C18.label },
|
|
893763
892595
|
{ text: "#".repeat(filled), fg: barColor, dim: pct < WARN_YELLOW },
|
|
893764
|
-
{ text: ".".repeat(Math.max(0, BAR_W - filled)), fg:
|
|
892596
|
+
{ text: ".".repeat(Math.max(0, BAR_W - filled)), fg: C18.barBg, dim: pct < WARN_YELLOW },
|
|
893765
892597
|
{ text: suffix, fg: barColor, dim: pct < WARN_YELLOW }
|
|
893766
892598
|
]));
|
|
893767
892599
|
return lines;
|
|
893768
892600
|
}
|
|
893769
892601
|
renderTotals(width) {
|
|
893770
892602
|
const lines = [];
|
|
893771
|
-
lines.push(this.paintTextLine(" Session Totals:", width,
|
|
892603
|
+
lines.push(this.paintTextLine(" Session Totals:", width, C18.label));
|
|
893772
892604
|
const u4 = this.sessionUsage;
|
|
893773
892605
|
const total = u4.input + u4.output + u4.cacheRead + u4.cacheWrite;
|
|
893774
892606
|
const rows = [
|
|
893775
|
-
[" Input: ", u4.input,
|
|
893776
|
-
[" Output: ", u4.output,
|
|
893777
|
-
[" Cache Read: ", u4.cacheRead,
|
|
893778
|
-
[" Cache Write:", u4.cacheWrite,
|
|
893779
|
-
[" Total: ", total,
|
|
892607
|
+
[" Input: ", u4.input, C18.input],
|
|
892608
|
+
[" Output: ", u4.output, C18.output],
|
|
892609
|
+
[" Cache Read: ", u4.cacheRead, C18.cacheRead],
|
|
892610
|
+
[" Cache Write:", u4.cacheWrite, C18.cacheWrite],
|
|
892611
|
+
[" Total: ", total, C18.value]
|
|
893780
892612
|
];
|
|
893781
892613
|
for (const [lbl, val, color2] of rows) {
|
|
893782
892614
|
if (lines.length >= 8)
|
|
893783
892615
|
break;
|
|
893784
892616
|
lines.push(buildStyledPanelLine(width, [
|
|
893785
|
-
{ text: lbl, fg:
|
|
892617
|
+
{ text: lbl, fg: C18.label },
|
|
893786
892618
|
{ text: fmtTok(val), fg: color2, bold: lbl.includes("Total") }
|
|
893787
892619
|
]));
|
|
893788
892620
|
}
|
|
@@ -893799,7 +892631,7 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893799
892631
|
for (const ch of h3.slice(0, cols[i5])) {
|
|
893800
892632
|
if (hx >= width)
|
|
893801
892633
|
break;
|
|
893802
|
-
colLine[hx++] = createStyledCell(ch, { fg:
|
|
892634
|
+
colLine[hx++] = createStyledCell(ch, { fg: C18.turnHeader, dim: true });
|
|
893803
892635
|
}
|
|
893804
892636
|
}
|
|
893805
892637
|
lines.push(colLine);
|
|
@@ -893811,26 +892643,26 @@ class TokenBudgetPanel extends BasePanel {
|
|
|
893811
892643
|
const turnNum = this.turnHistory.length - toShow.length + i5 + 1;
|
|
893812
892644
|
const total = t4.input + t4.output + t4.cacheRead + t4.cacheWrite;
|
|
893813
892645
|
const cells = [
|
|
893814
|
-
[String(turnNum).padStart(3),
|
|
893815
|
-
[fmtTok(t4.input).padStart(9),
|
|
893816
|
-
[fmtTok(t4.output).padStart(9),
|
|
893817
|
-
[fmtTok(t4.cacheRead).padStart(6),
|
|
893818
|
-
[fmtTok(t4.cacheWrite).padStart(6),
|
|
893819
|
-
[fmtTok(total).padStart(9),
|
|
892646
|
+
[String(turnNum).padStart(3), C18.dim],
|
|
892647
|
+
[fmtTok(t4.input).padStart(9), C18.input],
|
|
892648
|
+
[fmtTok(t4.output).padStart(9), C18.output],
|
|
892649
|
+
[fmtTok(t4.cacheRead).padStart(6), C18.cacheRead],
|
|
892650
|
+
[fmtTok(t4.cacheWrite).padStart(6), C18.cacheWrite],
|
|
892651
|
+
[fmtTok(total).padStart(9), C18.value]
|
|
893820
892652
|
];
|
|
893821
892653
|
lines.push(buildStyledPanelLine(width, cells.map(([val, color2]) => ({ text: val, fg: color2 }))));
|
|
893822
892654
|
});
|
|
893823
892655
|
return lines;
|
|
893824
892656
|
}
|
|
893825
892657
|
paintTextLine(text, width, fg, opts = {}) {
|
|
893826
|
-
const
|
|
892658
|
+
const line = createEmptyLine(width);
|
|
893827
892659
|
let x2 = 0;
|
|
893828
892660
|
for (const ch of text) {
|
|
893829
892661
|
if (x2 >= width)
|
|
893830
892662
|
break;
|
|
893831
|
-
|
|
892663
|
+
line[x2++] = createStyledCell(ch, { fg, bold: opts.bold, dim: opts.dim });
|
|
893832
892664
|
}
|
|
893833
|
-
return
|
|
892665
|
+
return line;
|
|
893834
892666
|
}
|
|
893835
892667
|
}
|
|
893836
892668
|
|
|
@@ -893849,10 +892681,10 @@ function getLocalNetworkIp3() {
|
|
|
893849
892681
|
function readBootstrapPassword(credentialPath) {
|
|
893850
892682
|
try {
|
|
893851
892683
|
const content = readFileSync98(credentialPath, "utf-8");
|
|
893852
|
-
for (const
|
|
892684
|
+
for (const line of content.split(`
|
|
893853
892685
|
`)) {
|
|
893854
|
-
if (
|
|
893855
|
-
return
|
|
892686
|
+
if (line.startsWith("password=")) {
|
|
892687
|
+
return line.slice("password=".length).trim();
|
|
893856
892688
|
}
|
|
893857
892689
|
}
|
|
893858
892690
|
} catch {}
|
|
@@ -893951,7 +892783,7 @@ function registerSessionPanels(manager5, deps) {
|
|
|
893951
892783
|
}
|
|
893952
892784
|
|
|
893953
892785
|
// src/panels/memory-panel.ts
|
|
893954
|
-
var
|
|
892786
|
+
var C19 = extendPalette(DEFAULT_PANEL_PALETTE, {
|
|
893955
892787
|
header: "#94a3b8",
|
|
893956
892788
|
headerBg: "#1e293b",
|
|
893957
892789
|
decision: "#38bdf8",
|
|
@@ -893974,23 +892806,23 @@ function fmtTime(ts2) {
|
|
|
893974
892806
|
function classColor(cls) {
|
|
893975
892807
|
switch (cls) {
|
|
893976
892808
|
case "decision":
|
|
893977
|
-
return
|
|
892809
|
+
return C19.decision;
|
|
893978
892810
|
case "constraint":
|
|
893979
|
-
return
|
|
892811
|
+
return C19.constraint;
|
|
893980
892812
|
case "incident":
|
|
893981
|
-
return
|
|
892813
|
+
return C19.incident;
|
|
893982
892814
|
case "pattern":
|
|
893983
|
-
return
|
|
892815
|
+
return C19.pattern;
|
|
893984
892816
|
case "fact":
|
|
893985
|
-
return
|
|
892817
|
+
return C19.fact;
|
|
893986
892818
|
case "risk":
|
|
893987
|
-
return
|
|
892819
|
+
return C19.risk;
|
|
893988
892820
|
case "runbook":
|
|
893989
|
-
return
|
|
892821
|
+
return C19.runbook;
|
|
893990
892822
|
case "architecture":
|
|
893991
|
-
return
|
|
892823
|
+
return C19.architecture;
|
|
893992
892824
|
case "ownership":
|
|
893993
|
-
return
|
|
892825
|
+
return C19.ownership;
|
|
893994
892826
|
}
|
|
893995
892827
|
}
|
|
893996
892828
|
|
|
@@ -894036,19 +892868,19 @@ class MemoryPanel extends SearchableListPanel {
|
|
|
894036
892868
|
return haystack.includes(q3);
|
|
894037
892869
|
}
|
|
894038
892870
|
renderItem(record2, index, selected, width) {
|
|
894039
|
-
const bg = selected ?
|
|
892871
|
+
const bg = selected ? C19.selected : undefined;
|
|
894040
892872
|
return buildPanelLine(width, [
|
|
894041
|
-
[" ",
|
|
892873
|
+
[" ", C19.label, bg],
|
|
894042
892874
|
[`[${record2.scope.slice(0, 1).toUpperCase()}/${record2.cls.slice(0, 3).toUpperCase()}] `, classColor(record2.cls), bg],
|
|
894043
|
-
[record2.id.slice(-8),
|
|
894044
|
-
[" ",
|
|
894045
|
-
[fmtTime(record2.createdAt),
|
|
894046
|
-
[" ",
|
|
894047
|
-
[record2.summary.slice(0, Math.max(0, width - 33)),
|
|
892875
|
+
[record2.id.slice(-8), C19.dim, bg],
|
|
892876
|
+
[" ", C19.label, bg],
|
|
892877
|
+
[fmtTime(record2.createdAt), C19.dim, bg],
|
|
892878
|
+
[" ", C19.label, bg],
|
|
892879
|
+
[record2.summary.slice(0, Math.max(0, width - 33)), C19.value, bg]
|
|
894048
892880
|
]);
|
|
894049
892881
|
}
|
|
894050
892882
|
getPalette() {
|
|
894051
|
-
return
|
|
892883
|
+
return C19;
|
|
894052
892884
|
}
|
|
894053
892885
|
getEmptyStateMessage() {
|
|
894054
892886
|
return this.searchQuery ? ` No records matching "${this.searchQuery}"` : " No memory records. Use /memory add <class> <summary> to create one.";
|
|
@@ -894099,30 +892931,30 @@ class MemoryPanel extends SearchableListPanel {
|
|
|
894099
892931
|
const filterLine = this.buildFilterInputLine(width, "Filter", this.filterFocused);
|
|
894100
892932
|
const summaryLines = [
|
|
894101
892933
|
buildKeyValueLine(width, [
|
|
894102
|
-
{ label: "records", value: String(records.length), valueColor:
|
|
894103
|
-
{ label: "facts", value: String(byClass2.get("fact") ?? 0), valueColor:
|
|
894104
|
-
{ label: "decisions", value: String(byClass2.get("decision") ?? 0), valueColor:
|
|
894105
|
-
{ label: "incidents", value: String(byClass2.get("incident") ?? 0), valueColor:
|
|
894106
|
-
{ label: "runbooks", value: String(byClass2.get("runbook") ?? 0), valueColor:
|
|
894107
|
-
],
|
|
892934
|
+
{ label: "records", value: String(records.length), valueColor: C19.value },
|
|
892935
|
+
{ label: "facts", value: String(byClass2.get("fact") ?? 0), valueColor: C19.fact },
|
|
892936
|
+
{ label: "decisions", value: String(byClass2.get("decision") ?? 0), valueColor: C19.decision },
|
|
892937
|
+
{ label: "incidents", value: String(byClass2.get("incident") ?? 0), valueColor: C19.incident },
|
|
892938
|
+
{ label: "runbooks", value: String(byClass2.get("runbook") ?? 0), valueColor: C19.runbook }
|
|
892939
|
+
], C19),
|
|
894108
892940
|
filterLine,
|
|
894109
|
-
buildGuidanceLine(width, "/memory review", "review durable memory and queue posture from the command workspace",
|
|
892941
|
+
buildGuidanceLine(width, "/memory review", "review durable memory and queue posture from the command workspace", C19)
|
|
894110
892942
|
];
|
|
894111
892943
|
const selected = records[this.selectedIndex];
|
|
894112
892944
|
const selectedLines = [];
|
|
894113
892945
|
if (selected) {
|
|
894114
892946
|
selectedLines.push(buildKeyValueLine(width, [
|
|
894115
|
-
{ label: "scope", value: selected.scope, valueColor:
|
|
892947
|
+
{ label: "scope", value: selected.scope, valueColor: C19.info },
|
|
894116
892948
|
{ label: "class", value: selected.cls, valueColor: classColor(selected.cls) },
|
|
894117
|
-
{ label: "created", value: fmtTime(selected.createdAt), valueColor:
|
|
894118
|
-
],
|
|
894119
|
-
selectedLines.push(...buildBodyText(width, selected.summary,
|
|
892949
|
+
{ label: "created", value: fmtTime(selected.createdAt), valueColor: C19.dim }
|
|
892950
|
+
], C19));
|
|
892951
|
+
selectedLines.push(...buildBodyText(width, selected.summary, C19, C19.value));
|
|
894120
892952
|
if (selected.detail)
|
|
894121
|
-
selectedLines.push(...buildBodyText(width, `Detail: ${selected.detail}`,
|
|
892953
|
+
selectedLines.push(...buildBodyText(width, `Detail: ${selected.detail}`, C19, C19.dim));
|
|
894122
892954
|
if (selected.tags.length)
|
|
894123
|
-
selectedLines.push(buildPanelLine(width, [[` Tags: ${selected.tags.join(", ")}`,
|
|
892955
|
+
selectedLines.push(buildPanelLine(width, [[` Tags: ${selected.tags.join(", ")}`, C19.good]]));
|
|
894124
892956
|
if (selected.provenance.length) {
|
|
894125
|
-
selectedLines.push(...buildBodyText(width, `Origin: ${formatAgentRecordReferences(selected.provenance)}`,
|
|
892957
|
+
selectedLines.push(...buildBodyText(width, `Origin: ${formatAgentRecordReferences(selected.provenance)}`, C19, C19.dim));
|
|
894126
892958
|
}
|
|
894127
892959
|
}
|
|
894128
892960
|
return this.renderList(width, height, {
|
|
@@ -894130,7 +892962,7 @@ class MemoryPanel extends SearchableListPanel {
|
|
|
894130
892962
|
header: summaryLines,
|
|
894131
892963
|
footer: [
|
|
894132
892964
|
...selectedLines,
|
|
894133
|
-
buildPanelLine(width, [[" / search j/k or Up/Down move r reload Esc clear search",
|
|
892965
|
+
buildPanelLine(width, [[" / search j/k or Up/Down move r reload Esc clear search", C19.dim]])
|
|
894134
892966
|
]
|
|
894135
892967
|
});
|
|
894136
892968
|
}
|
|
@@ -894140,7 +892972,7 @@ class MemoryPanel extends SearchableListPanel {
|
|
|
894140
892972
|
function summarize2(records, cls) {
|
|
894141
892973
|
return records.filter((record2) => record2.cls === cls).slice(0, 3);
|
|
894142
892974
|
}
|
|
894143
|
-
var
|
|
892975
|
+
var C20 = {
|
|
894144
892976
|
...DEFAULT_PANEL_PALETTE,
|
|
894145
892977
|
header: "#94a3b8",
|
|
894146
892978
|
headerBg: "#1e293b"
|
|
@@ -894148,14 +892980,14 @@ var C21 = {
|
|
|
894148
892980
|
function reviewStateColor(state3) {
|
|
894149
892981
|
switch (state3) {
|
|
894150
892982
|
case "reviewed":
|
|
894151
|
-
return
|
|
892983
|
+
return C20.good;
|
|
894152
892984
|
case "stale":
|
|
894153
|
-
return
|
|
892985
|
+
return C20.warn;
|
|
894154
892986
|
case "contradicted":
|
|
894155
|
-
return
|
|
892987
|
+
return C20.bad;
|
|
894156
892988
|
case "fresh":
|
|
894157
892989
|
default:
|
|
894158
|
-
return
|
|
892990
|
+
return C20.info;
|
|
894159
892991
|
}
|
|
894160
892992
|
}
|
|
894161
892993
|
function formatConfidence(confidence) {
|
|
@@ -894196,16 +893028,16 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894196
893028
|
return this.records;
|
|
894197
893029
|
}
|
|
894198
893030
|
renderItem(record2, index, selected, width) {
|
|
894199
|
-
const bg = selected ?
|
|
893031
|
+
const bg = selected ? C20.selectBg : undefined;
|
|
894200
893032
|
return buildPanelLine(width, [
|
|
894201
|
-
[" ",
|
|
893033
|
+
[" ", C20.label, bg],
|
|
894202
893034
|
[record2.reviewState.padEnd(13), reviewStateColor(record2.reviewState), bg],
|
|
894203
|
-
[` ${formatConfidence(record2.confidence)} `,
|
|
894204
|
-
[record2.summary.slice(0, Math.max(0, width - 26)),
|
|
893035
|
+
[` ${formatConfidence(record2.confidence)} `, C20.value, bg],
|
|
893036
|
+
[record2.summary.slice(0, Math.max(0, width - 26)), C20.value, bg]
|
|
894205
893037
|
]);
|
|
894206
893038
|
}
|
|
894207
893039
|
getPalette() {
|
|
894208
|
-
return
|
|
893040
|
+
return C20;
|
|
894209
893041
|
}
|
|
894210
893042
|
getEmptyStateMessage() {
|
|
894211
893043
|
return "No Agent Knowledge sources or local memory review records";
|
|
@@ -894327,40 +893159,40 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894327
893159
|
}
|
|
894328
893160
|
buildAgentKnowledgeHeader(width) {
|
|
894329
893161
|
const lines = [
|
|
894330
|
-
buildPanelLine(width, [[" Agent Knowledge Segment",
|
|
893162
|
+
buildPanelLine(width, [[" Agent Knowledge Segment", C20.label]]),
|
|
894331
893163
|
buildPanelLine(width, [
|
|
894332
|
-
[" route ",
|
|
894333
|
-
["/api/goodvibes-agent/knowledge/*",
|
|
894334
|
-
[" isolated: no default knowledge or non-Agent fallback",
|
|
893164
|
+
[" route ", C20.label],
|
|
893165
|
+
["/api/goodvibes-agent/knowledge/*", C20.info],
|
|
893166
|
+
[" isolated: no default knowledge or non-Agent fallback", C20.dim]
|
|
894335
893167
|
])
|
|
894336
893168
|
];
|
|
894337
893169
|
if (this.agentKnowledgeLoading && !this.agentKnowledgeStatus) {
|
|
894338
|
-
lines.push(buildPanelLine(width, [[" loading isolated Agent Knowledge status...",
|
|
893170
|
+
lines.push(buildPanelLine(width, [[" loading isolated Agent Knowledge status...", C20.dim]]));
|
|
894339
893171
|
} else if (this.agentKnowledgeStatus) {
|
|
894340
893172
|
const status3 = this.agentKnowledgeStatus;
|
|
894341
893173
|
lines.push(buildKeyValueLine(width, [
|
|
894342
|
-
{ label: "Ready", value: status3.ready ? "yes" : "no", valueColor: status3.ready ?
|
|
894343
|
-
{ label: "Sources", value: String(status3.sourceCount), valueColor: status3.sourceCount > 0 ?
|
|
894344
|
-
{ label: "Nodes", value: String(status3.nodeCount), valueColor: status3.nodeCount > 0 ?
|
|
894345
|
-
{ label: "Issues", value: String(status3.issueCount), valueColor: status3.issueCount > 0 ?
|
|
894346
|
-
],
|
|
893174
|
+
{ label: "Ready", value: status3.ready ? "yes" : "no", valueColor: status3.ready ? C20.good : C20.warn },
|
|
893175
|
+
{ label: "Sources", value: String(status3.sourceCount), valueColor: status3.sourceCount > 0 ? C20.info : C20.dim },
|
|
893176
|
+
{ label: "Nodes", value: String(status3.nodeCount), valueColor: status3.nodeCount > 0 ? C20.info : C20.dim },
|
|
893177
|
+
{ label: "Issues", value: String(status3.issueCount), valueColor: status3.issueCount > 0 ? C20.warn : C20.good }
|
|
893178
|
+
], C20));
|
|
894347
893179
|
const note = status3.note ? ` note: ${status3.note}` : "";
|
|
894348
|
-
lines.push(buildPanelLine(width, [[" storage: ",
|
|
893180
|
+
lines.push(buildPanelLine(width, [[" storage: ", C20.label], [status3.storagePath, C20.dim], [note, C20.dim]]));
|
|
894349
893181
|
} else {
|
|
894350
|
-
lines.push(buildPanelLine(width, [[" status: not loaded; /knowledge status uses the same isolated route.",
|
|
893182
|
+
lines.push(buildPanelLine(width, [[" status: not loaded; /knowledge status uses the same isolated route.", C20.dim]]));
|
|
894351
893183
|
}
|
|
894352
893184
|
if (this.agentKnowledgeError) {
|
|
894353
|
-
lines.push(...buildBodyText(width, `Agent Knowledge status warning: ${this.agentKnowledgeError}`,
|
|
893185
|
+
lines.push(...buildBodyText(width, `Agent Knowledge status warning: ${this.agentKnowledgeError}`, C20, C20.warn));
|
|
894354
893186
|
}
|
|
894355
893187
|
lines.push(buildPanelLine(width, [
|
|
894356
|
-
[" actions ",
|
|
894357
|
-
["/knowledge status",
|
|
894358
|
-
[" | ",
|
|
894359
|
-
["/knowledge ingest-url <url> --yes",
|
|
894360
|
-
[" | ",
|
|
894361
|
-
["/knowledge search <query>",
|
|
894362
|
-
[" | ",
|
|
894363
|
-
["/knowledge queue",
|
|
893188
|
+
[" actions ", C20.label],
|
|
893189
|
+
["/knowledge status", C20.value],
|
|
893190
|
+
[" | ", C20.dim],
|
|
893191
|
+
["/knowledge ingest-url <url> --yes", C20.value],
|
|
893192
|
+
[" | ", C20.dim],
|
|
893193
|
+
["/knowledge search <query>", C20.value],
|
|
893194
|
+
[" | ", C20.dim],
|
|
893195
|
+
["/knowledge queue", C20.value]
|
|
894364
893196
|
]));
|
|
894365
893197
|
return lines;
|
|
894366
893198
|
}
|
|
@@ -894371,8 +893203,8 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894371
893203
|
title: "Knowledge Control Room",
|
|
894372
893204
|
intro: "",
|
|
894373
893205
|
sections: [{ title: "Confirmation", lines: renderConfirmLines(width, this.confirm) }],
|
|
894374
|
-
footerLines: [buildPanelLine(width, [[" y confirm n / Esc cancel",
|
|
894375
|
-
palette:
|
|
893206
|
+
footerLines: [buildPanelLine(width, [[" y confirm n / Esc cancel", C20.dim]])],
|
|
893207
|
+
palette: C20
|
|
894376
893208
|
});
|
|
894377
893209
|
}
|
|
894378
893210
|
if (this.records.length === 0)
|
|
@@ -894384,7 +893216,7 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894384
893216
|
return this.renderList(width, height, {
|
|
894385
893217
|
title: "Knowledge Control Room",
|
|
894386
893218
|
header: agentKnowledgeHeader,
|
|
894387
|
-
footer: [buildPanelLine(width, [[" Review keys: Up/Down move r/Enter review s stale c contradicted f fresh",
|
|
893219
|
+
footer: [buildPanelLine(width, [[" Review keys: Up/Down move r/Enter review s stale c contradicted f fresh", C20.dim]])]
|
|
894388
893220
|
});
|
|
894389
893221
|
}
|
|
894390
893222
|
const queue = this.registry.reviewQueue(24);
|
|
@@ -894398,71 +893230,71 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894398
893230
|
}
|
|
894399
893231
|
const classLines = [
|
|
894400
893232
|
buildPanelLine(width, [
|
|
894401
|
-
[" facts ",
|
|
894402
|
-
[String(byClass2.get("fact") ?? 0),
|
|
894403
|
-
[" risks ",
|
|
894404
|
-
[String(byClass2.get("risk") ?? 0), (byClass2.get("risk") ?? 0) > 0 ?
|
|
894405
|
-
[" runbooks ",
|
|
894406
|
-
[String(byClass2.get("runbook") ?? 0),
|
|
894407
|
-
[" architecture ",
|
|
894408
|
-
[String(byClass2.get("architecture") ?? 0),
|
|
894409
|
-
[" incidents ",
|
|
894410
|
-
[String(byClass2.get("incident") ?? 0), (byClass2.get("incident") ?? 0) > 0 ?
|
|
893233
|
+
[" facts ", C20.label],
|
|
893234
|
+
[String(byClass2.get("fact") ?? 0), C20.good],
|
|
893235
|
+
[" risks ", C20.label],
|
|
893236
|
+
[String(byClass2.get("risk") ?? 0), (byClass2.get("risk") ?? 0) > 0 ? C20.warn : C20.good],
|
|
893237
|
+
[" runbooks ", C20.label],
|
|
893238
|
+
[String(byClass2.get("runbook") ?? 0), C20.info],
|
|
893239
|
+
[" architecture ", C20.label],
|
|
893240
|
+
[String(byClass2.get("architecture") ?? 0), C20.info],
|
|
893241
|
+
[" incidents ", C20.label],
|
|
893242
|
+
[String(byClass2.get("incident") ?? 0), (byClass2.get("incident") ?? 0) > 0 ? C20.bad : C20.good]
|
|
894411
893243
|
]),
|
|
894412
893244
|
buildPanelLine(width, [
|
|
894413
|
-
[" decisions ",
|
|
894414
|
-
[String(byClass2.get("decision") ?? 0),
|
|
894415
|
-
[" constraints ",
|
|
894416
|
-
[String(byClass2.get("constraint") ?? 0),
|
|
894417
|
-
[" ownership ",
|
|
894418
|
-
[String(byClass2.get("ownership") ?? 0),
|
|
894419
|
-
[" patterns ",
|
|
894420
|
-
[String(byClass2.get("pattern") ?? 0),
|
|
894421
|
-
[" total ",
|
|
894422
|
-
[String(records.length),
|
|
893245
|
+
[" decisions ", C20.label],
|
|
893246
|
+
[String(byClass2.get("decision") ?? 0), C20.value],
|
|
893247
|
+
[" constraints ", C20.label],
|
|
893248
|
+
[String(byClass2.get("constraint") ?? 0), C20.value],
|
|
893249
|
+
[" ownership ", C20.label],
|
|
893250
|
+
[String(byClass2.get("ownership") ?? 0), C20.value],
|
|
893251
|
+
[" patterns ", C20.label],
|
|
893252
|
+
[String(byClass2.get("pattern") ?? 0), C20.value],
|
|
893253
|
+
[" total ", C20.label],
|
|
893254
|
+
[String(records.length), C20.value]
|
|
894423
893255
|
])
|
|
894424
893256
|
];
|
|
894425
893257
|
const reviewLines = [
|
|
894426
893258
|
buildPanelLine(width, [
|
|
894427
|
-
[" reviewed ",
|
|
894428
|
-
[String(byReview.get("reviewed") ?? 0),
|
|
894429
|
-
[" fresh ",
|
|
894430
|
-
[String(byReview.get("fresh") ?? 0),
|
|
894431
|
-
[" stale ",
|
|
894432
|
-
[String(byReview.get("stale") ?? 0),
|
|
894433
|
-
[" contradicted ",
|
|
894434
|
-
[String(byReview.get("contradicted") ?? 0),
|
|
894435
|
-
[" Review Queue ",
|
|
894436
|
-
[String(queue.length), queue.length > 0 ?
|
|
893259
|
+
[" reviewed ", C20.label],
|
|
893260
|
+
[String(byReview.get("reviewed") ?? 0), C20.good],
|
|
893261
|
+
[" fresh ", C20.label],
|
|
893262
|
+
[String(byReview.get("fresh") ?? 0), C20.info],
|
|
893263
|
+
[" stale ", C20.label],
|
|
893264
|
+
[String(byReview.get("stale") ?? 0), C20.warn],
|
|
893265
|
+
[" contradicted ", C20.label],
|
|
893266
|
+
[String(byReview.get("contradicted") ?? 0), C20.bad],
|
|
893267
|
+
[" Review Queue ", C20.label],
|
|
893268
|
+
[String(queue.length), queue.length > 0 ? C20.warn : C20.good]
|
|
894437
893269
|
]),
|
|
894438
893270
|
buildPanelLine(width, [
|
|
894439
|
-
[" session ",
|
|
894440
|
-
[String(byScope.get("session") ?? 0),
|
|
894441
|
-
[" project ",
|
|
894442
|
-
[String(byScope.get("project") ?? 0),
|
|
894443
|
-
[" team ",
|
|
894444
|
-
[String(byScope.get("team") ?? 0),
|
|
893271
|
+
[" session ", C20.label],
|
|
893272
|
+
[String(byScope.get("session") ?? 0), C20.info],
|
|
893273
|
+
[" project ", C20.label],
|
|
893274
|
+
[String(byScope.get("project") ?? 0), C20.value],
|
|
893275
|
+
[" team ", C20.label],
|
|
893276
|
+
[String(byScope.get("team") ?? 0), C20.good]
|
|
894445
893277
|
]),
|
|
894446
|
-
buildGuidanceLine(width, "/memory review", "work the stale and contradicted queue from the command workspace",
|
|
893278
|
+
buildGuidanceLine(width, "/memory review", "work the stale and contradicted queue from the command workspace", C20)
|
|
894447
893279
|
];
|
|
894448
893280
|
const recentSummaryLines = [];
|
|
894449
893281
|
for (const [title, items, color2] of [
|
|
894450
|
-
["Recent Risks", summarize2(records, "risk"),
|
|
894451
|
-
["Runbooks", summarize2(records, "runbook"),
|
|
894452
|
-
["Architecture Notes", summarize2(records, "architecture"),
|
|
894453
|
-
["Recent Incidents", summarize2(records, "incident"),
|
|
893282
|
+
["Recent Risks", summarize2(records, "risk"), C20.warn],
|
|
893283
|
+
["Runbooks", summarize2(records, "runbook"), C20.info],
|
|
893284
|
+
["Architecture Notes", summarize2(records, "architecture"), C20.info],
|
|
893285
|
+
["Recent Incidents", summarize2(records, "incident"), C20.bad]
|
|
894454
893286
|
]) {
|
|
894455
893287
|
if (recentSummaryLines.length > 0) {
|
|
894456
|
-
recentSummaryLines.push(buildPanelLine(width, [["",
|
|
893288
|
+
recentSummaryLines.push(buildPanelLine(width, [["", C20.dim]]));
|
|
894457
893289
|
}
|
|
894458
|
-
recentSummaryLines.push(buildPanelLine(width, [[` ${title}`,
|
|
893290
|
+
recentSummaryLines.push(buildPanelLine(width, [[` ${title}`, C20.label]]));
|
|
894459
893291
|
if (items.length === 0) {
|
|
894460
|
-
recentSummaryLines.push(buildPanelLine(width, [[" none recorded",
|
|
893292
|
+
recentSummaryLines.push(buildPanelLine(width, [[" none recorded", C20.dim]]));
|
|
894461
893293
|
continue;
|
|
894462
893294
|
}
|
|
894463
893295
|
for (const item of items) {
|
|
894464
893296
|
recentSummaryLines.push(buildPanelLine(width, [
|
|
894465
|
-
[" ",
|
|
893297
|
+
[" ", C20.label],
|
|
894466
893298
|
[item.summary.slice(0, Math.max(0, width - 2)), color2]
|
|
894467
893299
|
]));
|
|
894468
893300
|
}
|
|
@@ -894470,31 +893302,31 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894470
893302
|
const selectedRecord = this.records[this.selectedIndex];
|
|
894471
893303
|
const selectedLines = [];
|
|
894472
893304
|
if (selectedRecord) {
|
|
894473
|
-
selectedLines.push(buildPanelLine(width, [[" Selected",
|
|
893305
|
+
selectedLines.push(buildPanelLine(width, [[" Selected", C20.label]]));
|
|
894474
893306
|
selectedLines.push(buildKeyValueLine(width, [
|
|
894475
|
-
{ label: "Class", value: selectedRecord.cls, valueColor:
|
|
894476
|
-
{ label: "Scope", value: selectedRecord.scope, valueColor:
|
|
893307
|
+
{ label: "Class", value: selectedRecord.cls, valueColor: C20.value },
|
|
893308
|
+
{ label: "Scope", value: selectedRecord.scope, valueColor: C20.info },
|
|
894477
893309
|
{ label: "Review", value: selectedRecord.reviewState, valueColor: reviewStateColor(selectedRecord.reviewState) },
|
|
894478
|
-
{ label: "Confidence", value: formatConfidence(selectedRecord.confidence), valueColor:
|
|
894479
|
-
],
|
|
894480
|
-
selectedLines.push(...buildBodyText(width, `Summary: ${selectedRecord.summary}`,
|
|
893310
|
+
{ label: "Confidence", value: formatConfidence(selectedRecord.confidence), valueColor: C20.value }
|
|
893311
|
+
], C20));
|
|
893312
|
+
selectedLines.push(...buildBodyText(width, `Summary: ${selectedRecord.summary}`, C20, C20.value));
|
|
894481
893313
|
if (selectedRecord.detail)
|
|
894482
|
-
selectedLines.push(...buildBodyText(width, `Detail: ${selectedRecord.detail}`,
|
|
893314
|
+
selectedLines.push(...buildBodyText(width, `Detail: ${selectedRecord.detail}`, C20, C20.dim));
|
|
894483
893315
|
if (selectedRecord.provenance.length) {
|
|
894484
|
-
selectedLines.push(...buildBodyText(width, `Origin: ${formatAgentRecordReferences(selectedRecord.provenance)}`,
|
|
893316
|
+
selectedLines.push(...buildBodyText(width, `Origin: ${formatAgentRecordReferences(selectedRecord.provenance)}`, C20, C20.dim));
|
|
894485
893317
|
}
|
|
894486
893318
|
if (selectedRecord.staleReason) {
|
|
894487
|
-
selectedLines.push(...buildBodyText(width, `Stale reason: ${selectedRecord.staleReason}`,
|
|
893319
|
+
selectedLines.push(...buildBodyText(width, `Stale reason: ${selectedRecord.staleReason}`, C20, selectedRecord.reviewState === "contradicted" ? C20.bad : C20.warn));
|
|
894488
893320
|
}
|
|
894489
893321
|
if (selectedRecord.reviewedAt) {
|
|
894490
893322
|
selectedLines.push(buildPanelLine(width, [
|
|
894491
|
-
[" Reviewed: ",
|
|
894492
|
-
[new Date(selectedRecord.reviewedAt).toLocaleString(),
|
|
893323
|
+
[" Reviewed: ", C20.label],
|
|
893324
|
+
[new Date(selectedRecord.reviewedAt).toLocaleString(), C20.dim]
|
|
894493
893325
|
]));
|
|
894494
893326
|
if (selectedRecord.reviewedBy) {
|
|
894495
893327
|
selectedLines.push(buildPanelLine(width, [
|
|
894496
|
-
[" Reviewer: ",
|
|
894497
|
-
[selectedRecord.reviewedBy,
|
|
893328
|
+
[" Reviewer: ", C20.label],
|
|
893329
|
+
[selectedRecord.reviewedBy, C20.dim]
|
|
894498
893330
|
]));
|
|
894499
893331
|
}
|
|
894500
893332
|
}
|
|
@@ -894503,7 +893335,7 @@ class KnowledgePanel extends ScrollableListPanel {
|
|
|
894503
893335
|
title: "Knowledge Control Room",
|
|
894504
893336
|
header: [...agentKnowledgeHeader, ...classLines, ...reviewLines],
|
|
894505
893337
|
footer: [
|
|
894506
|
-
buildPanelLine(width, [[" Up/Down move r/Enter reviewed s stale c contradicted f fresh",
|
|
893338
|
+
buildPanelLine(width, [[" Up/Down move r/Enter reviewed s stale c contradicted f fresh", C20.dim]]),
|
|
894507
893339
|
...selectedLines.length > 0 ? selectedLines : [],
|
|
894508
893340
|
...recentSummaryLines
|
|
894509
893341
|
]
|
|
@@ -894546,7 +893378,7 @@ function registerBuiltinPanels(manager5, deps) {
|
|
|
894546
893378
|
|
|
894547
893379
|
// src/panels/system-messages-panel.ts
|
|
894548
893380
|
var MAX_MESSAGES = 500;
|
|
894549
|
-
var
|
|
893381
|
+
var C21 = extendPalette(DEFAULT_PANEL_PALETTE, {
|
|
894550
893382
|
header: "#00ffff",
|
|
894551
893383
|
headerBg: "#0f172a",
|
|
894552
893384
|
high: "#fbbf24",
|
|
@@ -894574,20 +893406,20 @@ class SystemMessagesPanel extends ScrollableListPanel {
|
|
|
894574
893406
|
renderItem(entry, index, selected, width) {
|
|
894575
893407
|
const preview5 = entry.text.replace(/\s+/g, " ").trim();
|
|
894576
893408
|
return buildPanelListRow(width, [
|
|
894577
|
-
{ text: `${fmtTime2(entry.ts)} `, fg:
|
|
893409
|
+
{ text: `${fmtTime2(entry.ts)} `, fg: C21.ts },
|
|
894578
893410
|
{
|
|
894579
893411
|
text: `${entry.priority === "high" ? "HIGH" : "LOW ".padEnd(4)} `,
|
|
894580
|
-
fg: entry.priority === "high" ?
|
|
893412
|
+
fg: entry.priority === "high" ? C21.high : C21.low,
|
|
894581
893413
|
bold: entry.priority === "high"
|
|
894582
893414
|
},
|
|
894583
|
-
{ text: preview5, fg:
|
|
894584
|
-
],
|
|
893415
|
+
{ text: preview5, fg: C21.value }
|
|
893416
|
+
], C21, {
|
|
894585
893417
|
selected,
|
|
894586
893418
|
marker: entry.priority === "high" ? "!" : "\xB7"
|
|
894587
893419
|
});
|
|
894588
893420
|
}
|
|
894589
893421
|
getPalette() {
|
|
894590
|
-
return
|
|
893422
|
+
return C21;
|
|
894591
893423
|
}
|
|
894592
893424
|
getEmptyStateMessage() {
|
|
894593
893425
|
return " No system messages yet.";
|
|
@@ -894620,12 +893452,12 @@ class SystemMessagesPanel extends ScrollableListPanel {
|
|
|
894620
893452
|
lines: buildEmptyState(width, this.getEmptyStateMessage(), "Model switches, scan notices, provider/system state, and other operational updates will appear here once the runtime starts emitting them.", [
|
|
894621
893453
|
{ command: "/help", summary: "review commands and operator workflows" },
|
|
894622
893454
|
{ command: "/agent", summary: "open the Agent operator workspace" }
|
|
894623
|
-
],
|
|
893455
|
+
], C21)
|
|
894624
893456
|
}],
|
|
894625
893457
|
footerLines: [
|
|
894626
|
-
buildPanelLine(width, [[" j/k or Up/Down scroll g/G jump low-priority system traffic lands here by default",
|
|
893458
|
+
buildPanelLine(width, [[" j/k or Up/Down scroll g/G jump low-priority system traffic lands here by default", C21.dim]])
|
|
894627
893459
|
],
|
|
894628
|
-
palette:
|
|
893460
|
+
palette: C21
|
|
894629
893461
|
});
|
|
894630
893462
|
return lines2;
|
|
894631
893463
|
}
|
|
@@ -894635,35 +893467,35 @@ class SystemMessagesPanel extends ScrollableListPanel {
|
|
|
894635
893467
|
const ui3 = this.configManager.getRaw().ui;
|
|
894636
893468
|
const postureLines = [
|
|
894637
893469
|
buildKeyValueLine(width, [
|
|
894638
|
-
{ label: "messages", value: String(this._messages.length), valueColor:
|
|
894639
|
-
{ label: "high", value: String(highCount), valueColor: highCount > 0 ?
|
|
894640
|
-
{ label: "low", value: String(lowCount), valueColor: lowCount > 0 ?
|
|
894641
|
-
],
|
|
893470
|
+
{ label: "messages", value: String(this._messages.length), valueColor: C21.value },
|
|
893471
|
+
{ label: "high", value: String(highCount), valueColor: highCount > 0 ? C21.high : C21.dim },
|
|
893472
|
+
{ label: "low", value: String(lowCount), valueColor: lowCount > 0 ? C21.low : C21.dim }
|
|
893473
|
+
], C21),
|
|
894642
893474
|
buildKeyValueLine(width, [
|
|
894643
|
-
{ label: "system route", value: ui3.systemMessages, valueColor:
|
|
894644
|
-
{ label: "ops route", value: ui3.operationalMessages, valueColor:
|
|
894645
|
-
{ label: "review route", value: ui3.wrfcMessages, valueColor:
|
|
894646
|
-
],
|
|
894647
|
-
buildGuidanceLine(width, "/settings", "adjust where operational and delegated review/build messages render across panels and conversation",
|
|
893475
|
+
{ label: "system route", value: ui3.systemMessages, valueColor: C21.info },
|
|
893476
|
+
{ label: "ops route", value: ui3.operationalMessages, valueColor: C21.info },
|
|
893477
|
+
{ label: "review route", value: ui3.wrfcMessages, valueColor: C21.info }
|
|
893478
|
+
], C21),
|
|
893479
|
+
buildGuidanceLine(width, "/settings", "adjust where operational and delegated review/build messages render across panels and conversation", C21)
|
|
894648
893480
|
];
|
|
894649
893481
|
const selected = this._messages[this.selectedIndex];
|
|
894650
893482
|
const messageRows = this._messages.map((entry, index) => this.renderItem(entry, index, index === this.selectedIndex, width));
|
|
894651
|
-
const postureSection = { lines: buildSummaryBlock(width, "System posture", postureLines,
|
|
893483
|
+
const postureSection = { lines: buildSummaryBlock(width, "System posture", postureLines, C21) };
|
|
894652
893484
|
const detailSection = {
|
|
894653
893485
|
title: "Selected Message",
|
|
894654
893486
|
lines: [
|
|
894655
893487
|
buildPanelLine(width, [
|
|
894656
|
-
[" Time ",
|
|
894657
|
-
[fmtTime2(selected.ts),
|
|
894658
|
-
[" Priority ",
|
|
894659
|
-
[selected.priority, selected.priority === "high" ?
|
|
893488
|
+
[" Time ", C21.label],
|
|
893489
|
+
[fmtTime2(selected.ts), C21.value],
|
|
893490
|
+
[" Priority ", C21.label],
|
|
893491
|
+
[selected.priority, selected.priority === "high" ? C21.high : C21.low]
|
|
894660
893492
|
]),
|
|
894661
|
-
...buildBodyText(width, selected.text,
|
|
893493
|
+
...buildBodyText(width, selected.text, C21, C21.value)
|
|
894662
893494
|
]
|
|
894663
893495
|
};
|
|
894664
893496
|
const messagesSection = resolvePrimaryScrollableSection(width, height, {
|
|
894665
893497
|
intro,
|
|
894666
|
-
palette:
|
|
893498
|
+
palette: C21,
|
|
894667
893499
|
beforeSections: [postureSection],
|
|
894668
893500
|
section: {
|
|
894669
893501
|
title: "Timeline",
|
|
@@ -894671,7 +893503,7 @@ class SystemMessagesPanel extends ScrollableListPanel {
|
|
|
894671
893503
|
selectedIndex: this.selectedIndex,
|
|
894672
893504
|
scrollOffset: this.scrollStart,
|
|
894673
893505
|
minRows: 4,
|
|
894674
|
-
appendWindowSummary: { dimColor:
|
|
893506
|
+
appendWindowSummary: { dimColor: C21.ts }
|
|
894675
893507
|
},
|
|
894676
893508
|
afterSections: [detailSection]
|
|
894677
893509
|
});
|
|
@@ -894687,9 +893519,9 @@ class SystemMessagesPanel extends ScrollableListPanel {
|
|
|
894687
893519
|
intro,
|
|
894688
893520
|
sections,
|
|
894689
893521
|
footerLines: [
|
|
894690
|
-
buildPanelLine(width, [[" j/k or Up/Down scroll PgUp/PgDn page g/G jump",
|
|
893522
|
+
buildPanelLine(width, [[" j/k or Up/Down scroll PgUp/PgDn page g/G jump", C21.dim]])
|
|
894691
893523
|
],
|
|
894692
|
-
palette:
|
|
893524
|
+
palette: C21
|
|
894693
893525
|
});
|
|
894694
893526
|
return lines;
|
|
894695
893527
|
});
|
|
@@ -895109,10 +893941,10 @@ function createResumeSessionHandler(options) {
|
|
|
895109
893941
|
const ignoredPanels = meta3.returnContext?.openPanels?.slice(0, 4) ?? [];
|
|
895110
893942
|
const returnContextMode = getReturnContextMode2(options.configManager);
|
|
895111
893943
|
if (returnContextMode !== "off" && meta3.returnContext) {
|
|
895112
|
-
for (const
|
|
895113
|
-
if (
|
|
893944
|
+
for (const line of formatReturnContextForDisplay2(meta3.returnContext)) {
|
|
893945
|
+
if (line.startsWith("Open panels:"))
|
|
895114
893946
|
continue;
|
|
895115
|
-
options.conversation.log(`Resume: ${
|
|
893947
|
+
options.conversation.log(`Resume: ${line}`, { fg: "244" });
|
|
895116
893948
|
}
|
|
895117
893949
|
if (ignoredPanels.length > 0) {
|
|
895118
893950
|
options.conversation.log(`Resume: Saved panel state ignored: ${ignoredPanels.join(", ")}. Open the Agent workspace for current operator controls.`, { fg: "244" });
|
|
@@ -895713,9 +894545,9 @@ function isTurnOutcome(value) {
|
|
|
895713
894545
|
const candidate = value;
|
|
895714
894546
|
return typeof candidate.turnId === "string" && (candidate.status === "completed" || candidate.status === "error" || candidate.status === "cancelled") && (candidate.terminalEvent === "TURN_COMPLETED" || candidate.terminalEvent === "TURN_ERROR" || candidate.terminalEvent === "TURN_CANCEL") && typeof candidate.stopReason === "string" && typeof candidate.completedAt === "number" && Array.isArray(candidate.receiptIds);
|
|
895715
894547
|
}
|
|
895716
|
-
function parseReceiptLine(
|
|
894548
|
+
function parseReceiptLine(line) {
|
|
895717
894549
|
try {
|
|
895718
|
-
const parsed = JSON.parse(
|
|
894550
|
+
const parsed = JSON.parse(line);
|
|
895719
894551
|
if (isReceipt(parsed))
|
|
895720
894552
|
return { receipt: parsed };
|
|
895721
894553
|
if (parsed && typeof parsed === "object") {
|
|
@@ -896600,7 +895432,7 @@ function workPlanItemsByAgentId(items) {
|
|
|
896600
895432
|
}
|
|
896601
895433
|
function dispatchReceiptLines(item) {
|
|
896602
895434
|
return readString74(item.notes).split(`
|
|
896603
|
-
`).map((
|
|
895435
|
+
`).map((line) => line.trim()).filter((line) => line.includes("Agent dispatch receipt"));
|
|
896604
895436
|
}
|
|
896605
895437
|
function workPlanCloseoutItem(item, includeParameters) {
|
|
896606
895438
|
const receipts = dispatchReceiptLines(item);
|
|
@@ -900820,7 +899652,7 @@ function describeLiveRecord2(record2, includeParameters) {
|
|
|
900820
899652
|
...record2.sourceIds && record2.sourceIds.length > 0 ? { sourceIds: record2.sourceIds.slice(0, includeParameters ? 12 : 4) } : {},
|
|
900821
899653
|
...record2.logTail && record2.logTail.length > 0 ? { logTail: record2.logTail.slice(-(includeParameters ? 5 : 2)) } : {},
|
|
900822
899654
|
...record2.output ? { output: describeOutput(record2.output, includeParameters) } : {},
|
|
900823
|
-
...record2.diagnostics && record2.diagnostics.length > 0 ? { diagnostics: record2.diagnostics.slice(0, includeParameters ? 10 : 3).map((
|
|
899655
|
+
...record2.diagnostics && record2.diagnostics.length > 0 ? { diagnostics: record2.diagnostics.slice(0, includeParameters ? 10 : 3).map((line) => previewHarnessText(line, includeParameters ? 160 : 96)) } : {},
|
|
900824
899656
|
...availableControls && availableControls.length > 0 ? { availableControls: availableControls.slice(0, includeParameters ? 8 : 4) } : {},
|
|
900825
899657
|
...includeParameters && record2.controls && record2.controls.length > 0 ? { controls: record2.controls.map(describeControl) } : {}
|
|
900826
899658
|
};
|
|
@@ -906415,8 +905247,6 @@ var AGENT_WORKSPACE_CATEGORIES = [
|
|
|
906415
905247
|
{ id: "personal-ops-calendar", label: "Calendar workflows", detail: "Calendar agenda and conflict checks use workflow cards with reviewed connector routes; reminders stay on confirmed schedules.", kind: "guidance", safety: "safe" },
|
|
906416
905248
|
{ id: "personal-ops-notes", label: "Scratchpad notes", detail: "Open Agent-local notes for source triage, decisions, and handoff context.", targetCategoryId: "notes", kind: "workspace", safety: "safe" },
|
|
906417
905249
|
{ id: "personal-ops-note-create", label: "Create note", detail: "Capture temporary context as an Agent-local scratchpad note.", editorKind: "note", kind: "editor", safety: "safe" },
|
|
906418
|
-
{ id: "personal-ops-workplan", label: "Review work plan", detail: "Open the visible work-plan route for user-facing task tracking.", targetCategoryId: "work", kind: "workspace", safety: "safe" },
|
|
906419
|
-
{ id: "personal-ops-workplan-add", label: "Add work item", detail: "Create one visible work-plan item instead of hiding the task in background state.", editorKind: "workplan-add", kind: "editor", safety: "safe" },
|
|
906420
905250
|
{ id: "personal-ops-host-tasks", label: "Host tasks", detail: "Inspect connected-host task state without creating, retrying, or mutating tasks.", command: "/tasks list", kind: "command", safety: "read-only" },
|
|
906421
905251
|
{ id: "personal-ops-reminder", label: "Create reminder", detail: "Create one connected reminder schedule with real timing, optional delivery target, and explicit confirmation.", editorKind: "reminder-schedule", kind: "editor", safety: "safe" },
|
|
906422
905252
|
{ id: "personal-ops-routines", label: "Routine library", detail: "Open repeatable workflows and schedule-promotion readiness.", targetCategoryId: "routines", kind: "workspace", safety: "safe" },
|
|
@@ -906899,18 +905729,12 @@ var AGENT_WORKSPACE_CATEGORIES = [
|
|
|
906899
905729
|
id: "work",
|
|
906900
905730
|
group: "OPERATIONS",
|
|
906901
905731
|
label: "Work & Approvals",
|
|
906902
|
-
summary: "Visible task state
|
|
906903
|
-
detail: "Use this workspace to inspect active operator state and
|
|
905732
|
+
summary: "Visible task state and approval posture.",
|
|
905733
|
+
detail: "Use this workspace to inspect active operator state and approval posture.",
|
|
906904
905734
|
actions: [
|
|
906905
|
-
{ id: "
|
|
906906
|
-
{ id: "work-autonomy-queue", label: "Autonomy queue", detail: "Inspect visible work-plan, host-task, approval, automation, schedule, routine, and delegation queue cards.", kind: "guidance", safety: "read-only" },
|
|
905735
|
+
{ id: "work-autonomy-queue", label: "Autonomy queue", detail: "Inspect visible host-task, approval, automation, schedule, routine, and delegation queue cards.", kind: "guidance", safety: "read-only" },
|
|
906907
905736
|
{ id: "work-background-processes", label: "Background processes", detail: 'Inspect tracked local background processes, bounded output tails, visible monitor routes, and lifecycle controls with execution action:"processes".', kind: "guidance", safety: "read-only" },
|
|
906908
905737
|
{ id: "work-process-capabilities", label: "Process capabilities", detail: "Inspect process parity for start/list/poll/wait/log/kill/write, PTY, and sudo before choosing a local execution route.", kind: "guidance", safety: "read-only" },
|
|
906909
|
-
{ id: "workplan-show", label: "Show work plan detail", detail: "Open a read-only form for the detailed work plan view.", editorKind: "workplan-show", kind: "editor", safety: "read-only" },
|
|
906910
|
-
{ id: "workplan-add", label: "Add work item", detail: "Open a form that creates one visible work plan item from the Agent workspace.", editorKind: "workplan-add", kind: "editor", safety: "safe" },
|
|
906911
|
-
{ id: "workplan-status", label: "Update work item status", detail: "Open a form that updates one work plan item to pending, active, blocked, done, failed, or cancelled.", editorKind: "workplan-status", kind: "editor", safety: "safe" },
|
|
906912
|
-
{ id: "workplan-delete", label: "Remove work item", detail: "Open a confirmed form before removing one work plan item.", editorKind: "workplan-delete", kind: "editor", safety: "safe" },
|
|
906913
|
-
{ id: "workplan-clear-completed", label: "Clear completed work", detail: "Open a confirmed form before clearing completed and cancelled work plan items.", editorKind: "workplan-clear-completed", kind: "editor", safety: "safe" },
|
|
906914
905738
|
{ id: "conversation-export", label: "Export conversation", detail: "Open a confirmed form that exports the current Agent conversation to a workspace file.", editorKind: "conversation-export", kind: "editor", safety: "safe" },
|
|
906915
905739
|
{ id: "conversation-review", label: "Review transcript", detail: "Inspect current transcript structure without changing the conversation.", command: "/conversation review", kind: "command", safety: "read-only" },
|
|
906916
905740
|
{ id: "conversation-composer", label: "Composer posture", detail: "Inspect current composer mode, pending approval posture, and context warning state.", command: "/conversation composer", kind: "command", safety: "read-only" },
|
|
@@ -906931,15 +905755,6 @@ var AGENT_WORKSPACE_CATEGORIES = [
|
|
|
906931
905755
|
{ id: "session-export-saved", label: "Export saved session", detail: "Open a form that prints one saved-session transcript as markdown or text.", editorKind: "session-export-saved", kind: "editor", safety: "read-only" },
|
|
906932
905756
|
{ id: "session-search", label: "Search saved sessions", detail: "Open a form that searches saved Agent sessions.", editorKind: "session-search", kind: "editor", safety: "read-only" },
|
|
906933
905757
|
{ id: "session-delete", label: "Delete saved session", detail: "Open a confirmed form before deleting one saved Agent session.", editorKind: "session-delete", kind: "editor", safety: "safe" },
|
|
906934
|
-
{ id: "planning-status", label: "Planning status", detail: "Inspect current Agent planning readiness, mode, and next question without seeding or approving planning state.", command: "/plan status", kind: "command", safety: "read-only" },
|
|
906935
|
-
{ id: "planning-mode", label: "Planning mode", detail: "Inspect current planner mode and runtime strategy without changing it.", command: "/plan mode", kind: "command", safety: "read-only" },
|
|
906936
|
-
{ id: "planning-explain", label: "Explain planner", detail: "Explain planner state and readiness without approving or changing it.", command: "/plan explain", kind: "command", safety: "read-only" },
|
|
906937
|
-
{ id: "planning-list", label: "Saved plans", detail: "List saved Agent execution plans without changing current planning state.", command: "/plan list", kind: "command", safety: "read-only" },
|
|
906938
|
-
{ id: "plan-seed", label: "Seed planning goal", detail: "Open a form that seeds current planning state from a concrete Agent operating goal.", editorKind: "plan-seed", kind: "editor", safety: "safe" },
|
|
906939
|
-
{ id: "plan-show", label: "Show saved plan", detail: "Open a plan-id form for read-only saved plan detail.", editorKind: "plan-show", kind: "editor", safety: "read-only" },
|
|
906940
|
-
{ id: "plan-approve", label: "Approve planning state", detail: "Open a confirmation form before approving current planning state for execution.", editorKind: "plan-approve", kind: "editor", safety: "safe" },
|
|
906941
|
-
{ id: "plan-override", label: "Override planning strategy", detail: "Open a confirmation form before changing planner strategy.", editorKind: "plan-override", kind: "editor", safety: "safe" },
|
|
906942
|
-
{ id: "plan-clear", label: "Clear planning state", detail: "Open a confirmation form before clearing planner state.", editorKind: "plan-clear", kind: "editor", safety: "safe" },
|
|
906943
905758
|
{ id: "tasks-list", label: "Host tasks", detail: "Inspect connected-host task state without creating, retrying, or mutating tasks.", command: "/tasks list", kind: "command", safety: "read-only" },
|
|
906944
905759
|
{ id: "tasks-filter", label: "Filter host tasks", detail: "Open a status/kind form for read-only connected-host task filtering.", editorKind: "task-list-filter", kind: "editor", safety: "read-only" },
|
|
906945
905760
|
{ id: "task-show", label: "Inspect host task", detail: "Open a task-id form for read-only connected-host task metadata.", editorKind: "task-show", kind: "editor", safety: "read-only" },
|
|
@@ -921218,7 +920033,7 @@ function buildAgentWorkspaceTaskCommandEditorSubmission(editor, readField2) {
|
|
|
921218
920033
|
}
|
|
921219
920034
|
|
|
921220
920035
|
// src/input/agent-workspace-workplan-editor-submission.ts
|
|
921221
|
-
var
|
|
920036
|
+
var STATUS_COMMANDS = {
|
|
921222
920037
|
pending: "pending",
|
|
921223
920038
|
todo: "pending",
|
|
921224
920039
|
start: "start",
|
|
@@ -921284,7 +920099,7 @@ function buildAgentWorkspaceWorkPlanEditorSubmission(editor, readField2) {
|
|
|
921284
920099
|
}
|
|
921285
920100
|
if (editor.kind === "workplan-status") {
|
|
921286
920101
|
const requested = readField2("status").trim().toLowerCase().replace(/[\s-]+/g, "_");
|
|
921287
|
-
const commandStatus =
|
|
920102
|
+
const commandStatus = STATUS_COMMANDS[requested];
|
|
921288
920103
|
if (!commandStatus) {
|
|
921289
920104
|
return {
|
|
921290
920105
|
kind: "editor",
|
|
@@ -923667,16 +922482,16 @@ function sanitizeSourceUrl2(value) {
|
|
|
923667
922482
|
}
|
|
923668
922483
|
}
|
|
923669
922484
|
function parseSources(value) {
|
|
923670
|
-
return splitList8(value).map((
|
|
923671
|
-
const parts2 =
|
|
922485
|
+
return splitList8(value).map((line) => {
|
|
922486
|
+
const parts2 = line.split("|").map((part) => part.trim()).filter(Boolean);
|
|
923672
922487
|
const urlIndex = parts2.findIndex((part) => /^https?:\/\//i.test(part));
|
|
923673
922488
|
const url2 = urlIndex >= 0 ? parts2[urlIndex] : "";
|
|
923674
922489
|
const detailStart = urlIndex >= 0 ? urlIndex + 1 : 1;
|
|
923675
922490
|
const nonUrlParts = parts2.filter((_3, index) => index !== urlIndex);
|
|
923676
|
-
const title = urlIndex === 0 ? nonUrlParts.length > 1 ? nonUrlParts[0] : url2 : parts2[0] ?? url2 ??
|
|
922491
|
+
const title = urlIndex === 0 ? nonUrlParts.length > 1 ? nonUrlParts[0] : url2 : parts2[0] ?? url2 ?? line;
|
|
923677
922492
|
const noteParts = parts2.slice(detailStart + 1);
|
|
923678
922493
|
return {
|
|
923679
|
-
title: title ||
|
|
922494
|
+
title: title || line,
|
|
923680
922495
|
...url2 ? { url: sanitizeSourceUrl2(url2) } : {},
|
|
923681
922496
|
...parts2[detailStart] ? { credibility: parts2[detailStart] } : {},
|
|
923682
922497
|
...noteParts.length > 0 ? { note: noteParts.join(" | ") } : {}
|
|
@@ -927551,10 +926366,10 @@ function loadArtifact2(artifact) {
|
|
|
927551
926366
|
}
|
|
927552
926367
|
}
|
|
927553
926368
|
function firstHeading(source) {
|
|
927554
|
-
return source.split(/\r?\n/).find((
|
|
926369
|
+
return source.split(/\r?\n/).find((line) => line.startsWith("# "))?.replace(/^#\s+/, "").trim() || undefined;
|
|
927555
926370
|
}
|
|
927556
926371
|
function countMarkdownBullets(source) {
|
|
927557
|
-
return source.split(/\r?\n/).filter((
|
|
926372
|
+
return source.split(/\r?\n/).filter((line) => /^-\s+/.test(line)).length;
|
|
927558
926373
|
}
|
|
927559
926374
|
function countBy(items, key) {
|
|
927560
926375
|
const counts = {};
|
|
@@ -928235,7 +927050,7 @@ function normalizeRunner(entry, index) {
|
|
|
928235
927050
|
...stringArray6(entry.record.logTail),
|
|
928236
927051
|
...stringArray6(entry.record.boundedLogs),
|
|
928237
927052
|
...stringArray6(entry.record.outputChunks)
|
|
928238
|
-
].map((
|
|
927053
|
+
].map((line) => safePreview4(line, 180)).slice(0, 5);
|
|
928239
927054
|
const route = modelRoute2(entry.record, runId ? `research action:"runner" runId:"${runId}" includeParameters:true` : 'research action:"runner" includeParameters:true');
|
|
928240
927055
|
return {
|
|
928241
927056
|
id,
|
|
@@ -930992,7 +929807,7 @@ async function importAgentWorkspaceTuiSettings(context) {
|
|
|
930992
929807
|
unchangedCount > 0 ? `${unchangedCount} item(s) already matched.` : "",
|
|
930993
929808
|
skipped.length > 0 ? `Skipped: ${skipped.slice(0, 5).join("; ")}${skipped.length > 5 ? `; +${skipped.length - 5} more` : ""}.` : "",
|
|
930994
929809
|
parseErrors.length > 0 ? `Parse issues: ${parseErrors.join("; ")}.` : ""
|
|
930995
|
-
].filter((
|
|
929810
|
+
].filter((line) => line.length > 0).join(" "),
|
|
930996
929811
|
safety: "safe"
|
|
930997
929812
|
}
|
|
930998
929813
|
};
|
|
@@ -946527,10 +945342,10 @@ class ProfilePickerModal {
|
|
|
946527
945342
|
}
|
|
946528
945343
|
|
|
946529
945344
|
// src/input/handler-prompt-buffer.ts
|
|
946530
|
-
function wordWrapLine(
|
|
945345
|
+
function wordWrapLine(line, maxW) {
|
|
946531
945346
|
if (maxW <= 0)
|
|
946532
|
-
return [
|
|
946533
|
-
if (
|
|
945347
|
+
return [line];
|
|
945348
|
+
if (line.length === 0)
|
|
946534
945349
|
return [""];
|
|
946535
945350
|
const result2 = [];
|
|
946536
945351
|
let current = "";
|
|
@@ -946553,8 +945368,8 @@ function wordWrapLine(line2, maxW) {
|
|
|
946553
945368
|
current += wordBuf;
|
|
946554
945369
|
wordBuf = "";
|
|
946555
945370
|
};
|
|
946556
|
-
for (let i5 = 0;i5 <
|
|
946557
|
-
const ch =
|
|
945371
|
+
for (let i5 = 0;i5 < line.length; i5++) {
|
|
945372
|
+
const ch = line[i5];
|
|
946558
945373
|
if (ch === " ") {
|
|
946559
945374
|
flushWord();
|
|
946560
945375
|
if (current.length >= maxW) {
|
|
@@ -949001,7 +947816,7 @@ class InputHandler {
|
|
|
949001
947816
|
return true;
|
|
949002
947817
|
}
|
|
949003
947818
|
dispatchAgentWorkspaceCommand(command8, context, behavior) {
|
|
949004
|
-
const resolved = behavior ?? "
|
|
947819
|
+
const resolved = behavior ?? "inline";
|
|
949005
947820
|
const { name: name51, args: args2 } = parseSlashCommand(command8);
|
|
949006
947821
|
if (!name51)
|
|
949007
947822
|
return;
|
|
@@ -949258,8 +948073,8 @@ ${joined}` : joined || "(no output)";
|
|
|
949258
948073
|
handlePanelIntegrationAction(activePanel, key) {
|
|
949259
948074
|
handlePanelIntegrationAction(this.uiServices.shell.panelManager, activePanel, key, this.commandContext);
|
|
949260
948075
|
}
|
|
949261
|
-
wordWrapLine(
|
|
949262
|
-
return wordWrapLine(
|
|
948076
|
+
wordWrapLine(line, maxW) {
|
|
948077
|
+
return wordWrapLine(line, maxW);
|
|
949263
948078
|
}
|
|
949264
948079
|
}
|
|
949265
948080
|
|
|
@@ -949417,10 +948232,10 @@ var MODEL_WORKSPACE_FOOTER_CONTROLS = "Up/Down navigate \u2022 Left/Right pane \
|
|
|
949417
948232
|
function clamp7(value, min2, max2) {
|
|
949418
948233
|
return Math.max(min2, Math.min(max2, value));
|
|
949419
948234
|
}
|
|
949420
|
-
function fillRange2(
|
|
949421
|
-
for (let x2 = Math.max(0, startX);x2 <= Math.min(
|
|
949422
|
-
const cell =
|
|
949423
|
-
|
|
948235
|
+
function fillRange2(line, startX, endX, bg) {
|
|
948236
|
+
for (let x2 = Math.max(0, startX);x2 <= Math.min(line.length - 1, endX); x2 += 1) {
|
|
948237
|
+
const cell = line[x2] ?? createStyledCell(" ");
|
|
948238
|
+
line[x2] = createStyledCell(cell.char, {
|
|
949424
948239
|
fg: cell.fg,
|
|
949425
948240
|
bg,
|
|
949426
948241
|
bold: cell.bold,
|
|
@@ -949433,52 +948248,52 @@ function fillRange2(line2, startX, endX, bg) {
|
|
|
949433
948248
|
}
|
|
949434
948249
|
}
|
|
949435
948250
|
function makeLine2(width, bg = "") {
|
|
949436
|
-
const
|
|
948251
|
+
const line = createEmptyLine(width);
|
|
949437
948252
|
if (bg)
|
|
949438
|
-
fillRange2(
|
|
949439
|
-
return
|
|
948253
|
+
fillRange2(line, 0, width - 1, bg);
|
|
948254
|
+
return line;
|
|
949440
948255
|
}
|
|
949441
|
-
function writeText3(
|
|
948256
|
+
function writeText3(line, startX, maxWidth, text, style = {}) {
|
|
949442
948257
|
let x2 = startX;
|
|
949443
948258
|
let used = 0;
|
|
949444
948259
|
for (const ch of text) {
|
|
949445
948260
|
const width = getDisplayWidth(ch);
|
|
949446
948261
|
if (width <= 0)
|
|
949447
948262
|
continue;
|
|
949448
|
-
if (used + width > maxWidth || x2 >=
|
|
948263
|
+
if (used + width > maxWidth || x2 >= line.length)
|
|
949449
948264
|
break;
|
|
949450
|
-
|
|
949451
|
-
if (width > 1 && x2 + 1 <
|
|
949452
|
-
|
|
948265
|
+
line[x2] = createStyledCell(ch, style);
|
|
948266
|
+
if (width > 1 && x2 + 1 < line.length) {
|
|
948267
|
+
line[x2 + 1] = createStyledCell(" ", style);
|
|
949453
948268
|
}
|
|
949454
948269
|
x2 += width;
|
|
949455
948270
|
used += width;
|
|
949456
948271
|
}
|
|
949457
948272
|
}
|
|
949458
948273
|
function borderLine2(width, left, fill, right) {
|
|
949459
|
-
const
|
|
948274
|
+
const line = makeLine2(width);
|
|
949460
948275
|
if (width <= 0)
|
|
949461
|
-
return
|
|
949462
|
-
|
|
948276
|
+
return line;
|
|
948277
|
+
line[0] = createStyledCell(left, { fg: PALETTE.border });
|
|
949463
948278
|
for (let x2 = 1;x2 < width - 1; x2 += 1) {
|
|
949464
|
-
|
|
948279
|
+
line[x2] = createStyledCell(fill, { fg: PALETTE.border });
|
|
949465
948280
|
}
|
|
949466
948281
|
if (width > 1)
|
|
949467
|
-
|
|
949468
|
-
return
|
|
948282
|
+
line[width - 1] = createStyledCell(right, { fg: PALETTE.border });
|
|
948283
|
+
return line;
|
|
949469
948284
|
}
|
|
949470
948285
|
function contentLine2(width, bg) {
|
|
949471
|
-
const
|
|
948286
|
+
const line = makeLine2(width, bg);
|
|
949472
948287
|
if (width > 0)
|
|
949473
|
-
|
|
948288
|
+
line[0] = createStyledCell(GLYPHS.frame.vertical, { fg: PALETTE.border });
|
|
949474
948289
|
if (width > 1)
|
|
949475
|
-
|
|
949476
|
-
return
|
|
948290
|
+
line[width - 1] = createStyledCell(GLYPHS.frame.vertical, { fg: PALETTE.border });
|
|
948291
|
+
return line;
|
|
949477
948292
|
}
|
|
949478
|
-
function drawVertical(
|
|
949479
|
-
if (x2 <= 0 || x2 >=
|
|
948293
|
+
function drawVertical(line, x2, bg = "") {
|
|
948294
|
+
if (x2 <= 0 || x2 >= line.length - 1)
|
|
949480
948295
|
return;
|
|
949481
|
-
|
|
948296
|
+
line[x2] = createStyledCell(GLYPHS.frame.vertical, { fg: PALETTE.border, bg });
|
|
949482
948297
|
}
|
|
949483
948298
|
function clipDisplay2(text, width) {
|
|
949484
948299
|
if (width <= 0)
|
|
@@ -949596,18 +948411,18 @@ function detailLines(picker, width) {
|
|
|
949596
948411
|
}
|
|
949597
948412
|
const filterText = modelWorkspaceFilterText(picker.query || "(none)", picker.categoryFilter, picker.capabilityFilter, picker.groupBy, picker.availableOnly ? "yes" : "no");
|
|
949598
948413
|
lines.push(filterText);
|
|
949599
|
-
return lines.flatMap((
|
|
948414
|
+
return lines.flatMap((line) => wrapText(line, Math.max(1, width)));
|
|
949600
948415
|
}
|
|
949601
|
-
function renderTargets(picker,
|
|
948416
|
+
function renderTargets(picker, line, startX, width, rowIndex) {
|
|
949602
948417
|
const info3 = picker.targetInfos[rowIndex];
|
|
949603
948418
|
if (!info3)
|
|
949604
948419
|
return;
|
|
949605
948420
|
const selected = rowIndex === picker.targetIndex;
|
|
949606
948421
|
const bg = selected ? PALETTE.selectedBg : PALETTE.targetBg;
|
|
949607
|
-
fillRange2(
|
|
948422
|
+
fillRange2(line, startX, startX + width - 1, bg);
|
|
949608
948423
|
const marker = selected ? picker.focusPane === "targets" ? GLYPHS.navigation.selected : "\u2022" : " ";
|
|
949609
948424
|
const state4 = info3.enabled ? info3.inherited ? "inherit" : "set" : "off";
|
|
949610
|
-
writeText3(
|
|
948425
|
+
writeText3(line, startX + 1, width - 2, `${marker} ${info3.label} (${state4})`, {
|
|
949611
948426
|
fg: selected ? PALETTE.text : PALETTE.muted,
|
|
949612
948427
|
bg,
|
|
949613
948428
|
bold: selected
|
|
@@ -949622,19 +948437,19 @@ function renderProviderRows(picker, lines, rows, startX, width) {
|
|
|
949622
948437
|
for (let visibleRow = 0;visibleRow < rows; visibleRow += 1) {
|
|
949623
948438
|
const absolute = start2 + visibleRow;
|
|
949624
948439
|
const provider5 = providers2[absolute];
|
|
949625
|
-
const
|
|
948440
|
+
const line = lines[visibleRow];
|
|
949626
948441
|
if (!provider5)
|
|
949627
948442
|
continue;
|
|
949628
948443
|
const selected = absolute === picker.selectedIndex;
|
|
949629
948444
|
const bg = selected ? PALETTE.selectedBg : PALETTE.bodyBg;
|
|
949630
|
-
fillRange2(
|
|
948445
|
+
fillRange2(line, startX, startX + width - 1, bg);
|
|
949631
948446
|
const marker = selected ? picker.focusPane === "items" ? GLYPHS.navigation.selected : "\u2022" : " ";
|
|
949632
948447
|
const via = picker.configuredViaMap.get(provider5) ?? (picker.configuredProviders.has(provider5) ? "configured" : "not configured");
|
|
949633
948448
|
const count = String(modelCounts.get(provider5) ?? 0);
|
|
949634
|
-
writeText3(
|
|
949635
|
-
writeText3(
|
|
949636
|
-
writeText3(
|
|
949637
|
-
writeText3(
|
|
948449
|
+
writeText3(line, startX + 1, width, padDisplay2(marker, 2), { fg: PALETTE.text, bg, bold: selected });
|
|
948450
|
+
writeText3(line, startX + 3, Math.max(0, width - 36), padDisplay2(provider5, Math.max(0, width - 36)), { fg: selected ? PALETTE.text : PALETTE.muted, bg, bold: selected });
|
|
948451
|
+
writeText3(line, startX + Math.max(4, width - 31), 18, padDisplay2(via, 18), { fg: picker.configuredProviders.has(provider5) ? PALETTE.good : PALETTE.warn, bg });
|
|
948452
|
+
writeText3(line, startX + Math.max(4, width - 12), 10, padDisplay2(`${count} models`, 10), { fg: PALETTE.dim, bg });
|
|
949638
948453
|
}
|
|
949639
948454
|
if (start2 > 0 && lines[0])
|
|
949640
948455
|
writeText3(lines[0], startX + 1, width - 2, `${GLYPHS.navigation.moreAbove} ${start2} more provider(s) above`, { fg: PALETTE.dim, bg: PALETTE.bodyBg, dim: true });
|
|
@@ -949653,12 +948468,12 @@ function renderModelRows(picker, lines, rows, startX, width) {
|
|
|
949653
948468
|
for (let visibleRow = 0;visibleRow < rows; visibleRow += 1) {
|
|
949654
948469
|
const absolute = start2 + visibleRow;
|
|
949655
948470
|
const model = models[absolute];
|
|
949656
|
-
const
|
|
948471
|
+
const line = lines[visibleRow];
|
|
949657
948472
|
if (!model)
|
|
949658
948473
|
continue;
|
|
949659
948474
|
const selected = absolute === picker.selectedIndex;
|
|
949660
948475
|
const bg = selected ? PALETTE.selectedBg : PALETTE.bodyBg;
|
|
949661
|
-
fillRange2(
|
|
948476
|
+
fillRange2(line, startX, startX + width - 1, bg);
|
|
949662
948477
|
const marker = selected ? picker.focusPane === "items" ? GLYPHS.navigation.selected : "\u2022" : " ";
|
|
949663
948478
|
const caps = model.capabilities ?? {};
|
|
949664
948479
|
const capText = [
|
|
@@ -949667,19 +948482,19 @@ function renderModelRows(picker, lines, rows, startX, width) {
|
|
|
949667
948482
|
caps.toolCalling ? "T" : "-"
|
|
949668
948483
|
].join("");
|
|
949669
948484
|
let x2 = startX + 1;
|
|
949670
|
-
writeText3(
|
|
948485
|
+
writeText3(line, x2, 2, padDisplay2(marker, 2), { fg: PALETTE.text, bg, bold: selected });
|
|
949671
948486
|
x2 += 2;
|
|
949672
|
-
writeText3(
|
|
948487
|
+
writeText3(line, x2, keyW, padDisplay2(modelKey(model), keyW), { fg: selected ? PALETTE.text : PALETTE.muted, bg, bold: selected });
|
|
949673
948488
|
x2 += keyW + 1;
|
|
949674
|
-
writeText3(
|
|
948489
|
+
writeText3(line, x2, nameW, padDisplay2(model.displayName, nameW), { fg: selected ? PALETTE.subtitle : PALETTE.text, bg });
|
|
949675
948490
|
x2 += nameW + 1;
|
|
949676
|
-
writeText3(
|
|
948491
|
+
writeText3(line, x2, providerW, padDisplay2(model.provider, providerW), { fg: PALETTE.muted, bg });
|
|
949677
948492
|
x2 += providerW + 1;
|
|
949678
|
-
writeText3(
|
|
948493
|
+
writeText3(line, x2, ctxW, padDisplay2(formatContext(model.contextWindow), ctxW), { fg: PALETTE.dim, bg });
|
|
949679
948494
|
x2 += ctxW + 1;
|
|
949680
|
-
writeText3(
|
|
948495
|
+
writeText3(line, x2, tierW, padDisplay2(model.tier ?? "paid", tierW), { fg: model.tier === "free" ? PALETTE.good : PALETTE.dim, bg });
|
|
949681
948496
|
x2 += tierW + 1;
|
|
949682
|
-
writeText3(
|
|
948497
|
+
writeText3(line, x2, capsW, padDisplay2(capText, capsW), { fg: PALETTE.info, bg });
|
|
949683
948498
|
}
|
|
949684
948499
|
if (start2 > 0 && lines[0])
|
|
949685
948500
|
writeText3(lines[0], startX + 1, width - 2, `${GLYPHS.navigation.moreAbove} ${start2} more model(s) above`, { fg: PALETTE.dim, bg: PALETTE.bodyBg, dim: true });
|
|
@@ -949708,24 +948523,24 @@ function renderContextCapRows(picker, lines, rows, startX, width) {
|
|
|
949708
948523
|
MODEL_WORKSPACE_CONTEXT_CAP_INPUT_HELP
|
|
949709
948524
|
];
|
|
949710
948525
|
for (let row = 0;row < Math.min(rows, copy.length); row += 1) {
|
|
949711
|
-
const
|
|
949712
|
-
fillRange2(
|
|
949713
|
-
writeText3(
|
|
948526
|
+
const line = lines[row];
|
|
948527
|
+
fillRange2(line, startX, startX + width - 1, PALETTE.bodyBg);
|
|
948528
|
+
writeText3(line, startX + 1, width - 2, copy[row], { fg: row === 2 ? PALETTE.title : PALETTE.text, bg: PALETTE.bodyBg, bold: row === 2 });
|
|
949714
948529
|
}
|
|
949715
948530
|
}
|
|
949716
|
-
function writeTableHeader(
|
|
949717
|
-
fillRange2(
|
|
948531
|
+
function writeTableHeader(line, picker, startX, width) {
|
|
948532
|
+
fillRange2(line, startX, startX + width - 1, PALETTE.footerBg);
|
|
949718
948533
|
const style = { fg: PALETTE.muted, bg: PALETTE.footerBg, bold: true };
|
|
949719
948534
|
if (picker.mode === "provider") {
|
|
949720
|
-
writeText3(
|
|
948535
|
+
writeText3(line, startX + 1, width - 2, MODEL_WORKSPACE_TABLE_HEADERS.provider, style);
|
|
949721
948536
|
return;
|
|
949722
948537
|
}
|
|
949723
948538
|
if (picker.mode === "effort") {
|
|
949724
|
-
writeText3(
|
|
948539
|
+
writeText3(line, startX + 1, width - 2, MODEL_WORKSPACE_TABLE_HEADERS.effort, style);
|
|
949725
948540
|
return;
|
|
949726
948541
|
}
|
|
949727
948542
|
if (picker.mode === "contextCap") {
|
|
949728
|
-
writeText3(
|
|
948543
|
+
writeText3(line, startX + 1, width - 2, MODEL_WORKSPACE_TABLE_HEADERS.contextCap, style);
|
|
949729
948544
|
return;
|
|
949730
948545
|
}
|
|
949731
948546
|
const providerW = clamp7(Math.floor(width * 0.14), 10, 18);
|
|
@@ -949735,17 +948550,17 @@ function writeTableHeader(line2, picker, startX, width) {
|
|
|
949735
948550
|
const nameW = clamp7(Math.floor(width * 0.28), 16, 36);
|
|
949736
948551
|
const keyW = Math.max(10, width - providerW - ctxW - tierW - capsW - nameW - 10);
|
|
949737
948552
|
let x2 = startX + 3;
|
|
949738
|
-
writeText3(
|
|
948553
|
+
writeText3(line, x2, keyW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.modelKey, keyW), style);
|
|
949739
948554
|
x2 += keyW + 1;
|
|
949740
|
-
writeText3(
|
|
948555
|
+
writeText3(line, x2, nameW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.displayName, nameW), style);
|
|
949741
948556
|
x2 += nameW + 1;
|
|
949742
|
-
writeText3(
|
|
948557
|
+
writeText3(line, x2, providerW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.providerColumn, providerW), style);
|
|
949743
948558
|
x2 += providerW + 1;
|
|
949744
|
-
writeText3(
|
|
948559
|
+
writeText3(line, x2, ctxW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.context, ctxW), style);
|
|
949745
948560
|
x2 += ctxW + 1;
|
|
949746
|
-
writeText3(
|
|
948561
|
+
writeText3(line, x2, tierW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.tier, tierW), style);
|
|
949747
948562
|
x2 += tierW + 1;
|
|
949748
|
-
writeText3(
|
|
948563
|
+
writeText3(line, x2, capsW, padDisplay2(MODEL_WORKSPACE_TABLE_HEADERS.caps, capsW), style);
|
|
949749
948564
|
}
|
|
949750
948565
|
function renderModelWorkspace(picker, width, viewportHeight) {
|
|
949751
948566
|
const cacheKey2 = getRenderCacheKey(picker, width, viewportHeight);
|
|
@@ -949780,16 +948595,16 @@ function renderModelWorkspace(picker, width, viewportHeight) {
|
|
|
949780
948595
|
const details = detailLines(picker, contentW - 2).slice(0, detailRows);
|
|
949781
948596
|
for (let row = 0;row < bodyRows; row += 1) {
|
|
949782
948597
|
const inDetail = row < detailRows;
|
|
949783
|
-
const
|
|
949784
|
-
fillRange2(
|
|
949785
|
-
drawVertical(
|
|
949786
|
-
renderTargets(picker,
|
|
948598
|
+
const line = contentLine2(safeWidth, inDetail ? PALETTE.detailBg : PALETTE.bodyBg);
|
|
948599
|
+
fillRange2(line, 1, targetW - 1, PALETTE.targetBg);
|
|
948600
|
+
drawVertical(line, targetW, inDetail ? PALETTE.detailBg : PALETTE.bodyBg);
|
|
948601
|
+
renderTargets(picker, line, 1, targetW - 1, row);
|
|
949787
948602
|
if (inDetail) {
|
|
949788
948603
|
const text = details[row] ?? "";
|
|
949789
948604
|
const fg = row === 0 ? PALETTE.title : row <= 2 ? PALETTE.text : PALETTE.muted;
|
|
949790
|
-
writeText3(
|
|
948605
|
+
writeText3(line, contentX + 1, contentW - 2, text, { fg, bg: PALETTE.detailBg, bold: row === 0 });
|
|
949791
948606
|
}
|
|
949792
|
-
lines.push(
|
|
948607
|
+
lines.push(line);
|
|
949793
948608
|
}
|
|
949794
948609
|
const listStart = 3 + detailRows + 1;
|
|
949795
948610
|
if (listStart - 1 < lines.length) {
|
|
@@ -949996,13 +948811,13 @@ function describeUiRouting(value) {
|
|
|
949996
948811
|
|
|
949997
948812
|
// src/renderer/fullscreen-workspace.ts
|
|
949998
948813
|
var WORKSPACE_PALETTE = FULLSCREEN_PALETTE;
|
|
949999
|
-
function drawVertical2(
|
|
950000
|
-
if (x2 <= 0 || x2 >=
|
|
948814
|
+
function drawVertical2(line, x2, bg = "") {
|
|
948815
|
+
if (x2 <= 0 || x2 >= line.length - 1)
|
|
950001
948816
|
return;
|
|
950002
|
-
drawVerticalRule(
|
|
948817
|
+
drawVerticalRule(line, x2, WORKSPACE_PALETTE.border, bg);
|
|
950003
948818
|
}
|
|
950004
|
-
function drawHorizontalRange(
|
|
950005
|
-
drawHorizontalRule(
|
|
948819
|
+
function drawHorizontalRange(line, startX, endX, bg = "") {
|
|
948820
|
+
drawHorizontalRule(line, Math.max(1, startX), Math.min(line.length - 2, endX), WORKSPACE_PALETTE.border, bg);
|
|
950006
948821
|
}
|
|
950007
948822
|
function leftWidthFor(width, explicit) {
|
|
950008
948823
|
if (explicit !== undefined)
|
|
@@ -950072,23 +948887,23 @@ function renderFullscreenWorkspace(options) {
|
|
|
950072
948887
|
const inContext = y2 < separatorY;
|
|
950073
948888
|
const inSeparator = y2 === separatorY;
|
|
950074
948889
|
const bg = inSeparator ? "" : inContext ? WORKSPACE_PALETTE.contextBg : WORKSPACE_PALETTE.controlsBg;
|
|
950075
|
-
const
|
|
950076
|
-
fillRange(
|
|
950077
|
-
drawVertical2(
|
|
948890
|
+
const line = contentLine(safeWidth, bg);
|
|
948891
|
+
fillRange(line, 1, dividerX - 1, WORKSPACE_PALETTE.categoryBg);
|
|
948892
|
+
drawVertical2(line, dividerX, bg);
|
|
950078
948893
|
const leftRow = options.leftRows[row] ?? { text: "", kind: "empty" };
|
|
950079
948894
|
if (leftRow.selected)
|
|
950080
|
-
fillRange(
|
|
950081
|
-
writeText2(
|
|
948895
|
+
fillRange(line, leftStart, dividerX - 1, WORKSPACE_PALETTE.selectedBg);
|
|
948896
|
+
writeText2(line, leftStart + 1, leftWidth - 3, leftRow.text, {
|
|
950082
948897
|
fg: leftRow.selected ? WORKSPACE_PALETTE.text : rowFg(leftRow, WORKSPACE_PALETTE.muted),
|
|
950083
948898
|
bg: leftRow.selected ? WORKSPACE_PALETTE.selectedBg : WORKSPACE_PALETTE.categoryBg,
|
|
950084
948899
|
bold: leftRow.bold ?? (leftRow.selected || leftRow.kind === "group"),
|
|
950085
948900
|
dim: leftRow.dim
|
|
950086
948901
|
});
|
|
950087
948902
|
if (inSeparator) {
|
|
950088
|
-
drawHorizontalRange(
|
|
948903
|
+
drawHorizontalRange(line, centerStart, centerEnd);
|
|
950089
948904
|
} else if (inContext) {
|
|
950090
948905
|
const contextRow = options.contextRows[row] ?? { text: "", kind: "empty" };
|
|
950091
|
-
writeText2(
|
|
948906
|
+
writeText2(line, centerStart + 1, contextWidth, contextRow.text, {
|
|
950092
948907
|
fg: rowFg(contextRow, WORKSPACE_PALETTE.text),
|
|
950093
948908
|
bg,
|
|
950094
948909
|
bold: contextRow.bold,
|
|
@@ -950097,15 +948912,15 @@ function renderFullscreenWorkspace(options) {
|
|
|
950097
948912
|
} else {
|
|
950098
948913
|
const controlRow = options.controlRows[row - contextRows - 1] ?? { text: "", kind: "empty" };
|
|
950099
948914
|
if (controlRow.selected)
|
|
950100
|
-
fillRange(
|
|
950101
|
-
writeText2(
|
|
948915
|
+
fillRange(line, centerStart, centerEnd, WORKSPACE_PALETTE.selectedBg);
|
|
948916
|
+
writeText2(line, centerStart + 1, contextWidth, controlRow.text, {
|
|
950102
948917
|
fg: controlRow.selected ? WORKSPACE_PALETTE.text : rowFg(controlRow, WORKSPACE_PALETTE.text),
|
|
950103
948918
|
bg: controlRow.selected ? WORKSPACE_PALETTE.selectedBg : bg,
|
|
950104
948919
|
bold: controlRow.bold ?? controlRow.selected,
|
|
950105
948920
|
dim: controlRow.dim ?? controlRow.text.length === 0
|
|
950106
948921
|
});
|
|
950107
948922
|
}
|
|
950108
|
-
lines.push(
|
|
948923
|
+
lines.push(line);
|
|
950109
948924
|
}
|
|
950110
948925
|
const footer = contentLine(safeWidth, WORKSPACE_PALETTE.footerBg);
|
|
950111
948926
|
writeText2(footer, 2, safeWidth - 4, options.footer, { fg: WORKSPACE_PALETTE.muted, bg: WORKSPACE_PALETTE.footerBg });
|
|
@@ -950193,7 +949008,7 @@ function paddedWrapped(text, width, prefix = "") {
|
|
|
950193
949008
|
const wrapped = wrapText(text, safeWidth);
|
|
950194
949009
|
if (prefix.length === 0)
|
|
950195
949010
|
return wrapped;
|
|
950196
|
-
return wrapped.map((
|
|
949011
|
+
return wrapped.map((line, index) => `${index === 0 ? prefix : " ".repeat(getDisplayWidth(prefix))}${line}`);
|
|
950197
949012
|
}
|
|
950198
949013
|
function formatDefaultValue(value) {
|
|
950199
949014
|
if (value === "")
|
|
@@ -950333,12 +949148,12 @@ function buildContextLines(modal, width) {
|
|
|
950333
949148
|
}
|
|
950334
949149
|
lines.push("", `Category purpose: ${CATEGORY_INFO[category]}`);
|
|
950335
949150
|
const wrapped = [];
|
|
950336
|
-
for (const
|
|
950337
|
-
if (
|
|
949151
|
+
for (const line of lines) {
|
|
949152
|
+
if (line === "") {
|
|
950338
949153
|
wrapped.push("");
|
|
950339
949154
|
continue;
|
|
950340
949155
|
}
|
|
950341
|
-
wrapped.push(...paddedWrapped(
|
|
949156
|
+
wrapped.push(...paddedWrapped(line, width));
|
|
950342
949157
|
}
|
|
950343
949158
|
return wrapped;
|
|
950344
949159
|
}
|
|
@@ -950650,7 +949465,7 @@ function renderProcessIndicator(width, agentCount, toolCount, focused = false, a
|
|
|
950650
949465
|
const bg = "#31506f";
|
|
950651
949466
|
const fg = "#eefaff";
|
|
950652
949467
|
const markerFg = "#7dd3fc";
|
|
950653
|
-
const
|
|
949468
|
+
const line = UIFactory.stringToLine(" ".repeat(width), width, { fg: "238" });
|
|
950654
949469
|
const prefix = `${GLYPHS.navigation.selected} `;
|
|
950655
949470
|
const body2 = truncateToWidth2(text, Math.max(0, width - 8));
|
|
950656
949471
|
const highlighted = ` ${prefix}${body2} `;
|
|
@@ -950658,13 +949473,13 @@ function renderProcessIndicator(width, agentCount, toolCount, focused = false, a
|
|
|
950658
949473
|
for (let i5 = 0;i5 < highlighted.length && startX + i5 < width - 2; i5++) {
|
|
950659
949474
|
const ch = highlighted[i5];
|
|
950660
949475
|
const isMarker = i5 < prefix.length + 1;
|
|
950661
|
-
|
|
950662
|
-
|
|
950663
|
-
|
|
950664
|
-
|
|
950665
|
-
|
|
949476
|
+
line[startX + i5].char = ch;
|
|
949477
|
+
line[startX + i5].fg = isMarker ? markerFg : fg;
|
|
949478
|
+
line[startX + i5].bg = bg;
|
|
949479
|
+
line[startX + i5].bold = true;
|
|
949480
|
+
line[startX + i5].dim = false;
|
|
950666
949481
|
}
|
|
950667
|
-
return [
|
|
949482
|
+
return [line];
|
|
950668
949483
|
};
|
|
950669
949484
|
if (focused) {
|
|
950670
949485
|
const parts3 = [];
|
|
@@ -950792,13 +949607,13 @@ function renderFilePickerOverlay(picker, width, viewportHeight = 24) {
|
|
|
950792
949607
|
const isSelected = i5 === picker.selectedIndex;
|
|
950793
949608
|
const indicator = isSelected ? `${OVERLAY_GLYPHS.selected} ` : " ";
|
|
950794
949609
|
const displayFile = getDisplayWidth(file2) > contentW - 2 ? truncateDisplay(file2, contentW - 2) : file2;
|
|
950795
|
-
const
|
|
950796
|
-
putOverlayText(
|
|
949610
|
+
const line = createOverlayContentLine(width, layout, borderFg, isSelected ? selectedBg : DEFAULT_OVERLAY_PALETTE.bodyBg);
|
|
949611
|
+
putOverlayText(line, layout.margin + 2, contentW, fitDisplay(indicator + fitDisplay(displayFile, contentW - 2), contentW), {
|
|
950797
949612
|
fg: isSelected ? titleFg : file2.endsWith("/") ? titleFg : bodyFg,
|
|
950798
949613
|
bg: isSelected ? selectedBg : DEFAULT_OVERLAY_PALETTE.bodyBg,
|
|
950799
949614
|
bold: isSelected
|
|
950800
949615
|
});
|
|
950801
|
-
lines.push(
|
|
949616
|
+
lines.push(line);
|
|
950802
949617
|
}
|
|
950803
949618
|
}
|
|
950804
949619
|
const bottomLine = createOverlayFilledBorderLine(width, layout, OVERLAY_GLYPHS.bottomLeft, OVERLAY_GLYPHS.horizontal, OVERLAY_GLYPHS.bottomRight, borderFg, DEFAULT_OVERLAY_PALETTE.sectionBg);
|
|
@@ -950822,8 +949637,8 @@ var SELECTION_MODAL_NAVIGATION_HINT = "[Up/Down] Navigate";
|
|
|
950822
949637
|
var SELECTION_MODAL_CLOSE_HINT = "[Esc] Close";
|
|
950823
949638
|
var SELECTION_MODAL_SEARCH_HINT = "[/] Search";
|
|
950824
949639
|
var SELECTION_MODAL_SPACE_TOGGLE_HINT = "[Space] Toggle";
|
|
950825
|
-
function putText(
|
|
950826
|
-
putOverlayText(
|
|
949640
|
+
function putText(line, startX, maxWidth, text, style) {
|
|
949641
|
+
putOverlayText(line, startX, maxWidth, text, style);
|
|
950827
949642
|
}
|
|
950828
949643
|
function primaryVerbForAction(primaryAction) {
|
|
950829
949644
|
return primaryAction === "toggle" ? "[Enter] Toggle" : primaryAction === "edit" ? "[Enter] Edit" : primaryAction === "delete" ? "[Enter] Delete" : "[Enter] Select";
|
|
@@ -950871,10 +949686,10 @@ function renderSelectionModalOverlay(modal, width, viewportHeight = 24) {
|
|
|
950871
949686
|
lines.push(listTitle);
|
|
950872
949687
|
const items = modal.filteredItems;
|
|
950873
949688
|
if (items.length === 0) {
|
|
950874
|
-
const
|
|
949689
|
+
const line = createOverlayContentLine(width, layout, BORDER_FG, DEFAULT_OVERLAY_PALETTE.bodyBg);
|
|
950875
949690
|
const message = modal.query ? SELECTION_MODAL_NO_MATCHING_ITEMS : SELECTION_MODAL_NO_ITEMS;
|
|
950876
|
-
putText(
|
|
950877
|
-
lines.push(
|
|
949691
|
+
putText(line, layout.margin + 2, layout.innerWidth, fitDisplay(message, layout.innerWidth), { fg: MUTED_FG, dim: true });
|
|
949692
|
+
lines.push(line);
|
|
950878
949693
|
} else {
|
|
950879
949694
|
const maxVisible = metrics.contentRows;
|
|
950880
949695
|
let startIdx = 0;
|
|
@@ -950968,9 +949783,9 @@ function renderSelectionModalOverlay(modal, width, viewportHeight = 24) {
|
|
|
950968
949783
|
|
|
950969
949784
|
// src/renderer/bottom-bar.ts
|
|
950970
949785
|
function createBottomBarLine(width, style) {
|
|
950971
|
-
const
|
|
949786
|
+
const line = createEmptyLine(width);
|
|
950972
949787
|
for (let col = 0;col < width; col++) {
|
|
950973
|
-
|
|
949788
|
+
line[col] = createStyledCell(" ", {
|
|
950974
949789
|
fg: style.fg,
|
|
950975
949790
|
bg: style.bg,
|
|
950976
949791
|
bold: style.bold ?? false,
|
|
@@ -950978,26 +949793,26 @@ function createBottomBarLine(width, style) {
|
|
|
950978
949793
|
underline: style.underline ?? false
|
|
950979
949794
|
});
|
|
950980
949795
|
}
|
|
950981
|
-
return
|
|
949796
|
+
return line;
|
|
950982
949797
|
}
|
|
950983
|
-
function writeBottomBarText(
|
|
949798
|
+
function writeBottomBarText(line, startX, maxWidth, text, style) {
|
|
950984
949799
|
let x2 = startX;
|
|
950985
949800
|
let used = 0;
|
|
950986
949801
|
for (const ch of text) {
|
|
950987
949802
|
const cellWidth = getDisplayWidth(ch);
|
|
950988
949803
|
if (cellWidth <= 0)
|
|
950989
949804
|
continue;
|
|
950990
|
-
if (used + cellWidth > maxWidth || x2 >=
|
|
949805
|
+
if (used + cellWidth > maxWidth || x2 >= line.length)
|
|
950991
949806
|
break;
|
|
950992
|
-
|
|
949807
|
+
line[x2] = createStyledCell(ch, {
|
|
950993
949808
|
fg: style.fg,
|
|
950994
949809
|
bg: style.bg,
|
|
950995
949810
|
bold: style.bold ?? false,
|
|
950996
949811
|
dim: style.dim ?? false,
|
|
950997
949812
|
underline: style.underline ?? false
|
|
950998
949813
|
});
|
|
950999
|
-
if (cellWidth > 1 && x2 + 1 <
|
|
951000
|
-
|
|
949814
|
+
if (cellWidth > 1 && x2 + 1 < line.length) {
|
|
949815
|
+
line[x2 + 1] = createStyledCell(" ", {
|
|
951001
949816
|
fg: style.fg,
|
|
951002
949817
|
bg: style.bg,
|
|
951003
949818
|
bold: style.bold ?? false,
|
|
@@ -951033,13 +949848,13 @@ function renderSearchOverlay(manager5, width) {
|
|
|
951033
949848
|
const leftWidth = width - hintsW - matchStrW - 2;
|
|
951034
949849
|
const truncatedLeft = fitDisplay(getDisplayWidth(leftPart) > leftWidth ? truncateDisplay(leftPart, leftWidth) : leftPart, leftWidth);
|
|
951035
949850
|
const fullLine = truncatedLeft + matchStr + hints + " ";
|
|
951036
|
-
const
|
|
951037
|
-
writeBottomBarText(
|
|
949851
|
+
const line = createBottomBarLine(width, { fg: "#000000", bg: "#00ffcc" });
|
|
949852
|
+
writeBottomBarText(line, 0, width, fitDisplay(truncateDisplay(fullLine, width), width), { fg: "#000000", bg: "#00ffcc" });
|
|
951038
949853
|
if (matchStr.length > 0) {
|
|
951039
949854
|
const matchStart = getDisplayWidth(truncatedLeft);
|
|
951040
|
-
writeBottomBarText(
|
|
949855
|
+
writeBottomBarText(line, matchStart, matchStrW, matchStr, { fg: "#888888", bg: "#00ffcc", dim: true });
|
|
951041
949856
|
}
|
|
951042
|
-
return [
|
|
949857
|
+
return [line];
|
|
951043
949858
|
}
|
|
951044
949859
|
|
|
951045
949860
|
// src/renderer/history-search-overlay.ts
|
|
@@ -951075,22 +949890,22 @@ function renderHistorySearchOverlay(historySearch, width) {
|
|
|
951075
949890
|
const matchText = hasMatch ? match?.entry ?? "" : "";
|
|
951076
949891
|
const label = historySearchLabel(prefix, historySearch.query);
|
|
951077
949892
|
const full = truncateToWidth3(label + matchText, width);
|
|
951078
|
-
const
|
|
951079
|
-
writeBottomBarText(
|
|
949893
|
+
const line = createBottomBarLine(width, { fg: "#000000", bg: "#00ffcc" });
|
|
949894
|
+
writeBottomBarText(line, 0, width, full, { fg: "#000000", bg: "#00ffcc" });
|
|
951080
949895
|
if (hasMatch && match) {
|
|
951081
949896
|
const labelW = getDisplayWidth(label);
|
|
951082
949897
|
const matchStartCol = labelW + match.matchStart;
|
|
951083
949898
|
const matchEndCol = matchStartCol + match.matchLength;
|
|
951084
949899
|
const highlightWidth = Math.max(0, matchEndCol - matchStartCol);
|
|
951085
949900
|
const matchedSlice = truncateToWidth3(match.entry.slice(match.matchStart, match.matchStart + match.matchLength), highlightWidth);
|
|
951086
|
-
writeBottomBarText(
|
|
949901
|
+
writeBottomBarText(line, matchStartCol, highlightWidth, matchedSlice, {
|
|
951087
949902
|
fg: "#000000",
|
|
951088
949903
|
bg: "#00ffcc",
|
|
951089
949904
|
bold: true,
|
|
951090
949905
|
underline: true
|
|
951091
949906
|
});
|
|
951092
949907
|
}
|
|
951093
|
-
return [
|
|
949908
|
+
return [line];
|
|
951094
949909
|
}
|
|
951095
949910
|
|
|
951096
949911
|
// src/renderer/mcp-workspace.ts
|
|
@@ -951580,7 +950395,6 @@ var FEATURED_HELP_COMMANDS = [
|
|
|
951580
950395
|
["personas", "", "Manage serial Agent operating personas"],
|
|
951581
950396
|
["skills", "", "Manage Agent-local skills and bundles"],
|
|
951582
950397
|
["routines", "", "Manage reusable main-conversation routines"],
|
|
951583
|
-
["workplan", "", "Inspect shared work-plan state"],
|
|
951584
950398
|
["approval", "", "Review and explicitly act on approvals"],
|
|
951585
950399
|
["automation", "", "Run confirmed connected-host automation actions"],
|
|
951586
950400
|
["schedule", "remind", "Create confirmed reminders or inspect schedules"],
|
|
@@ -951664,7 +950478,6 @@ function renderHelpOverlay(width, keybindingsManager, commands3, scrollOffset =
|
|
|
951664
950478
|
"personas",
|
|
951665
950479
|
"skills",
|
|
951666
950480
|
"routines",
|
|
951667
|
-
"workplan",
|
|
951668
950481
|
"approval",
|
|
951669
950482
|
"schedule",
|
|
951670
950483
|
"delegate",
|
|
@@ -951806,8 +950619,8 @@ var SELECTED_BG2 = DEFAULT_OVERLAY_PALETTE.selectedBg;
|
|
|
951806
950619
|
var AUTOCOMPLETE_TITLE = " Commands";
|
|
951807
950620
|
var AUTOCOMPLETE_EMPTY_QUERY = "/";
|
|
951808
950621
|
var AUTOCOMPLETE_HINTS = "[Tab] Complete [Up/Down] Navigate [Enter] Execute [Esc] Cancel";
|
|
951809
|
-
function putText2(
|
|
951810
|
-
putOverlayText(
|
|
950622
|
+
function putText2(line, startX, maxWidth, text, style) {
|
|
950623
|
+
putOverlayText(line, startX, maxWidth, text, style);
|
|
951811
950624
|
}
|
|
951812
950625
|
function autocompleteQueryText(query2) {
|
|
951813
950626
|
return query2 ? `/${query2}` : AUTOCOMPLETE_EMPTY_QUERY;
|
|
@@ -951853,34 +950666,34 @@ function renderAutocompleteOverlay(autocomplete, width, viewportHeight = 24) {
|
|
|
951853
950666
|
for (let i5 = startIdx;i5 < endIdx; i5++) {
|
|
951854
950667
|
const { command: command8 } = results[i5];
|
|
951855
950668
|
const isSelected = i5 === state4.selectedIndex;
|
|
951856
|
-
const
|
|
950669
|
+
const line = createOverlayContentLine(width, layout, BORDER_FG2, isSelected ? SELECTED_BG2 : "");
|
|
951857
950670
|
const indicator = isSelected ? "\u25B8 " : " ";
|
|
951858
950671
|
const commandText = fitDisplay(truncateDisplay(`/${command8.name}`, maxCommandWidth), maxCommandWidth);
|
|
951859
950672
|
const descriptionText = fitDisplay(truncateDisplay(command8.description, descWidth), descWidth);
|
|
951860
950673
|
let x2 = layout.margin + 2;
|
|
951861
|
-
putText2(
|
|
950674
|
+
putText2(line, x2, indicatorWidth, indicator, {
|
|
951862
950675
|
fg: isSelected ? TITLE_FG2 : MUTED_FG2,
|
|
951863
950676
|
bg: isSelected ? SELECTED_BG2 : "",
|
|
951864
950677
|
bold: isSelected
|
|
951865
950678
|
});
|
|
951866
950679
|
x2 += indicatorWidth;
|
|
951867
|
-
putText2(
|
|
950680
|
+
putText2(line, x2, maxCommandWidth, commandText, {
|
|
951868
950681
|
fg: isSelected ? TITLE_FG2 : BODY_FG2,
|
|
951869
950682
|
bg: isSelected ? SELECTED_BG2 : "",
|
|
951870
950683
|
bold: isSelected
|
|
951871
950684
|
});
|
|
951872
950685
|
x2 += maxCommandWidth;
|
|
951873
|
-
putText2(
|
|
950686
|
+
putText2(line, x2, gapWidth, " ", {
|
|
951874
950687
|
fg: BODY_FG2,
|
|
951875
950688
|
bg: isSelected ? SELECTED_BG2 : ""
|
|
951876
950689
|
});
|
|
951877
950690
|
x2 += gapWidth;
|
|
951878
|
-
putText2(
|
|
950691
|
+
putText2(line, x2, descWidth, descriptionText, {
|
|
951879
950692
|
fg: isSelected ? BODY_FG2 : MUTED_FG2,
|
|
951880
950693
|
bg: isSelected ? SELECTED_BG2 : "",
|
|
951881
950694
|
bold: false
|
|
951882
950695
|
});
|
|
951883
|
-
lines.push(
|
|
950696
|
+
lines.push(line);
|
|
951884
950697
|
}
|
|
951885
950698
|
if (total > maxVisible) {
|
|
951886
950699
|
const scrollLine = createOverlayContentLine(width, layout);
|
|
@@ -952800,505 +951613,6 @@ function actionCommand(action2) {
|
|
|
952800
951613
|
function isOnboardingCategory(category) {
|
|
952801
951614
|
return category.group === "ONBOARDING";
|
|
952802
951615
|
}
|
|
952803
|
-
function editorPurposeLabel(editorKind) {
|
|
952804
|
-
switch (editorKind) {
|
|
952805
|
-
case "mcp-server":
|
|
952806
|
-
return "Edit MCP server";
|
|
952807
|
-
case "mcp-tools-server":
|
|
952808
|
-
return "Edit MCP tools server";
|
|
952809
|
-
case "mcp-repair":
|
|
952810
|
-
return "Repair MCP connection";
|
|
952811
|
-
case "secret-link":
|
|
952812
|
-
return "Link secret reference";
|
|
952813
|
-
case "secret-set":
|
|
952814
|
-
return "Store secret";
|
|
952815
|
-
case "secret-test":
|
|
952816
|
-
return "Test secret reference";
|
|
952817
|
-
case "secret-delete":
|
|
952818
|
-
return "Delete secret";
|
|
952819
|
-
case "subscription-login-start":
|
|
952820
|
-
return "Sign in to provider";
|
|
952821
|
-
case "subscription-login-finish":
|
|
952822
|
-
return "Finish provider sign-in";
|
|
952823
|
-
case "subscription-logout":
|
|
952824
|
-
return "Sign out of provider";
|
|
952825
|
-
case "subscription-inspect":
|
|
952826
|
-
return "Inspect subscription";
|
|
952827
|
-
case "provider-add":
|
|
952828
|
-
return "Add custom provider";
|
|
952829
|
-
case "provider-remove":
|
|
952830
|
-
return "Remove custom provider";
|
|
952831
|
-
case "provider-use":
|
|
952832
|
-
return "Choose provider";
|
|
952833
|
-
case "provider-inspect":
|
|
952834
|
-
return "Inspect provider";
|
|
952835
|
-
case "provider-routes":
|
|
952836
|
-
return "Edit provider routes";
|
|
952837
|
-
case "provider-account-repair":
|
|
952838
|
-
return "Repair provider account";
|
|
952839
|
-
case "memory":
|
|
952840
|
-
return "Edit memory";
|
|
952841
|
-
case "memory-search":
|
|
952842
|
-
return "Search memory";
|
|
952843
|
-
case "memory-get":
|
|
952844
|
-
return "Get memory record";
|
|
952845
|
-
case "memory-explain":
|
|
952846
|
-
return "Explain memory";
|
|
952847
|
-
case "memory-promote":
|
|
952848
|
-
return "Promote memory";
|
|
952849
|
-
case "memory-link":
|
|
952850
|
-
return "Link memory";
|
|
952851
|
-
case "memory-export":
|
|
952852
|
-
return "Export memory";
|
|
952853
|
-
case "memory-import":
|
|
952854
|
-
return "Import memory";
|
|
952855
|
-
case "memory-handoff-export":
|
|
952856
|
-
return "Export memory handoff";
|
|
952857
|
-
case "memory-handoff-inspect":
|
|
952858
|
-
return "Inspect memory handoff";
|
|
952859
|
-
case "memory-handoff-import":
|
|
952860
|
-
return "Import memory handoff";
|
|
952861
|
-
case "memory-vector-rebuild":
|
|
952862
|
-
return "Rebuild memory vectors";
|
|
952863
|
-
case "note":
|
|
952864
|
-
return "Edit note";
|
|
952865
|
-
case "persona":
|
|
952866
|
-
return "Edit persona";
|
|
952867
|
-
case "persona-search":
|
|
952868
|
-
return "Search personas";
|
|
952869
|
-
case "persona-show":
|
|
952870
|
-
return "Show persona";
|
|
952871
|
-
case "persona-discovery-import":
|
|
952872
|
-
return "Import persona files";
|
|
952873
|
-
case "skill":
|
|
952874
|
-
return "Edit skill";
|
|
952875
|
-
case "skill-search":
|
|
952876
|
-
return "Search skills";
|
|
952877
|
-
case "skill-show":
|
|
952878
|
-
return "Show skill";
|
|
952879
|
-
case "skill-discovery-import":
|
|
952880
|
-
return "Import skill files";
|
|
952881
|
-
case "routine":
|
|
952882
|
-
return "Edit routine";
|
|
952883
|
-
case "routine-search":
|
|
952884
|
-
return "Search routines";
|
|
952885
|
-
case "routine-show":
|
|
952886
|
-
return "Show routine";
|
|
952887
|
-
case "routine-discovery-import":
|
|
952888
|
-
return "Import routine files";
|
|
952889
|
-
case "profile":
|
|
952890
|
-
return "Edit profile";
|
|
952891
|
-
case "profile-from-discovered":
|
|
952892
|
-
return "Create profile from files";
|
|
952893
|
-
case "profile-show":
|
|
952894
|
-
return "Show profile";
|
|
952895
|
-
case "profile-default":
|
|
952896
|
-
return "Set default profile";
|
|
952897
|
-
case "profile-default-clear":
|
|
952898
|
-
return "Clear default profile";
|
|
952899
|
-
case "profile-delete":
|
|
952900
|
-
return "Delete profile";
|
|
952901
|
-
case "profile-template-export":
|
|
952902
|
-
return "Export profile template";
|
|
952903
|
-
case "profile-template-import":
|
|
952904
|
-
return "Import profile template";
|
|
952905
|
-
case "profile-template-show":
|
|
952906
|
-
return "Show profile template";
|
|
952907
|
-
case "profile-template-from-discovered":
|
|
952908
|
-
return "Create template from files";
|
|
952909
|
-
case "knowledge-url":
|
|
952910
|
-
return "Ingest URL";
|
|
952911
|
-
case "knowledge-urls":
|
|
952912
|
-
return "Ingest URLs";
|
|
952913
|
-
case "knowledge-file":
|
|
952914
|
-
return "Ingest file";
|
|
952915
|
-
case "knowledge-bookmarks":
|
|
952916
|
-
return "Import bookmarks";
|
|
952917
|
-
case "knowledge-browser-history":
|
|
952918
|
-
return "Import browser history";
|
|
952919
|
-
case "knowledge-connector-ingest":
|
|
952920
|
-
return "Run connector ingest";
|
|
952921
|
-
case "knowledge-connector-show":
|
|
952922
|
-
return "Show connector";
|
|
952923
|
-
case "knowledge-connector-doctor":
|
|
952924
|
-
return "Check connector health";
|
|
952925
|
-
case "knowledge-reindex":
|
|
952926
|
-
return "Reindex knowledge";
|
|
952927
|
-
case "knowledge-search":
|
|
952928
|
-
return "Search knowledge";
|
|
952929
|
-
case "knowledge-ask":
|
|
952930
|
-
return "Ask knowledge";
|
|
952931
|
-
case "knowledge-get":
|
|
952932
|
-
return "Get knowledge record";
|
|
952933
|
-
case "knowledge-map":
|
|
952934
|
-
return "Map knowledge";
|
|
952935
|
-
case "knowledge-review-issue":
|
|
952936
|
-
return "Review knowledge issue";
|
|
952937
|
-
case "knowledge-consolidate":
|
|
952938
|
-
return "Consolidate knowledge";
|
|
952939
|
-
case "knowledge-packet":
|
|
952940
|
-
return "Build knowledge packet";
|
|
952941
|
-
case "knowledge-explain":
|
|
952942
|
-
return "Explain knowledge";
|
|
952943
|
-
case "delegate-task":
|
|
952944
|
-
return "Delegate build task";
|
|
952945
|
-
case "document-browse":
|
|
952946
|
-
return "Browse documents";
|
|
952947
|
-
case "document-show":
|
|
952948
|
-
return "Show document";
|
|
952949
|
-
case "document-create":
|
|
952950
|
-
return "Create document";
|
|
952951
|
-
case "document-update":
|
|
952952
|
-
return "Revise document";
|
|
952953
|
-
case "document-review":
|
|
952954
|
-
return "Review document";
|
|
952955
|
-
case "document-comment":
|
|
952956
|
-
return "Add comment";
|
|
952957
|
-
case "document-resolve-comment":
|
|
952958
|
-
return "Resolve comment";
|
|
952959
|
-
case "document-suggest":
|
|
952960
|
-
return "Propose suggestion";
|
|
952961
|
-
case "document-accept-suggestion":
|
|
952962
|
-
return "Accept suggestion";
|
|
952963
|
-
case "document-reject-suggestion":
|
|
952964
|
-
return "Reject suggestion";
|
|
952965
|
-
case "document-insert-artifact":
|
|
952966
|
-
return "Insert artifact";
|
|
952967
|
-
case "document-attach-artifact":
|
|
952968
|
-
return "Attach artifact";
|
|
952969
|
-
case "document-export":
|
|
952970
|
-
return "Export document";
|
|
952971
|
-
case "document-reviewer-readiness":
|
|
952972
|
-
return "Review readiness preflight";
|
|
952973
|
-
case "document-review-packet-wizard":
|
|
952974
|
-
return "Run packet wizard";
|
|
952975
|
-
case "document-review-packet-preset":
|
|
952976
|
-
return "Save packet preset";
|
|
952977
|
-
case "document-review-packet-preset-refresh":
|
|
952978
|
-
return "Refresh packet preset";
|
|
952979
|
-
case "document-review-packet-share":
|
|
952980
|
-
return "Share review packet";
|
|
952981
|
-
case "model-compare":
|
|
952982
|
-
return "Compare models";
|
|
952983
|
-
case "model-compare-review":
|
|
952984
|
-
return "Review comparison";
|
|
952985
|
-
case "model-compare-handoff-diff":
|
|
952986
|
-
return "Diff reviewer handoffs";
|
|
952987
|
-
case "model-compare-judge":
|
|
952988
|
-
return "Judge comparison";
|
|
952989
|
-
case "model-compare-apply":
|
|
952990
|
-
return "Apply comparison winner";
|
|
952991
|
-
case "model-compare-route-decision":
|
|
952992
|
-
return "Record route decision";
|
|
952993
|
-
case "model-compare-export":
|
|
952994
|
-
return "Export comparison";
|
|
952995
|
-
case "model-compare-analytics":
|
|
952996
|
-
return "View comparison analytics";
|
|
952997
|
-
case "local-model-benchmark":
|
|
952998
|
-
return "Run local benchmark";
|
|
952999
|
-
case "auth-show":
|
|
953000
|
-
return "Show auth status";
|
|
953001
|
-
case "auth-repair":
|
|
953002
|
-
return "Repair auth";
|
|
953003
|
-
case "auth-bundle-export":
|
|
953004
|
-
return "Export auth bundle";
|
|
953005
|
-
case "auth-bundle-inspect":
|
|
953006
|
-
return "Inspect auth bundle";
|
|
953007
|
-
case "trust-bundle-export":
|
|
953008
|
-
return "Export trust bundle";
|
|
953009
|
-
case "trust-bundle-inspect":
|
|
953010
|
-
return "Inspect trust bundle";
|
|
953011
|
-
case "support-bundle-export":
|
|
953012
|
-
return "Export support bundle";
|
|
953013
|
-
case "support-bundle-inspect":
|
|
953014
|
-
return "Inspect support bundle";
|
|
953015
|
-
case "support-bundle-import":
|
|
953016
|
-
return "Import support bundle";
|
|
953017
|
-
case "subscription-bundle-export":
|
|
953018
|
-
return "Export subscription bundle";
|
|
953019
|
-
case "subscription-bundle-inspect":
|
|
953020
|
-
return "Inspect subscription bundle";
|
|
953021
|
-
case "voice-enable":
|
|
953022
|
-
return "Enable voice";
|
|
953023
|
-
case "voice-disable":
|
|
953024
|
-
return "Disable voice";
|
|
953025
|
-
case "voice-bundle-export":
|
|
953026
|
-
return "Export voice bundle";
|
|
953027
|
-
case "voice-bundle-inspect":
|
|
953028
|
-
return "Inspect voice bundle";
|
|
953029
|
-
case "tts-prompt":
|
|
953030
|
-
return "Test TTS prompt";
|
|
953031
|
-
case "image-input":
|
|
953032
|
-
return "Attach image";
|
|
953033
|
-
case "artifact-browser":
|
|
953034
|
-
return "Browse artifacts";
|
|
953035
|
-
case "artifact-show":
|
|
953036
|
-
return "Show artifact";
|
|
953037
|
-
case "artifact-export-file":
|
|
953038
|
-
return "Export artifact to file";
|
|
953039
|
-
case "artifact-export-package":
|
|
953040
|
-
return "Export artifact package";
|
|
953041
|
-
case "artifact-promote-knowledge":
|
|
953042
|
-
return "Promote artifact to knowledge";
|
|
953043
|
-
case "media-generate":
|
|
953044
|
-
return "Generate media";
|
|
953045
|
-
case "conversation-export":
|
|
953046
|
-
return "Export conversation";
|
|
953047
|
-
case "conversation-events":
|
|
953048
|
-
return "Show conversation events";
|
|
953049
|
-
case "conversation-groups":
|
|
953050
|
-
return "Show conversation groups";
|
|
953051
|
-
case "conversation-find":
|
|
953052
|
-
return "Find conversation";
|
|
953053
|
-
case "effort-level":
|
|
953054
|
-
return "Set effort level";
|
|
953055
|
-
case "channel-show":
|
|
953056
|
-
return "Show channel";
|
|
953057
|
-
case "channel-doctor":
|
|
953058
|
-
return "Check channel health";
|
|
953059
|
-
case "channel-setup":
|
|
953060
|
-
return "Set up channel";
|
|
953061
|
-
case "channel-send":
|
|
953062
|
-
return "Send to channel";
|
|
953063
|
-
case "session-save":
|
|
953064
|
-
return "Save session";
|
|
953065
|
-
case "session-load":
|
|
953066
|
-
return "Load session";
|
|
953067
|
-
case "session-rename":
|
|
953068
|
-
return "Rename session";
|
|
953069
|
-
case "session-resume":
|
|
953070
|
-
return "Resume session";
|
|
953071
|
-
case "session-info":
|
|
953072
|
-
return "Inspect session";
|
|
953073
|
-
case "session-export-saved":
|
|
953074
|
-
return "Export saved session";
|
|
953075
|
-
case "session-search":
|
|
953076
|
-
return "Search sessions";
|
|
953077
|
-
case "session-delete":
|
|
953078
|
-
return "Delete session";
|
|
953079
|
-
case "session-fork":
|
|
953080
|
-
return "Fork session";
|
|
953081
|
-
case "session-graph":
|
|
953082
|
-
return "Inspect session graph";
|
|
953083
|
-
case "task-list-filter":
|
|
953084
|
-
return "Filter task list";
|
|
953085
|
-
case "task-show":
|
|
953086
|
-
return "Show task";
|
|
953087
|
-
case "task-output":
|
|
953088
|
-
return "View task output";
|
|
953089
|
-
case "plan-seed":
|
|
953090
|
-
return "Seed plan";
|
|
953091
|
-
case "plan-show":
|
|
953092
|
-
return "Show plan";
|
|
953093
|
-
case "plan-approve":
|
|
953094
|
-
return "Approve plan";
|
|
953095
|
-
case "plan-override":
|
|
953096
|
-
return "Override plan";
|
|
953097
|
-
case "plan-clear":
|
|
953098
|
-
return "Clear plan";
|
|
953099
|
-
case "health-repair":
|
|
953100
|
-
return "Repair health issue";
|
|
953101
|
-
case "approval-review":
|
|
953102
|
-
return "Review approval";
|
|
953103
|
-
case "approval-approve":
|
|
953104
|
-
return "Approve request";
|
|
953105
|
-
case "approval-deny":
|
|
953106
|
-
return "Deny request";
|
|
953107
|
-
case "approval-cancel":
|
|
953108
|
-
return "Cancel approval";
|
|
953109
|
-
case "automation-job-run":
|
|
953110
|
-
return "Run automation job";
|
|
953111
|
-
case "automation-job-pause":
|
|
953112
|
-
return "Pause automation job";
|
|
953113
|
-
case "automation-job-resume":
|
|
953114
|
-
return "Resume automation job";
|
|
953115
|
-
case "automation-run-cancel":
|
|
953116
|
-
return "Cancel automation run";
|
|
953117
|
-
case "automation-run-retry":
|
|
953118
|
-
return "Retry automation run";
|
|
953119
|
-
case "schedule-run":
|
|
953120
|
-
return "Run schedule";
|
|
953121
|
-
case "schedule-edit":
|
|
953122
|
-
return "Edit schedule";
|
|
953123
|
-
case "routine-receipt":
|
|
953124
|
-
return "View routine receipt";
|
|
953125
|
-
case "schedule-receipt":
|
|
953126
|
-
return "View schedule receipt";
|
|
953127
|
-
case "mode-preset":
|
|
953128
|
-
return "Set mode preset";
|
|
953129
|
-
case "mode-domain":
|
|
953130
|
-
return "Set mode domain";
|
|
953131
|
-
case "setting-set":
|
|
953132
|
-
return "Set setting";
|
|
953133
|
-
case "model-pin":
|
|
953134
|
-
return "Pin model";
|
|
953135
|
-
case "model-unpin":
|
|
953136
|
-
return "Unpin model";
|
|
953137
|
-
case "workplan-add":
|
|
953138
|
-
return "Add work item";
|
|
953139
|
-
case "workplan-show":
|
|
953140
|
-
return "Show work plan";
|
|
953141
|
-
case "workplan-status":
|
|
953142
|
-
return "Check work plan status";
|
|
953143
|
-
case "workplan-delete":
|
|
953144
|
-
return "Delete work item";
|
|
953145
|
-
case "workplan-clear-completed":
|
|
953146
|
-
return "Clear completed items";
|
|
953147
|
-
case "routine-schedule":
|
|
953148
|
-
return "Schedule routine";
|
|
953149
|
-
case "reminder-schedule":
|
|
953150
|
-
return "Schedule reminder";
|
|
953151
|
-
case "skill-bundle":
|
|
953152
|
-
return "Edit skill bundle";
|
|
953153
|
-
case "skill-bundle-search":
|
|
953154
|
-
return "Search skill bundles";
|
|
953155
|
-
case "skill-bundle-show":
|
|
953156
|
-
return "Show skill bundle";
|
|
953157
|
-
case "skill-bundle-update":
|
|
953158
|
-
return "Update skill bundle";
|
|
953159
|
-
case "skill-bundle-enable":
|
|
953160
|
-
return "Enable skill bundle";
|
|
953161
|
-
case "skill-bundle-disable":
|
|
953162
|
-
return "Disable skill bundle";
|
|
953163
|
-
case "skill-bundle-review":
|
|
953164
|
-
return "Review skill bundle";
|
|
953165
|
-
case "skill-bundle-stale":
|
|
953166
|
-
return "Mark bundle stale";
|
|
953167
|
-
case "skill-bundle-delete":
|
|
953168
|
-
return "Delete skill bundle";
|
|
953169
|
-
case "learned-behavior":
|
|
953170
|
-
return "Review learned behavior";
|
|
953171
|
-
case "web-research":
|
|
953172
|
-
return "Run web research";
|
|
953173
|
-
case "web-fetch":
|
|
953174
|
-
return "Fetch from web";
|
|
953175
|
-
case "research-run":
|
|
953176
|
-
return "Run research";
|
|
953177
|
-
case "research-source":
|
|
953178
|
-
return "Manage research source";
|
|
953179
|
-
case "research-report":
|
|
953180
|
-
return "Show research report";
|
|
953181
|
-
case "notify-webhook":
|
|
953182
|
-
return "Add notification webhook";
|
|
953183
|
-
case "notify-webhook-remove":
|
|
953184
|
-
return "Remove notification webhook";
|
|
953185
|
-
case "notify-webhook-clear":
|
|
953186
|
-
return "Clear notification webhooks";
|
|
953187
|
-
case "notify-webhook-test":
|
|
953188
|
-
return "Test notification webhook";
|
|
953189
|
-
case "notify-send":
|
|
953190
|
-
return "Send notification";
|
|
953191
|
-
default:
|
|
953192
|
-
return `Edit ${editorKind}`;
|
|
953193
|
-
}
|
|
953194
|
-
}
|
|
953195
|
-
function localOperationLabel(localOperation) {
|
|
953196
|
-
switch (localOperation) {
|
|
953197
|
-
case "routine-start":
|
|
953198
|
-
return "Start routine";
|
|
953199
|
-
case "persona-activate":
|
|
953200
|
-
case "persona-use":
|
|
953201
|
-
return "Activate persona";
|
|
953202
|
-
case "persona-clear":
|
|
953203
|
-
return "Deactivate persona";
|
|
953204
|
-
case "persona-edit":
|
|
953205
|
-
return "Edit persona";
|
|
953206
|
-
case "persona-review":
|
|
953207
|
-
return "Review persona";
|
|
953208
|
-
case "persona-delete":
|
|
953209
|
-
return "Delete persona";
|
|
953210
|
-
case "memory-edit":
|
|
953211
|
-
return "Edit memory";
|
|
953212
|
-
case "memory-review":
|
|
953213
|
-
return "Review memory";
|
|
953214
|
-
case "memory-stale":
|
|
953215
|
-
return "Mark memory stale";
|
|
953216
|
-
case "memory-delete":
|
|
953217
|
-
return "Delete memory";
|
|
953218
|
-
case "note-edit":
|
|
953219
|
-
return "Edit note";
|
|
953220
|
-
case "note-review":
|
|
953221
|
-
return "Review note";
|
|
953222
|
-
case "note-stale":
|
|
953223
|
-
return "Mark note stale";
|
|
953224
|
-
case "note-delete":
|
|
953225
|
-
return "Delete note";
|
|
953226
|
-
case "note-promote-memory":
|
|
953227
|
-
return "Promote note to memory";
|
|
953228
|
-
case "note-promote-persona":
|
|
953229
|
-
return "Promote note to persona";
|
|
953230
|
-
case "note-promote-skill":
|
|
953231
|
-
return "Promote note to skill";
|
|
953232
|
-
case "note-promote-routine":
|
|
953233
|
-
return "Promote note to routine";
|
|
953234
|
-
case "note-promote-knowledge-url":
|
|
953235
|
-
return "Promote note to knowledge";
|
|
953236
|
-
case "skill-edit":
|
|
953237
|
-
return "Edit skill";
|
|
953238
|
-
case "skill-enable":
|
|
953239
|
-
return "Enable skill";
|
|
953240
|
-
case "skill-disable":
|
|
953241
|
-
return "Disable skill";
|
|
953242
|
-
case "skill-review":
|
|
953243
|
-
return "Review skill";
|
|
953244
|
-
case "skill-delete":
|
|
953245
|
-
return "Delete skill";
|
|
953246
|
-
case "routine-edit":
|
|
953247
|
-
return "Edit routine";
|
|
953248
|
-
case "routine-enable":
|
|
953249
|
-
return "Enable routine";
|
|
953250
|
-
case "routine-disable":
|
|
953251
|
-
return "Disable routine";
|
|
953252
|
-
case "routine-review":
|
|
953253
|
-
return "Review routine";
|
|
953254
|
-
case "routine-delete":
|
|
953255
|
-
return "Delete routine";
|
|
953256
|
-
default:
|
|
953257
|
-
return "Apply local action";
|
|
953258
|
-
}
|
|
953259
|
-
}
|
|
953260
|
-
function onboardingActionLabel(workspace, action2) {
|
|
953261
|
-
if (action2.kind === "settings-import")
|
|
953262
|
-
return "Import GoodVibes preferences";
|
|
953263
|
-
if (action2.kind === "setup-checkpoint") {
|
|
953264
|
-
if (action2.setupCheckpointOperation === "show")
|
|
953265
|
-
return "Review saved progress";
|
|
953266
|
-
if (action2.setupCheckpointOperation === "mark-current")
|
|
953267
|
-
return "Save progress";
|
|
953268
|
-
if (action2.setupCheckpointOperation === "clear")
|
|
953269
|
-
return "Clear saved progress";
|
|
953270
|
-
return "Review setup progress";
|
|
953271
|
-
}
|
|
953272
|
-
if (action2.kind === "model-picker")
|
|
953273
|
-
return action2.modelPickerFlow === "model" ? "Choose model" : "Choose provider and model";
|
|
953274
|
-
if (action2.kind === "settings-modal")
|
|
953275
|
-
return "Open settings";
|
|
953276
|
-
if (action2.kind === "workspace") {
|
|
953277
|
-
if (action2.targetCategoryId) {
|
|
953278
|
-
const target = workspace.categories.find((c4) => c4.id === action2.targetCategoryId);
|
|
953279
|
-
const label = target ? target.label : action2.targetCategoryId;
|
|
953280
|
-
return `Switch to ${label}`;
|
|
953281
|
-
}
|
|
953282
|
-
return "Switch to setup area";
|
|
953283
|
-
}
|
|
953284
|
-
if (action2.kind === "editor")
|
|
953285
|
-
return action2.editorKind ? editorPurposeLabel(action2.editorKind) : "Open form";
|
|
953286
|
-
if (action2.kind === "local-selection")
|
|
953287
|
-
return "Move selection";
|
|
953288
|
-
if (action2.kind === "local-operation")
|
|
953289
|
-
return action2.localOperation ? localOperationLabel(action2.localOperation) : "Apply local action";
|
|
953290
|
-
if (action2.kind === "onboarding-complete")
|
|
953291
|
-
return "Finish setup";
|
|
953292
|
-
if (action2.kind === "command") {
|
|
953293
|
-
const cmd = action2.command ?? "";
|
|
953294
|
-
return action2.commandBehavior === "inline" ? `Run: ${cmd}` : `Open: ${cmd}`;
|
|
953295
|
-
}
|
|
953296
|
-
if (action2.safety === "read-only")
|
|
953297
|
-
return "Review";
|
|
953298
|
-
if (action2.safety === "blocked")
|
|
953299
|
-
return "Unavailable in this setup step";
|
|
953300
|
-
return "Open";
|
|
953301
|
-
}
|
|
953302
951616
|
function onboardingActionColumns(workspace, action2) {
|
|
953303
951617
|
if (action2.kind === "setting") {
|
|
953304
951618
|
return workspace.settingActionDisplay(action2) ?? {
|
|
@@ -953308,9 +951622,9 @@ function onboardingActionColumns(workspace, action2) {
|
|
|
953308
951622
|
};
|
|
953309
951623
|
}
|
|
953310
951624
|
return {
|
|
953311
|
-
setting:
|
|
953312
|
-
defaultValue: "",
|
|
953313
|
-
currentValue: ""
|
|
951625
|
+
setting: action2.label,
|
|
951626
|
+
defaultValue: "\u2014",
|
|
951627
|
+
currentValue: "\u2014"
|
|
953314
951628
|
};
|
|
953315
951629
|
}
|
|
953316
951630
|
function actionChange(workspace, category, action2) {
|
|
@@ -953331,7 +951645,7 @@ function actionMetaLine(workspace, category, action2) {
|
|
|
953331
951645
|
}
|
|
953332
951646
|
function shouldRenderOnboardingSettingsTable(actions) {
|
|
953333
951647
|
const nonFinish = actions.filter((a4) => a4.kind !== "onboarding-complete");
|
|
953334
|
-
return nonFinish.length > 0
|
|
951648
|
+
return nonFinish.length > 0;
|
|
953335
951649
|
}
|
|
953336
951650
|
function editorContextLines(editor, snapshot2) {
|
|
953337
951651
|
const selected = editor.fields[editor.selectedFieldIndex];
|
|
@@ -953528,8 +951842,8 @@ function buildActionRows(workspace, width, height) {
|
|
|
953528
951842
|
if (workspace.lastActionResult) {
|
|
953529
951843
|
rows.push({ text: "" });
|
|
953530
951844
|
rows.push({ text: `${onboarding ? "Result" : "Action Result"}: ${workspace.lastActionResult.title}`, fg: actionResultColor(workspace.lastActionResult), bold: true });
|
|
953531
|
-
for (const
|
|
953532
|
-
rows.push({ text: ` ${
|
|
951845
|
+
for (const line of wrapText(workspace.lastActionResult.detail, Math.max(1, width - 2))) {
|
|
951846
|
+
rows.push({ text: ` ${line}`, fg: FULLSCREEN_PALETTE.text });
|
|
953533
951847
|
}
|
|
953534
951848
|
if (!onboarding && workspace.lastActionResult.command) {
|
|
953535
951849
|
rows.push({ text: ` Command: ${workspace.lastActionResult.command}`, fg: FULLSCREEN_PALETTE.muted });
|
|
@@ -953579,12 +951893,12 @@ function renderAgentWorkspace(workspace, width, height) {
|
|
|
953579
951893
|
|
|
953580
951894
|
// src/shell/agent-workspace-fullscreen.ts
|
|
953581
951895
|
function normalizeFullscreenViewport(lines, width, height) {
|
|
953582
|
-
const viewport = lines.slice(0, height).map((
|
|
953583
|
-
if (
|
|
953584
|
-
return
|
|
951896
|
+
const viewport = lines.slice(0, height).map((line) => {
|
|
951897
|
+
if (line.length === width)
|
|
951898
|
+
return line;
|
|
953585
951899
|
const next = createEmptyLine(width);
|
|
953586
|
-
for (let index = 0;index < Math.min(width,
|
|
953587
|
-
next[index] = { ...
|
|
951900
|
+
for (let index = 0;index < Math.min(width, line.length); index += 1) {
|
|
951901
|
+
next[index] = { ...line[index] };
|
|
953588
951902
|
}
|
|
953589
951903
|
return next;
|
|
953590
951904
|
});
|
|
@@ -954678,7 +952992,7 @@ function formatFatalStartupErrorForUser(error73, options) {
|
|
|
954678
952992
|
" reason: permission denied",
|
|
954679
952993
|
` next: launch from a writable directory, pass '${options.binary} --cd <dir>', or set GOODVIBES_WORKING_DIR to a writable path.`,
|
|
954680
952994
|
" note: GOODVIBES_AGENT_HOME can be set to move Agent-local config, sessions, memory, skills, personas, and routines."
|
|
954681
|
-
].filter((
|
|
952995
|
+
].filter((line) => line.length > 0).join(`
|
|
954682
952996
|
`);
|
|
954683
952997
|
}
|
|
954684
952998
|
if (isNodeLikeError(error73) && error73.code === "ENOENT") {
|
|
@@ -954687,7 +953001,7 @@ function formatFatalStartupErrorForUser(error73, options) {
|
|
|
954687
953001
|
error73.path ? ` path: ${error73.path}` : "",
|
|
954688
953002
|
` reason: ${message}`,
|
|
954689
953003
|
` next: check '${options.binary} --cd <dir>' and GOODVIBES_WORKING_DIR, then rerun '${options.binary} status'.`
|
|
954690
|
-
].filter((
|
|
953004
|
+
].filter((line) => line.length > 0).join(`
|
|
954691
953005
|
`);
|
|
954692
953006
|
}
|
|
954693
953007
|
return [
|
|
@@ -955249,444 +953563,6 @@ function readConfigString5(configManager, key) {
|
|
|
955249
953563
|
return String(configManager.get(key) ?? "").trim();
|
|
955250
953564
|
}
|
|
955251
953565
|
|
|
955252
|
-
// src/planning/project-planning-coordinator.ts
|
|
955253
|
-
var PLANNING_INTENT_PATTERNS = [
|
|
955254
|
-
/\b(plan|planning)\b/i,
|
|
955255
|
-
/\bimplementation (plan|strategy)\b/i,
|
|
955256
|
-
/\bexecution (plan|strategy)\b/i,
|
|
955257
|
-
/\bdependency graph\b/i,
|
|
955258
|
-
/\bbreak (this|it|that|the work) down\b/i,
|
|
955259
|
-
/\bbefore (coding|implementing|we start|execution)\b/i,
|
|
955260
|
-
/\bagent (handoff|assignment|assignments)\b/i,
|
|
955261
|
-
/\bverification gates?\b/i,
|
|
955262
|
-
/\binterview (me|loop)\b/i
|
|
955263
|
-
];
|
|
955264
|
-
var CANCEL_PATTERNS = [
|
|
955265
|
-
/\b(stop|cancel|pause|exit) (the )?planning\b/i,
|
|
955266
|
-
/\bplanning (is )?(done|cancelled|canceled|paused)\b/i,
|
|
955267
|
-
/\b(skip|dismiss) (the )?planning\b/i,
|
|
955268
|
-
/\bcontinue without (the )?planning\b/i
|
|
955269
|
-
];
|
|
955270
|
-
var APPROVAL_PATTERNS = [
|
|
955271
|
-
/\b(approve|approved|approval granted)\b/i,
|
|
955272
|
-
/\b(go ahead|execute this plan|start execution|ready to execute)\b/i
|
|
955273
|
-
];
|
|
955274
|
-
var ACCEPT_DEFAULT_PATTERNS = [
|
|
955275
|
-
/^(ok|okay|yes|y|yep|yeah|sure|fine|default|continue|go|go ahead|let'?s go|looks good|sounds good)\.?$/i,
|
|
955276
|
-
/\bok\b.*\blet'?s go\b/i,
|
|
955277
|
-
/\blet'?s go\b/i,
|
|
955278
|
-
/\b(use|accept|take) (the )?(default|recommended|recommendation)\b/i,
|
|
955279
|
-
/\b(create|use) (the )?default task breakdown\b/i,
|
|
955280
|
-
/\bfocused first-pass scope\b/i,
|
|
955281
|
-
/\bstandard verification gates?\b/i
|
|
955282
|
-
];
|
|
955283
|
-
var GENERIC_RECOMMENDATION_PATTERNS = [
|
|
955284
|
-
/\bdefine the first-pass scope\b/i,
|
|
955285
|
-
/\bseparate out-of-scope work\b/i,
|
|
955286
|
-
/\bcreate task records\b/i,
|
|
955287
|
-
/\brecord concrete tests\b/i,
|
|
955288
|
-
/\bverification gates?\b/i
|
|
955289
|
-
];
|
|
955290
|
-
function hasProjectPlanningIntent(text) {
|
|
955291
|
-
const trimmed2 = text.trim();
|
|
955292
|
-
if (!trimmed2 || trimmed2.startsWith("/"))
|
|
955293
|
-
return false;
|
|
955294
|
-
return PLANNING_INTENT_PATTERNS.some((pattern) => pattern.test(trimmed2));
|
|
955295
|
-
}
|
|
955296
|
-
|
|
955297
|
-
class ProjectPlanningCoordinator {
|
|
955298
|
-
service;
|
|
955299
|
-
projectId;
|
|
955300
|
-
workingDirectory;
|
|
955301
|
-
openPanel;
|
|
955302
|
-
notify;
|
|
955303
|
-
now;
|
|
955304
|
-
constructor(options) {
|
|
955305
|
-
this.service = options.service;
|
|
955306
|
-
this.projectId = options.projectId;
|
|
955307
|
-
this.workingDirectory = options.workingDirectory;
|
|
955308
|
-
this.openPanel = options.openPanel ?? (() => {});
|
|
955309
|
-
this.notify = options.notify ?? (() => {});
|
|
955310
|
-
this.now = options.now ?? (() => Date.now());
|
|
955311
|
-
}
|
|
955312
|
-
async prepareTurn(text) {
|
|
955313
|
-
const prompt = text.trim();
|
|
955314
|
-
if (!prompt || prompt.startsWith("!") || prompt.startsWith("/"))
|
|
955315
|
-
return null;
|
|
955316
|
-
const stateResult = await this.service.getState({ projectId: this.projectId });
|
|
955317
|
-
const existing = stateResult.state;
|
|
955318
|
-
const active = this.isActive(existing);
|
|
955319
|
-
const startsPlanning = hasProjectPlanningIntent(prompt);
|
|
955320
|
-
if (this.isCancel(prompt)) {
|
|
955321
|
-
if (existing) {
|
|
955322
|
-
await this.service.upsertState({
|
|
955323
|
-
projectId: this.projectId,
|
|
955324
|
-
state: {
|
|
955325
|
-
...existing,
|
|
955326
|
-
metadata: {
|
|
955327
|
-
...existing.metadata ?? {},
|
|
955328
|
-
active: false,
|
|
955329
|
-
pausedAt: this.now()
|
|
955330
|
-
}
|
|
955331
|
-
}
|
|
955332
|
-
});
|
|
955333
|
-
this.notify("[Planning] Paused project planning for this workspace.");
|
|
955334
|
-
}
|
|
955335
|
-
return null;
|
|
955336
|
-
}
|
|
955337
|
-
if (!active && !startsPlanning)
|
|
955338
|
-
return null;
|
|
955339
|
-
const answeredQuestion = active ? this.firstOpenQuestion(existing) : null;
|
|
955340
|
-
const stateDraft = this.buildStateDraft(existing, prompt, {
|
|
955341
|
-
startsPlanning,
|
|
955342
|
-
answeredQuestion,
|
|
955343
|
-
approved: this.isApproval(prompt)
|
|
955344
|
-
});
|
|
955345
|
-
const firstEvaluation = await this.service.evaluate({
|
|
955346
|
-
projectId: this.projectId,
|
|
955347
|
-
state: stateDraft
|
|
955348
|
-
});
|
|
955349
|
-
const withNextQuestion = this.recordNextQuestion(stateDraft, firstEvaluation.nextQuestion);
|
|
955350
|
-
const normalized3 = await this.service.evaluate({
|
|
955351
|
-
projectId: this.projectId,
|
|
955352
|
-
state: withNextQuestion
|
|
955353
|
-
});
|
|
955354
|
-
const saved = await this.service.upsertState({
|
|
955355
|
-
projectId: this.projectId,
|
|
955356
|
-
state: normalized3.state
|
|
955357
|
-
});
|
|
955358
|
-
const state4 = saved.state ?? normalized3.state;
|
|
955359
|
-
const evaluation = await this.service.evaluate({
|
|
955360
|
-
projectId: this.projectId,
|
|
955361
|
-
state: state4
|
|
955362
|
-
});
|
|
955363
|
-
this.openPanel();
|
|
955364
|
-
return {
|
|
955365
|
-
systemMessage: this.buildSystemMessage(state4, evaluation),
|
|
955366
|
-
state: state4,
|
|
955367
|
-
evaluation,
|
|
955368
|
-
handledLocally: true,
|
|
955369
|
-
statusMessage: this.buildStatusMessage(state4, evaluation)
|
|
955370
|
-
};
|
|
955371
|
-
}
|
|
955372
|
-
buildStateDraft(existing, prompt, options) {
|
|
955373
|
-
const now5 = this.now();
|
|
955374
|
-
const openQuestions = [...existing?.openQuestions ?? []];
|
|
955375
|
-
const answeredQuestions = [...existing?.answeredQuestions ?? []];
|
|
955376
|
-
if (options.answeredQuestion) {
|
|
955377
|
-
const idx = openQuestions.findIndex((question) => question.id === options.answeredQuestion?.id);
|
|
955378
|
-
if (idx >= 0)
|
|
955379
|
-
openQuestions.splice(idx, 1);
|
|
955380
|
-
if (!answeredQuestions.some((question) => question.id === options.answeredQuestion?.id && question.answer === prompt)) {
|
|
955381
|
-
answeredQuestions.push({
|
|
955382
|
-
...options.answeredQuestion,
|
|
955383
|
-
status: "answered",
|
|
955384
|
-
answer: prompt,
|
|
955385
|
-
answeredAt: now5
|
|
955386
|
-
});
|
|
955387
|
-
}
|
|
955388
|
-
}
|
|
955389
|
-
const knownContext = new Set(existing?.knownContext ?? []);
|
|
955390
|
-
knownContext.add(`Workspace: ${this.workingDirectory}`);
|
|
955391
|
-
if (options.startsPlanning && existing?.goal && prompt !== existing.goal) {
|
|
955392
|
-
knownContext.add(`Latest planning request: ${prompt}`);
|
|
955393
|
-
}
|
|
955394
|
-
const draft = {
|
|
955395
|
-
...existing ?? {},
|
|
955396
|
-
projectId: this.projectId,
|
|
955397
|
-
goal: existing?.goal?.trim() ? existing.goal : prompt,
|
|
955398
|
-
knownContext: [...knownContext],
|
|
955399
|
-
openQuestions,
|
|
955400
|
-
answeredQuestions,
|
|
955401
|
-
executionApproved: existing?.executionApproved === true || options.approved,
|
|
955402
|
-
metadata: {
|
|
955403
|
-
...existing?.metadata ?? {},
|
|
955404
|
-
active: true,
|
|
955405
|
-
owner: "agent",
|
|
955406
|
-
source: "conversation",
|
|
955407
|
-
lastPromptAt: now5
|
|
955408
|
-
}
|
|
955409
|
-
};
|
|
955410
|
-
return this.applyPlanningAnswer(draft, prompt, options.answeredQuestion, {
|
|
955411
|
-
startsPlanning: options.startsPlanning,
|
|
955412
|
-
approved: options.approved
|
|
955413
|
-
});
|
|
955414
|
-
}
|
|
955415
|
-
applyPlanningAnswer(state4, prompt, question, options) {
|
|
955416
|
-
if (!question)
|
|
955417
|
-
return state4;
|
|
955418
|
-
const acceptDefault = this.acceptsDefault(prompt);
|
|
955419
|
-
const questionId = question.id.toLowerCase();
|
|
955420
|
-
const questionText = question.prompt.toLowerCase();
|
|
955421
|
-
const existingGoal = (state4.goal ?? prompt).trim();
|
|
955422
|
-
const generic = acceptDefault || this.isGenericPlanningRecommendation(prompt);
|
|
955423
|
-
let next = { ...state4 };
|
|
955424
|
-
if (questionId.includes("scope") || questionText.includes("scope") || questionText.includes("in or out")) {
|
|
955425
|
-
next = {
|
|
955426
|
-
...next,
|
|
955427
|
-
scope: generic ? this.defaultScope(existingGoal) : this.normalizeScopeAnswer(existingGoal, prompt)
|
|
955428
|
-
};
|
|
955429
|
-
}
|
|
955430
|
-
if (questionId.includes("task") || questionText.includes("task") || questionId.includes("dependency") || questionText.includes("dependency") || questionId.includes("verification") || questionText.includes("verification") || acceptDefault && this.hasStructuralPlanningGaps(next)) {
|
|
955431
|
-
next = this.withDefaultExecutionPlan(next, existingGoal);
|
|
955432
|
-
if (!generic && !questionId.includes("scope")) {
|
|
955433
|
-
next = this.addKnownContext(next, `Planning answer: ${prompt}`);
|
|
955434
|
-
}
|
|
955435
|
-
}
|
|
955436
|
-
if (questionId.includes("approve") || questionText.includes("approve") || questionText.includes("execution")) {
|
|
955437
|
-
next = {
|
|
955438
|
-
...next,
|
|
955439
|
-
executionApproved: true,
|
|
955440
|
-
metadata: {
|
|
955441
|
-
...next.metadata ?? {},
|
|
955442
|
-
approvedAt: this.now(),
|
|
955443
|
-
approvedFrom: "planning-answer"
|
|
955444
|
-
}
|
|
955445
|
-
};
|
|
955446
|
-
}
|
|
955447
|
-
if (acceptDefault && this.isGoAhead(prompt)) {
|
|
955448
|
-
next = this.withDefaultExecutionPlan({
|
|
955449
|
-
...next,
|
|
955450
|
-
scope: next.scope ?? this.defaultScope(existingGoal),
|
|
955451
|
-
executionApproved: true,
|
|
955452
|
-
metadata: {
|
|
955453
|
-
...next.metadata ?? {},
|
|
955454
|
-
approvedAt: this.now(),
|
|
955455
|
-
approvedFrom: "planning-go-ahead"
|
|
955456
|
-
}
|
|
955457
|
-
}, existingGoal);
|
|
955458
|
-
}
|
|
955459
|
-
return next;
|
|
955460
|
-
}
|
|
955461
|
-
normalizeScopeAnswer(goal, answer) {
|
|
955462
|
-
const trimmed2 = answer.trim();
|
|
955463
|
-
if (!trimmed2)
|
|
955464
|
-
return this.defaultScope(goal);
|
|
955465
|
-
if (/^scope\s+is\b/i.test(trimmed2))
|
|
955466
|
-
return trimmed2;
|
|
955467
|
-
return `Scope for "${goal}": ${trimmed2}`;
|
|
955468
|
-
}
|
|
955469
|
-
defaultScope(goal) {
|
|
955470
|
-
const cleanGoal = goal.trim() || "the requested change";
|
|
955471
|
-
return [
|
|
955472
|
-
`First pass: make "${cleanGoal}" work end-to-end for the primary local TUI workflow.`,
|
|
955473
|
-
"Include the minimum TUI, connected-host wiring, configuration persistence, documentation, and verification required for the feature to actually work.",
|
|
955474
|
-
"Exclude unrelated cleanup, broad refactors, polish-only changes, third-party integrations, and advanced distributed behavior unless they directly block the primary workflow."
|
|
955475
|
-
].join(" ");
|
|
955476
|
-
}
|
|
955477
|
-
withDefaultExecutionPlan(state4, goal) {
|
|
955478
|
-
const tasks3 = state4.tasks && state4.tasks.length > 0 ? [...state4.tasks] : this.defaultTasks(goal);
|
|
955479
|
-
const verificationGates = state4.verificationGates && state4.verificationGates.length > 0 ? [...state4.verificationGates] : this.defaultVerificationGates(goal);
|
|
955480
|
-
const dependencies = state4.dependencies && state4.dependencies.length > 0 ? [...state4.dependencies] : this.defaultDependencies();
|
|
955481
|
-
const agentAssignments = state4.agentAssignments && state4.agentAssignments.length > 0 ? [...state4.agentAssignments] : this.defaultAgentAssignments();
|
|
955482
|
-
return {
|
|
955483
|
-
...state4,
|
|
955484
|
-
scope: state4.scope ?? this.defaultScope(goal),
|
|
955485
|
-
tasks: tasks3,
|
|
955486
|
-
verificationGates,
|
|
955487
|
-
dependencies,
|
|
955488
|
-
agentAssignments
|
|
955489
|
-
};
|
|
955490
|
-
}
|
|
955491
|
-
defaultTasks(goal) {
|
|
955492
|
-
const cleanGoal = goal.trim() || "requested change";
|
|
955493
|
-
return [
|
|
955494
|
-
{
|
|
955495
|
-
id: "inspect-current-flow",
|
|
955496
|
-
title: `Inspect the current paths for ${cleanGoal}`,
|
|
955497
|
-
why: "Planning must start from the actual code and runtime behavior, not assumptions.",
|
|
955498
|
-
status: "pending",
|
|
955499
|
-
verification: ["Identify the relevant files, commands, config keys, and runtime path before editing."],
|
|
955500
|
-
canRunConcurrently: false,
|
|
955501
|
-
needsReview: false,
|
|
955502
|
-
recommendedAgent: "explorer"
|
|
955503
|
-
},
|
|
955504
|
-
{
|
|
955505
|
-
id: "implement-core-behavior",
|
|
955506
|
-
title: `Implement the core ${cleanGoal} behavior`,
|
|
955507
|
-
why: "This is the minimum product behavior required for the requested outcome to work.",
|
|
955508
|
-
status: "pending",
|
|
955509
|
-
dependencies: ["inspect-current-flow"],
|
|
955510
|
-
verification: ["Focused tests cover the changed behavior and fail without the implementation."],
|
|
955511
|
-
canRunConcurrently: false,
|
|
955512
|
-
needsReview: true,
|
|
955513
|
-
recommendedAgent: "worker"
|
|
955514
|
-
},
|
|
955515
|
-
{
|
|
955516
|
-
id: "wire-user-surface",
|
|
955517
|
-
title: `Wire the user-facing path for ${cleanGoal}`,
|
|
955518
|
-
why: "The feature must be reachable through the intended TUI/connected-host/config surface, not just internal code.",
|
|
955519
|
-
status: "pending",
|
|
955520
|
-
dependencies: ["implement-core-behavior"],
|
|
955521
|
-
verification: ["A command, panel, route, or setting path exercises the behavior from the user-facing entry point."],
|
|
955522
|
-
canRunConcurrently: false,
|
|
955523
|
-
needsReview: true,
|
|
955524
|
-
recommendedAgent: "worker"
|
|
955525
|
-
},
|
|
955526
|
-
{
|
|
955527
|
-
id: "verify-release-readiness",
|
|
955528
|
-
title: `Verify ${cleanGoal} end-to-end`,
|
|
955529
|
-
why: "The plan is not complete until the user-facing path and regression tests prove it works.",
|
|
955530
|
-
status: "pending",
|
|
955531
|
-
dependencies: ["implement-core-behavior", "wire-user-surface"],
|
|
955532
|
-
verification: ["Run focused tests plus the relevant type/build/smoke checks for the touched area."],
|
|
955533
|
-
canRunConcurrently: false,
|
|
955534
|
-
needsReview: false,
|
|
955535
|
-
recommendedAgent: "none"
|
|
955536
|
-
}
|
|
955537
|
-
];
|
|
955538
|
-
}
|
|
955539
|
-
defaultDependencies() {
|
|
955540
|
-
return [
|
|
955541
|
-
{ fromTaskId: "inspect-current-flow", toTaskId: "implement-core-behavior", reason: "Implementation depends on knowing the current code path." },
|
|
955542
|
-
{ fromTaskId: "implement-core-behavior", toTaskId: "wire-user-surface", reason: "The user-facing surface should call the implemented behavior." },
|
|
955543
|
-
{ fromTaskId: "implement-core-behavior", toTaskId: "verify-release-readiness", reason: "Verification needs the implementation in place." },
|
|
955544
|
-
{ fromTaskId: "wire-user-surface", toTaskId: "verify-release-readiness", reason: "Verification must include the reachable user path." }
|
|
955545
|
-
];
|
|
955546
|
-
}
|
|
955547
|
-
defaultVerificationGates(goal) {
|
|
955548
|
-
const cleanGoal = goal.trim() || "requested change";
|
|
955549
|
-
return [
|
|
955550
|
-
{
|
|
955551
|
-
id: "focused-regression",
|
|
955552
|
-
description: `Focused regression coverage proves "${cleanGoal}" works and prevents the observed failure from returning.`,
|
|
955553
|
-
status: "pending",
|
|
955554
|
-
required: true
|
|
955555
|
-
},
|
|
955556
|
-
{
|
|
955557
|
-
id: "typecheck",
|
|
955558
|
-
description: "TypeScript/build validation passes for the touched code.",
|
|
955559
|
-
command: "bunx tsc --noEmit",
|
|
955560
|
-
status: "pending",
|
|
955561
|
-
required: true
|
|
955562
|
-
},
|
|
955563
|
-
{
|
|
955564
|
-
id: "runtime-smoke",
|
|
955565
|
-
description: "A user-facing runtime smoke exercises the changed path when feasible.",
|
|
955566
|
-
status: "pending",
|
|
955567
|
-
required: true
|
|
955568
|
-
}
|
|
955569
|
-
];
|
|
955570
|
-
}
|
|
955571
|
-
defaultAgentAssignments() {
|
|
955572
|
-
return [
|
|
955573
|
-
{
|
|
955574
|
-
taskId: "inspect-current-flow",
|
|
955575
|
-
agentType: "explorer",
|
|
955576
|
-
expectedOutput: "Concrete files, state transitions, and failure path that must change.",
|
|
955577
|
-
canRunConcurrently: false
|
|
955578
|
-
},
|
|
955579
|
-
{
|
|
955580
|
-
taskId: "implement-core-behavior",
|
|
955581
|
-
agentType: "worker",
|
|
955582
|
-
expectedOutput: "Patch implementing the core behavior with focused tests.",
|
|
955583
|
-
verification: "Review the patch against the original request and regression test.",
|
|
955584
|
-
canRunConcurrently: false
|
|
955585
|
-
},
|
|
955586
|
-
{
|
|
955587
|
-
taskId: "wire-user-surface",
|
|
955588
|
-
agentType: "worker",
|
|
955589
|
-
expectedOutput: "Patch wiring the behavior through the intended user-facing surface.",
|
|
955590
|
-
verification: "Verify the UI/command/route actually exercises the new behavior.",
|
|
955591
|
-
canRunConcurrently: false
|
|
955592
|
-
}
|
|
955593
|
-
];
|
|
955594
|
-
}
|
|
955595
|
-
addKnownContext(state4, entry) {
|
|
955596
|
-
const knownContext = new Set(state4.knownContext ?? []);
|
|
955597
|
-
knownContext.add(entry);
|
|
955598
|
-
return { ...state4, knownContext: [...knownContext] };
|
|
955599
|
-
}
|
|
955600
|
-
hasStructuralPlanningGaps(state4) {
|
|
955601
|
-
return !state4.scope || (state4.tasks?.length ?? 0) === 0 || (state4.verificationGates?.length ?? 0) === 0;
|
|
955602
|
-
}
|
|
955603
|
-
recordNextQuestion(state4, question) {
|
|
955604
|
-
if (!question)
|
|
955605
|
-
return state4;
|
|
955606
|
-
const answered = new Set((state4.answeredQuestions ?? []).map((entry) => entry.id));
|
|
955607
|
-
if (answered.has(question.id))
|
|
955608
|
-
return state4;
|
|
955609
|
-
const openQuestions = [...state4.openQuestions ?? []];
|
|
955610
|
-
const existingIndex = openQuestions.findIndex((entry) => entry.id === question.id);
|
|
955611
|
-
const normalized3 = { ...question, status: question.status ?? "open" };
|
|
955612
|
-
if (existingIndex >= 0)
|
|
955613
|
-
openQuestions[existingIndex] = normalized3;
|
|
955614
|
-
else
|
|
955615
|
-
openQuestions.unshift(normalized3);
|
|
955616
|
-
return {
|
|
955617
|
-
...state4,
|
|
955618
|
-
openQuestions
|
|
955619
|
-
};
|
|
955620
|
-
}
|
|
955621
|
-
buildSystemMessage(state4, evaluation) {
|
|
955622
|
-
const nextQuestion = evaluation.nextQuestion;
|
|
955623
|
-
const gaps = evaluation.gaps.slice(0, 8).map((gap) => `- ${gap.severity}: ${gap.kind} - ${gap.message}`).join(`
|
|
955624
|
-
`) || "- none";
|
|
955625
|
-
const tasks3 = state4.tasks.map((task) => `- ${task.id}: ${task.title}`).join(`
|
|
955626
|
-
`) || "- none recorded yet";
|
|
955627
|
-
const recentAnswers = state4.answeredQuestions.slice(-3).map((question) => `- ${question.prompt}
|
|
955628
|
-
Answer: ${question.answer ?? "(no answer recorded)"}`).join(`
|
|
955629
|
-
`) || "- none recorded yet";
|
|
955630
|
-
return [
|
|
955631
|
-
"Agent-owned planning loop is active for this turn.",
|
|
955632
|
-
"Do not execute code changes, create separate Agent jobs, or claim implementation is complete unless the user explicitly approves execution after the plan is structurally ready.",
|
|
955633
|
-
"Be relentless and thorough: challenge vague wording, inspect relevant context before proposing execution, and ask exactly one focused question when information is missing.",
|
|
955634
|
-
'Do not ask broad questions like "what is in scope?" without examples. Break broad planning gaps into concrete choices, explain tradeoffs, and recommend a default the user can accept or correct.',
|
|
955635
|
-
"",
|
|
955636
|
-
`Project id: ${this.projectId}`,
|
|
955637
|
-
`Planning namespace: ${state4.knowledgeSpaceId}`,
|
|
955638
|
-
`Readiness: ${evaluation.readiness}`,
|
|
955639
|
-
`Execution approved: ${state4.executionApproved ? "yes" : "no"}`,
|
|
955640
|
-
`Goal: ${state4.goal || "(missing)"}`,
|
|
955641
|
-
state4.scope ? `Scope: ${state4.scope}` : "Scope: (missing)",
|
|
955642
|
-
"",
|
|
955643
|
-
"Readiness gaps:",
|
|
955644
|
-
gaps,
|
|
955645
|
-
"",
|
|
955646
|
-
"Recent answered planning questions:",
|
|
955647
|
-
recentAnswers,
|
|
955648
|
-
"",
|
|
955649
|
-
"Recorded tasks:",
|
|
955650
|
-
tasks3,
|
|
955651
|
-
"",
|
|
955652
|
-
nextQuestion ? `Resolve this next planning gap. If this wording is broad, turn it into a smaller concrete multiple-choice question before asking: ${nextQuestion.prompt}` : "If the plan is structurally ready, summarize the plan and ask for explicit execution approval. Do not start execution yourself."
|
|
955653
|
-
].join(`
|
|
955654
|
-
`);
|
|
955655
|
-
}
|
|
955656
|
-
buildStatusMessage(state4, evaluation) {
|
|
955657
|
-
const nextQuestion = evaluation.nextQuestion?.prompt;
|
|
955658
|
-
const taskCount = state4.tasks.length;
|
|
955659
|
-
const gateCount = state4.verificationGates.length;
|
|
955660
|
-
const approved = state4.executionApproved ? "approved" : "not approved";
|
|
955661
|
-
if (evaluation.readiness === "executable") {
|
|
955662
|
-
return `[Planning] Updated plan: ${taskCount} task(s), ${gateCount} verification gate(s), execution ${approved}.`;
|
|
955663
|
-
}
|
|
955664
|
-
return `[Planning] Updated plan: ${taskCount} task(s), ${gateCount} verification gate(s). Next: ${nextQuestion ?? "review the plan."}`;
|
|
955665
|
-
}
|
|
955666
|
-
isActive(state4) {
|
|
955667
|
-
return state4?.metadata?.["active"] === true && state4.executionApproved !== true;
|
|
955668
|
-
}
|
|
955669
|
-
firstOpenQuestion(state4) {
|
|
955670
|
-
return state4?.openQuestions.find((question) => (question.status ?? "open") === "open") ?? null;
|
|
955671
|
-
}
|
|
955672
|
-
isCancel(text) {
|
|
955673
|
-
return CANCEL_PATTERNS.some((pattern) => pattern.test(text));
|
|
955674
|
-
}
|
|
955675
|
-
isApproval(text) {
|
|
955676
|
-
return APPROVAL_PATTERNS.some((pattern) => pattern.test(text));
|
|
955677
|
-
}
|
|
955678
|
-
acceptsDefault(text) {
|
|
955679
|
-
const trimmed2 = text.trim();
|
|
955680
|
-
return ACCEPT_DEFAULT_PATTERNS.some((pattern) => pattern.test(trimmed2));
|
|
955681
|
-
}
|
|
955682
|
-
isGoAhead(text) {
|
|
955683
|
-
return /\b(go|go ahead|let'?s go|execute|start|approved?|approval granted)\b/i.test(text.trim());
|
|
955684
|
-
}
|
|
955685
|
-
isGenericPlanningRecommendation(text) {
|
|
955686
|
-
return GENERIC_RECOMMENDATION_PATTERNS.some((pattern) => pattern.test(text));
|
|
955687
|
-
}
|
|
955688
|
-
}
|
|
955689
|
-
|
|
955690
953566
|
// src/input/command-args-hint.ts
|
|
955691
953567
|
var SUBCOMMAND_HINTS = {
|
|
955692
953568
|
session: { rename: "<name>", resume: "<id|name>", info: "<id>", export: "<id> [format]", search: "<query>", delete: "<id>" },
|
|
@@ -955923,20 +953799,6 @@ async function main() {
|
|
|
955923
953799
|
render();
|
|
955924
953800
|
}
|
|
955925
953801
|
}));
|
|
955926
|
-
const projectPlanningCoordinator = new ProjectPlanningCoordinator({
|
|
955927
|
-
service: ctx.services.projectPlanningService,
|
|
955928
|
-
projectId: ctx.services.projectPlanningProjectId,
|
|
955929
|
-
workingDirectory: workingDir,
|
|
955930
|
-
notify: (message) => {
|
|
955931
|
-
systemMessageRouter.high(message);
|
|
955932
|
-
render();
|
|
955933
|
-
},
|
|
955934
|
-
openPanel: () => {
|
|
955935
|
-
panelManager2.open("project-planning");
|
|
955936
|
-
panelManager2.show();
|
|
955937
|
-
render();
|
|
955938
|
-
}
|
|
955939
|
-
});
|
|
955940
953802
|
const submitInput = (text, content, options = {}) => {
|
|
955941
953803
|
input.clearModalStack();
|
|
955942
953804
|
scrollLocked = true;
|
|
@@ -955971,33 +953833,7 @@ async function main() {
|
|
|
955971
953833
|
}
|
|
955972
953834
|
if (processedText || content) {
|
|
955973
953835
|
(async () => {
|
|
955974
|
-
|
|
955975
|
-
if (!options.spokenOutput && processedText) {
|
|
955976
|
-
try {
|
|
955977
|
-
const planning = await projectPlanningCoordinator.prepareTurn(processedText);
|
|
955978
|
-
if (planning) {
|
|
955979
|
-
if (planning.handledLocally) {
|
|
955980
|
-
systemMessageRouter.high(planning.statusMessage);
|
|
955981
|
-
render();
|
|
955982
|
-
return;
|
|
955983
|
-
}
|
|
955984
|
-
conversation.addSystemMessage(planning.systemMessage);
|
|
955985
|
-
inputOptions = {
|
|
955986
|
-
origin: {
|
|
955987
|
-
source: "project-planning",
|
|
955988
|
-
surface: GOODVIBES_AGENT_PAIRING_SURFACE,
|
|
955989
|
-
metadata: {
|
|
955990
|
-
projectId: ctx.services.projectPlanningProjectId,
|
|
955991
|
-
knowledgeSpaceId: planning.state.knowledgeSpaceId,
|
|
955992
|
-
readiness: planning.evaluation.readiness
|
|
955993
|
-
}
|
|
955994
|
-
}
|
|
955995
|
-
};
|
|
955996
|
-
}
|
|
955997
|
-
} catch (err2) {
|
|
955998
|
-
systemMessageRouter.high(`[Planning] ${summarizeError(err2)}`);
|
|
955999
|
-
}
|
|
956000
|
-
}
|
|
953836
|
+
const inputOptions = options.spokenOutput ? createSpokenTurnInputOptions() : undefined;
|
|
956001
953837
|
if (options.spokenOutput && processedText) {
|
|
956002
953838
|
spokenTurns.submitNextTurn(processedText);
|
|
956003
953839
|
}
|
|
@@ -956027,11 +953863,11 @@ async function main() {
|
|
|
956027
953863
|
scrollTop = Math.max(0, block2.startLine);
|
|
956028
953864
|
render();
|
|
956029
953865
|
};
|
|
956030
|
-
const scrollToLine = (
|
|
953866
|
+
const scrollToLine = (line) => {
|
|
956031
953867
|
conversation.getDisplayBlocks();
|
|
956032
953868
|
const maxScroll = Math.max(0, conversation.history.getLineCount() - getViewportHeight());
|
|
956033
953869
|
scrollLocked = false;
|
|
956034
|
-
scrollTop = Math.max(0, Math.min(
|
|
953870
|
+
scrollTop = Math.max(0, Math.min(line, maxScroll));
|
|
956035
953871
|
render();
|
|
956036
953872
|
};
|
|
956037
953873
|
commandContext.submitInput = submitInput;
|
|
@@ -956149,7 +953985,7 @@ async function main() {
|
|
|
956149
953985
|
promptText: promptInfo.visibleLines.join(`
|
|
956150
953986
|
`),
|
|
956151
953987
|
promptLineCount: promptInfo.visibleLines.length,
|
|
956152
|
-
promptCursorPos: promptInfo.visibleCursorLine >= 0 ? promptInfo.visibleLines.slice(0, promptInfo.visibleCursorLine).reduce((sum,
|
|
953988
|
+
promptCursorPos: promptInfo.visibleCursorLine >= 0 ? promptInfo.visibleLines.slice(0, promptInfo.visibleCursorLine).reduce((sum, line) => sum + line.length + 1, 0) + promptInfo.visibleCursorCol : undefined,
|
|
956153
953989
|
usage: { up: orchestrator.usage.input, down: orchestrator.usage.output },
|
|
956154
953990
|
showExitNotice: input.showExitNotice,
|
|
956155
953991
|
lastCopyTime: input.lastCopyTime,
|
|
@@ -956354,8 +954190,8 @@ async function main() {
|
|
|
956354
954190
|
const recoveryInfo = checkRecoveryFile2({ workingDirectory: workingDir, homeDirectory: homeDirectory2 });
|
|
956355
954191
|
if (recoveryInfo) {
|
|
956356
954192
|
systemMessageRouter.high(`[Recovery] Found unsaved session from ${new Date(recoveryInfo.timestamp).toLocaleString()}. Title: "${recoveryInfo.title}". Press Ctrl+R to restore, Esc to discard, or start typing to ignore it.`);
|
|
956357
|
-
for (const
|
|
956358
|
-
systemMessageRouter.low(`[Recovery] ${
|
|
954193
|
+
for (const line of formatReturnContextForDisplay2(recoveryInfo.returnContext)) {
|
|
954194
|
+
systemMessageRouter.low(`[Recovery] ${line}`);
|
|
956359
954195
|
}
|
|
956360
954196
|
render();
|
|
956361
954197
|
recoveryPending = true;
|