@autorag/librarian 2.2.0 → 2.3.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 (50) hide show
  1. package/README.md +84 -42
  2. package/dist/agent/agent.d.ts +16 -41
  3. package/dist/agent/bash-tool.d.ts +0 -11
  4. package/dist/agent/dupey-tool.d.ts +15 -0
  5. package/dist/agent/emit-results-tool.d.ts +14 -0
  6. package/dist/agent/index.d.ts +1 -0
  7. package/dist/agent/local-model.d.ts +12 -0
  8. package/dist/agent/search-documents.d.ts +1 -1
  9. package/dist/agent/system-prompt.d.ts +1 -2
  10. package/dist/cli/commands/duplicates.d.ts +4 -0
  11. package/dist/cli/commands/health.d.ts +9 -65
  12. package/dist/cli/commands/init.d.ts +1 -1
  13. package/dist/cli/commands/search.d.ts +2 -2
  14. package/dist/cli/config.d.ts +10 -14
  15. package/dist/cli/index.js +10383 -11845
  16. package/dist/datasource/aliased-skill.d.ts +28 -0
  17. package/dist/datasource/chunk-store.d.ts +2 -0
  18. package/dist/datasource/connector-skill.d.ts +3 -0
  19. package/dist/datasource/connector.d.ts +4 -0
  20. package/dist/datasource/crawler-skill.d.ts +6 -0
  21. package/dist/datasource/index.d.ts +2 -0
  22. package/dist/datasource/skills/cloud-drive/index.d.ts +1 -0
  23. package/dist/datasource/skills/cloud-drive/skill.d.ts +14 -0
  24. package/dist/datasource/skills/discrawl/skill.d.ts +3 -0
  25. package/dist/datasource/skills/factory.d.ts +7 -0
  26. package/dist/datasource/skills/gdrive/rclone-connector.d.ts +16 -24
  27. package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
  28. package/dist/dupey/cli.d.ts +40 -0
  29. package/dist/dupey/filter.d.ts +8 -0
  30. package/dist/dupey/index.d.ts +2 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.js +5063 -6881
  33. package/dist/memory/check-memory-tool.d.ts +1 -0
  34. package/dist/memory/index.d.ts +2 -2
  35. package/dist/memory/memory.d.ts +33 -3
  36. package/dist/memory/renderer.d.ts +2 -1
  37. package/dist/mirror/sync.d.ts +3 -1
  38. package/dist/observability/run-log.d.ts +1 -26
  39. package/dist/process/portable-spawn.d.ts +10 -0
  40. package/package.json +5 -4
  41. package/skills/autorag/SKILL.md +59 -96
  42. package/skills/autorag-setup/SKILL.md +144 -400
  43. package/dist/subagents/contracts.d.ts +0 -90
  44. package/dist/subagents/dispatch-templates.d.ts +0 -104
  45. package/dist/subagents/dispatch-validation.d.ts +0 -169
  46. package/dist/subagents/explorer-tools-extension.d.ts +0 -4
  47. package/dist/subagents/explorer-tools-extension.js +0 -130
  48. package/dist/subagents/local-models.d.ts +0 -14
  49. package/dist/subagents/model-policy.d.ts +0 -31
  50. package/dist/subagents/runtime.d.ts +0 -52
@@ -8,6 +8,7 @@ export interface CheckMemoryDetails {
8
8
  signalCount: number;
9
9
  topMethod: string | null;
10
10
  insightCount: number;
11
+ contextHintCount: number;
11
12
  }
12
13
  export declare function createCheckMemoryTool(memory: RetrievalMemory): AgentTool<typeof checkMemorySchema, CheckMemoryDetails>;
13
14
  export {};
@@ -1,5 +1,5 @@
1
1
  export type { CheckMemoryDetails } from "./check-memory-tool.js";
2
2
  export { createCheckMemoryTool } from "./check-memory-tool.js";
3
- export type { MemoryEntry, ResultFeedback, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt } from "./memory.js";
4
- export { RetrievalMemory } from "./memory.js";
3
+ export type { ContextValueHint, EvidenceContext, FeedbackIdInput, MemoryEntry, ResultFeedback, RetrievalContextHints, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt, } from "./memory.js";
4
+ export { normalizeSessionEvidenceRef, RetrievalMemory } from "./memory.js";
5
5
  export { renderMemoryContext } from "./renderer.js";
@@ -9,7 +9,16 @@ export interface SignalDefaults {
9
9
  readonly implicitCap: number;
10
10
  readonly decayHalfLifeMs?: number;
11
11
  }
12
- export interface EvidenceChunkRecord extends NormalizedEvidenceRef {
12
+ export interface EvidenceContext {
13
+ readonly retrieverMix?: readonly string[];
14
+ readonly parserType?: string;
15
+ readonly documentType?: string;
16
+ readonly documentArea?: string;
17
+ readonly evidenceType?: string;
18
+ readonly evidenceLocation?: string;
19
+ readonly confidence?: number;
20
+ }
21
+ export interface EvidenceChunkRecord extends NormalizedEvidenceRef, EvidenceContext {
13
22
  readonly excerptHash: string;
14
23
  readonly firstSeenAt: number;
15
24
  readonly lastSeenAt: number;
@@ -24,6 +33,7 @@ export interface CuratedResultRecord {
24
33
  readonly summary: string;
25
34
  readonly resultHash: string;
26
35
  readonly evidenceIds: readonly string[];
36
+ readonly confidence?: number;
27
37
  readonly createdAt: number;
28
38
  }
29
39
  export interface FeedbackSignal {
@@ -53,6 +63,19 @@ export interface MethodHint {
53
63
  readonly confidence: number;
54
64
  readonly reason: string;
55
65
  }
66
+ export interface ContextValueHint {
67
+ readonly value: string;
68
+ readonly score: number;
69
+ readonly confidence: number;
70
+ }
71
+ export interface RetrievalContextHints {
72
+ readonly documentAreas: readonly ContextValueHint[];
73
+ readonly documentTypes: readonly ContextValueHint[];
74
+ readonly evidenceTypes: readonly ContextValueHint[];
75
+ readonly evidenceLocations: readonly ContextValueHint[];
76
+ readonly parserTypes: readonly ContextValueHint[];
77
+ readonly retrieverMix: readonly ContextValueHint[];
78
+ }
56
79
  export interface RetrievalInsight {
57
80
  readonly id: string;
58
81
  readonly clusterKey: string;
@@ -107,7 +130,7 @@ export interface ResultFeedback {
107
130
  source: string;
108
131
  useful: boolean;
109
132
  }
110
- export interface SessionEvidenceRef extends NormalizedEvidenceRef {
133
+ export interface SessionEvidenceRef extends NormalizedEvidenceRef, EvidenceContext {
111
134
  readonly metadata?: Record<string, unknown>;
112
135
  }
113
136
  export interface SessionCuratedResultInput {
@@ -117,6 +140,7 @@ export interface SessionCuratedResultInput {
117
140
  readonly content: string;
118
141
  readonly method: string;
119
142
  readonly source: string;
143
+ readonly confidence?: number;
120
144
  readonly evidenceRefs: readonly SessionEvidenceRef[];
121
145
  }
122
146
  export interface SessionRecordInput {
@@ -132,6 +156,10 @@ export interface NumberedFeedbackInput {
132
156
  readonly useful: boolean;
133
157
  }[];
134
158
  }
159
+ export interface FeedbackIdInput {
160
+ readonly feedbackId: string;
161
+ readonly useful: boolean;
162
+ }
135
163
  export interface RetrievalMemoryOptions {
136
164
  storagePath: string;
137
165
  insightExtractor?: InsightExtractor;
@@ -150,8 +178,10 @@ export declare class RetrievalMemory {
150
178
  getSignalCount(): number;
151
179
  recordCuratedResultsSession(input: SessionRecordInput): void;
152
180
  recordNumberedFeedback(input: NumberedFeedbackInput): boolean;
181
+ recordFeedbackByIds(feedback: readonly FeedbackIdInput[]): boolean;
153
182
  recordWeakSignal(query: string, method: string, source: "followup" | "retry"): void;
154
- getMethodHints(query: string): MethodHint[];
183
+ getMethodHints(_query: string): MethodHint[];
184
+ getContextHints(_query: string): RetrievalContextHints;
155
185
  getInsights(query: string): RetrievalInsight[];
156
186
  getMethodPriority(query: string): Array<{
157
187
  method: string;
@@ -1,6 +1,7 @@
1
- import type { MethodHint, RetrievalInsight } from "./memory.js";
1
+ import type { MethodHint, RetrievalContextHints, RetrievalInsight } from "./memory.js";
2
2
  export declare function renderMemoryContext(hints: readonly MethodHint[], opts?: {
3
3
  maxHints?: number;
4
4
  insights?: readonly RetrievalInsight[];
5
5
  maxInsights?: number;
6
+ contextHints?: RetrievalContextHints;
6
7
  }): string;
@@ -10,8 +10,10 @@ export interface ParsedMirrorSyncOptions {
10
10
  readonly force?: boolean;
11
11
  /** Override max source size for parse attempts (bytes). */
12
12
  readonly maxSourceBytes?: number;
13
+ /** Absolute source paths omitted from parsed mirrors (for example exact duplicate copies). */
14
+ readonly excludeSourcePaths?: ReadonlySet<string>;
13
15
  }
14
- export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "deleted-mirror" | "stale-index";
16
+ export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "duplicate-excluded" | "deleted-mirror" | "stale-index";
15
17
  /** Path-opaque refresh diagnostic. `source` is an opaque virtual path, never a real fs path. */
16
18
  export interface ParsedMirrorDiagnostic {
17
19
  readonly code: ParsedMirrorDiagnosticCode;
@@ -3,8 +3,7 @@ export type AutoRAGRunEvent = {
3
3
  timestamp: string;
4
4
  sessionId: string;
5
5
  queryLength: number;
6
- orchestratorModel: string;
7
- explorerModel: string;
6
+ model: string;
8
7
  } | {
9
8
  event: "search_completed";
10
9
  timestamp: string;
@@ -21,30 +20,6 @@ export type AutoRAGRunEvent = {
21
20
  sessionId: string;
22
21
  failureCount: number;
23
22
  errorTypes: string[];
24
- } | {
25
- event: "dispatch_rejected";
26
- schemaVersion: 1;
27
- sessionId: string;
28
- toolCallId: string | null;
29
- sequence: number;
30
- timestamp: string;
31
- dispatchKind: "launch" | "admin" | "control" | "mutation" | "schedule" | "hybrid" | "unknown";
32
- code: string;
33
- field: string;
34
- forceCorrectable: boolean;
35
- } | {
36
- event: "dispatch_autofilled";
37
- schemaVersion: 1;
38
- sessionId: string;
39
- toolCallId: string | null;
40
- sequence: number;
41
- timestamp: string;
42
- dispatchKind: "launch";
43
- fields: {
44
- artifacts: boolean;
45
- agentScope: boolean;
46
- leafModelFillCount: number;
47
- };
48
23
  };
49
24
  export declare class AutoRAGRunLogger {
50
25
  private readonly path;
@@ -0,0 +1,10 @@
1
+ export interface PortableSpawnCommand {
2
+ readonly command: string;
3
+ readonly args: readonly string[];
4
+ }
5
+ /**
6
+ * Windows does not execute Unix shebang files or extensionless scripts through
7
+ * child_process.spawn. Resolve test/dev script entrypoints through their
8
+ * interpreter while leaving native executables untouched.
9
+ */
10
+ export declare function portableSpawnCommand(command: string, args: readonly string[], platform?: NodeJS.Platform): PortableSpawnCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorag/librarian",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Self-evolving librarian agent on Pi framework with pluggable retrieval methods",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,11 +28,13 @@
28
28
  "access": "public"
29
29
  },
30
30
  "scripts": {
31
- "build": "bun build src/index.ts src/cli/index.ts src/subagents/explorer-tools-extension.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
31
+ "build": "bun build src/index.ts src/cli/index.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
32
32
  "prepublishOnly": "bun run typecheck && bun run build",
33
33
  "prepare": "bun run build",
34
- "test": "vitest run",
34
+ "test": "node scripts/run-test-files.mjs",
35
+ "test:windows": "node scripts/run-test-files.mjs",
35
36
  "check": "biome check --write .",
37
+ "lint": "biome check .",
36
38
  "typecheck": "tsc --noEmit"
37
39
  },
38
40
  "engines": {
@@ -50,7 +52,6 @@
50
52
  "iconv-lite": "^0.7.3",
51
53
  "jszip": "^3.10.1",
52
54
  "mailparser": "^3.9.15",
53
- "pi-subagents": "0.53.0",
54
55
  "slides-grab": "^1.5.0",
55
56
  "smol-toml": "1.8.0",
56
57
  "tesseract.js": "^7.0.0",
@@ -1,70 +1,82 @@
1
1
  ---
2
2
  name: autorag
3
- description: Use an already configured AutoRAG librarian agent to search, summarize, compare, and answer questions from local document collections. Use autorag-setup instead for provider/model discovery, first-time configuration, or selecting folders to index.
3
+ description: Use an already configured AutoRAG librarian agent to search, summarize, compare, and answer questions from local document collections. Use autorag-setup for configuration or indexing changes.
4
4
  ---
5
5
 
6
6
  # AutoRAG Librarian Skill
7
7
 
8
8
  Use this skill when AutoRAG is already configured and the user asks to search,
9
9
  summarize, compare, or answer questions from local PDFs, wikis, notes, research
10
- papers, or knowledge bases. For first-time configuration, missing model/provider
11
- settings, subscription or API-provider detection, or changing indexed folders,
12
- use the `autorag-setup` skill instead.
10
+ papers, or knowledge bases.
13
11
 
14
- AutoRAG is invoked through the `autorag` CLI. It is non-destructive: it reads
15
- source files and writes indexes under the configured workspace's `.autorag/`
16
- directory and, when enabled, Jikji's per-source `.jikji/` caches. Never move,
17
- rename, or delete source files.
12
+ AutoRAG is the specialized librarian agent. One configured model plans the
13
+ search, calls BM25, MinSync, Jikji, datasource, and filesystem tools, reads
14
+ sources, judges evidence, and curates the final answer. There is no subagent or
15
+ separate model role.
16
+
17
+ AutoRAG reads source documents and writes indexes only under the configured
18
+ workspace `.autorag/` directory and Jikji's per-source `.jikji/` caches. Never
19
+ move, rename, edit, or delete source files.
18
20
 
19
21
  ## Preflight
20
22
 
21
- Confirm that `~/.autorag/config.json` exists (or an explicit `--config` /
22
- `AUTORAG_CONFIG` path). Inspect that non-secret config for usable
23
- `searchPaths`/`agents` without printing credentials. Then run:
23
+ Confirm `~/.autorag/config.json`, an explicit `--config`, or `AUTORAG_CONFIG`
24
+ exists. Inspect only non-secret `searchPaths` and `model` metadata, then run:
24
25
 
25
26
  ```bash
27
+ autorag duplicates # read-only duplicate-family review
28
+ autorag duplicates --json # machine-readable cleanup planning input
26
29
  autorag status
27
30
  autorag health
28
31
  ```
29
32
 
30
- `status` is model-free and path-opaque: it reports corpus freshness and index
31
- health, not absolute filesystem paths or role-model auth. `health` checks
32
- model/provider auth and explorer subagent setup: it resolves both role models,
33
- verifies credential presence, and (unless `--skip-probes`) probes a completion
34
- call per role. Use `health` to diagnose model, provider, auth, timeout, or
35
- subagent dispatch failures before searching. If configuration, authentication,
36
- role models, or indexes are missing or unhealthy, stop this workflow and use
37
- `autorag-setup`; do not guess private providers or model IDs.
33
+ ### Duplicate-file review
34
+
35
+ Use `autorag duplicates` when the user asks to find duplicate files, choose
36
+ likely latest copies, or reduce corpus/index space. The command and the
37
+ `scan_duplicate_documents` Agent tool are read-only and never delete or move
38
+ source files. Exact means dupey's canonical extracted-text hash matches;
39
+ near/contains families require human review. Exact duplicate exclusion during
40
+ refresh is enabled by default and can be disabled with
41
+ `"excludeExactDuplicates": false` in `config.json`.
42
+
43
+ `status` is model-free and path-opaque. `health` resolves the single model,
44
+ checks credential presence, and normally probes one live completion. If the
45
+ model, authentication, configuration, or indexes are unhealthy, use
46
+ `autorag-setup` rather than guessing private provider details.
38
47
 
39
- ## Searching
48
+ BM25, MinSync, and Jikji should normally be healthy. If they are missing or
49
+ stale, run a full `autorag refresh` or return to setup rather than silently
50
+ degrading to lexical-only search.
51
+
52
+ ## Search
40
53
 
41
54
  ```bash
42
- autorag search "what were the key findings in the Q3 report" --top-k 5
55
+ autorag search "what were the key findings in the Q3 report" --top-k 5 --json
43
56
  ```
44
57
 
45
- AutoRAG returns curated, numbered knowledge units grounded in sources plus a
46
- `sessionId` needed for feedback. Use:
58
+ The response contains a `sessionId`, numbered curated results, source mapping,
59
+ and an answer grounded in those results.
47
60
 
48
- - `--scope` to narrow to a configured virtual sub-path
49
- - `--tags tag1,tag2` only when trusted datasource access is already configured
50
- server-side; tags narrow already-allowed results and never grant new access
51
- - `--json` for structured output (`sessionId`, numbered `results`, `answer`)
52
- - `--debug` only when diagnostics are needed
61
+ - `--scope` narrows to a configured virtual sub-path.
62
+ - `--tags` narrows already-authorized datasource results and never grants new
63
+ access.
64
+ - `--json` is preferred for programmatic consumption.
65
+ - `--debug` is for diagnostics only.
53
66
 
54
- Do not bypass AutoRAG with ad hoc raw search when the user explicitly requested
55
- the librarian agent. Search requires a resolvable orchestrator/explorer model
56
- pair from config, flags, env, or the authenticated local runtime. When `autorag
57
- search` fails for a model, provider, auth, timeout, or subagent reason, the
58
- error output includes a hint pointing to `autorag health` for diagnosis.
67
+ Do not bypass the librarian with ad hoc raw search when the user requested
68
+ AutoRAG. The search loop can use Jikji, BM25, MinSync, datasource retrieval, and
69
+ direct source reading as appropriate. If search fails because of model,
70
+ provider, auth, or timeout problems, diagnose with `autorag health`.
59
71
 
60
- Record feedback so retrieval memory learns which results were useful:
72
+ Record feedback so retrieval memory can learn:
61
73
 
62
74
  ```bash
63
75
  autorag feedback <sessionId> --useful 1,3 --not-useful 2
64
76
  ```
65
77
 
66
- Supply at least one of `--useful` or `--not-useful`. Numbers refer to the
67
- numbered knowledge units from that session's search output.
78
+ Supply at least one feedback list. Numbers refer to the returned knowledge
79
+ units.
68
80
 
69
81
  ## Maintenance
70
82
 
@@ -72,7 +84,7 @@ numbered knowledge units from that session's search output.
72
84
  autorag status
73
85
  autorag health
74
86
  autorag refresh
75
- autorag refresh --method bm25,minsync
87
+ autorag refresh --method bm25,minsync,jikji
76
88
  autorag watch --once
77
89
  autorag watch
78
90
  autorag refresh --force
@@ -81,69 +93,20 @@ autorag index reset --method bm25 --yes
81
93
  autorag memory inspect
82
94
  ```
83
95
 
84
- Use `refresh` after source documents change (parses sources and resyncs BM25 /
85
- MinSync / datasources / optional Jikji prepare). Prefer bounded refresh over
86
- reset. `watch --once` is the preferred single tick for scheduled jobs; long-running
87
- `watch` keeps an fs event loop open for interactive sessions.
88
- `--method <csv>` (e.g. `--method bm25,minsync,parsed`) restricts which methods
89
- refresh/index run; when omitted all methods run. BM25 and MinSync are enabled
90
- by default — no explicit configuration is needed for standard lexical + semantic
91
- retrieval. MinSync uses a pre-installed binary (`autoInstall: false`); configure
92
- `minSync.embedder` via `autorag init --embedder-*` flags for remote embedding.
93
-
94
- ### Keep indexes fresh on a schedule (agent responsibility)
95
-
96
- There is **no always-on network service** in the CLI. Agents and operators must
97
- install an OS-appropriate periodic job that runs a model-free index tick:
98
-
99
- ```bash
100
- # Preferred scheduled command (single non-daemon refresh)
101
- NODE_OPTIONS=--max-old-space-size=16384 autorag watch --once
102
- # Equivalent one-shot refresh
103
- NODE_OPTIONS=--max-old-space-size=16384 autorag refresh
104
- ```
96
+ Prefer a full refresh so parsed mirrors, BM25, MinSync, Jikji, and configured
97
+ datasources stay aligned. Use `--method` only for deliberate narrowing.
98
+ Scheduled maintenance should use non-daemon `autorag watch --once`, typically
99
+ every 15–30 minutes, with the same config used by search and no overlapping
100
+ runs.
105
101
 
106
- Schedule guidance by OS (typical interval: every 15–30 minutes; never more often
107
- than the corpus can finish refreshing):
108
-
109
- | OS | Preferred scheduler | Pattern |
110
- |---|---|---|
111
- | macOS | `cron` or `launchd` (`~/Library/LaunchAgents`) | `*/30 * * * * ... autorag watch --once` or a KeepAlive=false StartInterval plist |
112
- | Linux | `cron` / `systemd --user` timer | crontab `*/30 * * * *` or a oneshot service + timer |
113
- | Windows | Task Scheduler | repeating task every 30 minutes running `autorag watch --once` under the user profile |
114
-
115
- Rules for scheduled watch:
116
-
117
- 1. Prefer `autorag watch --once` (or `autorag refresh`) over a permanent
118
- long-running `autorag watch` daemon in user agents — daemons die on reboot
119
- and are harder to supervise from skill workflows.
120
- 2. Use the same config the search path uses (`~/.autorag/config.json` or an
121
- explicit `--config` / `AUTORAG_CONFIG`).
122
- 3. Raise Node heap for large home trees: `NODE_OPTIONS=--max-old-space-size=16384`.
123
- 4. Redirect logs somewhere under the home/user temp tree, never into source
124
- document folders.
125
- 5. After install/setup, **create or verify** the scheduled job before claiming
126
- ongoing indexing is covered. Re-check with `crontab -l`, `systemctl --user list-timers`,
127
- or Task Scheduler inspection when the user asks about freshness.
128
- 6. Do not schedule concurrent overlapping ticks; if a prior refresh is still
129
- running, skip or wait (lock/log rather than stampeding MiniSync/BM25 writers).
130
-
131
- Destructive index commands:
132
-
133
- - `autorag index reset --yes` removes parsed, BM25, and MinSync directories under
134
- workspace `.autorag` only. Add `--method bm25|minsync|parsed` to scope which
135
- indexes are removed (e.g. `--method bm25` removes only the BM25 index).
136
- - `autorag index rebuild --yes` resets those indexes then forced-refreshes.
137
- `--method` scopes both the reset and the rebuild refresh.
138
-
139
- Never run reset/rebuild against source documents. `memory inspect` is
140
- read-only and path-opaque.
102
+ Reset and rebuild commands remove only selected workspace `.autorag` indexes.
103
+ Never target source documents. `memory inspect` is read-only and path-opaque.
141
104
 
142
105
  ## Rules
143
106
 
144
107
  - Use only configured and approved search paths.
145
108
  - Never expose provider credentials or authentication payloads.
146
- - Never invent or reveal private provider names or model IDs.
147
- - Never treat a consumer subscription as API access without runtime evidence.
109
+ - Never invent or reveal private provider names or model ids.
110
+ - A Pi-usable subscription is valid; a subscription Pi cannot invoke is not.
148
111
  - Preserve real source mapping and numbered feedback identifiers.
149
- - Prefer `--json` when another agent must consume the result programmatically.
112
+ - Prefer `--json` when another agent consumes the response.