Expand description
ocserve-tools: v1 tool names + permission evaluation (PLAN §11: v1 names kept; no v2 renames). Wildcard/evaluate ported from v1 util/wildcard.ts and core/permission.ts; tool params verified against v1 sources + live tool-part capture (testdata/m2).
Modules§
- bash_
patterns - Bash command → permission patterns (upstream
permission/arity.tsparity). - permission_
asks - Tool → permission ask sequence (upstream tool-call
ctx.ask()parity). - shell_
prompt - The
bashtool description is TEMPLATED upstream (tool/shell/prompt.tsShellPrompt.render):${os},${shell},${tmp}, and a generated command section are substituted at runtime. A capture therefore bakes in the capturing host’s values — never ship that. This mirrors the upstream template so the description is correct on the running host (K-CAPDIFF: capdiff compares description bytes too; a stale/host-baked string is red).
Structs§
- Rule
- v1 permission evaluation: find LAST rule matching (permission, resource); default = ask (core/permission.ts evaluate()).
- Tool
Result
Constants§
- IMPLEMENTED
- Tools ocserve executes. Advertised tool list = the intersection of these
names and the frozen provider-tools.json (D-TOOLS-TASK:
taskis advertised upstream but not yet executed here, so it is excluded until implemented — see bench/openapi/FIELD-CONTRACT.md). - MAX_
BYTES - MAX_
LINES - Truncation (v1 shell: MAX_LINES/MAX_BYTES constants).
- QUESTION_
DESCRIPTION - v1 tool/question.txt — model-facing contract for the question tool
(verbatim: prompt_loop routes
questionto the QuestionGate, never toexecute()).
Functions§
- evaluate
- execute
- Execute a tool by v1 name.
cwdscopes relative paths. - schemas
- Provider tool schemas, filtered to IMPLEMENTED (deny filtering happens in the caller). Order matches the frozen capture.
- wildcard_
match - v1 Wildcard.match: glob → regex,
\→/, trailing “ *“ tail optional.