@openplanr/protocol 0.2.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 (334) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/lib/dashboard/closed-json-contract.mjs +141 -0
  4. package/lib/dashboard/generated/operate-experience-surface-schema-data.mjs +67 -0
  5. package/lib/dashboard/generated/operate-review-schema-data.mjs +35 -0
  6. package/lib/dashboard/generated/operate-schema-token-codec.mjs +127 -0
  7. package/lib/dashboard/operate-experience-audit-display-contract.d.mts +196 -0
  8. package/lib/dashboard/operate-experience-audit-display-contract.mjs +700 -0
  9. package/lib/dashboard/operate-experience-display-contract.d.mts +572 -0
  10. package/lib/dashboard/operate-experience-display-contract.mjs +1007 -0
  11. package/lib/dashboard/operate-experience-surface-contract.d.mts +157 -0
  12. package/lib/dashboard/operate-experience-surface-contract.mjs +91 -0
  13. package/lib/dashboard/operate-review-contract.d.mts +34 -0
  14. package/lib/dashboard/operate-review-contract.mjs +175 -0
  15. package/lib/dashboard/operate-review-display-workspace-contract.d.mts +54 -0
  16. package/lib/dashboard/operate-review-display-workspace-contract.mjs +258 -0
  17. package/lib/dashboard/operate-review-payload-safety.d.mts +7 -0
  18. package/lib/dashboard/operate-review-payload-safety.mjs +42 -0
  19. package/lib/dashboard/operate-review-workspace-projection-v2.d.mts +218 -0
  20. package/lib/protocol/index.d.ts +2638 -0
  21. package/package.json +115 -0
  22. package/registries/commands.json +1952 -0
  23. package/registries/diagram-grammars.json +2407 -0
  24. package/registries/diagram-semantic-patterns.json +111 -0
  25. package/registries/output-paths.json +40 -0
  26. package/registries/outputs.json +864 -0
  27. package/registries/roles.json +661 -0
  28. package/registries/rules.json +261 -0
  29. package/registries/skill-host-profiles.json +247 -0
  30. package/registries/skill-modules.json +1112 -0
  31. package/registries/skill-routing.json +389 -0
  32. package/registries/skills.json +1545 -0
  33. package/registries/task-kinds.json +220 -0
  34. package/registry/adapters.json +110 -0
  35. package/registry/artifact-theme.json +60 -0
  36. package/registry/evaluation-graders.json +303 -0
  37. package/registry/evaluation-host-profiles.json +131 -0
  38. package/registry/frozen-commands.json +15 -0
  39. package/registry/landing-operations.json +20 -0
  40. package/registry/landing-workflows.json +70 -0
  41. package/registry/live-evidence-providers.json +1 -0
  42. package/registry/operate-v2-contracts.json +5965 -0
  43. package/registry/professional-skills.json +115 -0
  44. package/registry/roles.json +14 -0
  45. package/registry/ship-review-specialists.json +42 -0
  46. package/schemas/v1.0.0/design-approved.schema.json +35 -0
  47. package/schemas/v1.0.0/design-feedback.schema.json +169 -0
  48. package/schemas/v1.0.0/design-manifest.schema.json +90 -0
  49. package/schemas/v1.0.0/design-session.schema.json +73 -0
  50. package/schemas/v1.0.0/graph.schema.json +100 -0
  51. package/schemas/v1.0.0/pipeline-shipped.schema.json +154 -0
  52. package/schemas/v1.0.0/run-manifest.schema.json +81 -0
  53. package/schemas/v1.0.0/spec.schema.json +120 -0
  54. package/schemas/v1.0.0/stack.schema.json +184 -0
  55. package/schemas/v1.0.0/story.schema.json +95 -0
  56. package/schemas/v1.0.0/task.schema.json +171 -0
  57. package/schemas/v1.0.0/taste-profile.schema.json +96 -0
  58. package/schemas/v1.1.0/adapter-registry.schema.json +72 -0
  59. package/schemas/v1.1.0/artifact-envelope.schema.json +142 -0
  60. package/schemas/v1.1.0/artifact-paste.schema.json +49 -0
  61. package/schemas/v1.1.0/artifact-review.schema.json +97 -0
  62. package/schemas/v1.1.0/artifact-room-descriptor.schema.json +39 -0
  63. package/schemas/v1.1.0/artifact-room-event.schema.json +184 -0
  64. package/schemas/v1.1.0/artifact-room-signed-event.schema.json +58 -0
  65. package/schemas/v1.1.0/artifact-theme.schema.json +139 -0
  66. package/schemas/v1.1.0/browser-qa-gate.schema.json +21 -0
  67. package/schemas/v1.1.0/browser-qa-result.schema.json +24 -0
  68. package/schemas/v1.1.0/browser-qa-session.schema.json +12 -0
  69. package/schemas/v1.1.0/ecosystem-manifest.schema.json +46 -0
  70. package/schemas/v1.1.0/investigation-diagnosis.schema.json +12 -0
  71. package/schemas/v1.1.0/investigation-event.schema.json +15 -0
  72. package/schemas/v1.1.0/investigation-experiment.schema.json +17 -0
  73. package/schemas/v1.1.0/investigation-fix.schema.json +11 -0
  74. package/schemas/v1.1.0/investigation-hypothesis.schema.json +6 -0
  75. package/schemas/v1.1.0/investigation-observation.schema.json +10 -0
  76. package/schemas/v1.1.0/investigation-receipt.schema.json +7 -0
  77. package/schemas/v1.1.0/investigation-record.schema.json +7 -0
  78. package/schemas/v1.1.0/investigation-request.schema.json +34 -0
  79. package/schemas/v1.1.0/planning-review-event.schema.json +64 -0
  80. package/schemas/v1.1.0/planning-review-receipt.schema.json +19 -0
  81. package/schemas/v1.1.0/planning-review-record.schema.json +176 -0
  82. package/schemas/v1.1.0/planning-review-state.schema.json +19 -0
  83. package/schemas/v1.1.0/professional-skills.schema.json +105 -0
  84. package/schemas/v1.1.0/professional-specification.schema.json +111 -0
  85. package/schemas/v1.1.0/provenance-event.schema.json +82 -0
  86. package/schemas/v1.1.0/role-registry.schema.json +28 -0
  87. package/schemas/v1.1.0/runtime-lock.schema.json +39 -0
  88. package/schemas/v1.1.0/ship-closure.schema.json +353 -0
  89. package/schemas/v1.1.0/ship-review-specialist-registry.schema.json +29 -0
  90. package/schemas/v1.1.0/ship-risk-classification.schema.json +48 -0
  91. package/schemas/v1.1.0/specialist-review-result.schema.json +19 -0
  92. package/schemas/v1.10.0/design-review-bundle.schema.json +584 -0
  93. package/schemas/v1.10.0/design-review-context.schema.json +191 -0
  94. package/schemas/v1.10.0/design-review-handoff.schema.json +407 -0
  95. package/schemas/v1.10.0/design-review-metadata-payload.schema.json +106 -0
  96. package/schemas/v1.11.0/design-review-metadata-payload.schema.json +107 -0
  97. package/schemas/v1.12.0/enterprise-access-context.schema.json +217 -0
  98. package/schemas/v1.12.0/enterprise-agent-handoff.schema.json +508 -0
  99. package/schemas/v1.12.0/enterprise-artifact-revision.schema.json +87 -0
  100. package/schemas/v1.12.0/enterprise-change-proposal.schema.json +359 -0
  101. package/schemas/v1.12.0/enterprise-evidence-reference.schema.json +147 -0
  102. package/schemas/v1.12.0/enterprise-review-thread.schema.json +278 -0
  103. package/schemas/v1.12.0/enterprise-sync-state.schema.json +169 -0
  104. package/schemas/v1.2.0/adapter-registry.schema.json +83 -0
  105. package/schemas/v1.2.0/dashboard-bootstrap.schema.json +219 -0
  106. package/schemas/v1.2.0/ecosystem-release-operation.schema.json +90 -0
  107. package/schemas/v1.2.0/ecosystem-saga.schema.json +54 -0
  108. package/schemas/v1.2.0/evidence-diagnostic.schema.json +77 -0
  109. package/schemas/v1.2.0/guided-answer-envelope.schema.json +73 -0
  110. package/schemas/v1.2.0/guided-confirmation.schema.json +128 -0
  111. package/schemas/v1.2.0/guided-question.schema.json +242 -0
  112. package/schemas/v1.2.0/guided-questionnaire.schema.json +278 -0
  113. package/schemas/v1.2.0/guided-session.schema.json +141 -0
  114. package/schemas/v1.2.0/landing-confirmation.schema.json +17 -0
  115. package/schemas/v1.2.0/landing-event.schema.json +12 -0
  116. package/schemas/v1.2.0/landing-operation-registry.schema.json +16 -0
  117. package/schemas/v1.2.0/landing-phase-receipt.schema.json +19 -0
  118. package/schemas/v1.2.0/landing-plan.schema.json +36 -0
  119. package/schemas/v1.2.0/landing-receipt.schema.json +12 -0
  120. package/schemas/v1.2.0/landing-workflow-catalog.schema.json +143 -0
  121. package/schemas/v1.2.0/operate-action-display-workspace.schema.json +119 -0
  122. package/schemas/v1.2.0/operate-cycle-display-workspace.schema.json +109 -0
  123. package/schemas/v1.2.0/operate-executive-board-display-surface.schema.json +72 -0
  124. package/schemas/v1.2.0/operate-experience-audit-display-surface.schema.json +328 -0
  125. package/schemas/v1.2.0/operate-experience-display-surface.schema.json +46 -0
  126. package/schemas/v1.2.0/operate-experience-surface.schema.json +590 -0
  127. package/schemas/v1.2.0/operate-recovery-display-surface.schema.json +85 -0
  128. package/schemas/v1.2.0/structured-action.schema.json +91 -0
  129. package/schemas/v1.3.0/adapter-registry.schema.json +84 -0
  130. package/schemas/v1.3.0/ecosystem-manifest.schema.json +120 -0
  131. package/schemas/v1.3.0/release-compatibility-claim.schema.json +46 -0
  132. package/schemas/v1.3.0/release-ledger-receipt.schema.json +45 -0
  133. package/schemas/v1.3.0/release-ledger.schema.json +60 -0
  134. package/schemas/v1.4.0/adapter-registry.schema.json +62 -0
  135. package/schemas/v1.4.0/evaluation-aggregate-report.schema.json +166 -0
  136. package/schemas/v1.4.0/evaluation-budget.schema.json +49 -0
  137. package/schemas/v1.4.0/evaluation-corpus.schema.json +93 -0
  138. package/schemas/v1.4.0/evaluation-fixture.schema.json +64 -0
  139. package/schemas/v1.4.0/evaluation-gate-policy.schema.json +33 -0
  140. package/schemas/v1.4.0/evaluation-grader-registration.schema.json +141 -0
  141. package/schemas/v1.4.0/evaluation-grader-registry.schema.json +20 -0
  142. package/schemas/v1.4.0/evaluation-host-profile-registry.schema.json +20 -0
  143. package/schemas/v1.4.0/evaluation-host-profile.schema.json +73 -0
  144. package/schemas/v1.4.0/evaluation-observation.schema.json +76 -0
  145. package/schemas/v1.4.0/evaluation-run-result.schema.json +84 -0
  146. package/schemas/v1.4.0/evaluation-scenario.schema.json +231 -0
  147. package/schemas/v1.4.0/evaluation-waiver.schema.json +65 -0
  148. package/schemas/v1.4.0/skill-certification-receipt.schema.json +103 -0
  149. package/schemas/v1.5.0/command-catalog.schema.json +296 -0
  150. package/schemas/v1.5.0/common.schema.json +261 -0
  151. package/schemas/v1.5.0/generated-asset-manifest.schema.json +313 -0
  152. package/schemas/v1.5.0/implementation-result.schema.json +152 -0
  153. package/schemas/v1.5.0/migration-preservation-manifest.schema.json +749 -0
  154. package/schemas/v1.5.0/output-catalog.schema.json +210 -0
  155. package/schemas/v1.5.0/output-path-catalog.schema.json +81 -0
  156. package/schemas/v1.5.0/role-registry.schema.json +261 -0
  157. package/schemas/v1.5.0/rule-catalog.schema.json +130 -0
  158. package/schemas/v1.5.0/skill-catalog.schema.json +303 -0
  159. package/schemas/v1.5.0/task-kind-registry.schema.json +167 -0
  160. package/schemas/v1.5.0/task-manifest.schema.json +373 -0
  161. package/schemas/v1.5.0/task-output-manifest.schema.json +462 -0
  162. package/schemas/v1.6.0/common.schema.json +462 -0
  163. package/schemas/v1.6.0/diagram-consumer-reference.schema.json +167 -0
  164. package/schemas/v1.6.0/diagram-document.schema.json +699 -0
  165. package/schemas/v1.6.0/diagram-fidelity-report.schema.json +137 -0
  166. package/schemas/v1.6.0/diagram-manifest.schema.json +162 -0
  167. package/schemas/v1.6.0/diagram-quality-report.schema.json +148 -0
  168. package/schemas/v1.6.0/diagram-review-binding.schema.json +132 -0
  169. package/schemas/v1.6.0/diagram-semantic-pattern-registry.schema.json +90 -0
  170. package/schemas/v1.6.0/diagram-type-registry.schema.json +373 -0
  171. package/schemas/v1.6.0/generated-asset-manifest.schema.json +103 -0
  172. package/schemas/v1.6.0/skill-catalog.schema.json +84 -0
  173. package/schemas/v1.6.0/skill-completion-receipt.schema.json +72 -0
  174. package/schemas/v1.6.0/skill-consent-record.schema.json +74 -0
  175. package/schemas/v1.6.0/skill-host-profile-registry.schema.json +526 -0
  176. package/schemas/v1.6.0/skill-learning-record.schema.json +116 -0
  177. package/schemas/v1.6.0/skill-module-registry.schema.json +108 -0
  178. package/schemas/v1.6.0/skill-routing-registry.schema.json +93 -0
  179. package/schemas/v1.6.0/skill-session.schema.json +73 -0
  180. package/schemas/v1.6.0/skill-source.schema.json +169 -0
  181. package/schemas/v1.7.0/common.schema.json +464 -0
  182. package/schemas/v1.7.0/generated-asset-manifest.schema.json +103 -0
  183. package/schemas/v1.7.0/planning-id-sequence.schema.json +50 -0
  184. package/schemas/v1.7.0/request-authority.schema.json +71 -0
  185. package/schemas/v1.7.0/skill-catalog.schema.json +84 -0
  186. package/schemas/v1.7.0/skill-completion-receipt.schema.json +72 -0
  187. package/schemas/v1.7.0/skill-consent-record.schema.json +74 -0
  188. package/schemas/v1.7.0/skill-host-profile-registry.schema.json +526 -0
  189. package/schemas/v1.7.0/skill-learning-record.schema.json +116 -0
  190. package/schemas/v1.7.0/skill-module-registry.schema.json +108 -0
  191. package/schemas/v1.7.0/skill-routing-registry.schema.json +93 -0
  192. package/schemas/v1.7.0/skill-session.schema.json +73 -0
  193. package/schemas/v1.7.0/skill-source.schema.json +169 -0
  194. package/schemas/v1.7.0/spec.schema.json +117 -0
  195. package/schemas/v1.7.0/story.schema.json +107 -0
  196. package/schemas/v1.7.0/task.schema.json +217 -0
  197. package/schemas/v1.8.0/common.schema.json +96 -0
  198. package/schemas/v1.8.0/skill-package.schema.json +63 -0
  199. package/schemas/v1.8.0/utility-command-catalog.schema.json +82 -0
  200. package/schemas/v1.9.0/design-document.schema.json +306 -0
  201. package/schemas/v1.9.0/design-review-bundle.schema.json +346 -0
  202. package/schemas/v1.9.0/design-review-workspace.schema.json +108 -0
  203. package/schemas/v1.9.0/design-workspace-create.schema.json +170 -0
  204. package/schemas/v1.9.0/design-workspace-event.schema.json +97 -0
  205. package/schemas/v1.9.0/design-workspace-revision.schema.json +56 -0
  206. package/schemas/v2.0.0/agent-runtime-manifest.schema.json +59 -0
  207. package/schemas/v2.0.0/business-operating-snapshot-projection.schema.json +14 -0
  208. package/schemas/v2.0.0/operate-allowed-action.schema.json +181 -0
  209. package/schemas/v2.0.0/operate-api-envelope.schema.json +225 -0
  210. package/schemas/v2.0.0/operate-capability-provider-registration.schema.json +30 -0
  211. package/schemas/v2.0.0/operate-domain-registration.schema.json +284 -0
  212. package/schemas/v2.0.0/operate-evidence-provider-registration.schema.json +55 -0
  213. package/schemas/v2.0.0/operate-evidence-resolver-registration.schema.json +46 -0
  214. package/schemas/v2.0.0/operate-executor-registration.schema.json +27 -0
  215. package/schemas/v2.0.0/operate-experience-live-patch.schema.json +47 -0
  216. package/schemas/v2.0.0/operate-experience-preview.schema.json +51 -0
  217. package/schemas/v2.0.0/operate-experience-view.schema.json +281 -0
  218. package/schemas/v2.0.0/operate-live-evidence-provider-registration.schema.json +48 -0
  219. package/schemas/v2.0.0/operate-live-evidence-provider-registry.schema.json +17 -0
  220. package/schemas/v2.0.0/operate-metric-provider-registration.schema.json +12 -0
  221. package/schemas/v2.0.0/operate-policy-provider-registration.schema.json +33 -0
  222. package/schemas/v2.0.0/operate-review-bound-submission.schema.json +29 -0
  223. package/schemas/v2.0.0/operate-review-display-workspace.schema.json +390 -0
  224. package/schemas/v2.0.0/operate-snapshot-provider-registration.schema.json +16 -0
  225. package/schemas/v2.0.0/operate-tool-call.schema.json +172 -0
  226. package/schemas/v2.0.0/operate-verification-provider-registration.schema.json +12 -0
  227. package/schemas/v2.0.0/operating-action-policy.schema.json +31 -0
  228. package/schemas/v2.0.0/operating-action-verification-plan.schema.json +13 -0
  229. package/schemas/v2.0.0/operating-action.schema.json +86 -0
  230. package/schemas/v2.0.0/operating-advisor-result.schema.json +394 -0
  231. package/schemas/v2.0.0/operating-approval-record.schema.json +23 -0
  232. package/schemas/v2.0.0/operating-approval-requirement.schema.json +31 -0
  233. package/schemas/v2.0.0/operating-artifact.schema.json +52 -0
  234. package/schemas/v2.0.0/operating-assignment.schema.json +437 -0
  235. package/schemas/v2.0.0/operating-assumption.schema.json +16 -0
  236. package/schemas/v2.0.0/operating-capability-availability.schema.json +15 -0
  237. package/schemas/v2.0.0/operating-capability-grant.schema.json +14 -0
  238. package/schemas/v2.0.0/operating-challenger-review.schema.json +204 -0
  239. package/schemas/v2.0.0/operating-checkpoint.schema.json +43 -0
  240. package/schemas/v2.0.0/operating-claim.schema.json +17 -0
  241. package/schemas/v2.0.0/operating-connector-checkpoint.schema.json +28 -0
  242. package/schemas/v2.0.0/operating-context-capture.schema.json +74 -0
  243. package/schemas/v2.0.0/operating-cycle-input-binding.schema.json +30 -0
  244. package/schemas/v2.0.0/operating-cycle.schema.json +42 -0
  245. package/schemas/v2.0.0/operating-decision-ledger.schema.json +237 -0
  246. package/schemas/v2.0.0/operating-decision.schema.json +137 -0
  247. package/schemas/v2.0.0/operating-delivery-evidence.schema.json +46 -0
  248. package/schemas/v2.0.0/operating-delivery-route.schema.json +43 -0
  249. package/schemas/v2.0.0/operating-delta.schema.json +13 -0
  250. package/schemas/v2.0.0/operating-domain-projection.schema.json +15 -0
  251. package/schemas/v2.0.0/operating-event-trigger.schema.json +11 -0
  252. package/schemas/v2.0.0/operating-event.schema.json +505 -0
  253. package/schemas/v2.0.0/operating-evidence-candidate.schema.json +88 -0
  254. package/schemas/v2.0.0/operating-evidence-edge.schema.json +39 -0
  255. package/schemas/v2.0.0/operating-evidence-graph.schema.json +25 -0
  256. package/schemas/v2.0.0/operating-evidence-observation.schema.json +48 -0
  257. package/schemas/v2.0.0/operating-evidence-ref.schema.json +51 -0
  258. package/schemas/v2.0.0/operating-evidence-resolution.schema.json +54 -0
  259. package/schemas/v2.0.0/operating-execution-result.schema.json +23 -0
  260. package/schemas/v2.0.0/operating-executive-board.schema.json +78 -0
  261. package/schemas/v2.0.0/operating-finding.schema.json +116 -0
  262. package/schemas/v2.0.0/operating-governed-operation.schema.json +54 -0
  263. package/schemas/v2.0.0/operating-intelligence-input-bundle.schema.json +128 -0
  264. package/schemas/v2.0.0/operating-intelligence-plan.schema.json +302 -0
  265. package/schemas/v2.0.0/operating-learning-receipt.schema.json +31 -0
  266. package/schemas/v2.0.0/operating-learning.schema.json +13 -0
  267. package/schemas/v2.0.0/operating-live-evidence-consent-record.schema.json +42 -0
  268. package/schemas/v2.0.0/operating-live-evidence-ingestion.schema.json +31 -0
  269. package/schemas/v2.0.0/operating-measurement-plan.schema.json +18 -0
  270. package/schemas/v2.0.0/operating-measurement-schedule-receipt.schema.json +7 -0
  271. package/schemas/v2.0.0/operating-measurement-schedule.schema.json +16 -0
  272. package/schemas/v2.0.0/operating-metric-observation.schema.json +15 -0
  273. package/schemas/v2.0.0/operating-metric.schema.json +18 -0
  274. package/schemas/v2.0.0/operating-model-state.schema.json +36 -0
  275. package/schemas/v2.0.0/operating-objective.schema.json +21 -0
  276. package/schemas/v2.0.0/operating-origin.schema.json +31 -0
  277. package/schemas/v2.0.0/operating-outcome-evaluation.schema.json +46 -0
  278. package/schemas/v2.0.0/operating-outcome.schema.json +13 -0
  279. package/schemas/v2.0.0/operating-planning-proposal.schema.json +45 -0
  280. package/schemas/v2.0.0/operating-policy-evaluation.schema.json +28 -0
  281. package/schemas/v2.0.0/operating-review-read.schema.json +217 -0
  282. package/schemas/v2.0.0/operating-review-receipt.schema.json +64 -0
  283. package/schemas/v2.0.0/operating-review.schema.json +47 -0
  284. package/schemas/v2.0.0/operating-risk.schema.json +96 -0
  285. package/schemas/v2.0.0/operating-rollback-plan.schema.json +10 -0
  286. package/schemas/v2.0.0/operating-rollback-result.schema.json +20 -0
  287. package/schemas/v2.0.0/operating-runtime-state.schema.json +289 -0
  288. package/schemas/v2.0.0/operating-scenario.schema.json +13 -0
  289. package/schemas/v2.0.0/operating-snapshot.schema.json +38 -0
  290. package/schemas/v2.0.0/operating-submission.schema.json +34 -0
  291. package/schemas/v2.0.0/operating-trace-matrix.schema.json +176 -0
  292. package/schemas/v2.0.0/operating-work-change-set.schema.json +89 -0
  293. package/schemas/v2.0.0/operating-work-ledger.schema.json +40 -0
  294. package/schemas/v2.0.0/software-operating-snapshot-projection.schema.json +14 -0
  295. package/src/browser-contracts.d.mts +5 -0
  296. package/src/browser-contracts.mjs +40 -0
  297. package/src/canonical-json.d.mts +5 -0
  298. package/src/canonical-json.mjs +142 -0
  299. package/src/compat/live-evidence-v2.mjs +1019 -0
  300. package/src/compat/operate-experience-live-patch.mjs +66 -0
  301. package/src/compat/operating-planning-contracts.mjs +114 -0
  302. package/src/contracts.d.mts +42 -0
  303. package/src/contracts.mjs +990 -0
  304. package/src/design-contracts.d.mts +62 -0
  305. package/src/design-contracts.mjs +186 -0
  306. package/src/design-publication-contracts.d.mts +4 -0
  307. package/src/design-publication-contracts.mjs +85 -0
  308. package/src/diagram-contracts.d.mts +19 -0
  309. package/src/diagram-contracts.mjs +28 -0
  310. package/src/enterprise-contracts.d.mts +107 -0
  311. package/src/enterprise-contracts.mjs +463 -0
  312. package/src/errors.d.mts +11 -0
  313. package/src/errors.mjs +109 -0
  314. package/src/generated/canonical-registries.mjs +5554 -0
  315. package/src/generated/contract-catalog-v2.mjs +7076 -0
  316. package/src/generated/diagram-registries.mjs +2529 -0
  317. package/src/index.d.mts +10 -0
  318. package/src/index.mjs +40 -0
  319. package/src/json-schema.d.mts +7 -0
  320. package/src/json-schema.mjs +283 -0
  321. package/src/planning-contracts.d.mts +10 -0
  322. package/src/planning-contracts.mjs +53 -0
  323. package/src/registries.d.mts +40 -0
  324. package/src/registries.mjs +261 -0
  325. package/src/review-experience-contracts.d.mts +11 -0
  326. package/src/review-experience-contracts.mjs +103 -0
  327. package/src/semver.d.mts +2 -0
  328. package/src/semver.mjs +7 -0
  329. package/src/skill-source-contracts.d.mts +25 -0
  330. package/src/skill-source-contracts.mjs +105 -0
  331. package/src/task-contracts.d.mts +7 -0
  332. package/src/task-contracts.mjs +130 -0
  333. package/src/workspace-contracts.d.mts +26 -0
  334. package/src/workspace-contracts.mjs +83 -0
@@ -0,0 +1,62 @@
1
+ export type DesignView = 'canvas' | 'prototype' | 'walkthrough';
2
+
3
+ export interface DesignSource {
4
+ /** Local HTML path relative to the authored document directory. */
5
+ html: string;
6
+ styles?: string[];
7
+ scripts?: string[];
8
+ }
9
+
10
+ export interface DesignFrame {
11
+ id: string;
12
+ label: string;
13
+ width: number;
14
+ height: number;
15
+ }
16
+
17
+ export interface DesignScreen {
18
+ id: string;
19
+ title: string;
20
+ description?: string;
21
+ source: DesignSource;
22
+ /** Stable feedback anchors, unique within this screen. */
23
+ anchors?: string[];
24
+ }
25
+
26
+ export interface DesignVariant {
27
+ id: string;
28
+ label: string;
29
+ description?: string;
30
+ status: 'ready' | 'failed';
31
+ /** Required for failed variants. */
32
+ issue?: string;
33
+ /** Sparse screen overrides inherit unchanged sources from screens. */
34
+ sources?: Record<string, DesignSource>;
35
+ }
36
+
37
+ export interface DesignDocument {
38
+ kind: 'openplanr-design-document';
39
+ schemaVersion: '1.0.0';
40
+ id: string;
41
+ title: string;
42
+ brief: {
43
+ text: string;
44
+ source: 'spec' | 'png' | 'describe';
45
+ provenance: 'spec' | 'inferred';
46
+ references?: string[];
47
+ };
48
+ designSystem?: { path?: string; tokens?: string; spacing?: number[] };
49
+ assets?: string[];
50
+ frames: DesignFrame[];
51
+ screens: DesignScreen[];
52
+ screenOrder: string[];
53
+ flows?: { id: string; title: string; screens: string[] }[];
54
+ variants: DesignVariant[];
55
+ selectedVariant: string;
56
+ defaultView: DesignView;
57
+ }
58
+
59
+ export declare const DESIGN_DOCUMENT_VERSION: '1.0.0';
60
+ export declare const DESIGN_DOCUMENT_SCHEMA: Readonly<Record<string, unknown>>;
61
+ export declare function validateDesignDocument(value: unknown): { ok: boolean; errors: string[] };
62
+ export declare function assertDesignDocument(value: unknown): DesignDocument;
@@ -0,0 +1,186 @@
1
+ import { validateJson } from './json-schema.mjs';
2
+
3
+ /** The authored document version is independent of the Protocol release. */
4
+ export const DESIGN_DOCUMENT_VERSION = '1.0.0';
5
+
6
+ const freeze = (value) => {
7
+ if (value && typeof value === 'object') {
8
+ for (const nested of Object.values(value)) freeze(nested);
9
+ Object.freeze(value);
10
+ }
11
+ return value;
12
+ };
13
+
14
+ /**
15
+ * Portable source of truth for the packaged Protocol 1.9 schema. Rendering,
16
+ * file existence, symlink containment and revisions belong to the design domain.
17
+ */
18
+ export const DESIGN_DOCUMENT_SCHEMA = freeze({
19
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
20
+ $id: 'https://openplanr.dev/schemas/v1.9.0/design-document.schema.json',
21
+ 'x-openplanr-contract': { id: 'design-document', version: '1.9.0' },
22
+ title: 'OpenPlanr authored design document',
23
+ type: 'object',
24
+ additionalProperties: false,
25
+ required: [
26
+ 'kind', 'schemaVersion', 'id', 'title', 'brief', 'frames', 'screens',
27
+ 'screenOrder', 'variants', 'selectedVariant', 'defaultView',
28
+ ],
29
+ properties: {
30
+ kind: { const: 'openplanr-design-document' },
31
+ schemaVersion: { const: DESIGN_DOCUMENT_VERSION },
32
+ id: { $ref: '#/$defs/id' },
33
+ title: { $ref: '#/$defs/text' },
34
+ brief: {
35
+ type: 'object',
36
+ additionalProperties: false,
37
+ required: ['text', 'source', 'provenance'],
38
+ properties: {
39
+ text: { $ref: '#/$defs/text' },
40
+ source: { enum: ['spec', 'png', 'describe'] },
41
+ provenance: { enum: ['spec', 'inferred'] },
42
+ references: { type: 'array', items: { $ref: '#/$defs/text' }, uniqueItems: true },
43
+ },
44
+ },
45
+ designSystem: {
46
+ type: 'object',
47
+ additionalProperties: false,
48
+ properties: {
49
+ path: { $ref: '#/$defs/localPath' },
50
+ tokens: { $ref: '#/$defs/localPath' },
51
+ spacing: {
52
+ type: 'array', minItems: 1, uniqueItems: true,
53
+ items: { type: 'number', minimum: 0, maximum: 16384 },
54
+ },
55
+ },
56
+ },
57
+ assets: { $ref: '#/$defs/paths' },
58
+ frames: {
59
+ type: 'array', minItems: 1,
60
+ items: {
61
+ type: 'object', additionalProperties: false,
62
+ required: ['id', 'label', 'width', 'height'],
63
+ properties: {
64
+ id: { $ref: '#/$defs/id' },
65
+ label: { $ref: '#/$defs/text' },
66
+ width: { type: 'integer', minimum: 1, maximum: 16384 },
67
+ height: { type: 'integer', minimum: 1, maximum: 16384 },
68
+ },
69
+ },
70
+ },
71
+ screens: {
72
+ type: 'array', minItems: 1,
73
+ items: {
74
+ type: 'object', additionalProperties: false,
75
+ required: ['id', 'title', 'source'],
76
+ properties: {
77
+ id: { $ref: '#/$defs/id' },
78
+ title: { $ref: '#/$defs/text' },
79
+ description: { $ref: '#/$defs/text' },
80
+ source: { $ref: '#/$defs/source' },
81
+ anchors: { $ref: '#/$defs/ids' },
82
+ },
83
+ },
84
+ },
85
+ screenOrder: { type: 'array', minItems: 1, items: { $ref: '#/$defs/id' }, uniqueItems: true },
86
+ flows: {
87
+ type: 'array',
88
+ items: {
89
+ type: 'object', additionalProperties: false,
90
+ required: ['id', 'title', 'screens'],
91
+ properties: {
92
+ id: { $ref: '#/$defs/id' },
93
+ title: { $ref: '#/$defs/text' },
94
+ screens: { type: 'array', minItems: 1, items: { $ref: '#/$defs/id' } },
95
+ },
96
+ },
97
+ },
98
+ variants: {
99
+ type: 'array', minItems: 1,
100
+ items: {
101
+ type: 'object', additionalProperties: false,
102
+ required: ['id', 'label', 'status'],
103
+ properties: {
104
+ id: { $ref: '#/$defs/id' },
105
+ label: { $ref: '#/$defs/text' },
106
+ description: { $ref: '#/$defs/text' },
107
+ status: { enum: ['ready', 'failed'] },
108
+ issue: { $ref: '#/$defs/text' },
109
+ sources: { type: 'object', additionalProperties: { $ref: '#/$defs/source' } },
110
+ },
111
+ if: { properties: { status: { const: 'failed' } } },
112
+ then: { required: ['issue'] },
113
+ },
114
+ },
115
+ selectedVariant: { $ref: '#/$defs/id' },
116
+ defaultView: { enum: ['canvas', 'prototype', 'walkthrough'] },
117
+ },
118
+ $defs: {
119
+ id: { type: 'string', minLength: 1, maxLength: 128, pattern: '^[A-Za-z][A-Za-z0-9_-]*$' },
120
+ text: { type: 'string', minLength: 1, pattern: '\\S' },
121
+ ids: { type: 'array', items: { $ref: '#/$defs/id' }, uniqueItems: true },
122
+ localPath: {
123
+ type: 'string', minLength: 1,
124
+ description: 'Path relative to the authored document directory. No URL, traversal, encoded path, query or fragment.',
125
+ pattern: '^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*[/ ]$)[^\\\\:\\u0000-\\u001F%?#]+$',
126
+ },
127
+ paths: { type: 'array', items: { $ref: '#/$defs/localPath' }, uniqueItems: true },
128
+ source: {
129
+ type: 'object', additionalProperties: false, required: ['html'],
130
+ properties: {
131
+ html: { $ref: '#/$defs/localPath' },
132
+ styles: { $ref: '#/$defs/paths' },
133
+ scripts: { $ref: '#/$defs/paths' },
134
+ },
135
+ },
136
+ },
137
+ });
138
+
139
+ /** Validate structure plus stable identity and cross-reference constraints. */
140
+ export function validateDesignDocument(value) {
141
+ const errors = validateJson(value, DESIGN_DOCUMENT_SCHEMA)
142
+ .map(({ path, detail }) => `${path}: ${detail}`);
143
+ if (errors.length > 0) return { ok: false, errors };
144
+
145
+ for (const field of ['frames', 'screens', 'flows', 'variants']) {
146
+ const seen = new Set();
147
+ for (const [index, item] of (value[field] ?? []).entries()) {
148
+ if (seen.has(item.id)) errors.push(`$.${field}[${index}].id: duplicate identity '${item.id}'`);
149
+ seen.add(item.id);
150
+ }
151
+ }
152
+
153
+ const screenIds = new Set(value.screens.map(({ id }) => id));
154
+ const orderedIds = new Set(value.screenOrder);
155
+ for (const id of value.screenOrder) {
156
+ if (!screenIds.has(id)) errors.push(`$.screenOrder: unknown screen '${id}'`);
157
+ }
158
+ for (const id of screenIds) {
159
+ if (!orderedIds.has(id)) errors.push(`$.screenOrder: missing screen '${id}'`);
160
+ }
161
+ for (const [index, flow] of (value.flows ?? []).entries()) {
162
+ for (const id of flow.screens) {
163
+ if (!screenIds.has(id)) errors.push(`$.flows[${index}].screens: unknown screen '${id}'`);
164
+ }
165
+ }
166
+ for (const [index, variant] of value.variants.entries()) {
167
+ for (const id of Object.keys(variant.sources ?? {})) {
168
+ if (!screenIds.has(id)) errors.push(`$.variants[${index}].sources: unknown screen '${id}'`);
169
+ }
170
+ }
171
+ const selected = value.variants.find(({ id }) => id === value.selectedVariant);
172
+ if (!selected) errors.push(`$.selectedVariant: unknown variant '${value.selectedVariant}'`);
173
+ else if (selected.status !== 'ready') errors.push('$.selectedVariant: selected variant must be ready');
174
+
175
+ for (const [index, spacing] of (value.designSystem?.spacing ?? []).entries()) {
176
+ if (!Number.isFinite(spacing)) errors.push(`$.designSystem.spacing[${index}]: expected a finite spacing value`);
177
+ }
178
+ return { ok: errors.length === 0, errors };
179
+ }
180
+
181
+ /** Return the original valid document; never normalize authored design intent. */
182
+ export function assertDesignDocument(value) {
183
+ const result = validateDesignDocument(value);
184
+ if (!result.ok) throw new TypeError(`Invalid design document:\n${result.errors.join('\n')}`);
185
+ return value;
186
+ }
@@ -0,0 +1,4 @@
1
+ export declare const COMPANY_DESIGN_MAX_BYTES: number;
2
+ export declare const COMPANY_DESIGN_MAX_ENTRIES: number;
3
+ /** Validate the existing 1.1.0 review bundle for bounded company publication. */
4
+ export declare function assertCompanyDesignBundle<T>(value: T): T;
@@ -0,0 +1,85 @@
1
+ /** Company publication constraints over the existing, compatible review bundle. */
2
+ import { assertDesignReviewBundle } from './review-experience-contracts.mjs';
3
+ import { canonicalizeJson, sha256Hex } from './canonical-json.mjs';
4
+
5
+ export const COMPANY_DESIGN_MAX_BYTES = 1024 * 1024;
6
+ export const COMPANY_DESIGN_MAX_ENTRIES = 256;
7
+ const fail = message => { throw new TypeError(`Invalid company design bundle: ${message}`); };
8
+ const isRecord = value => value !== null && typeof value === 'object' && !Array.isArray(value);
9
+ const closed = (value, keys, label) => {
10
+ if (!isRecord(value) || Object.keys(value).some(key => !keys.includes(key))) fail(`${label} contains unsupported fields.`);
11
+ };
12
+ const boundedList = (value, max, label) => {
13
+ if (!Array.isArray(value) || !value.length || value.length > max) fail(`${label} must contain 1–${max} items.`);
14
+ };
15
+ const identities = (items, label) => {
16
+ const map = new Map();
17
+ for (const item of items) {
18
+ if (map.has(item.id)) fail(`${label} contains a duplicate identity.`);
19
+ map.set(item.id, item);
20
+ }
21
+ return map;
22
+ };
23
+
24
+ /** Pure browser/Worker-compatible validation; no artifact or design dependency. */
25
+ export function assertCompanyDesignBundle(value) {
26
+ // Bound complexity before recursive schema validation/canonical serialization.
27
+ const pending = [[value, 0]];
28
+ let nodes = 0;
29
+ while (pending.length) {
30
+ const [item, depth] = pending.pop();
31
+ if (++nodes > 50000 || depth > 40) fail('document complexity exceeds the publication limit.');
32
+ if (item && typeof item === 'object') for (const child of Object.values(item)) pending.push([child, depth + 1]);
33
+ }
34
+ let serialized;
35
+ try { serialized = canonicalizeJson(value); } catch { fail('expected bounded JSON data.'); }
36
+ if (new TextEncoder().encode(serialized).byteLength > COMPANY_DESIGN_MAX_BYTES) fail('publication exceeds 1 MiB.');
37
+ if (value?.schemaVersion !== '1.1.0') fail('company publication requires review bundle version 1.1.0.');
38
+ assertDesignReviewBundle(value);
39
+ const { design, envelope, entries } = value;
40
+ boundedList(design.screens, 64, 'screens');
41
+ boundedList(design.frames, 16, 'frames');
42
+ boundedList(design.variants, 16, 'variants');
43
+ boundedList(entries, COMPANY_DESIGN_MAX_ENTRIES, 'entries');
44
+ const screens = identities(design.screens, 'screens');
45
+ const frames = identities(design.frames, 'frames');
46
+ const variants = identities(design.variants, 'variants');
47
+ if (design.variants.some(variant => variant.status !== 'ready') || !variants.has(design.selectedVariant)) fail('selected and published variants must be ready.');
48
+ if (design.screenOrder.length !== screens.size || design.screenOrder.some(id => !screens.has(id))) fail('screen order must identify every published screen.');
49
+ identities(design.flows ?? [], 'flows');
50
+ for (const flow of design.flows ?? []) if (flow.screens.some(id => !screens.has(id))) fail('flow references an unknown screen.');
51
+ if (screens.size * frames.size * variants.size !== entries.length) fail('entries must cover every screen, frame and ready variant.');
52
+ closed(envelope, ['schemaVersion', 'artifacts', 'viewer'], 'envelope');
53
+ if (envelope.schemaVersion !== '1.0.0') fail('unsupported envelope version.');
54
+ boundedList(envelope.artifacts, COMPANY_DESIGN_MAX_ENTRIES, 'artifacts');
55
+ const artifacts = identities(envelope.artifacts, 'artifacts');
56
+ if (artifacts.size !== entries.length) fail('entries and artifacts must correspond exactly.');
57
+ for (const artifact of artifacts.values()) {
58
+ closed(artifact, ['id', 'kind', 'title', 'html', 'sha256', 'viewport', 'colorScheme'], 'artifact');
59
+ if (typeof artifact.id !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(artifact.id)) fail('artifact identity is invalid.');
60
+ if (artifact.kind !== 'html' || typeof artifact.title !== 'string' || !artifact.title.trim() || artifact.title.length > 512 || typeof artifact.html !== 'string' || !artifact.html.trim()) fail('artifacts must be titled HTML screens.');
61
+ closed(artifact.viewport, ['width', 'height'], 'viewport');
62
+ if (!['light', 'dark'].includes(artifact.colorScheme)) fail('artifact color scheme is invalid.');
63
+ if (artifact.sha256 !== sha256Hex(artifact.html.replace(/^\uFEFF/u, '').replace(/\r\n?/gu, '\n'))) fail('artifact digest does not match its HTML.');
64
+ }
65
+ const usedArtifacts = new Set(), combinations = new Set();
66
+ for (const entry of entries) {
67
+ const artifact = artifacts.get(entry.artifactId), frame = frames.get(entry.frameId);
68
+ if (!artifact || !frame || !screens.has(entry.screenId) || !variants.has(entry.variantId)) fail('entry references an unknown screen, variant, frame or artifact.');
69
+ const key = `${entry.screenId}:${entry.variantId}:${entry.frameId}`;
70
+ if (usedArtifacts.has(entry.artifactId) || combinations.has(key)) fail('entries must uniquely map artboards to artifacts.');
71
+ usedArtifacts.add(entry.artifactId); combinations.add(key);
72
+ if (artifact.viewport.width !== frame.width || artifact.viewport.height !== frame.height) fail('artifact viewport must match its declared frame.');
73
+ }
74
+ closed(envelope.viewer, ['mode', 'activeArtifactId', 'presentation'], 'viewer');
75
+ if (!['single', 'variants'].includes(envelope.viewer.mode) || !artifacts.has(envelope.viewer.activeArtifactId) || envelope.viewer.presentation !== 'canvas') fail('viewer must select a published canvas artifact.');
76
+ if (value.fingerprints.length !== entries.length) fail('fingerprints must cover every published artboard.');
77
+ for (const key of Object.keys(value.state?.positions ?? {})) if (!artifacts.has(key)) fail('layout references an unknown artifact.');
78
+ const components = identities(value.reviewContext.implementation.components, 'review components');
79
+ for (const component of components.values()) {
80
+ if (component.screenIds?.some(id => !screens.has(id))) fail('review guidance references an unknown screen.');
81
+ const anchors = new Set((component.screenIds?.length ? component.screenIds : design.screenOrder).flatMap(id => screens.get(id).anchors ?? []));
82
+ if (component.anchorIds?.some(id => !anchors.has(id))) fail('review guidance references an undeclared anchor.');
83
+ }
84
+ return value;
85
+ }
@@ -0,0 +1,19 @@
1
+ export interface DiagramGrammarRegistryEntry extends Record<string, unknown> {
2
+ readonly grammarId: string;
3
+ readonly grammarVersion: '1.0.0';
4
+ readonly title: string;
5
+ readonly layoutFamily: string;
6
+ readonly aliases: readonly string[];
7
+ readonly requiredPrimitives: readonly string[];
8
+ readonly allowedPrimitives: readonly string[];
9
+ }
10
+
11
+ export declare const DIAGRAM_CONTRACT_FILES: Readonly<Record<string, string>>;
12
+ export declare const DIAGRAM_GRAMMAR_REGISTRY: Readonly<{
13
+ grammars: readonly DiagramGrammarRegistryEntry[];
14
+ [key: string]: unknown;
15
+ }>;
16
+ export declare const DIAGRAM_SEMANTIC_PATTERN_REGISTRY: Readonly<Record<string, unknown>>;
17
+ export declare function getDiagramGrammar(grammarId: string): DiagramGrammarRegistryEntry | null;
18
+ export declare function diagramContractUrl(kind: string): URL;
19
+ export declare function diagramDocumentPath(slug: string): string;
@@ -0,0 +1,28 @@
1
+ import { DIAGRAM_V16_CONTRACT_FILES } from './skill-source-contracts.mjs';
2
+ import { DIAGRAM_REGISTRIES } from './generated/diagram-registries.mjs';
3
+
4
+ export const DIAGRAM_CONTRACT_FILES = DIAGRAM_V16_CONTRACT_FILES;
5
+ export const DIAGRAM_GRAMMAR_REGISTRY = DIAGRAM_REGISTRIES['diagram-grammars.json'];
6
+ export const DIAGRAM_SEMANTIC_PATTERN_REGISTRY = DIAGRAM_REGISTRIES['diagram-semantic-patterns.json'];
7
+
8
+ const grammarIndex = new Map(
9
+ DIAGRAM_GRAMMAR_REGISTRY.grammars.map((grammar) => [grammar.grammarId, grammar]),
10
+ );
11
+
12
+ export function getDiagramGrammar(grammarId) {
13
+ return grammarIndex.get(grammarId) ?? null;
14
+ }
15
+
16
+ export function diagramContractUrl(kind) {
17
+ const filename = DIAGRAM_CONTRACT_FILES[kind];
18
+ if (!filename) throw new RangeError(`Unknown diagram contract: ${kind}@1.6.0`);
19
+ return new URL(`../schemas/v1.6.0/${filename}`, import.meta.url);
20
+ }
21
+
22
+ export function diagramDocumentPath(slug) {
23
+ const value = String(slug);
24
+ if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(value)) {
25
+ throw new TypeError(`Invalid diagram slug: ${value}`);
26
+ }
27
+ return `diagrams/${value}/${value}.planr-diagram.json`;
28
+ }
@@ -0,0 +1,107 @@
1
+ export type EnterpriseId = string;
2
+ export type EnterpriseTimestamp = string;
3
+ export type EnterpriseDigest = string;
4
+ export type EnterpriseSchema = Readonly<Record<string, unknown>>;
5
+ export type EnterpriseAction = 'organization.manage' | 'ownership.transfer' | 'billing.manage' | 'audit.read' | 'project.create' | 'project.manage' | 'artifact.read' | 'artifact.author' | 'artifact.export' | 'review.write' | 'review.resolve';
6
+ export type EnterpriseProjectRole = 'maintainer' | 'author' | 'reviewer' | 'viewer';
7
+ export type EnterpriseJson = null | boolean | number | string | EnterpriseJson[] | { [key: string]: EnterpriseJson };
8
+ export interface EnterpriseScope { organizationId: EnterpriseId; projectId: EnterpriseId }
9
+ export interface EnterpriseAccessContext {
10
+ actor: { id: EnterpriseId; verified: boolean };
11
+ organization: { id: EnterpriseId; status: 'active' | 'suspended' };
12
+ membership?: { organizationId: EnterpriseId; actorId: EnterpriseId; role: 'owner' | 'admin' | 'member'; status: 'active' | 'revoked' };
13
+ projectMembership?: EnterpriseScope & { actorId: EnterpriseId; role: EnterpriseProjectRole; status: 'active' | 'revoked' };
14
+ guestGrant?: EnterpriseScope & { artifactId: EnterpriseId; actorId: EnterpriseId; role: 'reviewer' | 'viewer'; status: 'active' | 'revoked'; expiresAt: EnterpriseTimestamp };
15
+ resource: { organizationId: EnterpriseId; projectId?: EnterpriseId; artifactId?: EnterpriseId };
16
+ action: EnterpriseAction;
17
+ now: EnterpriseTimestamp;
18
+ }
19
+ export interface EnterpriseAccessDecision { readonly allowed: boolean; readonly code: string }
20
+ export interface EnterpriseArtifactRevision extends EnterpriseScope {
21
+ kind: 'openplanr-enterprise-artifact-revision'; schemaVersion: '1.0.0';
22
+ id: EnterpriseId; artifactId: EnterpriseId; parentRevisionId: EnterpriseId | null;
23
+ contentDigest: EnterpriseDigest; contentType: 'application/json' | 'text/markdown' | 'image/svg+xml' | 'text/html';
24
+ byteLength: number; createdAt: EnterpriseTimestamp; actorId: EnterpriseId;
25
+ }
26
+ export interface EnterpriseReviewAnchor {
27
+ revisionId: EnterpriseId; elementId?: EnterpriseId; screenId?: EnterpriseId; frameId?: EnterpriseId; x?: number; y?: number;
28
+ }
29
+ export interface EnterpriseReviewReply { id: EnterpriseId; authorId: EnterpriseId; body: string; createdAt: EnterpriseTimestamp }
30
+ export type EnterpriseReviewCategory = 'question' | 'suggestion' | 'change-request' | 'blocker';
31
+ export interface EnterpriseReviewThread extends EnterpriseScope {
32
+ kind: 'openplanr-enterprise-review-thread'; schemaVersion: '1.0.0';
33
+ id: EnterpriseId; artifactId: EnterpriseId; anchor: EnterpriseReviewAnchor;
34
+ category: EnterpriseReviewCategory; status: 'open' | 'addressed' | 'resolved';
35
+ authorId: EnterpriseId; body: string; createdAt: EnterpriseTimestamp; updatedAt: EnterpriseTimestamp;
36
+ replies: EnterpriseReviewReply[]; assigneeId?: EnterpriseId | null; addressedRevisionId?: EnterpriseId; resolvedAt?: EnterpriseTimestamp;
37
+ }
38
+ export type EnterpriseElementCollection = 'nodes' | 'relations' | 'groups' | 'events' | 'items';
39
+ export type EnterpriseChangeOperation =
40
+ | { op: 'replace-document'; content: { [key: string]: EnterpriseJson } }
41
+ | { op: 'set-field'; targetId: EnterpriseId; field: 'label' | 'description' | 'status' | 'title'; value: string }
42
+ | { op: 'add-element'; collection: EnterpriseElementCollection; element: { id: EnterpriseId; [key: string]: EnterpriseJson } }
43
+ | { op: 'remove-element'; collection: EnterpriseElementCollection; targetId: EnterpriseId }
44
+ | { op: 'set-layout'; targetId: EnterpriseId; x: number; y: number };
45
+ export interface EnterpriseChangeProposal extends EnterpriseScope {
46
+ kind: 'openplanr-enterprise-change-proposal'; schemaVersion: '1.0.0';
47
+ id: EnterpriseId; artifactId: EnterpriseId; baseRevisionId: EnterpriseId; authorId: EnterpriseId; createdAt: EnterpriseTimestamp;
48
+ status: 'draft' | 'proposed' | 'accepted' | 'rejected' | 'applied' | 'conflicted'; summary: string;
49
+ operations: EnterpriseChangeOperation[];
50
+ validation: { status: 'pending' | 'passed' | 'failed'; issues: { code: string; message: string; targetId?: EnterpriseId }[] };
51
+ application?: { revisionId: EnterpriseId; appliedAt: EnterpriseTimestamp; actorId: EnterpriseId; gitCommit?: string };
52
+ }
53
+ export type EnterpriseEvidenceSource =
54
+ | { kind: 'repository'; repositoryId: EnterpriseId; path: string; commit: string; line?: number }
55
+ | { kind: 'artifact'; artifactId: EnterpriseId; revisionId: EnterpriseId; elementId?: EnterpriseId }
56
+ | { kind: 'url'; url: string };
57
+ export interface EnterpriseEvidenceReference extends EnterpriseScope {
58
+ kind: 'openplanr-enterprise-evidence-reference'; schemaVersion: '1.0.0'; id: EnterpriseId;
59
+ source: EnterpriseEvidenceSource; capturedAt: EnterpriseTimestamp; freshness: 'current' | 'stale' | 'unknown'; label: string; contentDigest?: EnterpriseDigest;
60
+ }
61
+ export interface EnterpriseSyncState extends EnterpriseScope {
62
+ kind: 'openplanr-enterprise-sync-state'; schemaVersion: '1.0.0'; repositoryId: EnterpriseId;
63
+ direction: 'push' | 'pull'; status: 'preview' | 'pending' | 'synchronized' | 'failed' | 'conflicted';
64
+ scope: EnterpriseId[]; cursor: string | null; operationId: EnterpriseId; updatedAt: EnterpriseTimestamp;
65
+ items: { artifactId: EnterpriseId; baseRevisionId: EnterpriseId | null; revisionId: EnterpriseId | null; contentDigest: EnterpriseDigest; action: 'create' | 'update' | 'unchanged' | 'conflict' }[];
66
+ issues: { code: string; artifactId?: EnterpriseId; message: string }[];
67
+ }
68
+ export interface EnterpriseAgentHandoff extends EnterpriseScope {
69
+ kind: 'openplanr-enterprise-agent-handoff'; schemaVersion: '1.0.0'; artifactId: EnterpriseId; revisionId: EnterpriseId;
70
+ generatedAt: EnterpriseTimestamp; authority: 'feedback-only'; contentTrust: 'untrusted';
71
+ threads: EnterpriseReviewThread[]; evidence: EnterpriseEvidenceReference[]; unresolvedUncertainties: string[]; contentDigest: EnterpriseDigest;
72
+ }
73
+ export declare const ENTERPRISE_CONTRACT_VERSION: '1.0.0';
74
+ export declare const ENTERPRISE_PROTOCOL_VERSION: '1.12.0';
75
+ export declare const ENTERPRISE_CONTENT_DIGEST_HEADER: 'X-OpenPlanr-Content-Digest';
76
+ export declare const ENTERPRISE_ID_PATTERN: string;
77
+ export declare const ENTERPRISE_REVIEW_CATEGORIES: readonly EnterpriseReviewCategory[];
78
+ export declare const ENTERPRISE_ACTIONS: readonly EnterpriseAction[];
79
+ export declare const ENTERPRISE_ACCESS_CONTEXT_SCHEMA: EnterpriseSchema;
80
+ export declare const ENTERPRISE_ARTIFACT_REVISION_SCHEMA: EnterpriseSchema;
81
+ export declare const ENTERPRISE_REVIEW_ANCHOR_SCHEMA: EnterpriseSchema;
82
+ export declare const ENTERPRISE_REVIEW_THREAD_SCHEMA: EnterpriseSchema;
83
+ export declare const ENTERPRISE_CHANGE_OPERATION_SCHEMA: EnterpriseSchema;
84
+ export declare const ENTERPRISE_CHANGE_PROPOSAL_SCHEMA: EnterpriseSchema;
85
+ export declare const ENTERPRISE_EVIDENCE_REFERENCE_SCHEMA: EnterpriseSchema;
86
+ export declare const ENTERPRISE_SYNC_STATE_SCHEMA: EnterpriseSchema;
87
+ export declare const ENTERPRISE_AGENT_HANDOFF_SCHEMA: EnterpriseSchema;
88
+ export declare const ENTERPRISE_SCHEMAS: Readonly<Record<string, EnterpriseSchema>>;
89
+ export declare function assertEnterpriseContract<T>(value: T, schemaOrName: EnterpriseSchema | string): T;
90
+ export declare function assertEnterpriseRevision<T extends EnterpriseArtifactRevision>(value: T): T;
91
+ export declare function assertEnterpriseRevisionAppend<T extends EnterpriseArtifactRevision>(revision: T, previous: EnterpriseArtifactRevision | null, content: string | Uint8Array): T;
92
+ export declare function assertEnterpriseReviewThread<T extends EnterpriseReviewThread>(value: T): T;
93
+ export declare function assertEnterpriseProposal<T extends EnterpriseChangeProposal>(value: T): T;
94
+ export declare function assertEnterpriseEvidence<T extends EnterpriseEvidenceReference>(value: T): T;
95
+ export declare function assertEnterpriseSync<T extends EnterpriseSyncState>(value: T): T;
96
+ export declare function assertEnterpriseHandoff<T extends EnterpriseAgentHandoff>(value: T): T;
97
+ export declare function isEnterpriseRepositoryPath(value: unknown): boolean;
98
+ export declare function authorizeEnterpriseAccess(context: EnterpriseAccessContext): EnterpriseAccessDecision;
99
+ /** Stable UI projection only; every resource request still requires server authorization. */
100
+ export declare function enterpriseProjectCapabilities(role: EnterpriseProjectRole | string): readonly EnterpriseAction[];
101
+ export declare function createEnterpriseHandoff(input: EnterpriseScope & { artifactId: EnterpriseId; revisionId: EnterpriseId; generatedAt: EnterpriseTimestamp; threads?: EnterpriseReviewThread[]; evidence?: EnterpriseEvidenceReference[]; unresolvedUncertainties?: string[] }): EnterpriseAgentHandoff;
102
+ export declare function renderEnterpriseHandoffMarkdown(value: EnterpriseAgentHandoff): string;
103
+ export interface EnterpriseLayout { [targetId: string]: { x: number; y: number } }
104
+ export interface EnterpriseDocumentChange { op: 'add' | 'remove' | 'replace'; plane: 'semantic' | 'layout'; collection?: string; targetId?: string; field?: string; before?: EnterpriseJson; after?: EnterpriseJson }
105
+ export interface EnterpriseDocumentDiff { semanticChanged: boolean; layoutChanged: boolean; changes: EnterpriseDocumentChange[] }
106
+ export declare function diffEnterpriseDocuments(before: { [key: string]: EnterpriseJson }, after: { [key: string]: EnterpriseJson }, options?: { beforeLayout?: EnterpriseLayout; afterLayout?: EnterpriseLayout }): EnterpriseDocumentDiff;
107
+ export declare function applyEnterpriseOperations(document: { [key: string]: EnterpriseJson }, proposal: EnterpriseChangeProposal, options?: { layout?: EnterpriseLayout }): EnterpriseDocumentDiff & { document: { [key: string]: EnterpriseJson }; layout: EnterpriseLayout };