openplanr 3.0.1 → 3.1.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 (223) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cli/commands/init-deterministic.d.ts.map +1 -1
  3. package/dist/cli/commands/init-deterministic.js +49 -6
  4. package/dist/cli/commands/init-deterministic.js.map +1 -1
  5. package/dist/dashboard/.vite/manifest.json +2 -2
  6. package/dist/dashboard/assets/{index-Bk8DyO_2.css → index-BU5fzjyz.css} +1 -1
  7. package/dist/dashboard/assets/index-G7ygVDGg.js +572 -0
  8. package/dist/dashboard/assets/index-G7ygVDGg.js.map +1 -0
  9. package/dist/dashboard/dashboard-manifest.json +14 -14
  10. package/dist/dashboard/index.html +2 -2
  11. package/dist/models/types.d.ts +0 -46
  12. package/dist/models/types.d.ts.map +1 -1
  13. package/dist/services/capability-map-service.d.ts +4 -0
  14. package/dist/services/capability-map-service.d.ts.map +1 -1
  15. package/dist/services/capability-map-service.js +7 -1
  16. package/dist/services/capability-map-service.js.map +1 -1
  17. package/dist/services/claude-plugin-service.d.ts +6 -1
  18. package/dist/services/claude-plugin-service.d.ts.map +1 -1
  19. package/dist/services/claude-plugin-service.js +54 -15
  20. package/dist/services/claude-plugin-service.js.map +1 -1
  21. package/dist/services/config-service.d.ts +24 -1
  22. package/dist/services/config-service.d.ts.map +1 -1
  23. package/dist/services/config-service.js +69 -2
  24. package/dist/services/config-service.js.map +1 -1
  25. package/dist/services/git-service.d.ts +5 -0
  26. package/dist/services/git-service.d.ts.map +1 -1
  27. package/dist/services/git-service.js +27 -0
  28. package/dist/services/git-service.js.map +1 -1
  29. package/dist/services/linear-pull-service.d.ts.map +1 -1
  30. package/dist/services/linear-pull-service.js +1 -2
  31. package/dist/services/linear-pull-service.js.map +1 -1
  32. package/dist/services/pipeline-package-service.d.ts +2 -0
  33. package/dist/services/pipeline-package-service.d.ts.map +1 -1
  34. package/dist/services/pipeline-package-service.js +2 -1
  35. package/dist/services/pipeline-package-service.js.map +1 -1
  36. package/dist/services/runtime-change-summary.d.ts.map +1 -1
  37. package/dist/services/runtime-change-summary.js +4 -0
  38. package/dist/services/runtime-change-summary.js.map +1 -1
  39. package/dist/services/runtime-manager-service.d.ts.map +1 -1
  40. package/dist/services/runtime-manager-service.js +14 -3
  41. package/dist/services/runtime-manager-service.js.map +1 -1
  42. package/dist/services/spec-service.d.ts.map +1 -1
  43. package/dist/services/spec-service.js +11 -22
  44. package/dist/services/spec-service.js.map +1 -1
  45. package/dist/services/upgrade-service.d.ts.map +1 -1
  46. package/dist/services/upgrade-service.js +3 -1
  47. package/dist/services/upgrade-service.js.map +1 -1
  48. package/dist/templates/rules/shared/capability-map.md.hbs +2 -2
  49. package/lib/host-packages/adapter-registry.json +5 -5
  50. package/lib/host-packages/capability-map.json +89 -29
  51. package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
  52. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
  53. package/lib/host-packages/claude/openplanr/.openplanr-content.json +69 -37
  54. package/lib/host-packages/claude/openplanr/CONNECTORS.md +62 -0
  55. package/lib/host-packages/claude/openplanr/README.md +1 -1
  56. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  57. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  58. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  59. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  60. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  61. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  62. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  63. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  64. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  65. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  66. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  67. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  68. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  69. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  70. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  71. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  72. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  73. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  74. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  75. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  76. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  77. package/lib/host-packages/claude/openplanr/skills/connect/SKILL.md +60 -0
  78. package/lib/host-packages/claude/openplanr/skills/connect/references/connectors.md +62 -0
  79. package/lib/host-packages/claude/openplanr/skills/openplanr/SKILL.md +4 -0
  80. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +4 -1
  81. package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
  82. package/lib/host-packages/claude/openplanr/skills/share/SKILL.md +87 -0
  83. package/lib/host-packages/claude/openplanr/skills/share/references/connectors.md +62 -0
  84. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +6 -3
  85. package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
  86. package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +15 -6
  87. package/lib/host-packages/claude/openplanr/skills/sprint/references/connectors.md +62 -0
  88. package/lib/host-packages/claude/openplanr/skills/sprint/references/tracker-connections.md +9 -13
  89. package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +14 -3
  90. package/lib/host-packages/claude/openplanr/skills/status/references/connectors.md +62 -0
  91. package/lib/host-packages/claude/openplanr/skills/status/references/tracker-connections.md +9 -13
  92. package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +25 -10
  93. package/lib/host-packages/claude/openplanr/skills/sync/references/connectors.md +62 -0
  94. package/lib/host-packages/claude/openplanr/skills/sync/references/tracker-connections.md +9 -13
  95. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +68 -36
  96. package/lib/host-packages/cursor/openplanr/CONNECTORS.md +62 -0
  97. package/lib/host-packages/cursor/openplanr/manifest.json +4 -2
  98. package/lib/host-packages/cursor/openplanr/rules/planr-connect/references/connectors.md +62 -0
  99. package/lib/host-packages/cursor/openplanr/rules/planr-connect.mdc +58 -0
  100. package/lib/host-packages/cursor/openplanr/rules/planr-openplanr.mdc +4 -0
  101. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +49 -3
  102. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +4 -1
  103. package/lib/host-packages/cursor/openplanr/rules/planr-share/references/connectors.md +62 -0
  104. package/lib/host-packages/cursor/openplanr/rules/planr-share.mdc +85 -0
  105. package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +2 -1
  106. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +6 -3
  107. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/connectors.md +62 -0
  108. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/tracker-connections.md +9 -13
  109. package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +15 -6
  110. package/lib/host-packages/cursor/openplanr/rules/planr-status/references/connectors.md +62 -0
  111. package/lib/host-packages/cursor/openplanr/rules/planr-status/references/tracker-connections.md +9 -13
  112. package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +14 -3
  113. package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/connectors.md +62 -0
  114. package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/tracker-connections.md +9 -13
  115. package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +25 -10
  116. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  117. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  118. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  119. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  120. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  121. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  122. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  123. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  124. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  125. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  126. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  127. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  128. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  129. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  130. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  131. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  132. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  133. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  134. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  135. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  136. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  137. package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
  138. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
  139. package/lib/host-packages/openai/openplanr/.openplanr-content.json +87 -39
  140. package/lib/host-packages/openai/openplanr/CONNECTORS.md +62 -0
  141. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  142. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  143. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  144. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  145. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  146. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  147. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  148. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  149. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  150. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  151. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  152. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  153. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  154. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  155. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  156. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  157. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  158. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  159. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  160. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  161. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  162. package/lib/host-packages/openai/openplanr/skills/connect/SKILL.md +59 -0
  163. package/lib/host-packages/openai/openplanr/skills/connect/agents/openai.yaml +6 -0
  164. package/lib/host-packages/openai/openplanr/skills/connect/openplanr.skill.json +37 -0
  165. package/lib/host-packages/openai/openplanr/skills/connect/references/connectors.md +62 -0
  166. package/lib/host-packages/openai/openplanr/skills/openplanr/SKILL.md +4 -0
  167. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +4 -1
  168. package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
  169. package/lib/host-packages/openai/openplanr/skills/share/SKILL.md +86 -0
  170. package/lib/host-packages/openai/openplanr/skills/share/agents/openai.yaml +6 -0
  171. package/lib/host-packages/openai/openplanr/skills/share/openplanr.skill.json +37 -0
  172. package/lib/host-packages/openai/openplanr/skills/share/references/connectors.md +62 -0
  173. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +6 -3
  174. package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
  175. package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +15 -6
  176. package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +11 -0
  177. package/lib/host-packages/openai/openplanr/skills/sprint/references/connectors.md +62 -0
  178. package/lib/host-packages/openai/openplanr/skills/sprint/references/tracker-connections.md +9 -13
  179. package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +14 -3
  180. package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +11 -0
  181. package/lib/host-packages/openai/openplanr/skills/status/references/connectors.md +62 -0
  182. package/lib/host-packages/openai/openplanr/skills/status/references/tracker-connections.md +9 -13
  183. package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +25 -10
  184. package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +11 -0
  185. package/lib/host-packages/openai/openplanr/skills/sync/references/connectors.md +62 -0
  186. package/lib/host-packages/openai/openplanr/skills/sync/references/tracker-connections.md +9 -13
  187. package/lib/json-schema.mjs +313 -36
  188. package/lib/schemas/v1.0.0/spec.schema.json +120 -0
  189. package/lib/schemas/v1.0.0/story.schema.json +95 -0
  190. package/lib/schemas/v1.0.0/task.schema.json +171 -0
  191. package/lib/schemas/v1.7.0/spec.schema.json +117 -0
  192. package/lib/schemas/v1.7.0/story.schema.json +107 -0
  193. package/lib/schemas/v1.7.0/task.schema.json +217 -0
  194. package/package.json +31 -31
  195. package/dist/dashboard/assets/index-n08LJ6bK.js +0 -557
  196. package/dist/dashboard/assets/index-n08LJ6bK.js.map +0 -1
  197. package/dist/services/audit-log-service.d.ts +0 -47
  198. package/dist/services/audit-log-service.d.ts.map +0 -1
  199. package/dist/services/audit-log-service.js +0 -211
  200. package/dist/services/audit-log-service.js.map +0 -1
  201. package/dist/services/delta-apply-service.d.ts +0 -16
  202. package/dist/services/delta-apply-service.d.ts.map +0 -1
  203. package/dist/services/delta-apply-service.js +0 -74
  204. package/dist/services/delta-apply-service.js.map +0 -1
  205. package/dist/services/evidence-verifier.d.ts +0 -71
  206. package/dist/services/evidence-verifier.d.ts.map +0 -1
  207. package/dist/services/evidence-verifier.js +0 -174
  208. package/dist/services/evidence-verifier.js.map +0 -1
  209. package/dist/services/revise-apply-service.d.ts +0 -55
  210. package/dist/services/revise-apply-service.d.ts.map +0 -1
  211. package/dist/services/revise-apply-service.js +0 -265
  212. package/dist/services/revise-apply-service.js.map +0 -1
  213. package/dist/services/revise-cache-service.d.ts +0 -46
  214. package/dist/services/revise-cache-service.d.ts.map +0 -1
  215. package/dist/services/revise-cache-service.js +0 -89
  216. package/dist/services/revise-cache-service.js.map +0 -1
  217. package/dist/services/revise-plan-service.d.ts +0 -38
  218. package/dist/services/revise-plan-service.d.ts.map +0 -1
  219. package/dist/services/revise-plan-service.js +0 -153
  220. package/dist/services/revise-plan-service.js.map +0 -1
  221. /package/lib/host-packages/claude/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
  222. /package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
  223. /package/lib/host-packages/openai/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openplanr/protocol",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "Canonical OpenPlanr schemas, registries, typed errors, and portable contract validation",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  "access": "public"
148
148
  },
149
149
  "devDependencies": {
150
- "esbuild": "0.28.1",
151
- "miniflare": "4.20260708.1",
152
- "playwright": "1.61.1",
150
+ "esbuild": "0.28.2",
151
+ "miniflare": "4.20260730.0",
152
+ "playwright": "1.64.0",
153
153
  "typescript": "6.0.2"
154
154
  }
155
155
  }
@@ -120,17 +120,179 @@ var matchesType = (v, t) => {
120
120
  };
121
121
  var FORMAT_DATE = /^\d{4}-\d{2}-\d{2}$/;
122
122
  var FORMAT_DATETIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
123
+ var SUPPORTED_FORMATS = /* @__PURE__ */ new Set(["date", "date-time"]);
124
+ var ANNOTATION_KEYWORDS = [
125
+ "$schema",
126
+ "$id",
127
+ "$defs",
128
+ "$comment",
129
+ "title",
130
+ "description",
131
+ "default",
132
+ "examples",
133
+ "deprecated",
134
+ "readOnly",
135
+ "writeOnly"
136
+ ];
137
+ var VALIDATION_KEYWORDS = [
138
+ "$ref",
139
+ "type",
140
+ "const",
141
+ "enum",
142
+ "minLength",
143
+ "maxLength",
144
+ "pattern",
145
+ "format",
146
+ "minimum",
147
+ "maximum",
148
+ "exclusiveMinimum",
149
+ "minItems",
150
+ "maxItems",
151
+ "prefixItems",
152
+ "items",
153
+ "uniqueItems",
154
+ "contains",
155
+ "minContains",
156
+ "maxContains",
157
+ "required",
158
+ "properties",
159
+ "additionalProperties",
160
+ "maxProperties",
161
+ "dependentRequired",
162
+ "unevaluatedProperties",
163
+ "oneOf",
164
+ "anyOf",
165
+ "allOf",
166
+ "if",
167
+ "then",
168
+ "else",
169
+ "not"
170
+ ];
171
+ var KNOWN_KEYWORDS = /* @__PURE__ */ new Set([...ANNOTATION_KEYWORDS, ...VALIDATION_KEYWORDS]);
172
+ var TYPE_NAMES = /* @__PURE__ */ new Set(["array", "boolean", "integer", "null", "number", "object", "string"]);
173
+ var isSchema = (value) => typeof value === "boolean" || value !== null && typeof value === "object" && !Array.isArray(value);
174
+ var isPlainObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
175
+ var isCount = (value) => Number.isSafeInteger(value) && value >= 0;
176
+ var isUniqueStrings = (value) => Array.isArray(value) && value.every((item2) => typeof item2 === "string") && new Set(value).size === value.length;
177
+ var isSchemaArray = (value) => Array.isArray(value) && value.length > 0 && value.every(isSchema);
178
+ var isSchemaMap = (value) => isPlainObject(value) && Object.values(value).every(isSchema);
179
+ var compiledPatterns = /* @__PURE__ */ new Map();
180
+ var MAX_COMPILED_PATTERNS = 1024;
181
+ var tryCompilePattern = (source) => {
182
+ try {
183
+ return new RegExp(source);
184
+ } catch (error) {
185
+ if (error instanceof SyntaxError) return null;
186
+ throw error;
187
+ }
188
+ };
189
+ var compilePattern = (source) => {
190
+ if (!compiledPatterns.has(source)) {
191
+ if (compiledPatterns.size >= MAX_COMPILED_PATTERNS) compiledPatterns.clear();
192
+ compiledPatterns.set(source, tryCompilePattern(source));
193
+ }
194
+ return compiledPatterns.get(source) ?? null;
195
+ };
196
+ var describeValue = (value) => {
197
+ const text3 = String(JSON.stringify(value));
198
+ return text3.length > 80 ? `${text3.slice(0, 77)}...` : text3;
199
+ };
200
+ var KEYWORD_SHAPES = {
201
+ $ref: ["a string", (value) => typeof value === "string"],
202
+ $defs: ["an object of schemas", isSchemaMap],
203
+ type: [
204
+ "a type name or a non-empty array of unique type names",
205
+ (value) => typeof value === "string" && TYPE_NAMES.has(value) || isUniqueStrings(value) && value.length > 0 && value.every((name) => TYPE_NAMES.has(name))
206
+ ],
207
+ enum: ["an array", Array.isArray],
208
+ minLength: ["a non-negative integer", isCount],
209
+ maxLength: ["a non-negative integer", isCount],
210
+ pattern: [
211
+ "a valid regular expression string",
212
+ (value) => typeof value === "string" && compilePattern(value) !== null
213
+ ],
214
+ minimum: ["a finite number", Number.isFinite],
215
+ maximum: ["a finite number", Number.isFinite],
216
+ exclusiveMinimum: ["a finite number", Number.isFinite],
217
+ minItems: ["a non-negative integer", isCount],
218
+ maxItems: ["a non-negative integer", isCount],
219
+ prefixItems: ["a non-empty array of schemas", isSchemaArray],
220
+ items: ["a schema", isSchema],
221
+ uniqueItems: ["a boolean", (value) => typeof value === "boolean"],
222
+ contains: ["a schema", isSchema],
223
+ minContains: ["a non-negative integer", isCount],
224
+ maxContains: ["a non-negative integer", isCount],
225
+ required: ["an array of unique strings", isUniqueStrings],
226
+ properties: ["an object of schemas", isSchemaMap],
227
+ additionalProperties: ["a schema", isSchema],
228
+ maxProperties: ["a non-negative integer", isCount],
229
+ dependentRequired: [
230
+ "an object of unique string arrays",
231
+ (value) => isPlainObject(value) && Object.values(value).every(isUniqueStrings)
232
+ ],
233
+ unevaluatedProperties: ["a schema", isSchema],
234
+ oneOf: ["a non-empty array of schemas", isSchemaArray],
235
+ anyOf: ["a non-empty array of schemas", isSchemaArray],
236
+ allOf: ["a non-empty array of schemas", isSchemaArray],
237
+ if: ["a schema", isSchema],
238
+ then: ["a schema", isSchema],
239
+ else: ["a schema", isSchema],
240
+ not: ["a schema", isSchema]
241
+ };
123
242
  function resolveJsonPointer(root, reference) {
124
243
  if (reference === "#") return root;
125
244
  if (!reference.startsWith("#/")) return null;
126
245
  return reference.slice(2).split("/").map((part) => part.replaceAll("~1", "/").replaceAll("~0", "~")).reduce((value, part) => value?.[part], root);
127
246
  }
247
+ var wellFormedSchemas = /* @__PURE__ */ new WeakSet();
248
+ var isFrozenNode = (schema6) => Object.isFrozen(schema6) && Object.values(schema6).every(Object.isFrozen) && (!isPlainObject(schema6.dependentRequired) || Object.values(schema6.dependentRequired).every(Object.isFrozen));
249
+ var checkSchemaNode = (schema6, path, context) => {
250
+ if (wellFormedSchemas.has(schema6) || context.checkedSchemas.has(schema6)) return;
251
+ context.checkedSchemas.add(schema6);
252
+ const errorCount = context.schemaErrors.length;
253
+ for (const keyword of Object.keys(schema6)) {
254
+ if (!KNOWN_KEYWORDS.has(keyword) && !keyword.startsWith("x-")) {
255
+ context.schemaErrors.push({
256
+ path,
257
+ rule: "unsupported-keyword",
258
+ detail: `schema keyword '${keyword}' is not supported by this validator`
259
+ });
260
+ }
261
+ }
262
+ if (Object.hasOwn(schema6, "format") && !SUPPORTED_FORMATS.has(schema6.format)) {
263
+ context.schemaErrors.push({
264
+ path,
265
+ rule: "unsupported-format",
266
+ detail: `schema format ${JSON.stringify(schema6.format)} is not supported by this validator`
267
+ });
268
+ }
269
+ for (const [keyword, [expected, isValid]] of Object.entries(KEYWORD_SHAPES)) {
270
+ if (Object.hasOwn(schema6, keyword) && !isValid(schema6[keyword])) {
271
+ context.schemaErrors.push({
272
+ path,
273
+ rule: "schema",
274
+ detail: `schema keyword '${keyword}' must be ${expected}, got ${describeValue(schema6[keyword])}`
275
+ });
276
+ }
277
+ }
278
+ if (context.schemaErrors.length === errorCount && isFrozenNode(schema6)) {
279
+ wellFormedSchemas.add(schema6);
280
+ }
281
+ };
282
+ var reportReference = (schema6, path, detail, context) => {
283
+ if (context.reportedReferences.has(schema6)) return;
284
+ context.reportedReferences.add(schema6);
285
+ context.schemaErrors.push({ path, rule: "$ref", detail });
286
+ };
128
287
  var validateNode = (value, schema6, path, errs, context) => {
129
- if (schema6 === true) return;
288
+ const evaluated = /* @__PURE__ */ new Set();
289
+ if (schema6 === true) return evaluated;
130
290
  if (schema6 === false) {
131
291
  errs.push({ path, rule: "schema:false", detail: "value not allowed" });
132
- return;
292
+ return evaluated;
133
293
  }
294
+ if (!isSchema(schema6)) return evaluated;
295
+ checkSchemaNode(schema6, path, context);
134
296
  if (typeof schema6?.$ref === "string") {
135
297
  const reference = schema6.$ref;
136
298
  let resolved;
@@ -144,21 +306,23 @@ var validateNode = (value, schema6, path, errs, context) => {
144
306
  nextRoot = result?.rootSchema ?? resolved;
145
307
  resolvedBase = result?.base ?? resolved?.$id ?? context.base;
146
308
  }
147
- if (!resolved) {
148
- errs.push({ path, rule: "$ref", detail: `could not resolve schema reference ${reference}` });
149
- return;
309
+ if (!isSchema(resolved)) {
310
+ const detail = resolved === void 0 || resolved === null ? `could not resolve schema reference ${reference}` : `schema reference ${reference} resolved to ${typeOf(resolved)}, not a schema`;
311
+ reportReference(schema6, path, detail, context);
312
+ return evaluated;
150
313
  }
151
- const referenceKey = `${context.base ?? "<root>"}:${reference}`;
314
+ const referenceKey = `${path} ${context.base ?? "<root>"}:${reference}`;
152
315
  if (context.referenceStack.includes(referenceKey)) {
153
- errs.push({ path, rule: "$ref", detail: `circular schema reference ${reference}` });
154
- return;
316
+ reportReference(schema6, path, `circular schema reference ${reference}`, context);
317
+ return evaluated;
155
318
  }
156
- validateNode(value, resolved, path, errs, {
319
+ const referenced = validateNode(value, resolved, path, errs, {
157
320
  ...context,
158
321
  rootSchema: nextRoot,
159
322
  base: resolvedBase,
160
323
  referenceStack: [...context.referenceStack, referenceKey]
161
324
  });
325
+ for (const key of referenced) evaluated.add(key);
162
326
  }
163
327
  if (schema6.type !== void 0) {
164
328
  const types = Array.isArray(schema6.type) ? schema6.type : [schema6.type];
@@ -168,7 +332,7 @@ var validateNode = (value, schema6, path, errs, context) => {
168
332
  rule: "type",
169
333
  detail: `expected ${types.join("|")}, got ${typeOf(value)}`
170
334
  });
171
- return;
335
+ return evaluated;
172
336
  }
173
337
  }
174
338
  if (schema6.const !== void 0) {
@@ -204,22 +368,13 @@ var validateNode = (value, schema6, path, errs, context) => {
204
368
  detail: `length ${value.length} > ${schema6.maxLength}`
205
369
  });
206
370
  }
207
- if (typeof schema6.pattern === "string") {
208
- try {
209
- if (!new RegExp(schema6.pattern).test(value)) {
210
- errs.push({
211
- path,
212
- rule: "pattern",
213
- detail: `value ${JSON.stringify(value)} does not match /${schema6.pattern}/`
214
- });
215
- }
216
- } catch (e) {
217
- errs.push({
218
- path,
219
- rule: "pattern",
220
- detail: `invalid regex /${schema6.pattern}/: ${e instanceof Error ? e.message : String(e)}`
221
- });
222
- }
371
+ const pattern = typeof schema6.pattern === "string" ? compilePattern(schema6.pattern) : null;
372
+ if (pattern && !pattern.test(value)) {
373
+ errs.push({
374
+ path,
375
+ rule: "pattern",
376
+ detail: `value ${JSON.stringify(value)} does not match /${schema6.pattern}/`
377
+ });
223
378
  }
224
379
  if (typeof schema6.format === "string") {
225
380
  if (schema6.format === "date" && !FORMAT_DATE.test(value)) {
@@ -244,6 +399,13 @@ var validateNode = (value, schema6, path, errs, context) => {
244
399
  if (typeof schema6.maximum === "number" && value > schema6.maximum) {
245
400
  errs.push({ path, rule: "maximum", detail: `value ${value} > ${schema6.maximum}` });
246
401
  }
402
+ if (typeof schema6.exclusiveMinimum === "number" && value <= schema6.exclusiveMinimum) {
403
+ errs.push({
404
+ path,
405
+ rule: "exclusiveMinimum",
406
+ detail: `value ${value} <= ${schema6.exclusiveMinimum}`
407
+ });
408
+ }
247
409
  }
248
410
  if (Array.isArray(value)) {
249
411
  if (typeof schema6.minItems === "number" && value.length < schema6.minItems) {
@@ -307,8 +469,31 @@ var validateNode = (value, schema6, path, errs, context) => {
307
469
  }
308
470
  }
309
471
  }
472
+ if (typeof schema6.maxProperties === "number" && Object.keys(value).length > schema6.maxProperties) {
473
+ errs.push({
474
+ path,
475
+ rule: "maxProperties",
476
+ detail: `property count ${Object.keys(value).length} > ${schema6.maxProperties}`
477
+ });
478
+ }
479
+ if (schema6.dependentRequired !== null && typeof schema6.dependentRequired === "object") {
480
+ for (const [trigger, dependencies] of Object.entries(schema6.dependentRequired)) {
481
+ if (!Object.hasOwn(value, trigger) || !Array.isArray(dependencies)) continue;
482
+ for (const dependency of dependencies) {
483
+ if (!Object.hasOwn(value, dependency)) {
484
+ errs.push({
485
+ path,
486
+ rule: "dependentRequired",
487
+ detail: `property '${trigger}' requires property '${dependency}'`
488
+ });
489
+ }
490
+ }
491
+ }
492
+ }
310
493
  const props = schema6.properties || {};
311
494
  for (const [k, v] of Object.entries(value)) {
495
+ if (Object.hasOwn(props, k)) evaluated.add(k);
496
+ else if (schema6.additionalProperties !== void 0) evaluated.add(k);
312
497
  if (!Object.hasOwn(props, k)) {
313
498
  if (schema6.additionalProperties === false) {
314
499
  errs.push({ path, rule: "additionalProperties", detail: `unknown property '${k}'` });
@@ -325,8 +510,11 @@ var validateNode = (value, schema6, path, errs, context) => {
325
510
  let matched = 0;
326
511
  for (const sub of schema6.oneOf) {
327
512
  const e = [];
328
- validateNode(value, sub, path, e, context);
329
- if (e.length === 0) matched++;
513
+ const branch = validateNode(value, sub, path, e, context);
514
+ if (e.length === 0) {
515
+ matched++;
516
+ for (const key of branch) evaluated.add(key);
517
+ }
330
518
  }
331
519
  if (matched !== 1) {
332
520
  const titles = schema6.oneOf.map((s) => s.title || "(unnamed)").join(" | ");
@@ -341,8 +529,11 @@ var validateNode = (value, schema6, path, errs, context) => {
341
529
  let matched = 0;
342
530
  for (const sub of schema6.anyOf) {
343
531
  const candidateErrors = [];
344
- validateNode(value, sub, path, candidateErrors, context);
345
- if (candidateErrors.length === 0) matched += 1;
532
+ const branch = validateNode(value, sub, path, candidateErrors, context);
533
+ if (candidateErrors.length === 0) {
534
+ matched += 1;
535
+ for (const key of branch) evaluated.add(key);
536
+ }
346
537
  }
347
538
  if (matched === 0) {
348
539
  const titles = schema6.anyOf.map((sub) => sub.title || "(unnamed)").join(" | ");
@@ -355,14 +546,21 @@ var validateNode = (value, schema6, path, errs, context) => {
355
546
  }
356
547
  if (Array.isArray(schema6.allOf)) {
357
548
  for (const sub of schema6.allOf) {
358
- validateNode(value, sub, path, errs, context);
549
+ for (const key of validateNode(value, sub, path, errs, context)) evaluated.add(key);
359
550
  }
360
551
  }
361
552
  if (schema6.if !== void 0) {
362
553
  const conditionErrors = [];
363
- validateNode(value, schema6.if, path, conditionErrors, context);
364
- const branch = conditionErrors.length === 0 ? schema6.then : schema6.else;
365
- if (branch !== void 0) validateNode(value, branch, path, errs, context);
554
+ const condition = validateNode(value, schema6.if, path, conditionErrors, context);
555
+ const passed = conditionErrors.length === 0;
556
+ if (passed) for (const key of condition) evaluated.add(key);
557
+ const branch = passed ? schema6.then : schema6.else;
558
+ if (branch !== void 0) {
559
+ const branchErrors = [];
560
+ const branchEvaluated = validateNode(value, branch, path, branchErrors, context);
561
+ errs.push(...branchErrors);
562
+ if (branchErrors.length === 0) for (const key of branchEvaluated) evaluated.add(key);
563
+ }
366
564
  }
367
565
  if (schema6.not !== void 0) {
368
566
  const e = [];
@@ -371,6 +569,18 @@ var validateNode = (value, schema6, path, errs, context) => {
371
569
  errs.push({ path, rule: "not", detail: "value matched a forbidden subschema" });
372
570
  }
373
571
  }
572
+ if (schema6.unevaluatedProperties !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value)) {
573
+ for (const [k, v] of Object.entries(value)) {
574
+ if (evaluated.has(k)) continue;
575
+ if (schema6.unevaluatedProperties === false) {
576
+ errs.push({ path, rule: "unevaluatedProperties", detail: `unevaluated property '${k}'` });
577
+ } else {
578
+ validateNode(v, schema6.unevaluatedProperties, `${path}.${k}`, errs, context);
579
+ }
580
+ evaluated.add(k);
581
+ }
582
+ }
583
+ return evaluated;
374
584
  };
375
585
  var validateJson = (value, schema6, {
376
586
  resolveRef,
@@ -380,13 +590,26 @@ var validateJson = (value, schema6, {
380
590
  )
381
591
  } = {}) => {
382
592
  const errs = [];
593
+ const schemaErrors = [];
594
+ if (!isSchema(schema6)) {
595
+ return [
596
+ {
597
+ path: "$",
598
+ rule: "schema",
599
+ detail: `expected a schema object or boolean, got ${typeOf(schema6)}`
600
+ }
601
+ ];
602
+ }
383
603
  validateNode(value, schema6, "$", errs, {
384
604
  rootSchema: schema6,
385
605
  resolveRef,
386
606
  base,
387
- referenceStack: []
607
+ referenceStack: [],
608
+ schemaErrors,
609
+ checkedSchemas: /* @__PURE__ */ new WeakSet(),
610
+ reportedReferences: /* @__PURE__ */ new WeakSet()
388
611
  });
389
- return errs;
612
+ return [...schemaErrors, ...errs];
390
613
  };
391
614
 
392
615
  // packages/protocol/src/enterprise-contracts.mjs
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openplanr/protocol",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "description": "Canonical OpenPlanr schemas, registries, typed errors, and portable contract validation",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  "access": "public"
148
148
  },
149
149
  "devDependencies": {
150
- "esbuild": "0.28.1",
151
- "miniflare": "4.20260708.1",
152
- "playwright": "1.61.1",
150
+ "esbuild": "0.28.2",
151
+ "miniflare": "4.20260730.0",
152
+ "playwright": "1.64.0",
153
153
  "typescript": "6.0.2"
154
154
  }
155
155
  }
@@ -4,14 +4,14 @@
4
4
  "name": "OpenPlanr"
5
5
  },
6
6
  "metadata": {
7
- "version": "3.0.1",
7
+ "version": "3.1.0",
8
8
  "description": "Generated local OpenPlanr package."
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "planr",
13
13
  "source": "./openplanr",
14
- "version": "3.0.1",
14
+ "version": "3.1.0",
15
15
  "description": "Close the loop from intent to delivery. Plan, design, build, review, and operate from durable context in your repository.",
16
16
  "strict": true
17
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "planr",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Close the loop from intent to delivery. Plan, design, build, review, and operate from durable context in your repository.",
5
5
  "author": {
6
6
  "name": "OpenPlanr",