acp-kernel 0.0.40 → 0.0.41-pr.135.2
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.
- package/dist/compress-tools.d.ts +669 -0
- package/dist/compress-tools.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +361 -0
- package/dist/index.js.map +1 -1
- package/dist/persist/index.js +40 -8
- package/dist/persist/index.js.map +1 -1
- package/dist/persist/store.d.ts +28 -3
- package/dist/persist/store.d.ts.map +1 -1
- package/dist/wire/compress-detect.d.ts +142 -0
- package/dist/wire/compress-detect.d.ts.map +1 -0
- package/dist/wire/index.d.ts +1 -0
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +189 -1
- package/dist/wire/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACP tool surface: the tool schemas (Anthropic / OpenAI chat / Responses
|
|
3
|
+
* flat), the system-prompt builders for the three protocols (function tools,
|
|
4
|
+
* text triggers, hybrid), and the lenient compress-argument parser.
|
|
5
|
+
*
|
|
6
|
+
* Single source for every downstream that injects the ACP tools into a
|
|
7
|
+
* request (the billion-context proxy on the wire; hosts via their own tool
|
|
8
|
+
* registration). The content is static — no transport, no state, no host
|
|
9
|
+
* types. Moved from billion-context `src/compress-tool.ts` (Phase K1).
|
|
10
|
+
*/
|
|
11
|
+
import { type Prompts } from "./prompts.js";
|
|
12
|
+
export declare const COMPRESS_TOOL_NAME = "compress";
|
|
13
|
+
export declare const DECOMPRESS_TOOL_NAME = "decompress";
|
|
14
|
+
export declare const SEARCH_CONTEXT_TOOL_NAME = "search_context";
|
|
15
|
+
export declare const ACP_STATUS_TOOL_NAME = "acp_status";
|
|
16
|
+
/** Text-protocol trigger tags. The model emits these in its text output to
|
|
17
|
+
* request compression (used when host client tools cannot coexist with a
|
|
18
|
+
* declared `tools` field — e.g. OpenAI Codex code_mode). Distinct from the
|
|
19
|
+
* `<acp tokens=...>` history tags so they never collide. */
|
|
20
|
+
export declare const ACP_TEXT_OPEN = "<acp_compress>";
|
|
21
|
+
export declare const ACP_TEXT_CLOSE = "</acp_compress>";
|
|
22
|
+
export declare const ACP_STATUS_OPEN = "<acp_status>";
|
|
23
|
+
export declare const ACP_STATUS_CLOSE = "</acp_status>";
|
|
24
|
+
export declare const ACP_SEARCH_OPEN = "<acp_search>";
|
|
25
|
+
export declare const ACP_SEARCH_CLOSE = "</acp_search>";
|
|
26
|
+
export declare const ACP_DECOMPRESS_OPEN = "<acp_decompress>";
|
|
27
|
+
export declare const ACP_DECOMPRESS_CLOSE = "</acp_decompress>";
|
|
28
|
+
export declare const COMPRESS_TOOL: {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
input_schema: {
|
|
32
|
+
type: string;
|
|
33
|
+
properties: {
|
|
34
|
+
topic: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
content: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
items: {
|
|
42
|
+
type: string;
|
|
43
|
+
properties: {
|
|
44
|
+
topic: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
startId: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
endId: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
summary: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
required: string[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
required: string[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type ParsedRange = {
|
|
68
|
+
startRef: string;
|
|
69
|
+
endRef: string;
|
|
70
|
+
summary: string;
|
|
71
|
+
topic?: string;
|
|
72
|
+
compressCallId?: string;
|
|
73
|
+
};
|
|
74
|
+
/** Lenient parse of a compress tool-call argument object into ranges.
|
|
75
|
+
* Accepts `content` as an array or a JSON-encoded string (non-strict-tool
|
|
76
|
+
* providers stringify array args, e.g. vLLM openai-completions), a single
|
|
77
|
+
* range object at the top level, and both startId/startRef spellings.
|
|
78
|
+
* `onWarn` receives diagnostics for rejected shapes — the kernel stays
|
|
79
|
+
* side-effect free, downstream wires its logger. */
|
|
80
|
+
export declare function parseCompressInput(input: unknown, callId?: string, onWarn?: (message: string) => void): ParsedRange[];
|
|
81
|
+
export declare const COMPRESS_TOOL_OPENAI: {
|
|
82
|
+
type: "function";
|
|
83
|
+
function: {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
parameters: {
|
|
87
|
+
type: string;
|
|
88
|
+
properties: {
|
|
89
|
+
topic: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
content: {
|
|
94
|
+
type: string;
|
|
95
|
+
description: string;
|
|
96
|
+
items: {
|
|
97
|
+
type: string;
|
|
98
|
+
properties: {
|
|
99
|
+
topic: {
|
|
100
|
+
type: string;
|
|
101
|
+
};
|
|
102
|
+
startId: {
|
|
103
|
+
type: string;
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
106
|
+
endId: {
|
|
107
|
+
type: string;
|
|
108
|
+
description: string;
|
|
109
|
+
};
|
|
110
|
+
summary: {
|
|
111
|
+
type: string;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
required: string[];
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
required: string[];
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export declare function buildCompressSystemPrompt(prompts?: Prompts): string;
|
|
124
|
+
/** Text-protocol compress prompt. Used when the host (e.g. OpenAI Codex
|
|
125
|
+
* code_mode) cannot coexist with a declared `tools` array. The model emits
|
|
126
|
+
* the trigger tags in its text output instead of calling a function tool.
|
|
127
|
+
* Only compress is available via this protocol (decompress/search/status
|
|
128
|
+
* require real tools). */
|
|
129
|
+
export declare function buildCompressTextSystemPrompt(prompts?: Prompts): string;
|
|
130
|
+
/** Hybrid protocol prompt (codex): compress stays a text marker (batch + STOP
|
|
131
|
+
* is a poor fit for a single function call), while decompress/search_context/
|
|
132
|
+
* acp_status are real function tools the model calls directly. The compress
|
|
133
|
+
* loop already merges text triggers and function tool_calls, so both paths
|
|
134
|
+
* coexist in one turn. */
|
|
135
|
+
export declare function buildCompressHybridSystemPrompt(prompts?: Prompts): string;
|
|
136
|
+
export declare const DECOMPRESS_TOOL_OPENAI: {
|
|
137
|
+
type: "function";
|
|
138
|
+
function: {
|
|
139
|
+
name: string;
|
|
140
|
+
description: string;
|
|
141
|
+
parameters: {
|
|
142
|
+
type: string;
|
|
143
|
+
properties: {
|
|
144
|
+
blockId: {
|
|
145
|
+
type: string;
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
toFile: {
|
|
149
|
+
type: string;
|
|
150
|
+
description: string;
|
|
151
|
+
};
|
|
152
|
+
full: {
|
|
153
|
+
type: string;
|
|
154
|
+
description: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
required: string[];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
export declare const SEARCH_CONTEXT_TOOL_OPENAI: {
|
|
162
|
+
type: "function";
|
|
163
|
+
function: {
|
|
164
|
+
name: string;
|
|
165
|
+
description: string;
|
|
166
|
+
parameters: {
|
|
167
|
+
type: string;
|
|
168
|
+
properties: {
|
|
169
|
+
query: {
|
|
170
|
+
type: string;
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
173
|
+
limit: {
|
|
174
|
+
type: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
required: string[];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
export declare const ACP_STATUS_TOOL_OPENAI: {
|
|
183
|
+
type: "function";
|
|
184
|
+
function: {
|
|
185
|
+
name: string;
|
|
186
|
+
description: string;
|
|
187
|
+
parameters: {
|
|
188
|
+
type: string;
|
|
189
|
+
properties: {};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export declare const ACP_TOOLS_OPENAI: readonly [{
|
|
194
|
+
type: "function";
|
|
195
|
+
function: {
|
|
196
|
+
name: string;
|
|
197
|
+
description: string;
|
|
198
|
+
parameters: {
|
|
199
|
+
type: string;
|
|
200
|
+
properties: {
|
|
201
|
+
topic: {
|
|
202
|
+
type: string;
|
|
203
|
+
description: string;
|
|
204
|
+
};
|
|
205
|
+
content: {
|
|
206
|
+
type: string;
|
|
207
|
+
description: string;
|
|
208
|
+
items: {
|
|
209
|
+
type: string;
|
|
210
|
+
properties: {
|
|
211
|
+
topic: {
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
startId: {
|
|
215
|
+
type: string;
|
|
216
|
+
description: string;
|
|
217
|
+
};
|
|
218
|
+
endId: {
|
|
219
|
+
type: string;
|
|
220
|
+
description: string;
|
|
221
|
+
};
|
|
222
|
+
summary: {
|
|
223
|
+
type: string;
|
|
224
|
+
description: string;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
required: string[];
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
required: string[];
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
}, {
|
|
235
|
+
type: "function";
|
|
236
|
+
function: {
|
|
237
|
+
name: string;
|
|
238
|
+
description: string;
|
|
239
|
+
parameters: {
|
|
240
|
+
type: string;
|
|
241
|
+
properties: {
|
|
242
|
+
blockId: {
|
|
243
|
+
type: string;
|
|
244
|
+
description: string;
|
|
245
|
+
};
|
|
246
|
+
toFile: {
|
|
247
|
+
type: string;
|
|
248
|
+
description: string;
|
|
249
|
+
};
|
|
250
|
+
full: {
|
|
251
|
+
type: string;
|
|
252
|
+
description: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
required: string[];
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
}, {
|
|
259
|
+
type: "function";
|
|
260
|
+
function: {
|
|
261
|
+
name: string;
|
|
262
|
+
description: string;
|
|
263
|
+
parameters: {
|
|
264
|
+
type: string;
|
|
265
|
+
properties: {
|
|
266
|
+
query: {
|
|
267
|
+
type: string;
|
|
268
|
+
description: string;
|
|
269
|
+
};
|
|
270
|
+
limit: {
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
required: string[];
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
}, {
|
|
279
|
+
type: "function";
|
|
280
|
+
function: {
|
|
281
|
+
name: string;
|
|
282
|
+
description: string;
|
|
283
|
+
parameters: {
|
|
284
|
+
type: string;
|
|
285
|
+
properties: {};
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
}];
|
|
289
|
+
/** Anthropic-format tools (name + description + input_schema). The Anthropic
|
|
290
|
+
* request path (ZCode, Claude Code) injects all four so the model can
|
|
291
|
+
* actually call compress/decompress/search_context/acp_status — the system
|
|
292
|
+
* prompt describes all four, so declaring only COMPRESS_TOOL left the model
|
|
293
|
+
* able to see the docs but unable to call the rest. */
|
|
294
|
+
export declare const DECOMPRESS_TOOL: {
|
|
295
|
+
name: string;
|
|
296
|
+
description: string;
|
|
297
|
+
input_schema: {
|
|
298
|
+
type: string;
|
|
299
|
+
properties: {
|
|
300
|
+
blockId: {
|
|
301
|
+
type: string;
|
|
302
|
+
description: string;
|
|
303
|
+
};
|
|
304
|
+
toFile: {
|
|
305
|
+
type: string;
|
|
306
|
+
description: string;
|
|
307
|
+
};
|
|
308
|
+
full: {
|
|
309
|
+
type: string;
|
|
310
|
+
description: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
required: string[];
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
export declare const SEARCH_CONTEXT_TOOL: {
|
|
317
|
+
name: string;
|
|
318
|
+
description: string;
|
|
319
|
+
input_schema: {
|
|
320
|
+
type: string;
|
|
321
|
+
properties: {
|
|
322
|
+
query: {
|
|
323
|
+
type: string;
|
|
324
|
+
description: string;
|
|
325
|
+
};
|
|
326
|
+
limit: {
|
|
327
|
+
type: string;
|
|
328
|
+
description: string;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
required: string[];
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
export declare const ACP_STATUS_TOOL: {
|
|
335
|
+
name: string;
|
|
336
|
+
description: string;
|
|
337
|
+
input_schema: {
|
|
338
|
+
type: string;
|
|
339
|
+
properties: {};
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
export declare const ACP_TOOLS_ANTHROPIC: readonly [{
|
|
343
|
+
name: string;
|
|
344
|
+
description: string;
|
|
345
|
+
input_schema: {
|
|
346
|
+
type: string;
|
|
347
|
+
properties: {
|
|
348
|
+
topic: {
|
|
349
|
+
type: string;
|
|
350
|
+
description: string;
|
|
351
|
+
};
|
|
352
|
+
content: {
|
|
353
|
+
type: string;
|
|
354
|
+
description: string;
|
|
355
|
+
items: {
|
|
356
|
+
type: string;
|
|
357
|
+
properties: {
|
|
358
|
+
topic: {
|
|
359
|
+
type: string;
|
|
360
|
+
};
|
|
361
|
+
startId: {
|
|
362
|
+
type: string;
|
|
363
|
+
description: string;
|
|
364
|
+
};
|
|
365
|
+
endId: {
|
|
366
|
+
type: string;
|
|
367
|
+
description: string;
|
|
368
|
+
};
|
|
369
|
+
summary: {
|
|
370
|
+
type: string;
|
|
371
|
+
description: string;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
required: string[];
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
required: string[];
|
|
379
|
+
};
|
|
380
|
+
}, {
|
|
381
|
+
name: string;
|
|
382
|
+
description: string;
|
|
383
|
+
input_schema: {
|
|
384
|
+
type: string;
|
|
385
|
+
properties: {
|
|
386
|
+
blockId: {
|
|
387
|
+
type: string;
|
|
388
|
+
description: string;
|
|
389
|
+
};
|
|
390
|
+
toFile: {
|
|
391
|
+
type: string;
|
|
392
|
+
description: string;
|
|
393
|
+
};
|
|
394
|
+
full: {
|
|
395
|
+
type: string;
|
|
396
|
+
description: string;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
required: string[];
|
|
400
|
+
};
|
|
401
|
+
}, {
|
|
402
|
+
name: string;
|
|
403
|
+
description: string;
|
|
404
|
+
input_schema: {
|
|
405
|
+
type: string;
|
|
406
|
+
properties: {
|
|
407
|
+
query: {
|
|
408
|
+
type: string;
|
|
409
|
+
description: string;
|
|
410
|
+
};
|
|
411
|
+
limit: {
|
|
412
|
+
type: string;
|
|
413
|
+
description: string;
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
required: string[];
|
|
417
|
+
};
|
|
418
|
+
}, {
|
|
419
|
+
name: string;
|
|
420
|
+
description: string;
|
|
421
|
+
input_schema: {
|
|
422
|
+
type: string;
|
|
423
|
+
properties: {};
|
|
424
|
+
};
|
|
425
|
+
}];
|
|
426
|
+
export declare const COMPRESS_TOOL_RESPONSES: {
|
|
427
|
+
type: "function";
|
|
428
|
+
name: string;
|
|
429
|
+
description: string;
|
|
430
|
+
parameters: {
|
|
431
|
+
type: string;
|
|
432
|
+
properties: {
|
|
433
|
+
topic: {
|
|
434
|
+
type: string;
|
|
435
|
+
description: string;
|
|
436
|
+
};
|
|
437
|
+
content: {
|
|
438
|
+
type: string;
|
|
439
|
+
description: string;
|
|
440
|
+
items: {
|
|
441
|
+
type: string;
|
|
442
|
+
properties: {
|
|
443
|
+
topic: {
|
|
444
|
+
type: string;
|
|
445
|
+
};
|
|
446
|
+
startId: {
|
|
447
|
+
type: string;
|
|
448
|
+
description: string;
|
|
449
|
+
};
|
|
450
|
+
endId: {
|
|
451
|
+
type: string;
|
|
452
|
+
description: string;
|
|
453
|
+
};
|
|
454
|
+
summary: {
|
|
455
|
+
type: string;
|
|
456
|
+
description: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
required: string[];
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
required: string[];
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
export declare const DECOMPRESS_TOOL_RESPONSES: {
|
|
467
|
+
type: "function";
|
|
468
|
+
name: string;
|
|
469
|
+
description: string;
|
|
470
|
+
parameters: {
|
|
471
|
+
type: string;
|
|
472
|
+
properties: {
|
|
473
|
+
blockId: {
|
|
474
|
+
type: string;
|
|
475
|
+
description: string;
|
|
476
|
+
};
|
|
477
|
+
toFile: {
|
|
478
|
+
type: string;
|
|
479
|
+
description: string;
|
|
480
|
+
};
|
|
481
|
+
full: {
|
|
482
|
+
type: string;
|
|
483
|
+
description: string;
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
required: string[];
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
export declare const SEARCH_CONTEXT_TOOL_RESPONSES: {
|
|
490
|
+
type: "function";
|
|
491
|
+
name: string;
|
|
492
|
+
description: string;
|
|
493
|
+
parameters: {
|
|
494
|
+
type: string;
|
|
495
|
+
properties: {
|
|
496
|
+
query: {
|
|
497
|
+
type: string;
|
|
498
|
+
description: string;
|
|
499
|
+
};
|
|
500
|
+
limit: {
|
|
501
|
+
type: string;
|
|
502
|
+
description: string;
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
required: string[];
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
export declare const ACP_STATUS_TOOL_RESPONSES: {
|
|
509
|
+
type: "function";
|
|
510
|
+
name: string;
|
|
511
|
+
description: string;
|
|
512
|
+
parameters: {
|
|
513
|
+
type: string;
|
|
514
|
+
properties: {};
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
/** All ACP tools in Responses API flat format, matching ACP_TOOL_NAMES. */
|
|
518
|
+
export declare const ACP_TOOLS_RESPONSES: readonly [{
|
|
519
|
+
type: "function";
|
|
520
|
+
name: string;
|
|
521
|
+
description: string;
|
|
522
|
+
parameters: {
|
|
523
|
+
type: string;
|
|
524
|
+
properties: {
|
|
525
|
+
topic: {
|
|
526
|
+
type: string;
|
|
527
|
+
description: string;
|
|
528
|
+
};
|
|
529
|
+
content: {
|
|
530
|
+
type: string;
|
|
531
|
+
description: string;
|
|
532
|
+
items: {
|
|
533
|
+
type: string;
|
|
534
|
+
properties: {
|
|
535
|
+
topic: {
|
|
536
|
+
type: string;
|
|
537
|
+
};
|
|
538
|
+
startId: {
|
|
539
|
+
type: string;
|
|
540
|
+
description: string;
|
|
541
|
+
};
|
|
542
|
+
endId: {
|
|
543
|
+
type: string;
|
|
544
|
+
description: string;
|
|
545
|
+
};
|
|
546
|
+
summary: {
|
|
547
|
+
type: string;
|
|
548
|
+
description: string;
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
required: string[];
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
required: string[];
|
|
556
|
+
};
|
|
557
|
+
}, {
|
|
558
|
+
type: "function";
|
|
559
|
+
name: string;
|
|
560
|
+
description: string;
|
|
561
|
+
parameters: {
|
|
562
|
+
type: string;
|
|
563
|
+
properties: {
|
|
564
|
+
blockId: {
|
|
565
|
+
type: string;
|
|
566
|
+
description: string;
|
|
567
|
+
};
|
|
568
|
+
toFile: {
|
|
569
|
+
type: string;
|
|
570
|
+
description: string;
|
|
571
|
+
};
|
|
572
|
+
full: {
|
|
573
|
+
type: string;
|
|
574
|
+
description: string;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
required: string[];
|
|
578
|
+
};
|
|
579
|
+
}, {
|
|
580
|
+
type: "function";
|
|
581
|
+
name: string;
|
|
582
|
+
description: string;
|
|
583
|
+
parameters: {
|
|
584
|
+
type: string;
|
|
585
|
+
properties: {
|
|
586
|
+
query: {
|
|
587
|
+
type: string;
|
|
588
|
+
description: string;
|
|
589
|
+
};
|
|
590
|
+
limit: {
|
|
591
|
+
type: string;
|
|
592
|
+
description: string;
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
required: string[];
|
|
596
|
+
};
|
|
597
|
+
}, {
|
|
598
|
+
type: "function";
|
|
599
|
+
name: string;
|
|
600
|
+
description: string;
|
|
601
|
+
parameters: {
|
|
602
|
+
type: string;
|
|
603
|
+
properties: {};
|
|
604
|
+
};
|
|
605
|
+
}];
|
|
606
|
+
/** Read-only ACP tools (no compress) in Responses flat format. Used for the
|
|
607
|
+
* hybrid protocol (codex): compress stays a text marker (batch + STOP), while
|
|
608
|
+
* decompress/search_context/acp_status are injected as real function tools so
|
|
609
|
+
* the model can call them directly instead of emitting text triggers.
|
|
610
|
+
* Empirically (direct comfly A/B) declaring these tools does NOT disable
|
|
611
|
+
* codex code_mode — the earlier "tools can't coexist" assumption was wrong. */
|
|
612
|
+
export declare const ACP_READONLY_TOOLS_RESPONSES: readonly [{
|
|
613
|
+
type: "function";
|
|
614
|
+
name: string;
|
|
615
|
+
description: string;
|
|
616
|
+
parameters: {
|
|
617
|
+
type: string;
|
|
618
|
+
properties: {
|
|
619
|
+
blockId: {
|
|
620
|
+
type: string;
|
|
621
|
+
description: string;
|
|
622
|
+
};
|
|
623
|
+
toFile: {
|
|
624
|
+
type: string;
|
|
625
|
+
description: string;
|
|
626
|
+
};
|
|
627
|
+
full: {
|
|
628
|
+
type: string;
|
|
629
|
+
description: string;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
required: string[];
|
|
633
|
+
};
|
|
634
|
+
}, {
|
|
635
|
+
type: "function";
|
|
636
|
+
name: string;
|
|
637
|
+
description: string;
|
|
638
|
+
parameters: {
|
|
639
|
+
type: string;
|
|
640
|
+
properties: {
|
|
641
|
+
query: {
|
|
642
|
+
type: string;
|
|
643
|
+
description: string;
|
|
644
|
+
};
|
|
645
|
+
limit: {
|
|
646
|
+
type: string;
|
|
647
|
+
description: string;
|
|
648
|
+
};
|
|
649
|
+
};
|
|
650
|
+
required: string[];
|
|
651
|
+
};
|
|
652
|
+
}, {
|
|
653
|
+
type: "function";
|
|
654
|
+
name: string;
|
|
655
|
+
description: string;
|
|
656
|
+
parameters: {
|
|
657
|
+
type: string;
|
|
658
|
+
properties: {};
|
|
659
|
+
};
|
|
660
|
+
}];
|
|
661
|
+
/** All ACP tool names (dynamic membership — Set, not a static record). */
|
|
662
|
+
export declare const ACP_TOOL_NAMES: ReadonlySet<string>;
|
|
663
|
+
/** compress/decompress: mutate history → must drive the compress loop (their
|
|
664
|
+
* result is folded into the request before the model continues). */
|
|
665
|
+
export declare const ACP_MUTATING_TOOLS: ReadonlySet<string>;
|
|
666
|
+
/** acp_status/search_context: read-only → must NOT loop. Looping them made the
|
|
667
|
+
* model re-call until the 5× limit and discarded the whole turn. */
|
|
668
|
+
export declare const ACP_READONLY_TOOLS: ReadonlySet<string>;
|
|
669
|
+
//# sourceMappingURL=compress-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress-tools.d.ts","sourceRoot":"","sources":["../src/compress-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5D,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD;;;6DAG6D;AAC7D,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,eAAe,iBAAiB,CAAC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Input, } from "./compress.js";
|
|
4
4
|
export { createInitialState, allocateBlockId, allocateRunId, blockById, activeBlocks, coveredMessageIds, highestActiveTier, advanceSurvival, } from "./state.js";
|
|
5
5
|
export { defaultConfig, validateConfig } from "./config.js";
|
|
6
|
+
export * from "./compress-tools.js";
|
|
6
7
|
export { assignRefs, highestUsedIndex, emptyRefMap, indexToRef, refToIndex, refForRaw, rawForRef, BLOCKED_REF, } from "./refs.js";
|
|
7
8
|
export { prune, SUMMARY_HEADER, summaryMessageId, isSummaryMessageId, isRenderedSummaryMessage, } from "./prune.js";
|
|
8
9
|
export { syncBlocks } from "./sync.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EACV,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,iBA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c,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,WAAW,EACX,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EACV,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,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