cdx-chores 0.2.1 → 0.2.2-canary.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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/{discovery-DWPx7mnv.cjs → discovery-6luRdauU.cjs} +4 -7
  3. package/dist/cjs/docx-child.cjs +4 -6
  4. package/dist/cjs/docx-parser.cjs +21 -40
  5. package/dist/cjs/docx-worker.cjs +5 -7
  6. package/dist/cjs/{file-io-C4kZv_nR.cjs → file-io-Mpvv0of_.cjs} +8 -15
  7. package/dist/cjs/index.cjs +420 -736
  8. package/dist/cjs/{limits-gYOZoKwZ.cjs → limits-h2BRjuU8.cjs} +1 -2
  9. package/dist/cjs/{markdown-pdf-template-CWs6T91M.cjs → markdown-pdf-template-G_94fFV7.cjs} +5 -9
  10. package/dist/cjs/{menu-prompt-Ccyj2jTV.cjs → menu-prompt-DpXJjD8C.cjs} +49 -97
  11. package/dist/cjs/{protocol-DCBoZhtP.cjs → protocol-Dvi_2MQj.cjs} +4 -7
  12. package/dist/cjs/{rolldown-runtime-Gi87jfEt.cjs → rolldown-runtime-Bc0pwXKd.cjs} +1 -2
  13. package/dist/cjs/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
  14. package/dist/cjs/{template-codex-CIONsDRY.cjs → template-codex-BbSsPb7X.cjs} +79 -156
  15. package/dist/cjs/{workflow-CDKCREXZ.cjs → workflow-CNoowupZ.cjs} +13 -24
  16. package/dist/esm/bin.mjs +537 -978
  17. package/dist/esm/{discovery-CAU_JRnQ.mjs → discovery-BE-tCTZO.mjs} +3 -6
  18. package/dist/esm/discovery.mjs +3 -6
  19. package/dist/esm/docx-child.mjs +4 -6
  20. package/dist/esm/docx-parser.mjs +20 -39
  21. package/dist/esm/docx-worker.mjs +4 -6
  22. package/dist/esm/{file-io-9Kla0PwA.mjs → file-io-zcm-G8Mo.mjs} +8 -16
  23. package/dist/esm/file-io.mjs +8 -16
  24. package/dist/esm/index.d.mts +1 -21
  25. package/dist/esm/index.mjs +419 -735
  26. package/dist/esm/{limits-BBxswqKh.mjs → limits-CZJyFZxe.mjs} +1 -2
  27. package/dist/esm/{markdown-pdf-template-B0rRw6Dy.mjs → markdown-pdf-template-CNYkGyYE.mjs} +5 -9
  28. package/dist/esm/markdown-pdf-template.mjs +4 -8
  29. package/dist/esm/{menu-prompt-BRn2xwbV.mjs → menu-prompt-9Zoib-bA.mjs} +49 -97
  30. package/dist/esm/{protocol-B_tYnSge.mjs → protocol-eyY6Uh9f.mjs} +4 -7
  31. package/dist/esm/{template-codex-3msNZF6m.mjs → template-codex-CZL5eXa5.mjs} +79 -156
  32. package/dist/esm/{workflow-8lv05XD0.mjs → workflow-1nfXM6gq.mjs} +13 -24
  33. package/dist/esm/workflow.mjs +12 -23
  34. package/package.json +15 -15
package/README.md CHANGED
@@ -83,7 +83,7 @@ Use `cdx-chores doctor` before relying on a command in a script, a CI job, or a
83
83
  | `data extract` reviewed suggestions, `data query codex` | Codex-assisted source shaping, semantic header review, and natural-language SQL drafting | Codex support must be configured and an auth/session signal must be available | Run `cdx-chores doctor` |
84
84
  | `md pdf-profile codex`, `md pdf-template codex`, `md pdf-project codex` | Codex-assisted Markdown PDF profile, template, and coordinated project drafting | Codex support must be configured for Codex-assisted decisions; deterministic fallback paths remain available where documented | Run `cdx-chores doctor` |
85
85
 
86
- The Codex SDK baseline for `v0.2.1` is `@openai/codex-sdk` `0.163.0`.
86
+ The Codex SDK baseline for `v0.2.2-canary.2` is `@openai/codex-sdk` `0.167.0`.
87
87
 
88
88
  Adopted helper commands and explicit `interactive` sessions accept
89
89
  `--codex-model`, `--codex-provider`, and `--codex-reasoning-effort`. Model and
@@ -1,11 +1,11 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-Gi87jfEt.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-Bc0pwXKd.cjs");
2
2
  let node_fs = require("node:fs");
3
3
  let node_path = require("node:path");
4
4
  let node_child_process = require("node:child_process");
5
5
  let node_module = require("node:module");
6
6
  node_module = require_rolldown_runtime.__toESM(node_module, 1);
7
7
  let node_string_decoder = require("node:string_decoder");
8
- //#region src/adapters/codex/discovery/executable.ts
8
+ // src/adapters/codex/discovery/executable.ts
9
9
  function hasType(path, type) {
10
10
  try {
11
11
  const stat = (0, node_fs.statSync)(path);
@@ -65,8 +65,7 @@ function resolveDiscoveryExecutable(env) {
65
65
  throw new Error("Unable to locate the installed Codex binary; install its optional dependencies or set CDX_CHORES_CODEX_PATH.");
66
66
  }
67
67
  }
68
- //#endregion
69
- //#region src/adapters/codex/discovery/transport.ts
68
+ // src/adapters/codex/discovery/transport.ts
70
69
  const MAX_LINE_BYTES = 1048576;
71
70
  const MAX_OUTPUT_BYTES = 8388608;
72
71
  function isRecord(value) {
@@ -221,8 +220,7 @@ var DiscoveryTransport = class {
221
220
  }
222
221
  }
223
222
  };
224
- //#endregion
225
- //#region src/adapters/codex/discovery/index.ts
223
+ // src/adapters/codex/discovery/index.ts
226
224
  const MAX_MODEL_PAGES = 100;
227
225
  const MAX_MODELS = 1e4;
228
226
  async function discoverCodexInfo(options) {
@@ -288,5 +286,4 @@ async function discoverCodexInfo(options) {
288
286
  await transport.close();
289
287
  }
290
288
  }
291
- //#endregion
292
289
  exports.discoverCodexInfo = discoverCodexInfo;
@@ -1,7 +1,7 @@
1
- const require_limits = require("./limits-gYOZoKwZ.cjs");
2
- const require_protocol = require("./protocol-DCBoZhtP.cjs");
1
+ const require_limits = require("./limits-h2BRjuU8.cjs");
2
+ const require_protocol = require("./protocol-Dvi_2MQj.cjs");
3
3
  let node_worker_threads = require("node:worker_threads");
4
- //#region src/docx/runtime/child.ts
4
+ // src/docx/runtime/child.ts
5
5
  async function runDocxChild(options = {}) {
6
6
  const decoder = new require_protocol.RequestFrameDecoder();
7
7
  const started = performance.now();
@@ -146,11 +146,9 @@ async function runDocxChild(options = {}) {
146
146
  process.stdin.resume();
147
147
  await done;
148
148
  }
149
- //#endregion
150
- //#region src/docx/runtime/docx-child.ts
149
+ // src/docx/runtime/docx-child.ts
151
150
  runDocxChild().catch(() => {
152
151
  process.exitCode = 1;
153
152
  process.stdin.destroy();
154
153
  process.stdout.end();
155
154
  });
156
- //#endregion
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
- const require_limits = require("./limits-gYOZoKwZ.cjs");
2
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
3
+ const require_limits = require("./limits-h2BRjuU8.cjs");
4
4
  let dingbat_to_unicode = require("dingbat-to-unicode");
5
5
  let fast_xml_parser = require("fast-xml-parser");
6
6
  let fast_xml_validator = require("fast-xml-validator");
@@ -8,7 +8,7 @@ let node_path = require("node:path");
8
8
  let yauzl = require("yauzl");
9
9
  yauzl = require_rolldown_runtime.__toESM(yauzl, 1);
10
10
  let node_stream_promises = require("node:stream/promises");
11
- //#region src/docx/symbols.ts
11
+ // src/docx/symbols.ts
12
12
  /** Map font symbols permissively; retry unmapped uppercase F0xx codes using their final byte. */
13
13
  function readSymbol(node, diagnostics) {
14
14
  const font = node.attributes.get("w:font");
@@ -20,8 +20,7 @@ function readSymbol(node, diagnostics) {
20
20
  diagnostics.add("docx_symbol_unsupported");
21
21
  return "";
22
22
  }
23
- //#endregion
24
- //#region src/utils/xml-validation.ts
23
+ // src/utils/xml-validation.ts
25
24
  /** Keep syntax policy shared while callers own diagnostics and recovery. */
26
25
  function isValidXml(xml) {
27
26
  try {
@@ -42,8 +41,7 @@ function isValidXml(xml) {
42
41
  return false;
43
42
  }
44
43
  }
45
- //#endregion
46
- //#region src/docx/xml-budget.ts
44
+ // src/docx/xml-budget.ts
47
45
  /** Checks structure and allocation bounds before either XML parser sees a part. */
48
46
  var XmlBudget = class {
49
47
  limits;
@@ -106,8 +104,7 @@ var XmlBudget = class {
106
104
  if (stack.length) throw new Error("docx_xml_invalid");
107
105
  }
108
106
  };
109
- //#endregion
110
- //#region src/docx/xml.ts
107
+ // src/docx/xml.ts
111
108
  const aliases = /* @__PURE__ */ new Map([
112
109
  ["http://schemas.openxmlformats.org/wordprocessingml/2006/main", "w"],
113
110
  ["http://purl.oclc.org/ooxml/wordprocessingml/main", "w"],
@@ -232,8 +229,7 @@ function first(parent, name) {
232
229
  function elementText(value) {
233
230
  return value.children.map((item) => typeof item === "string" ? item : elementText(item)).join("");
234
231
  }
235
- //#endregion
236
- //#region src/docx/content.ts
232
+ // src/docx/content.ts
237
233
  const passthrough = /* @__PURE__ */ new Set([
238
234
  "w:hyperlink",
239
235
  "w:customXml",
@@ -545,8 +541,7 @@ function readComments(root, diagnostics, numberingFor, hyperlinkFor, validateIma
545
541
  }
546
542
  return comments;
547
543
  }
548
- //#endregion
549
- //#region src/docx/style-work.ts
544
+ // src/docx/style-work.ts
550
545
  /** Maximum actual matching steps for one selected node; XML bounds node count. */
551
546
  var StyleWork = class {
552
547
  limits;
@@ -558,8 +553,7 @@ var StyleWork = class {
558
553
  require_limits.checkDocxLimit(++this.steps, "maxStyleTraversalSteps", this.limits);
559
554
  }
560
555
  };
561
- //#endregion
562
- //#region src/docx/numbering.ts
556
+ // src/docx/numbering.ts
563
557
  /** Resolve only the numbering facts used by list selectors in the heading projection. */
564
558
  function createNumberingResolver(numbering, styles, limits) {
565
559
  const abstracts = Object.create(null);
@@ -638,8 +632,7 @@ function createNumberingResolver(numbering, styles, limits) {
638
632
  };
639
633
  };
640
634
  }
641
- //#endregion
642
- //#region src/docx/projection.ts
635
+ // src/docx/projection.ts
643
636
  const voidTags = /* @__PURE__ */ new Set([
644
637
  "br",
645
638
  "hr",
@@ -746,8 +739,7 @@ function projectedEvidence(nodes, limits) {
746
739
  hasContent: html.trim().length > 0
747
740
  };
748
741
  }
749
- //#endregion
750
- //#region src/docx/styles.ts
742
+ // src/docx/styles.ts
751
743
  var Cursor = class {
752
744
  source;
753
745
  offset = 0;
@@ -963,8 +955,7 @@ function styleProjection(styles, embeddedMap, limits, diagnostics, numberingFor)
963
955
  if (nameLevel || name === "HEADING") return [projectionTag(`h${nameLevel ?? 1}`, true)];
964
956
  };
965
957
  }
966
- //#endregion
967
- //#region src/docx/body.ts
958
+ // src/docx/body.ts
968
959
  function enabled(node) {
969
960
  return !!node && !["false", "0"].includes(node.attributes.get("w:val") ?? "");
970
961
  }
@@ -1147,8 +1138,7 @@ function documentBodyFacts(input) {
1147
1138
  diagnostics: [...diagnostics]
1148
1139
  };
1149
1140
  }
1150
- //#endregion
1151
- //#region src/docx/content-loading.ts
1141
+ // src/docx/content-loading.ts
1152
1142
  const RELATIONSHIP_PREFIX = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/";
1153
1143
  function relationshipPath(part) {
1154
1144
  const directory = node_path.posix.dirname(part);
@@ -1245,8 +1235,7 @@ var ContentLoader = class {
1245
1235
  return targets;
1246
1236
  }
1247
1237
  };
1248
- //#endregion
1249
- //#region src/adapters/docx/ooxml-metadata-parser.ts
1238
+ // src/adapters/docx/ooxml-metadata-parser.ts
1250
1239
  const xmlParser$1 = new fast_xml_parser.XMLParser({
1251
1240
  ignoreAttributes: false,
1252
1241
  parseTagValue: false,
@@ -1291,8 +1280,7 @@ function parseDocxExtendedPropertiesApplication(xml) {
1291
1280
  return;
1292
1281
  }
1293
1282
  }
1294
- //#endregion
1295
- //#region src/adapters/docx/ooxml-part-path.ts
1283
+ // src/adapters/docx/ooxml-part-path.ts
1296
1284
  function decodePackagePartSegment(segment) {
1297
1285
  try {
1298
1286
  return decodeURIComponent(segment);
@@ -1305,8 +1293,7 @@ function normalizePackagePartPath(value) {
1305
1293
  const normalized = node_path.posix.normalize(decodedSegments);
1306
1294
  return normalized === "." ? "/" : normalized;
1307
1295
  }
1308
- //#endregion
1309
- //#region src/adapters/docx/ooxml-package.ts
1296
+ // src/adapters/docx/ooxml-package.ts
1310
1297
  function readZipFileFromBuffer(buffer, autoClose = true) {
1311
1298
  return new Promise((resolve, reject) => {
1312
1299
  yauzl.default.fromBuffer(buffer, {
@@ -1357,8 +1344,7 @@ function decodeXmlBuffer(buffer) {
1357
1344
  return buffer.toString("utf8");
1358
1345
  }
1359
1346
  }
1360
- //#endregion
1361
- //#region src/adapters/docx/ooxml-part-discovery.ts
1347
+ // src/adapters/docx/ooxml-part-discovery.ts
1362
1348
  const DOCX_PACKAGE_RELS_PATH = "/_rels/.rels";
1363
1349
  const DOCX_CONTENT_TYPES_PATH = "/[Content_Types].xml";
1364
1350
  const DOCX_DEFAULT_CORE_PROPERTIES_PATH = "/docProps/core.xml";
@@ -1441,8 +1427,7 @@ function resolveDocxMetadataPartPaths(parts) {
1441
1427
  })
1442
1428
  };
1443
1429
  }
1444
- //#endregion
1445
- //#region src/adapters/docx/ooxml-metadata.ts
1430
+ // src/adapters/docx/ooxml-metadata.ts
1446
1431
  /** Apply existing metadata policy to an already-read package. */
1447
1432
  function readDocxCoreMetadataFromParts(parts) {
1448
1433
  const { appPropertiesPath, corePropertiesPath } = resolveDocxMetadataPartPaths(parts);
@@ -1457,8 +1442,7 @@ function readDocxCoreMetadataFromParts(parts) {
1457
1442
  warnings
1458
1443
  };
1459
1444
  }
1460
- //#endregion
1461
- //#region src/docx/metadata.ts
1445
+ // src/docx/metadata.ts
1462
1446
  async function readMetadata(archive, budget) {
1463
1447
  const parts = /* @__PURE__ */ new Map();
1464
1448
  for (const path of archive.metadataEntries.keys()) parts.set(path, "");
@@ -1481,8 +1465,7 @@ async function readMetadata(archive, budget) {
1481
1465
  if (paths.appPropertiesPath) await read(paths.appPropertiesPath);
1482
1466
  return readDocxCoreMetadataFromParts(parts);
1483
1467
  }
1484
- //#endregion
1485
- //#region src/docx/package.ts
1468
+ // src/docx/package.ts
1486
1469
  function nextEntry(zip) {
1487
1470
  return new Promise((resolve, reject) => {
1488
1471
  const cleanup = () => {
@@ -1648,8 +1631,7 @@ async function openGuardedDocxPackage(buffer, limits) {
1648
1631
  }
1649
1632
  };
1650
1633
  }
1651
- //#endregion
1652
- //#region src/docx/reader.ts
1634
+ // src/docx/reader.ts
1653
1635
  /** Inline parser entry; its runtime owner supplies deadline/process containment. */
1654
1636
  async function readDocxDocument(buffer, overrides) {
1655
1637
  let archive;
@@ -1725,5 +1707,4 @@ async function readDocxDocument(buffer, overrides) {
1725
1707
  await archive?.close();
1726
1708
  }
1727
1709
  }
1728
- //#endregion
1729
1710
  exports.readDocxDocument = readDocxDocument;
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
- const require_limits = require("./limits-gYOZoKwZ.cjs");
3
- const require_protocol = require("./protocol-DCBoZhtP.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
2
+ const require_limits = require("./limits-h2BRjuU8.cjs");
3
+ const require_protocol = require("./protocol-Dvi_2MQj.cjs");
4
4
  let node_worker_threads = require("node:worker_threads");
5
5
  let node_child_process = require("node:child_process");
6
6
  node_child_process = require_rolldown_runtime.__toESM(node_child_process, 1);
@@ -15,7 +15,7 @@ let node_net = require("node:net");
15
15
  node_net = require_rolldown_runtime.__toESM(node_net, 1);
16
16
  let node_tls = require("node:tls");
17
17
  node_tls = require_rolldown_runtime.__toESM(node_tls, 1);
18
- //#region src/docx/runtime/offline-guard.ts
18
+ // src/docx/runtime/offline-guard.ts
19
19
  /** Interception is an offline regression check, not an OS security sandbox. */
20
20
  function installOfflineGuard() {
21
21
  const counts = /* @__PURE__ */ new Map();
@@ -69,8 +69,7 @@ function installOfflineGuard() {
69
69
  if (counts.size !== 0) throw new Error("docx_offline_guard_failed");
70
70
  } };
71
71
  }
72
- //#endregion
73
- //#region src/docx/runtime/docx-worker.ts
72
+ // src/docx/runtime/docx-worker.ts
74
73
  async function run() {
75
74
  let result;
76
75
  try {
@@ -92,4 +91,3 @@ async function run() {
92
91
  node_worker_threads.parentPort?.close();
93
92
  }
94
93
  run();
95
- //#endregion
@@ -1,9 +1,9 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-Gi87jfEt.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-Bc0pwXKd.cjs");
2
2
  let node_fs = require("node:fs");
3
3
  let node_fs_promises = require("node:fs/promises");
4
4
  let node_path = require("node:path");
5
5
  let node_crypto = require("node:crypto");
6
- //#region node_modules/picocolors/picocolors.js
6
+ // node_modules/picocolors/picocolors.js
7
7
  var require_picocolors = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
8
8
  let p = process || {};
9
9
  let argv = p.argv || [];
@@ -72,8 +72,7 @@ var require_picocolors = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(
72
72
  module.exports = createColors();
73
73
  module.exports.createColors = createColors;
74
74
  }));
75
- //#endregion
76
- //#region src/cli/colors.ts
75
+ // src/cli/colors.ts
77
76
  var import_picocolors = require_picocolors();
78
77
  function isNoColorEnvSet(env = process.env) {
79
78
  return Object.prototype.hasOwnProperty.call(env, "NO_COLOR");
@@ -86,8 +85,7 @@ function getCliColors(runtime, targetStream) {
86
85
  const stream = targetStream;
87
86
  return (0, import_picocolors.createColors)(runtime.colorEnabled && Boolean(stream.isTTY));
88
87
  }
89
- //#endregion
90
- //#region src/cli/errors.ts
88
+ // src/cli/errors.ts
91
89
  var CliError = class extends Error {
92
90
  exitCode;
93
91
  code;
@@ -102,8 +100,7 @@ function toCliError(error) {
102
100
  if (error instanceof CliError) return error;
103
101
  return new CliError(error instanceof Error ? error.message : String(error));
104
102
  }
105
- //#endregion
106
- //#region src/cli/path-utils.ts
103
+ // src/cli/path-utils.ts
107
104
  function resolveFromCwd(runtime, filePath) {
108
105
  return (0, node_path.resolve)(runtime.cwd, filePath);
109
106
  }
@@ -112,8 +109,7 @@ function formatPathForDisplay(runtime, filePath) {
112
109
  const relativePath = (0, node_path.relative)(runtime.cwd, filePath);
113
110
  return relativePath.length > 0 ? relativePath : ".";
114
111
  }
115
- //#endregion
116
- //#region src/cli/actions/shared.ts
112
+ // src/cli/actions/shared.ts
117
113
  function printLine(stream, line = "") {
118
114
  stream.write(`${line}\n`);
119
115
  }
@@ -142,8 +138,7 @@ async function ensureFileExists(path, label) {
142
138
  });
143
139
  }
144
140
  }
145
- //#endregion
146
- //#region src/cli/markdown-pdf/profile/page-number-format.ts
141
+ // src/cli/markdown-pdf/profile/page-number-format.ts
147
142
  const MARKDOWN_PDF_PAGE_NUMBER_FORMAT_TOKEN_DEFINITIONS = [
148
143
  {
149
144
  introducedIn: 2,
@@ -209,8 +204,7 @@ function parseMarkdownPdfPageNumberFormat(format) {
209
204
  function markdownPdfPageNumberFormatTokens(format) {
210
205
  return parseMarkdownPdfPageNumberFormat(format).flatMap((segment) => segment.kind === "token" ? [segment.token] : []);
211
206
  }
212
- //#endregion
213
- //#region src/cli/file-io.ts
207
+ // src/cli/file-io.ts
214
208
  function isNotFoundError(error) {
215
209
  return error instanceof Error && "code" in error && error.code === "ENOENT";
216
210
  }
@@ -387,7 +381,6 @@ async function writeFileSafe(path, content, options = {}) {
387
381
  await handle?.close();
388
382
  }
389
383
  }
390
- //#endregion
391
384
  Object.defineProperty(exports, "CliError", {
392
385
  enumerable: true,
393
386
  get: function() {