@bendyline/gezel-sdk 1.1.5 → 1.1.6

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/checks.d.ts CHANGED
@@ -337,6 +337,14 @@ declare function normalizeDigitGroups(text: string): string;
337
337
  * carries meaning in globs.
338
338
  */
339
339
  declare function normalizeInlineEmphasis(text: string): string;
340
+ /**
341
+ * Fold typographic hyphens (U+2010-U+2012, U+2212) and no-break, figure, thin
342
+ * and narrow spaces to ASCII. Nemotron 3.5 Lightning writes dates and
343
+ * compounds with U+2011 between the parts, so a faithful 2026-09-01 read as a
344
+ * missing value (2026-10-15). En and em dashes are punctuation and stay. Like
345
+ * the emphasis fold, this only ever widens what a required value can match.
346
+ */
347
+ declare function normalizeTypography(text: string): string;
340
348
  /** A single grounded fact: at least one `required` form must appear and no
341
349
  * `forbidden` (decoy) form may. Values are regex sources, matched
342
350
  * case-insensitively against the (optionally digit-normalized) text. */
@@ -901,4 +909,4 @@ declare function workspaceFromGezel(g: {
901
909
  };
902
910
  }): WorkspaceLike;
903
911
 
904
- export { type CellType, type CheckResult, type CitationsResult, type CodebaseReviewReportOptions, type CodebaseReviewReportResult, type CorpusCoverageLedger, type CorpusCoverageMergeResult, type CorpusCoverageShardInput, type CsvShapeResult, type CsvShapeSpec, type EntitiesResult, type EntitySpec, type ExplainableSniff, type FigureCheckOptions, type FigureCheckResult, type FigureFinding, type FigureFindingKind, GateScriptResult, type GroundingFact, type GroundingResult, IMG_EXT, type ImageRefsReport, type InlineScript, type JsonPathEqualsResult, type JsonScalar, type JudgeVerdict, MIN_INLINE_JS_BYTES, MIN_JUDGE_EVIDENCE_SUBSTRING, type MarkdownHeadingsMatchResult, type ParsedTable, type PlanRow, type PlanStructureResult, type PlanStructureSpec, type ReadingLevelResult, type RecordFieldSpec, type RecordSchemaResult, type RecordSchemaSpec, type ScriptValidation, type SecurityReportOptions, type SecurityReportResult, type StepSniffName, type TableShapeResult, type TableShapeSpec, type UnsupportedClaimPattern, type UnsupportedClaimViolation, type UnsupportedClaimsResult, type ValuesSubsetResult, type ValuesSubsetSpec, type WordBandResult, type WorkspaceLike, buildJudgePrompt, checkFigures, citationsResolve, citedPathKey, cleanCitedPath, codebaseReviewReport, containsPattern, countDistinctMatches, createCitedPathChecker, cssMinBytes, csvShape, dataTableSniff, detectTypeScriptOnlySyntax, detectUnclosedScript, esmImports, explainSniff, extractInlineScripts, extractMoneyAmounts, fileCountByExt, fileMinBytes, fileMinLines, findImageRefs, frontmatterList, gateResult, grepMatches, htmlCompleteSniff, htmlGameSniff, imageRefsResolve, inlineJsBytes, isRealIsoDate, jsonPathEquals, jsonValid, listedFiles, markdownHeadingsMatch, mergeCorpusCoverageShards, namedEntitiesConsistent, normalizeDigitGroups, normalizeInlineEmphasis, notContainsPattern, parseCsv, parseJudgeVerdict, parseMarkdownTable, planStructure, readingLevel, recordSchema, requireOrderedSections, resolveRelative, runSniff, securityReport, standaloneJsParses, tableShape, totalMinBytes, unsupportedClaims, validateJudgeEvidence, validateScriptSyntax, valueGrounding, valuesSubsetOf, wordBand, workspaceFromGezel, wrapperReturnHint };
912
+ export { type CellType, type CheckResult, type CitationsResult, type CodebaseReviewReportOptions, type CodebaseReviewReportResult, type CorpusCoverageLedger, type CorpusCoverageMergeResult, type CorpusCoverageShardInput, type CsvShapeResult, type CsvShapeSpec, type EntitiesResult, type EntitySpec, type ExplainableSniff, type FigureCheckOptions, type FigureCheckResult, type FigureFinding, type FigureFindingKind, GateScriptResult, type GroundingFact, type GroundingResult, IMG_EXT, type ImageRefsReport, type InlineScript, type JsonPathEqualsResult, type JsonScalar, type JudgeVerdict, MIN_INLINE_JS_BYTES, MIN_JUDGE_EVIDENCE_SUBSTRING, type MarkdownHeadingsMatchResult, type ParsedTable, type PlanRow, type PlanStructureResult, type PlanStructureSpec, type ReadingLevelResult, type RecordFieldSpec, type RecordSchemaResult, type RecordSchemaSpec, type ScriptValidation, type SecurityReportOptions, type SecurityReportResult, type StepSniffName, type TableShapeResult, type TableShapeSpec, type UnsupportedClaimPattern, type UnsupportedClaimViolation, type UnsupportedClaimsResult, type ValuesSubsetResult, type ValuesSubsetSpec, type WordBandResult, type WorkspaceLike, buildJudgePrompt, checkFigures, citationsResolve, citedPathKey, cleanCitedPath, codebaseReviewReport, containsPattern, countDistinctMatches, createCitedPathChecker, cssMinBytes, csvShape, dataTableSniff, detectTypeScriptOnlySyntax, detectUnclosedScript, esmImports, explainSniff, extractInlineScripts, extractMoneyAmounts, fileCountByExt, fileMinBytes, fileMinLines, findImageRefs, frontmatterList, gateResult, grepMatches, htmlCompleteSniff, htmlGameSniff, imageRefsResolve, inlineJsBytes, isRealIsoDate, jsonPathEquals, jsonValid, listedFiles, markdownHeadingsMatch, mergeCorpusCoverageShards, namedEntitiesConsistent, normalizeDigitGroups, normalizeInlineEmphasis, normalizeTypography, notContainsPattern, parseCsv, parseJudgeVerdict, parseMarkdownTable, planStructure, readingLevel, recordSchema, requireOrderedSections, resolveRelative, runSniff, securityReport, standaloneJsParses, tableShape, totalMinBytes, unsupportedClaims, validateJudgeEvidence, validateScriptSyntax, valueGrounding, valuesSubsetOf, wordBand, workspaceFromGezel, wrapperReturnHint };
package/dist/checks.js CHANGED
@@ -530,7 +530,7 @@ function requireOrderedSections(text, headers) {
530
530
  let cursor = 0;
531
531
  for (const header of headers) {
532
532
  const escaped = header.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
533
- const re = new RegExp(`^#+\\s+${escaped}\\s*$`, "im");
533
+ const re = new RegExp(`^#+\\s+${escaped}(?:\\s*\\([^)\\n]*\\))?\\s*:?\\s*$`, "im");
534
534
  const slice = text.slice(cursor);
535
535
  const m = slice.match(re);
536
536
  if (!m || m.index === void 0) {
@@ -1004,6 +1004,9 @@ function normalizeDigitGroups(text) {
1004
1004
  function normalizeInlineEmphasis(text) {
1005
1005
  return text.replace(/\*\*|__|`/g, "");
1006
1006
  }
1007
+ function normalizeTypography(text) {
1008
+ return text.replace(/[\u2010-\u2012\u2212]/g, "-").replace(/[\u00a0\u2007\u2009\u202f]/g, " ");
1009
+ }
1007
1010
  function safeRegExp(src, flags) {
1008
1011
  try {
1009
1012
  return new RegExp(src, flags);
@@ -1012,8 +1015,8 @@ function safeRegExp(src, flags) {
1012
1015
  }
1013
1016
  }
1014
1017
  function valueGrounding(text, facts, opts = {}) {
1015
- const haystack = normalizeInlineEmphasis(
1016
- opts.normalizeDigits === false ? text : normalizeDigitGroups(text)
1018
+ const haystack = normalizeTypography(
1019
+ normalizeInlineEmphasis(opts.normalizeDigits === false ? text : normalizeDigitGroups(text))
1017
1020
  );
1018
1021
  const signals = [];
1019
1022
  const decoysDetected = [];
@@ -1187,7 +1190,7 @@ function valuesSubsetOf(outputText, sourceTexts, spec) {
1187
1190
  return out;
1188
1191
  };
1189
1192
  const caseInsensitive = flags.includes("i");
1190
- const foldSpace = (t) => t.replace(/ | | | /g, " ").replace(/\u00a0/g, " ").replace(/\s+/g, " ");
1193
+ const foldSpace = (t) => normalizeTypography(t).replace(/ | | | /g, " ").replace(/\s+/g, " ");
1191
1194
  const normalize = (t) => {
1192
1195
  const folded = foldSpace(t);
1193
1196
  return caseInsensitive ? folded.toLowerCase() : folded;
@@ -2406,12 +2409,21 @@ var REQUIRED_COLUMNS = ["id", "task", "owner", "depends on", "done when"];
2406
2409
  function headerIndex(headers, name) {
2407
2410
  return headers.findIndex((h) => h.trim().toLowerCase() === name);
2408
2411
  }
2412
+ function plainCell(cell) {
2413
+ let text = cell.trim();
2414
+ for (; ; ) {
2415
+ const unwrapped = text.match(/^(\*\*|__|\*|_|`)(.+)\1$/)?.[2]?.trim();
2416
+ if (!unwrapped) return text;
2417
+ text = unwrapped;
2418
+ }
2419
+ }
2409
2420
  function parseDeps(cell) {
2410
2421
  const trimmed = cell.trim();
2411
- if (!trimmed || /^[-\u2010-\u2015\u2212]$/.test(trimmed) || /^(none|n\/a)$/i.test(trimmed)) {
2422
+ const plain = plainCell(trimmed);
2423
+ if (!plain || /^[-\u2010-\u2015\u2212]$/.test(plain) || /^(none|n\/a)$/i.test(plain)) {
2412
2424
  return [];
2413
2425
  }
2414
- return trimmed.split(/[,;]/).map((s) => s.trim()).filter(Boolean);
2426
+ return trimmed.split(/[,;]/).map(plainCell).filter(Boolean);
2415
2427
  }
2416
2428
  function planStructure(text, spec = {}) {
2417
2429
  const fail = (detail, partial = {}) => ({
@@ -2446,9 +2458,9 @@ function planStructure(text, spec = {}) {
2446
2458
  estimate: headerIndex(headers, "estimate")
2447
2459
  };
2448
2460
  const rows = table.rows.map((cells) => ({
2449
- id: (cells[col.id] ?? "").trim(),
2461
+ id: plainCell(cells[col.id] ?? ""),
2450
2462
  task: (cells[col.task] ?? "").trim(),
2451
- owner: (cells[col.owner] ?? "").trim(),
2463
+ owner: plainCell(cells[col.owner] ?? ""),
2452
2464
  dependsOn: parseDeps(cells[col.deps] ?? ""),
2453
2465
  doneWhen: (cells[col.done] ?? "").trim(),
2454
2466
  ...col.estimate >= 0 && (cells[col.estimate] ?? "").trim() ? { estimate: (cells[col.estimate] ?? "").trim() } : {}
@@ -2786,6 +2798,7 @@ export {
2786
2798
  namedEntitiesConsistent,
2787
2799
  normalizeDigitGroups,
2788
2800
  normalizeInlineEmphasis,
2801
+ normalizeTypography,
2789
2802
  notContainsPattern,
2790
2803
  parseCsv,
2791
2804
  parseJudgeVerdict,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bendyline/gezel-sdk",
3
- "version": "1.1.5",
4
- "description": "SDK imported by scripts running in the Gezel sandbox. Exposes the `gezel` object and `defineScript` helper.",
3
+ "version": "1.1.6",
4
+ "description": "SDK for scripts that run in the Gezel sandbox: the gezel object and the defineScript helper.",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "gezel",
@@ -63,7 +63,7 @@
63
63
  "!dist/**/*.map"
64
64
  ],
65
65
  "devDependencies": {
66
- "@bendyline/gezel": "1.2.5",
66
+ "@bendyline/gezel": "1.2.6",
67
67
  "tsup": "^8.5.1",
68
68
  "typescript": "^6.0.3",
69
69
  "vitest": "^4.1.10"