hoomanjs 1.32.0 → 1.33.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 (60) hide show
  1. package/README.md +9 -0
  2. package/dist/acp/utils/tool-kind.js +1 -1
  3. package/dist/acp/utils/tool-kind.js.map +1 -1
  4. package/dist/acp/utils/tool-locations.js +1 -1
  5. package/dist/acp/utils/tool-locations.js.map +1 -1
  6. package/dist/chat/app.js.map +1 -1
  7. package/dist/core/agent/index.js +2 -1
  8. package/dist/core/agent/index.js.map +1 -1
  9. package/dist/core/models/ollama/index.js +4 -0
  10. package/dist/core/models/ollama/index.js.map +1 -1
  11. package/dist/core/modes/definitions.js +2 -2
  12. package/dist/core/modes/definitions.js.map +1 -1
  13. package/dist/core/prompts/harness/behaviour.md +10 -16
  14. package/dist/core/prompts/harness/communication.md +10 -19
  15. package/dist/core/prompts/harness/execution.md +8 -22
  16. package/dist/core/prompts/harness/guardrails.md +11 -18
  17. package/dist/core/prompts/modes/ask.md +6 -17
  18. package/dist/core/prompts/modes/plan.md +8 -25
  19. package/dist/core/prompts/runtime.js +2 -1
  20. package/dist/core/prompts/runtime.js.map +1 -1
  21. package/dist/core/prompts/static/filesystem.md +6 -36
  22. package/dist/core/prompts/static/planning.md +9 -32
  23. package/dist/core/prompts/static/shell.md +7 -30
  24. package/dist/core/prompts/static/skills.md +5 -16
  25. package/dist/core/prompts/static/web-search.md +6 -41
  26. package/dist/core/ripgrep/bootstrap.d.ts +1 -0
  27. package/dist/core/ripgrep/bootstrap.js +191 -0
  28. package/dist/core/ripgrep/bootstrap.js.map +1 -0
  29. package/dist/core/ripgrep/exec.d.ts +38 -0
  30. package/dist/core/ripgrep/exec.js +320 -0
  31. package/dist/core/ripgrep/exec.js.map +1 -0
  32. package/dist/core/ripgrep/index.d.ts +2 -0
  33. package/dist/core/ripgrep/index.js +3 -0
  34. package/dist/core/ripgrep/index.js.map +1 -0
  35. package/dist/core/ripgrep/tool.d.ts +18 -0
  36. package/dist/core/ripgrep/tool.js +101 -0
  37. package/dist/core/ripgrep/tool.js.map +1 -0
  38. package/dist/core/state/tool-approvals.js +1 -1
  39. package/dist/core/state/tool-approvals.js.map +1 -1
  40. package/dist/core/subagents/research.js +1 -1
  41. package/dist/core/subagents/research.js.map +1 -1
  42. package/dist/core/tools/filesystem.d.ts +0 -5
  43. package/dist/core/tools/filesystem.js +2 -60
  44. package/dist/core/tools/filesystem.js.map +1 -1
  45. package/dist/core/tools/grep.d.ts +1 -0
  46. package/dist/core/tools/grep.js +2 -0
  47. package/dist/core/tools/grep.js.map +1 -0
  48. package/dist/core/tools/index.d.ts +1 -0
  49. package/dist/core/tools/index.js +1 -0
  50. package/dist/core/tools/index.js.map +1 -1
  51. package/dist/core/utils/paths.d.ts +3 -0
  52. package/dist/core/utils/paths.js +3 -0
  53. package/dist/core/utils/paths.js.map +1 -1
  54. package/dist/core/utils/ripgrep.d.ts +1 -0
  55. package/dist/core/utils/ripgrep.js +2 -0
  56. package/dist/core/utils/ripgrep.js.map +1 -0
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/package.json +3 -3
@@ -116,7 +116,8 @@ export function resolveAgentInstructionsForFile(filePath, options) {
116
116
  for (const dir of directories) {
117
117
  const instructionPath = join(dir, AGENTS_FILENAME);
118
118
  const resolvedInstructionPath = resolve(instructionPath);
119
- if (resolvedInstructionPath === target || exclude.has(resolvedInstructionPath)) {
119
+ if (resolvedInstructionPath === target ||
120
+ exclude.has(resolvedInstructionPath)) {
120
121
  continue;
121
122
  }
122
123
  if (!existsSync(resolvedInstructionPath)) {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/core/prompts/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAA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AI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,MAAM;QACR,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,WAAW,CAAC,OAAO,EAAE,CAAC;IACtB,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACnD,MAAM,uBAAuB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QACzD,IACE,uBAAuB,KAAK,MAAM;YAClC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,EACpC,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,CAAC;YACzC,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,YAAY,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACrE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,OAAO,EAAE,2BAA2B,CAAC,KAAK,CAAC;KAC5C,CAAC;AACJ,CAAC"}
@@ -2,39 +2,9 @@
2
2
 
3
3
  You have access to filesystem tools for reading, writing, editing, moving, listing, and searching files and directories.
4
4
 
5
- ### When To Use Them
6
-
7
- - Use filesystem tools when the task is primarily about file contents, directory structure, or metadata
8
- - Especially use them for:
9
- - reading text files or configuration files
10
- - editing files directly and precisely
11
- - listing directories or exploring workspace structure
12
- - searching for files by name or pattern
13
- - retrieving file metadata such as size or timestamps
14
- - Prefer filesystem tools over `shell` when a task is fundamentally a file operation
15
-
16
- ### How To Choose
17
-
18
- - Use `read_file` for inspecting file contents
19
- - Use `read_multiple_files` when you need several files at once
20
- - `read_file` and `read_multiple_files` may include `agents_instructions` loaded from nearby subdirectory `AGENTS.md` files that are more specific to the file being read
21
- - Treat returned `agents_instructions` as additional file-scoped project instructions and follow them when relevant
22
- - Use `write_file` to create or overwrite text files
23
- - Use `edit_file` for targeted replacements instead of rewriting the whole file
24
- - Use `create_directory` for directory creation
25
- - Use `list_directory` or `directory_tree` for structure discovery
26
- - Use `move_file` for renaming or relocating files and directories
27
- - Use `search_files` to locate files by pattern
28
- - Use `get_file_info` for metadata without opening the file
29
-
30
- ### Safety
31
-
32
- - Prefer the narrowest operation that solves the task
33
- - Read before editing when verification helps avoid mistakes
34
- - Be especially careful with overwrites, renames, and broad recursive operations
35
- - Avoid unnecessary file churn when a smaller edit is sufficient
36
-
37
- ### Goal
38
-
39
- - Use filesystem tools for direct, precise file work
40
- - Keep file operations intentional, minimal, and easy to verify
5
+ - Prefer filesystem tools over `shell` when the task is mainly about file contents, directory structure, or metadata.
6
+ - Use `read_file` for one known file, `read_multiple_files` for several known files, `grep` for exact text or symbols, and `list_directory` or `directory_tree` for structure discovery.
7
+ - Use `write_file`, `edit_file`, `create_directory`, `move_file`, and `get_file_info` for the corresponding focused operations.
8
+ - `read_file` and `read_multiple_files` may include file-scoped `agents_instructions`; treat them as additional project instructions when relevant.
9
+ - Prefer bounded reads for long files, and batch independent file reads or searches when supported.
10
+ - Prefer the narrowest operation that solves the task, read before editing when that reduces risk, and be careful with overwrites, renames, and broad recursive changes.
@@ -1,34 +1,11 @@
1
1
  ## Planning workflow
2
2
 
3
- Before large or risky changes, use **plan mode** so you explore options with a reduced tool surface and write the plan to disk. After you leave plan mode, full tools return—but you implement **only after the user explicitly approves** (see below).
4
-
5
- ### When to enter plan mode
6
-
7
- Call **`enter_plan_mode`** when the task is multi-step, ambiguous, or could cause harm if executed hastily (wide refactors, migrations, security-sensitive edits, or unclear requirements).
8
-
9
- ### While in plan mode
10
-
11
- - You receive a **`plan_file`** path under the app plans directory. Expand it with **`read_file`**, **`write_file`**, and **`edit_file`** as needed (paths must stay within allowed locations).
12
- - Prefer **`think`** or **`update_todos`** to organize reasoning; avoid shell and other tools not exposed in this phase.
13
- - **`run_subagents`** is available: use it for **read-only** parallel exploration when splitting investigations helps (same discipline as subagents—narrow prompts, synthesize results yourself). Child agents are constrained like other tooling in this phase; you remain responsible for the plan document.
14
-
15
- ### Leaving plan mode
16
-
17
- When the written plan is concrete enough to **review**, call **`exit_plan_mode`**. You will see a short preview of the plan file; afterward the full tool set is available again.
18
-
19
- Do **not** call **`exit_plan_mode`** until you have entered plan mode with **`enter_plan_mode`** and drafted content in the plan file.
20
-
21
- ### After exiting plan mode (user approval gate)
22
-
23
- **Leaving plan mode is not permission to implement.** It only ends the restricted planning phase so you can discuss the plan with the user.
24
-
25
- Until the user **explicitly approves** execution—clear wording such as agreeing to the plan, asking you to proceed, implement it, apply it, or “execute”—you must **not** start substantive implementation work (code changes, destructive commands, migrations, broad edits, or following numbered execution steps from the plan).
26
-
27
- After **`exit_plan_mode`**, default behavior:
28
-
29
- 1. Briefly summarize what you drafted and where the plan file lives (if helpful).
30
- 2. Ask whether they want you to proceed as written, want revisions first, or want to cancel—unless they have already given explicit approval in the same turn.
31
-
32
- If they approve only part of the plan, restrict implementation to that scope. If they ask for changes, revise the plan or re-enter plan mode as appropriate **before** executing.
33
-
34
- Only after **explicit user approval** should you implement or execute the plan using your normal tools.
3
+ Use **plan mode** for multi-step, ambiguous, or high-risk work when you should explore first and write a plan to disk.
4
+
5
+ - Call **`enter_plan_mode`** before that planning work.
6
+ - In plan mode, use the **plan file** as the source of truth and keep it updated as the plan changes.
7
+ - Use only the tools exposed in that phase; prefer read-only exploration and planning helpers over implementation.
8
+ - Call **`exit_plan_mode`** only after the plan is concrete enough to review.
9
+ - **Leaving plan mode is not permission to implement.** Wait for explicit user approval before substantive execution.
10
+ - After exit, briefly summarize the plan and ask whether to proceed, revise, or cancel unless the user already approved in the same turn.
11
+ - If approval is partial, implement only that approved scope.
@@ -2,33 +2,10 @@
2
2
 
3
3
  You have access to a `shell` tool for local command execution.
4
4
 
5
- ### When To Use It
6
-
7
- - Use `shell` when executing a local command is the most direct or reliable way to inspect, verify, or operate on the environment
8
- - Especially use it for:
9
- - running local scripts, checks, tools, and CLIs
10
- - checking system or workspace state
11
- - executing multiple related shell commands in sequence
12
- - gathering output that is easier to obtain from the command line than from reasoning alone
13
- - Do NOT use `shell` when the answer can be given directly without execution
14
- - Do NOT use `shell` for destructive or risky commands unless they are clearly necessary and appropriate
15
-
16
- ### How To Use It
17
-
18
- - Prefer the smallest command that answers the question
19
- - Use `work_dir` when the command should run in a specific directory
20
- - Use sequential commands for dependent steps
21
- - Use `parallel` only for independent commands
22
- - Set sensible timeouts for commands that may hang or run for a long time
23
- - Use `ignore_errors` only when partial success is acceptable
24
-
25
- ### Safety
26
-
27
- - Avoid commands that delete, overwrite, or broadly modify files unless required
28
- - Prefer inspection and verification before making changes
29
- - Be careful with package managers, process control, and commands that affect the wider system
30
-
31
- ### Goal
32
-
33
- - Use the shell to improve accuracy and efficiency
34
- - Keep command usage targeted, minimal, and relevant to the task
5
+ - Use `shell` when local command execution is the most direct way to inspect, verify, or operate on the environment.
6
+ - Prefer dedicated file and search tools when the task is fundamentally about files or text.
7
+ - Prefer the smallest command that answers the question, and use `work_dir` when location matters.
8
+ - Put multiple related shell steps in one `shell` call; run them sequentially when dependent and in `parallel` only when independent.
9
+ - Use sensible timeouts, use `ignore_errors` only when partial success is acceptable, and prefer commands or flags with naturally bounded output.
10
+ - Summarize important command output instead of echoing long logs back to the user.
11
+ - Avoid destructive or risky commands unless they are clearly necessary and appropriate, and be careful with package managers, process control, and commands that affect the wider system.
@@ -2,20 +2,9 @@
2
2
 
3
3
  You may have an `<available_skills>` section elsewhere in the system prompt listing skill names, descriptions, and optional `SKILL.md` locations. Use the `skills` tool to activate a skill and load its full instructions when needed.
4
4
 
5
- ### When to use a skill during this turn
6
-
7
- - When the user's goal, stack, or workflow clearly matches a listed skill (same product, API, or task family), treat that skill as the preferred playbook before improvising.
8
- - **Programming and implementation** (creating or changing source, tests, tooling config, dependencies, package manifests, installs, builds, or new scaffold directories): **before** your first implementation tool call in that task, activate the built-in `hooman-coding` skill with the `skills` tool so you have its full instructions in context. Do **not** skip this because the task seems small, throwaway, or tutorial-sized.
9
- - When you are unsure but a listed skill plausibly fits the task, activate it with the `skills` tool and skim the returned instructions; if it helps, follow it for the rest of the turn.
10
- - Prefer using the `skills` tool over guessing conventions (naming, CLI flags, safety steps) that the skill is meant to encode.
11
- - Do **not** load skills unrelated to the request. Other skills stay selective; **hooman-coding** is the exception for any implementation work as above.
12
-
13
- ### Coordination with tools
14
-
15
- - Use the `skills` tool to load full instructions.
16
- - Use **filesystem** tools to inspect a skill's `SKILL.md`, scripts, references, or assets only when the task specifically needs the underlying files.
5
+ - When the user's goal, stack, or workflow clearly matches a listed skill, treat that skill as the preferred playbook before improvising.
6
+ - For programming or implementation work, load the built-in `hooman-coding` skill before the first implementation tool call, even when the task looks small.
7
+ - When unsure but a listed skill plausibly fits, load it and follow it if it helps.
8
+ - Prefer the `skills` tool over guessing conventions the skill is meant to encode, but do not load unrelated skills.
9
+ - Use filesystem tools to inspect a skill's files only when the task specifically needs them.
17
10
  - When the user wants to manage Hooman skills, use the built-in `hooman-skills` skill and edit `~/.hooman/skills` directly.
18
-
19
- ### Goal
20
-
21
- Apply skills **selectively** except for **hooman-coding** on programming tasks, where loading it first is required as above. For everything else, improve quality when a skill applies and avoid extra I/O when none do.
@@ -2,45 +2,10 @@
2
2
 
3
3
  You have access to a `web_search` tool for finding relevant webpages and snippets.
4
4
 
5
- ### When To Use It
6
-
7
- - Use `web_search` when you need current or external information not available in local context.
8
- - Prefer it for discovering candidate sources before reading full page content.
9
- - After identifying promising URLs, use `fetch` to read those pages in detail.
10
-
11
- ### Input Contract
12
-
13
- Use only these inputs:
14
-
15
- - `query` (required)
16
- - `count` (optional)
17
- - `freshness` (optional: `day`, `week`, `month`, `year`)
18
- - `start_date` + `end_date` (optional date range, `YYYY-MM-DD`)
19
- - `country` (optional country code)
20
- - `safe_search` (optional boolean)
21
-
22
- Do not invent provider-specific parameters.
23
-
24
- ### Query Construction
25
-
26
- - Keep `query` focused on the topic, entity, source, and search operators.
27
- - Do not add specific dates, months, or years to `query` for recency unless the user explicitly asked for that date/month/year or it is essential to disambiguate the topic.
28
- - For "latest", "recent", "today", "this week", "this month", or other relative-time requests, use `freshness` or `start_date` + `end_date` instead of adding date words to `query`.
29
- - Use the injected `<now>...</now>` ISO timestamp when interpreting relative dates.
30
- - Use `get_current_time` only if you need current time in a specific timezone before choosing `freshness` or date ranges.
31
-
32
- ### Examples
33
-
34
- - General current-information search:
35
- - `{"query":"latest TypeScript 6 release notes","count":5}`
36
- - Recency-filtered search:
37
- - `{"query":"browser rendering performance updates","freshness":"week","count":5}`
38
- - Country-targeted search:
39
- - `{"query":"renewable energy policy updates","country":"DE","count":5}`
40
- - Search operators inside query:
41
- - `{"query":"\"climate change\" site:ipcc.ch filetype:pdf -draft","count":5}`
42
-
43
- ### Notes
44
-
5
+ - Use `web_search` when you need current or external information not available locally.
6
+ - Prefer it for discovering candidate sources; use `fetch` to read selected pages in detail.
7
+ - Use only supported inputs: `query`, optional `count`, `freshness`, `start_date`, `end_date`, `country`, and `safe_search`.
8
+ - Keep `query` focused on the topic, entity, source, and search operators. Do not invent provider-specific parameters.
9
+ - For relative-time requests such as "latest" or "this week", prefer `freshness` or a date range over stuffing date words into `query`.
10
+ - Use the injected `<now>...</now>` timestamp to interpret relative dates, and use `get_current_time` only if a specific timezone matters.
45
11
  - `web_search` returns result pages and snippets, not full article bodies.
46
- - For complete page content, call `fetch` on selected result URLs.
@@ -0,0 +1 @@
1
+ export declare function ensureRipgrepPath(): Promise<string>;
@@ -0,0 +1,191 @@
1
+ import { execFile, spawnSync } from "node:child_process";
2
+ import { createHash } from "node:crypto";
3
+ import { createWriteStream } from "node:fs";
4
+ import fs from "node:fs/promises";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+ import { Readable } from "node:stream";
8
+ import { pipeline } from "node:stream/promises";
9
+ import { promisify } from "node:util";
10
+ import { binPath, ripgrepPath } from "../utils/paths.js";
11
+ const execFileAsync = promisify(execFile);
12
+ const RIPGREP_VERSION = "15.1.0";
13
+ const DOWNLOAD_TIMEOUT_MS = 600_000;
14
+ const DOWNLOAD_TARGETS = {
15
+ "arm64-darwin": {
16
+ target: "aarch64-apple-darwin",
17
+ extension: "tar.gz",
18
+ },
19
+ "x64-darwin": {
20
+ target: "x86_64-apple-darwin",
21
+ extension: "tar.gz",
22
+ },
23
+ "arm64-linux": {
24
+ target: "aarch64-unknown-linux-gnu",
25
+ extension: "tar.gz",
26
+ },
27
+ "x64-linux": {
28
+ target: "x86_64-unknown-linux-musl",
29
+ extension: "tar.gz",
30
+ },
31
+ "arm64-win32": {
32
+ target: "aarch64-pc-windows-msvc",
33
+ extension: "zip",
34
+ },
35
+ "x64-win32": {
36
+ target: "x86_64-pc-windows-msvc",
37
+ extension: "zip",
38
+ },
39
+ };
40
+ const ARCHIVE_SHA256 = {
41
+ "ripgrep-15.1.0-aarch64-apple-darwin.tar.gz": "378e973289176ca0c6054054ee7f631a065874a352bf43f0fa60ef079b6ba715",
42
+ "ripgrep-15.1.0-aarch64-pc-windows-msvc.zip": "00d931fb5237c9696ca49308818edb76d8eb6fc132761cb2a1bd616b2df02f8e",
43
+ "ripgrep-15.1.0-aarch64-unknown-linux-gnu.tar.gz": "2b661c6ef508e902f388e9098d9c4c5aca72c87b55922d94abdba830b4dc885e",
44
+ "ripgrep-15.1.0-x86_64-apple-darwin.tar.gz": "64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882",
45
+ "ripgrep-15.1.0-x86_64-pc-windows-msvc.zip": "124510b94b6baa3380d051fdf4650eaa80a302c876d611e9dba0b2e18d87493a",
46
+ "ripgrep-15.1.0-x86_64-unknown-linux-musl.tar.gz": "1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599",
47
+ };
48
+ let resolvedRipgrepPath;
49
+ function lookupBinary(command) {
50
+ const lookup = process.platform === "win32" ? "where" : "which";
51
+ const result = spawnSync(lookup, [command], {
52
+ encoding: "utf8",
53
+ stdio: ["ignore", "pipe", "ignore"],
54
+ });
55
+ if (result.status !== 0) {
56
+ return undefined;
57
+ }
58
+ const first = result.stdout
59
+ .split(/\r?\n/)
60
+ .map((line) => line.trim())
61
+ .find(Boolean);
62
+ return first || undefined;
63
+ }
64
+ async function isExistingFile(filePath) {
65
+ try {
66
+ const stat = await fs.stat(filePath);
67
+ return stat.isFile();
68
+ }
69
+ catch {
70
+ return false;
71
+ }
72
+ }
73
+ function detectTargetConfig() {
74
+ const key = `${process.arch}-${process.platform}`;
75
+ const target = DOWNLOAD_TARGETS[key];
76
+ if (!target) {
77
+ throw new Error(`Unsupported platform for ripgrep bootstrap: ${process.platform}/${process.arch}`);
78
+ }
79
+ return target;
80
+ }
81
+ function archiveName(config) {
82
+ return `ripgrep-${RIPGREP_VERSION}-${config.target}.${config.extension}`;
83
+ }
84
+ async function sha256File(filePath) {
85
+ const data = await fs.readFile(filePath);
86
+ return createHash("sha256").update(data).digest("hex");
87
+ }
88
+ async function downloadArchive(url, targetPath) {
89
+ const response = await fetch(url, {
90
+ signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS),
91
+ });
92
+ if (!response.ok) {
93
+ throw new Error(`Failed to download ripgrep (${response.status} ${url})`);
94
+ }
95
+ if (!response.body) {
96
+ throw new Error("Ripgrep download response body was empty.");
97
+ }
98
+ await pipeline(Readable.fromWeb(response.body), createWriteStream(targetPath));
99
+ }
100
+ function selectPowerShell() {
101
+ if (process.platform !== "win32") {
102
+ return "powershell.exe";
103
+ }
104
+ return (lookupBinary("pwsh.exe") ||
105
+ lookupBinary("powershell.exe") ||
106
+ "powershell.exe");
107
+ }
108
+ function escapeSingleQuotes(value) {
109
+ return value.split("'").join("''");
110
+ }
111
+ async function extractArchive(archivePath, destinationDir, extension) {
112
+ if (extension === "tar.gz") {
113
+ await execFileAsync("tar", ["-xzf", archivePath, "-C", destinationDir], {
114
+ maxBuffer: 4 * 1024 * 1024,
115
+ });
116
+ return;
117
+ }
118
+ const escapedArchive = escapeSingleQuotes(archivePath);
119
+ const escapedDestination = escapeSingleQuotes(destinationDir);
120
+ const shell = selectPowerShell();
121
+ await execFileAsync(shell, [
122
+ "-NoProfile",
123
+ "-NonInteractive",
124
+ "-Command",
125
+ `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${escapedArchive}' -DestinationPath '${escapedDestination}' -Force`,
126
+ ], {
127
+ windowsHide: true,
128
+ maxBuffer: 4 * 1024 * 1024,
129
+ });
130
+ }
131
+ async function installManagedRipgrep() {
132
+ const config = detectTargetConfig();
133
+ const fileName = archiveName(config);
134
+ const expectedHash = ARCHIVE_SHA256[fileName];
135
+ if (!expectedHash) {
136
+ throw new Error(`Missing pinned SHA-256 for ripgrep archive: ${fileName}`);
137
+ }
138
+ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "hooman-rg-"));
139
+ const finalPath = ripgrepPath();
140
+ try {
141
+ const archivePath = path.join(tempDir, fileName);
142
+ const url = `https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/${fileName}`;
143
+ await downloadArchive(url, archivePath);
144
+ const hash = await sha256File(archivePath);
145
+ if (hash !== expectedHash) {
146
+ throw new Error(`Ripgrep checksum mismatch for ${fileName}. Expected ${expectedHash}, got ${hash}.`);
147
+ }
148
+ await extractArchive(archivePath, tempDir, config.extension);
149
+ const extractedPath = path.join(tempDir, `ripgrep-${RIPGREP_VERSION}-${config.target}`, process.platform === "win32" ? "rg.exe" : "rg");
150
+ if (!(await isExistingFile(extractedPath))) {
151
+ throw new Error(`Ripgrep archive did not include the expected binary at ${extractedPath}.`);
152
+ }
153
+ await fs.mkdir(binPath(), { recursive: true });
154
+ const tempTarget = `${finalPath}.tmp`;
155
+ await fs.copyFile(extractedPath, tempTarget);
156
+ if (process.platform !== "win32") {
157
+ await fs.chmod(tempTarget, 0o755);
158
+ }
159
+ await fs.rm(finalPath, { force: true }).catch(() => { });
160
+ await fs.rename(tempTarget, finalPath);
161
+ return finalPath;
162
+ }
163
+ finally {
164
+ await fs.rm(tempDir, { recursive: true, force: true }).catch(() => { });
165
+ }
166
+ }
167
+ export async function ensureRipgrepPath() {
168
+ if (resolvedRipgrepPath) {
169
+ return resolvedRipgrepPath;
170
+ }
171
+ const pending = (async () => {
172
+ const system = lookupBinary(process.platform === "win32" ? "rg.exe" : "rg");
173
+ if (system && (await isExistingFile(system))) {
174
+ return system;
175
+ }
176
+ const cached = ripgrepPath();
177
+ if (await isExistingFile(cached)) {
178
+ return cached;
179
+ }
180
+ return installManagedRipgrep();
181
+ })();
182
+ resolvedRipgrepPath = pending;
183
+ try {
184
+ return await pending;
185
+ }
186
+ catch (error) {
187
+ resolvedRipgrepPath = undefined;
188
+ throw error;
189
+ }
190
+ }
191
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/core/ripgrep/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAA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CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,mBAAmB,EAAE,CAAC;QACxB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;QAC1B,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5E,IAAI,MAAM,IAAI,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAC7C,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,MAAM,GAAG,WAAW,EAAE,CAAC;QAC7B,IAAI,MAAM,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,OAAO,qBAAqB,EAAE,CAAC;IACjC,CAAC,CAAC,EAAE,CAAC;IAEL,mBAAmB,GAAG,OAAO,CAAC;IAC9B,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mBAAmB,GAAG,SAAS,CAAC;QAChC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { JSONValue, ToolContext } from "@strands-agents/sdk";
2
+ export type OutputMode = "paths" | "content" | "files_with_matches" | "count";
3
+ type RipgrepExecutionResult = {
4
+ stdout: string;
5
+ stderr: string;
6
+ code: number;
7
+ };
8
+ export declare function executeRipgrep(rgPath: string, args: string[], options: {
9
+ cwd: string;
10
+ signal?: AbortSignal;
11
+ timeoutMs?: number;
12
+ }): Promise<RipgrepExecutionResult>;
13
+ export declare function runPathsMode(rgPath: string, input: {
14
+ path: string;
15
+ pattern: string;
16
+ exclude_patterns?: string[];
17
+ offset?: number;
18
+ head_limit?: number;
19
+ max_results?: number;
20
+ }, context?: ToolContext): Promise<JSONValue>;
21
+ export declare function runContentMode(rgPath: string, mode: Exclude<OutputMode, "paths">, input: {
22
+ path: string;
23
+ pattern: string;
24
+ glob?: string;
25
+ type?: string;
26
+ exclude_patterns?: string[];
27
+ context?: number;
28
+ before?: number;
29
+ after?: number;
30
+ case_insensitive?: boolean;
31
+ fixed_strings?: boolean;
32
+ multiline?: boolean;
33
+ no_ignore?: boolean;
34
+ offset?: number;
35
+ head_limit?: number;
36
+ max_results?: number;
37
+ }, context?: ToolContext): Promise<JSONValue>;
38
+ export {};