@eigenpal/cli 0.16.6 → 0.16.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eigenpal/cli
2
2
 
3
+ ## 0.16.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 35375db: The CLI now uploads macro-enabled Excel workbooks with the correct media type, so original `.xlsm` workflow inputs work without manual conversion.
8
+
3
9
  ## 0.16.4
4
10
 
5
11
  ### Minor Changes
package/dist/cli.js CHANGED
@@ -8038,6 +8038,9 @@ function refineLayoutOutputFormat(config, ctx) {
8038
8038
  message: LAYOUT_OUTPUT_PARSE_MODE_ERROR
8039
8039
  });
8040
8040
  }
8041
+ function mimeTypeForExtension(extension) {
8042
+ return EXTENSION_TO_MIME[extension.replace(/^\./, "").toLowerCase()];
8043
+ }
8041
8044
  var OFFICE_MIME_TYPES, ParserCategory, ParserTypeSchema, ParseModeSchema, PARSE_OUTPUT_FORMATS, ParseOutputFormatSchema, PageProvenanceSourceSchema, PageProvenanceSchema, ProcessingStrategySchema, LAYOUT_OUTPUT_PARSE_MODE_ERROR = 'outputFormat "layout" is native PDF-only. Set parseMode to "native" or "native-or-ocr". Omitted parseMode, OCR, vision, and nativeText: true cannot request layout.', PARSE_OUTPUT_FORMAT_DESCRIPTION = "Format for extracted text. `markdown` (default) keeps structure; `plain` is unstyled text; `djot`/`html` preserve more markup. `layout` is native-PDF spatial text with column gaps preserved as spaces. It requires `parseMode: native` or `parseMode: native-or-ocr` and a PDF — omitted parseMode and `nativeText: true` are not enough. Native mode is layout-only and fail-closed. `native-or-ocr` keeps layout text on accepted native pages and uses OCR markdown on suspect or empty pages, so the document can mix fixed-width layout and markdown. Extractor failure never falls back to another parser. Office, plaintext, and images fail. OCR/vision cannot request `layout`.", DocumentMetadataSchema, ParseUsageSchema, StructuredDocumentSchema, CoordinateUnitSchema, PointSchema, BoundingRegionSchema, PositionedTextSchema, TableCellSchema, ExtractedTableSchema, LayoutElementTypeSchema, LayoutElementSchema, PageResultSchema, ParseResultSchema, ParseOptionsSchema, ParserInputSchema, EXTENSION_TO_MIME, MIME_TO_EXTENSION;
8042
8045
  var init_parser = __esm(() => {
8043
8046
  init_zod();
@@ -8587,7 +8590,7 @@ var init_split = __esm(() => {
8587
8590
  rules: string2().optional().describe("Optional natural-language rules appended to the system prompt"),
8588
8591
  provider: string2().optional().describe('Provider ID from eigenpal.config.yaml (e.g. "openai-gpt5.4-mini"). Falls back to the tenant default LLM provider when omitted.'),
8589
8592
  reasoningEffort: ReasoningEffortSchema.optional().describe("Reasoning effort for the split model. Omit to use the model default."),
8590
- windowTokenBudget: number2().int().positive().optional().describe("Per-window token ceiling. Defaults to env SPLIT_WINDOW_TOKEN_BUDGET or 20000. Smaller windows give sharper anchors on contract-style documents (less competing context for the LLM to mis-anchor on); 50k–100k when sections routinely exceed per-window page count.")
8593
+ windowTokenBudget: number2().int().positive().optional().describe("Per-window token ceiling, enforced across and within parsed pages while preserving the original page index. Defaults to env SPLIT_WINDOW_TOKEN_BUDGET or 20000. Smaller windows give sharper anchors on contract-style documents; use 50k–100k only when broader context is necessary. The step rejects inputs requiring more than 64 LLM windows.")
8591
8594
  });
8592
8595
  ConfidenceLevelSchema2 = _enum(["low", "medium", "high"]).describe("LLM confidence as a coarse enum. Numeric (0..1) confidences cluster at 0.85–0.95 and gradations are noise; low/medium/high is reliable.");
8593
8596
  SplitSectionSchema = object({
@@ -8867,6 +8870,11 @@ var init_processor = __esm(() => {
8867
8870
  init_configs();
8868
8871
  });
8869
8872
 
8873
+ // ../types/src/parser/index.ts
8874
+ var init_parser2 = __esm(() => {
8875
+ init_parser();
8876
+ });
8877
+
8870
8878
  // ../types/src/execution-row.ts
8871
8879
  function isTerminalExecutionStatus(status) {
8872
8880
  return status != null && TERMINAL_STATUS_SET.has(status);
@@ -53220,7 +53228,7 @@ function describeUnsupportedType(nodeType) {
53220
53228
  function compileTypedScript(opts) {
53221
53229
  let ast;
53222
53230
  try {
53223
- ast = import_parser3.parse(opts.source, {
53231
+ ast = import_parser4.parse(opts.source, {
53224
53232
  sourceType: "script",
53225
53233
  plugins: ["typescript"],
53226
53234
  ranges: true
@@ -53473,9 +53481,9 @@ function stripCommentsAndStrings(s) {
53473
53481
  out = out.replace(/`(\\.|[^`\\])*`/g, "``");
53474
53482
  return out;
53475
53483
  }
53476
- var import_parser3, import_sucrase, EVALUATOR_FN_NAME = "scoreScript", EVALUATOR_PARAM_NAMES, TRANSFORM_FN_NAME = "script";
53484
+ var import_parser4, import_sucrase, EVALUATOR_FN_NAME = "scoreScript", EVALUATOR_PARAM_NAMES, TRANSFORM_FN_NAME = "script";
53477
53485
  var init_compile = __esm(() => {
53478
- import_parser3 = __toESM(require_lib(), 1);
53486
+ import_parser4 = __toESM(require_lib(), 1);
53479
53487
  import_sucrase = __toESM(require_dist3(), 1);
53480
53488
  EVALUATOR_PARAM_NAMES = ["expected", "actual"];
53481
53489
  });
@@ -53897,7 +53905,7 @@ var init_step_configs = __esm(() => {
53897
53905
  rules: string2().optional().describe('Optional natural-language rules appended to the system prompt. E.g. "End-of-section markers like *Koniec prílohy 2* close the current section."'),
53898
53906
  provider: string2().optional().describe('Provider ID from eigenpal.config.yaml (e.g. "openai-gpt5.4-mini"). Falls back to the tenant default LLM provider when omitted.'),
53899
53907
  reasoningEffort: OptionalReasoningEffortSchema,
53900
- windowTokenBudget: number2().int().positive().optional().describe("Override the per-window token ceiling for this step. Defaults to env SPLIT_WINDOW_TOKEN_BUDGET or 20000. Smaller windows give sharper anchors on contract-style documents (less competing context for the LLM to mis-anchor on); bump to 50k–100k when sections routinely exceed per-window page count.")
53908
+ windowTokenBudget: number2().int().positive().optional().describe("Override the estimated per-window token ceiling. Oversized pages are subdivided with overlap while retaining their original page index. Defaults to env SPLIT_WINDOW_TOKEN_BUDGET or 20000. Inputs requiring more than 64 LLM windows are rejected before calls begin.")
53901
53909
  });
53902
53910
  AiSplitSectionSchema = object({
53903
53911
  name: string2().describe("Section name from the config"),
@@ -56272,6 +56280,7 @@ var init_src = __esm(() => {
56272
56280
  init_core3();
56273
56281
  init_scoped_file_ref();
56274
56282
  init_processor();
56283
+ init_parser2();
56275
56284
  init_execution_row();
56276
56285
  init_run_expand();
56277
56286
  init_validation();
@@ -206226,7 +206235,7 @@ import { fileURLToPath as fileURLToPath8 } from "url";
206226
206235
  // package.json
206227
206236
  var package_default = {
206228
206237
  name: "@eigenpal/cli",
206229
- version: "0.16.6",
206238
+ version: "0.16.8",
206230
206239
  description: "Eigenpal CLI — author and run document workflows from your terminal. Agent-ready.",
206231
206240
  keywords: [
206232
206241
  "eigenpal",
@@ -212055,13 +212064,14 @@ function assertMissingDimensionCellRefs(path, xml, limits) {
212055
212064
  assertOptionalCountLimits(path, maxRow, maxCol, limits);
212056
212065
  }
212057
212066
  }
212058
- function assertSafeSpreadsheetZip(bytes, limits = SPREADSHEET_ZIP_STRUCTURE_DEFAULTS) {
212067
+ function assertSafeSpreadsheetZip(bytes, limits = SPREADSHEET_ZIP_STRUCTURE_DEFAULTS, options = {}) {
212059
212068
  if (!isOfficeZipContainer(bytes)) {
212060
212069
  throw new Error("Unsupported spreadsheet: expected an .xls or .xlsx workbook");
212061
212070
  }
212062
212071
  const inspection = inspectSafeOfficeZip(bytes);
212063
212072
  const classified = classifyOfficeSpreadsheetZip(inspection);
212064
- if (classified.kind !== "xlsx") {
212073
+ const allowedMacroWorkbook = classified.kind === "unsupported" && classified.format === "xlsm" && options.allowMacros === true;
212074
+ if (classified.kind !== "xlsx" && !allowedMacroWorkbook) {
212065
212075
  throw new Error(classified.message);
212066
212076
  }
212067
212077
  const worksheetEntries = inspection.entries.filter((entry) => SPREADSHEET_WORKSHEET_PATH_RE.test(entry.path));
@@ -239318,30 +239328,10 @@ import { existsSync as existsSync11, readdirSync as readdirSync3, readFileSync a
239318
239328
  import { join as join6 } from "path";
239319
239329
 
239320
239330
  // src/lib/fs-helpers.ts
239331
+ init_src();
239321
239332
  import { extname as extname3, join as join5 } from "path";
239322
- var EXT_MIME = {
239323
- ".pdf": "application/pdf",
239324
- ".png": "image/png",
239325
- ".jpg": "image/jpeg",
239326
- ".jpeg": "image/jpeg",
239327
- ".webp": "image/webp",
239328
- ".tiff": "image/tiff",
239329
- ".odt": "application/vnd.oasis.opendocument.text",
239330
- ".txt": "text/plain",
239331
- ".csv": "text/csv",
239332
- ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
239333
- ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
239334
- ".doc": "application/msword",
239335
- ".xls": "application/vnd.ms-excel",
239336
- ".rtf": "application/rtf",
239337
- ".msg": "application/vnd.ms-outlook",
239338
- ".json": "application/json",
239339
- ".xml": "application/xml",
239340
- ".html": "text/html",
239341
- ".zip": "application/zip"
239342
- };
239343
239333
  function guessMimeType(filename) {
239344
- return EXT_MIME[extname3(filename).toLowerCase()] || "";
239334
+ return mimeTypeForExtension(extname3(filename)) ?? "";
239345
239335
  }
239346
239336
 
239347
239337
  // src/lib/payload.ts