perchai-cli 2.4.38 → 2.4.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/perch.mjs +272 -19
- package/package.json +1 -1
package/dist/perch.mjs
CHANGED
|
@@ -75566,7 +75566,6 @@ var init_payroll = __esm({
|
|
|
75566
75566
|
// lib/perchBusinessTools/index.ts
|
|
75567
75567
|
var init_perchBusinessTools = __esm({
|
|
75568
75568
|
"lib/perchBusinessTools/index.ts"() {
|
|
75569
|
-
"use strict";
|
|
75570
75569
|
init_generateAPAuditPacket();
|
|
75571
75570
|
init_inventoryFolder();
|
|
75572
75571
|
init_loadBusinessTables();
|
|
@@ -76219,7 +76218,6 @@ function getToolDisplayName(toolName) {
|
|
|
76219
76218
|
var NON_MODULE_TOOL_OWNERS, TOOL_RISK, TOOL_DISPLAY_NAMES;
|
|
76220
76219
|
var init_catalog = __esm({
|
|
76221
76220
|
"features/perchTerminal/runtime/toolSystem/catalog.ts"() {
|
|
76222
|
-
"use strict";
|
|
76223
76221
|
init_toolNames();
|
|
76224
76222
|
NON_MODULE_TOOL_OWNERS = {
|
|
76225
76223
|
[TOOL_NAMES.listSources]: "lane",
|
|
@@ -92810,6 +92808,40 @@ var init_agentSkillRegistry = __esm({
|
|
|
92810
92808
|
"visionInspect"
|
|
92811
92809
|
]
|
|
92812
92810
|
},
|
|
92811
|
+
{
|
|
92812
|
+
"id": "github",
|
|
92813
|
+
"name": "github",
|
|
92814
|
+
"description": "Inspect GitHub and git repository state, review commits and pull requests, debug checks, and publish local changes with clear permission boundaries.",
|
|
92815
|
+
"path": "features/perchTerminal/agentPlatform/skills/github/SKILL.md",
|
|
92816
|
+
"body": "\n# github\n\nUse this skill when the user asks Perch to inspect git state, review commits, prepare a commit, push a branch, understand GitHub checks, triage a pull request, or coordinate repo release work.\n\n## Operating Rules\n\n- Start with repository state before changing anything: current branch, status, recent commits, and relevant diff.\n- Protect unrelated work. Do not stage, discard, rewrite, or overwrite changes that are not part of the requested task.\n- For reviews, lead with concrete risks tied to file paths, diffs, commits, checks, or PR comments.\n- For commits, stage intentionally and write a concise message that matches the actual diff. Commit and push only when the user explicitly asks or has already authorized that action.\n- For CI or deployment checks, pair this with `wait-operator`: poll bounded status, read failing logs when available, and report final state rather than guessing.\n- For PR work, prefer existing authenticated GitHub routes or local `gh` when available; otherwise use git history, diff, and visible URLs as evidence.\n- Keep product language clean. Say GitHub, git, branch, commit, push, PR, checks, and deploy; avoid internal runtime labels unless debugging requires them.\n\n## Verification\n\nBefore finishing, report the branch, files changed, commit SHA when created, push target when pushed, PR/check/deploy URL when available, and any uncommitted files intentionally left alone.",
|
|
92817
|
+
"surface": {
|
|
92818
|
+
"gui": "supported",
|
|
92819
|
+
"cli": "supported"
|
|
92820
|
+
},
|
|
92821
|
+
"triggerHints": [
|
|
92822
|
+
"github",
|
|
92823
|
+
"git status",
|
|
92824
|
+
"git diff",
|
|
92825
|
+
"commit changes",
|
|
92826
|
+
"push branch",
|
|
92827
|
+
"pull request",
|
|
92828
|
+
"review commits",
|
|
92829
|
+
"github checks",
|
|
92830
|
+
"ci failure",
|
|
92831
|
+
"release branch"
|
|
92832
|
+
],
|
|
92833
|
+
"companionSkills": [
|
|
92834
|
+
"workspace",
|
|
92835
|
+
"wait-operator"
|
|
92836
|
+
],
|
|
92837
|
+
"preferredTools": [
|
|
92838
|
+
"bash",
|
|
92839
|
+
"runBashTerminalCommand",
|
|
92840
|
+
"grep",
|
|
92841
|
+
"readLocalFile",
|
|
92842
|
+
"writeLocalFile"
|
|
92843
|
+
]
|
|
92844
|
+
},
|
|
92813
92845
|
{
|
|
92814
92846
|
"id": "pdf",
|
|
92815
92847
|
"name": "pdf",
|
|
@@ -92999,6 +93031,41 @@ var init_agentSkillRegistry = __esm({
|
|
|
92999
93031
|
"readLocalFile"
|
|
93000
93032
|
]
|
|
93001
93033
|
},
|
|
93034
|
+
{
|
|
93035
|
+
"id": "wait-operator",
|
|
93036
|
+
"name": "wait-operator",
|
|
93037
|
+
"description": "Watch bounded external or local conditions, poll deployment and job status, wait through short-running tasks, and resume with verified state instead of guessing.",
|
|
93038
|
+
"path": "features/perchTerminal/agentPlatform/skills/wait-operator/SKILL.md",
|
|
93039
|
+
"body": "\n# wait-operator\n\nUse this skill when the user asks Perch to wait, watch, poll, monitor, check back, or keep an eye on a deployment, CI run, background job, file creation, local server, browser page, or other condition.\n\n## Operating Rules\n\n- Treat waiting as an active bounded loop: define the condition, timeout, interval, and failure states before polling.\n- Never sleep indefinitely. Use short intervals and a clear maximum wait unless the user explicitly asks for a longer watch.\n- Prefer read-only checks: status commands, existing logs, HTTP status endpoints, browser observe/wait, or file existence checks.\n- For deployments and CI, distinguish pending, ready/success, failed, canceled, timed out, and unknown. Do not call a run ready from elapsed time alone.\n- Report the last observed state if the wait times out or credentials/session state blocks verification.\n- Avoid noisy transcript spam. Group repeated polling into a short progress summary unless the user asks to see every check.\n- If the user asks for a real follow-up after this turn rather than an in-turn wait, create or suggest the appropriate automation instead of pretending the current turn can run forever.\n\n## Verification\n\nFinish only after the watched condition is directly verified or a blocker is named. Include the evidence source: command status, page state, URL, log line, file path, or timestamped last check.",
|
|
93040
|
+
"surface": {
|
|
93041
|
+
"gui": "supported",
|
|
93042
|
+
"cli": "supported"
|
|
93043
|
+
},
|
|
93044
|
+
"triggerHints": [
|
|
93045
|
+
"wait for deploy",
|
|
93046
|
+
"watch deployment",
|
|
93047
|
+
"poll status",
|
|
93048
|
+
"check until ready",
|
|
93049
|
+
"wait until done",
|
|
93050
|
+
"keep checking",
|
|
93051
|
+
"monitor progress",
|
|
93052
|
+
"long running task",
|
|
93053
|
+
"deployment status",
|
|
93054
|
+
"wake when done"
|
|
93055
|
+
],
|
|
93056
|
+
"companionSkills": [
|
|
93057
|
+
"github",
|
|
93058
|
+
"workspace",
|
|
93059
|
+
"browser-operator"
|
|
93060
|
+
],
|
|
93061
|
+
"preferredTools": [
|
|
93062
|
+
"bash",
|
|
93063
|
+
"runBashTerminalCommand",
|
|
93064
|
+
"webFetch",
|
|
93065
|
+
"browser_observe",
|
|
93066
|
+
"browser_wait"
|
|
93067
|
+
]
|
|
93068
|
+
},
|
|
93002
93069
|
{
|
|
93003
93070
|
"id": "workspace",
|
|
93004
93071
|
"name": "workspace",
|
|
@@ -93132,6 +93199,14 @@ function selectAgentSkills(input) {
|
|
|
93132
93199
|
if (/\b(ap|accounts?\s+payable)\b/i.test(text)) {
|
|
93133
93200
|
explicit.add("data-quality");
|
|
93134
93201
|
}
|
|
93202
|
+
if (/\b(vercel|deploy(?:ment)?|github\s+actions?|ci|checks?)\b/i.test(text)) {
|
|
93203
|
+
if (/\b(wait|watch|poll|monitor|keep\s+checking|check\s+until|status)\b/i.test(text)) {
|
|
93204
|
+
explicit.add("wait-operator");
|
|
93205
|
+
}
|
|
93206
|
+
}
|
|
93207
|
+
if (/\b(github|git\b|pull\s+request|pr\b|commit|push|branch|ci|checks?)\b/i.test(text)) {
|
|
93208
|
+
explicit.add("github");
|
|
93209
|
+
}
|
|
93135
93210
|
if (isMarketDeskSignalTask(text, availableToolNames)) {
|
|
93136
93211
|
explicit.delete("research");
|
|
93137
93212
|
omitted.push({
|
|
@@ -93186,6 +93261,8 @@ var init_skillSelector = __esm({
|
|
|
93186
93261
|
"browser_navigate"
|
|
93187
93262
|
]);
|
|
93188
93263
|
CORE_PRIORITY = [
|
|
93264
|
+
"wait-operator",
|
|
93265
|
+
"github",
|
|
93189
93266
|
"data-quality",
|
|
93190
93267
|
"presentations",
|
|
93191
93268
|
"spreadsheets",
|
|
@@ -93221,6 +93298,14 @@ var init_skillSelector = __esm({
|
|
|
93221
93298
|
/\b(research|credible\s+sources?|current\s+source|citations?|source\s+comparison|scholarly|public\s+web|fact[-\s]?check|latest|recent|filing)\b/i,
|
|
93222
93299
|
/\b(find|gather|compare|verify)\b.{0,48}\b(sources?|evidence|filings?)\b/i
|
|
93223
93300
|
],
|
|
93301
|
+
github: [
|
|
93302
|
+
/\b(github|git\s+(?:status|diff|log|show|commit|push|pull|branch)|commit\s+(?:these|changes|and\s+push)|push\s+(?:this|the|branch)|pull\s+request|pr\s+#?\d*|review\s+commits?|github\s+checks?|ci\s+(?:failure|checks?|run)|release\s+branch)\b/i,
|
|
93303
|
+
/\b(stage|commit|push)\b.{0,56}\b(changes?|branch|repo|github)\b/i
|
|
93304
|
+
],
|
|
93305
|
+
"wait-operator": [
|
|
93306
|
+
/\b(wait\s+(?:for|until)|watch\s+(?:the|this)?|poll\s+(?:status|until|for)|keep\s+checking|check\s+(?:until|back|again)|monitor\s+(?:progress|status|deploy)|long[-\s]?running\s+task|deployment\s+status|wake\s+when\s+done)\b/i,
|
|
93307
|
+
/\b(vercel|deploy(?:ment)?|github\s+actions?|ci|checks?|background\s+job|server|localhost)\b.{0,64}\b(ready|done|finish(?:ed)?|complete|succeed(?:ed)?|fail(?:ed)?|status)\b/i
|
|
93308
|
+
],
|
|
93224
93309
|
diagrams: [
|
|
93225
93310
|
/\b(diagram|mermaid|drawio|workflow\s+graph|org\s+chart|entity\s+network|control\s+graph|architecture\s+map|vendor[-\s]?risk\s+graph|nodes?\s+and\s+edges?)\b/i,
|
|
93226
93311
|
/\b(graph|map)\b.{0,32}\b(risk|workflow|architecture|network|relationship)\b/i
|
|
@@ -205518,13 +205603,13 @@ var init_spawnWorker = __esm({
|
|
|
205518
205603
|
if (workerId && customSpec && !resolveWorkerManifest(workerId)) {
|
|
205519
205604
|
workerId = "";
|
|
205520
205605
|
}
|
|
205521
|
-
let
|
|
205606
|
+
let displayTitle;
|
|
205522
205607
|
if (!workerId && customSpec) {
|
|
205523
205608
|
const { manifest, droppedTools } = buildAdhocWorkerManifest(customSpec);
|
|
205524
205609
|
registerWorkerManifest(manifest);
|
|
205525
205610
|
adhocManifestId = manifest.workerId;
|
|
205526
205611
|
adhocNickname = flockNicknameFor(manifest.workerId, 0);
|
|
205527
|
-
|
|
205612
|
+
displayTitle = `${manifest.name} \xB7 ${adhocNickname}`;
|
|
205528
205613
|
workerId = manifest.workerId;
|
|
205529
205614
|
if (droppedTools.length > 0 && ctx.onEvent) {
|
|
205530
205615
|
ctx.onEvent({
|
|
@@ -205543,6 +205628,14 @@ var init_spawnWorker = __esm({
|
|
|
205543
205628
|
errorCode: "worker_id_missing"
|
|
205544
205629
|
};
|
|
205545
205630
|
}
|
|
205631
|
+
if (!displayTitle) {
|
|
205632
|
+
const registeredManifest = resolveWorkerManifest(workerId);
|
|
205633
|
+
if (registeredManifest) {
|
|
205634
|
+
const runSeed = `${workerId}_${ctx.threadId ?? ""}_${Date.now().toString(36)}`;
|
|
205635
|
+
const nickname = flockNicknameFor(runSeed, 0);
|
|
205636
|
+
displayTitle = `${registeredManifest.name} \xB7 ${nickname}`;
|
|
205637
|
+
}
|
|
205638
|
+
}
|
|
205546
205639
|
const context = typeof args.context === "string" || typeof args.context === "object" && args.context !== null && !Array.isArray(args.context) ? args.context : void 0;
|
|
205547
205640
|
const lane = typeof args.lane === "string" ? args.lane : void 0;
|
|
205548
205641
|
const maxIterations = typeof args.maxIterations === "number" ? adhocManifestId ? Math.min(args.maxIterations, ADHOC_MAX_ITERATIONS) : args.maxIterations : void 0;
|
|
@@ -205579,7 +205672,7 @@ Proceed with the available context. If a missing fact is essential, ask the user
|
|
|
205579
205672
|
maxToolCalls: adhocManifestId ? ADHOC_MAX_TOOL_CALLS : void 0
|
|
205580
205673
|
},
|
|
205581
205674
|
{
|
|
205582
|
-
displayTitle
|
|
205675
|
+
displayTitle,
|
|
205583
205676
|
workspaceRoot: effectiveWorkspaceRoot(ctx),
|
|
205584
205677
|
desktopConnected: ctx.desktopConnected,
|
|
205585
205678
|
// CLI surface: children inherit the local bridge and server auth,
|
|
@@ -216983,6 +217076,53 @@ var init_toolExecutor = __esm({
|
|
|
216983
217076
|
}
|
|
216984
217077
|
});
|
|
216985
217078
|
|
|
217079
|
+
// features/perchTerminal/runtime/transcript/fileDiff.ts
|
|
217080
|
+
function lineDiff(oldText, newText) {
|
|
217081
|
+
const a = oldText.length ? oldText.split("\n") : [];
|
|
217082
|
+
const b2 = newText.length ? newText.split("\n") : [];
|
|
217083
|
+
const m = a.length;
|
|
217084
|
+
const n = b2.length;
|
|
217085
|
+
const dp = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
|
|
217086
|
+
for (let i2 = m - 1; i2 >= 0; i2--) {
|
|
217087
|
+
for (let j2 = n - 1; j2 >= 0; j2--) {
|
|
217088
|
+
dp[i2][j2] = a[i2] === b2[j2] ? dp[i2 + 1][j2 + 1] + 1 : Math.max(dp[i2 + 1][j2], dp[i2][j2 + 1]);
|
|
217089
|
+
}
|
|
217090
|
+
}
|
|
217091
|
+
const rows = [];
|
|
217092
|
+
let i = 0;
|
|
217093
|
+
let j = 0;
|
|
217094
|
+
while (i < m && j < n) {
|
|
217095
|
+
if (a[i] === b2[j]) {
|
|
217096
|
+
rows.push({ t: "ctx", text: a[i] });
|
|
217097
|
+
i++;
|
|
217098
|
+
j++;
|
|
217099
|
+
} else if (dp[i + 1][j] >= dp[i][j + 1]) {
|
|
217100
|
+
rows.push({ t: "del", text: a[i] });
|
|
217101
|
+
i++;
|
|
217102
|
+
} else {
|
|
217103
|
+
rows.push({ t: "add", text: b2[j] });
|
|
217104
|
+
j++;
|
|
217105
|
+
}
|
|
217106
|
+
}
|
|
217107
|
+
while (i < m) rows.push({ t: "del", text: a[i++] });
|
|
217108
|
+
while (j < n) rows.push({ t: "add", text: b2[j++] });
|
|
217109
|
+
return rows;
|
|
217110
|
+
}
|
|
217111
|
+
function lineDiffCounts(oldText, newText) {
|
|
217112
|
+
let added = 0;
|
|
217113
|
+
let removed = 0;
|
|
217114
|
+
for (const row of lineDiff(oldText, newText)) {
|
|
217115
|
+
if (row.t === "add") added++;
|
|
217116
|
+
else if (row.t === "del") removed++;
|
|
217117
|
+
}
|
|
217118
|
+
return { added, removed };
|
|
217119
|
+
}
|
|
217120
|
+
var init_fileDiff = __esm({
|
|
217121
|
+
"features/perchTerminal/runtime/transcript/fileDiff.ts"() {
|
|
217122
|
+
"use strict";
|
|
217123
|
+
}
|
|
217124
|
+
});
|
|
217125
|
+
|
|
216986
217126
|
// features/perchTerminal/runtime/toolLoop/autoRouterTurnPolicy.ts
|
|
216987
217127
|
function addAutoRouterAvoidFromProviderError(error, lane, avoid) {
|
|
216988
217128
|
const match = error.match(/^([a-z0-9_]+)\s+returned\b/i);
|
|
@@ -217900,13 +218040,18 @@ async function executeToolBatch(toolCalls, ctx) {
|
|
|
217900
218040
|
const filePath = typeof out?.relativePath === "string" ? out.relativePath : null;
|
|
217901
218041
|
if (filePath) {
|
|
217902
218042
|
const isWrite = toolCall.name === "writeLocalFile";
|
|
217903
|
-
const
|
|
218043
|
+
const args = toolCall.arguments ?? {};
|
|
218044
|
+
const overwrite = args.overwrite === true;
|
|
218045
|
+
const { added, removed } = isWrite ? lineDiffCounts("", typeof args.content === "string" ? args.content : "") : lineDiffCounts(
|
|
218046
|
+
typeof args.oldText === "string" ? args.oldText : "",
|
|
218047
|
+
typeof args.newText === "string" ? args.newText : ""
|
|
218048
|
+
);
|
|
217904
218049
|
ctx.onEvent({
|
|
217905
218050
|
type: "file_change_summary",
|
|
217906
218051
|
filePath,
|
|
217907
218052
|
changeKind: isWrite && !overwrite ? "created" : "modified",
|
|
217908
|
-
linesAdded:
|
|
217909
|
-
linesRemoved:
|
|
218053
|
+
linesAdded: added,
|
|
218054
|
+
linesRemoved: removed,
|
|
217910
218055
|
toolCallId: toolCall.id,
|
|
217911
218056
|
ts: now6()
|
|
217912
218057
|
});
|
|
@@ -218159,6 +218304,7 @@ var init_toolBatchExecutor = __esm({
|
|
|
218159
218304
|
"use strict";
|
|
218160
218305
|
init_modelRegistry();
|
|
218161
218306
|
init_toolExecutor();
|
|
218307
|
+
init_fileDiff();
|
|
218162
218308
|
init_toolNames();
|
|
218163
218309
|
init_localCommandPolicy();
|
|
218164
218310
|
init_toolArgHardening();
|
|
@@ -287194,6 +287340,8 @@ __export(perch_cli_exports, {
|
|
|
287194
287340
|
HELP_TEXT: () => HELP_TEXT,
|
|
287195
287341
|
INTERACTIVE_HELP_TEXT: () => INTERACTIVE_HELP_TEXT,
|
|
287196
287342
|
PERCH_SPLASH_COMMANDS: () => PERCH_SPLASH_COMMANDS,
|
|
287343
|
+
cliWorkerActivityVerb: () => cliWorkerActivityVerb,
|
|
287344
|
+
composeWorkerActivityRowText: () => composeWorkerActivityRowText,
|
|
287197
287345
|
flockEventToCliRow: () => flockEventToCliRow,
|
|
287198
287346
|
flockNicknameAccentColor: () => flockNicknameAccentColor,
|
|
287199
287347
|
parseInteractiveSlashCommand: () => parseInteractiveSlashCommand,
|
|
@@ -287252,6 +287400,19 @@ function workerEventToCliRow(event) {
|
|
|
287252
287400
|
return null;
|
|
287253
287401
|
}
|
|
287254
287402
|
}
|
|
287403
|
+
function composeWorkerActivityRowText(base, activity) {
|
|
287404
|
+
const parts = [base.displayName];
|
|
287405
|
+
if (base.nickname) parts.push(base.nickname);
|
|
287406
|
+
const callCount = activity && activity.calls > 0 ? `${activity.calls} ${activity.calls === 1 ? "call" : "calls"}` : null;
|
|
287407
|
+
if (!base.done && activity && activity.calls > 0) {
|
|
287408
|
+
parts.push(cliWorkerActivityVerb(activity.lastTool));
|
|
287409
|
+
if (callCount) parts.push(callCount);
|
|
287410
|
+
} else {
|
|
287411
|
+
parts.push(FLOCK_STATUS_LABELS[base.status] ?? base.status);
|
|
287412
|
+
if (base.done && callCount) parts.push(callCount);
|
|
287413
|
+
}
|
|
287414
|
+
return parts.join(" \xB7 ");
|
|
287415
|
+
}
|
|
287255
287416
|
async function runPerchCli(argv, writer = defaultWriter(), deps = {}) {
|
|
287256
287417
|
const parsed = parsePerchCli(argv);
|
|
287257
287418
|
if (!parsed.ok) {
|
|
@@ -287854,6 +288015,14 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
287854
288015
|
const toolNamesById = /* @__PURE__ */ new Map();
|
|
287855
288016
|
const flockWorkerNames = /* @__PURE__ */ new Map();
|
|
287856
288017
|
const workerTitles = /* @__PURE__ */ new Map();
|
|
288018
|
+
const workerRowState = /* @__PURE__ */ new Map();
|
|
288019
|
+
const workerActivity = /* @__PURE__ */ new Map();
|
|
288020
|
+
const renderWorkerActivityRow = (workerId) => {
|
|
288021
|
+
const base = workerRowState.get(workerId);
|
|
288022
|
+
if (!base) return;
|
|
288023
|
+
const text = composeWorkerActivityRowText(base, workerActivity.get(workerId));
|
|
288024
|
+
updateToolItem(base.rowId, { label: base.label, text, tone: base.tone });
|
|
288025
|
+
};
|
|
287857
288026
|
const flockLimitMeta = /* @__PURE__ */ new Map();
|
|
287858
288027
|
const aggregateToolIds = /* @__PURE__ */ new Map();
|
|
287859
288028
|
const aggregateToolMeta = /* @__PURE__ */ new Map();
|
|
@@ -287919,7 +288088,16 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
287919
288088
|
setWorkingText("recovering route");
|
|
287920
288089
|
break;
|
|
287921
288090
|
case "tool_call_started": {
|
|
287922
|
-
if (event.workerId)
|
|
288091
|
+
if (event.workerId) {
|
|
288092
|
+
const act = workerActivity.get(event.workerId) ?? { calls: 0, lastTool: event.toolName };
|
|
288093
|
+
act.calls += 1;
|
|
288094
|
+
act.lastTool = event.toolName;
|
|
288095
|
+
workerActivity.set(event.workerId, act);
|
|
288096
|
+
renderWorkerActivityRow(event.workerId);
|
|
288097
|
+
setWorkingText(cliWorkerActivityVerb(event.toolName));
|
|
288098
|
+
break;
|
|
288099
|
+
}
|
|
288100
|
+
if (event.toolName === "spawn_worker") break;
|
|
287923
288101
|
const toolId = event.toolCallId ?? `${event.toolName}-${Date.now()}`;
|
|
287924
288102
|
const name = humanizeCliToolName(event.toolName);
|
|
287925
288103
|
const aggregateKind = cliToolAggregateKind(event.toolName);
|
|
@@ -287958,6 +288136,7 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
287958
288136
|
}
|
|
287959
288137
|
case "tool_call_completed": {
|
|
287960
288138
|
if (event.workerId) break;
|
|
288139
|
+
if (event.toolName === "spawn_worker") break;
|
|
287961
288140
|
const toolId = event.toolCallId ?? `${event.toolName}-${Date.now()}`;
|
|
287962
288141
|
const stored = toolInputsById.current.get(toolId);
|
|
287963
288142
|
const aggregateKind = aggregateToolIds.get(toolId);
|
|
@@ -288004,6 +288183,7 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288004
288183
|
}
|
|
288005
288184
|
case "tool_call_failed": {
|
|
288006
288185
|
if (event.workerId) break;
|
|
288186
|
+
if (event.toolName === "spawn_worker") break;
|
|
288007
288187
|
const toolId = event.toolCallId ?? `${event.toolName}-${Date.now()}`;
|
|
288008
288188
|
const name = toolNamesById.get(toolId) ?? humanizeCliToolName(event.toolName);
|
|
288009
288189
|
const stored = toolInputsById.current.get(toolId);
|
|
@@ -288232,7 +288412,17 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288232
288412
|
const row = workerEventToCliRow(event);
|
|
288233
288413
|
if (!row) break;
|
|
288234
288414
|
if (row.id) {
|
|
288235
|
-
|
|
288415
|
+
const done = event.type === "worker_run_completed";
|
|
288416
|
+
const status = done ? event.ok ? event.usabilityStatus === "needs_user_input" ? "blocked" : "done" : "failed" : "running";
|
|
288417
|
+
workerRowState.set(event.workerId, {
|
|
288418
|
+
rowId: row.id,
|
|
288419
|
+
label: "worker",
|
|
288420
|
+
displayName: event.title,
|
|
288421
|
+
status,
|
|
288422
|
+
tone: row.tone,
|
|
288423
|
+
done
|
|
288424
|
+
});
|
|
288425
|
+
renderWorkerActivityRow(event.workerId);
|
|
288236
288426
|
} else {
|
|
288237
288427
|
addItem({ label: "worker", text: row.text, tone: row.tone });
|
|
288238
288428
|
}
|
|
@@ -288256,7 +288446,19 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288256
288446
|
}
|
|
288257
288447
|
const row = flockEventToCliRow(event);
|
|
288258
288448
|
if (!row) break;
|
|
288259
|
-
if (row.id) {
|
|
288449
|
+
if (event.type === "flock_worker_update" && row.id) {
|
|
288450
|
+
const done = !(event.status === "queued" || event.status === "waiting" || event.status === "running");
|
|
288451
|
+
workerRowState.set(event.workerId, {
|
|
288452
|
+
rowId: row.id,
|
|
288453
|
+
label: "flock",
|
|
288454
|
+
displayName: event.displayName,
|
|
288455
|
+
nickname: event.nickname,
|
|
288456
|
+
status: event.status,
|
|
288457
|
+
tone: row.tone,
|
|
288458
|
+
done
|
|
288459
|
+
});
|
|
288460
|
+
renderWorkerActivityRow(event.workerId);
|
|
288461
|
+
} else if (row.id) {
|
|
288260
288462
|
updateToolItem(row.id, { label: "flock", text: row.text, tone: row.tone });
|
|
288261
288463
|
} else {
|
|
288262
288464
|
addItem({ label: "flock", text: row.text, tone: row.tone });
|
|
@@ -288451,6 +288653,39 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288451
288653
|
)
|
|
288452
288654
|
);
|
|
288453
288655
|
};
|
|
288656
|
+
const renderWorkerRow = (key, line, tone, showLabel) => {
|
|
288657
|
+
const dotParts = line.split(" \xB7 ");
|
|
288658
|
+
if (dotParts.length >= 3 && WORKER_STATUS_WORDS.has(dotParts[dotParts.length - 1] ?? "")) {
|
|
288659
|
+
const status = dotParts[dotParts.length - 1];
|
|
288660
|
+
const nickname = dotParts[dotParts.length - 2] ?? "";
|
|
288661
|
+
const name = dotParts.slice(0, dotParts.length - 2).join(" \xB7 ");
|
|
288662
|
+
return React11.createElement(
|
|
288663
|
+
Ink2.Box,
|
|
288664
|
+
{ key },
|
|
288665
|
+
React11.createElement(
|
|
288666
|
+
Ink2.Box,
|
|
288667
|
+
{ width: INK_LABEL_WIDTH, flexShrink: 0 },
|
|
288668
|
+
React11.createElement(
|
|
288669
|
+
Ink2.Text,
|
|
288670
|
+
{ color: colorForInkTone(tone) },
|
|
288671
|
+
showLabel ? renderInkSpeakerLabel("worker") : ""
|
|
288672
|
+
)
|
|
288673
|
+
),
|
|
288674
|
+
React11.createElement(
|
|
288675
|
+
Ink2.Box,
|
|
288676
|
+
{ flexGrow: 1 },
|
|
288677
|
+
React11.createElement(
|
|
288678
|
+
Ink2.Text,
|
|
288679
|
+
null,
|
|
288680
|
+
React11.createElement(Ink2.Text, { color: bodyColorForInkTone(tone) }, `${name} \xB7 `),
|
|
288681
|
+
React11.createElement(Ink2.Text, { color: flockNicknameAccentColor(nickname), bold: true }, nickname),
|
|
288682
|
+
React11.createElement(Ink2.Text, { color: bodyColorForInkTone(tone) }, ` \xB7 ${status}`)
|
|
288683
|
+
)
|
|
288684
|
+
)
|
|
288685
|
+
);
|
|
288686
|
+
}
|
|
288687
|
+
return renderTranscriptRow(key, "worker", line, tone, showLabel);
|
|
288688
|
+
};
|
|
288454
288689
|
const renderTranscriptItem = (item, index) => {
|
|
288455
288690
|
const lines = item.text.split(/\r?\n/);
|
|
288456
288691
|
const previous = items[index - 1];
|
|
@@ -288464,7 +288699,7 @@ async function runInkInteractivePerchCli(writer, deps, options) {
|
|
|
288464
288699
|
React11.createElement(Ink2.Box, { width: INK_LABEL_WIDTH, flexShrink: 0 }),
|
|
288465
288700
|
React11.createElement(Ink2.Text, { color: CLI_BRAND.divider }, INK_DIVIDER)
|
|
288466
288701
|
) : null,
|
|
288467
|
-
lines.map((line, lineIndex) => item.label === "flock"
|
|
288702
|
+
lines.map((line, lineIndex) => item.label === "flock" ? renderFlockRow(`${item.id}-${lineIndex}`, line, item.tone, lineIndex === 0) : item.label === "worker" ? renderWorkerRow(`${item.id}-${lineIndex}`, line, item.tone, lineIndex === 0) : renderTranscriptRow(
|
|
288468
288703
|
`${item.id}-${lineIndex}`,
|
|
288469
288704
|
item.label,
|
|
288470
288705
|
line,
|
|
@@ -289284,7 +289519,7 @@ function colorForInkDetailTone(tone) {
|
|
|
289284
289519
|
case "add":
|
|
289285
289520
|
return CLI_BRAND.patinaActive;
|
|
289286
289521
|
case "remove":
|
|
289287
|
-
return CLI_BRAND.
|
|
289522
|
+
return CLI_BRAND.brick;
|
|
289288
289523
|
case "stderr":
|
|
289289
289524
|
return "#d06b55";
|
|
289290
289525
|
case "command":
|
|
@@ -289301,18 +289536,18 @@ function colorForCliSyntaxTone(tone, lineTone) {
|
|
|
289301
289536
|
if (lineTone === "remove") {
|
|
289302
289537
|
switch (tone) {
|
|
289303
289538
|
case "comment":
|
|
289304
|
-
return "#
|
|
289539
|
+
return "#9e6a5e";
|
|
289305
289540
|
case "string":
|
|
289306
|
-
return "#
|
|
289541
|
+
return "#d98a72";
|
|
289307
289542
|
case "keyword":
|
|
289308
289543
|
case "flag":
|
|
289309
|
-
return CLI_BRAND.
|
|
289544
|
+
return CLI_BRAND.brickGlint;
|
|
289310
289545
|
case "number":
|
|
289311
|
-
return "#
|
|
289546
|
+
return "#d2705a";
|
|
289312
289547
|
case "operator":
|
|
289313
|
-
return CLI_BRAND.
|
|
289548
|
+
return CLI_BRAND.brickDeep;
|
|
289314
289549
|
default:
|
|
289315
|
-
return CLI_BRAND.
|
|
289550
|
+
return CLI_BRAND.brick;
|
|
289316
289551
|
}
|
|
289317
289552
|
}
|
|
289318
289553
|
if (lineTone === "add") {
|
|
@@ -289519,6 +289754,19 @@ function cliToolAggregateKind(toolName) {
|
|
|
289519
289754
|
if (normalized === "glob" || normalized === "grep" || normalized === "listlocalsources" || normalized === "statpath" || normalized === "validateworkspaceroot") return "search";
|
|
289520
289755
|
return null;
|
|
289521
289756
|
}
|
|
289757
|
+
function cliWorkerActivityVerb(toolName) {
|
|
289758
|
+
const aggregate = cliToolAggregateKind(toolName);
|
|
289759
|
+
if (aggregate === "read") return "reading";
|
|
289760
|
+
if (aggregate === "search") return "searching";
|
|
289761
|
+
const n = toolName.toLowerCase();
|
|
289762
|
+
if (n.includes("write") && n.includes("file")) return "writing";
|
|
289763
|
+
if (n.includes("edit") && n.includes("file")) return "editing";
|
|
289764
|
+
if (n.includes("patch")) return "patching";
|
|
289765
|
+
if (n === "run_sandbox_code") return "running code";
|
|
289766
|
+
if (n.includes("bash") || n.includes("terminal") || n.includes("shell")) return "running";
|
|
289767
|
+
if (n === "spawn_worker" || n === "dispatch_agent") return "delegating";
|
|
289768
|
+
return "working";
|
|
289769
|
+
}
|
|
289522
289770
|
function getCliToolAggregateMeta(store, kind) {
|
|
289523
289771
|
const existing = store.get(kind);
|
|
289524
289772
|
if (existing) return existing;
|
|
@@ -289995,6 +290243,11 @@ var init_perch_cli = __esm({
|
|
|
289995
290243
|
bronze: "#9A5228",
|
|
289996
290244
|
bronzeGlint: "#B5632F",
|
|
289997
290245
|
bronzeDeep: "#6F351D",
|
|
290246
|
+
// Diff "removed" family — warm muted brick red, brand-tuned (not git red),
|
|
290247
|
+
// kept distinct from bronze so deletions don't share the accent/interactive hue.
|
|
290248
|
+
brick: "#CF6A52",
|
|
290249
|
+
brickGlint: "#DC7A60",
|
|
290250
|
+
brickDeep: "#9E4634",
|
|
289998
290251
|
graphite: "#0F0D0B",
|
|
289999
290252
|
divider: "#32251E",
|
|
290000
290253
|
cream: "#FFF8F0",
|