structured-context 0.11.0 → 0.13.0

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 (138) hide show
  1. package/README.md +52 -198
  2. package/dist/api.d.ts +17 -15
  3. package/dist/api.js +12 -9
  4. package/dist/commands/diagram.d.ts +1 -0
  5. package/dist/commands/diagram.js +7 -1
  6. package/dist/commands/docs.js +1 -0
  7. package/dist/commands/dump.d.ts +15 -2
  8. package/dist/commands/dump.js +18 -4
  9. package/dist/commands/providers.d.ts +4 -0
  10. package/dist/commands/providers.js +52 -0
  11. package/dist/commands/render.d.ts +4 -0
  12. package/dist/commands/render.js +64 -9
  13. package/dist/commands/schemas.d.ts +2 -2
  14. package/dist/commands/schemas.js +133 -22
  15. package/dist/commands/show.d.ts +1 -0
  16. package/dist/commands/show.js +7 -1
  17. package/dist/commands/spaces.d.ts +3 -1
  18. package/dist/commands/spaces.js +11 -2
  19. package/dist/commands/validate-file.d.ts +3 -0
  20. package/dist/commands/validate-file.js +24 -6
  21. package/dist/commands/validate.d.ts +4 -0
  22. package/dist/commands/validate.js +79 -23
  23. package/dist/config.d.ts +25 -1
  24. package/dist/config.js +106 -12
  25. package/dist/filter/augment-nodes.d.ts +3 -1
  26. package/dist/filter/augment-nodes.js +12 -7
  27. package/dist/filter/filter-nodes.js +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +96 -31
  30. package/dist/judge/context.d.ts +20 -0
  31. package/dist/judge/context.js +105 -0
  32. package/dist/judge/factory.d.ts +44 -0
  33. package/dist/judge/factory.js +148 -0
  34. package/dist/judge/index.d.ts +13 -0
  35. package/dist/judge/index.js +8 -0
  36. package/dist/judge/judge-node.d.ts +27 -0
  37. package/dist/judge/judge-node.js +122 -0
  38. package/dist/judge/prompt.d.ts +10 -0
  39. package/dist/judge/prompt.js +92 -0
  40. package/dist/judge/provider/anthropic.d.ts +17 -0
  41. package/dist/judge/provider/anthropic.js +43 -0
  42. package/dist/judge/provider/fake.d.ts +26 -0
  43. package/dist/judge/provider/fake.js +56 -0
  44. package/dist/judge/provider/jev.d.ts +37 -0
  45. package/dist/judge/provider/jev.js +169 -0
  46. package/dist/judge/provider/openai-decisions.d.ts +21 -0
  47. package/dist/judge/provider/openai-decisions.js +84 -0
  48. package/dist/judge/provider/openai.d.ts +20 -0
  49. package/dist/judge/provider/openai.js +53 -0
  50. package/dist/judge/provider/per-rule.d.ts +10 -0
  51. package/dist/judge/provider/per-rule.js +18 -0
  52. package/dist/judge/trim.d.ts +27 -0
  53. package/dist/judge/trim.js +62 -0
  54. package/dist/judge/types.d.ts +92 -0
  55. package/dist/judge/types.js +9 -0
  56. package/dist/judge/verdicts.d.ts +24 -0
  57. package/dist/judge/verdicts.js +82 -0
  58. package/dist/load-space-graph.d.ts +7 -5
  59. package/dist/load-space-graph.js +19 -8
  60. package/dist/plugins/loader.js +3 -3
  61. package/dist/plugins/markdown/extract-content-links.js +8 -29
  62. package/dist/plugins/markdown/index.js +8 -2
  63. package/dist/plugins/markdown/parse-embedded.d.ts +8 -0
  64. package/dist/plugins/markdown/parse-embedded.js +195 -24
  65. package/dist/plugins/markdown/read-space.js +42 -14
  66. package/dist/plugins/markdown/render-directory.d.ts +11 -0
  67. package/dist/plugins/markdown/render-directory.js +130 -0
  68. package/dist/plugins/markdown/template-sync.js +3 -4
  69. package/dist/plugins/markdown/util.d.ts +26 -5
  70. package/dist/plugins/markdown/util.js +56 -15
  71. package/dist/plugins/mermaid/render-mermaid.js +2 -1
  72. package/dist/plugins/miro/sync.js +7 -6
  73. package/dist/plugins/util.d.ts +39 -1
  74. package/dist/plugins/util.js +139 -0
  75. package/dist/read/resolve-graph-edges.d.ts +1 -1
  76. package/dist/read/resolve-graph-edges.js +46 -27
  77. package/dist/read/wikilink-utils.d.ts +17 -0
  78. package/dist/read/wikilink-utils.js +40 -0
  79. package/dist/render/render.d.ts +3 -1
  80. package/dist/render/render.js +2 -2
  81. package/dist/schema/evaluate-rule.d.ts +33 -2
  82. package/dist/schema/evaluate-rule.js +58 -4
  83. package/dist/schema/gating.d.ts +69 -0
  84. package/dist/schema/gating.js +253 -0
  85. package/dist/schema/meta-schemas.d.ts +13 -0
  86. package/dist/schema/meta-schemas.js +50 -0
  87. package/dist/schema/metadata-contract.d.ts +952 -183
  88. package/dist/schema/metadata-contract.js +177 -33
  89. package/dist/schema/rule-filter.d.ts +12 -0
  90. package/dist/schema/rule-filter.js +46 -0
  91. package/dist/schema/rule-severity.d.ts +13 -0
  92. package/dist/schema/rule-severity.js +33 -0
  93. package/dist/schema/schema.d.ts +14 -8
  94. package/dist/schema/schema.js +308 -199
  95. package/dist/schema/validate-graph.d.ts +2 -1
  96. package/dist/schema/validate-graph.js +40 -23
  97. package/dist/schema/validate-rules.d.ts +16 -3
  98. package/dist/schema/validate-rules.js +91 -29
  99. package/dist/schemas/_knowledge_wiki.json +24 -24
  100. package/dist/schemas/_okf.json +172 -0
  101. package/dist/schemas/_ost_strict.json +17 -8
  102. package/dist/schemas/_sctx_base.json +3 -3
  103. package/dist/schemas/_strategy_general.json +38 -38
  104. package/dist/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  105. package/dist/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
  106. package/dist/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
  107. package/dist/schemas/knowledge_wiki.json +10 -9
  108. package/dist/schemas/okf.json +8 -0
  109. package/dist/schemas/strategy_general.json +15 -14
  110. package/dist/schemas/strict_ost.json +17 -16
  111. package/dist/space-context.d.ts +5 -2
  112. package/dist/space-context.js +9 -4
  113. package/dist/space-graph.d.ts +9 -7
  114. package/dist/space-graph.js +7 -5
  115. package/dist/testing.d.ts +33 -0
  116. package/dist/testing.js +72 -0
  117. package/dist/types.d.ts +64 -16
  118. package/dist/validate.d.ts +62 -9
  119. package/dist/validate.js +229 -114
  120. package/docs/concepts.md +65 -9
  121. package/docs/config.md +78 -1
  122. package/docs/rules.md +168 -50
  123. package/docs/schemas.md +152 -52
  124. package/package.json +17 -11
  125. package/schemas/_knowledge_wiki.json +24 -24
  126. package/schemas/_okf.json +172 -0
  127. package/schemas/_ost_strict.json +17 -8
  128. package/schemas/_sctx_base.json +3 -3
  129. package/schemas/_strategy_general.json +38 -38
  130. package/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
  131. package/schemas/generated/0.13.0/_structured_context_schema_meta.json +400 -0
  132. package/schemas/generated/latest/_structured_context_schema_meta.json +400 -0
  133. package/schemas/knowledge_wiki.json +10 -9
  134. package/schemas/okf.json +8 -0
  135. package/schemas/strategy_general.json +15 -14
  136. package/schemas/strict_ost.json +17 -16
  137. package/dist/schemas/generated/_structured_context_schema_meta.json +0 -191
  138. package/schemas/generated/_structured_context_schema_meta.json +0 -191
@@ -1,191 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json",
4
- "title": "structured-context schema dialect",
5
- "description": "Extends JSON Schema Draft-07 with top-level $metadata for hierarchy and rule metadata.",
6
- "type": "object",
7
- "allOf": [
8
- {
9
- "$ref": "http://json-schema.org/draft-07/schema#"
10
- }
11
- ],
12
- "properties": {
13
- "$metadata": {
14
- "type": "object",
15
- "properties": {
16
- "hierarchy": {
17
- "type": "object",
18
- "properties": {
19
- "levels": {
20
- "type": "array",
21
- "minItems": 1,
22
- "items": {
23
- "oneOf": [
24
- {
25
- "type": "string",
26
- "minLength": 1
27
- },
28
- {
29
- "type": "object",
30
- "properties": {
31
- "type": {
32
- "type": "string",
33
- "minLength": 1
34
- },
35
- "field": {
36
- "type": "string",
37
- "minLength": 1
38
- },
39
- "fieldOn": {
40
- "enum": ["child", "parent"]
41
- },
42
- "multiple": {
43
- "type": "boolean"
44
- },
45
- "templateFormat": {
46
- "enum": ["heading", "list", "table", "page"]
47
- },
48
- "matchers": {
49
- "type": "array",
50
- "items": {
51
- "type": "string",
52
- "minLength": 1
53
- },
54
- "minItems": 1
55
- },
56
- "embeddedTemplateFields": {
57
- "type": "array",
58
- "items": {
59
- "type": "string",
60
- "minLength": 1
61
- }
62
- },
63
- "selfRef": {
64
- "type": "boolean"
65
- },
66
- "selfRefField": {
67
- "type": "string",
68
- "minLength": 1
69
- }
70
- },
71
- "required": ["type"],
72
- "additionalProperties": false
73
- }
74
- ]
75
- }
76
- },
77
- "allowSkipLevels": {
78
- "type": "boolean"
79
- }
80
- },
81
- "required": ["levels"],
82
- "additionalProperties": false
83
- },
84
- "relationships": {
85
- "type": "array",
86
- "items": {
87
- "type": "object",
88
- "properties": {
89
- "parent": {
90
- "type": "string",
91
- "minLength": 1
92
- },
93
- "type": {
94
- "type": "string",
95
- "minLength": 1
96
- },
97
- "field": {
98
- "type": "string",
99
- "minLength": 1
100
- },
101
- "fieldOn": {
102
- "enum": ["child", "parent"]
103
- },
104
- "multiple": {
105
- "type": "boolean"
106
- },
107
- "templateFormat": {
108
- "enum": ["heading", "list", "table", "page"]
109
- },
110
- "matchers": {
111
- "type": "array",
112
- "items": {
113
- "type": "string",
114
- "minLength": 1
115
- },
116
- "minItems": 1
117
- },
118
- "embeddedTemplateFields": {
119
- "type": "array",
120
- "items": {
121
- "type": "string",
122
- "minLength": 1
123
- }
124
- }
125
- },
126
- "required": ["parent", "type"],
127
- "additionalProperties": false
128
- }
129
- },
130
- "aliases": {
131
- "type": "object",
132
- "additionalProperties": {
133
- "type": "string",
134
- "minLength": 1
135
- }
136
- },
137
- "rules": {
138
- "type": "array",
139
- "items": {
140
- "oneOf": [
141
- {
142
- "type": "object",
143
- "properties": {
144
- "id": {
145
- "type": "string",
146
- "minLength": 1
147
- },
148
- "category": {
149
- "enum": ["validation", "coherence", "workflow", "best-practice"]
150
- },
151
- "description": {
152
- "type": "string",
153
- "minLength": 1
154
- },
155
- "check": {
156
- "type": "string",
157
- "minLength": 1
158
- },
159
- "type": {
160
- "type": "string",
161
- "minLength": 1
162
- },
163
- "scope": {
164
- "enum": ["global"]
165
- },
166
- "override": {
167
- "type": "boolean"
168
- }
169
- },
170
- "required": ["id", "category", "description", "check"],
171
- "additionalProperties": false
172
- },
173
- {
174
- "type": "object",
175
- "properties": {
176
- "$ref": {
177
- "type": "string",
178
- "minLength": 1
179
- }
180
- },
181
- "required": ["$ref"],
182
- "additionalProperties": false
183
- }
184
- ]
185
- }
186
- }
187
- },
188
- "additionalProperties": false
189
- }
190
- }
191
- }
@@ -1,191 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json",
4
- "title": "structured-context schema dialect",
5
- "description": "Extends JSON Schema Draft-07 with top-level $metadata for hierarchy and rule metadata.",
6
- "type": "object",
7
- "allOf": [
8
- {
9
- "$ref": "http://json-schema.org/draft-07/schema#"
10
- }
11
- ],
12
- "properties": {
13
- "$metadata": {
14
- "type": "object",
15
- "properties": {
16
- "hierarchy": {
17
- "type": "object",
18
- "properties": {
19
- "levels": {
20
- "type": "array",
21
- "minItems": 1,
22
- "items": {
23
- "oneOf": [
24
- {
25
- "type": "string",
26
- "minLength": 1
27
- },
28
- {
29
- "type": "object",
30
- "properties": {
31
- "type": {
32
- "type": "string",
33
- "minLength": 1
34
- },
35
- "field": {
36
- "type": "string",
37
- "minLength": 1
38
- },
39
- "fieldOn": {
40
- "enum": ["child", "parent"]
41
- },
42
- "multiple": {
43
- "type": "boolean"
44
- },
45
- "templateFormat": {
46
- "enum": ["heading", "list", "table", "page"]
47
- },
48
- "matchers": {
49
- "type": "array",
50
- "items": {
51
- "type": "string",
52
- "minLength": 1
53
- },
54
- "minItems": 1
55
- },
56
- "embeddedTemplateFields": {
57
- "type": "array",
58
- "items": {
59
- "type": "string",
60
- "minLength": 1
61
- }
62
- },
63
- "selfRef": {
64
- "type": "boolean"
65
- },
66
- "selfRefField": {
67
- "type": "string",
68
- "minLength": 1
69
- }
70
- },
71
- "required": ["type"],
72
- "additionalProperties": false
73
- }
74
- ]
75
- }
76
- },
77
- "allowSkipLevels": {
78
- "type": "boolean"
79
- }
80
- },
81
- "required": ["levels"],
82
- "additionalProperties": false
83
- },
84
- "relationships": {
85
- "type": "array",
86
- "items": {
87
- "type": "object",
88
- "properties": {
89
- "parent": {
90
- "type": "string",
91
- "minLength": 1
92
- },
93
- "type": {
94
- "type": "string",
95
- "minLength": 1
96
- },
97
- "field": {
98
- "type": "string",
99
- "minLength": 1
100
- },
101
- "fieldOn": {
102
- "enum": ["child", "parent"]
103
- },
104
- "multiple": {
105
- "type": "boolean"
106
- },
107
- "templateFormat": {
108
- "enum": ["heading", "list", "table", "page"]
109
- },
110
- "matchers": {
111
- "type": "array",
112
- "items": {
113
- "type": "string",
114
- "minLength": 1
115
- },
116
- "minItems": 1
117
- },
118
- "embeddedTemplateFields": {
119
- "type": "array",
120
- "items": {
121
- "type": "string",
122
- "minLength": 1
123
- }
124
- }
125
- },
126
- "required": ["parent", "type"],
127
- "additionalProperties": false
128
- }
129
- },
130
- "aliases": {
131
- "type": "object",
132
- "additionalProperties": {
133
- "type": "string",
134
- "minLength": 1
135
- }
136
- },
137
- "rules": {
138
- "type": "array",
139
- "items": {
140
- "oneOf": [
141
- {
142
- "type": "object",
143
- "properties": {
144
- "id": {
145
- "type": "string",
146
- "minLength": 1
147
- },
148
- "category": {
149
- "enum": ["validation", "coherence", "workflow", "best-practice"]
150
- },
151
- "description": {
152
- "type": "string",
153
- "minLength": 1
154
- },
155
- "check": {
156
- "type": "string",
157
- "minLength": 1
158
- },
159
- "type": {
160
- "type": "string",
161
- "minLength": 1
162
- },
163
- "scope": {
164
- "enum": ["global"]
165
- },
166
- "override": {
167
- "type": "boolean"
168
- }
169
- },
170
- "required": ["id", "category", "description", "check"],
171
- "additionalProperties": false
172
- },
173
- {
174
- "type": "object",
175
- "properties": {
176
- "$ref": {
177
- "type": "string",
178
- "minLength": 1
179
- }
180
- },
181
- "required": ["$ref"],
182
- "additionalProperties": false
183
- }
184
- ]
185
- }
186
- }
187
- },
188
- "additionalProperties": false
189
- }
190
- }
191
- }