@descent-vtt/spec-harness 0.1.2 → 0.1.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/vendor/spec-core/markdown/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * The shapes a scan produces.\n *\n * Every structure carries absolute UTF-16 offsets into the scanned text - the\n * text after any byte-order mark - and a 1-based line. Nothing holds a copy of\n * the document that a rule could match against and then report somewhere else.\n */\n\nimport type { LineIndex, Range } from '../text/index.js';\n\n/** The three masked copies of a document; see {@link Masks}. */\nexport type MaskKind = 'structure' | 'prose' | 'directives';\n\n/**\n * Copies of the text with some constructs blanked to spaces.\n *\n * Every copy has the length of the text and its line terminators at the same\n * offsets, so a match at an offset of a mask is at that offset of the text, on\n * the same line and in the same column.\n */\nexport interface Masks {\n /**\n * Front matter, block code, raw-text HTML, code spans and comments blanked:\n * what counts as structure. Headings, list items, links and tables are read\n * from this copy.\n */\n readonly structure: string;\n /**\n * Front matter and comments blanked, code kept: what counts as content. A\n * section holding only a template hint in a comment is empty; one holding\n * only a code sample is not.\n */\n readonly prose: string;\n /**\n * Front matter, block code, raw-text HTML and code spans blanked, comments\n * kept: where a directive written in a comment is read, so that one shown in\n * a code sample is not.\n */\n readonly directives: string;\n}\n\nexport type FrontMatterKind = 'yaml' | 'toml';\n\n/** The metadata block at the top of a document. */\nexport interface FrontMatterBlock {\n /** YAML between `---` lines, closed by `---` or `...`; TOML between `+++` lines. */\n readonly kind: FrontMatterKind;\n /** The text between the delimiter lines. */\n readonly raw: string;\n /** Offset of the first character of `raw`. */\n readonly start: number;\n /** Offset just past `raw`: the start of the closing delimiter line. */\n readonly end: number;\n /** Offset just past the closing delimiter line and its terminator. */\n readonly bodyStart: number;\n /** 1-based line of the closing delimiter. */\n readonly closeLine: number;\n}\n\n/**\n * One line of the document. Every line has one, front matter included, so the\n * record for line `n` is at index `n - 1`.\n */\nexport interface ScannedLine {\n /** 1-based. */\n readonly line: number;\n /** Offset of the line's first character. */\n readonly start: number;\n /** Offset just past the line, before its terminator. */\n readonly end: number;\n /**\n * Offset of the first character after the block-quote markers. In a fenced\n * block only the markers of the quote holding the fence are taken off: a `>`\n * written inside the code is code.\n */\n readonly contentStart: number;\n /** The line from `contentStart`, indentation intact. */\n readonly content: string;\n /** Indentation of `content` in columns, a tab reaching the next multiple of four. */\n readonly indent: number;\n /** `content` is empty or whitespace. */\n readonly blank: boolean;\n readonly quoteDepth: number;\n /** Part of the front matter, delimiters included. */\n readonly frontMatter: boolean;\n /** Part of a fenced or indented code block, fences included. */\n readonly code: boolean;\n /** Part of a `<script>`, `<pre>`, `<style>` or `<textarea>` block. */\n readonly html: boolean;\n /**\n * The line's first non-blank character is inside an HTML comment. What is\n * written there is not Markdown, whatever it looks like. Never set on a blank\n * line.\n */\n readonly comment: boolean;\n}\n\nexport type BlockKind = 'fenced' | 'indented' | 'html';\n\n/** A block whose content is not Markdown: code, or raw-text HTML. */\nexport interface Block {\n readonly kind: BlockKind;\n /** Offset of the first line's first character. */\n readonly start: number;\n /** Offset just past the last line, before its terminator. */\n readonly end: number;\n /** 1-based first line: the opening fence or tag, or the first code line. */\n readonly line: number;\n /** 1-based last line. */\n readonly endLine: number;\n /** A fenced block's info string, trimmed; empty for the other kinds. */\n readonly info: string;\n /**\n * Whether a closing fence or closing tag ended the block. One that runs to\n * the end of the document or of its block quote is not closed. An indented\n * block always is.\n */\n readonly closed: boolean;\n}\n\nexport interface HtmlComment {\n /** Offset of `<!--`. */\n readonly start: number;\n /** Offset just past `-->`, or the end of the text for one never closed. */\n readonly end: number;\n /** The text between `<!--` and `-->`. */\n readonly inner: string;\n readonly innerStart: number;\n /** 1-based line of `<!--`. */\n readonly line: number;\n /**\n * False for a comment that opens a line and is never closed, which runs to\n * the end of the document as CommonMark's HTML block does. A `<!--` in the\n * middle of a line with no `-->` after it is text, and is not a comment.\n */\n readonly closed: boolean;\n}\n\nexport type HeadingForm = 'atx' | 'setext';\n\nexport interface Heading {\n readonly form: HeadingForm;\n readonly level: number;\n /**\n * The text a reader sees: trimmed, without an ATX closing sequence, and\n * without any comment in it. Code spans are kept as written.\n */\n readonly text: string;\n /** GitHub's slug of `text`. */\n readonly slug: string;\n /**\n * The anchor GitHub gives the heading: its slug, with `-1`, `-2` and so on\n * appended for the second and later headings that slug the same.\n */\n readonly anchor: string;\n /** Offset of the heading line's content, after any block-quote markers. */\n readonly start: number;\n /** Offset just past the heading line, or past a setext heading's underline. */\n readonly end: number;\n /** Offsets of `text` as written; a comment inside it is between them. */\n readonly textStart: number;\n readonly textEnd: number;\n /** 1-based line of the heading text. */\n readonly line: number;\n /** 1-based last line: the underline of a setext heading. */\n readonly endLine: number;\n}\n\n/** A heading and everything under it up to the next heading at its level or above. */\nexport interface Section {\n readonly heading: Heading;\n /** Offset of the heading line's first character. */\n readonly start: number;\n /** Offset of the line after the heading. */\n readonly bodyStart: number;\n /** Offset of the first line of the next heading at this level or above, or the end of the text. */\n readonly end: number;\n /** 1-based line after the section: that heading's line, or one past the last line. */\n readonly endLine: number;\n}\n\nexport interface ListItem {\n /** Offset of the marker line's content, after any block-quote markers. */\n readonly start: number;\n /** Offset just past the item's last line: continuations and nested content included. */\n readonly end: number;\n /** Offset of the marker. */\n readonly markerStart: number;\n /** `-`, `*`, `+`, or a number followed by `.` or `)`. */\n readonly marker: string;\n /** Offset of the item's text, after the marker and any checkbox. */\n readonly textStart: number;\n /**\n * The character inside a task checkbox, or `null` without one. GFM's are\n * space, `x` and `X`; `~ - ? ! * / +` are read too, and what each means is\n * the caller's decision.\n */\n readonly checkbox: string | null;\n /** Offset of the checkbox's `[`. */\n readonly checkboxStart: number | null;\n /** The text of the marker line, trimmed. */\n readonly firstLine: string;\n /** Everything from `textStart` to `end`. */\n readonly body: string;\n /**\n * `body` read from the structure mask. Anything that searches item text for\n * meaning reads this, or a fenced example nested under the item speaks for it.\n */\n readonly maskedBody: string;\n /** 1-based line of the marker. */\n readonly line: number;\n /** 1-based last line the item owns. */\n readonly endLine: number;\n /** How many list items enclose this one; a top-level item is `0`. */\n readonly depth: number;\n /** Columns before the marker, after any block-quote markers. */\n readonly indent: number;\n readonly quoteDepth: number;\n}\n\nexport type LinkForm = 'inline' | 'reference' | 'shortcut' | 'autolink' | 'wiki' | 'definition';\n\nexport interface Link {\n /**\n * `[text](dest)`, `[text][label]` or `[label][]`, `[label]`, `<https://...>`,\n * `[[target|text]]`, or a reference definition `[label]: dest`.\n */\n readonly form: LinkForm;\n /** Written with a leading `!`: an image, or an embed in the wiki form. */\n readonly image: boolean;\n /** The label as written, trimmed. Empty for an autolink; the label for a definition. */\n readonly text: string;\n /** The destination as written, without angle brackets. */\n readonly target: string;\n /** The reference label of the reference, shortcut and definition forms; `null` for the others. */\n readonly label: string | null;\n /** Offsets of the whole construct, a leading `!` included. */\n readonly start: number;\n readonly end: number;\n /**\n * Offsets of `target` as written. For the inline form and a definition they\n * lie inside the construct, inside any angle brackets, so replacing them\n * rewrites the destination. For the reference and shortcut forms they lie\n * inside the definition: the use has no destination of its own, and the\n * line a human edits to fix one is the definition.\n */\n readonly targetStart: number;\n readonly targetEnd: number;\n /** 1-based line of `start`. */\n readonly line: number;\n}\n\nexport interface TableCell {\n /** The cell as written, trimmed. */\n readonly text: string;\n /** Offsets of the trimmed text. */\n readonly start: number;\n readonly end: number;\n}\n\nexport interface TableRow {\n readonly cells: readonly TableCell[];\n readonly start: number;\n readonly end: number;\n readonly line: number;\n}\n\nexport interface Table {\n /** Offset of the header line's content. */\n readonly start: number;\n /** Offset just past the last row, or past the delimiter row of a table with none. */\n readonly end: number;\n /** 1-based line of the header. */\n readonly line: number;\n /** 1-based last line. */\n readonly endLine: number;\n readonly headers: readonly TableCell[];\n readonly rows: readonly TableRow[];\n}\n\nexport interface MarkdownScan {\n /** The scanned text: the input without a leading byte-order mark. */\n readonly text: string;\n /** Code units taken off the input before scanning: 1 for a byte-order mark, else 0. */\n readonly bom: number;\n readonly index: LineIndex;\n /** One record per line of `index`, front matter included. */\n readonly lines: readonly ScannedLine[];\n readonly frontMatter: FrontMatterBlock | null;\n /** Offset where the body starts, after any front matter. */\n readonly bodyStart: number;\n /** Code blocks and raw-text HTML blocks, in order. */\n readonly blocks: readonly Block[];\n /** Code spans, backticks included, in order. */\n readonly codeSpans: readonly Range[];\n readonly comments: readonly HtmlComment[];\n readonly masks: Masks;\n /** ATX and setext headings, in order. */\n readonly headings: readonly Heading[];\n readonly listItems: readonly ListItem[];\n /** Links, images and definitions, in order of `start`. */\n readonly links: readonly Link[];\n readonly tables: readonly Table[];\n /** Whether an offset is blanked in a mask, the structure mask unless another is named. */\n isMasked(offset: number, mask?: MaskKind): boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/vendor/spec-core/markdown/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * The shapes a scan produces.\n *\n * Every structure carries absolute UTF-16 offsets into the scanned text - the\n * text after any byte-order mark - and a 1-based line. Nothing holds a copy of\n * the document that a rule could match against and then report somewhere else.\n */\n\nimport type { LineIndex, Range } from '../text/index.js';\n\n/** The three masked copies of a document; see {@link Masks}. */\nexport type MaskKind = 'structure' | 'prose' | 'directives';\n\n/**\n * Copies of the text with some constructs blanked to spaces.\n *\n * Every copy has the length of the text and its line terminators at the same\n * offsets, so a match at an offset of a mask is at that offset of the text, on\n * the same line and in the same column.\n */\nexport interface Masks {\n /**\n * Front matter, block code, raw-text HTML, code spans and comments blanked:\n * what counts as structure. Headings, list items, links and tables are read\n * from this copy.\n */\n readonly structure: string;\n /**\n * Front matter and comments blanked, code kept: what counts as content. A\n * section holding only a template hint in a comment is empty; one holding\n * only a code sample is not.\n */\n readonly prose: string;\n /**\n * Front matter, block code, raw-text HTML and code spans blanked, comments\n * kept: where a directive written in a comment is read, so that one shown in\n * a code sample is not.\n */\n readonly directives: string;\n}\n\nexport type FrontMatterKind = 'yaml' | 'toml';\n\n/** The metadata block at the top of a document. */\nexport interface FrontMatterBlock {\n /** YAML between `---` lines, closed by `---` or `...`; TOML between `+++` lines. */\n readonly kind: FrontMatterKind;\n /** The text between the delimiter lines. */\n readonly raw: string;\n /** Offset of the first character of `raw`. */\n readonly start: number;\n /** Offset just past `raw`: the start of the closing delimiter line. */\n readonly end: number;\n /** Offset just past the closing delimiter line and its terminator. */\n readonly bodyStart: number;\n /** 1-based line of the closing delimiter. */\n readonly closeLine: number;\n}\n\n/**\n * One line of the document. Every line has one, front matter included, so the\n * record for line `n` is at index `n - 1`.\n */\nexport interface ScannedLine {\n /** 1-based. */\n readonly line: number;\n /** Offset of the line's first character. */\n readonly start: number;\n /** Offset just past the line, before its terminator. */\n readonly end: number;\n /**\n * Offset of the first character after the block-quote markers. In a fenced\n * block only the markers of the quote holding the fence are taken off: a `>`\n * written inside the code is code.\n */\n readonly contentStart: number;\n /** The line from `contentStart`, indentation intact. */\n readonly content: string;\n /** Indentation of `content` in columns, a tab reaching the next multiple of four. */\n readonly indent: number;\n /** `content` is empty or whitespace. */\n readonly blank: boolean;\n readonly quoteDepth: number;\n /** Part of the front matter, delimiters included. */\n readonly frontMatter: boolean;\n /** Part of a fenced or indented code block, fences included. */\n readonly code: boolean;\n /** Part of a `<script>`, `<pre>`, `<style>` or `<textarea>` block. */\n readonly html: boolean;\n /**\n * The line's first non-blank character is inside an HTML comment. What is\n * written there is not Markdown, whatever it looks like. Never set on a blank\n * line.\n */\n readonly comment: boolean;\n}\n\nexport type BlockKind = 'fenced' | 'indented' | 'html';\n\n/** A block whose content is not Markdown: code, or raw-text HTML. */\nexport interface Block {\n readonly kind: BlockKind;\n /** Offset of the first line's first character. */\n readonly start: number;\n /** Offset just past the last line, before its terminator. */\n readonly end: number;\n /** 1-based first line: the opening fence or tag, or the first code line. */\n readonly line: number;\n /** 1-based last line. */\n readonly endLine: number;\n /** A fenced block's info string, trimmed; empty for the other kinds. */\n readonly info: string;\n /**\n * Whether a closing fence or closing tag ended the block. One that runs to\n * the end of the document or of its block quote is not closed. An indented\n * block always is.\n */\n readonly closed: boolean;\n}\n\nexport interface HtmlComment {\n /** Offset of `<!--`. */\n readonly start: number;\n /** Offset just past `-->`, or the end of the text for one never closed. */\n readonly end: number;\n /** The text between `<!--` and `-->`. */\n readonly inner: string;\n readonly innerStart: number;\n /** 1-based line of `<!--`. */\n readonly line: number;\n /**\n * False for a comment that opens a line and is never closed, which runs to\n * the end of the document as CommonMark's HTML block does. A `<!--` in the\n * middle of a line with no `-->` after it is text, and is not a comment.\n */\n readonly closed: boolean;\n}\n\nexport type HeadingForm = 'atx' | 'setext';\n\nexport interface Heading {\n readonly form: HeadingForm;\n readonly level: number;\n /**\n * The text a reader sees: trimmed, without an ATX closing sequence, and\n * without any comment in it. Code spans are kept as written.\n */\n readonly text: string;\n /** GitHub's slug of `text`. */\n readonly slug: string;\n /**\n * The anchor GitHub gives the heading: its slug, with `-1`, `-2` and so on\n * appended for the second and later headings that slug the same.\n */\n readonly anchor: string;\n /** Offset of the heading line's content, after any block-quote markers. */\n readonly start: number;\n /** Offset just past the heading line, or past a setext heading's underline. */\n readonly end: number;\n /** Offsets of `text` as written; a comment inside it is between them. */\n readonly textStart: number;\n readonly textEnd: number;\n /** 1-based line of the heading text. */\n readonly line: number;\n /** 1-based last line: the underline of a setext heading. */\n readonly endLine: number;\n}\n\n/** A heading and everything under it up to the next heading at its level or above. */\nexport interface Section {\n readonly heading: Heading;\n /** Offset of the heading line's first character. */\n readonly start: number;\n /** Offset of the line after the heading. */\n readonly bodyStart: number;\n /** Offset of the first line of the next heading at this level or above, or the end of the text. */\n readonly end: number;\n /** 1-based line after the section: that heading's line, or one past the last line. */\n readonly endLine: number;\n}\n\nexport interface ListItem {\n /** Offset of the marker line's content, after any block-quote markers. */\n readonly start: number;\n /** Offset just past the item's last line: continuations and nested content included. */\n readonly end: number;\n /** Offset of the marker. */\n readonly markerStart: number;\n /** `-`, `*`, `+`, or a number followed by `.` or `)`. */\n readonly marker: string;\n /** Offset of the item's text, after the marker and any checkbox. */\n readonly textStart: number;\n /**\n * The character inside a task checkbox, or `null` without one. GFM's are\n * space, `x` and `X`; `~ - ? ! * / +` are read too, and what each means is\n * the caller's decision.\n */\n readonly checkbox: string | null;\n /** Offset of the checkbox's `[`. */\n readonly checkboxStart: number | null;\n /** The text of the marker line, trimmed. */\n readonly firstLine: string;\n /** Everything from `textStart` to `end`. */\n readonly body: string;\n /**\n * `body` read from the structure mask. Anything that searches item text for\n * meaning reads this, or a fenced example nested under the item speaks for it.\n */\n readonly maskedBody: string;\n /** 1-based line of the marker. */\n readonly line: number;\n /** 1-based last line the item owns. */\n readonly endLine: number;\n /** How many list items enclose this one; a top-level item is `0`. */\n readonly depth: number;\n /** Columns before the marker, after any block-quote markers. */\n readonly indent: number;\n readonly quoteDepth: number;\n}\n\nexport type LinkForm = 'inline' | 'reference' | 'shortcut' | 'autolink' | 'wiki' | 'definition';\n\nexport interface Link {\n /**\n * `[text](dest)`, `[text][label]` or `[label][]`, `[label]`, `<https://...>`,\n * `[[target|text]]`, or a reference definition `[label]: dest`.\n */\n readonly form: LinkForm;\n /** Written with a leading `!`: an image, or an embed in the wiki form. */\n readonly image: boolean;\n /** The label as written, trimmed. Empty for an autolink; the label for a definition. */\n readonly text: string;\n /** The destination as written, without angle brackets. */\n readonly target: string;\n /** The reference label of the reference, shortcut and definition forms; `null` for the others. */\n readonly label: string | null;\n /**\n * Offsets of the whole construct, a leading `!` included. An image may lie\n * inside a link's text, and is listed after that link.\n */\n readonly start: number;\n readonly end: number;\n /**\n * Offsets of `target` as written. For the inline form and a definition they\n * lie inside the construct, inside any angle brackets, so replacing them\n * rewrites the destination. For the reference and shortcut forms they lie\n * inside the definition: the use has no destination of its own, and the\n * line a human edits to fix one is the definition.\n */\n readonly targetStart: number;\n readonly targetEnd: number;\n /** 1-based line of `start`. */\n readonly line: number;\n}\n\nexport interface TableCell {\n /** The cell as written, trimmed. */\n readonly text: string;\n /** Offsets of the trimmed text. */\n readonly start: number;\n readonly end: number;\n}\n\nexport interface TableRow {\n readonly cells: readonly TableCell[];\n readonly start: number;\n readonly end: number;\n readonly line: number;\n}\n\nexport interface Table {\n /** Offset of the header line's content. */\n readonly start: number;\n /** Offset just past the last row, or past the delimiter row of a table with none. */\n readonly end: number;\n /** 1-based line of the header. */\n readonly line: number;\n /** 1-based last line. */\n readonly endLine: number;\n readonly headers: readonly TableCell[];\n readonly rows: readonly TableRow[];\n}\n\nexport interface MarkdownScan {\n /** The scanned text: the input without a leading byte-order mark. */\n readonly text: string;\n /** Code units taken off the input before scanning: 1 for a byte-order mark, else 0. */\n readonly bom: number;\n readonly index: LineIndex;\n /** One record per line of `index`, front matter included. */\n readonly lines: readonly ScannedLine[];\n readonly frontMatter: FrontMatterBlock | null;\n /** Offset where the body starts, after any front matter. */\n readonly bodyStart: number;\n /** Code blocks and raw-text HTML blocks, in order. */\n readonly blocks: readonly Block[];\n /** Code spans, backticks included, in order. */\n readonly codeSpans: readonly Range[];\n readonly comments: readonly HtmlComment[];\n readonly masks: Masks;\n /** ATX and setext headings, in order. */\n readonly headings: readonly Heading[];\n readonly listItems: readonly ListItem[];\n /** Links, images and definitions, in order of `start`. */\n readonly links: readonly Link[];\n readonly tables: readonly Table[];\n /** Whether an offset is blanked in a mask, the structure mask unless another is named. */\n isMasked(offset: number, mask?: MaskKind): boolean;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descent-vtt/spec-harness",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "The agent-facing member of the spec-* tools: context for a round, a guard on every write, an audit when it ends, probes that prove a defect before it is filed, and rulings a person signs.",
5
5
  "keywords": [
6
6
  "agents",