ollama_repo_pack
Repo pack (writes artifact). PACK. Runs the full repo ONBOARDING job: corpus_search (if corpus given) → repo_brief → targeted ollama_extract (narrow onboarding schema: packages, entrypoints, scripts, config_files, exposed_surfaces, runtime_hints) → deterministic markdown+JSON artifact on disk. Corpus-first posture: when a corpus is given, it’s the main working surface alongside source_paths. Not repo Q&A — this is get me onboarded fast with a stable operator artifact. Response is compact; full brief + extracted facts live in the artifact.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source_paths |
string[] | yes | — | Files the onboarding brief should read (README, key src entries, package/manifest, docs). Required — these are the repo’s concrete source-of-truth. |
corpus |
string | no | — | Optional named corpus (e.g. ‘handbook’, ‘doctrine’) for cross-cutting architecture context. When given, queried as the pack’s main working surface alongside source_paths. |
corpus_query |
string | no | — | Corpus query (defaults to ‘repo architecture and surfaces’). (max 200 chars — deliberately shorter than ollama_corpus_search.query’s 1000, because this is a short retrieval prompt, not a document.) |
title |
string | no | — | Short human title — used in the artifact header and filename slug. Defaults to the repo thesis head. |
artifact_dir |
string | no | — | Directory to write the repo.md + repo.json artifact pair. Defaults to ~/.ollama-intern/artifacts/repo/. |
allowed_roots |
string[] | no | — | Absolute directories artifact_dir may live under when it is not inside INTERN_ARTIFACT_DIR. Same dual-declaration as ollama_artifact_export_to_path. |
confirm_write |
boolean | no | — | Required when the artifact pair would land on a protected path (.git/, SECURITY.md, memory/, …). Same gate as ollama_draft. |
per_file_max_chars |
integer | no | — | Chars per source file (default 20k). |
max_key_surfaces |
integer | no | — | Cap on key_surfaces (default 8). |
max_risk_areas |
integer | no | — | Cap on risk_areas (default 5). |
max_read_next |
integer | no | — | Cap on read_next (default 8). |
backend |
"cloud" \ |
"local" |
no | — |
Full input schema
Section titled “Full input schema”The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "source_paths": { "minItems": 1, "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Files the onboarding brief should read (README, key src entries, package/manifest, docs). Required — these are the repo's concrete source-of-truth." }, "corpus": { "description": "Optional named corpus (e.g. 'handbook', 'doctrine') for cross-cutting architecture context. When given, queried as the pack's main working surface alongside source_paths.", "type": "string", "pattern": "^[a-zA-Z0-9_-]+$" }, "corpus_query": { "description": "Corpus query (defaults to 'repo architecture and surfaces'). (max 200 chars — deliberately shorter than ollama_corpus_search.query's 1000, because this is a short retrieval prompt, not a document.)", "type": "string", "minLength": 1, "maxLength": 200 }, "title": { "description": "Short human title — used in the artifact header and filename slug. Defaults to the repo thesis head.", "type": "string", "minLength": 1, "maxLength": 120 }, "artifact_dir": { "description": "Directory to write the repo.md + repo.json artifact pair. Defaults to ~/.ollama-intern/artifacts/repo/.", "type": "string", "minLength": 1 }, "allowed_roots": { "description": "Absolute directories artifact_dir may live under when it is not inside INTERN_ARTIFACT_DIR. Same dual-declaration as ollama_artifact_export_to_path.", "type": "array", "items": { "type": "string", "minLength": 1 } }, "confirm_write": { "description": "Required when the artifact pair would land on a protected path (.git/, SECURITY.md, memory/, ...). Same gate as ollama_draft.", "type": "boolean" }, "per_file_max_chars": { "description": "Chars per source file (default 20k).", "type": "integer", "minimum": 1000, "maximum": 200000 }, "max_key_surfaces": { "description": "Cap on key_surfaces (default 8).", "type": "integer", "minimum": 1, "maximum": 20 }, "max_risk_areas": { "description": "Cap on risk_areas (default 5).", "type": "integer", "minimum": 1, "maximum": 10 }, "max_read_next": { "description": "Cap on read_next (default 8).", "type": "integer", "minimum": 1, "maximum": 15 }, "backend": { "description": "Optional per-call backend directive (v2.9). 'cloud' escalates THIS call to Ollama Cloud — works in cloud standby (OLLAMA_API_KEY set, OLLAMA_CLOUD_PRIMARY unset) and cloud-primary modes; errors with CLOUD_NOT_CONFIGURED when no cloud is configured (never silently runs local while claiming escalation). 'local' pins the call to the local backend (zero egress) even under cloud-primary. Omit for the mode default. Escalated calls disclose egress loudly and carry backend provenance on the envelope. Synthesis quality on this tool scales sharply with model class — on a repo-scale job the local 8B is often the binding constraint, not the evidence. Tools where a local model is genuinely adequate (ollama_summarize_fast, ollama_classify, ollama_triage_logs, and every no-LLM tool) deliberately do NOT offer this field. SCOPE: this directive reaches the brief synthesis step (ollama_repo_brief, Deep tier) ONLY — evidence assembly, the targeted extract (Workhorse structured fill) and the artifact write run on the mode default regardless. A pack is a mixed-cost pipeline; escalating all of it would bill a flagship for work a local model does fine.", "type": "string", "enum": [ "cloud", "local" ] } }, "required": [ "source_paths" ]}Envelope
Section titled “Envelope”Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.
Source
Section titled “Source”Schema + handler: src/tools/packs/repoPack.ts · registration: src/index.ts
Back to the Tool Reference.