pi-subagents-lite 1.0.1 → 1.0.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/package.json +1 -1
- package/src/agent-types.ts +1 -1
- package/src/default-agents.ts +1 -1
- package/src/index.ts +12 -9
- package/src/tool-execution.ts +7 -12
package/package.json
CHANGED
package/src/agent-types.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { AgentConfig } from "./types.js";
|
|
|
17
17
|
* `find` and `ls` were removed — they're thin wrappers over bash commands
|
|
18
18
|
* that add ~180 tokens/turn with no real benefit.
|
|
19
19
|
*/
|
|
20
|
-
export const BUILTIN_TOOL_NAMES: string[] = ["read", "bash", "edit", "write", "grep"];
|
|
20
|
+
export const BUILTIN_TOOL_NAMES: string[] = ["read", "bash", "edit", "write", "grep", "find"];
|
|
21
21
|
|
|
22
22
|
/** Unified runtime registry of all agents (defaults + user-defined). */
|
|
23
23
|
const agents = new Map<string, AgentConfig>();
|
package/src/default-agents.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -136,6 +136,13 @@ async function loadConfigAndRegisterAgents(ctx: ExtensionContext): Promise<void>
|
|
|
136
136
|
// UI helpers — stats card rendering (shared by renderResult and message renderer)
|
|
137
137
|
// ============================================================================
|
|
138
138
|
|
|
139
|
+
/** Format agent display name with optional model: "Agent (mimo-v2.5-pro)" or "Agent". */
|
|
140
|
+
function agentNameLabel(d: Record<string, unknown>, theme: Theme): string {
|
|
141
|
+
const typeName = getDisplayName((d.type as string) || "");
|
|
142
|
+
const modelName = d.modelName as string | undefined;
|
|
143
|
+
return modelName ? `${theme.bold(typeName)} (${modelName})` : theme.bold(typeName);
|
|
144
|
+
}
|
|
145
|
+
|
|
139
146
|
/** Build the stats line for an agent result card. Used by both renderers. */
|
|
140
147
|
function buildStatsLine(d: Record<string, unknown>, theme: Theme): string {
|
|
141
148
|
const parts = buildStatsParts({
|
|
@@ -205,8 +212,9 @@ function registerAgentTool(pi: ExtensionAPI): void {
|
|
|
205
212
|
const desc = (d?.description as string) || "";
|
|
206
213
|
|
|
207
214
|
if (d && d.turnCount != null) {
|
|
215
|
+
const namePart = agentNameLabel(d, theme);
|
|
208
216
|
const statsLine = buildStatsLine(d, theme);
|
|
209
|
-
let lines = `${icon} ${statsLine}\n ${theme.fg("text", desc)}`;
|
|
217
|
+
let lines = `${icon} ${namePart}·${statsLine}\n ${theme.fg("text", desc)}`;
|
|
210
218
|
if (expanded && text) {
|
|
211
219
|
lines += "\n" + text.split("\n").map(l => ` ${l}`).join("\n");
|
|
212
220
|
}
|
|
@@ -265,11 +273,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
265
273
|
if (d && d.turnCount != null) {
|
|
266
274
|
const isError = d.status === "error" || d.status === "aborted" || d.status === "stopped";
|
|
267
275
|
const icon = isError ? theme.fg("error", "✗") : theme.fg("success", "✓");
|
|
268
|
-
const typeName = getDisplayName((d.type as string) || "");
|
|
269
|
-
const modelName = d.modelName as string | undefined;
|
|
270
276
|
const desc = (d.description as string) || "";
|
|
271
277
|
|
|
272
|
-
const namePart =
|
|
278
|
+
const namePart = agentNameLabel(d, theme);
|
|
273
279
|
const statsLine = buildStatsLine(d, theme);
|
|
274
280
|
let headerLine = `${icon} ${namePart}·${statsLine}\n ${theme.fg("text", desc)}`;
|
|
275
281
|
if ((d.outputFile as string)) {
|
|
@@ -283,13 +289,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
283
289
|
inner.addChild(new Text(resultLines, 0, 0));
|
|
284
290
|
}
|
|
285
291
|
} else {
|
|
286
|
-
const typeName = getDisplayName((d?.type as string) || "");
|
|
287
|
-
const modelName = d?.modelName as string | undefined;
|
|
288
292
|
const desc = (d?.description as string) || "";
|
|
289
293
|
let line = `${theme.fg("success", "✓")}`;
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
line += ` ${namePart}`;
|
|
294
|
+
if (d?.type) {
|
|
295
|
+
line += ` ${agentNameLabel(d, theme)}`;
|
|
293
296
|
}
|
|
294
297
|
if (desc) line += `\n ${theme.fg("text", desc)}`;
|
|
295
298
|
if (d?.outputFile) {
|
package/src/tool-execution.ts
CHANGED
|
@@ -191,11 +191,8 @@ export async function executeAgentTool(
|
|
|
191
191
|
const model = findModelInRegistry(modelStr, ctx.modelRegistry, ctx.model);
|
|
192
192
|
const modelKey = model ? `${model.provider}/${model.id}` : undefined;
|
|
193
193
|
|
|
194
|
-
// Determine modelName for invocation (
|
|
195
|
-
const
|
|
196
|
-
const modelName = (modelKey && modelKey !== parentModelId)
|
|
197
|
-
? parseModelKey(modelKey)?.modelId
|
|
198
|
-
: undefined;
|
|
194
|
+
// Determine modelName for invocation (always capture for display)
|
|
195
|
+
const modelName = model?.id;
|
|
199
196
|
|
|
200
197
|
// Resolve thinking: explicit param > agent config (frontmatter) > undefined (inherit)
|
|
201
198
|
const thinkingLevel = parseThinkingLevel(params.thinking as string | undefined)
|
|
@@ -207,7 +204,7 @@ export async function executeAgentTool(
|
|
|
207
204
|
maxTurns,
|
|
208
205
|
thinkingLevel,
|
|
209
206
|
modelKey,
|
|
210
|
-
invocation:
|
|
207
|
+
invocation: { modelName },
|
|
211
208
|
graceTurns: __config.agent.graceTurns,
|
|
212
209
|
};
|
|
213
210
|
|
|
@@ -319,12 +316,10 @@ export async function toolCallListener(
|
|
|
319
316
|
|
|
320
317
|
if (effectiveModel) {
|
|
321
318
|
input.model = effectiveModel;
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
input._modelOverride = parsed.modelId;
|
|
327
|
-
}
|
|
319
|
+
// Always inject _modelOverride for renderCall
|
|
320
|
+
const parsed = parseModelKey(effectiveModel);
|
|
321
|
+
if (parsed) {
|
|
322
|
+
input._modelOverride = parsed.modelId;
|
|
328
323
|
}
|
|
329
324
|
}
|
|
330
325
|
|