@agentshouse/mdmodel 0.1.0-cd6a8e5bc7efc → 0.1.0-cdaa2262b2988
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/API.md +108 -115
- package/README.md +15 -13
- package/dist/built-in.d.ts.map +1 -1
- package/dist/built-in.js +10 -1
- package/dist/definition.d.ts +10 -3
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +99 -21
- package/dist/document.d.ts +3 -2
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +113 -71
- package/dist/event.d.ts +4 -7
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +3 -2
- package/dist/facts.d.ts.map +1 -1
- package/dist/facts.js +8 -4
- package/dist/fields.d.ts +1 -1
- package/dist/fields.d.ts.map +1 -1
- package/dist/fields.js +2 -2
- package/dist/folders.d.ts +5 -0
- package/dist/folders.d.ts.map +1 -0
- package/dist/folders.js +19 -0
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +3 -2
- package/dist/house-model.d.ts +190 -24
- package/dist/house-model.d.ts.map +1 -1
- package/dist/house-model.js +99 -15
- package/dist/house-references/crockford.d.ts.map +1 -0
- package/dist/house-references/patterns.d.ts +13 -0
- package/dist/house-references/patterns.d.ts.map +1 -0
- package/dist/house-references/patterns.js +20 -0
- package/dist/index.d.ts +23 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -13
- package/dist/indexed.d.ts +10 -0
- package/dist/indexed.d.ts.map +1 -0
- package/dist/indexed.js +63 -0
- package/dist/kinds.d.ts +9 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +68 -0
- package/dist/markdown.d.ts +0 -4
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +1 -34
- package/dist/media-type.d.ts +72 -0
- package/dist/media-type.d.ts.map +1 -0
- package/dist/media-type.js +157 -0
- package/dist/moment.d.ts +9 -0
- package/dist/moment.d.ts.map +1 -0
- package/dist/moment.js +40 -0
- package/dist/not-ready.d.ts +2 -0
- package/dist/not-ready.d.ts.map +1 -0
- package/dist/not-ready.js +5 -0
- package/dist/paths.d.ts +6 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +33 -3
- package/dist/query/language.d.ts +4 -1
- package/dist/query/language.d.ts.map +1 -1
- package/dist/query/language.js +8 -7
- package/dist/query/match.d.ts +1 -1
- package/dist/query/match.d.ts.map +1 -1
- package/dist/query/match.js +3 -24
- package/dist/query/rows.d.ts +6 -1
- package/dist/query/rows.d.ts.map +1 -1
- package/dist/query/rows.js +37 -8
- package/dist/query/sql.d.ts +10 -1
- package/dist/query/sql.d.ts.map +1 -1
- package/dist/query/sql.js +22 -3
- package/dist/query/walk.d.ts +73 -0
- package/dist/query/walk.d.ts.map +1 -0
- package/dist/query/walk.js +277 -0
- package/dist/references.d.ts +2 -2
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +1 -1
- package/dist/reserved.d.ts +1 -1
- package/dist/reserved.d.ts.map +1 -1
- package/dist/reserved.js +15 -6
- package/dist/room-types.d.ts +2 -1
- package/dist/room-types.d.ts.map +1 -1
- package/dist/room-types.js +19 -13
- package/dist/schema.d.ts +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +6 -7
- package/dist/types.d.ts +11 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +7 -3
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +108 -46
- package/dist/view.d.ts +5 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +27 -0
- package/dist/yaml.d.ts +7 -5
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +154 -33
- package/fixtures/README.md +64 -57
- package/fixtures/cases/absent-link-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/absent-optional-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/absolute-link/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-any-file/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/attachment-reference-outside/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-any-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-document-collision/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-image-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-link-dangles/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-link-outside-collection/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/block-scalar-frontmatter/expected.json +1 -0
- package/fixtures/cases/block-scalar-frontmatter/library/notes/literal.md +17 -0
- package/fixtures/cases/block-scalar-frontmatter/library/skills/notes/SKILL.md +10 -0
- package/fixtures/cases/boolean-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/{duplicate-link-definition/schema.yaml → bracketed-link-definition/schema.md} +2 -0
- package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/conditional-long-text/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/declared-binary-links/schema.md +3 -0
- package/fixtures/cases/default-unfilled/schema.md +57 -0
- package/fixtures/cases/defs-pattern/schema.md +57 -0
- package/fixtures/cases/dependent-rule/schema.md +57 -0
- package/fixtures/cases/{bracketed-link-definition/schema.yaml → duplicate-link-definition/schema.md} +2 -0
- package/fixtures/cases/email-format/schema.md +57 -0
- package/fixtures/cases/equal-labels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/fenced-link-definition/schema.md +7 -0
- package/fixtures/cases/field-enum/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/context.json +1 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/expected.json +1 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/host.md +13 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/map.md +24 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/open.md +13 -0
- package/fixtures/cases/folder-keeps-a-built-in-type/schema.md +9 -0
- package/fixtures/cases/folder-keeps-a-record/context.json +1 -0
- package/fixtures/cases/folder-keeps-a-record/expected.json +1 -0
- package/fixtures/cases/folder-keeps-a-record/library/tickets/2026-11-16-d_1.r.md +13 -0
- package/fixtures/cases/folder-keeps-a-record/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-keeps-a-record/schema.md +9 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/context.json +1 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/expected.json +5 -0
- package/fixtures/cases/folder-names-no-type-of-the-schema/schema.md +7 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/context.json +1 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/expected.json +6 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/library/tickets/archive/2025/old.md +1 -0
- package/fixtures/cases/folder-nearer-entry-types-a-document/schema.md +15 -0
- package/fixtures/cases/folder-refuses-a-declared-any/context.json +1 -0
- package/fixtures/cases/folder-refuses-a-declared-any/expected.json +6 -0
- package/fixtures/cases/folder-refuses-a-declared-any/library/tickets/door.md +5 -0
- package/fixtures/cases/folder-refuses-a-declared-any/schema.md +9 -0
- package/fixtures/cases/folder-refuses-another-declared-type/context.json +1 -0
- package/fixtures/cases/folder-refuses-another-declared-type/expected.json +6 -0
- package/fixtures/cases/folder-refuses-another-declared-type/library/tickets/door.md +5 -0
- package/fixtures/cases/folder-refuses-another-declared-type/schema.md +12 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/context.json +1 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/expected.json +1 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/notes/plan.md +7 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/gate.md +7 -0
- package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/schema.md +13 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/context.json +1 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/expected.json +6 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/library/tickets/2026/gate.md +1 -0
- package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/schema.md +9 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/context.json +1 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/expected.json +7 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/library/tickets/door.md +3 -0
- package/fixtures/cases/folder-types-a-document-that-names-no-type/schema.md +9 -0
- package/fixtures/cases/folder-under-a-reserved-name/context.json +1 -0
- package/fixtures/cases/folder-under-a-reserved-name/expected.json +5 -0
- package/fixtures/cases/folder-under-a-reserved-name/schema.md +7 -0
- package/fixtures/cases/folder-without-a-trailing-slash/context.json +1 -0
- package/fixtures/cases/folder-without-a-trailing-slash/expected.json +5 -0
- package/fixtures/cases/folder-without-a-trailing-slash/schema.md +7 -0
- package/fixtures/cases/frontmatter-construct/context.json +1 -0
- package/fixtures/cases/frontmatter-construct/expected.json +7 -0
- package/fixtures/cases/frontmatter-construct/library/note.md +6 -0
- package/fixtures/cases/integer-field/schema.md +57 -0
- package/fixtures/cases/interrupted-link-definition/schema.md +3 -0
- package/fixtures/cases/json-schema-constructs/schema.md +57 -0
- package/fixtures/cases/labels-in-the-rooms-language/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/lazy-list-item/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-item-enum/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-item-kind/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-items/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
- package/fixtures/cases/list-of-objects-item/schema.md +57 -0
- package/fixtures/cases/list-of-objects-reference/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-reference-path/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/list-size/schema.md +57 -0
- package/fixtures/cases/long-fence-link-definition/schema.md +3 -0
- package/fixtures/cases/long-value-past-six-levels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/malformed-list/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/missing-required-field/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/misspelled-key/schema.md +57 -0
- package/fixtures/cases/name-not-a-string/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/nested-object-reference/schema.md +34 -0
- package/fixtures/cases/nested-reference/schema.md +34 -0
- package/fixtures/cases/nested-required-field/schema.md +57 -0
- package/fixtures/cases/numeric-range/schema.md +57 -0
- package/fixtures/cases/one-key-two-labels/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/one-key-two-types/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/one-of-variant/schema.md +57 -0
- package/fixtures/cases/other-room-reference/schema.md +34 -0
- package/fixtures/cases/paragraph-link-definition/schema.md +3 -0
- package/fixtures/cases/prototype-field/schema.md +7 -0
- package/fixtures/cases/quoted-link-definition/schema.md +3 -0
- package/fixtures/cases/reference-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/reference-to-any-file-name/context.json +1 -0
- package/fixtures/cases/reference-to-any-file-name/expected.json +1 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/100%.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/C#.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/My notes.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/[draft].md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/c (d).md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people/caf/303/251.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/people//320/236/321/202/321/207/321/221/321/202.md +4 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/bracket.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/cyrillic.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/decomposed.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/hash.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/parenthesis.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/percent.md +9 -0
- package/fixtures/cases/reference-to-any-file-name/library/tasks/spaced.md +9 -0
- package/fixtures/cases/{referenced-missing-file/schema.yaml → reference-to-any-file-name/schema.md} +2 -0
- package/fixtures/cases/referenced-missing-file/schema.md +12 -0
- package/fixtures/cases/referenced-missing-non-latin-file/context.json +1 -0
- package/fixtures/cases/referenced-missing-non-latin-file/expected.json +6 -0
- package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/a.md +9 -0
- package/fixtures/cases/referenced-missing-non-latin-file/library/tasks/b.md +9 -0
- package/fixtures/cases/referenced-missing-non-latin-file/schema.md +12 -0
- package/fixtures/cases/remote-ref/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/schema-body-ignored/context.json +1 -0
- package/fixtures/cases/schema-body-ignored/expected.json +1 -0
- package/fixtures/cases/schema-body-ignored/schema.md +9 -0
- package/fixtures/cases/schema-type-named-folders/context.json +1 -0
- package/fixtures/cases/schema-type-named-folders/expected.json +5 -0
- package/fixtures/cases/schema-type-named-folders/schema.md +5 -0
- package/fixtures/cases/schema-type-named-type/context.json +1 -0
- package/fixtures/cases/schema-type-named-type/expected.json +5 -0
- package/fixtures/cases/{unknown-type/schema.yaml → schema-type-named-type/schema.md} +3 -1
- package/fixtures/cases/second-member-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/sections-keyword-refused/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
- package/fixtures/cases/string-length/schema.md +57 -0
- package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/thematic-break-ends-the-values/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/truncated-link-definition/schema.md +3 -0
- package/fixtures/cases/typed-path-names-another-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/typed-path-names-its-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/typed-path-names-no-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/undeclared-field/schema.md +7 -0
- package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unique-in-app-schema/context.json +1 -0
- package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
- package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
- package/fixtures/cases/unique-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-indexed-field/expected.json +1 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
- package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
- package/fixtures/cases/unique-indexed-field/schema.md +9 -0
- package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
- package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
- package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
- package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-checks-its-fields/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-names-a-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-reads-its-type/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unnamed-typed-path-without-a-body/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/unresolved-link/schema.md +7 -0
- package/fixtures/cases/valid-typed-document/{schema.yaml → schema.md} +2 -0
- package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
- package/fixtures/forms.json +24 -0
- package/fixtures/preamble.json +4 -4
- package/fixtures/queries.json +1010 -2
- package/fixtures/references.json +15 -0
- package/package.json +2 -2
- package/dist/crockford.d.ts.map +0 -1
- package/dist/divide.d.ts +0 -3
- package/dist/divide.d.ts.map +0 -1
- package/dist/divide.js +0 -321
- package/dist/house-references.d.ts +0 -4
- package/dist/house-references.d.ts.map +0 -1
- package/dist/house-references.js +0 -7
- package/dist/project.d.ts +0 -22
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js +0 -101
- package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
- package/fixtures/cases/default-unfilled/schema.yaml +0 -55
- package/fixtures/cases/defs-pattern/schema.yaml +0 -55
- package/fixtures/cases/dependent-rule/schema.yaml +0 -55
- package/fixtures/cases/email-format/schema.yaml +0 -55
- package/fixtures/cases/fenced-link-definition/schema.yaml +0 -5
- package/fixtures/cases/frontmatter-schema/expected.json +0 -5
- package/fixtures/cases/integer-field/schema.yaml +0 -55
- package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/json-schema-constructs/schema.yaml +0 -55
- package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -55
- package/fixtures/cases/list-of-objects-item/schema.yaml +0 -55
- package/fixtures/cases/list-size/schema.yaml +0 -55
- package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
- package/fixtures/cases/misspelled-key/schema.yaml +0 -55
- package/fixtures/cases/nested-object-reference/schema.yaml +0 -32
- package/fixtures/cases/nested-reference/schema.yaml +0 -32
- package/fixtures/cases/nested-required-field/schema.yaml +0 -55
- package/fixtures/cases/numeric-range/schema.yaml +0 -55
- package/fixtures/cases/one-of-variant/schema.yaml +0 -55
- package/fixtures/cases/other-room-reference/schema.yaml +0 -32
- package/fixtures/cases/paragraph-link-definition/schema.yaml +0 -1
- package/fixtures/cases/prototype-field/schema.yaml +0 -5
- package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
- package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -5
- package/fixtures/cases/string-length/schema.yaml +0 -55
- package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
- package/fixtures/cases/undeclared-field/schema.yaml +0 -5
- package/fixtures/cases/unresolved-link/schema.yaml +0 -5
- package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
- package/fixtures/division.json +0 -454
- package/fixtures/projection.json +0 -358
- /package/dist/{crockford.d.ts → house-references/crockford.d.ts} +0 -0
- /package/dist/{crockford.js → house-references/crockford.js} +0 -0
- /package/fixtures/cases/{frontmatter-schema → block-scalar-frontmatter}/context.json +0 -0
- /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
package/dist/house-model.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references.js';
|
|
1
|
+
import { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references/patterns.js';
|
|
2
2
|
export const APP_PREFERENCES_HOME = 'settings/apps';
|
|
3
|
+
export const RECORD_TYPE = 'house-record';
|
|
3
4
|
export const HOUSE_MODEL_DECLARATION = {
|
|
4
5
|
$defs: {
|
|
5
6
|
room: {
|
|
@@ -40,16 +41,20 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
40
41
|
'join-request',
|
|
41
42
|
'join-request-approved',
|
|
42
43
|
'room-ownership-offer',
|
|
44
|
+
'new-instructions',
|
|
43
45
|
'managed-environment-retention-opened',
|
|
44
46
|
'storage-full',
|
|
45
47
|
'sandbox-budget-spent',
|
|
46
48
|
'trigger-failed',
|
|
49
|
+
'app-origins-added',
|
|
47
50
|
'room-telegram-chat-paused',
|
|
51
|
+
'viber-number-unlinked',
|
|
48
52
|
'break-glass-owner-disclosure',
|
|
49
53
|
'export-ready',
|
|
50
54
|
'export-failed',
|
|
51
55
|
'custom',
|
|
52
56
|
'agent-function-request-finished',
|
|
57
|
+
'storage-past-included',
|
|
53
58
|
],
|
|
54
59
|
},
|
|
55
60
|
created: { title: 'Created', type: 'string', format: 'date-time' },
|
|
@@ -76,7 +81,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
76
81
|
name: { title: 'Name', type: 'string' },
|
|
77
82
|
email: { title: 'Email', type: 'string', format: 'email' },
|
|
78
83
|
},
|
|
79
|
-
required: ['name'
|
|
84
|
+
required: ['name'],
|
|
80
85
|
},
|
|
81
86
|
rooms: {
|
|
82
87
|
title: 'Rooms',
|
|
@@ -141,9 +146,40 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
141
146
|
title: 'App',
|
|
142
147
|
type: 'object',
|
|
143
148
|
additionalProperties: false,
|
|
144
|
-
properties: {
|
|
149
|
+
properties: {
|
|
150
|
+
app: { title: 'App', $ref: '#/$defs/app' },
|
|
151
|
+
name: { title: 'Name', type: 'string' },
|
|
152
|
+
},
|
|
145
153
|
required: ['app'],
|
|
146
154
|
},
|
|
155
|
+
origins: {
|
|
156
|
+
title: 'Origins',
|
|
157
|
+
type: 'array',
|
|
158
|
+
items: { type: 'string', minLength: 1, maxLength: 512 },
|
|
159
|
+
},
|
|
160
|
+
triggers: {
|
|
161
|
+
title: 'Triggers',
|
|
162
|
+
type: 'array',
|
|
163
|
+
items: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
additionalProperties: false,
|
|
166
|
+
properties: {
|
|
167
|
+
trigger: { title: 'Trigger', $ref: '#/$defs/id' },
|
|
168
|
+
description: { title: 'Description', type: 'string' },
|
|
169
|
+
room: {
|
|
170
|
+
title: 'Room',
|
|
171
|
+
type: 'object',
|
|
172
|
+
additionalProperties: false,
|
|
173
|
+
properties: {
|
|
174
|
+
room: { title: 'Room', $ref: '#/$defs/room' },
|
|
175
|
+
name: { title: 'Name', type: 'string' },
|
|
176
|
+
},
|
|
177
|
+
required: ['room', 'name'],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
required: ['trigger', 'description', 'room'],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
147
183
|
space: {
|
|
148
184
|
title: 'Space',
|
|
149
185
|
type: 'object',
|
|
@@ -152,6 +188,8 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
152
188
|
required: ['space'],
|
|
153
189
|
},
|
|
154
190
|
ownership_offer: { title: 'Ownership offer', $ref: '#/$defs/id' },
|
|
191
|
+
version: { title: 'Version', type: 'integer', minimum: 1 },
|
|
192
|
+
approved_version: { title: 'Approved version', type: 'integer', minimum: 1 },
|
|
155
193
|
offerer: {
|
|
156
194
|
title: 'Offerer',
|
|
157
195
|
type: 'object',
|
|
@@ -160,7 +198,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
160
198
|
name: { title: 'Name', type: 'string' },
|
|
161
199
|
email: { title: 'Email', type: 'string', format: 'email' },
|
|
162
200
|
},
|
|
163
|
-
required: ['name'
|
|
201
|
+
required: ['name'],
|
|
164
202
|
},
|
|
165
203
|
environment: {
|
|
166
204
|
title: 'Environment',
|
|
@@ -205,6 +243,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
205
243
|
],
|
|
206
244
|
},
|
|
207
245
|
},
|
|
246
|
+
number: { title: 'Number', type: 'string' },
|
|
208
247
|
budget: { title: 'Budget', type: 'string', pattern: '^\\d+(?:\\.\\d+)?$' },
|
|
209
248
|
resets_at: { title: 'Resets at', type: 'string', format: 'date-time' },
|
|
210
249
|
grant: { title: 'Grant', $ref: '#/$defs/id' },
|
|
@@ -243,14 +282,18 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
243
282
|
type: 'string',
|
|
244
283
|
enum: [
|
|
245
284
|
'failed',
|
|
285
|
+
'internal_error',
|
|
286
|
+
'agent_function_unreadable',
|
|
246
287
|
'function_failed',
|
|
247
288
|
'function_not_started',
|
|
248
289
|
'agent_function_request_not_started',
|
|
290
|
+
'post_not_confirmed',
|
|
249
291
|
],
|
|
250
292
|
},
|
|
251
293
|
action: { title: 'Action', type: 'integer', minimum: 0 },
|
|
252
294
|
moment: { title: 'Moment', type: 'string', format: 'date-time' },
|
|
253
295
|
error: { title: 'Error', type: 'string' },
|
|
296
|
+
document_path: { title: 'Document path', type: 'string' },
|
|
254
297
|
agent_function: {
|
|
255
298
|
title: 'Agent function',
|
|
256
299
|
type: 'object',
|
|
@@ -267,6 +310,12 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
267
310
|
},
|
|
268
311
|
ended: { title: 'Ended', type: 'string', enum: ['finished', 'failed'] },
|
|
269
312
|
duration: { title: 'Duration', type: 'integer', minimum: 1 },
|
|
313
|
+
meter: { title: 'Meter', type: 'string', enum: ['indexed_text', 'blob'] },
|
|
314
|
+
average_bytes: { title: 'Average in bytes', type: 'integer', minimum: 0 },
|
|
315
|
+
included_bytes: { title: 'Included in bytes', type: 'integer', minimum: 1 },
|
|
316
|
+
block_bytes: { title: 'Block in bytes', type: 'integer', minimum: 1 },
|
|
317
|
+
block_usd: { title: 'Block price in USD', type: 'number', exclusiveMinimum: 0 },
|
|
318
|
+
amount_usd: { title: 'Amount in USD', type: 'number', exclusiveMinimum: 0 },
|
|
270
319
|
},
|
|
271
320
|
required: ['notification', 'kind', 'created', 'way_in', 'subject'],
|
|
272
321
|
},
|
|
@@ -275,7 +324,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
275
324
|
properties: {},
|
|
276
325
|
},
|
|
277
326
|
'house-agent-function': {
|
|
278
|
-
description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing,
|
|
327
|
+
description: "One Agent function that serves this Room, which House alone writes from its owner's document in their Private Room and their Standing answer for it: the `agent_function` by identifier, its `description`, the `input` a caller sends, empty when it takes nothing, the `agent` it starts, by `agent` and the `name` that Agent had when this card was last written, and its `answer`, how a request from anyone but its owner starts: `at_once`, `ask_me`, which waits for its owner's approval, or `off`, which refuses it. The Agent function's instruction is never written here.",
|
|
279
328
|
properties: {
|
|
280
329
|
reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
|
|
281
330
|
agent_function: { title: 'Agent function', $ref: '#/$defs/id' },
|
|
@@ -291,8 +340,9 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
291
340
|
},
|
|
292
341
|
required: ['agent', 'name'],
|
|
293
342
|
},
|
|
343
|
+
answer: { title: 'Answer', type: 'string', enum: ['at_once', 'ask_me', 'off'] },
|
|
294
344
|
},
|
|
295
|
-
required: ['reflected', 'agent_function', 'description', 'input', 'agent'],
|
|
345
|
+
required: ['reflected', 'agent_function', 'description', 'input', 'agent', 'answer'],
|
|
296
346
|
},
|
|
297
347
|
'house-agent-function-document': {
|
|
298
348
|
description: 'One Agent function as its owner writes it in their Private Room at rooms/<room-handle>/agent-functions/<name>.md, a path that binds this type and a document that names no type: what it does as `description`, what a caller sends as `input`, empty when it takes nothing, the `agent` it starts, by identifier, and `afk`, true for a run nobody watches, off when absent. Its body is the instruction that Agent follows.',
|
|
@@ -305,7 +355,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
305
355
|
required: ['description', 'input', 'agent'],
|
|
306
356
|
},
|
|
307
357
|
'house-trigger': {
|
|
308
|
-
description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles
|
|
358
|
+
description: "One Trigger of this Room as its acts wrote it, which House alone writes: its `description`, the `condition` it fires on, its `actions` in order, whether each action and the Trigger are `enabled`, `paused_by` `types` while a change of the Room's types paused it, its `creator` by `user` and the `name` they had then, and when it was `created`. A `notify` action reaches the `users` its `to` names, the members its `fields` name in the matched document and the holders of its `roles`, or, `in_group`, posts once in this Room's Telegram group in their place, mentioning each; an `agent_function` action starts the Agent function whose card under this Room's `house/agent-functions/` its `card` names with the Event, `card` absent while this Room holds no card of that Agent function; a `message` action puts the Event into the active conversation that Agent function started for what the Event is about, or starts that Agent function with it when none is active; a `function` action runs the `function` its `app`'s latest release declares, on House's servers, while the `user` it was `attached_by` owns this Room, or, naming no `app`, the Environment function of that name the `user` its `owner` names keeps, on its Environment, from any Room that Environment reaches, as the function's Standing answer there says and at once in the owner's Private Room, its target holding while that Environment reaches this Room. Whether an action's target holds is not written: it follows from the Room's members, the Agent function's card, the App's latest release, who owns this Room, and each owner's functions and the Rooms their Environments reach.",
|
|
309
359
|
properties: {
|
|
310
360
|
reflected: { title: 'Reflected', type: 'string', format: 'date-time' },
|
|
311
361
|
trigger: { title: 'Trigger', $ref: '#/$defs/id' },
|
|
@@ -349,6 +399,7 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
349
399
|
},
|
|
350
400
|
required: ['users', 'fields', 'roles'],
|
|
351
401
|
},
|
|
402
|
+
in_group: { title: 'In group', const: true },
|
|
352
403
|
},
|
|
353
404
|
required: ['kind', 'enabled', 'title', 'text', 'to'],
|
|
354
405
|
},
|
|
@@ -359,9 +410,8 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
359
410
|
kind: { title: 'Kind', const: 'agent_function' },
|
|
360
411
|
enabled: { title: 'Enabled', type: 'boolean' },
|
|
361
412
|
card: { title: 'Card', type: 'string', minLength: 1 },
|
|
362
|
-
payload: { title: 'Payload', type: 'string' },
|
|
363
413
|
},
|
|
364
|
-
required: ['kind', 'enabled'
|
|
414
|
+
required: ['kind', 'enabled'],
|
|
365
415
|
},
|
|
366
416
|
{
|
|
367
417
|
type: 'object',
|
|
@@ -370,18 +420,26 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
370
420
|
kind: { title: 'Kind', const: 'message' },
|
|
371
421
|
enabled: { title: 'Enabled', type: 'boolean' },
|
|
372
422
|
card: { title: 'Card', type: 'string', minLength: 1 },
|
|
373
|
-
text: { title: 'Text', type: 'string' },
|
|
374
423
|
},
|
|
375
|
-
required: ['kind', 'enabled'
|
|
424
|
+
required: ['kind', 'enabled'],
|
|
376
425
|
},
|
|
377
426
|
{
|
|
378
427
|
type: 'object',
|
|
379
428
|
additionalProperties: false,
|
|
380
429
|
properties: {
|
|
381
|
-
kind: { title: 'Kind', const: '
|
|
430
|
+
kind: { title: 'Kind', const: 'function' },
|
|
382
431
|
enabled: { title: 'Enabled', type: 'boolean' },
|
|
432
|
+
app: { title: 'App', $ref: '#/$defs/app' },
|
|
433
|
+
function: { title: 'Function', type: 'string' },
|
|
434
|
+
attached_by: {
|
|
435
|
+
title: 'Attached by',
|
|
436
|
+
type: 'object',
|
|
437
|
+
additionalProperties: false,
|
|
438
|
+
properties: { user: { title: 'User', $ref: '#/$defs/id' } },
|
|
439
|
+
required: ['user'],
|
|
440
|
+
},
|
|
383
441
|
},
|
|
384
|
-
required: ['kind', 'enabled'],
|
|
442
|
+
required: ['kind', 'enabled', 'app', 'function'],
|
|
385
443
|
},
|
|
386
444
|
{
|
|
387
445
|
type: 'object',
|
|
@@ -389,10 +447,16 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
389
447
|
properties: {
|
|
390
448
|
kind: { title: 'Kind', const: 'function' },
|
|
391
449
|
enabled: { title: 'Enabled', type: 'boolean' },
|
|
392
|
-
app: { title: 'App', $ref: '#/$defs/app' },
|
|
393
450
|
function: { title: 'Function', type: 'string' },
|
|
451
|
+
owner: {
|
|
452
|
+
title: 'Owner',
|
|
453
|
+
type: 'object',
|
|
454
|
+
additionalProperties: false,
|
|
455
|
+
properties: { user: { title: 'User', $ref: '#/$defs/id' } },
|
|
456
|
+
required: ['user'],
|
|
457
|
+
},
|
|
394
458
|
},
|
|
395
|
-
required: ['kind', 'enabled', 'function'],
|
|
459
|
+
required: ['kind', 'enabled', 'function', 'owner'],
|
|
396
460
|
},
|
|
397
461
|
],
|
|
398
462
|
},
|
|
@@ -422,6 +486,26 @@ export const HOUSE_MODEL_DECLARATION = {
|
|
|
422
486
|
'created',
|
|
423
487
|
],
|
|
424
488
|
},
|
|
489
|
+
'house-record': {
|
|
490
|
+
description: "One Record: a Markdown document House received from outside, written by the `record` op of `update` or by a push address, and edited by nobody afterwards. `received` is what House attests: `at`, when House accepted it; `through`, the push address that delivered it, or `by`, the User whose act delivered it; `key`, its delivery key, where it has one; and `original`, the path of its original beside it, where it has one. `claimed` is what its sender says, kept as delivered, conventionally `from`, `date`, `subject` and a push delivery's request `headers`; House vouches for none of it. Its body is kept as delivered, and no Room or Space schema validates it.",
|
|
491
|
+
properties: {
|
|
492
|
+
received: {
|
|
493
|
+
title: 'Received',
|
|
494
|
+
type: 'object',
|
|
495
|
+
additionalProperties: false,
|
|
496
|
+
properties: {
|
|
497
|
+
at: { title: 'At', type: 'string', format: 'date-time' },
|
|
498
|
+
through: { title: 'Through', type: 'string' },
|
|
499
|
+
by: { title: 'By', type: 'string' },
|
|
500
|
+
key: { title: 'Key', type: 'string' },
|
|
501
|
+
original: { title: 'Original', type: 'string' },
|
|
502
|
+
},
|
|
503
|
+
required: ['at'],
|
|
504
|
+
},
|
|
505
|
+
claimed: { title: 'Claimed', type: 'object', additionalProperties: true },
|
|
506
|
+
},
|
|
507
|
+
required: ['received', 'claimed'],
|
|
508
|
+
},
|
|
425
509
|
'house-web-wizard': {
|
|
426
510
|
description: "One Web Wizard an agent made for this User: the `environment` it runs on, with the `name` that Environment had when the Web Wizard was made, and its `state`, `waiting` until its owner presses Run or Keep, `running`, `finished` with the script's `exit_code`, `failed`, `cancelled` when its page closed before the script ended, `lapsed` when nobody ran it in its time, or `kept` when its owner kept the script, without running it, as their Environment function named `function`. Its body is the script, whole, in one fenced code block. The terminal's output is never kept.",
|
|
427
511
|
properties: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crockford.d.ts","sourceRoot":"","sources":["../../src/house-references/crockford.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAErE,eAAO,MAAM,mBAAmB,uCAA4B,CAAC;AAE7D,eAAO,MAAM,2BAA2B,QAAqC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ROOM_REFERENCE_PREFIX = "r_";
|
|
2
|
+
export declare const APP_REFERENCE_PREFIX = "a_";
|
|
3
|
+
export declare const SPACE_REFERENCE_PREFIX = "sp_";
|
|
4
|
+
export declare const DOCUMENT_REFERENCE_PREFIX = "d_";
|
|
5
|
+
export declare const ATTACHMENT_REFERENCE_PREFIX = "at_";
|
|
6
|
+
export declare const REVISION_REFERENCE_PREFIX = "v_";
|
|
7
|
+
export declare const ROOM_REFERENCE_PATTERN: RegExp;
|
|
8
|
+
export declare const APP_REFERENCE_PATTERN: RegExp;
|
|
9
|
+
export declare const SPACE_REFERENCE_PATTERN: RegExp;
|
|
10
|
+
export declare const DOCUMENT_REFERENCE_PATTERN: RegExp;
|
|
11
|
+
export declare const ATTACHMENT_REFERENCE_PATTERN: RegExp;
|
|
12
|
+
export declare const REVISION_REFERENCE_PATTERN: RegExp;
|
|
13
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/house-references/patterns.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAM9C,eAAO,MAAM,sBAAsB,QAA0C,CAAC;AAE9E,eAAO,MAAM,qBAAqB,QAAyC,CAAC;AAE5E,eAAO,MAAM,uBAAuB,QAA2C,CAAC;AAQhF,eAAO,MAAM,0BAA0B,QAA0C,CAAC;AAElF,eAAO,MAAM,4BAA4B,QAA4C,CAAC;AAEtF,eAAO,MAAM,0BAA0B,QAEtC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER } from './crockford.js';
|
|
2
|
+
export const ROOM_REFERENCE_PREFIX = 'r_';
|
|
3
|
+
export const APP_REFERENCE_PREFIX = 'a_';
|
|
4
|
+
export const SPACE_REFERENCE_PREFIX = 'sp_';
|
|
5
|
+
export const DOCUMENT_REFERENCE_PREFIX = 'd_';
|
|
6
|
+
export const ATTACHMENT_REFERENCE_PREFIX = 'at_';
|
|
7
|
+
export const REVISION_REFERENCE_PREFIX = 'v_';
|
|
8
|
+
function referencePattern(prefix) {
|
|
9
|
+
return new RegExp(`^${prefix}(${CROCKFORD_CHARACTER}+)\\.(${CROCKFORD_CHARACTER})$`);
|
|
10
|
+
}
|
|
11
|
+
export const ROOM_REFERENCE_PATTERN = referencePattern(ROOM_REFERENCE_PREFIX);
|
|
12
|
+
export const APP_REFERENCE_PATTERN = referencePattern(APP_REFERENCE_PREFIX);
|
|
13
|
+
export const SPACE_REFERENCE_PATTERN = referencePattern(SPACE_REFERENCE_PREFIX);
|
|
14
|
+
const ORDINAL = `${CROCKFORD_LEADING_CHARACTER}${CROCKFORD_CHARACTER}*`;
|
|
15
|
+
function entryPattern(prefix) {
|
|
16
|
+
return new RegExp(`^${prefix}(${ORDINAL})\\.(${CROCKFORD_CHARACTER})$`);
|
|
17
|
+
}
|
|
18
|
+
export const DOCUMENT_REFERENCE_PATTERN = entryPattern(DOCUMENT_REFERENCE_PREFIX);
|
|
19
|
+
export const ATTACHMENT_REFERENCE_PATTERN = entryPattern(ATTACHMENT_REFERENCE_PREFIX);
|
|
20
|
+
export const REVISION_REFERENCE_PATTERN = new RegExp(`^${REVISION_REFERENCE_PREFIX}(${ORDINAL})\\.(${ORDINAL})\\.(${CROCKFORD_CHARACTER})$`);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
-
export type { Actor, DocumentEvent, DocumentFacts, Fact,
|
|
3
|
-
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
2
|
+
export type { Actor, DocumentEvent, DocumentFacts, Fact, MessageFacts, RecordFacts, Resolved, WriteDoor, } from './event.js';
|
|
3
|
+
export { byCodePoint, compared, dated, fieldKey, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
4
4
|
export type { Kind, Ordering } from './kinds.js';
|
|
5
|
+
export { folderType } from './folders.js';
|
|
5
6
|
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
6
7
|
export type { Clause, Continuation, Direction, DocumentQuery, DocumentShape, Filter, GroupKey, GroupOrder, GroupQuery, GroupSelect, GroupShape, HeldRooms, Key, KeyPlan, LocalQuery, OrderOptions, Place, Predicate, QueryErrorCode, QueryPlan, Related, RoomFacts, Scope, Select, Test, Value, Where, } from './query/language.js';
|
|
8
|
+
export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
|
|
9
|
+
export type { Count, HopTarget, KeyBound, KeyRange, PageOrder, Walk, WalkedFacts, WalkRun, } from './query/walk.js';
|
|
10
|
+
export { verifyIndexBounds } from './indexed.js';
|
|
11
|
+
export type { IndexBounds } from './indexed.js';
|
|
7
12
|
export { heldAt, matches } from './query/match.js';
|
|
8
13
|
export type { Candidate } from './query/match.js';
|
|
9
14
|
export { heldKind, indexed } from './query/rows.js';
|
|
@@ -11,32 +16,34 @@ export type { HeldKind, HeldLink, HeldValue, Indexed, Reach } from './query/rows
|
|
|
11
16
|
export * as sql from './query/sql.js';
|
|
12
17
|
export { headingLines } from './markdown.js';
|
|
13
18
|
export type { HeadingLine } from './markdown.js';
|
|
19
|
+
export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
|
|
20
|
+
export { agoWords, recentWords, shownDay, shownMoment } from './moment.js';
|
|
21
|
+
export type { MomentReader } from './moment.js';
|
|
14
22
|
export { labelAt, NAME_FIELD } from './body.js';
|
|
15
23
|
export type { Naming } from './body.js';
|
|
16
|
-
export {
|
|
17
|
-
export { apply, bodyLinks, create, links, parse, parseFrontmatter, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
24
|
+
export { apply, bodyLinks, create, links, linkSpans, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
18
25
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
26
|
+
export { notReadyWaitMs } from './not-ready.js';
|
|
19
27
|
export type { ReferenceTarget, SavedFacts } from './facts.js';
|
|
20
|
-
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './crockford.js';
|
|
21
|
-
export { HOUSE_FIELDS, MEMBER_FIELD,
|
|
28
|
+
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
|
|
29
|
+
export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
|
|
22
30
|
export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
|
|
23
|
-
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
|
|
24
|
-
export { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references.js';
|
|
31
|
+
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS, RECORD_TYPE, } from './house-model.js';
|
|
32
|
+
export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
|
|
25
33
|
export type { HouseDocumentFields, HouseModelType } from './house-model.js';
|
|
26
|
-
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
|
|
34
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
|
|
27
35
|
export type { InboxChannelKind } from './room-types.js';
|
|
28
|
-
export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
36
|
+
export { destinationText, keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
|
|
29
37
|
export { openPatternBudget } from './pattern.js';
|
|
30
38
|
export type { LinkedPath, RoomTarget } from './paths.js';
|
|
31
|
-
export { project } from './project.js';
|
|
32
39
|
export { references } from './references.js';
|
|
33
|
-
export {
|
|
40
|
+
export { foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
34
41
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
|
|
35
42
|
export type { Definition, FieldRules, JsonType, PatternFacts, PointerFacts, RuleValue, Shape, Transition, ValueFacts, } from './definition.js';
|
|
36
|
-
export type { ApplyResult, BodyResult, Change, DefinitionOf,
|
|
37
|
-
export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
|
|
43
|
+
export type { ApplyResult, BodyResult, Change, DefinitionOf, Document, DocumentCheck, Extent, Library, ModelVerification, Link, ParseResult, Reached, Reference, Refusal, RoleNeed, RoomReference, Span, TypedPath, LinkSpan, UnlinkedBody, Validation, ValidationContext, ValidationStep, VerifiedModel, } from './types.js';
|
|
44
|
+
export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
|
|
38
45
|
export type { Assessment, Verdicts } from './validate.js';
|
|
39
46
|
export { VERSION } from './version.js';
|
|
40
|
-
export { bodyAfterFrontmatter,
|
|
41
|
-
export type {
|
|
47
|
+
export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
|
|
48
|
+
export type { DocumentValue } from './yaml.js';
|
|
42
49
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EACV,MAAM,EACN,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,GACT,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,MAAM,EACN,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAA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AS,EACT,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,UAAU,EACV,QAAQ,EACR,MAAM,EACN,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
export { candidateOf, datePointers, facts, memberPointers, members, pointed, prosePaths, TEXT_FIELD, valuedChange, WRITE_DOORS, } from './event.js';
|
|
2
|
-
export { byCodePoint, compared, dated, fitsKind, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
2
|
+
export { byCodePoint, compared, dated, fieldKey, fitsKind, indexKey, instant, instantKey, kindOf, kindWords, } from './kinds.js';
|
|
3
|
+
export { folderType } from './folders.js';
|
|
3
4
|
export { bodied, cursorOf, decodedCursor, identityOf, invalid, known, placeText, planOf, QueryError, queryKey, } from './query/language.js';
|
|
5
|
+
export { countOf, countShape, hopTargets, pageOrder, walkedValue, walkOf } from './query/walk.js';
|
|
6
|
+
export { verifyIndexBounds } from './indexed.js';
|
|
4
7
|
export { heldAt, matches } from './query/match.js';
|
|
5
8
|
export { heldKind, indexed } from './query/rows.js';
|
|
6
9
|
export * as sql from './query/sql.js';
|
|
7
10
|
export { headingLines } from './markdown.js';
|
|
11
|
+
export { acceptsType, dataUrl, dataUrlPattern, declaresUtf8, FILE_MEDIA_TYPES, fileExtension, formDataType, gitMediaType, isAudioType, isImageType, isVideoType, MEDIA_TYPES, mediaTypeEssence, SCRIPT_MEDIA_TYPES, servedMediaType, UTF8_TEXT, withCharset, } from './media-type.js';
|
|
12
|
+
export { agoWords, recentWords, shownDay, shownMoment } from './moment.js';
|
|
8
13
|
export { labelAt, NAME_FIELD } from './body.js';
|
|
9
|
-
export {
|
|
10
|
-
export { apply, bodyLinks, create, links, parse, parseFrontmatter, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
14
|
+
export { apply, bodyLinks, create, links, linkSpans, parse, partText, relabel, relabels, relativize, relativizeBody, relinkBody, serialize, textSpans, unlinkBody, } from './document.js';
|
|
11
15
|
export { documentFacts, referenceTarget, referenceTargets } from './facts.js';
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
16
|
+
export { notReadyWaitMs } from './not-ready.js';
|
|
17
|
+
export { CROCKFORD_ALPHABET, CROCKFORD_CHARACTER, CROCKFORD_LEADING_CHARACTER, } from './house-references/crockford.js';
|
|
18
|
+
export { HOUSE_FIELDS, MEMBER_FIELD, SITE_FIELD, SUBMITTED_FIELD, TYPE_FIELD } from './fields.js';
|
|
14
19
|
export { HOUSE_MODEL, HOUSE_ROOM_TYPES } from './built-in.js';
|
|
15
|
-
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS } from './house-model.js';
|
|
16
|
-
export { APP_REFERENCE_PATTERN, ROOM_REFERENCE_PATTERN, SPACE_REFERENCE_PATTERN, } from './house-references.js';
|
|
17
|
-
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES } from './room-types.js';
|
|
18
|
-
export { linkedPath, relative, retarget, roomPath, roomTarget, target } from './paths.js';
|
|
20
|
+
export { APP_PREFERENCES_HOME, HOUSE_MODEL_DECLARATION, HOUSE_TYPED_PATHS, RECORD_TYPE, } from './house-model.js';
|
|
21
|
+
export { APP_REFERENCE_PATTERN, APP_REFERENCE_PREFIX, ATTACHMENT_REFERENCE_PATTERN, ATTACHMENT_REFERENCE_PREFIX, DOCUMENT_REFERENCE_PATTERN, DOCUMENT_REFERENCE_PREFIX, ROOM_REFERENCE_PATTERN, REVISION_REFERENCE_PATTERN, REVISION_REFERENCE_PREFIX, ROOM_REFERENCE_PREFIX, SPACE_REFERENCE_PATTERN, SPACE_REFERENCE_PREFIX, } from './house-references/patterns.js';
|
|
22
|
+
export { CHAT_MESSAGE_TYPE, CHAT_TYPE, INBOX_CHANNEL_KINDS, INBOX_TYPES, VIEW_TYPE, } from './room-types.js';
|
|
23
|
+
export { destinationText, keyedDestination, keyedLink, linkedPath, relative, retarget, roomPath, roomTarget, target, urlDestination, } from './paths.js';
|
|
19
24
|
export { openPatternBudget } from './pattern.js';
|
|
20
|
-
export { project } from './project.js';
|
|
21
25
|
export { references } from './references.js';
|
|
22
|
-
export {
|
|
26
|
+
export { foldedName, isDocumentPath, isReservedName, RESERVED_NAMES, ROOM_DESCRIPTION, } from './reserved.js';
|
|
23
27
|
export { ARRAY_INDEX, ATTACHMENT, crossedFacts, escapePointer, itemFacts, JSON_POINTER, memberFacts, pointerFacts, pointerSegments, untitled, } from './definition.js';
|
|
24
|
-
export { assess, assessReferences, bodyRoomLinks, checkDocument, definitionAt, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, } from './validate.js';
|
|
28
|
+
export { assess, assessReferences, bodyKeyedLinks, bodyRoomLinks, checkDocument, definitionAt, readSchemaDocument, readTypes, resolves, roomReferences, validate, validateParsed, validating, verdicts, verify, verifySchemaDocument, } from './validate.js';
|
|
25
29
|
export { VERSION } from './version.js';
|
|
26
|
-
export { bodyAfterFrontmatter,
|
|
30
|
+
export { bodyAfterFrontmatter, documentValue, equalValue, plain } from './yaml.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Failure } from './definition.js';
|
|
2
|
+
import type { ModelVerification, VerifiedModel } from './types.js';
|
|
3
|
+
export type IndexBounds = {
|
|
4
|
+
readonly perType: number;
|
|
5
|
+
readonly longestText: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function indexedFailure(model: VerifiedModel): Failure | undefined;
|
|
8
|
+
export declare function uniqueFailure(model: VerifiedModel): Failure | undefined;
|
|
9
|
+
export declare function verifyIndexBounds(model: VerifiedModel, bounds: IndexBounds): ModelVerification;
|
|
10
|
+
//# sourceMappingURL=indexed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexed.d.ts","sourceRoot":"","sources":["../src/indexed.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGnE,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AA+CrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,CAQxE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,SAAS,CAOvE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAW9F"}
|
package/dist/indexed.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { admitted, conjoined, escapePointer, refuse, UNIONS, } from './definition.js';
|
|
2
|
+
import { HOUSE_FIELDS } from './fields.js';
|
|
3
|
+
import { kindOf } from './kinds.js';
|
|
4
|
+
import { isRecord } from './yaml.js';
|
|
5
|
+
const PLAIN = ['string', 'number', 'boolean'];
|
|
6
|
+
const UNBOUNDED_KINDS = ['enum', 'date', 'date-time', 'time'];
|
|
7
|
+
function declarations(definition, field) {
|
|
8
|
+
const { schema, defs } = definition.shape;
|
|
9
|
+
return conjoined([{ node: schema, at: '' }], defs, new Set()).held.flatMap(({ node }) => isRecord(node.properties) && Object.hasOwn(node.properties, field)
|
|
10
|
+
? [node.properties[field]]
|
|
11
|
+
: []);
|
|
12
|
+
}
|
|
13
|
+
function indexable(definition, field) {
|
|
14
|
+
if (HOUSE_FIELDS.includes(field) || !Object.hasOwn(definition.fields, field))
|
|
15
|
+
return null;
|
|
16
|
+
const facts = definition.fields[field];
|
|
17
|
+
if (facts.markdown === true || facts.reference !== undefined)
|
|
18
|
+
return null;
|
|
19
|
+
const declared = declarations(definition, field);
|
|
20
|
+
const { defs } = definition.shape;
|
|
21
|
+
const held = conjoined(declared.map((node) => ({ node, at: '' })), defs, new Set()).held.map(({ node }) => node);
|
|
22
|
+
if (held.length === 0 ||
|
|
23
|
+
held.some((node) => UNIONS.some((keyword) => node[keyword] !== undefined)))
|
|
24
|
+
return null;
|
|
25
|
+
const types = admitted(declared, defs, new Set());
|
|
26
|
+
const plain = types === null ? [] : [...types].filter((type) => type !== 'null');
|
|
27
|
+
if (plain.length !== 1 || !PLAIN.includes(plain[0]))
|
|
28
|
+
return null;
|
|
29
|
+
if (plain[0] !== 'string' || UNBOUNDED_KINDS.includes(kindOf(facts) ?? ''))
|
|
30
|
+
return { text: null };
|
|
31
|
+
const lengths = held.flatMap((node) => typeof node.maxLength === 'number' ? [node.maxLength] : []);
|
|
32
|
+
return lengths.length === 0 ? null : { text: Math.min(...lengths) };
|
|
33
|
+
}
|
|
34
|
+
function at(name, index) {
|
|
35
|
+
return `/${escapePointer(name)}/indexed/${index}`;
|
|
36
|
+
}
|
|
37
|
+
export function indexedFailure(model) {
|
|
38
|
+
for (const [name, definition] of Object.entries(model.types)) {
|
|
39
|
+
const index = (definition.indexed ?? []).findIndex((field) => indexable(definition, field) === null);
|
|
40
|
+
if (index !== -1)
|
|
41
|
+
return refuse('indexed', at(name, index));
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
export function uniqueFailure(model) {
|
|
46
|
+
for (const [name, definition] of Object.entries(model.types)) {
|
|
47
|
+
const [field] = definition.unique ?? [];
|
|
48
|
+
if (field !== undefined)
|
|
49
|
+
return refuse('unique', `/${escapePointer(name)}/properties/${escapePointer(field)}/unique`);
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
export function verifyIndexBounds(model, bounds) {
|
|
54
|
+
for (const [name, definition] of Object.entries(model.types)) {
|
|
55
|
+
const indexed = definition.indexed ?? [];
|
|
56
|
+
if (indexed.length > bounds.perType)
|
|
57
|
+
return { verdict: 'refuse', rule: 'indexed', location: at(name, bounds.perType) };
|
|
58
|
+
const index = indexed.findIndex((field) => (indexable(definition, field)?.text ?? 0) > bounds.longestText);
|
|
59
|
+
if (index !== -1)
|
|
60
|
+
return { verdict: 'refuse', rule: 'indexed', location: at(name, index) };
|
|
61
|
+
}
|
|
62
|
+
return { verdict: 'accept', model };
|
|
63
|
+
}
|
package/dist/kinds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ValueFacts } from './definition.js';
|
|
1
|
+
import type { Definition, ValueFacts } from './definition.js';
|
|
2
2
|
export type Kind = 'string' | 'number' | 'integer' | 'boolean' | 'date' | 'date-time' | 'time' | 'enum' | 'reference';
|
|
3
3
|
export type Ordering = {
|
|
4
4
|
readonly direction: 'asc' | 'desc';
|
|
@@ -13,6 +13,14 @@ export declare function kindWords(facts: ValueFacts | undefined): readonly strin
|
|
|
13
13
|
export declare function dated(value: unknown): value is string;
|
|
14
14
|
export declare function instant(value: unknown): bigint | undefined;
|
|
15
15
|
export declare function instantKey(value: unknown): string | null;
|
|
16
|
+
export declare function instantOf(facts: ValueFacts | undefined, value: unknown): string | null;
|
|
17
|
+
export declare function indexKey(facts: ValueFacts, value: unknown): Uint8Array;
|
|
18
|
+
export declare function fieldKey(definition: Pick<Definition, 'fields' | 'unique'>, fields: Readonly<Record<string, unknown>>, field: string): {
|
|
19
|
+
readonly value: unknown;
|
|
20
|
+
readonly key: string;
|
|
21
|
+
readonly unique: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function sortedKey(value: unknown): Uint8Array | null;
|
|
16
24
|
export declare function byCodePoint(left: string, right: string): number;
|
|
17
25
|
export declare function compared(left: unknown, right: unknown, ordering: Ordering): number;
|
|
18
26
|
//# sourceMappingURL=kinds.d.ts.map
|
package/dist/kinds.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../src/kinds.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,MAAM,IAAI,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,WAAW,GACX,MAAM,GACN,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;CAC1D,CAAC;AAiBF,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAWrD;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAW/E;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,MAAM,EAAE,CAe1E;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IA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