iosm-cli 0.1.2 → 0.2.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +37 -3
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +4 -2
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/agent-profiles.d.ts.map +1 -1
  7. package/dist/core/agent-profiles.js +1 -0
  8. package/dist/core/agent-profiles.js.map +1 -1
  9. package/dist/core/agent-session.d.ts.map +1 -1
  10. package/dist/core/agent-session.js +3 -0
  11. package/dist/core/agent-session.js.map +1 -1
  12. package/dist/core/blast.d.ts +62 -0
  13. package/dist/core/blast.d.ts.map +1 -0
  14. package/dist/core/blast.js +448 -0
  15. package/dist/core/blast.js.map +1 -0
  16. package/dist/core/contract.d.ts +54 -0
  17. package/dist/core/contract.d.ts.map +1 -0
  18. package/dist/core/contract.js +300 -0
  19. package/dist/core/contract.js.map +1 -0
  20. package/dist/core/sdk.d.ts +3 -3
  21. package/dist/core/sdk.d.ts.map +1 -1
  22. package/dist/core/sdk.js +11 -19
  23. package/dist/core/sdk.js.map +1 -1
  24. package/dist/core/semantic/chunking.d.ts +10 -0
  25. package/dist/core/semantic/chunking.d.ts.map +1 -0
  26. package/dist/core/semantic/chunking.js +82 -0
  27. package/dist/core/semantic/chunking.js.map +1 -0
  28. package/dist/core/semantic/cli.d.ts +23 -0
  29. package/dist/core/semantic/cli.d.ts.map +1 -0
  30. package/dist/core/semantic/cli.js +86 -0
  31. package/dist/core/semantic/cli.js.map +1 -0
  32. package/dist/core/semantic/config.d.ts +8 -0
  33. package/dist/core/semantic/config.d.ts.map +1 -0
  34. package/dist/core/semantic/config.js +266 -0
  35. package/dist/core/semantic/config.js.map +1 -0
  36. package/dist/core/semantic/index-store.d.ts +21 -0
  37. package/dist/core/semantic/index-store.d.ts.map +1 -0
  38. package/dist/core/semantic/index-store.js +73 -0
  39. package/dist/core/semantic/index-store.js.map +1 -0
  40. package/dist/core/semantic/index.d.ts +8 -0
  41. package/dist/core/semantic/index.d.ts.map +1 -0
  42. package/dist/core/semantic/index.js +7 -0
  43. package/dist/core/semantic/index.js.map +1 -0
  44. package/dist/core/semantic/providers.d.ts +22 -0
  45. package/dist/core/semantic/providers.d.ts.map +1 -0
  46. package/dist/core/semantic/providers.js +317 -0
  47. package/dist/core/semantic/providers.js.map +1 -0
  48. package/dist/core/semantic/runtime.d.ts +32 -0
  49. package/dist/core/semantic/runtime.d.ts.map +1 -0
  50. package/dist/core/semantic/runtime.js +510 -0
  51. package/dist/core/semantic/runtime.js.map +1 -0
  52. package/dist/core/semantic/types.d.ts +157 -0
  53. package/dist/core/semantic/types.d.ts.map +1 -0
  54. package/dist/core/semantic/types.js +23 -0
  55. package/dist/core/semantic/types.js.map +1 -0
  56. package/dist/core/shadow-guard.d.ts +30 -0
  57. package/dist/core/shadow-guard.d.ts.map +1 -0
  58. package/dist/core/shadow-guard.js +81 -0
  59. package/dist/core/shadow-guard.js.map +1 -0
  60. package/dist/core/singular.d.ts +73 -0
  61. package/dist/core/singular.d.ts.map +1 -0
  62. package/dist/core/singular.js +413 -0
  63. package/dist/core/singular.js.map +1 -0
  64. package/dist/core/slash-commands.d.ts.map +1 -1
  65. package/dist/core/slash-commands.js +12 -0
  66. package/dist/core/slash-commands.js.map +1 -1
  67. package/dist/core/system-prompt.d.ts.map +1 -1
  68. package/dist/core/system-prompt.js +21 -3
  69. package/dist/core/system-prompt.js.map +1 -1
  70. package/dist/core/tools/ast-grep.js +1 -1
  71. package/dist/core/tools/ast-grep.js.map +1 -1
  72. package/dist/core/tools/comby.js +1 -1
  73. package/dist/core/tools/comby.js.map +1 -1
  74. package/dist/core/tools/index.d.ts +9 -0
  75. package/dist/core/tools/index.d.ts.map +1 -1
  76. package/dist/core/tools/index.js +6 -0
  77. package/dist/core/tools/index.js.map +1 -1
  78. package/dist/core/tools/rg.js +1 -1
  79. package/dist/core/tools/rg.js.map +1 -1
  80. package/dist/core/tools/semantic-search.d.ts +21 -0
  81. package/dist/core/tools/semantic-search.d.ts.map +1 -0
  82. package/dist/core/tools/semantic-search.js +123 -0
  83. package/dist/core/tools/semantic-search.js.map +1 -0
  84. package/dist/index.d.ts +4 -2
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +3 -2
  87. package/dist/index.js.map +1 -1
  88. package/dist/main.d.ts.map +1 -1
  89. package/dist/main.js +124 -0
  90. package/dist/main.js.map +1 -1
  91. package/dist/modes/interactive/components/custom-editor.d.ts +8 -0
  92. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  93. package/dist/modes/interactive/components/custom-editor.js +70 -1
  94. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  95. package/dist/modes/interactive/interactive-mode.d.ts +58 -0
  96. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  97. package/dist/modes/interactive/interactive-mode.js +2067 -104
  98. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  99. package/docs/cli-reference.md +36 -1
  100. package/docs/configuration.md +79 -2
  101. package/docs/getting-started.md +1 -0
  102. package/docs/interactive-mode.md +135 -1
  103. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAEhE,0CAA0C;AAC1C,MAAM,gBAAgB,GAA2B;IAChD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,8CAA8C;IACpD,IAAI,EAAE,4DAA4D;IAClE,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,yDAAyD;IAC/D,IAAI,EAAE,kDAAkD;IACxD,EAAE,EAAE,yBAAyB;IAC7B,EAAE,EAAE,g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AAmD,CAAC;QAC9D,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;YACxD,MAAM,IAAI,MAAM,QAAQ,OAAO,OAAO,MAAM,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,2CAA2C;IAC3C,MAAM,IAAI,4BAA4B,QAAQ,EAAE,CAAC;IACjD,MAAM,IAAI,gCAAgC,WAAW,EAAE,CAAC;IAExD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.js\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.js\";\n\n/** Tool descriptions for system prompt */\nconst toolDescriptions: Record<string, string> = {\n\tread: \"Read file contents\",\n\tbash: \"Execute bash commands (ls, grep, find, etc.)\",\n\tedit: \"Make surgical edits to files (find exact text and replace)\",\n\twrite: \"Create or overwrite files\",\n\tgrep: \"Search file contents for patterns (respects .gitignore)\",\n\tfind: \"Find files by glob pattern (respects .gitignore)\",\n\tls: \"List directory contents\",\n\trg: \"Run ripgrep directly for advanced regex search\",\n\tfd: \"Run fd directly for fast file discovery\",\n\tast_grep: \"Run ast-grep for AST/syntax-aware structural code search\",\n\tcomby: \"Run comby for structural pattern search/rewrite previews (no in-place edits)\",\n\tjq: \"Run jq for JSON querying/transformation\",\n\tyq: \"Run yq for YAML/JSON/TOML querying/transformation\",\n\tsemgrep: \"Run semgrep for structural/static security checks\",\n\tsed: \"Run sed for stream editing/extraction previews (no in-place edits)\",\n\ttask: \"Run a specialized subagent (supports profile, cwd, lock_key for optional write serialization, run_id/task_id, model override, background mode for detached runs, and agent=<custom name from .iosm/agents>)\",\n};\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. Default: process.cwd() */\n\tcwd?: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions = {}): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst resolvedCwd = cwd ?? process.cwd();\n\n\tconst now = new Date();\n\tconst dateTime = now.toLocaleString(\"en-US\", {\n\t\tweekday: \"long\",\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\ttimeZoneName: \"short\",\n\t});\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\t// Add date/time and working directory last\n\t\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\t\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// Built-ins use toolDescriptions. Custom tools can provide one-line snippets.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\"];\n\tconst toolsList =\n\t\ttools.length > 0\n\t\t\t? tools\n\t\t\t\t\t.map((name) => {\n\t\t\t\t\t\tconst snippet = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;\n\t\t\t\t\t\treturn `- ${name}: ${snippet}`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")\n\t\t\t: \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasEdit = tools.includes(\"edit\");\n\tconst hasWrite = tools.includes(\"write\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRg = tools.includes(\"rg\");\n\tconst hasFd = tools.includes(\"fd\");\n\tconst hasAstGrep = tools.includes(\"ast_grep\");\n\tconst hasComby = tools.includes(\"comby\");\n\tconst hasJq = tools.includes(\"jq\");\n\tconst hasYq = tools.includes(\"yq\");\n\tconst hasSemgrep = tools.includes(\"semgrep\");\n\tconst hasSed = tools.includes(\"sed\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif (hasBash && !hasGrep && !hasFind && !hasLs && !hasRg && !hasFd) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find; prefer rg for targeted search when available\");\n\t} else if (hasBash && (hasGrep || hasFind || hasLs || hasRg || hasFd)) {\n\t\taddGuideline(\"Prefer grep/find/ls/rg/fd tools over bash for codebase exploration (faster and less noisy)\");\n\t}\n\n\tif (hasAstGrep || hasComby) {\n\t\taddGuideline(\"Use ast_grep/comby for syntax-aware structural queries before falling back to broad regex\");\n\t}\n\n\tif (hasComby) {\n\t\taddGuideline(\"Use comby to preview structural rewrite matches first, then apply final changes via edit/write\");\n\t}\n\n\tif (hasJq || hasYq) {\n\t\taddGuideline(\"Prefer jq/yq over ad-hoc shell parsing when extracting or transforming JSON/YAML/TOML\");\n\t}\n\n\tif (hasSemgrep) {\n\t\taddGuideline(\"Use semgrep for rule-based risk scans and structural security checks when relevant\");\n\t}\n\n\tif (hasSed) {\n\t\taddGuideline(\"Use sed for preview/extraction workflows only; perform final file edits with edit/write\");\n\t}\n\n\t// Read before edit guideline\n\tif (hasRead && hasEdit) {\n\t\taddGuideline(\"Use read to examine files before editing. You must use this tool instead of cat or sed.\");\n\t}\n\n\t// Edit guideline\n\tif (hasEdit) {\n\t\taddGuideline(\"Use edit for precise changes (old text must match exactly)\");\n\t}\n\n\t// Write guideline\n\tif (hasWrite) {\n\t\taddGuideline(\"Use write only for new files or complete rewrites\");\n\t}\n\n\t// Output guideline (only when actually writing or executing)\n\tif (hasEdit || hasWrite) {\n\t\taddGuideline(\n\t\t\t\"When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did\",\n\t\t);\n\t}\n\n\taddGuideline(\"Inspect the relevant files before editing and keep exploration bounded to the task\");\n\taddGuideline(\"Make reasonable assumptions and continue unless a risky ambiguity blocks the work\");\n\taddGuideline(\"Classify requests as simple vs complex: execute simple work immediately, use a step plan for complex work\");\n\taddGuideline(\"For complex work, publish a short step plan before edits and keep step statuses current while executing\");\n\taddGuideline(\"If a meaningful architecture or product fork changes implementation, ask a concise clarification before editing\");\n\taddGuideline(\"After changes, run the smallest relevant verification and report the concrete result\");\n\taddGuideline(\"Do not claim success without evidence; if you could not verify, say so explicitly\");\n\taddGuideline(\"Complete the requested task end-to-end when possible instead of stopping at analysis\");\n\taddGuideline(\"For code review requests, lead with findings and risks before summaries\");\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are a professional software engineering agent operating inside iosm-cli. Help users inspect systems, change code, run commands, maintain project artifacts when needed, and explain results clearly.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nOperating defaults:\n- Summarize work in standard engineering language first: what you inspected, what you changed, what you verified, and any remaining risk or blocker.\n- Do NOT start by reading documentation unless the user asks for documentation help, asks about harness internals, or implementation is blocked without it.\n- Start implementation turns with a quick repository scan of the files most likely to matter before proposing or editing.\n- Prefer targeted reads and searches over broad dumps; keep command output bounded and focused.\n- For complex tasks, include a machine-readable plan block before edits and update it when statuses change:\n <task_plan complexity=\"complex\">\n - [in_progress] Current step\n - [pending] Next step\n </task_plan>\n- Skip plan blocks for simple one-shot tasks.\n- When a material architecture fork exists, pause and ask one concise clarification (or use ask_user when available) before implementation.\n- Treat verification as mandatory after edits: tests, type checks, linters, or a precise explanation of why verification was not possible.\n- For complex requests, execute plan steps in order, close each step explicitly, and finish the full plan unless blocked.\n- If the user explicitly asks for subagents/agents orchestration, you MUST use the task tool rather than doing all work in the main agent.\n- For explicit subagent/orchestration requests, execute at least one task tool call before giving a final prose-only answer.\n- Do not expose internal orchestration scaffolding to the user (for example: [ORCHESTRATION_DIRECTIVE], pseudo tool-call JSON, or raw task arguments).\n- When invoking tools, call them directly without preambles like \"I will now call tool X\"; only report outcomes that matter to the user.\n- Respect orchestration constraints from the user exactly: count, parallel vs sequential execution, per-agent profile, and per-agent working directory (cwd) when provided.\n- For explicit parallel orchestration requests, issue multiple independent task tool calls to match the requested agent count; do not collapse to a single subagent unless the user asks for one.\n- For explicit parallel orchestration requests, emit independent task calls in a single assistant turn whenever possible so they can be launched together.\n- Runtime note: when parallel orchestration is requested, emit independent task calls in one assistant turn so they can run concurrently; avoid background mode unless the user explicitly asks for detached async runs.\n- If orchestration constraints are ambiguous or conflict, ask one concise clarification (or use ask_user when available) before launching subagents.\n- When the user provides an <orchestrate ...>...</orchestrate> block, treat it as an execution contract and follow its mode/agents/profile/cwd assignments strictly.\n- When orchestration assignments include run_id/task_id/lock_key or depends_on, enforce them in task calls (run_id/task_id for team tracking, lock_key for serialization domains, depends_on for ordering).\n- For write-heavy parallel orchestration, prefer isolation=worktree to reduce cross-agent interference when the repository is git-backed.\n- If the user message includes @<custom-agent-name>, treat it as an explicit agent selection and call task with agent set to that custom agent name.\n\niosm-cli reference docs (use when needed):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), package composition (docs/packages.md)\n- When working on harness internals, read the relevant docs/examples before implementing`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t}\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\t// Add date/time and working directory last\n\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\n\treturn prompt;\n}\n"]}
1
+ {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAc,MAAM,aAAa,CAAC;AAEhE,0CAA0C;AAC1C,MAAM,gBAAgB,GAA2B;IAChD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,8CAA8C;IACpD,IAAI,EAAE,4DAA4D;IAClE,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,yDAAyD;IAC/D,IAAI,EAAE,kDAAkD;IACxD,EAAE,EAAE,yBAAyB;IAC7B,EAAE,EAAE,+FAA+F;IACnG,EAAE,EAAE,yCAAyC;IAC7C,QAAQ,EACP,uHAAuH;IACxH,KAAK,EACJ,wGAAwG;IACzG,EAAE,EAAE,yCAAyC;IAC7C,EAAE,EAAE,mDAAmD;IACvD,OAAO,EAAE,mDAAmD;IAC5D,GAAG,EAAE,oEAAoE;IACzE,eAAe,EACd,4FAA4F;IAC7F,IAAI,EAAE,6MAA6M;CACnN,CAAC;AAqBF,kEAAkE;AAClE,MAAM,UAAU,iBAAiB,CAAC,UAAoC,EAAE;IACvE,MAAM,EACL,YAAY,EACZ,aAAa,EACb,YAAY,E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KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElE,IAAI,MAAM,GAAG;;;EAGZ,SAAS;;;;;EAKT,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+BY,UAAU;qBACb,QAAQ;cACf,YAAY;;yFAE+D,CAAC;IAEzF,IAAI,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,aAAa,CAAC;IACzB,CAAC;IAED,+BAA+B;IAC/B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,2BAA2B,CAAC;QACtC,MAAM,IAAI,mDAAmD,CAAC;QAC9D,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;YACxD,MAAM,IAAI,MAAM,QAAQ,OAAO,OAAO,MAAM,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,2CAA2C;IAC3C,MAAM,IAAI,4BAA4B,QAAQ,EAAE,CAAC;IACjD,MAAM,IAAI,gCAAgC,WAAW,EAAE,CAAC;IAExD,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.js\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.js\";\n\n/** Tool descriptions for system prompt */\nconst toolDescriptions: Record<string, string> = {\n\tread: \"Read file contents\",\n\tbash: \"Execute bash commands (ls, grep, find, etc.)\",\n\tedit: \"Make surgical edits to files (find exact text and replace)\",\n\twrite: \"Create or overwrite files\",\n\tgrep: \"Search file contents for patterns (respects .gitignore)\",\n\tfind: \"Find files by glob pattern (respects .gitignore)\",\n\tls: \"List directory contents\",\n\trg: \"Run ripgrep directly for advanced regex search (prefer explicit path args, e.g. -n pattern .)\",\n\tfd: \"Run fd directly for fast file discovery\",\n\tast_grep:\n\t\t\"Run ast-grep for AST/syntax-aware structural code search (prefer run --pattern; retry with scan/-p on older versions)\",\n\tcomby:\n\t\t\"Run comby for structural pattern search/rewrite previews (prefer explicit -matcher; no in-place edits)\",\n\tjq: \"Run jq for JSON querying/transformation\",\n\tyq: \"Run yq for YAML/JSON/TOML querying/transformation\",\n\tsemgrep: \"Run semgrep for structural/static security checks\",\n\tsed: \"Run sed for stream editing/extraction previews (no in-place edits)\",\n\tsemantic_search:\n\t\t\"Semantic embeddings search over the project index (actions: status, index, rebuild, query)\",\n\ttask: \"Run a specialized subagent (supports profile, cwd, lock_key for optional write serialization, run_id/task_id, model override, background mode for detached runs, and agent=<custom name from .iosm/agents>)\",\n};\n\nexport interface BuildSystemPromptOptions {\n\t/** Custom system prompt (replaces default). */\n\tcustomPrompt?: string;\n\t/** Tools to include in prompt. Default: [read, bash, edit, write] */\n\tselectedTools?: string[];\n\t/** Optional one-line tool snippets keyed by tool name. */\n\ttoolSnippets?: Record<string, string>;\n\t/** Additional guideline bullets appended to the default system prompt guidelines. */\n\tpromptGuidelines?: string[];\n\t/** Text to append to system prompt. */\n\tappendSystemPrompt?: string;\n\t/** Working directory. Default: process.cwd() */\n\tcwd?: string;\n\t/** Pre-loaded context files. */\n\tcontextFiles?: Array<{ path: string; content: string }>;\n\t/** Pre-loaded skills. */\n\tskills?: Skill[];\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions = {}): string {\n\tconst {\n\t\tcustomPrompt,\n\t\tselectedTools,\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t\tappendSystemPrompt,\n\t\tcwd,\n\t\tcontextFiles: providedContextFiles,\n\t\tskills: providedSkills,\n\t} = options;\n\tconst resolvedCwd = cwd ?? process.cwd();\n\n\tconst now = new Date();\n\tconst dateTime = now.toLocaleString(\"en-US\", {\n\t\tweekday: \"long\",\n\t\tyear: \"numeric\",\n\t\tmonth: \"long\",\n\t\tday: \"numeric\",\n\t\thour: \"2-digit\",\n\t\tminute: \"2-digit\",\n\t\tsecond: \"2-digit\",\n\t\ttimeZoneName: \"short\",\n\t});\n\n\tconst appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n\n\tconst contextFiles = providedContextFiles ?? [];\n\tconst skills = providedSkills ?? [];\n\n\tif (customPrompt) {\n\t\tlet prompt = customPrompt;\n\n\t\tif (appendSection) {\n\t\t\tprompt += appendSection;\n\t\t}\n\n\t\t// Append project context files\n\t\tif (contextFiles.length > 0) {\n\t\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\t// Append skills section (only if read tool is available)\n\t\tconst customPromptHasRead = !selectedTools || selectedTools.includes(\"read\");\n\t\tif (customPromptHasRead && skills.length > 0) {\n\t\t\tprompt += formatSkillsForPrompt(skills);\n\t\t}\n\n\t\t// Add date/time and working directory last\n\t\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\t\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\n\t\treturn prompt;\n\t}\n\n\t// Get absolute paths to documentation and examples\n\tconst readmePath = getReadmePath();\n\tconst docsPath = getDocsPath();\n\tconst examplesPath = getExamplesPath();\n\n\t// Build tools list based on selected tools.\n\t// Built-ins use toolDescriptions. Custom tools can provide one-line snippets.\n\tconst tools = selectedTools || [\"read\", \"bash\", \"edit\", \"write\"];\n\tconst toolsList =\n\t\ttools.length > 0\n\t\t\t? tools\n\t\t\t\t\t.map((name) => {\n\t\t\t\t\t\tconst snippet = toolSnippets?.[name] ?? toolDescriptions[name] ?? name;\n\t\t\t\t\t\treturn `- ${name}: ${snippet}`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")\n\t\t\t: \"(none)\";\n\n\t// Build guidelines based on which tools are actually available\n\tconst guidelinesList: string[] = [];\n\tconst guidelinesSet = new Set<string>();\n\tconst addGuideline = (guideline: string): void => {\n\t\tif (guidelinesSet.has(guideline)) {\n\t\t\treturn;\n\t\t}\n\t\tguidelinesSet.add(guideline);\n\t\tguidelinesList.push(guideline);\n\t};\n\n\tconst hasBash = tools.includes(\"bash\");\n\tconst hasEdit = tools.includes(\"edit\");\n\tconst hasWrite = tools.includes(\"write\");\n\tconst hasGrep = tools.includes(\"grep\");\n\tconst hasFind = tools.includes(\"find\");\n\tconst hasLs = tools.includes(\"ls\");\n\tconst hasRg = tools.includes(\"rg\");\n\tconst hasFd = tools.includes(\"fd\");\n\tconst hasAstGrep = tools.includes(\"ast_grep\");\n\tconst hasComby = tools.includes(\"comby\");\n\tconst hasJq = tools.includes(\"jq\");\n\tconst hasYq = tools.includes(\"yq\");\n\tconst hasSemgrep = tools.includes(\"semgrep\");\n\tconst hasSed = tools.includes(\"sed\");\n\tconst hasSemanticSearch = tools.includes(\"semantic_search\");\n\tconst hasRead = tools.includes(\"read\");\n\n\t// File exploration guidelines\n\tif (hasBash && !hasGrep && !hasFind && !hasLs && !hasRg && !hasFd) {\n\t\taddGuideline(\"Use bash for file operations like ls, rg, find; prefer rg for targeted search when available\");\n\t} else if (hasBash && (hasGrep || hasFind || hasLs || hasRg || hasFd)) {\n\t\taddGuideline(\"Prefer grep/find/ls/rg/fd tools over bash for codebase exploration (faster and less noisy)\");\n\t}\n\n\tif (hasRg || hasFd || hasAstGrep || hasComby || hasJq || hasYq || hasSemgrep || hasSed || hasSemanticSearch) {\n\t\taddGuideline(\n\t\t\t\"Route work to specialized tools first: rg/fd (search/discovery), semantic_search (concept-level retrieval), ast_grep/comby (structural code queries), jq/yq (data/config transforms), semgrep (risk scans), sed (stream extraction)\",\n\t\t);\n\t}\n\n\tif (hasAstGrep || hasComby) {\n\t\taddGuideline(\"Use ast_grep/comby for syntax-aware structural queries before falling back to broad regex\");\n\t}\n\n\tif (hasComby) {\n\t\taddGuideline(\"Use comby to preview structural rewrite matches first, then apply final changes via edit/write\");\n\t}\n\n\tif (hasJq || hasYq) {\n\t\taddGuideline(\"Prefer jq/yq over ad-hoc shell parsing when extracting or transforming JSON/YAML/TOML\");\n\t}\n\n\tif (hasSemgrep) {\n\t\taddGuideline(\"Use semgrep for rule-based risk scans and structural security checks when relevant\");\n\t}\n\n\tif (hasSed) {\n\t\taddGuideline(\"Use sed for preview/extraction workflows only; perform final file edits with edit/write\");\n\t}\n\n\tif (hasSemanticSearch) {\n\t\taddGuideline(\n\t\t\t\"Use semantic_search for intent/meaning queries that are hard to express with regex; use rg/ast_grep for exact symbol and syntax matches\",\n\t\t);\n\t\taddGuideline(\n\t\t\t\"semantic_search query can auto-refresh stale indexes when semantic auto-index is enabled (default); if disabled or if provider/chunk/filter changes require it, run semantic_search index/rebuild explicitly\",\n\t\t);\n\t}\n\n\tif (hasRg || hasAstGrep || hasComby) {\n\t\taddGuideline(\n\t\t\t\"For rg/ast_grep/comby, pass explicit target paths to avoid cwd ambiguity; if syntax errors occur (especially ast_grep), retry once with version-compatible command forms before concluding no matches\",\n\t\t);\n\t}\n\n\tif (\n\t\thasBash &&\n\t\t(hasRg || hasFd || hasAstGrep || hasComby || hasJq || hasYq || hasSemgrep || hasSed || hasSemanticSearch)\n\t) {\n\t\taddGuideline(\n\t\t\t\"If a required CLI tool is missing, install it first when permitted (rg/fd can be auto-managed; others via brew/apt/pipx/npm), then continue with that tool instead of broad bash fallback. For semantic_search, configure provider/index first via /semantic setup.\",\n\t\t);\n\t}\n\n\t// Read before edit guideline\n\tif (hasRead && hasEdit) {\n\t\taddGuideline(\"Use read to examine files before editing. You must use this tool instead of cat or sed.\");\n\t}\n\n\t// Edit guideline\n\tif (hasEdit) {\n\t\taddGuideline(\"Use edit for precise changes (old text must match exactly)\");\n\t}\n\n\t// Write guideline\n\tif (hasWrite) {\n\t\taddGuideline(\"Use write only for new files or complete rewrites\");\n\t}\n\n\t// Output guideline (only when actually writing or executing)\n\tif (hasEdit || hasWrite) {\n\t\taddGuideline(\n\t\t\t\"When summarizing your actions, output plain text directly - do NOT use cat or bash to display what you did\",\n\t\t);\n\t}\n\n\taddGuideline(\"Inspect the relevant files before editing and keep exploration bounded to the task\");\n\taddGuideline(\"Make reasonable assumptions and continue unless a risky ambiguity blocks the work\");\n\taddGuideline(\"Classify requests as simple vs complex: execute simple work immediately, use a step plan for complex work\");\n\taddGuideline(\"For complex work, publish a short step plan before edits and keep step statuses current while executing\");\n\taddGuideline(\"If a meaningful architecture or product fork changes implementation, ask a concise clarification before editing\");\n\taddGuideline(\"After changes, run the smallest relevant verification and report the concrete result\");\n\taddGuideline(\"Do not claim success without evidence; if you could not verify, say so explicitly\");\n\taddGuideline(\"Complete the requested task end-to-end when possible instead of stopping at analysis\");\n\taddGuideline(\"For code review requests, lead with findings and risks before summaries\");\n\taddGuideline(\n\t\t\"When an active engineering contract is present in context, treat its constraints, quality gates, and definition_of_done as execution requirements unless user overrides them.\",\n\t);\n\taddGuideline(\"For major feature forks, run a /singular feasibility pass before coding to compare implementation options.\");\n\n\tfor (const guideline of promptGuidelines ?? []) {\n\t\tconst normalized = guideline.trim();\n\t\tif (normalized.length > 0) {\n\t\t\taddGuideline(normalized);\n\t\t}\n\t}\n\n\t// Always include these\n\taddGuideline(\"Be concise in your responses\");\n\taddGuideline(\"Show file paths clearly when working with files\");\n\n\tconst guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n\tlet prompt = `You are a professional software engineering agent operating inside iosm-cli. Help users inspect systems, change code, run commands, maintain project artifacts when needed, and explain results clearly.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nOperating defaults:\n- Summarize work in standard engineering language first: what you inspected, what you changed, what you verified, and any remaining risk or blocker.\n- Do NOT start by reading documentation unless the user asks for documentation help, asks about harness internals, or implementation is blocked without it.\n- Start implementation turns with a quick repository scan of the files most likely to matter before proposing or editing.\n- Prefer targeted reads and searches over broad dumps; keep command output bounded and focused.\n- For complex tasks, include a machine-readable plan block before edits and update it when statuses change:\n <task_plan complexity=\"complex\">\n - [in_progress] Current step\n - [pending] Next step\n </task_plan>\n- Skip plan blocks for simple one-shot tasks.\n- When a material architecture fork exists, pause and ask one concise clarification (or use ask_user when available) before implementation.\n- Treat verification as mandatory after edits: tests, type checks, linters, or a precise explanation of why verification was not possible.\n- For complex requests, execute plan steps in order, close each step explicitly, and finish the full plan unless blocked.\n- If the user explicitly asks for subagents/agents orchestration, you MUST use the task tool rather than doing all work in the main agent.\n- For explicit subagent/orchestration requests, execute at least one task tool call before giving a final prose-only answer.\n- Do not expose internal orchestration scaffolding to the user (for example: [ORCHESTRATION_DIRECTIVE], pseudo tool-call JSON, or raw task arguments).\n- When invoking tools, call them directly without preambles like \"I will now call tool X\"; only report outcomes that matter to the user.\n- Respect orchestration constraints from the user exactly: count, parallel vs sequential execution, per-agent profile, and per-agent working directory (cwd) when provided.\n- For explicit parallel orchestration requests, issue multiple independent task tool calls to match the requested agent count; do not collapse to a single subagent unless the user asks for one.\n- For explicit parallel orchestration requests, emit independent task calls in a single assistant turn whenever possible so they can be launched together.\n- Runtime note: when parallel orchestration is requested, emit independent task calls in one assistant turn so they can run concurrently; avoid background mode unless the user explicitly asks for detached async runs.\n- If orchestration constraints are ambiguous or conflict, ask one concise clarification (or use ask_user when available) before launching subagents.\n- When the user provides an <orchestrate ...>...</orchestrate> block, treat it as an execution contract and follow its mode/agents/profile/cwd assignments strictly.\n- When orchestration assignments include run_id/task_id/lock_key or depends_on, enforce them in task calls (run_id/task_id for team tracking, lock_key for serialization domains, depends_on for ordering).\n- For write-heavy parallel orchestration, prefer isolation=worktree to reduce cross-agent interference when the repository is git-backed.\n- If the user message includes @<custom-agent-name>, treat it as an explicit agent selection and call task with agent set to that custom agent name.\n\niosm-cli reference docs (use when needed):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), package composition (docs/packages.md)\n- When working on harness internals, read the relevant docs/examples before implementing`;\n\n\tif (appendSection) {\n\t\tprompt += appendSection;\n\t}\n\n\t// Append project context files\n\tif (contextFiles.length > 0) {\n\t\tprompt += \"\\n\\n# Project Context\\n\\n\";\n\t\tprompt += \"Project-specific instructions and guidelines:\\n\\n\";\n\t\tfor (const { path: filePath, content } of contextFiles) {\n\t\t\tprompt += `## ${filePath}\\n\\n${content}\\n\\n`;\n\t\t}\n\t}\n\n\t// Append skills section (only if read tool is available)\n\tif (hasRead && skills.length > 0) {\n\t\tprompt += formatSkillsForPrompt(skills);\n\t}\n\n\t// Add date/time and working directory last\n\tprompt += `\\nCurrent date and time: ${dateTime}`;\n\tprompt += `\\nCurrent working directory: ${resolvedCwd}`;\n\n\treturn prompt;\n}\n"]}
@@ -3,7 +3,7 @@ export function createAstGrepTool(cwd) {
3
3
  return createExternalCliTool(cwd, {
4
4
  name: "ast_grep",
5
5
  label: "ast-grep",
6
- description: "Run ast-grep (sg) for syntax-aware code queries. Pass CLI arguments directly (for example: [\"scan\",\"--pattern\",\"console.log($A)\",\"src\"]).",
6
+ description: "Run ast-grep (sg) for syntax-aware code queries. Pass CLI args directly. Preferred form: [\"run\",\"--pattern\",\"console.log($A)\",\"--lang\",\"javascript\",\"src\"]. If version syntax differs, retry with scan/-p equivalents.",
7
7
  commandCandidates: ["ast-grep", "sg"],
8
8
  missingInstallHint: "Install ast-grep (brew install ast-grep or npm i -g @ast-grep/cli).",
9
9
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ast-grep.js","sourceRoot":"","sources":["../../../src/core/tools/ast-grep.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC5C,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,WAAW,EACV,mJAAmJ;QACpJ,iBAAiB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC;QACrC,kBAAkB,EAAE,qEAAqE;KACzF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type AstGrepToolInput = Static<typeof externalCliSchema>;\n\nexport function createAstGrepTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"ast_grep\",\n\t\tlabel: \"ast-grep\",\n\t\tdescription:\n\t\t\t\"Run ast-grep (sg) for syntax-aware code queries. Pass CLI arguments directly (for example: [\\\"scan\\\",\\\"--pattern\\\",\\\"console.log($A)\\\",\\\"src\\\"]).\",\n\t\tcommandCandidates: [\"ast-grep\", \"sg\"],\n\t\tmissingInstallHint: \"Install ast-grep (brew install ast-grep or npm i -g @ast-grep/cli).\",\n\t});\n}\n\nexport const astGrepTool = createAstGrepTool(process.cwd());\n"]}
1
+ {"version":3,"file":"ast-grep.js","sourceRoot":"","sources":["../../../src/core/tools/ast-grep.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC5C,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,WAAW,EACV,oOAAoO;QACrO,iBAAiB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC;QACrC,kBAAkB,EAAE,qEAAqE;KACzF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type AstGrepToolInput = Static<typeof externalCliSchema>;\n\nexport function createAstGrepTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"ast_grep\",\n\t\tlabel: \"ast-grep\",\n\t\tdescription:\n\t\t\t\"Run ast-grep (sg) for syntax-aware code queries. Pass CLI args directly. Preferred form: [\\\"run\\\",\\\"--pattern\\\",\\\"console.log($A)\\\",\\\"--lang\\\",\\\"javascript\\\",\\\"src\\\"]. If version syntax differs, retry with scan/-p equivalents.\",\n\t\tcommandCandidates: [\"ast-grep\", \"sg\"],\n\t\tmissingInstallHint: \"Install ast-grep (brew install ast-grep or npm i -g @ast-grep/cli).\",\n\t});\n}\n\nexport const astGrepTool = createAstGrepTool(process.cwd());\n"]}
@@ -3,7 +3,7 @@ export function createCombyTool(cwd) {
3
3
  return createExternalCliTool(cwd, {
4
4
  name: "comby",
5
5
  label: "comby",
6
- description: "Run comby for structural search/rewrite previews. In-place flags are blocked; use edit/write tools for actual file mutations.",
6
+ description: "Run comby for structural search/rewrite previews. Prefer explicit matcher when language is known (for example: [\"pattern\", \"rewrite\", \"-matcher\", \".python\", \"src\"]). In-place flags are blocked; use edit/write tools for actual file mutations.",
7
7
  commandCandidates: ["comby"],
8
8
  missingInstallHint: "Install comby (brew install comby).",
9
9
  forbiddenArgs: ["-i", "--in-place", "-in-place"],
@@ -1 +1 @@
1
- {"version":3,"file":"comby.js","sourceRoot":"","sources":["../../../src/core/tools/comby.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,WAAW,EACV,+HAA+H;QAChI,iBAAiB,EAAE,CAAC,OAAO,CAAC;QAC5B,kBAAkB,EAAE,qCAAqC;QACzD,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,CAAC;QAChD,oBAAoB,EAAE,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type CombyToolInput = Static<typeof externalCliSchema>;\n\nexport function createCombyTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"comby\",\n\t\tlabel: \"comby\",\n\t\tdescription:\n\t\t\t\"Run comby for structural search/rewrite previews. In-place flags are blocked; use edit/write tools for actual file mutations.\",\n\t\tcommandCandidates: [\"comby\"],\n\t\tmissingInstallHint: \"Install comby (brew install comby).\",\n\t\tforbiddenArgs: [\"-i\", \"--in-place\", \"-in-place\"],\n\t\tforbiddenArgPrefixes: [\"-i=\"],\n\t});\n}\n\nexport const combyTool = createCombyTool(process.cwd());\n"]}
1
+ {"version":3,"file":"comby.js","sourceRoot":"","sources":["../../../src/core/tools/comby.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,WAAW,EACV,6PAA6P;QAC9P,iBAAiB,EAAE,CAAC,OAAO,CAAC;QAC5B,kBAAkB,EAAE,qCAAqC;QACzD,aAAa,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,CAAC;QAChD,oBAAoB,EAAE,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type CombyToolInput = Static<typeof externalCliSchema>;\n\nexport function createCombyTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"comby\",\n\t\tlabel: \"comby\",\n\t\tdescription:\n\t\t\t\"Run comby for structural search/rewrite previews. Prefer explicit matcher when language is known (for example: [\\\"pattern\\\", \\\"rewrite\\\", \\\"-matcher\\\", \\\".python\\\", \\\"src\\\"]). In-place flags are blocked; use edit/write tools for actual file mutations.\",\n\t\tcommandCandidates: [\"comby\"],\n\t\tmissingInstallHint: \"Install comby (brew install comby).\",\n\t\tforbiddenArgs: [\"-i\", \"--in-place\", \"-in-place\"],\n\t\tforbiddenArgPrefixes: [\"-i=\"],\n\t});\n}\n\nexport const combyTool = createCombyTool(process.cwd());\n"]}
@@ -12,6 +12,7 @@ export { createReadTool, type ReadOperations, type ReadToolDetails, type ReadToo
12
12
  export { createRgTool, type RgToolInput, rgTool, } from "./rg.js";
13
13
  export { createSedTool, type SedToolInput, sedTool, } from "./sed.js";
14
14
  export { createSemgrepTool, type SemgrepToolInput, semgrepTool, } from "./semgrep.js";
15
+ export { createSemanticSearchTool, type SemanticSearchToolInput, type SemanticSearchToolOptions, semanticSearchTool, } from "./semantic-search.js";
15
16
  export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, } from "./truncate.js";
16
17
  export { createWriteTool, type WriteOperations, type WriteToolInput, type WriteToolOptions, writeTool, } from "./write.js";
17
18
  export { type ToolPermissionGuard, type ToolPermissionRequest } from "./permissions.js";
@@ -22,6 +23,7 @@ import type { AgentTool } from "@mariozechner/pi-agent-core";
22
23
  import { type BashToolOptions } from "./bash.js";
23
24
  import { type EditToolOptions } from "./edit.js";
24
25
  import { type ReadToolOptions } from "./read.js";
26
+ import { type SemanticSearchToolOptions } from "./semantic-search.js";
25
27
  import { type WriteToolOptions } from "./write.js";
26
28
  /** Tool type (AgentTool from pi-ai) */
27
29
  export type Tool = AgentTool<any>;
@@ -112,6 +114,11 @@ export declare const allTools: {
112
114
  stdin: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
113
115
  timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
114
116
  }>, any>;
117
+ semantic_search: AgentTool<import("@sinclair/typebox").TObject<{
118
+ action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"status">, import("@sinclair/typebox").TLiteral<"index">, import("@sinclair/typebox").TLiteral<"rebuild">, import("@sinclair/typebox").TLiteral<"query">]>;
119
+ query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
120
+ top_k: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
121
+ }>, any>;
115
122
  todo_write: AgentTool<import("@sinclair/typebox").TObject<{
116
123
  tasks: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
117
124
  id: import("@sinclair/typebox").TString;
@@ -133,6 +140,8 @@ export interface ToolsOptions {
133
140
  edit?: EditToolOptions;
134
141
  /** Options for the write tool */
135
142
  write?: WriteToolOptions;
143
+ /** Options for the semantic_search tool */
144
+ semantic?: SemanticSearchToolOptions;
136
145
  }
137
146
  /**
138
147
  * Create coding tools configured for a specific working directory.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,WAAW,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,KAAK,cAAc,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,YAAY,EACZ,KAAK,WAAW,EAChB,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EACZ,KAAK,WAAW,EAChB,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAA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AM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAKjG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,WAAW,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,KAAK,cAAc,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,YAAY,EACZ,KAAK,WAAW,EAChB,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EACZ,KAAK,WAAW,EAChB,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KA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AAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAgB/E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAqB1F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAKjG"}
@@ -12,6 +12,7 @@ export { createReadTool, readTool, } from "./read.js";
12
12
  export { createRgTool, rgTool, } from "./rg.js";
13
13
  export { createSedTool, sedTool, } from "./sed.js";
14
14
  export { createSemgrepTool, semgrepTool, } from "./semgrep.js";
15
+ export { createSemanticSearchTool, semanticSearchTool, } from "./semantic-search.js";
15
16
  export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, } from "./truncate.js";
16
17
  export { createWriteTool, writeTool, } from "./write.js";
17
18
  export { createTodoWriteTool, createTodoReadTool, todoWriteTool, todoReadTool, getTaskFilePath, } from "./todo.js";
@@ -30,6 +31,7 @@ import { createReadTool, readTool } from "./read.js";
30
31
  import { createRgTool, rgTool } from "./rg.js";
31
32
  import { createSedTool, sedTool } from "./sed.js";
32
33
  import { createSemgrepTool, semgrepTool } from "./semgrep.js";
34
+ import { createSemanticSearchTool, semanticSearchTool, } from "./semantic-search.js";
33
35
  import { createWriteTool, writeTool } from "./write.js";
34
36
  import { createYqTool, yqTool } from "./yq.js";
35
37
  import { todoWriteTool, todoReadTool } from "./todo.js";
@@ -49,6 +51,7 @@ export const readOnlyTools = [
49
51
  yqTool,
50
52
  semgrepTool,
51
53
  sedTool,
54
+ semanticSearchTool,
52
55
  ];
53
56
  // All available tools (using process.cwd())
54
57
  export const allTools = {
@@ -67,6 +70,7 @@ export const allTools = {
67
70
  yq: yqTool,
68
71
  semgrep: semgrepTool,
69
72
  sed: sedTool,
73
+ semantic_search: semanticSearchTool,
70
74
  todo_write: todoWriteTool,
71
75
  todo_read: todoReadTool,
72
76
  };
@@ -98,6 +102,7 @@ export function createReadOnlyTools(cwd, options) {
98
102
  createYqTool(cwd),
99
103
  createSemgrepTool(cwd),
100
104
  createSedTool(cwd),
105
+ createSemanticSearchTool(cwd, options?.semantic),
101
106
  ];
102
107
  }
103
108
  /**
@@ -120,6 +125,7 @@ export function createAllTools(cwd, options) {
120
125
  yq: createYqTool(cwd),
121
126
  semgrep: createSemgrepTool(cwd),
122
127
  sed: createSedTool(cwd),
128
+ semantic_search: createSemanticSearchTool(cwd, options?.semantic),
123
129
  todo_write: todoWriteTool,
124
130
  todo_read: todoReadTool,
125
131
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EAEjB,WAAW,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAON,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAEN,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EAIN,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,YAAY,EAKZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM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eAAe,CAAC,GAAG,CAAC;QAC3B,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC;QAC/B,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC;QACvB,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,YAAY;KACvB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAE,KAAe,EAAE,OAAsB;IACxF,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzC,OAAO,KAAK;SACV,MAAM,CAAC,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC","sourcesContent":["export {\n\tcreateAstGrepTool,\n\ttype AstGrepToolInput,\n\tastGrepTool,\n} from \"./ast-grep.js\";\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashTool,\n\tcreateBashTool,\n} from \"./bash.js\";\nexport {\n\ttype CombyToolInput,\n\tcombyTool,\n\tcreateCombyTool,\n} from \"./comby.js\";\nexport {\n\tcreateEditTool,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditTool,\n} from \"./edit.js\";\nexport {\n\ttype ExternalCliToolDetails,\n\ttype ExternalCliToolInput,\n\ttype ExternalCliToolOptions,\n\tcreateExternalCliTool,\n} from \"./external-cli.js\";\nexport {\n\tcreateFdTool,\n\ttype FdToolInput,\n\tfdTool,\n} from \"./fd.js\";\nexport {\n\tcreateFindTool,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindTool,\n} from \"./find.js\";\nexport {\n\tcreateGrepTool,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\tgrepTool,\n} from \"./grep.js\";\nexport {\n\tcreateJqTool,\n\ttype JqToolInput,\n\tjqTool,\n} from \"./jq.js\";\nexport {\n\tcreateLsTool,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsTool,\n} from \"./ls.js\";\nexport {\n\tcreateReadTool,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadTool,\n} from \"./read.js\";\nexport {\n\tcreateRgTool,\n\ttype RgToolInput,\n\trgTool,\n} from \"./rg.js\";\nexport {\n\tcreateSedTool,\n\ttype SedToolInput,\n\tsedTool,\n} from \"./sed.js\";\nexport {\n\tcreateSemgrepTool,\n\ttype SemgrepToolInput,\n\tsemgrepTool,\n} from \"./semgrep.js\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.js\";\nexport {\n\tcreateWriteTool,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twriteTool,\n} from \"./write.js\";\nexport { type ToolPermissionGuard, type ToolPermissionRequest } from \"./permissions.js\";\nexport {\n\tcreateTodoWriteTool,\n\tcreateTodoReadTool,\n\ttodoWriteTool,\n\ttodoReadTool,\n\tgetTaskFilePath,\n\ttype TodoTask,\n\ttype TodoTaskStatus,\n\ttype TodoWriteInput,\n\ttype TodoReadInput,\n} from \"./todo.js\";\nexport {\n\tcreateYqTool,\n\ttype YqToolInput,\n\tyqTool,\n} from \"./yq.js\";\nexport {\n\tcreateTaskTool,\n\ttype SubagentRunner,\n\ttype TaskToolProgress,\n\ttype TaskToolProgressPhase,\n\ttype TaskToolInput,\n\ttype TaskToolDetails,\n} from \"./task.js\";\n\nimport type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport { astGrepTool, createAstGrepTool } from \"./ast-grep.js\";\nimport { type BashToolOptions, bashTool, createBashTool } from \"./bash.js\";\nimport { combyTool, createCombyTool } from \"./comby.js\";\nimport { createEditTool, type EditToolOptions, editTool } from \"./edit.js\";\nimport { createFdTool, fdTool } from \"./fd.js\";\nimport { createFindTool, findTool } from \"./find.js\";\nimport { createGrepTool, grepTool } from \"./grep.js\";\nimport { createJqTool, jqTool } from \"./jq.js\";\nimport { createLsTool, lsTool } from \"./ls.js\";\nimport { createReadTool, type ReadToolOptions, readTool } from \"./read.js\";\nimport { createRgTool, rgTool } from \"./rg.js\";\nimport { createSedTool, sedTool } from \"./sed.js\";\nimport { createSemgrepTool, semgrepTool } from \"./semgrep.js\";\nimport { createWriteTool, type WriteToolOptions, writeTool } from \"./write.js\";\nimport { createYqTool, yqTool } from \"./yq.js\";\nimport { todoWriteTool, todoReadTool } from \"./todo.js\";\n\n/** Tool type (AgentTool from pi-ai) */\nexport type Tool = AgentTool<any>;\n\n// Default tools for full access mode (using process.cwd())\nexport const codingTools: Tool[] = [readTool, bashTool, editTool, writeTool];\n\n// Read-only tools for exploration without modification (using process.cwd())\nexport const readOnlyTools: Tool[] = [\n\treadTool,\n\tgrepTool,\n\tfindTool,\n\tlsTool,\n\trgTool,\n\tfdTool,\n\tastGrepTool,\n\tcombyTool,\n\tjqTool,\n\tyqTool,\n\tsemgrepTool,\n\tsedTool,\n];\n\n// All available tools (using process.cwd())\nexport const allTools = {\n\tread: readTool,\n\tbash: bashTool,\n\tedit: editTool,\n\twrite: writeTool,\n\tgrep: grepTool,\n\tfind: findTool,\n\tls: lsTool,\n\trg: rgTool,\n\tfd: fdTool,\n\tast_grep: astGrepTool,\n\tcomby: combyTool,\n\tjq: jqTool,\n\tyq: yqTool,\n\tsemgrep: semgrepTool,\n\tsed: sedTool,\n\ttodo_write: todoWriteTool,\n\ttodo_read: todoReadTool,\n};\n\nexport type ToolName = keyof typeof allTools;\n\nexport interface ToolsOptions {\n\t/** Options for the read tool */\n\tread?: ReadToolOptions;\n\t/** Options for the bash tool */\n\tbash?: BashToolOptions;\n\t/** Options for the edit tool */\n\tedit?: EditToolOptions;\n\t/** Options for the write tool */\n\twrite?: WriteToolOptions;\n}\n\n/**\n * Create coding tools configured for a specific working directory.\n */\nexport function createCodingTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateBashTool(cwd, options?.bash),\n\t\tcreateEditTool(cwd, options?.edit),\n\t\tcreateWriteTool(cwd, options?.write),\n\t];\n}\n\n/**\n * Create read-only tools configured for a specific working directory.\n */\nexport function createReadOnlyTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateGrepTool(cwd),\n\t\tcreateFindTool(cwd),\n\t\tcreateLsTool(cwd),\n\t\tcreateRgTool(cwd),\n\t\tcreateFdTool(cwd),\n\t\tcreateAstGrepTool(cwd),\n\t\tcreateCombyTool(cwd),\n\t\tcreateJqTool(cwd),\n\t\tcreateYqTool(cwd),\n\t\tcreateSemgrepTool(cwd),\n\t\tcreateSedTool(cwd),\n\t];\n}\n\n/**\n * Create all tools configured for a specific working directory.\n */\nexport function createAllTools(cwd: string, options?: ToolsOptions): Record<ToolName, Tool> {\n\treturn {\n\t\tread: createReadTool(cwd, options?.read),\n\t\tbash: createBashTool(cwd, options?.bash),\n\t\tedit: createEditTool(cwd, options?.edit),\n\t\twrite: createWriteTool(cwd, options?.write),\n\t\tgrep: createGrepTool(cwd),\n\t\tfind: createFindTool(cwd),\n\t\tls: createLsTool(cwd),\n\t\trg: createRgTool(cwd),\n\t\tfd: createFdTool(cwd),\n\t\tast_grep: createAstGrepTool(cwd),\n\t\tcomby: createCombyTool(cwd),\n\t\tjq: createJqTool(cwd),\n\t\tyq: createYqTool(cwd),\n\t\tsemgrep: createSemgrepTool(cwd),\n\t\tsed: createSedTool(cwd),\n\t\ttodo_write: todoWriteTool,\n\t\ttodo_read: todoReadTool,\n\t};\n}\n\n/**\n * Create a filtered set of tools from a list of tool names.\n * Used by agent profiles and the Task tool to configure subagent capabilities.\n */\nexport function createToolsFromNames(cwd: string, names: string[], options?: ToolsOptions): Tool[] {\n\tconst all = createAllTools(cwd, options);\n\treturn names\n\t\t.filter((n): n is ToolName => n in all)\n\t\t.map((n) => all[n]);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EAEjB,WAAW,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAON,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAEN,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EAIN,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,YAAY,EAKZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EAKd,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EAEZ,MAAM,GACN,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,aAAa,EAEb,OAAO,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,iBAAiB,EAEjB,WAAW,GAC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CAAC,GAAG,CAAC;QACrB,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC;QAChC,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC;QAC3B,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC;QAC/B,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC;QACvB,eAAe,EAAE,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC;QACjE,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,YAAY;KACvB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAE,KAAe,EAAE,OAAsB;IACxF,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzC,OAAO,KAAK;SACV,MAAM,CAAC,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC","sourcesContent":["export {\n\tcreateAstGrepTool,\n\ttype AstGrepToolInput,\n\tastGrepTool,\n} from \"./ast-grep.js\";\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashTool,\n\tcreateBashTool,\n} from \"./bash.js\";\nexport {\n\ttype CombyToolInput,\n\tcombyTool,\n\tcreateCombyTool,\n} from \"./comby.js\";\nexport {\n\tcreateEditTool,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditTool,\n} from \"./edit.js\";\nexport {\n\ttype ExternalCliToolDetails,\n\ttype ExternalCliToolInput,\n\ttype ExternalCliToolOptions,\n\tcreateExternalCliTool,\n} from \"./external-cli.js\";\nexport {\n\tcreateFdTool,\n\ttype FdToolInput,\n\tfdTool,\n} from \"./fd.js\";\nexport {\n\tcreateFindTool,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindTool,\n} from \"./find.js\";\nexport {\n\tcreateGrepTool,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\tgrepTool,\n} from \"./grep.js\";\nexport {\n\tcreateJqTool,\n\ttype JqToolInput,\n\tjqTool,\n} from \"./jq.js\";\nexport {\n\tcreateLsTool,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsTool,\n} from \"./ls.js\";\nexport {\n\tcreateReadTool,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadTool,\n} from \"./read.js\";\nexport {\n\tcreateRgTool,\n\ttype RgToolInput,\n\trgTool,\n} from \"./rg.js\";\nexport {\n\tcreateSedTool,\n\ttype SedToolInput,\n\tsedTool,\n} from \"./sed.js\";\nexport {\n\tcreateSemgrepTool,\n\ttype SemgrepToolInput,\n\tsemgrepTool,\n} from \"./semgrep.js\";\nexport {\n\tcreateSemanticSearchTool,\n\ttype SemanticSearchToolInput,\n\ttype SemanticSearchToolOptions,\n\tsemanticSearchTool,\n} from \"./semantic-search.js\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.js\";\nexport {\n\tcreateWriteTool,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twriteTool,\n} from \"./write.js\";\nexport { type ToolPermissionGuard, type ToolPermissionRequest } from \"./permissions.js\";\nexport {\n\tcreateTodoWriteTool,\n\tcreateTodoReadTool,\n\ttodoWriteTool,\n\ttodoReadTool,\n\tgetTaskFilePath,\n\ttype TodoTask,\n\ttype TodoTaskStatus,\n\ttype TodoWriteInput,\n\ttype TodoReadInput,\n} from \"./todo.js\";\nexport {\n\tcreateYqTool,\n\ttype YqToolInput,\n\tyqTool,\n} from \"./yq.js\";\nexport {\n\tcreateTaskTool,\n\ttype SubagentRunner,\n\ttype TaskToolProgress,\n\ttype TaskToolProgressPhase,\n\ttype TaskToolInput,\n\ttype TaskToolDetails,\n} from \"./task.js\";\n\nimport type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport { astGrepTool, createAstGrepTool } from \"./ast-grep.js\";\nimport { type BashToolOptions, bashTool, createBashTool } from \"./bash.js\";\nimport { combyTool, createCombyTool } from \"./comby.js\";\nimport { createEditTool, type EditToolOptions, editTool } from \"./edit.js\";\nimport { createFdTool, fdTool } from \"./fd.js\";\nimport { createFindTool, findTool } from \"./find.js\";\nimport { createGrepTool, grepTool } from \"./grep.js\";\nimport { createJqTool, jqTool } from \"./jq.js\";\nimport { createLsTool, lsTool } from \"./ls.js\";\nimport { createReadTool, type ReadToolOptions, readTool } from \"./read.js\";\nimport { createRgTool, rgTool } from \"./rg.js\";\nimport { createSedTool, sedTool } from \"./sed.js\";\nimport { createSemgrepTool, semgrepTool } from \"./semgrep.js\";\nimport {\n\tcreateSemanticSearchTool,\n\ttype SemanticSearchToolOptions,\n\tsemanticSearchTool,\n} from \"./semantic-search.js\";\nimport { createWriteTool, type WriteToolOptions, writeTool } from \"./write.js\";\nimport { createYqTool, yqTool } from \"./yq.js\";\nimport { todoWriteTool, todoReadTool } from \"./todo.js\";\n\n/** Tool type (AgentTool from pi-ai) */\nexport type Tool = AgentTool<any>;\n\n// Default tools for full access mode (using process.cwd())\nexport const codingTools: Tool[] = [readTool, bashTool, editTool, writeTool];\n\n// Read-only tools for exploration without modification (using process.cwd())\nexport const readOnlyTools: Tool[] = [\n\treadTool,\n\tgrepTool,\n\tfindTool,\n\tlsTool,\n\trgTool,\n\tfdTool,\n\tastGrepTool,\n\tcombyTool,\n\tjqTool,\n\tyqTool,\n\tsemgrepTool,\n\tsedTool,\n\tsemanticSearchTool,\n];\n\n// All available tools (using process.cwd())\nexport const allTools = {\n\tread: readTool,\n\tbash: bashTool,\n\tedit: editTool,\n\twrite: writeTool,\n\tgrep: grepTool,\n\tfind: findTool,\n\tls: lsTool,\n\trg: rgTool,\n\tfd: fdTool,\n\tast_grep: astGrepTool,\n\tcomby: combyTool,\n\tjq: jqTool,\n\tyq: yqTool,\n\tsemgrep: semgrepTool,\n\tsed: sedTool,\n\tsemantic_search: semanticSearchTool,\n\ttodo_write: todoWriteTool,\n\ttodo_read: todoReadTool,\n};\n\nexport type ToolName = keyof typeof allTools;\n\nexport interface ToolsOptions {\n\t/** Options for the read tool */\n\tread?: ReadToolOptions;\n\t/** Options for the bash tool */\n\tbash?: BashToolOptions;\n\t/** Options for the edit tool */\n\tedit?: EditToolOptions;\n\t/** Options for the write tool */\n\twrite?: WriteToolOptions;\n\t/** Options for the semantic_search tool */\n\tsemantic?: SemanticSearchToolOptions;\n}\n\n/**\n * Create coding tools configured for a specific working directory.\n */\nexport function createCodingTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateBashTool(cwd, options?.bash),\n\t\tcreateEditTool(cwd, options?.edit),\n\t\tcreateWriteTool(cwd, options?.write),\n\t];\n}\n\n/**\n * Create read-only tools configured for a specific working directory.\n */\nexport function createReadOnlyTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateGrepTool(cwd),\n\t\tcreateFindTool(cwd),\n\t\tcreateLsTool(cwd),\n\t\tcreateRgTool(cwd),\n\t\tcreateFdTool(cwd),\n\t\tcreateAstGrepTool(cwd),\n\t\tcreateCombyTool(cwd),\n\t\tcreateJqTool(cwd),\n\t\tcreateYqTool(cwd),\n\t\tcreateSemgrepTool(cwd),\n\t\tcreateSedTool(cwd),\n\t\tcreateSemanticSearchTool(cwd, options?.semantic),\n\t];\n}\n\n/**\n * Create all tools configured for a specific working directory.\n */\nexport function createAllTools(cwd: string, options?: ToolsOptions): Record<ToolName, Tool> {\n\treturn {\n\t\tread: createReadTool(cwd, options?.read),\n\t\tbash: createBashTool(cwd, options?.bash),\n\t\tedit: createEditTool(cwd, options?.edit),\n\t\twrite: createWriteTool(cwd, options?.write),\n\t\tgrep: createGrepTool(cwd),\n\t\tfind: createFindTool(cwd),\n\t\tls: createLsTool(cwd),\n\t\trg: createRgTool(cwd),\n\t\tfd: createFdTool(cwd),\n\t\tast_grep: createAstGrepTool(cwd),\n\t\tcomby: createCombyTool(cwd),\n\t\tjq: createJqTool(cwd),\n\t\tyq: createYqTool(cwd),\n\t\tsemgrep: createSemgrepTool(cwd),\n\t\tsed: createSedTool(cwd),\n\t\tsemantic_search: createSemanticSearchTool(cwd, options?.semantic),\n\t\ttodo_write: todoWriteTool,\n\t\ttodo_read: todoReadTool,\n\t};\n}\n\n/**\n * Create a filtered set of tools from a list of tool names.\n * Used by agent profiles and the Task tool to configure subagent capabilities.\n */\nexport function createToolsFromNames(cwd: string, names: string[], options?: ToolsOptions): Tool[] {\n\tconst all = createAllTools(cwd, options);\n\treturn names\n\t\t.filter((n): n is ToolName => n in all)\n\t\t.map((n) => all[n]);\n}\n"]}
@@ -3,7 +3,7 @@ export function createRgTool(cwd) {
3
3
  return createExternalCliTool(cwd, {
4
4
  name: "rg",
5
5
  label: "rg",
6
- description: "Run ripgrep directly for advanced regex search. Args are passed directly to rg (no shell interpolation). Exit code 1 (no matches) is treated as success.",
6
+ description: "Run ripgrep directly for advanced regex search. Args are passed directly to rg (no shell interpolation). Prefer explicit path args (for example: [\"-n\",\"--hidden\",\"score\",\".\"]). Exit code 1 (no matches) is treated as success.",
7
7
  commandCandidates: ["rg"],
8
8
  ensureManagedTool: "rg",
9
9
  allowExitCodes: [0, 1],
@@ -1 +1 @@
1
- {"version":3,"file":"rg.js","sourceRoot":"","sources":["../../../src/core/tools/rg.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI;QACX,WAAW,EACV,0JAA0J;QAC3J,iBAAiB,EAAE,CAAC,IAAI,CAAC;QACzB,iBAAiB,EAAE,IAAI;QACvB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACtB,kBAAkB,EAAE,kBAAkB;QACtC,kBAAkB,EAAE,sEAAsE;KAC1F,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type RgToolInput = Static<typeof externalCliSchema>;\n\nexport function createRgTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"rg\",\n\t\tlabel: \"rg\",\n\t\tdescription:\n\t\t\t\"Run ripgrep directly for advanced regex search. Args are passed directly to rg (no shell interpolation). Exit code 1 (no matches) is treated as success.\",\n\t\tcommandCandidates: [\"rg\"],\n\t\tensureManagedTool: \"rg\",\n\t\tallowExitCodes: [0, 1],\n\t\temptyOutputMessage: \"No matches found\",\n\t\tmissingInstallHint: \"Install ripgrep (rg) or allow iosm-cli to download managed binaries.\",\n\t});\n}\n\nexport const rgTool = createRgTool(process.cwd());\n"]}
1
+ {"version":3,"file":"rg.js","sourceRoot":"","sources":["../../../src/core/tools/rg.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAqB,MAAM,mBAAmB,CAAC;AAI7E,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,OAAO,qBAAqB,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI;QACX,WAAW,EACV,0OAA0O;QAC3O,iBAAiB,EAAE,CAAC,IAAI,CAAC;QACzB,iBAAiB,EAAE,IAAI;QACvB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACtB,kBAAkB,EAAE,kBAAkB;QACtC,kBAAkB,EAAE,sEAAsE;KAC1F,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport type { Static } from \"@sinclair/typebox\";\nimport { createExternalCliTool, externalCliSchema } from \"./external-cli.js\";\n\nexport type RgToolInput = Static<typeof externalCliSchema>;\n\nexport function createRgTool(cwd: string): AgentTool<typeof externalCliSchema> {\n\treturn createExternalCliTool(cwd, {\n\t\tname: \"rg\",\n\t\tlabel: \"rg\",\n\t\tdescription:\n\t\t\t\"Run ripgrep directly for advanced regex search. Args are passed directly to rg (no shell interpolation). Prefer explicit path args (for example: [\\\"-n\\\",\\\"--hidden\\\",\\\"score\\\",\\\".\\\"]). Exit code 1 (no matches) is treated as success.\",\n\t\tcommandCandidates: [\"rg\"],\n\t\tensureManagedTool: \"rg\",\n\t\tallowExitCodes: [0, 1],\n\t\temptyOutputMessage: \"No matches found\",\n\t\tmissingInstallHint: \"Install ripgrep (rg) or allow iosm-cli to download managed binaries.\",\n\t});\n}\n\nexport const rgTool = createRgTool(process.cwd());\n"]}
@@ -0,0 +1,21 @@
1
+ import type { AgentTool } from "@mariozechner/pi-agent-core";
2
+ import { type Static } from "@sinclair/typebox";
3
+ import type { AuthStorage } from "../auth-storage.js";
4
+ declare const semanticSearchSchema: import("@sinclair/typebox").TObject<{
5
+ action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"status">, import("@sinclair/typebox").TLiteral<"index">, import("@sinclair/typebox").TLiteral<"rebuild">, import("@sinclair/typebox").TLiteral<"query">]>;
6
+ query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
7
+ top_k: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
8
+ }>;
9
+ export type SemanticSearchToolInput = Static<typeof semanticSearchSchema>;
10
+ export interface SemanticSearchToolOptions {
11
+ agentDir?: string;
12
+ authStorage?: AuthStorage;
13
+ }
14
+ export declare function createSemanticSearchTool(cwd: string, options?: SemanticSearchToolOptions): AgentTool<typeof semanticSearchSchema>;
15
+ export declare const semanticSearchTool: AgentTool<import("@sinclair/typebox").TObject<{
16
+ action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"status">, import("@sinclair/typebox").TLiteral<"index">, import("@sinclair/typebox").TLiteral<"rebuild">, import("@sinclair/typebox").TLiteral<"query">]>;
17
+ query: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
18
+ top_k: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
19
+ }>, any>;
20
+ export {};
21
+ //# sourceMappingURL=semantic-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-search.d.ts","sourceRoot":"","sources":["../../../src/core/tools/semantic-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAStD,QAAA,MAAM,oBAAoB;;;;EAsBxB,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE1E,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B;AAqED,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,yBAAyB,GACjC,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAoCxC;AAED,eAAO,MAAM,kBAAkB;;;;QAA0C,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { getAgentDir } from "../../config.js";
3
+ import { SemanticSearchRuntime } from "../semantic/runtime.js";
4
+ const semanticSearchSchema = Type.Object({
5
+ action: Type.Union([
6
+ Type.Literal("status"),
7
+ Type.Literal("index"),
8
+ Type.Literal("rebuild"),
9
+ Type.Literal("query"),
10
+ ], { description: "Semantic action: status | index | rebuild | query" }),
11
+ query: Type.Optional(Type.String({
12
+ description: "Query text (required when action=query)",
13
+ })),
14
+ top_k: Type.Optional(Type.Number({
15
+ minimum: 1,
16
+ maximum: 20,
17
+ description: "Maximum number of query hits to return (default: 8, max: 20)",
18
+ })),
19
+ });
20
+ function formatSemanticStatus(result) {
21
+ const lines = [
22
+ `configured: ${result.configured ? "yes" : "no"}`,
23
+ `enabled: ${result.enabled ? "yes" : "no"}`,
24
+ `auto_index: ${result.autoIndex ? "on" : "off"}`,
25
+ `indexed: ${result.indexed ? "yes" : "no"}`,
26
+ `stale: ${result.stale ? `yes${result.staleReason ? ` (${result.staleReason})` : ""}` : "no"}`,
27
+ ];
28
+ if (result.provider)
29
+ lines.push(`provider: ${result.provider}`);
30
+ if (result.model)
31
+ lines.push(`model: ${result.model}`);
32
+ lines.push(`files: ${result.files}`);
33
+ lines.push(`chunks: ${result.chunks}`);
34
+ if (result.dimension !== undefined)
35
+ lines.push(`dimension: ${result.dimension}`);
36
+ if (result.ageSeconds !== undefined)
37
+ lines.push(`age_seconds: ${result.ageSeconds}`);
38
+ lines.push(`index_path: ${result.indexPath}`);
39
+ lines.push(`config_user: ${result.configPathUser}`);
40
+ lines.push(`config_project: ${result.configPathProject}`);
41
+ if (!result.configured) {
42
+ lines.push("hint: run /semantic setup, then /semantic index");
43
+ }
44
+ return lines.join("\n");
45
+ }
46
+ function formatSemanticIndexResult(result) {
47
+ return [
48
+ `action: ${result.action}`,
49
+ `processed_files: ${result.processedFiles}`,
50
+ `reused_files: ${result.reusedFiles}`,
51
+ `new_files: ${result.newFiles}`,
52
+ `changed_files: ${result.changedFiles}`,
53
+ `removed_files: ${result.removedFiles}`,
54
+ `chunks: ${result.chunks}`,
55
+ `dimension: ${result.dimension}`,
56
+ `duration_ms: ${result.durationMs}`,
57
+ `built_at: ${result.builtAt}`,
58
+ `index_path: ${result.indexPath}`,
59
+ ].join("\n");
60
+ }
61
+ function formatSemanticQueryResult(result) {
62
+ const lines = [
63
+ `query: ${result.query}`,
64
+ `top_k: ${result.topK}`,
65
+ `auto_refreshed: ${result.autoRefreshed ? "yes" : "no"}`,
66
+ ];
67
+ if (result.hits.length === 0) {
68
+ lines.push("hits: none");
69
+ return lines.join("\n");
70
+ }
71
+ lines.push("hits:");
72
+ for (let index = 0; index < result.hits.length; index++) {
73
+ const hit = result.hits[index];
74
+ lines.push(`${index + 1}. score=${hit.score.toFixed(4)} ${hit.path}:${hit.lineStart}-${hit.lineEnd} | ${hit.snippet}`);
75
+ }
76
+ return lines.join("\n");
77
+ }
78
+ function formatSemanticToolResult(result) {
79
+ if (result.action === "status")
80
+ return formatSemanticStatus(result);
81
+ if (result.action === "query")
82
+ return formatSemanticQueryResult(result);
83
+ return formatSemanticIndexResult(result);
84
+ }
85
+ export function createSemanticSearchTool(cwd, options) {
86
+ return {
87
+ name: "semantic_search",
88
+ label: "semantic_search",
89
+ description: "Semantic code search with embeddings. Actions: status/index/rebuild/query. Query supports top_k (default 8, max 20).",
90
+ parameters: semanticSearchSchema,
91
+ execute: async (_toolCallId, params, _signal) => {
92
+ const input = params;
93
+ const runtime = new SemanticSearchRuntime({
94
+ cwd,
95
+ agentDir: options?.agentDir ?? getAgentDir(),
96
+ authStorage: options?.authStorage,
97
+ });
98
+ let result;
99
+ if (input.action === "status") {
100
+ result = await runtime.status();
101
+ }
102
+ else if (input.action === "index") {
103
+ result = await runtime.index();
104
+ }
105
+ else if (input.action === "rebuild") {
106
+ result = await runtime.rebuild();
107
+ }
108
+ else {
109
+ const query = (input.query ?? "").trim();
110
+ if (!query) {
111
+ throw new Error("semantic_search query action requires a non-empty query");
112
+ }
113
+ result = await runtime.query(query, input.top_k);
114
+ }
115
+ return {
116
+ content: [{ type: "text", text: formatSemanticToolResult(result) }],
117
+ details: result,
118
+ };
119
+ },
120
+ };
121
+ }
122
+ export const semanticSearchTool = createSemanticSearchTool(process.cwd());
123
+ //# sourceMappingURL=semantic-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-search.js","sourceRoot":"","sources":["../../../src/core/tools/semantic-search.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAQ/D,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,IAAI,CAAC,KAAK,CACjB;QACC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;KACrB,EACD,EAAE,WAAW,EAAE,mDAAmD,EAAE,CACpE;IACD,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,MAAM,CAAC;QACX,WAAW,EAAE,yCAAyC;KACtD,CAAC,CACF;IACD,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,CAAC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ACzC,GAAG;gBACH,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE;gBAC5C,WAAW,EAAE,OAAO,EAAE,WAAW;aACjC,CAAC,CAAC;YAEH,IAAI,MAA0B,CAAC;YAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC/B,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;YACjC,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBACrC,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YAChC,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACvC,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACP,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBACzC,IAAI,CAAC,KAAK,EAAE,CAAC;oBACZ,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;gBAC5E,CAAC;gBACD,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YAClD,CAAC;YAED,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC5E,OAAO,EAAE,MAAM;aACf,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@mariozechner/pi-agent-core\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { getAgentDir } from \"../../config.js\";\nimport type { AuthStorage } from \"../auth-storage.js\";\nimport { SemanticSearchRuntime } from \"../semantic/runtime.js\";\nimport type {\n\tSemanticIndexOperationResult,\n\tSemanticQueryResult,\n\tSemanticStatusResult,\n\tSemanticToolResult,\n} from \"../semantic/types.js\";\n\nconst semanticSearchSchema = Type.Object({\n\taction: Type.Union(\n\t\t[\n\t\t\tType.Literal(\"status\"),\n\t\t\tType.Literal(\"index\"),\n\t\t\tType.Literal(\"rebuild\"),\n\t\t\tType.Literal(\"query\"),\n\t\t],\n\t\t{ description: \"Semantic action: status | index | rebuild | query\" },\n\t),\n\tquery: Type.Optional(\n\t\tType.String({\n\t\t\tdescription: \"Query text (required when action=query)\",\n\t\t}),\n\t),\n\ttop_k: Type.Optional(\n\t\tType.Number({\n\t\t\tminimum: 1,\n\t\t\tmaximum: 20,\n\t\t\tdescription: \"Maximum number of query hits to return (default: 8, max: 20)\",\n\t\t}),\n\t),\n});\n\nexport type SemanticSearchToolInput = Static<typeof semanticSearchSchema>;\n\nexport interface SemanticSearchToolOptions {\n\tagentDir?: string;\n\tauthStorage?: AuthStorage;\n}\n\nfunction formatSemanticStatus(result: SemanticStatusResult): string {\n\tconst lines = [\n\t\t`configured: ${result.configured ? \"yes\" : \"no\"}`,\n\t\t`enabled: ${result.enabled ? \"yes\" : \"no\"}`,\n\t\t`auto_index: ${result.autoIndex ? \"on\" : \"off\"}`,\n\t\t`indexed: ${result.indexed ? \"yes\" : \"no\"}`,\n\t\t`stale: ${result.stale ? `yes${result.staleReason ? ` (${result.staleReason})` : \"\"}` : \"no\"}`,\n\t];\n\tif (result.provider) lines.push(`provider: ${result.provider}`);\n\tif (result.model) lines.push(`model: ${result.model}`);\n\tlines.push(`files: ${result.files}`);\n\tlines.push(`chunks: ${result.chunks}`);\n\tif (result.dimension !== undefined) lines.push(`dimension: ${result.dimension}`);\n\tif (result.ageSeconds !== undefined) lines.push(`age_seconds: ${result.ageSeconds}`);\n\tlines.push(`index_path: ${result.indexPath}`);\n\tlines.push(`config_user: ${result.configPathUser}`);\n\tlines.push(`config_project: ${result.configPathProject}`);\n\tif (!result.configured) {\n\t\tlines.push(\"hint: run /semantic setup, then /semantic index\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n\nfunction formatSemanticIndexResult(result: SemanticIndexOperationResult): string {\n\treturn [\n\t\t`action: ${result.action}`,\n\t\t`processed_files: ${result.processedFiles}`,\n\t\t`reused_files: ${result.reusedFiles}`,\n\t\t`new_files: ${result.newFiles}`,\n\t\t`changed_files: ${result.changedFiles}`,\n\t\t`removed_files: ${result.removedFiles}`,\n\t\t`chunks: ${result.chunks}`,\n\t\t`dimension: ${result.dimension}`,\n\t\t`duration_ms: ${result.durationMs}`,\n\t\t`built_at: ${result.builtAt}`,\n\t\t`index_path: ${result.indexPath}`,\n\t].join(\"\\n\");\n}\n\nfunction formatSemanticQueryResult(result: SemanticQueryResult): string {\n\tconst lines = [\n\t\t`query: ${result.query}`,\n\t\t`top_k: ${result.topK}`,\n\t\t`auto_refreshed: ${result.autoRefreshed ? \"yes\" : \"no\"}`,\n\t];\n\n\tif (result.hits.length === 0) {\n\t\tlines.push(\"hits: none\");\n\t\treturn lines.join(\"\\n\");\n\t}\n\n\tlines.push(\"hits:\");\n\tfor (let index = 0; index < result.hits.length; index++) {\n\t\tconst hit = result.hits[index]!;\n\t\tlines.push(\n\t\t\t`${index + 1}. score=${hit.score.toFixed(4)} ${hit.path}:${hit.lineStart}-${hit.lineEnd} | ${hit.snippet}`,\n\t\t);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\nfunction formatSemanticToolResult(result: SemanticToolResult): string {\n\tif (result.action === \"status\") return formatSemanticStatus(result);\n\tif (result.action === \"query\") return formatSemanticQueryResult(result);\n\treturn formatSemanticIndexResult(result);\n}\n\nexport function createSemanticSearchTool(\n\tcwd: string,\n\toptions?: SemanticSearchToolOptions,\n): AgentTool<typeof semanticSearchSchema> {\n\treturn {\n\t\tname: \"semantic_search\",\n\t\tlabel: \"semantic_search\",\n\t\tdescription:\n\t\t\t\"Semantic code search with embeddings. Actions: status/index/rebuild/query. Query supports top_k (default 8, max 20).\",\n\t\tparameters: semanticSearchSchema,\n\t\texecute: async (_toolCallId: string, params: unknown, _signal?: AbortSignal) => {\n\t\t\tconst input = params as SemanticSearchToolInput;\n\t\t\tconst runtime = new SemanticSearchRuntime({\n\t\t\t\tcwd,\n\t\t\t\tagentDir: options?.agentDir ?? getAgentDir(),\n\t\t\t\tauthStorage: options?.authStorage,\n\t\t\t});\n\n\t\t\tlet result: SemanticToolResult;\n\t\t\tif (input.action === \"status\") {\n\t\t\t\tresult = await runtime.status();\n\t\t\t} else if (input.action === \"index\") {\n\t\t\t\tresult = await runtime.index();\n\t\t\t} else if (input.action === \"rebuild\") {\n\t\t\t\tresult = await runtime.rebuild();\n\t\t\t} else {\n\t\t\t\tconst query = (input.query ?? \"\").trim();\n\t\t\t\tif (!query) {\n\t\t\t\t\tthrow new Error(\"semantic_search query action requires a non-empty query\");\n\t\t\t\t}\n\t\t\t\tresult = await runtime.query(query, input.top_k);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontent: [{ type: \"text\" as const, text: formatSemanticToolResult(result) }],\n\t\t\t\tdetails: result,\n\t\t\t};\n\t\t},\n\t};\n}\n\nexport const semanticSearchTool = createSemanticSearchTool(process.cwd());\n"]}
package/dist/index.d.ts CHANGED
@@ -14,11 +14,13 @@ export type { PackageManager, PathMetadata, ProgressCallback, ProgressEvent, Res
14
14
  export { DefaultPackageManager } from "./core/package-manager.js";
15
15
  export type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from "./core/resource-loader.js";
16
16
  export { DefaultResourceLoader } from "./core/resource-loader.js";
17
- export { type CreateAgentSessionOptions, type CreateAgentSessionResult, createAgentSession, createAskUserTool, createBashTool, createCodingTools, createCombyTool, createEditTool, createFdTool, createFindTool, createGrepTool, createJqTool, createLsTool, createReadOnlyTools, createReadTool, createRgTool, createSedTool, createSemgrepTool, createAstGrepTool, createWriteTool, createYqTool, type PromptTemplate, readOnlyTools, } from "./core/sdk.js";
17
+ export { type CreateAgentSessionOptions, type CreateAgentSessionResult, createAgentSession, createAskUserTool, createBashTool, createCodingTools, createCombyTool, createEditTool, createFdTool, createFindTool, createGrepTool, createJqTool, createLsTool, createReadOnlyTools, createReadTool, createRgTool, createSedTool, createSemanticSearchTool, createSemgrepTool, createAstGrepTool, createWriteTool, createYqTool, type PromptTemplate, readOnlyTools, } from "./core/sdk.js";
18
18
  export { type BranchSummaryEntry, buildSessionContext, type CompactionEntry, CURRENT_SESSION_VERSION, type CustomEntry, type CustomMessageEntry, type FileEntry, getLatestCompactionEntry, type ModelChangeEntry, migrateSessionEntries, type NewSessionOptions, parseSessionEntries, type SessionContext, type SessionEntry, type SessionEntryBase, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type ThinkingLevelChangeEntry, } from "./core/session-manager.js";
19
19
  export { type CompactionSettings, type ImageSettings, type PackageSource, type RetrySettings, SettingsManager, } from "./core/settings-manager.js";
20
20
  export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.js";
21
- export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, type CombyToolInput, type AstGrepToolInput, type ExternalCliToolDetails, type ExternalCliToolInput, type ExternalCliToolOptions, type FdToolInput, type JqToolInput, type RgToolInput, type SedToolInput, type SemgrepToolInput, type YqToolInput, astGrepTool, bashTool, codingTools, combyTool, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, editTool, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, fdTool, findTool, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, grepTool, jqTool, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, lsTool, rgTool, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, readTool, sedTool, semgrepTool, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, writeTool, yqTool, createExternalCliTool, } from "./core/tools/index.js";
21
+ export { type SemanticSearchToolInput, type SemanticSearchToolOptions, type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, type CombyToolInput, type AstGrepToolInput, type ExternalCliToolDetails, type ExternalCliToolInput, type ExternalCliToolOptions, type FdToolInput, type JqToolInput, type RgToolInput, type SedToolInput, type SemgrepToolInput, type YqToolInput, astGrepTool, bashTool, codingTools, combyTool, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, editTool, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, fdTool, findTool, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, grepTool, jqTool, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, lsTool, rgTool, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, readTool, sedTool, semanticSearchTool, semgrepTool, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, writeTool, yqTool, createExternalCliTool, } from "./core/tools/index.js";
22
+ export type { SemanticAction, SemanticConfigFile, SemanticIndexConfig, SemanticIndexMeta, SemanticIndexOperationResult, SemanticMergedConfig, SemanticProviderConfig, SemanticProviderType, SemanticQueryHit, SemanticQueryResult, SemanticScope, SemanticScopedLoadResult, SemanticSearchConfig, SemanticStatusResult, SemanticStaleReason, SemanticToolResult, } from "./core/semantic/index.js";
23
+ export { SemanticConfigError, SemanticConfigMissingError, SemanticRebuildRequiredError, SemanticSearchRuntime, createSemanticEmbeddingProvider, getDefaultSemanticSearchConfig, getSemanticConfigPath, getSemanticIndexDir, getSemanticIndexFiles, getSemanticIndexesDir, getSemanticProjectHash, getSemanticRootDir, loadMergedSemanticConfig, loadSemanticIndex, readScopedSemanticConfig, upsertScopedSemanticSearchConfig, writeScopedSemanticConfig, writeSemanticIndex, clearSemanticIndex, } from "./core/semantic/index.js";
22
24
  export { main } from "./main.js";
23
25
  export { InteractiveMode, type InteractiveModeOptions, type PrintModeOptions, runPrintMode, runRpcMode, } from "./modes/index.js";
24
26
  export { ArminComponent, AssistantMessageComponent, appKey, appKeyHint, BashExecutionComponent, BorderedLoader, BranchSummaryMessageComponent, CompactionSummaryMessageComponent, CustomEditor, CustomMessageComponent, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionSelectorComponent, editorKey, FooterComponent, keyHint, LoginDialogComponent, McpSelectorComponent, ModelSelectorComponent, OAuthSelectorComponent, type McpSelectorCallbacks, type RenderDiffOptions, rawKeyHint, renderDiff, SessionSelectorComponent, type SettingsCallbacks, type SettingsConfig, SettingsSelectorComponent, ShowImagesSelectorComponent, SkillInvocationMessageComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, type ToolExecutionOptions, TreeSelectorComponent, truncateToVisualLines, UserMessageComponent, UserMessageSelectorComponent, type VisualTruncateResult, } from "./modes/interactive/components/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,kBAAkB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,eAA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AAY,EACZ,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,kBAAkB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,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K,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,8BAA8B,EAC9B,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ export {
18
18
  // Factory
19
19
  createAgentSession, createAskUserTool, createBashTool,
20
20
  // Tool factories (for custom cwd)
21
- createCodingTools, createCombyTool, createEditTool, createFdTool, createFindTool, createGrepTool, createJqTool, createLsTool, createReadOnlyTools, createReadTool, createRgTool, createSedTool, createSemgrepTool, createAstGrepTool, createWriteTool, createYqTool,
21
+ createCodingTools, createCombyTool, createEditTool, createFdTool, createFindTool, createGrepTool, createJqTool, createLsTool, createReadOnlyTools, createReadTool, createRgTool, createSedTool, createSemanticSearchTool, createSemgrepTool, createAstGrepTool, createWriteTool, createYqTool,
22
22
  // Pre-built tools (use process.cwd())
23
23
  readOnlyTools, } from "./core/sdk.js";
24
24
  export { buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, migrateSessionEntries, parseSessionEntries, SessionManager, } from "./core/session-manager.js";
@@ -26,7 +26,8 @@ export { SettingsManager, } from "./core/settings-manager.js";
26
26
  // Skills
27
27
  export { formatSkillsForPrompt, loadSkills, loadSkillsFromDir, } from "./core/skills.js";
28
28
  // Tools
29
- export { astGrepTool, bashTool, codingTools, combyTool, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, editTool, fdTool, findTool, formatSize, grepTool, jqTool, lsTool, rgTool, readTool, sedTool, semgrepTool, truncateHead, truncateLine, truncateTail, writeTool, yqTool, createExternalCliTool, } from "./core/tools/index.js";
29
+ export { astGrepTool, bashTool, codingTools, combyTool, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, editTool, fdTool, findTool, formatSize, grepTool, jqTool, lsTool, rgTool, readTool, sedTool, semanticSearchTool, semgrepTool, truncateHead, truncateLine, truncateTail, writeTool, yqTool, createExternalCliTool, } from "./core/tools/index.js";
30
+ export { SemanticConfigError, SemanticConfigMissingError, SemanticRebuildRequiredError, SemanticSearchRuntime, createSemanticEmbeddingProvider, getDefaultSemanticSearchConfig, getSemanticConfigPath, getSemanticIndexDir, getSemanticIndexFiles, getSemanticIndexesDir, getSemanticProjectHash, getSemanticRootDir, loadMergedSemanticConfig, loadSemanticIndex, readScopedSemanticConfig, upsertScopedSemanticSearchConfig, writeScopedSemanticConfig, writeSemanticIndex, clearSemanticIndex, } from "./core/semantic/index.js";
30
31
  // Main entry point
31
32
  export { main } from "./main.js";
32
33
  // Run modes for programmatic SDK usage