@ai0x0/codex-ts 0.6.4 → 0.7.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 (89) hide show
  1. package/README.md +22 -3
  2. package/dist/core/src/codex_thread.d.ts +6 -0
  3. package/dist/core/src/codex_thread.d.ts.map +1 -1
  4. package/dist/core/src/codex_thread.js +62 -7
  5. package/dist/core/src/codex_thread.js.map +1 -1
  6. package/dist/core/src/compact.d.ts +12 -2
  7. package/dist/core/src/compact.d.ts.map +1 -1
  8. package/dist/core/src/compact.js +28 -11
  9. package/dist/core/src/compact.js.map +1 -1
  10. package/dist/core/src/index.d.ts +4 -4
  11. package/dist/core/src/index.d.ts.map +1 -1
  12. package/dist/core/src/index.js +3 -3
  13. package/dist/core/src/index.js.map +1 -1
  14. package/dist/core/src/session/retry.d.ts +47 -5
  15. package/dist/core/src/session/retry.d.ts.map +1 -1
  16. package/dist/core/src/session/retry.js +143 -6
  17. package/dist/core/src/session/retry.js.map +1 -1
  18. package/dist/core/src/session/turn.d.ts +6 -0
  19. package/dist/core/src/session/turn.d.ts.map +1 -1
  20. package/dist/core/src/session/turn.js +103 -42
  21. package/dist/core/src/session/turn.js.map +1 -1
  22. package/dist/core/src/skills.d.ts +35 -2
  23. package/dist/core/src/skills.d.ts.map +1 -1
  24. package/dist/core/src/skills.js +146 -41
  25. package/dist/core/src/skills.js.map +1 -1
  26. package/dist/core/src/state/auto_compact_window.d.ts +58 -4
  27. package/dist/core/src/state/auto_compact_window.d.ts.map +1 -1
  28. package/dist/core/src/state/auto_compact_window.js +89 -5
  29. package/dist/core/src/state/auto_compact_window.js.map +1 -1
  30. package/dist/core/src/tools/handlers/request_user_input_spec.d.ts +10 -1
  31. package/dist/core/src/tools/handlers/request_user_input_spec.d.ts.map +1 -1
  32. package/dist/core/src/tools/handlers/request_user_input_spec.js +30 -2
  33. package/dist/core/src/tools/handlers/request_user_input_spec.js.map +1 -1
  34. package/dist/core/src/tools/router.d.ts.map +1 -1
  35. package/dist/core/src/tools/router.js +12 -2
  36. package/dist/core/src/tools/router.js.map +1 -1
  37. package/dist/core/tests/suite/compact.test.js +64 -7
  38. package/dist/core/tests/suite/compact.test.js.map +1 -1
  39. package/dist/core/tests/suite/goal.test.js +18 -2
  40. package/dist/core/tests/suite/goal.test.js.map +1 -1
  41. package/dist/core/tests/suite/image_input.test.js +23 -0
  42. package/dist/core/tests/suite/image_input.test.js.map +1 -1
  43. package/dist/core/tests/suite/reasoning_delta.test.d.ts +11 -0
  44. package/dist/core/tests/suite/reasoning_delta.test.d.ts.map +1 -0
  45. package/dist/core/tests/suite/reasoning_delta.test.js +85 -0
  46. package/dist/core/tests/suite/reasoning_delta.test.js.map +1 -0
  47. package/dist/core/tests/suite/request_user_input.test.js +78 -1
  48. package/dist/core/tests/suite/request_user_input.test.js.map +1 -1
  49. package/dist/core/tests/suite/skills.test.js +30 -2
  50. package/dist/core/tests/suite/skills.test.js.map +1 -1
  51. package/dist/core/tests/suite/stream_failure.test.d.ts +11 -0
  52. package/dist/core/tests/suite/stream_failure.test.d.ts.map +1 -0
  53. package/dist/core/tests/suite/stream_failure.test.js +162 -0
  54. package/dist/core/tests/suite/stream_failure.test.js.map +1 -0
  55. package/dist/core/tests/suite/token_count.test.js +8 -1
  56. package/dist/core/tests/suite/token_count.test.js.map +1 -1
  57. package/dist/core/tests/suite/tool_arg_parse_error.test.d.ts +14 -0
  58. package/dist/core/tests/suite/tool_arg_parse_error.test.d.ts.map +1 -0
  59. package/dist/core/tests/suite/tool_arg_parse_error.test.js +100 -0
  60. package/dist/core/tests/suite/tool_arg_parse_error.test.js.map +1 -0
  61. package/dist/ext/goal/src/spec.d.ts.map +1 -1
  62. package/dist/ext/goal/src/spec.js +14 -9
  63. package/dist/ext/goal/src/spec.js.map +1 -1
  64. package/dist/ext/goal/src/tool.d.ts.map +1 -1
  65. package/dist/ext/goal/src/tool.js +39 -15
  66. package/dist/ext/goal/src/tool.js.map +1 -1
  67. package/dist/protocol/src/index.d.ts +2 -1
  68. package/dist/protocol/src/index.d.ts.map +1 -1
  69. package/dist/protocol/src/index.js +1 -1
  70. package/dist/protocol/src/index.js.map +1 -1
  71. package/dist/protocol/src/protocol.d.ts +114 -5
  72. package/dist/protocol/src/protocol.d.ts.map +1 -1
  73. package/dist/protocol/src/protocol.js +13 -1
  74. package/dist/protocol/src/protocol.js.map +1 -1
  75. package/dist/protocol/src/request_user_input.d.ts +15 -0
  76. package/dist/protocol/src/request_user_input.d.ts.map +1 -1
  77. package/dist/protocol/src/user_input.d.ts +11 -0
  78. package/dist/protocol/src/user_input.d.ts.map +1 -1
  79. package/dist/state/src/runtime/goals.d.ts +15 -1
  80. package/dist/state/src/runtime/goals.d.ts.map +1 -1
  81. package/dist/state/src/runtime/goals.js +36 -3
  82. package/dist/state/src/runtime/goals.js.map +1 -1
  83. package/dist/thread-store/src/types.d.ts +5 -0
  84. package/dist/thread-store/src/types.d.ts.map +1 -1
  85. package/dist/tools/src/json_schema.d.ts +2 -0
  86. package/dist/tools/src/json_schema.d.ts.map +1 -1
  87. package/dist/tools/src/json_schema.js +4 -0
  88. package/dist/tools/src/json_schema.js.map +1 -1
  89. package/package.json +1 -1
@@ -19,6 +19,13 @@
19
19
  const DEFAULT_SKILL_METADATA_CHAR_BUDGET = 8_000;
20
20
  const SKILL_METADATA_CONTEXT_WINDOW_PERCENT = 2;
21
21
  const APPROX_BYTES_PER_TOKEN = 4;
22
+ // mirrors MAX_DEFAULT_CONTEXT_SKILL_DESCRIPTION_CHARS / the "..." suffix
23
+ // (render.rs:20-21): a single skill can't monopolise the catalog with a
24
+ // thousands-of-chars description.
25
+ const MAX_DEFAULT_CONTEXT_SKILL_DESCRIPTION_CHARS = 1_024;
26
+ const TRUNCATED_SKILL_DESCRIPTION_SUFFIX = "...";
27
+ // mirrors SKILL_DESCRIPTION_TRUNCATION_WARNING_THRESHOLD_CHARS (render.rs:22)
28
+ const SKILL_DESCRIPTION_TRUNCATION_WARNING_THRESHOLD_CHARS = 100;
22
29
  const TEXT_ENCODER = new TextEncoder();
23
30
  function byteLength(text) {
24
31
  return TEXT_ENCODER.encode(text).length;
@@ -53,9 +60,29 @@ export function defaultSkillMetadataBudget(contextWindow) {
53
60
  function normalizedPath(skill) {
54
61
  return skill.path.replace(/\\/g, "/");
55
62
  }
63
+ /**
64
+ * Cap a description before it ever reaches the budget allocator.
65
+ * mirrors truncate_default_context_skill_description (render.rs:537), applied in
66
+ * SkillLine::with_path — the ORIGINAL SkillMetadata is never mutated.
67
+ */
68
+ export function truncateDefaultContextSkillDescription(description) {
69
+ const codePoints = Array.from(description);
70
+ if (codePoints.length <= MAX_DEFAULT_CONTEXT_SKILL_DESCRIPTION_CHARS) {
71
+ return description;
72
+ }
73
+ const prefixChars = MAX_DEFAULT_CONTEXT_SKILL_DESCRIPTION_CHARS -
74
+ Array.from(TRUNCATED_SKILL_DESCRIPTION_SUFFIX).length;
75
+ return (codePoints.slice(0, prefixChars).join("") +
76
+ TRUNCATED_SKILL_DESCRIPTION_SUFFIX);
77
+ }
56
78
  // render.rs SkillLine::render_full
57
79
  function renderSkillLineFull(skill) {
58
- return renderSkillLineWithDescriptionChars(skill, Array.from(skill.description).length);
80
+ return renderSkillLineWithDescriptionChars(skill, Array.from(catalogDescription(skill)).length);
81
+ }
82
+ // The description as it appears in the catalog (render.rs SkillLine.description:
83
+ // a Cow that is the capped form when the raw description is over the cap).
84
+ function catalogDescription(skill) {
85
+ return truncateDefaultContextSkillDescription(skill.description);
59
86
  }
60
87
  // render.rs SkillLine::render_with_description_chars
61
88
  function renderSkillLineWithDescriptionChars(skill, descriptionChars) {
@@ -63,17 +90,25 @@ function renderSkillLineWithDescriptionChars(skill, descriptionChars) {
63
90
  if (descriptionChars === 0) {
64
91
  return `- ${skill.name}: (file: ${path})`;
65
92
  }
66
- const description = Array.from(skill.description)
93
+ const description = Array.from(catalogDescription(skill))
67
94
  .slice(0, descriptionChars)
68
95
  .join("");
69
96
  return `- ${skill.name}: ${description} (file: ${path})`;
70
97
  }
98
+ /** mirrors SkillRenderReport::average_truncated_description_chars (render.rs:431) */
99
+ function averageTruncatedDescriptionChars(report) {
100
+ if (report.totalCount === 0 || report.truncatedDescriptionChars === 0) {
101
+ return 0;
102
+ }
103
+ return Math.floor((report.truncatedDescriptionChars + report.totalCount - 1) /
104
+ report.totalCount);
105
+ }
71
106
  function descriptionBudgetLine(skill, budget) {
72
107
  const minimumLine = renderSkillLineWithDescriptionChars(skill, /*descriptionChars*/ 0);
73
108
  const minimumChars = Array.from(minimumLine).length + 1; // +1 for "\n"
74
109
  const minimumBytes = byteLength(minimumLine) + 1;
75
110
  const minimumCost = budgetCostFromCounts(budget, minimumChars, minimumBytes);
76
- const descriptionCodePoints = Array.from(skill.description);
111
+ const descriptionCodePoints = Array.from(catalogDescription(skill));
77
112
  const extraCosts = [0];
78
113
  let prefixChars = 0;
79
114
  let prefixBytes = 0;
@@ -116,15 +151,24 @@ function renderLinesWithDescriptionBudget(skills, budget, limit) {
116
151
  break;
117
152
  }
118
153
  }
119
- return budgetLines.map((line, index) => renderSkillLineWithDescriptionChars(line.skill, charAllocations[index]));
154
+ // mirrors the RenderedSkillLine mapping at the tail of
155
+ // render_lines_with_description_budget (render.rs:639): truncated_chars is how
156
+ // much of the (already capped) description had to be dropped.
157
+ return budgetLines.map((line, index) => ({
158
+ line: renderSkillLineWithDescriptionChars(line.skill, charAllocations[index]),
159
+ truncatedChars: Math.max(0, line.descriptionCharCount - charAllocations[index]),
160
+ }));
120
161
  }
121
- // render.rs render_minimum_skill_lines_until_budget — when even the no-description
122
- // lines overflow, keep adding minimum lines until the budget is spent; the rest
123
- // are omitted.
162
+ // render.rs render_minimum_skill_lines_until_budget (render.rs:664) — when even
163
+ // the no-description lines overflow, keep adding minimum lines until the budget
164
+ // is spent; the rest are omitted. Every dropped description counts as fully
165
+ // truncated in the report.
124
166
  function renderMinimumUntilBudget(skills, budget) {
125
167
  const lines = [];
126
168
  let used = 0;
127
169
  let omitted = 0;
170
+ let truncatedDescriptionChars = 0;
171
+ let truncatedDescriptionCount = 0;
128
172
  for (const skill of skills) {
129
173
  const minimumLine = renderSkillLineWithDescriptionChars(skill, /*descriptionChars*/ 0);
130
174
  const cost = lineCost(budget, minimumLine);
@@ -135,43 +179,78 @@ function renderMinimumUntilBudget(skills, budget) {
135
179
  else {
136
180
  omitted += 1;
137
181
  }
182
+ const descriptionCharCount = Array.from(catalogDescription(skill)).length;
183
+ truncatedDescriptionChars += descriptionCharCount;
184
+ if (descriptionCharCount > 0) {
185
+ truncatedDescriptionCount += 1;
186
+ }
138
187
  }
139
- return { lines, omitted };
188
+ return {
189
+ lines,
190
+ report: {
191
+ totalCount: skills.length,
192
+ includedCount: lines.length,
193
+ omittedCount: omitted,
194
+ truncatedDescriptionChars,
195
+ truncatedDescriptionCount,
196
+ },
197
+ };
140
198
  }
141
199
  // render.rs render_skill_lines_from_lines — three tiers: full → trimmed
142
200
  // descriptions → minimum-until-budget.
143
201
  function renderSkillLines(skills, budget) {
202
+ const noTruncation = (lines) => ({
203
+ totalCount: skills.length,
204
+ includedCount: lines.length,
205
+ omittedCount: 0,
206
+ truncatedDescriptionChars: 0,
207
+ truncatedDescriptionCount: 0,
208
+ });
144
209
  const fullCost = skills.reduce((used, skill) => used + lineCost(budget, renderSkillLineFull(skill)), 0);
145
210
  if (fullCost <= budget.limit) {
146
- return { lines: skills.map(renderSkillLineFull), omitted: 0 };
211
+ const lines = skills.map(renderSkillLineFull);
212
+ return { lines, report: noTruncation(lines) };
147
213
  }
148
214
  const minimumCost = skills.reduce((used, skill) => used + lineCost(budget, renderSkillLineWithDescriptionChars(skill, /*descriptionChars*/ 0)), 0);
149
215
  if (minimumCost <= budget.limit) {
216
+ const rendered = renderLinesWithDescriptionBudget(skills, budget, budget.limit - minimumCost);
217
+ // mirrors sum_description_truncation (render.rs:459)
218
+ const truncated = rendered.filter((line) => line.truncatedChars > 0);
219
+ const lines = rendered.map((line) => line.line);
150
220
  return {
151
- lines: renderLinesWithDescriptionBudget(skills, budget, budget.limit - minimumCost),
152
- omitted: 0,
221
+ lines,
222
+ report: {
223
+ totalCount: skills.length,
224
+ includedCount: lines.length,
225
+ omittedCount: 0,
226
+ truncatedDescriptionChars: truncated.reduce((sum, line) => sum + line.truncatedChars, 0),
227
+ truncatedDescriptionCount: truncated.length,
228
+ },
153
229
  };
154
230
  }
155
231
  return renderMinimumUntilBudget(skills, budget);
156
232
  }
157
233
  // ─── Layer 1: catalog (mirrors render.rs render_available_skills_body) ────────
158
- // render.rs SKILLS_INTRO_WITH_ABSOLUTE_PATHS (verbatim)
159
- const SKILLS_INTRO = "A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list of skills that can be used. Each entry includes a name, description, and file path so you can open the source for full instructions when using a specific skill.";
234
+ // render.rs SKILLS_INTRO_WITH_ABSOLUTE_PATHS (verbatim). Upstream reworded this
235
+ // for non-filesystem skill sources (environment / orchestrator / custom
236
+ // resources); codex-ts only ever renders `file` locators, but the text is kept
237
+ // verbatim so the model sees exactly what codex-rs sends.
238
+ const SKILLS_INTRO = "A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that can be used. Each entry includes a name, description, and source locator. `file` locators are on the host filesystem, `environment resource` locators are owned by an execution environment, `orchestrator resource` locators are opaque non-filesystem resources, and `custom resource` locators use their provider's access mechanism.";
160
239
  // render.rs SKILLS_HOW_TO_USE_WITH_ABSOLUTE_PATHS (verbatim)
161
- const SKILLS_HOW_TO_USE = `- Discovery: The list above is the skills available in this session (name + description + file path). Skill bodies live on disk at the listed paths.
240
+ const SKILLS_HOW_TO_USE = `- Discovery: The list above is the skills available in this session (name + description + source locator). \`file\` entries live on the host filesystem, \`environment resource\` and \`orchestrator resource\` entries must be accessed through \`skills.list\` and \`skills.read\`, and \`custom resource\` entries use their provider's access mechanism.
162
241
  - Trigger rules: If the user names a skill (with \`$SkillName\` or plain text) OR the task clearly matches a skill's description shown above, you must use that skill for that turn. Multiple mentions mean use them all. Do not carry skills across turns unless re-mentioned.
163
- - Missing/blocked: If a named skill isn't in the list or the path can't be read, say so briefly and continue with the best fallback.
242
+ - Missing/blocked: If a named skill isn't in the list or its source can't be read, say so briefly and continue with the best fallback.
164
243
  - How to use a skill (progressive disclosure):
165
- 1) After deciding to use a skill, open its \`SKILL.md\`. Read only enough to follow the workflow.
166
- 2) When \`SKILL.md\` references relative paths (e.g., \`scripts/foo.py\`), resolve them relative to the skill directory listed above first, and only consider other paths if needed.
167
- 3) If \`SKILL.md\` points to extra folders such as \`references/\`, load only the specific files needed for the request; don't bulk-load everything.
168
- 4) If \`scripts/\` exist, prefer running or patching them instead of retyping large code blocks.
169
- 5) If \`assets/\` or templates exist, reuse them instead of recreating from scratch.
244
+ 1) After deciding to use a skill, the main agent must read its \`SKILL.md\` completely before taking task actions. For a \`file\` entry, open the listed path. For an \`environment resource\`, call \`skills.list\` with \`{"authority":{"kind":"executor"}}\`; for an \`orchestrator resource\`, use \`{"authority":{"kind":"orchestrator"}}\`. Select the matching package and pass its exact authority, package, and \`main_resource\` to \`skills.read\`. Follow \`next_cursor\`; if a read is paginated, continue until EOF.
245
+ 2) When \`SKILL.md\` references another resource, use the same access mechanism. Resolve relative references beneath an executor skill's returned package and call \`skills.read\` with the same authority and package. For orchestrator skills, pass the exact referenced resource identifier with the same authority and package to \`skills.read\`; do not treat \`skill://\` identifiers as filesystem paths.
246
+ 3) If \`SKILL.md\` points to extra folders such as \`references/\`, use its routing instructions to identify the resources required for the task. The main agent must read each required instruction or reference file itself before acting on it. Do not delegate reading, summarizing, or interpreting skill instructions to a subagent. Subagents may still perform task work when the selected skill allows it.
247
+ 4) For filesystem-backed skills, prefer running or patching provided scripts instead of retyping large code blocks. For environment and orchestrator skills, use \`skills.read\` and the available tools; do not invent a local path.
248
+ 5) Reuse provided assets or templates through the same source access mechanism instead of recreating them.
170
249
  - Coordination and sequencing:
171
250
  - If multiple skills apply, choose the minimal set that covers the request and state the order you'll use them.
172
251
  - Announce which skill(s) you're using and why (one short line). If you skip an obvious skill, say why.
173
252
  - Context hygiene:
174
- - Keep context small: summarize long sections instead of pasting them; only load extra files when needed.
253
+ - Progressive disclosure applies to selecting relevant files, not partially reading a selected instruction file. Do not load unrelated references, scripts, or assets.
175
254
  - Avoid deep reference-chasing: prefer opening only files directly linked from \`SKILL.md\` unless you're blocked.
176
255
  - When variants exist (frameworks, providers, domains), pick only the relevant reference file(s) and note that choice.
177
256
  - Safety and fallback: If a skill can't be applied cleanly (missing files, unclear instructions), state the issue, pick the next-best approach, and continue.`;
@@ -184,11 +263,14 @@ const SKILL_DESCRIPTION_TRUNCATED_WARNING_WITH_PERCENT = "Skill descriptions wer
184
263
  "Codex can still see every skill, but some descriptions are shorter. " +
185
264
  "Disable unused skills or plugins to leave more room for the rest.";
186
265
  /**
187
- * Build the omission / truncation warning appended to the catalog.
188
- * mirrors render.rs build_available_skills_from_lines warning_message logic.
266
+ * Build the omission / truncation warning for a render report.
267
+ * mirrors build_available_skills_from_lines's warning_message (render.rs:208):
268
+ * omission wins over truncation, and truncation only warns once the AVERAGE
269
+ * dropped description exceeds SKILL_DESCRIPTION_TRUNCATION_WARNING_THRESHOLD_CHARS.
189
270
  */
190
- function buildCatalogWarning(omitted, truncated, budget) {
191
- if (omitted > 0) {
271
+ function buildCatalogWarning(report, budget) {
272
+ if (report.omittedCount > 0) {
273
+ const omitted = report.omittedCount;
192
274
  const skillWord = omitted === 1 ? "skill" : "skills";
193
275
  const verb = omitted === 1 ? "was" : "were";
194
276
  const prefix = budget.kind === "tokens"
@@ -196,7 +278,8 @@ function buildCatalogWarning(omitted, truncated, budget) {
196
278
  : SKILL_DESCRIPTIONS_REMOVED_WARNING_PREFIX;
197
279
  return `${prefix} ${omitted} additional ${skillWord} ${verb} not included in the model-visible skills list.`;
198
280
  }
199
- if (truncated) {
281
+ if (averageTruncatedDescriptionChars(report) >
282
+ SKILL_DESCRIPTION_TRUNCATION_WARNING_THRESHOLD_CHARS) {
200
283
  return budget.kind === "tokens"
201
284
  ? SKILL_DESCRIPTION_TRUNCATED_WARNING_WITH_PERCENT
202
285
  : SKILL_DESCRIPTION_TRUNCATED_WARNING;
@@ -205,32 +288,54 @@ function buildCatalogWarning(omitted, truncated, budget) {
205
288
  }
206
289
  /**
207
290
  * Render the always-on skills catalog (Layer 1), trimmed to fit `budget`.
208
- * Mirrors render.rs render_available_skills_body (absolute-paths variant)
209
- * including the omission / truncation warning appended when the budget is tight.
210
- * Returns "" when there are no skills so callers can skip injection entirely.
291
+ * mirrors render_available_skills_body (render.rs:65) for the absolute-paths
292
+ * variant, plus AvailableSkillsInstructions::from_available_skills
293
+ * (core/src/context/available_skills_instructions.rs:25), which is where
294
+ * upstream moved the "### How to use skills" section.
211
295
  */
212
- export function renderSkillsCatalog(skills, budget = defaultSkillMetadataBudget()) {
296
+ export function renderAvailableSkills(skills, budget = defaultSkillMetadataBudget()) {
213
297
  if (skills.length === 0) {
214
- return "";
298
+ return {
299
+ body: "",
300
+ warningMessage: null,
301
+ report: {
302
+ totalCount: 0,
303
+ includedCount: 0,
304
+ omittedCount: 0,
305
+ truncatedDescriptionChars: 0,
306
+ truncatedDescriptionCount: 0,
307
+ },
308
+ };
215
309
  }
216
- const { lines, omitted } = renderSkillLines(skills, budget);
217
- // Detect whether any description was truncated by comparing rendered lengths
218
- // to full descriptions (cheap proxy — good enough for the warning threshold).
219
- const anyTruncated = skills.some((skill, i) => {
220
- const rendered = lines[i] ?? "";
221
- return skill.description.length > 0 && !rendered.includes(skill.description);
222
- });
223
- const warning = buildCatalogWarning(omitted, anyTruncated, budget);
310
+ const { lines, report } = renderSkillLines(skills, budget);
224
311
  const out = [
225
312
  "## Skills",
226
313
  SKILLS_INTRO,
227
314
  "### Available skills",
228
315
  ...lines,
229
- ...(warning ? [warning] : []),
230
316
  "### How to use skills",
231
317
  SKILLS_HOW_TO_USE,
232
318
  ];
233
- return `\n${out.join("\n")}\n`;
319
+ return {
320
+ body: `\n${out.join("\n")}\n`,
321
+ warningMessage: buildCatalogWarning(report, budget),
322
+ report,
323
+ };
324
+ }
325
+ /**
326
+ * Browser-specific convenience wrapper — codex-rs has no single-string form.
327
+ * Returns the catalog body with the budget warning appended, for hosts that
328
+ * inject one blob and have nowhere to route a separate warning. CodexThread
329
+ * itself uses renderAvailableSkills() and emits the warning as a `Warning`
330
+ * event, exactly like codex-rs.
331
+ * Returns "" when there are no skills so callers can skip injection entirely.
332
+ */
333
+ export function renderSkillsCatalog(skills, budget = defaultSkillMetadataBudget()) {
334
+ const { body, warningMessage } = renderAvailableSkills(skills, budget);
335
+ if (body === "") {
336
+ return "";
337
+ }
338
+ return warningMessage ? `${body}${warningMessage}\n` : body;
234
339
  }
235
340
  // ─── Layer 2: mention detection (mirrors injection.rs) ────────────────────────
236
341
  // injection.rs is_common_env_var — skip `$HOME` etc. so env vars in prose don't
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../core/src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAqBH,MAAM,kCAAkC,GAAG,KAAK,CAAC;AACjD,MAAM,qCAAqC,GAAG,CAAC,CAAC;AAChD,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC;AAEvC,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAC1C,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAa;IAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,sBAAsB,GAAG,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,UAAU,CAAC,MAA2B,EAAE,IAAY;IAC3D,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;QAC7B,CAAC,CAAC,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC,CAAC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AAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAoB,EACpB,QAAgB;IAEhB,OAAO,kBAAkB,KAAK,CAAC,IAAI,kBAAkB,KAAK,CAAC,IAAI,YAAY,QAAQ,YAAY,CAAC;AAClG,CAAC"}
@@ -5,12 +5,27 @@
5
5
  * BodyAfterPrefix mode can measure context growth since the last compaction
6
6
  * rather than total context size.
7
7
  */
8
+ /** mirrors AutoCompactWindowIds (auto_compact_window.rs:5).
9
+ * rs mints Uuid::now_v7(); codex-ts uses crypto.randomUUID() when available
10
+ * (browser + Node ≥ 19) and falls back to a counter-based id otherwise. */
11
+ export interface AutoCompactWindowIds {
12
+ firstWindowId: string;
13
+ previousWindowId: string | null;
14
+ windowId: string;
15
+ }
16
+ /** mirrors AutoCompactWindowIds::new_initial (auto_compact_window.rs:12) */
17
+ export declare function newInitialAutoCompactWindowIds(): AutoCompactWindowIds;
18
+ /** mirrors AutoCompactWindowSnapshot (auto_compact_window.rs:22) — rs dropped the
19
+ * `ordinal` field when window identity moved to windowNumber + ids. */
8
20
  export interface AutoCompactWindowSnapshot {
9
- ordinal: number;
10
21
  prefillInputTokens: number | null;
11
22
  }
12
23
  export declare class AutoCompactWindow {
13
- private ordinal;
24
+ /** mirrors window_number (auto_compact_window.rs:35) — starts at 0, not 1, and
25
+ * advances once per compaction. */
26
+ private windowNumber;
27
+ private ids;
28
+ private newContextWindowRequested;
14
29
  /**
15
30
  * Absolute input-token baseline for the current window.
16
31
  * Set from the first server-observed usage after a new window opens;
@@ -18,9 +33,48 @@ export declare class AutoCompactWindow {
18
33
  */
19
34
  private prefillInputTokens;
20
35
  private prefillSource;
36
+ private tokenBudgetReminderDelivered;
37
+ private autoCompactFallbackDelivered;
21
38
  clearPrefill(): void;
22
- /** Called after each compaction to start a fresh measurement window */
23
- startNext(): void;
39
+ /** mirrors window_number() (auto_compact_window.rs:64) */
40
+ currentWindowNumber(): number;
41
+ /** mirrors ids() (auto_compact_window.rs:68) */
42
+ currentIds(): AutoCompactWindowIds;
43
+ /** mirrors restore() (auto_compact_window.rs:72) — used when a resumed thread
44
+ * replays its persisted compaction checkpoints. */
45
+ restore(windowNumber: number, ids: AutoCompactWindowIds): void;
46
+ /**
47
+ * Open the next compaction window: bump the number, rotate the ids, and reset
48
+ * the per-window one-shot flags. mirrors advance() (auto_compact_window.rs:77).
49
+ *
50
+ * Note rs's `advance()` deliberately does NOT clear the prefill baseline —
51
+ * `Session::start_new_context_window` / `replace_history` do that separately
52
+ * (state/session.rs:122,200). Callers that rewrite history must therefore call
53
+ * `startNewContextWindow()` (or `clearPrefill()`) as well; see
54
+ * runCompactAndRecompute in session/turn.ts.
55
+ */
56
+ advance(): {
57
+ windowNumber: number;
58
+ ids: AutoCompactWindowIds;
59
+ };
60
+ /** mirrors Session::start_new_context_window (state/session.rs:199): advance
61
+ * the window AND drop the stale prefill baseline in one step. */
62
+ startNewContextWindow(): {
63
+ windowNumber: number;
64
+ ids: AutoCompactWindowIds;
65
+ };
66
+ /** mirrors claim_token_budget_reminder (auto_compact_window.rs:88) — true only
67
+ * the first time it is called within a window. */
68
+ claimTokenBudgetReminder(): boolean;
69
+ /** mirrors claim_auto_compact_fallback (auto_compact_window.rs:92) */
70
+ claimAutoCompactFallback(): boolean;
71
+ /** mirrors request_new_context_window (auto_compact_window.rs:96) — codex-rs
72
+ * sets this from the `new_context` tool so the next mid-turn checkpoint rolls
73
+ * the window over even when the token limit was not reached. codex-ts has no
74
+ * such built-in tool, so a host can drive it from a custom tool. */
75
+ requestNewContextWindow(): void;
76
+ /** mirrors take_new_context_window_request (auto_compact_window.rs:100) */
77
+ takeNewContextWindowRequest(): boolean;
24
78
  /**
25
79
  * Records the request-input side of the first server usage sample.
26
80
  * Server-observed values take priority and are never overwritten.
@@ -1 +1 @@
1
- {"version":3,"file":"auto_compact_window.d.ts","sourceRoot":"","sources":["../../../../core/src/state/auto_compact_window.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAK;IACpB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,aAAa,CAAuC;IAE5D,YAAY,IAAI,IAAI;IAKpB,uEAAuE;IACvE,SAAS,IAAI,IAAI;IAKjB;;;;OAIG;IACH,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAMtD;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMzC,QAAQ,IAAI,yBAAyB;IAIrC;;;OAGG;IACH,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM;CAIlD"}
1
+ {"version":3,"file":"auto_compact_window.d.ts","sourceRoot":"","sources":["../../../../core/src/state/auto_compact_window.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;4EAE4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAeD,4EAA4E;AAC5E,wBAAgB,8BAA8B,IAAI,oBAAoB,CAGrE;AAED;wEACwE;AACxE,MAAM,WAAW,yBAA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 let windowIdCounter = 0;
9
+ function newWindowId() {
10
+ const cryptoObj = globalThis.crypto;
11
+ if (typeof cryptoObj?.randomUUID === "function") {
12
+ return cryptoObj.randomUUID();
13
+ }
14
+ windowIdCounter += 1;
15
+ return `window-${Date.now().toString(36)}-${windowIdCounter}`;
16
+ }
17
+ /** mirrors AutoCompactWindowIds::new_initial (auto_compact_window.rs:12) */
18
+ export function newInitialAutoCompactWindowIds() {
19
+ const windowId = newWindowId();
20
+ return { firstWindowId: windowId, previousWindowId: null, windowId };
21
+ }
8
22
  export class AutoCompactWindow {
9
- ordinal = 1;
23
+ /** mirrors window_number (auto_compact_window.rs:35) — starts at 0, not 1, and
24
+ * advances once per compaction. */
25
+ windowNumber = 0;
26
+ ids = newInitialAutoCompactWindowIds();
27
+ newContextWindowRequested = false;
10
28
  /**
11
29
  * Absolute input-token baseline for the current window.
12
30
  * Set from the first server-observed usage after a new window opens;
@@ -14,14 +32,80 @@ export class AutoCompactWindow {
14
32
  */
15
33
  prefillInputTokens = null;
16
34
  prefillSource = null;
35
+ tokenBudgetReminderDelivered = false;
36
+ autoCompactFallbackDelivered = false;
17
37
  clearPrefill() {
18
38
  this.prefillInputTokens = null;
19
39
  this.prefillSource = null;
20
40
  }
21
- /** Called after each compaction to start a fresh measurement window */
22
- startNext() {
23
- this.ordinal += 1;
41
+ /** mirrors window_number() (auto_compact_window.rs:64) */
42
+ currentWindowNumber() {
43
+ return this.windowNumber;
44
+ }
45
+ /** mirrors ids() (auto_compact_window.rs:68) */
46
+ currentIds() {
47
+ return { ...this.ids };
48
+ }
49
+ /** mirrors restore() (auto_compact_window.rs:72) — used when a resumed thread
50
+ * replays its persisted compaction checkpoints. */
51
+ restore(windowNumber, ids) {
52
+ this.windowNumber = windowNumber;
53
+ this.ids = { ...ids };
54
+ }
55
+ /**
56
+ * Open the next compaction window: bump the number, rotate the ids, and reset
57
+ * the per-window one-shot flags. mirrors advance() (auto_compact_window.rs:77).
58
+ *
59
+ * Note rs's `advance()` deliberately does NOT clear the prefill baseline —
60
+ * `Session::start_new_context_window` / `replace_history` do that separately
61
+ * (state/session.rs:122,200). Callers that rewrite history must therefore call
62
+ * `startNewContextWindow()` (or `clearPrefill()`) as well; see
63
+ * runCompactAndRecompute in session/turn.ts.
64
+ */
65
+ advance() {
66
+ this.windowNumber += 1;
67
+ this.ids = {
68
+ firstWindowId: this.ids.firstWindowId,
69
+ previousWindowId: this.ids.windowId,
70
+ windowId: newWindowId(),
71
+ };
72
+ this.newContextWindowRequested = false;
73
+ this.tokenBudgetReminderDelivered = false;
74
+ this.autoCompactFallbackDelivered = false;
75
+ return { windowNumber: this.windowNumber, ids: this.currentIds() };
76
+ }
77
+ /** mirrors Session::start_new_context_window (state/session.rs:199): advance
78
+ * the window AND drop the stale prefill baseline in one step. */
79
+ startNewContextWindow() {
80
+ const advanced = this.advance();
24
81
  this.clearPrefill();
82
+ return advanced;
83
+ }
84
+ /** mirrors claim_token_budget_reminder (auto_compact_window.rs:88) — true only
85
+ * the first time it is called within a window. */
86
+ claimTokenBudgetReminder() {
87
+ const claimed = !this.tokenBudgetReminderDelivered;
88
+ this.tokenBudgetReminderDelivered = true;
89
+ return claimed;
90
+ }
91
+ /** mirrors claim_auto_compact_fallback (auto_compact_window.rs:92) */
92
+ claimAutoCompactFallback() {
93
+ const claimed = !this.autoCompactFallbackDelivered;
94
+ this.autoCompactFallbackDelivered = true;
95
+ return claimed;
96
+ }
97
+ /** mirrors request_new_context_window (auto_compact_window.rs:96) — codex-rs
98
+ * sets this from the `new_context` tool so the next mid-turn checkpoint rolls
99
+ * the window over even when the token limit was not reached. codex-ts has no
100
+ * such built-in tool, so a host can drive it from a custom tool. */
101
+ requestNewContextWindow() {
102
+ this.newContextWindowRequested = true;
103
+ }
104
+ /** mirrors take_new_context_window_request (auto_compact_window.rs:100) */
105
+ takeNewContextWindowRequest() {
106
+ const requested = this.newContextWindowRequested;
107
+ this.newContextWindowRequested = false;
108
+ return requested;
25
109
  }
26
110
  /**
27
111
  * Records the request-input side of the first server usage sample.
@@ -45,7 +129,7 @@ export class AutoCompactWindow {
45
129
  this.prefillSource = "estimated";
46
130
  }
47
131
  snapshot() {
48
- return { ordinal: this.ordinal, prefillInputTokens: this.prefillInputTokens };
132
+ return { prefillInputTokens: this.prefillInputTokens };
49
133
  }
50
134
  /**
51
135
  * Tokens added since the start of this window (BodyAfterPrefix mode).
@@ -1 +1 @@
1
- {"version":3,"file":"auto_compact_window.js","sourceRoot":"","sources":["../../../../core/src/state/auto_compact_window.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,OAAO,iBAAiB;IACpB,OAAO,GAAG,CAAC,CAAC;IACpB;;;;OAIG;IACK,kBAAkB,GAAkB,IAAI,CAAC;IACzC,aAAa,GAAkC,IAAI,CAAC;IAE5D,YAAY;QACV,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,uEAAuE;IACvE,SAAS;QACP,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,2BAA2B,CAAC,WAAmB;QAC7C,IAAI,IAAI,CAAC,aAAa,KAAK,QAAQ;YAAE,OAAO;QAC5C,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAChC,CAAC;IAED;;;OAGG;IACH,mBAAmB,CAAC,MAAc;QAChC,IAAI,IAAI,CAAC,aAAa,KAAK,QAAQ;YAAE,OAAO;QAC5C,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,OAAO,E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4
4
  import type { ToolSpec } from "../../../../tools/src/tool_spec.js";
5
5
  export declare const REQUEST_USER_INPUT_TOOL_NAME = "request_user_input";
6
+ /** mirrors MIN/MAX_AUTO_RESOLUTION_MS (request_user_input_spec.rs:9-10) */
7
+ export declare const MIN_AUTO_RESOLUTION_MS = 60000;
8
+ export declare const MAX_AUTO_RESOLUTION_MS = 240000;
6
9
  export declare function createRequestUserInputTool(): ToolSpec;
7
- /** Normalise args from the model: ensure options exist and set isOther = true */
10
+ /**
11
+ * Normalise args from the model: ensure options exist, set isOther = true, and
12
+ * clamp autoResolutionMs into the supported range.
13
+ * mirrors normalize_request_user_input_args (request_user_input_spec.rs:104).
14
+ */
8
15
  export declare function normalizeRequestUserInputArgs(args: {
9
16
  questions?: {
10
17
  id: string;
@@ -17,8 +24,10 @@ export declare function normalizeRequestUserInputArgs(args: {
17
24
  isOther?: boolean;
18
25
  isSecret?: boolean;
19
26
  }[];
27
+ autoResolutionMs?: unknown;
20
28
  }): {
21
29
  questions: import("../../../../protocol/src/request_user_input.js").RequestUserInputQuestion[];
30
+ autoResolutionMs?: number | undefined;
22
31
  } | {
23
32
  error: string;
24
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"request_user_input_spec.d.ts","sourceRoot":"","sources":["../../../../../core/src/tools/handlers/request_user_input_spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAGnE,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AAEjE,wBAAgB,0BAA0B,IAAI,QAAQ,CAgDrD;AAED,iFAAiF;AACjF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACnD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;CACL,GAAG;IAAE,SAAS,EAAE,OAAO,gDAAgD,EAAE,wBAAwB,EAAE,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA0BzH"}
1
+ {"version":3,"file":"request_user_input_spec.d.ts","sourceRoot":"","sources":["../../../../../core/src/tools/handlers/request_user_input_spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAGnE,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AACjE,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAE9C,wBAAgB,0BAA0B,IAAI,QAAQ,CAgErD;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACnD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;IACJ,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACG;IACE,SAAS,EAAE,OAAO,gDAAgD,EAAE,wBAAwB,EAAE,CAAC;IAC/F,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,GACD;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAuCpB"}