@ai-matrx/records 0.76.13 → 0.76.15

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.
@@ -592,7 +592,7 @@ interface ParsedImport {
592
592
  /** Every row, keyed by heading. Every column is here; nothing is dropped. */
593
593
  rows: Array<Record<string, string>>;
594
594
  }
595
- /** RFC-4180 enough for what the canonical table writes, quotes and embedded newlines included. */
595
+ /** Comma-separated text as rows — THE one reader (kit `parseDelimited`), quotes and embedded newlines included. */
596
596
  declare function parseCsv(text: string): string[][];
597
597
  declare function importCsv(text: string): ParsedImport;
598
598
  declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
@@ -592,7 +592,7 @@ interface ParsedImport {
592
592
  /** Every row, keyed by heading. Every column is here; nothing is dropped. */
593
593
  rows: Array<Record<string, string>>;
594
594
  }
595
- /** RFC-4180 enough for what the canonical table writes, quotes and embedded newlines included. */
595
+ /** Comma-separated text as rows — THE one reader (kit `parseDelimited`), quotes and embedded newlines included. */
596
596
  declare function parseCsv(text: string): string[][];
597
597
  declare function importCsv(text: string): ParsedImport;
598
598
  declare function importXlsx(bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
@@ -4399,7 +4399,7 @@ function scopeChip(scope) {
4399
4399
 
4400
4400
  // src/table-kind-mapping.json
4401
4401
  var table_kind_mapping_default = {
4402
- about: "THE ONE MAPPING from a store Field to a kind's three schemas (KINDS-GLUE wave 3 \xA72). Hand-written here; aidream copies it verbatim to packages/matrx-graph/matrx_graph/table_kind_mapping.json (scripts/generate_table_kind_mapping.py --check). Both languages derive from this file only: @ai-matrx/records src/table-kind.ts and matrx_graph.table_kinds. Keys of `kinds` are the store's field kinds (custom.field_kinds() plus the formula `system` kinds custom.field_kind_of answers). Stored mode only: `column_source_default` is custom.table_column_source's answer when the facts carry none (silence means the doctrine: Field rows are the columns); `platform_keys` mirrors custom.record_platform_keys() with each key's shape (parent_id: custom.containment_parent's uuid cast); `stored_patterns` mirror custom.validate_values' relation id regex and, for dates, refuse a string the timestamptz cast can never read (no digits, not a special word) while never refusing one it can.",
4402
+ about: "THE ONE MAPPING from a store Field to a kind's three schemas (KINDS-GLUE wave 3 \xA72). Hand-written here; aidream copies it verbatim to packages/matrx-graph/matrx_graph/table_kind_mapping.json (scripts/generate_table_kind_mapping.py --check). Both languages derive from this file only: @ai-matrx/records src/table-kind.ts and matrx_graph.table_kinds. Keys of `kinds` are the store's field kinds (custom.field_kinds() plus the formula `system` kinds custom.field_kind_of answers). Stored mode only: `column_source_default` is custom.table_column_source's answer when the facts carry none (silence means the doctrine: Field rows are the columns); `platform_keys` mirrors custom.record_platform_keys() with each key's shape (parent_id: custom.containment_parent's uuid cast; icon: the record's own @ai-matrx/icons name, a string or null); `stored_patterns` mirror custom.validate_values' relation id regex and, for dates, refuse a string the timestamptz cast can never read (no digits, not a special word) while never refusing one it can.",
4403
4403
  version: 2,
4404
4404
  kernels: {
4405
4405
  file: "11111111-0000-4000-8000-000000000006",
@@ -4420,7 +4420,8 @@ var table_kind_mapping_default = {
4420
4420
  address_part_max: 200,
4421
4421
  column_source_default: "fields",
4422
4422
  platform_keys: {
4423
- parent_id: { type: ["string", "null"], pattern: "^(?:\\{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}\\}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$" }
4423
+ parent_id: { type: ["string", "null"], pattern: "^(?:\\{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}\\}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$" },
4424
+ icon: { type: ["string", "null"] }
4424
4425
  },
4425
4426
  stored_patterns: {
4426
4427
  record_id: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
@@ -9532,7 +9533,7 @@ function predictWriteRefusals(args) {
9532
9533
  }
9533
9534
 
9534
9535
  // src/core/io.ts
9535
- import { toDelimited } from "@ai-matrx/kit/delimited";
9536
+ import { parseDelimited, toDelimited } from "@ai-matrx/kit/delimited";
9536
9537
 
9537
9538
  // src/core/wholeValue.ts
9538
9539
  import { formatFileSize } from "@ai-matrx/kit/format";
@@ -9618,38 +9619,7 @@ async function exportXlsx(fields, rows2, sheetLabel = "Records") {
9618
9619
  return writeWorkbookBytes({ sheets: [{ name, rows: toAoa(fields, rows2) }] });
9619
9620
  }
9620
9621
  function parseCsv(text2) {
9621
- const rows2 = [];
9622
- let row = [];
9623
- let cell = "";
9624
- let quoted = false;
9625
- for (let i = 0; i < text2.length; i += 1) {
9626
- const ch = text2[i];
9627
- if (quoted) {
9628
- if (ch === '"') {
9629
- if (text2[i + 1] === '"') {
9630
- cell += '"';
9631
- i += 1;
9632
- } else quoted = false;
9633
- } else cell += ch;
9634
- continue;
9635
- }
9636
- if (ch === '"') quoted = true;
9637
- else if (ch === ",") {
9638
- row.push(cell);
9639
- cell = "";
9640
- } else if (ch === "\n" || ch === "\r") {
9641
- if (ch === "\r" && text2[i + 1] === "\n") i += 1;
9642
- row.push(cell);
9643
- rows2.push(row);
9644
- row = [];
9645
- cell = "";
9646
- } else cell += ch;
9647
- }
9648
- if (cell.length > 0 || row.length > 0) {
9649
- row.push(cell);
9650
- rows2.push(row);
9651
- }
9652
- return rows2;
9622
+ return parseDelimited(text2, { delimiter: ",", skipEmptyLines: true }).data;
9653
9623
  }
9654
9624
  function importCsv(text2) {
9655
9625
  return fromMatrix(parseCsv(text2));