topchester-ai 0.68.0 → 0.69.0

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/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as runTopchesterCli } from "./cli-CRhzHqMB.mjs";
2
+ import { t as runTopchesterCli } from "./cli-CUjNKJTW.mjs";
3
3
  //#region src/bin.ts
4
4
  await runTopchesterCli();
5
5
  //#endregion
@@ -5287,8 +5287,8 @@ function formatSkillSource$2(skill) {
5287
5287
  }
5288
5288
  const taskTool = defineTool({
5289
5289
  name: "task",
5290
- description: "Delegate a focused prompt to a constrained child agent session.",
5291
- prompt: "task: delegate focused read-only research or isolated analysis to a child agent session. Use it when parallel context gathering would help. To use it, reply with only JSON: {\"tool\":\"task\",\"args\":{\"description\":\"Inspect runtime event flow\",\"prompt\":\"Read the runtime and summarize how events are emitted.\",\"subagent_type\":\"explore\"}}",
5290
+ description: "Delegate read-only file/search/git research to a child agent. Do not use for shell commands, bash, Python/Node scripts, validators, edits, writes, or other execution work.",
5291
+ prompt: "task: delegate read-only file/search/git research to a child agent. Do not use task for shell commands, bash, Python/Node scripts, validators, edits, writes, finish_task, or other execution work; use parent tools directly. To use it, reply with only JSON: {\"tool\":\"task\",\"args\":{\"description\":\"Inspect runtime event flow\",\"prompt\":\"Read the runtime and summarize how events are emitted.\",\"subagent_type\":\"explore\"}}",
5292
5292
  argsSchema: z.object({
5293
5293
  description: z.string().min(1),
5294
5294
  prompt: z.string().min(1),
@@ -5297,6 +5297,7 @@ const taskTool = defineTool({
5297
5297
  }),
5298
5298
  async execute(context, args) {
5299
5299
  if (!context.subagents) throw new Error("task requires a runtime subagent manager.");
5300
+ rejectUnsupportedSubagentPrompt(args);
5300
5301
  const result = await context.subagents.runTask({
5301
5302
  description: args.description,
5302
5303
  prompt: args.prompt,
@@ -5304,7 +5305,8 @@ const taskTool = defineTool({
5304
5305
  taskId: args.task_id,
5305
5306
  parentToolCallId: context.toolCallId ?? args.task_id ?? "task",
5306
5307
  eventSink: context.eventSink,
5307
- abortSignal: context.abortSignal
5308
+ abortSignal: context.abortSignal,
5309
+ benchmarkProfile: context.benchmarkProfile
5308
5310
  });
5309
5311
  return {
5310
5312
  tool: "task",
@@ -5321,6 +5323,14 @@ const taskTool = defineTool({
5321
5323
  };
5322
5324
  }
5323
5325
  });
5326
+ function rejectUnsupportedSubagentPrompt(args) {
5327
+ const profile = resolveAgentProfile(args.subagent_type ?? "explore");
5328
+ if (isToolAllowed(createToolPermissionView(profile), "bash") || !looksLikeShellExecutionRequest(args.prompt)) return;
5329
+ throw new Error(`task subagent "${profile.id}" cannot run bash, shell commands, Python/Node scripts, validators, or other execution tools. Use the parent bash/run_validator tools directly, or delegate only read-only file/search/git research.`);
5330
+ }
5331
+ function looksLikeShellExecutionRequest(prompt) {
5332
+ return /\b(use|run|execute)\s+(bash|shell|command|commands|python3?|node|npm|npx|pnpm|xxd|readelf|objdump|file)\b/i.test(prompt);
5333
+ }
5324
5334
  //#endregion
5325
5335
  //#region src/agent/tools/registry.ts
5326
5336
  const toolRegistry = {
@@ -12784,7 +12794,10 @@ var SubagentManager = class {
12784
12794
  });
12785
12795
  let finalResponse = "";
12786
12796
  try {
12787
- for await (const childEvent of childRuntime.submitMessageStream([], options.prompt, options.abortSignal, { session: child })) {
12797
+ for await (const childEvent of childRuntime.submitMessageStream([], options.prompt, options.abortSignal, {
12798
+ session: child,
12799
+ benchmarkProfile: options.benchmarkProfile
12800
+ })) {
12788
12801
  const payload = runtimeEventToSessionPayload(childEvent);
12789
12802
  if (payload) await child.append(payload);
12790
12803
  if (childEvent.type === "message" && childEvent.role === "assistant") finalResponse = childEvent.text;
@@ -16774,4 +16787,4 @@ function formatDryRunSyncStatus(status) {
16774
16787
  //#endregion
16775
16788
  export { runTopchesterCli as t };
16776
16789
 
16777
- //# sourceMappingURL=cli-CRhzHqMB.mjs.map
16790
+ //# sourceMappingURL=cli-CUjNKJTW.mjs.map