@agentshouse/mdmodel 0.1.0-ccf1367190878 → 0.1.0-cdbd463e01dc2

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.
Files changed (135) hide show
  1. package/API.md +197 -178
  2. package/README.md +21 -22
  3. package/dist/blocks.d.ts.map +1 -1
  4. package/dist/blocks.js +35 -20
  5. package/dist/definition.d.ts +3 -1
  6. package/dist/definition.d.ts.map +1 -1
  7. package/dist/definition.js +112 -24
  8. package/dist/divide.d.ts.map +1 -1
  9. package/dist/divide.js +27 -17
  10. package/dist/document.d.ts +5 -5
  11. package/dist/document.d.ts.map +1 -1
  12. package/dist/document.js +304 -187
  13. package/dist/event.d.ts +78 -0
  14. package/dist/event.d.ts.map +1 -0
  15. package/dist/event.js +230 -0
  16. package/dist/facts.d.ts +15 -0
  17. package/dist/facts.d.ts.map +1 -0
  18. package/dist/facts.js +39 -0
  19. package/dist/index.d.ts +22 -8
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +13 -6
  22. package/dist/kinds.d.ts +19 -0
  23. package/dist/kinds.d.ts.map +1 -0
  24. package/dist/kinds.js +161 -0
  25. package/dist/links.d.ts +2 -0
  26. package/dist/links.d.ts.map +1 -1
  27. package/dist/links.js +107 -50
  28. package/dist/paths.d.ts +9 -1
  29. package/dist/paths.d.ts.map +1 -1
  30. package/dist/paths.js +28 -2
  31. package/dist/pattern.d.ts +10 -0
  32. package/dist/pattern.d.ts.map +1 -0
  33. package/dist/pattern.js +355 -0
  34. package/dist/project.d.ts +1 -0
  35. package/dist/project.d.ts.map +1 -1
  36. package/dist/project.js +38 -15
  37. package/dist/query/language.d.ts +223 -0
  38. package/dist/query/language.d.ts.map +1 -0
  39. package/dist/query/language.js +565 -0
  40. package/dist/query/match.d.ts +14 -0
  41. package/dist/query/match.d.ts.map +1 -0
  42. package/dist/query/match.js +121 -0
  43. package/dist/query/rows.d.ts +32 -0
  44. package/dist/query/rows.d.ts.map +1 -0
  45. package/dist/query/rows.js +161 -0
  46. package/dist/query/sql.d.ts +39 -0
  47. package/dist/query/sql.d.ts.map +1 -0
  48. package/dist/query/sql.js +279 -0
  49. package/dist/references.d.ts.map +1 -1
  50. package/dist/references.js +6 -1
  51. package/dist/reserved.d.ts +5 -0
  52. package/dist/reserved.d.ts.map +1 -0
  53. package/dist/reserved.js +20 -0
  54. package/dist/schema.d.ts +1 -0
  55. package/dist/schema.d.ts.map +1 -1
  56. package/dist/schema.js +55 -4
  57. package/dist/types.d.ts +35 -4
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/validate.d.ts +29 -4
  60. package/dist/validate.d.ts.map +1 -1
  61. package/dist/validate.js +301 -85
  62. package/dist/yaml.d.ts.map +1 -1
  63. package/dist/yaml.js +36 -3
  64. package/fixtures/README.md +26 -6
  65. package/fixtures/cases/conditional-section/context.json +1 -0
  66. package/fixtures/cases/conditional-section/expected.json +6 -0
  67. package/fixtures/cases/conditional-section/library/questions/hosting.md +9 -0
  68. package/fixtures/cases/conditional-section/library/questions/payments.md +12 -0
  69. package/fixtures/cases/conditional-section/schema.yaml +14 -0
  70. package/fixtures/cases/cross-room-link/context.json +1 -0
  71. package/fixtures/cases/cross-room-link/expected.json +1 -0
  72. package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
  73. package/fixtures/cases/cross-room-link/schema.yaml +3 -0
  74. package/fixtures/cases/cross-room-reference/context.json +1 -0
  75. package/fixtures/cases/cross-room-reference/expected.json +1 -0
  76. package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
  77. package/fixtures/cases/cross-room-reference/schema.yaml +9 -0
  78. package/fixtures/cases/link-into-a-reserved-name/context.json +1 -0
  79. package/fixtures/cases/link-into-a-reserved-name/expected.json +5 -0
  80. package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +6 -0
  81. package/fixtures/cases/link-into-a-reserved-name/schema.yaml +3 -0
  82. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/context.json +1 -0
  83. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/expected.json +5 -0
  84. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/library/notes/b.md +5 -0
  85. package/fixtures/cases/member-on-an-untyped-document/context.json +1 -0
  86. package/fixtures/cases/member-on-an-untyped-document/expected.json +6 -0
  87. package/fixtures/cases/member-on-an-untyped-document/library/note.md +4 -0
  88. package/fixtures/cases/member-on-another-type/context.json +1 -0
  89. package/fixtures/cases/member-on-another-type/expected.json +6 -0
  90. package/fixtures/cases/member-on-another-type/library/note.md +4 -0
  91. package/fixtures/cases/member-on-another-type/schema.yaml +7 -0
  92. package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
  93. package/fixtures/cases/reference-into-a-reserved-name/expected.json +6 -0
  94. package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +4 -0
  95. package/fixtures/cases/reference-into-a-reserved-name/library/settings/brief.md +1 -0
  96. package/fixtures/cases/reference-into-a-reserved-name/schema.yaml +3 -0
  97. package/fixtures/cases/room-md-declares-a-type/context.json +1 -0
  98. package/fixtures/cases/room-md-declares-a-type/expected.json +6 -0
  99. package/fixtures/cases/room-md-declares-a-type/library/ROOM.md +5 -0
  100. package/fixtures/cases/typed-path-names-another-type/context.json +11 -0
  101. package/fixtures/cases/typed-path-names-another-type/expected.json +6 -0
  102. package/fixtures/cases/typed-path-names-another-type/library/settings/prefs/one.md +3 -0
  103. package/fixtures/cases/typed-path-names-another-type/schema.yaml +6 -0
  104. package/fixtures/cases/typed-path-names-its-type/context.json +11 -0
  105. package/fixtures/cases/typed-path-names-its-type/expected.json +3 -0
  106. package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/deeper/two.md +1 -0
  107. package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +4 -0
  108. package/fixtures/cases/typed-path-names-its-type/schema.yaml +6 -0
  109. package/fixtures/cases/typed-path-names-no-type/context.json +11 -0
  110. package/fixtures/cases/typed-path-names-no-type/expected.json +6 -0
  111. package/fixtures/cases/typed-path-names-no-type/library/settings/prefs/one.md +1 -0
  112. package/fixtures/cases/typed-path-names-no-type/schema.yaml +6 -0
  113. package/fixtures/cases/unnamed-typed-path-checks-its-fields/context.json +11 -0
  114. package/fixtures/cases/unnamed-typed-path-checks-its-fields/expected.json +6 -0
  115. package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +4 -0
  116. package/fixtures/cases/unnamed-typed-path-checks-its-fields/schema.yaml +5 -0
  117. package/fixtures/cases/unnamed-typed-path-names-a-type/context.json +11 -0
  118. package/fixtures/cases/unnamed-typed-path-names-a-type/expected.json +6 -0
  119. package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +6 -0
  120. package/fixtures/cases/unnamed-typed-path-names-a-type/schema.yaml +5 -0
  121. package/fixtures/cases/unnamed-typed-path-reads-its-type/context.json +11 -0
  122. package/fixtures/cases/unnamed-typed-path-reads-its-type/expected.json +3 -0
  123. package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/plan.md +1 -0
  124. package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +5 -0
  125. package/fixtures/cases/unnamed-typed-path-reads-its-type/schema.yaml +5 -0
  126. package/fixtures/cases/unnamed-typed-path-without-a-body/context.json +11 -0
  127. package/fixtures/cases/unnamed-typed-path-without-a-body/expected.json +5 -0
  128. package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +5 -0
  129. package/fixtures/cases/unnamed-typed-path-without-a-body/schema.yaml +5 -0
  130. package/fixtures/division.json +26 -26
  131. package/fixtures/queries.json +913 -0
  132. package/package.json +7 -2
  133. package/dist/condition.d.ts +0 -149
  134. package/dist/condition.d.ts.map +0 -1
  135. package/dist/condition.js +0 -500
@@ -0,0 +1,12 @@
1
+ ---
2
+ type: question
3
+ title: Who takes payments
4
+ status: answered
5
+ ---
6
+
7
+ ## Question
8
+
9
+ Which provider takes card payments?
10
+
11
+ ## Answer
12
+
@@ -0,0 +1,14 @@
1
+ question:
2
+ properties:
3
+ title: { type: string }
4
+ status: { enum: [open, answered, withdrawn] }
5
+ required: [title, status]
6
+ sections:
7
+ Question: { kind: text, required: true }
8
+ Answer: { kind: text }
9
+ if:
10
+ properties:
11
+ status: { enum: [answered, withdrawn] }
12
+ then:
13
+ sections:
14
+ Answer: { kind: text, required: true }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: client
3
+ name: Acme
4
+ ---
5
+
6
+ Paid by [the March invoice](/rooms/finance/invoices/march.md#total).
@@ -0,0 +1,3 @@
1
+ client:
2
+ properties:
3
+ name: { type: string }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: client
3
+ name: Acme
4
+ finance: /rooms/finance/invoices/acme.md
5
+ ---
6
+
7
+ ## Invoices
8
+
9
+ - [March](/rooms/finance/invoices/march.md)
@@ -0,0 +1,9 @@
1
+ client:
2
+ properties:
3
+ name: { type: string }
4
+ finance: { type: string, reference: invoice, cross_room: true }
5
+ sections:
6
+ Invoices: { kind: list, items: { type: string, reference: invoice, cross_room: true } }
7
+ invoice:
8
+ properties:
9
+ name: { type: string }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "notes/a.md",
4
+ "rule": "unresolved-link"
5
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: note
3
+ title: Plan
4
+ ---
5
+
6
+ See [the schema](../settings/schema.yaml).
@@ -0,0 +1,3 @@
1
+ note:
2
+ properties:
3
+ title: { type: string }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "notes/b.md",
4
+ "rule": "unresolved-link"
5
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: any
3
+ ---
4
+
5
+ See [the Room](../Rooms/other/plan.md).
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "note.md",
4
+ "location": "/member",
5
+ "rule": "undeclared-field"
6
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ member: ana@example.com
3
+ ---
4
+ # Ana
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "note.md",
4
+ "location": "/member",
5
+ "rule": "undeclared-field"
6
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: note
3
+ member: ana@example.com
4
+ ---
@@ -0,0 +1,7 @@
1
+ contact:
2
+ member_document: true
3
+ properties:
4
+ name: { type: string }
5
+ note:
6
+ properties:
7
+ member: { type: string }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "notes/a.md",
4
+ "rule": "unresolved-reference",
5
+ "location": "/brief"
6
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: task
3
+ brief: ../settings/brief.md
4
+ ---
@@ -0,0 +1,3 @@
1
+ task:
2
+ properties:
3
+ brief: { type: string, reference: any }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "ROOM.md",
4
+ "location": "/type",
5
+ "rule": "room-md-type"
6
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: any
3
+ ---
4
+
5
+ # Research
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "settings/prefs/*.md",
6
+ "type": "prefs",
7
+ "named": true,
8
+ "body": false
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "settings/prefs/one.md",
4
+ "rule": "unknown-type",
5
+ "location": "/type"
6
+ }
@@ -0,0 +1,6 @@
1
+ prefs:
2
+ properties:
3
+ theme: { type: string }
4
+ note:
5
+ properties:
6
+ title: { type: string }
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "settings/prefs/*.md",
6
+ "type": "prefs",
7
+ "named": true,
8
+ "body": false
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "verdict": "accept"
3
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: prefs
3
+ theme: dark
4
+ ---
@@ -0,0 +1,6 @@
1
+ prefs:
2
+ properties:
3
+ theme: { type: string }
4
+ note:
5
+ properties:
6
+ title: { type: string }
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "settings/prefs/*.md",
6
+ "type": "prefs",
7
+ "named": true,
8
+ "body": false
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "settings/prefs/one.md",
4
+ "rule": "unknown-type",
5
+ "location": "/type"
6
+ }
@@ -0,0 +1,6 @@
1
+ prefs:
2
+ properties:
3
+ theme: { type: string }
4
+ note:
5
+ properties:
6
+ title: { type: string }
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "rooms/*/tasks/*.md",
6
+ "type": "task",
7
+ "named": false,
8
+ "body": true
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "rooms/team/tasks/plan.md",
4
+ "rule": "required",
5
+ "location": "/owner"
6
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Plan
3
+ ---
4
+ Write the plan.
@@ -0,0 +1,5 @@
1
+ task:
2
+ properties:
3
+ title: { type: string, maxLength: 20 }
4
+ owner: { type: string, format: uuid }
5
+ required: [title, owner]
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "rooms/*/tasks/*.md",
6
+ "type": "task",
7
+ "named": false,
8
+ "body": true
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "rooms/team/tasks/plan.md",
4
+ "rule": "unknown-type",
5
+ "location": "/type"
6
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: task
3
+ title: Plan
4
+ owner: 019a0000-0000-7000-8000-000000000001
5
+ ---
6
+ Write the plan.
@@ -0,0 +1,5 @@
1
+ task:
2
+ properties:
3
+ title: { type: string, maxLength: 20 }
4
+ owner: { type: string, format: uuid }
5
+ required: [title, owner]
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "rooms/*/tasks/*.md",
6
+ "type": "task",
7
+ "named": false,
8
+ "body": true
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "verdict": "accept"
3
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Plan
3
+ owner: 019a0000-0000-7000-8000-000000000001
4
+ ---
5
+ Write the plan.
@@ -0,0 +1,5 @@
1
+ task:
2
+ properties:
3
+ title: { type: string, maxLength: 20 }
4
+ owner: { type: string, format: uuid }
5
+ required: [title, owner]
@@ -0,0 +1,11 @@
1
+ {
2
+ "binaryTargets": [],
3
+ "typedPaths": [
4
+ {
5
+ "path": "rooms/*/tasks/*.md",
6
+ "type": "task",
7
+ "named": false,
8
+ "body": true
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "rooms/team/tasks/plan.md",
4
+ "rule": "required-body"
5
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Plan
3
+ owner: 019a0000-0000-7000-8000-000000000001
4
+ ---
5
+
@@ -0,0 +1,5 @@
1
+ task:
2
+ properties:
3
+ title: { type: string, maxLength: 20 }
4
+ owner: { type: string, format: uuid }
5
+ required: [title, owner]