tarsk 0.5.54 → 0.5.55

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13746,9 +13746,13 @@ function applyToolWrapperHooks(tools) {
13746
13746
  function filterAvailableTools(tools, disabledTools) {
13747
13747
  return filterProjectTools(filterEnabledTools(tools), disabledTools);
13748
13748
  }
13749
+ function filterPlanModeTools(tools) {
13750
+ return tools.filter((tool) => !PLAN_MODE_EXCLUDED_TOOLS.has(tool.name));
13751
+ }
13749
13752
  async function createCodingTools(cwd, options) {
13750
13753
  const deferOption = options?.deferTools ?? true;
13751
13754
  const disabledTools = options?.disabledTools;
13755
+ const planMode = options?.planMode ?? false;
13752
13756
  const shellPermissionGate = options?.shellPermissionGate;
13753
13757
  const bashOptions = shellPermissionGate || options?.projectId ? { ...options?.bash, shellPermissionGate, projectId: options?.projectId } : options?.bash;
13754
13758
  const coreTools = filterAvailableTools(
@@ -13771,7 +13775,7 @@ async function createCodingTools(cwd, options) {
13771
13775
  ],
13772
13776
  disabledTools
13773
13777
  );
13774
- if (options?.projectId && options.threadId && isToolEnabled("tasks") && isProjectToolEnabled("tasks", disabledTools)) {
13778
+ if (!planMode && options?.projectId && options.threadId && isToolEnabled("tasks") && isProjectToolEnabled("tasks", disabledTools)) {
13775
13779
  coreTools.push(
13776
13780
  createTasksTool(
13777
13781
  options.projectId,
@@ -13782,9 +13786,17 @@ async function createCodingTools(cwd, options) {
13782
13786
  )
13783
13787
  );
13784
13788
  }
13785
- if (options?.metadataManager && isToolEnabled("generate_image") && isProjectToolEnabled("generate_image", disabledTools)) {
13789
+ if (!planMode && options?.metadataManager && isToolEnabled("generate_image") && isProjectToolEnabled("generate_image", disabledTools)) {
13786
13790
  coreTools.push(createGenerateImageTool({ metadataManager: options.metadataManager, cwd }));
13787
13791
  }
13792
+ if (planMode) {
13793
+ const readOnlyCore = filterPlanModeTools(coreTools);
13794
+ const deferredToolNames = /* @__PURE__ */ new Map();
13795
+ return {
13796
+ tools: applyToolWrapperHooks(readOnlyCore),
13797
+ deferredToolNames
13798
+ };
13799
+ }
13788
13800
  const optionalTools = filterAvailableTools(
13789
13801
  [
13790
13802
  createFindImagesTool({ cwd, threadId: options?.threadId }),
@@ -13893,7 +13905,7 @@ function createAllTools(cwd, options) {
13893
13905
  }
13894
13906
  return tools;
13895
13907
  }
13896
- var log33, codingTools, readOnlyTools, allToolsByName, allTools;
13908
+ var log33, codingTools, readOnlyTools, allToolsByName, allTools, PLAN_MODE_EXCLUDED_TOOLS;
13897
13909
  var init_tools = __esm({
13898
13910
  "src/tools/index.ts"() {
13899
13911
  "use strict";
@@ -13960,6 +13972,18 @@ var init_tools = __esm({
13960
13972
  allTools = Object.fromEntries(
13961
13973
  Object.entries(allToolsByName).filter(([name]) => isToolEnabled(name))
13962
13974
  );
13975
+ PLAN_MODE_EXCLUDED_TOOLS = /* @__PURE__ */ new Set([
13976
+ "bash",
13977
+ "edit",
13978
+ "write",
13979
+ "run_js",
13980
+ "generate_image",
13981
+ "tasks",
13982
+ "browser",
13983
+ "open_widget",
13984
+ "call_widget",
13985
+ "mcp"
13986
+ ]);
13963
13987
  }
13964
13988
  });
13965
13989
 
@@ -16530,7 +16554,7 @@ var init_agent_prompt_loader = __esm({
16530
16554
 
16531
16555
  # Plan Mode (ACTIVE)
16532
16556
 
16533
- You are currently in PLAN MODE. You MUST follow these constraints strictly:
16557
+ You are currently in PLAN MODE. Write-capable tools (Bash, Edit, Write, browser, image generation, MCP tools) are NOT available \u2014 only read-only tools (Read, Grep, Find, Ask User) are loaded.
16534
16558
 
16535
16559
  ## What you MUST do:
16536
16560
  - Analyze the user's request thoroughly
@@ -16541,10 +16565,6 @@ You are currently in PLAN MODE. You MUST follow these constraints strictly:
16541
16565
  - Present the plan for user review and approval
16542
16566
 
16543
16567
  ## What you MUST NOT do:
16544
- - Do NOT use any tools that modify files (Write, Edit, Bash with write operations)
16545
- - Do NOT create, delete, or modify any files
16546
- - Do NOT run any commands that change system state (npm install, git commit, etc.)
16547
- - You MAY use read-only tools (Read, Glob, Grep, Bash with read-only commands like ls, cat, git status, git log, git diff) to explore the codebase
16548
16568
  - Do NOT use emojis
16549
16569
 
16550
16570
  ## Output format:
@@ -16998,7 +17018,8 @@ var init_agent_executor = __esm({
16998
17018
  metadataManager: this.metadataManager,
16999
17019
  shellPermissionGate,
17000
17020
  webFetchPermissionGate,
17001
- disabledTools: context.disabledTools
17021
+ disabledTools: context.disabledTools,
17022
+ planMode: context.planMode
17002
17023
  });
17003
17024
  let toolsResult = await toolsLoader.next();
17004
17025
  while (!toolsResult.done) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tarsk",
3
- "version": "0.5.54",
3
+ "version": "0.5.55",
4
4
  "description": "CLI for Tarsk - Project Threads Manager",
5
5
  "keywords": [
6
6
  "cli",