scoutline 0.2.0 → 0.6.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 (110) hide show
  1. package/README.md +240 -18
  2. package/dist/capabilities/diagnostics.d.ts +70 -32
  3. package/dist/capabilities/diagnostics.d.ts.map +1 -1
  4. package/dist/capabilities/diagnostics.js +97 -46
  5. package/dist/capabilities/diagnostics.js.map +1 -1
  6. package/dist/capabilities/reader.d.ts +227 -0
  7. package/dist/capabilities/reader.d.ts.map +1 -0
  8. package/dist/capabilities/reader.js +100 -0
  9. package/dist/capabilities/reader.js.map +1 -0
  10. package/dist/capabilities/repository.d.ts +221 -0
  11. package/dist/capabilities/repository.d.ts.map +1 -0
  12. package/dist/capabilities/repository.js +172 -0
  13. package/dist/capabilities/repository.js.map +1 -0
  14. package/dist/commands/cache.d.ts +106 -0
  15. package/dist/commands/cache.d.ts.map +1 -0
  16. package/dist/commands/cache.js +203 -0
  17. package/dist/commands/cache.js.map +1 -0
  18. package/dist/commands/doctor.d.ts +17 -6
  19. package/dist/commands/doctor.d.ts.map +1 -1
  20. package/dist/commands/doctor.js +42 -17
  21. package/dist/commands/doctor.js.map +1 -1
  22. package/dist/commands/read.d.ts +74 -14
  23. package/dist/commands/read.d.ts.map +1 -1
  24. package/dist/commands/read.js +257 -117
  25. package/dist/commands/read.js.map +1 -1
  26. package/dist/commands/repo.d.ts +53 -7
  27. package/dist/commands/repo.d.ts.map +1 -1
  28. package/dist/commands/repo.js +104 -123
  29. package/dist/commands/repo.js.map +1 -1
  30. package/dist/commands/repository-explorer.d.ts +147 -0
  31. package/dist/commands/repository-explorer.d.ts.map +1 -0
  32. package/dist/commands/repository-explorer.js +550 -0
  33. package/dist/commands/repository-explorer.js.map +1 -0
  34. package/dist/index.d.ts +20 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +209 -34
  37. package/dist/index.js.map +1 -1
  38. package/dist/lib/cache.d.ts +123 -18
  39. package/dist/lib/cache.d.ts.map +1 -1
  40. package/dist/lib/cache.js +324 -49
  41. package/dist/lib/cache.js.map +1 -1
  42. package/dist/lib/errors.d.ts +24 -1
  43. package/dist/lib/errors.d.ts.map +1 -1
  44. package/dist/lib/errors.js +33 -2
  45. package/dist/lib/errors.js.map +1 -1
  46. package/dist/lib/execution.d.ts +119 -5
  47. package/dist/lib/execution.d.ts.map +1 -1
  48. package/dist/lib/execution.js +216 -10
  49. package/dist/lib/execution.js.map +1 -1
  50. package/dist/lib/index.d.ts +1 -1
  51. package/dist/lib/index.d.ts.map +1 -1
  52. package/dist/lib/index.js +1 -1
  53. package/dist/lib/index.js.map +1 -1
  54. package/dist/lib/mcp-client.d.ts +29 -5
  55. package/dist/lib/mcp-client.d.ts.map +1 -1
  56. package/dist/lib/mcp-client.js +88 -88
  57. package/dist/lib/mcp-client.js.map +1 -1
  58. package/dist/lib/tool-cache.d.ts +86 -0
  59. package/dist/lib/tool-cache.d.ts.map +1 -0
  60. package/dist/lib/tool-cache.js +123 -0
  61. package/dist/lib/tool-cache.js.map +1 -0
  62. package/dist/providers/minimax/adapter.d.ts +6 -4
  63. package/dist/providers/minimax/adapter.d.ts.map +1 -1
  64. package/dist/providers/minimax/adapter.js +64 -57
  65. package/dist/providers/minimax/adapter.js.map +1 -1
  66. package/dist/providers/minimax/coding-plan-client.d.ts +60 -0
  67. package/dist/providers/minimax/coding-plan-client.d.ts.map +1 -0
  68. package/dist/providers/minimax/coding-plan-client.js +204 -0
  69. package/dist/providers/minimax/coding-plan-client.js.map +1 -0
  70. package/dist/providers/minimax/media.d.ts +60 -6
  71. package/dist/providers/minimax/media.d.ts.map +1 -1
  72. package/dist/providers/minimax/media.js +147 -7
  73. package/dist/providers/minimax/media.js.map +1 -1
  74. package/dist/providers/minimax/quota-client.d.ts +13 -6
  75. package/dist/providers/minimax/quota-client.d.ts.map +1 -1
  76. package/dist/providers/minimax/quota-client.js +5 -0
  77. package/dist/providers/minimax/quota-client.js.map +1 -1
  78. package/dist/providers/minimax/vision-attestations.d.ts +23 -0
  79. package/dist/providers/minimax/vision-attestations.d.ts.map +1 -1
  80. package/dist/providers/minimax/vision-attestations.js +35 -10
  81. package/dist/providers/minimax/vision-attestations.js.map +1 -1
  82. package/dist/providers/minimax/vision-conformance.d.ts +8 -6
  83. package/dist/providers/minimax/vision-conformance.d.ts.map +1 -1
  84. package/dist/providers/minimax/vision-conformance.js +8 -6
  85. package/dist/providers/minimax/vision-conformance.js.map +1 -1
  86. package/dist/providers/minimax/vision-revisions.d.ts +8 -1
  87. package/dist/providers/minimax/vision-revisions.d.ts.map +1 -1
  88. package/dist/providers/minimax/vision-revisions.js +13 -6
  89. package/dist/providers/minimax/vision-revisions.js.map +1 -1
  90. package/dist/providers/selection.d.ts +3 -3
  91. package/dist/providers/selection.js +3 -3
  92. package/dist/providers/types.d.ts +66 -32
  93. package/dist/providers/types.d.ts.map +1 -1
  94. package/dist/providers/types.js.map +1 -1
  95. package/dist/providers/zai/adapter.d.ts.map +1 -1
  96. package/dist/providers/zai/adapter.js +71 -5
  97. package/dist/providers/zai/adapter.js.map +1 -1
  98. package/dist/providers/zai/encoded-error.d.ts +90 -0
  99. package/dist/providers/zai/encoded-error.d.ts.map +1 -0
  100. package/dist/providers/zai/encoded-error.js +169 -0
  101. package/dist/providers/zai/encoded-error.js.map +1 -0
  102. package/dist/providers/zai/reader.d.ts +82 -0
  103. package/dist/providers/zai/reader.d.ts.map +1 -0
  104. package/dist/providers/zai/reader.js +490 -0
  105. package/dist/providers/zai/reader.js.map +1 -0
  106. package/dist/providers/zai/repository.d.ts +76 -0
  107. package/dist/providers/zai/repository.d.ts.map +1 -0
  108. package/dist/providers/zai/repository.js +715 -0
  109. package/dist/providers/zai/repository.js.map +1 -0
  110. package/package.json +3 -3
@@ -23,6 +23,8 @@
23
23
  * 8. Apply local count truncation
24
24
  */
25
25
  import type { SearchCapability, SearchRequest, SearchSource } from "../capabilities/search.js";
26
+ import type { RepositoryOperation, RepositoryOperationKind } from "../capabilities/repository.js";
27
+ import type { ReaderFetchRequest, ReaderFetchResult, ReaderOperation, ReaderOperationKind } from "../capabilities/reader.js";
26
28
  import { type ResponseCache } from "./cache.js";
27
29
  /**
28
30
  * Retry policy for a single Provider operation. Defaults are applied
@@ -43,12 +45,29 @@ export interface ExecutionDependencies {
43
45
  sleep(ms: number): Promise<void>;
44
46
  random(): number;
45
47
  }
46
- /** Provider operations that share a single retry policy table. */
47
- export type ProviderOperation = "search" | "vision" | "quota" | "diagnostics";
48
48
  /**
49
- * Default retry policy per operation. Search, quota, and diagnostics
50
- * allow one retry; Vision allows two to preserve shipped Z.AI
51
- * behaviour. Base delay 500 ms, max delay 8000 ms, jitter up to 250 ms.
49
+ * Provider operations that share a single retry policy table.
50
+ *
51
+ * The four legacy values identify Provider Capabilities that have a
52
+ * 1:1 Capability-to-operation mapping (`"search"`, `"vision"`, ...)
53
+ * The three repository operations are composed from the P6-02
54
+ * {@link RepositoryOperationKind} source of truth so a future change
55
+ * to that union (e.g. adding a fourth repository kind) propagates
56
+ * here without further manual upkeep. The reader operation is
57
+ * composed from the Reader Migration {@link ReaderOperationKind}
58
+ * source of truth for the same reason.
59
+ */
60
+ export type ProviderOperation = "search" | "vision" | "quota" | "diagnostics" | RepositoryOperationKind | ReaderOperationKind;
61
+ /**
62
+ * Default retry policy per operation. Search, quota, diagnostics, the
63
+ * three repository operations, and the reader operation allow one
64
+ * retry; Vision allows two to preserve shipped Z.AI behaviour. Base
65
+ * delay 500 ms, max delay 8000 ms, jitter up to 250 ms.
66
+ *
67
+ * The repository and reader operations inherit the existing single-
68
+ * retry non-Vision policy (DESIGN.md §18) without altering the
69
+ * behaviour of Search/Vision/Quota/Diagnostics; the new values are
70
+ * routed through the same default branch as Search/Quota/Diagnostics.
52
71
  */
53
72
  export declare function defaultRetryPolicy(operation: ProviderOperation): RetryPolicy;
54
73
  /**
@@ -73,4 +92,99 @@ export declare function executeSearch(capability: SearchCapability, request: Sea
73
92
  noCache?: boolean;
74
93
  retryPolicy?: RetryPolicy;
75
94
  }, dependencies: ExecutionDependencies): Promise<readonly SearchSource[]>;
95
+ /**
96
+ * Options for {@link executeRepositoryOperation}. `noCache` bypasses
97
+ * the provider-partitioned cache and the legacy read-through cache
98
+ * for both reads and writes; it never bypasses validation, identity,
99
+ * invoke, or retry semantics. `retryPolicy` overrides the default
100
+ * single-retry non-Vision policy from {@link defaultRetryPolicy}.
101
+ */
102
+ export interface ExecuteRepositoryOptions {
103
+ noCache?: boolean;
104
+ retryPolicy?: RetryPolicy;
105
+ }
106
+ /**
107
+ * Generic cache + retry executor for every cacheable Repository
108
+ * Capability operation (Search, Read File, Directory Listing).
109
+ *
110
+ * The observable order is fixed and exhaustively enumerated in
111
+ * DESIGN.md §18:
112
+ *
113
+ * 1. `operation.validate(request)` — throws `ValidationError`
114
+ * synchronously before any cache or Adapter work.
115
+ * 2. `operation.cacheIdentity(request)` — Adapter computes the
116
+ * provider-partitioned cache key and ordered legacy candidates
117
+ * from the validated request and a single resolved credential.
118
+ * 3. Read the provider-partitioned cache key and pass the raw value
119
+ * through `operation.decodeCached`. A valid decode returns
120
+ * immediately; `null` is a miss; malformed values never propagate
121
+ * through a generic cast.
122
+ * 4. For each legacy candidate, in declaration order, read the
123
+ * legacy key and pass it through the candidate's `decode`. A
124
+ * valid legacy hit is written through to the normalized key
125
+ * (the legacy file is never changed or deleted) and returned.
126
+ * A malformed legacy value is a miss.
127
+ * 5. `operation.invoke(request)` is wrapped through
128
+ * `executeProviderOperation` with the existing single-retry
129
+ * non-Vision policy. Each retry creates a fresh Adapter
130
+ * transport attempt; cache hits create no transport.
131
+ * 6. The normalized result is written to the provider-partitioned
132
+ * cache key.
133
+ *
134
+ * `--no-cache` skips steps 3, 4, and 6. It never skips validation
135
+ * (1), identity (2), invoke (5), or retry semantics.
136
+ *
137
+ * `executeRepositoryOperation` imports no Z.AI, MiniMax, MCP, UTCP,
138
+ * command-output, BFS, selection, or presentation module.
139
+ */
140
+ export declare function executeRepositoryOperation<Request, Result>(operation: RepositoryOperation<Request, Result>, request: Request, options: ExecuteRepositoryOptions, dependencies: ExecutionDependencies): Promise<Result>;
141
+ /**
142
+ * Options for {@link executeReaderOperation}. `noCache` bypasses the
143
+ * provider-partitioned cache and the legacy read-through cache for
144
+ * both reads and writes; it never bypasses validation, identity,
145
+ * invoke, or retry semantics. `retryPolicy` overrides the default
146
+ * single-retry non-Vision policy from {@link defaultRetryPolicy}.
147
+ */
148
+ export interface ExecuteReaderOptions {
149
+ noCache?: boolean;
150
+ retryPolicy?: RetryPolicy;
151
+ }
152
+ /**
153
+ * Generic cache + retry executor for the Reader Capability's
154
+ * `reader-fetch` operation. Structurally identical to
155
+ * {@link executeRepositoryOperation}; the two are duplicated rather
156
+ * than shared because factoring them would widen this ticket's
157
+ * scope (modifying repository.ts further). Future consolidation is
158
+ * a separate refactor.
159
+ *
160
+ * The observable order is fixed:
161
+ *
162
+ * 1. `operation.validate(request)` — throws `ValidationError`
163
+ * synchronously before any cache or Adapter work.
164
+ * 2. `operation.cacheIdentity(request)` — Adapter computes the
165
+ * provider-partitioned cache key and ordered legacy candidates
166
+ * from the validated request and a single resolved credential.
167
+ * 3. Read the provider-partitioned cache key and pass the raw
168
+ * value through `operation.decodeCached`. A valid decode
169
+ * returns immediately; `null` is a miss; malformed values
170
+ * never propagate through a generic cast.
171
+ * 4. For each legacy candidate, in declaration order, read the
172
+ * legacy key and pass it through the candidate's `decode`. A
173
+ * valid legacy hit is written through to the normalized key
174
+ * (the legacy file is never changed or deleted) and returned.
175
+ * A malformed legacy value is a miss.
176
+ * 5. `operation.invoke(request)` is wrapped through
177
+ * `executeProviderOperation` with the single-retry non-Vision
178
+ * policy. Each retry creates a fresh Adapter transport attempt;
179
+ * cache hits create no transport.
180
+ * 6. The normalized result is written to the provider-partitioned
181
+ * cache key.
182
+ *
183
+ * `--no-cache` skips steps 3, 4, and 6. It never skips validation
184
+ * (1), identity (2), invoke (5), or retry semantics.
185
+ *
186
+ * `executeReaderOperation` imports no Z.AI, MiniMax, MCP, UTCP,
187
+ * command-output, selection, or presentation module.
188
+ */
189
+ export declare function executeReaderOperation(operation: ReaderOperation<ReaderFetchRequest, ReaderFetchResult>, request: ReaderFetchRequest, options: ExecuteReaderOptions, dependencies: ExecutionDependencies): Promise<ReaderFetchResult>;
76
190
  //# sourceMappingURL=execution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/lib/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE/F,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAMvE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,IAAI,MAAM,CAAC;CAClB;AAED,kEAAkE;AAClE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,GAAG,WAAW,CAe5E;AAkCD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,SAAS,EAAE,iBAAiB,EAC5B,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,YAAY,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,QAAQ,CAAC,EAC7D,WAAW,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;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,eAAe,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,EACjE,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,oBAAoB,EAC7B,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAkE5B"}
@@ -28,9 +28,15 @@ const DEFAULT_BASE_DELAY_MS = 500;
28
28
  const DEFAULT_MAX_DELAY_MS = 8000;
29
29
  const DEFAULT_JITTER_MS = 250;
30
30
  /**
31
- * Default retry policy per operation. Search, quota, and diagnostics
32
- * allow one retry; Vision allows two to preserve shipped Z.AI
33
- * behaviour. Base delay 500 ms, max delay 8000 ms, jitter up to 250 ms.
31
+ * Default retry policy per operation. Search, quota, diagnostics, the
32
+ * three repository operations, and the reader operation allow one
33
+ * retry; Vision allows two to preserve shipped Z.AI behaviour. Base
34
+ * delay 500 ms, max delay 8000 ms, jitter up to 250 ms.
35
+ *
36
+ * The repository and reader operations inherit the existing single-
37
+ * retry non-Vision policy (DESIGN.md §18) without altering the
38
+ * behaviour of Search/Vision/Quota/Diagnostics; the new values are
39
+ * routed through the same default branch as Search/Quota/Diagnostics.
34
40
  */
35
41
  export function defaultRetryPolicy(operation) {
36
42
  const base = {
@@ -44,6 +50,10 @@ export function defaultRetryPolicy(operation) {
44
50
  case "search":
45
51
  case "quota":
46
52
  case "diagnostics":
53
+ case "repository-search":
54
+ case "repository-read-file":
55
+ case "repository-list-directory":
56
+ case "reader-fetch":
47
57
  default:
48
58
  return { ...base, maxRetries: 1 };
49
59
  }
@@ -52,7 +62,13 @@ export function defaultRetryPolicy(operation) {
52
62
  * Classify whether a normalized error is retryable for a Provider
53
63
  * operation. Authentication, validation, unsupported, content-policy,
54
64
  * and exhausted-quota failures are terminal. Normalized timeout,
55
- * network, HTTP 429, 500, 502, 503, and 504 equivalents are retryable.
65
+ * network, HTTP 429, and any 5xx (statusCode 500..599, inclusive)
66
+ * equivalents are retryable.
67
+ *
68
+ * The 5xx range is matched as a closed interval so Provider-encoded
69
+ * statuses that the upstream gateway passes through verbatim (501,
70
+ * 505, 599, etc.) retry exactly once, matching Design §18 and
71
+ * FR-090. Other 4xx codes remain terminal.
56
72
  *
57
73
  * An explicit `retryable: true` on a `ScoutlineError` wins; an explicit
58
74
  * `retryable: false` overrides a code-based default. Non-Scoutline
@@ -69,12 +85,13 @@ function isOperationRetryableError(error) {
69
85
  case "TIMEOUT_ERROR":
70
86
  case "NETWORK_ERROR":
71
87
  return true;
72
- case "API_ERROR":
73
- return (error.statusCode === 429 ||
74
- error.statusCode === 500 ||
75
- error.statusCode === 502 ||
76
- error.statusCode === 503 ||
77
- error.statusCode === 504);
88
+ case "API_ERROR": {
89
+ // Design §18 / FR-090: 429 and any 5xx (500..599 inclusive) retry
90
+ // once. The interval is closed so encoded Provider statuses that
91
+ // pass through verbatim (501, 505, 599, ...) match the contract.
92
+ const status = error.statusCode;
93
+ return status !== undefined && (status === 429 || (status >= 500 && status <= 599));
94
+ }
78
95
  default:
79
96
  return false;
80
97
  }
@@ -174,4 +191,193 @@ export async function executeSearch(capability, request, options, dependencies)
174
191
  // 8. Local count truncation.
175
192
  return applyCount(result, options.count);
176
193
  }
194
+ /**
195
+ * Generic cache + retry executor for every cacheable Repository
196
+ * Capability operation (Search, Read File, Directory Listing).
197
+ *
198
+ * The observable order is fixed and exhaustively enumerated in
199
+ * DESIGN.md §18:
200
+ *
201
+ * 1. `operation.validate(request)` — throws `ValidationError`
202
+ * synchronously before any cache or Adapter work.
203
+ * 2. `operation.cacheIdentity(request)` — Adapter computes the
204
+ * provider-partitioned cache key and ordered legacy candidates
205
+ * from the validated request and a single resolved credential.
206
+ * 3. Read the provider-partitioned cache key and pass the raw value
207
+ * through `operation.decodeCached`. A valid decode returns
208
+ * immediately; `null` is a miss; malformed values never propagate
209
+ * through a generic cast.
210
+ * 4. For each legacy candidate, in declaration order, read the
211
+ * legacy key and pass it through the candidate's `decode`. A
212
+ * valid legacy hit is written through to the normalized key
213
+ * (the legacy file is never changed or deleted) and returned.
214
+ * A malformed legacy value is a miss.
215
+ * 5. `operation.invoke(request)` is wrapped through
216
+ * `executeProviderOperation` with the existing single-retry
217
+ * non-Vision policy. Each retry creates a fresh Adapter
218
+ * transport attempt; cache hits create no transport.
219
+ * 6. The normalized result is written to the provider-partitioned
220
+ * cache key.
221
+ *
222
+ * `--no-cache` skips steps 3, 4, and 6. It never skips validation
223
+ * (1), identity (2), invoke (5), or retry semantics.
224
+ *
225
+ * `executeRepositoryOperation` imports no Z.AI, MiniMax, MCP, UTCP,
226
+ * command-output, BFS, selection, or presentation module.
227
+ */
228
+ export async function executeRepositoryOperation(operation, request, options, dependencies) {
229
+ // 1. Validate Capability request.
230
+ operation.validate(request);
231
+ // 2. Adapter-owned cache identity (after validation). The Adapter
232
+ // resolves its credential exactly once and returns legacy
233
+ // candidates alongside the full fingerprint and canonical
234
+ // request. Candidate construction performs no ambient
235
+ // environment read.
236
+ const identity = operation.cacheIdentity(request);
237
+ // 3. Provider-partitioned cache key.
238
+ //
239
+ // The key namespace is `<capability>-<operation>` rather than the
240
+ // umbrella Capability alone, so File and Directory operations —
241
+ // which share the `{ repository, path }` request shape — cannot
242
+ // collide. This composes the existing `buildProviderCacheKey` slot
243
+ // without mutating `buildProviderCacheKey` or its existing callers
244
+ // (Search, Vision, Quota, Diagnostics still pass a single Capability
245
+ // name). The canonical request object is unchanged; only the
246
+ // capability argument gains the operation suffix.
247
+ const newKey = buildProviderCacheKey({
248
+ provider: identity.provider,
249
+ capability: `${identity.capability}-${identity.operation}`,
250
+ credentialFingerprint: identity.credentialFingerprint,
251
+ request: identity.request,
252
+ });
253
+ if (!options.noCache) {
254
+ const raw = await dependencies.cache.get(newKey);
255
+ if (raw !== null) {
256
+ const decoded = operation.decodeCached(raw);
257
+ if (decoded !== null) {
258
+ return decoded;
259
+ }
260
+ // Malformed normalized value: treat as a miss and fall through.
261
+ }
262
+ // 4. Ordered legacy candidates. Each candidate's decode is
263
+ // total — invalid raw data is a miss. A valid legacy hit
264
+ // populates the new key but the legacy file is never
265
+ // changed or deleted.
266
+ for (const candidate of identity.legacyCandidates) {
267
+ const legacyRaw = await dependencies.cache.get(candidate.key);
268
+ if (legacyRaw === null)
269
+ continue;
270
+ const decoded = candidate.decode(legacyRaw);
271
+ if (decoded !== null) {
272
+ await dependencies.cache.set(newKey, decoded);
273
+ return decoded;
274
+ }
275
+ }
276
+ }
277
+ // 5. Retry-wrapped invoke. Auth, Validation, Unsupported, and
278
+ // exhausted Quota failures are terminal; transient timeout,
279
+ // network, and 5xx/429-equivalent failures get one retry.
280
+ const result = await executeProviderOperation(
281
+ // `operation.kind` is `RepositoryOperationKind`, which is
282
+ // composed into `ProviderOperation` directly — no cast needed
283
+ // and a future kind union change propagates automatically.
284
+ operation.kind, () => operation.invoke(request), dependencies, options.retryPolicy);
285
+ // 6. Cache the full normalized result before returning.
286
+ if (!options.noCache) {
287
+ await dependencies.cache.set(newKey, result);
288
+ }
289
+ return result;
290
+ }
291
+ /**
292
+ * Generic cache + retry executor for the Reader Capability's
293
+ * `reader-fetch` operation. Structurally identical to
294
+ * {@link executeRepositoryOperation}; the two are duplicated rather
295
+ * than shared because factoring them would widen this ticket's
296
+ * scope (modifying repository.ts further). Future consolidation is
297
+ * a separate refactor.
298
+ *
299
+ * The observable order is fixed:
300
+ *
301
+ * 1. `operation.validate(request)` — throws `ValidationError`
302
+ * synchronously before any cache or Adapter work.
303
+ * 2. `operation.cacheIdentity(request)` — Adapter computes the
304
+ * provider-partitioned cache key and ordered legacy candidates
305
+ * from the validated request and a single resolved credential.
306
+ * 3. Read the provider-partitioned cache key and pass the raw
307
+ * value through `operation.decodeCached`. A valid decode
308
+ * returns immediately; `null` is a miss; malformed values
309
+ * never propagate through a generic cast.
310
+ * 4. For each legacy candidate, in declaration order, read the
311
+ * legacy key and pass it through the candidate's `decode`. A
312
+ * valid legacy hit is written through to the normalized key
313
+ * (the legacy file is never changed or deleted) and returned.
314
+ * A malformed legacy value is a miss.
315
+ * 5. `operation.invoke(request)` is wrapped through
316
+ * `executeProviderOperation` with the single-retry non-Vision
317
+ * policy. Each retry creates a fresh Adapter transport attempt;
318
+ * cache hits create no transport.
319
+ * 6. The normalized result is written to the provider-partitioned
320
+ * cache key.
321
+ *
322
+ * `--no-cache` skips steps 3, 4, and 6. It never skips validation
323
+ * (1), identity (2), invoke (5), or retry semantics.
324
+ *
325
+ * `executeReaderOperation` imports no Z.AI, MiniMax, MCP, UTCP,
326
+ * command-output, selection, or presentation module.
327
+ */
328
+ export async function executeReaderOperation(operation, request, options, dependencies) {
329
+ // 1. Validate Capability request.
330
+ operation.validate(request);
331
+ // 2. Adapter-owned cache identity (after validation). The Adapter
332
+ // resolves its credential exactly once and returns legacy
333
+ // candidates alongside the full fingerprint and canonical
334
+ // request. Candidate construction performs no ambient
335
+ // environment read.
336
+ const identity = operation.cacheIdentity(request);
337
+ // 3. Provider-partitioned cache key.
338
+ //
339
+ // The key namespace is `${capability}-${operation}` rather than the
340
+ // umbrella Capability alone, mirroring the repository convention so
341
+ // future Reader operations cannot collide. The capability argument
342
+ // gains the operation suffix.
343
+ const newKey = buildProviderCacheKey({
344
+ provider: identity.provider,
345
+ capability: `${identity.capability}-${identity.operation}`,
346
+ credentialFingerprint: identity.credentialFingerprint,
347
+ request: identity.request,
348
+ });
349
+ if (!options.noCache) {
350
+ const raw = await dependencies.cache.get(newKey);
351
+ if (raw !== null) {
352
+ const decoded = operation.decodeCached(raw);
353
+ if (decoded !== null) {
354
+ return decoded;
355
+ }
356
+ // Malformed normalized value: treat as a miss and fall through.
357
+ }
358
+ // 4. Ordered legacy candidates. Each candidate's decode is
359
+ // total — invalid raw data is a miss. A valid legacy hit
360
+ // populates the new key but the legacy file is never
361
+ // changed or deleted.
362
+ for (const candidate of identity.legacyCandidates) {
363
+ const legacyRaw = await dependencies.cache.get(candidate.key);
364
+ if (legacyRaw === null)
365
+ continue;
366
+ const decoded = candidate.decode(legacyRaw);
367
+ if (decoded !== null) {
368
+ await dependencies.cache.set(newKey, decoded);
369
+ return decoded;
370
+ }
371
+ }
372
+ }
373
+ // 5. Retry-wrapped invoke. Auth, Validation, Unsupported, and
374
+ // exhausted Quota failures are terminal; transient timeout,
375
+ // network, and 5xx/429-equivalent failures get one retry.
376
+ const result = await executeProviderOperation(operation.kind, () => operation.invoke(request), dependencies, options.retryPolicy);
377
+ // 6. Cache the full normalized result before returning.
378
+ if (!options.noCache) {
379
+ await dependencies.cache.set(newKey, result);
380
+ }
381
+ return result;
382
+ }
177
383
  //# sourceMappingURL=execution.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/lib/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAsB,MAAM,YAAY,CAAC;AA8BvE,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAClC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA4B;IAC7D,MAAM,IAAI,GAAG;QACX,WAAW,EAAE,qBAAqB;QAClC,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;IACF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACpC,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO,CAAC;QACb,KAAK,aAAa,CAAC;QACnB;YACE,OAAO,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,yBAAyB,CAAC,KA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AO,CAAC;YACjB,CAAC;YACD,gEAAgE;QAClE,CAAC;QAED,2DAA2D;QAC3D,4DAA4D;QAC5D,wDAAwD;QACxD,yBAAyB;QACzB,KAAK,MAAM,SAAS,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;YAClD,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,CAAU,SAAS,CAAC,GAAG,CAAC,CAAC;YACvE,IAAI,SAAS,KAAK,IAAI;gBAAE,SAAS;YACjC,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAC9C,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IAED,8DAA8D;IAC9D,+DAA+D;IAC/D,6DAA6D;IAC7D,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAC3C,SAAS,CAAC,IAAI,EACd,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,EAC/B,YAAY,EACZ,OAAO,CAAC,WAAW,CACpB,CAAC;IAEF,wDAAwD;IACxD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -10,7 +10,7 @@
10
10
  * wins through `export *` below.
11
11
  */
12
12
  export * from "./config.js";
13
- export { type ScoutlineErrorCode, type ScoutlineErrorOptions, ScoutlineError, ZaiError, ValidationError, ConfigurationError, UnsupportedCapabilityError, UnsupportedOptionError, AuthError, ApiError, NetworkError, TimeoutError, FileError, isRetryableError, getErrorExitCode, } from "./errors.js";
13
+ export { type ScoutlineErrorCode, type ScoutlineErrorOptions, ScoutlineError, ZaiError, ValidationError, ConfigurationError, UnsupportedCapabilityError, UnsupportedOptionError, AuthError, ApiError, NetworkError, TimeoutError, FileError, QuotaError, isRetryableError, getErrorExitCode, } from "./errors.js";
14
14
  export * from "./output.js";
15
15
  export * from "./image.js";
16
16
  export * from "./api-client.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
package/dist/lib/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * wins through `export *` below.
11
11
  */
12
12
  export * from "./config.js";
13
- export { ScoutlineError, ZaiError, ValidationError, ConfigurationError, UnsupportedCapabilityError, UnsupportedOptionError, AuthError, ApiError, NetworkError, TimeoutError, FileError, isRetryableError, getErrorExitCode, } from "./errors.js";
13
+ export { ScoutlineError, ZaiError, ValidationError, ConfigurationError, UnsupportedCapabilityError, UnsupportedOptionError, AuthError, ApiError, NetworkError, TimeoutError, FileError, QuotaError, isRetryableError, getErrorExitCode, } from "./errors.js";
14
14
  export * from "./output.js";
15
15
  export * from "./image.js";
16
16
  export * from "./api-client.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC;AAC5B,OAAO,EAGL,cAAc,EACd,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,aAAa,CAAC;AAC5B,OAAO,EAGL,cAAc,EACd,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import { UtcpClient, type Tool } from "@utcp/sdk";
11
11
  import "@utcp/mcp";
12
+ import type { ReaderRawResponse } from "../capabilities/reader.js";
12
13
  export interface ZReadSearchResult {
13
14
  title: string;
14
15
  content: string;
@@ -63,10 +64,14 @@ export declare class ZaiMcpClient {
63
64
  private getRetryCount;
64
65
  private isRetriableError;
65
66
  private resolveEnableVision;
66
- private getToolCacheKey;
67
- private getToolCachePath;
68
- private readToolsCache;
69
- private writeToolsCache;
67
+ /**
68
+ * Build the tool-cache config (D4 — adapter encapsulates the
69
+ * config + endpoints + vision-resolution inputs that the extracted
70
+ * `tool-cache.ts` needs to compute a stable key). Owned here because
71
+ * the inputs come from this class's options and the shared config
72
+ * module; the extracted module stays pure of `loadConfig` / `getMcpEndpoints`.
73
+ */
74
+ private getToolCacheConfig;
70
75
  /**
71
76
  * List all discovered tools from registered MCP servers.
72
77
  *
@@ -81,6 +86,9 @@ export declare class ZaiMcpClient {
81
86
  * Private unprojected discovery list. Tools keep their exact UTCP
82
87
  * names so {@link getTool} can resolve public aliases back to the
83
88
  * internal invocation identity.
89
+ *
90
+ * Tool-cache I/O is delegated to the extracted {@link tool-cache.ts}
91
+ * module (D1 — owns its I/O directly against the `tools/` subdir).
84
92
  */
85
93
  private discoverTools;
86
94
  /**
@@ -107,6 +115,22 @@ export declare class ZaiMcpClient {
107
115
  * Call a tool by full name or suffix
108
116
  */
109
117
  callToolRaw<T>(toolName: string, args: Record<string, unknown>): Promise<T>;
118
+ /**
119
+ * P6-01A: invoke a tool while preserving the public dotted tool name as
120
+ * the cache identity, then resolve to the internal sanitized identity
121
+ * only on a cache miss.
122
+ *
123
+ * The legacy v0.2 repository cache contract (P0–P2) keyed entries under
124
+ * the public dotted name and returned them before any transport work.
125
+ * A naive `callToolRaw` migration routes through `resolveToolName` first,
126
+ * which forces discovery, registration, and `init()` even when a v0.2
127
+ * hit is present. This helper restores the legacy cache identity and
128
+ * skips discovery on hits while keeping the translation fix for misses.
129
+ *
130
+ * Other callers (`callTool`, `callToolRaw`, Vision, Search, Reader, raw
131
+ * tools) are unchanged.
132
+ */
133
+ private callToolWithPublicCacheIdentity;
110
134
  /**
111
135
  * Search documentation and code in a GitHub repository
112
136
  */
@@ -143,7 +167,7 @@ export declare class ZaiMcpClient {
143
167
  noGfm?: boolean;
144
168
  keepImgDataUrl?: boolean;
145
169
  withImagesSummary?: boolean;
146
- }): Promise<string>;
170
+ }): Promise<ReaderRawResponse>;
147
171
  visionAnalyze(params: {
148
172
  imageSource: string;
149
173
  prompt: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../src/lib/mcp-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,WAAW,CAAC;AAkDnB,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,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