create-agdf 0.14.5 → 0.20.1

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 (1331) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +496 -19
  3. package/bin/create-agdf.js +2 -1
  4. package/generated/.agdf/control/README.md +29 -2
  5. package/generated/.agdf/control/templates/MASTER_BACKLOG.md +4 -2
  6. package/generated/.agdf/control/templates/RUN_STATE.md +1 -0
  7. package/generated/.agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +31 -0
  8. package/generated/.agdf/control/templates/artefacts/PRD.md +44 -5
  9. package/generated/.agdf/control/templates/artefacts/QA_REPORT.md +6 -0
  10. package/generated/.agdf/control/templates/artefacts/SD.md +31 -3
  11. package/generated/.agdf/control/templates/artefacts/TP.md +43 -8
  12. package/generated/.agdf/control/templates/artefacts/UR.md +17 -0
  13. package/generated/.agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +10 -0
  14. package/generated/.opencode/AGDF.md +17 -121
  15. package/generated/.opencode/README.md +7 -2
  16. package/generated/.opencode/agdf-agent-router.md +174 -0
  17. package/generated/.opencode/agdf-interaction-locales.json +2682 -495
  18. package/generated/.opencode/agdf-runtime-contract.md +17 -9
  19. package/generated/.opencode/contracts/closeout.md +7 -3
  20. package/generated/.opencode/contracts/control-scaffold.md +19 -6
  21. package/generated/.opencode/contracts/gate-artifact-preparation.md +132 -0
  22. package/generated/.opencode/contracts/gate-transition.md +56 -12
  23. package/generated/.opencode/contracts/interaction.md +331 -41
  24. package/generated/.opencode/contracts/modes.md +23 -11
  25. package/generated/.opencode/contracts/prd-definition.md +130 -0
  26. package/generated/.opencode/contracts/quality.md +85 -14
  27. package/generated/.opencode/contracts/request-activation.md +252 -0
  28. package/generated/.opencode/contracts/sd-definition.md +69 -0
  29. package/generated/.opencode/contracts/task-target-resolution.md +63 -9
  30. package/generated/.opencode/contracts/tp-definition.md +81 -0
  31. package/generated/.opencode/contracts/ur-definition.md +94 -0
  32. package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +70 -8
  33. package/generated/.opencode/skills/agdf-clean-implementation-review/SKILL.md +35 -3
  34. package/generated/.opencode/skills/agdf-code-review/SKILL.md +36 -2
  35. package/generated/.opencode/skills/agdf-delivery-closeout/SKILL.md +36 -4
  36. package/generated/.opencode/skills/agdf-delivery-path-search/SKILL.md +36 -4
  37. package/generated/.opencode/skills/agdf-gate-check/SKILL.md +68 -222
  38. package/generated/.opencode/skills/agdf-prd-definition/SKILL.md +51 -0
  39. package/generated/.opencode/skills/agdf-qa-gate/SKILL.md +78 -10
  40. package/generated/.opencode/skills/agdf-release-or/SKILL.md +44 -11
  41. package/generated/.opencode/skills/agdf-sd-definition/SKILL.md +51 -0
  42. package/generated/.opencode/skills/agdf-task-plan-review/SKILL.md +35 -3
  43. package/generated/.opencode/skills/agdf-tp-definition/SKILL.md +51 -0
  44. package/generated/.opencode/skills/agdf-ur-definition/SKILL.md +54 -0
  45. package/generated/.opencode/skills/agdf-ux-intent-definition/SKILL.md +100 -6
  46. package/generated/plugins/agdf/.claude-plugin/plugin.json +3 -2
  47. package/generated/plugins/agdf/.codex-plugin/plugin.json +3 -1
  48. package/generated/plugins/agdf/control/README.md +29 -2
  49. package/generated/plugins/agdf/control/templates/MASTER_BACKLOG.md +4 -2
  50. package/generated/plugins/agdf/control/templates/RUN_STATE.md +1 -0
  51. package/generated/plugins/agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +31 -0
  52. package/generated/plugins/agdf/control/templates/artefacts/PRD.md +44 -5
  53. package/generated/plugins/agdf/control/templates/artefacts/QA_REPORT.md +6 -0
  54. package/generated/plugins/agdf/control/templates/artefacts/SD.md +31 -3
  55. package/generated/plugins/agdf/control/templates/artefacts/TP.md +43 -8
  56. package/generated/plugins/agdf/control/templates/artefacts/UR.md +17 -0
  57. package/generated/plugins/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +10 -0
  58. package/generated/plugins/agdf/hooks/hooks.json +2 -2
  59. package/generated/plugins/agdf/hooks/session-start.sh +5 -70
  60. package/generated/plugins/agdf/mcp/agdf-mcp-launch.js +7 -0
  61. package/generated/plugins/agdf/mcp/claude.mcp.json +11 -0
  62. package/generated/plugins/agdf/mcp/sdk/expected-sdk.json +21 -0
  63. package/generated/plugins/agdf/mcp/sdk/package-lock.json +47 -0
  64. package/generated/plugins/agdf/mcp/sdk/package.json +7 -0
  65. package/generated/plugins/agdf/mcp/server/NOTICE +10 -0
  66. package/generated/plugins/agdf/mcp/server/README.md +136 -0
  67. package/generated/plugins/agdf/mcp/server/bin/agdf-mcp.js +24 -0
  68. package/generated/plugins/agdf/mcp/server/package.json +59 -0
  69. package/generated/plugins/agdf/mcp/server/src/cockpit-resource.js +20 -0
  70. package/generated/plugins/agdf/mcp/server/src/generation-entry.js +86 -0
  71. package/generated/plugins/agdf/mcp/server/src/generation-protocol.js +44 -0
  72. package/generated/plugins/agdf/mcp/server/src/generation.js +211 -0
  73. package/generated/plugins/agdf/mcp/server/src/main.js +56 -0
  74. package/generated/plugins/agdf/mcp/server/src/server.js +187 -0
  75. package/generated/plugins/agdf/mcp/server/src/ui-capability.js +17 -0
  76. package/generated/plugins/agdf/mcp/server/src/worker-entry.js +39 -0
  77. package/generated/plugins/agdf/mcp/server/src/worker.js +134 -0
  78. package/generated/plugins/agdf/mcp/server/ui/cockpit.html +109 -0
  79. package/generated/plugins/agdf/mcp/server/ui/decision-manifest.json +8 -0
  80. package/generated/plugins/agdf/mcp/server/ui/decision.html +108 -0
  81. package/generated/plugins/agdf/mcp/server/ui/manifest.json +8 -0
  82. package/generated/plugins/agdf/mcp.json +28 -0
  83. package/generated/plugins/agdf/meta/agdf-agent-router.md +50 -8
  84. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +2682 -495
  85. package/generated/plugins/agdf/meta/agdf-mcp-capability.json +158 -0
  86. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +354 -17
  87. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +17 -9
  88. package/generated/plugins/agdf/meta/contracts/closeout.md +6 -2
  89. package/generated/plugins/agdf/meta/contracts/control-scaffold.md +17 -4
  90. package/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +132 -0
  91. package/generated/plugins/agdf/meta/contracts/gate-transition.md +48 -4
  92. package/generated/plugins/agdf/meta/contracts/interaction.md +328 -38
  93. package/generated/plugins/agdf/meta/contracts/modes.md +23 -11
  94. package/generated/plugins/agdf/meta/contracts/prd-definition.md +130 -0
  95. package/generated/plugins/agdf/meta/contracts/quality.md +77 -6
  96. package/generated/plugins/agdf/meta/contracts/request-activation.md +252 -0
  97. package/generated/plugins/agdf/meta/contracts/sd-definition.md +69 -0
  98. package/generated/plugins/agdf/meta/contracts/task-target-resolution.md +63 -9
  99. package/generated/plugins/agdf/meta/contracts/tp-definition.md +81 -0
  100. package/generated/plugins/agdf/meta/contracts/ur-definition.md +94 -0
  101. package/generated/plugins/agdf/meta/copilot-payload-baseline.json +3 -3
  102. package/generated/plugins/agdf/meta/distribution-profile-history.json +14 -0
  103. package/generated/plugins/agdf/meta/schemas/agent-plugins/1.0.0/mcp.schema.json +120 -0
  104. package/generated/plugins/agdf/meta/schemas/agent-plugins/1.0.0/plugin.schema.json +65 -0
  105. package/generated/plugins/agdf/meta/schemas/agent-plugins/1.0.0/provenance.json +19 -0
  106. package/generated/plugins/agdf/runtime/agdf-local.js +5 -4
  107. package/generated/plugins/agdf/runtime/agdf-session-check.js +127 -50
  108. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +2682 -495
  109. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +354 -17
  110. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/closeout.md +7 -3
  111. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/control-scaffold.md +19 -6
  112. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +132 -0
  113. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/gate-transition.md +56 -12
  114. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +777 -0
  115. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/modes.md +23 -11
  116. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +130 -0
  117. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/quality.md +85 -14
  118. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +252 -0
  119. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +69 -0
  120. package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/task-target-resolution.md +63 -9
  121. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +81 -0
  122. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +94 -0
  123. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +251 -16
  124. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/contract-command.js +24 -0
  125. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/control-maintenance-command.js +44 -0
  126. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +11 -11
  127. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +254 -5
  128. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/runtime-context.js +14 -37
  129. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +205 -7
  130. package/generated/plugins/agdf/runtime/create-agdf/lib/control-command.js +4 -0
  131. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/git-observation.js +22 -0
  132. package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/interaction.js +28 -0
  133. package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/repair.js +4 -0
  134. package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/service.js +3 -0
  135. package/generated/plugins/agdf/runtime/create-agdf/lib/control-maintenance/startup.js +25 -0
  136. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-recovery.js +5 -0
  137. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +3 -3
  138. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +3 -3
  139. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +4 -4
  140. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +1 -1
  141. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +3 -3
  142. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +3 -3
  143. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +1 -1
  144. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +1 -1
  145. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +2 -1
  146. package/generated/plugins/agdf/runtime/create-agdf/lib/host-adapters/claude/session-command.js +2 -0
  147. package/generated/plugins/agdf/runtime/create-agdf/lib/host-adapters/codex/session-command.js +7 -0
  148. package/generated/plugins/agdf/runtime/create-agdf/lib/host-adapters/copilot/session-command.js +1 -0
  149. package/generated/plugins/agdf/runtime/create-agdf/lib/host-adapters/opencode/session-command.js +1 -0
  150. package/generated/plugins/agdf/runtime/create-agdf/lib/host-adapters/session-command.js +11 -0
  151. package/generated/plugins/agdf/runtime/create-agdf/lib/host-command.js +112 -0
  152. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +360 -0
  153. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-entry.js +26 -0
  154. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-owner-entry.js +34 -0
  155. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +527 -0
  156. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +420 -0
  157. package/generated/plugins/agdf/runtime/create-agdf/lib/npm-invocation.js +27 -0
  158. package/generated/plugins/agdf/runtime/create-agdf/lib/repository-context.js +87 -0
  159. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/control-command-service.js +12 -0
  160. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/control-context.js +11 -0
  161. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/git-history.js +7 -0
  162. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/git-originals.js +36 -0
  163. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/local-validator.js +39 -5
  164. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +1 -298
  165. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/runtime-probe.js +61 -0
  166. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +3 -3
  167. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +9 -8
  168. package/generated/plugins/agdf/runtime/create-agdf/lib/skill-dispatch/binding.js +9 -0
  169. package/generated/plugins/agdf/runtime/create-agdf/package.json +6 -2
  170. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +61 -0
  171. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.d.ts +3 -0
  172. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.js +15 -0
  173. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +103 -0
  174. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-readiness.js +131 -0
  175. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/definition-sources.js +46 -0
  176. package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/delivery-map.js +31 -37
  177. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/delivery-relationships.js +21 -0
  178. package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/doctor.js +85 -17
  179. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +827 -0
  180. package/generated/plugins/{copilot/agdf/runtime/create-agdf → agdf/runtime/create-agdf/runtime/core}/lib/control-evaluation/gate-policy.js +141 -10
  181. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/markdown-table.js +40 -0
  182. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/next-action.js +32 -0
  183. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/normalized-gaps.js +105 -0
  184. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +51 -0
  185. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/qa-follow-up.js +83 -0
  186. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +237 -0
  187. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state-policy.js +51 -0
  188. package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/run-state.js +108 -74
  189. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-step-policy.js +20 -0
  190. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-work-summary.js +109 -0
  191. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/sd-readiness.js +56 -0
  192. package/generated/plugins/{copilot/agdf/runtime/create-agdf → agdf/runtime/create-agdf/runtime/core}/lib/control-evaluation/shared.js +5 -2
  193. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/tp-planning.js +118 -0
  194. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +212 -0
  195. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +47 -0
  196. package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/verified-change.js +10 -30
  197. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +122 -0
  198. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-backlog.js +135 -0
  199. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-context.js +97 -0
  200. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-contract.js +86 -0
  201. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.d.ts +17 -0
  202. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.js +45 -0
  203. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-session.js +217 -0
  204. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit.js +388 -0
  205. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +299 -0
  206. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/decision-session.js +243 -0
  207. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +35 -0
  208. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +319 -0
  209. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/compatibility.js +149 -0
  210. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/contract.js +41 -0
  211. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/interaction.js +57 -0
  212. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/migration.js +85 -0
  213. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/presentation.js +122 -0
  214. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/repair.js +226 -0
  215. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/service.js +38 -0
  216. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-pool.js +105 -0
  217. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-worker.js +33 -0
  218. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/control-changes.js +33 -0
  219. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/fs.js +55 -0
  220. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/snapshot.js +378 -0
  221. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read-boundary.js +22 -0
  222. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command-contract.js +73 -0
  223. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command.js +137 -0
  224. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-operations.js +95 -0
  225. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-binding-proof.js +90 -0
  226. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-bindings.js +94 -0
  227. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.d.ts +4 -0
  228. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.js +40 -0
  229. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary.js +67 -0
  230. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/contained-file.js +56 -0
  231. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/control-configuration.js +19 -0
  232. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-action-contract.js +32 -0
  233. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-action-service.js +55 -0
  234. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-material-contract.js +12 -0
  235. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/evidence-bindings.js +132 -0
  236. package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/index.js +2 -0
  237. package/generated/plugins/{copilot/agdf/runtime/create-agdf → agdf/runtime/create-agdf/runtime/core}/lib/control-state/legacy-migration.js +5 -31
  238. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-projection-reader.js +38 -0
  239. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-decision.js +138 -0
  240. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-render.js +130 -0
  241. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-review.js +136 -0
  242. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-snapshot.js +108 -0
  243. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/qa-deviation-acceptance.js +82 -0
  244. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/recording-formats.js +29 -0
  245. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-artefact-recording.js +81 -0
  246. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog-writer.js +80 -0
  247. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog.js +90 -0
  248. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +143 -0
  249. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +174 -0
  250. package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/control-state/run-identity.js +1 -0
  251. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-identity.js +31 -0
  252. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-proof.js +103 -0
  253. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-status.js +59 -0
  254. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operations.js +80 -0
  255. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-owned-outputs.js +59 -0
  256. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-envelope.js +36 -0
  257. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +443 -0
  258. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation.js +348 -0
  259. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recording.js +273 -0
  260. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recovery.js +296 -0
  261. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-relationship-correction.js +74 -0
  262. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-boundary.js +44 -0
  263. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-history.js +184 -0
  264. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +458 -0
  265. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal-compute.js +141 -0
  266. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal.js +26 -0
  267. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +221 -0
  268. package/generated/plugins/{copilot/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js → agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-document.js} +17 -47
  269. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-edits.js +170 -0
  270. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-parser.js +106 -0
  271. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +57 -0
  272. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-repository.js +201 -0
  273. package/generated/plugins/{copilot/agdf/runtime/create-agdf → agdf/runtime/create-agdf/runtime/core}/lib/control-state/run-state-resolver.js +1 -1
  274. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-writer.js +484 -0
  275. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-pending.js +15 -0
  276. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-transaction.js +359 -0
  277. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +571 -0
  278. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-store-inspection.js +65 -0
  279. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-text.js +8 -0
  280. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/delivery-continuation/service.js +67 -0
  281. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/index.js +14 -0
  282. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +26 -0
  283. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.d.ts +2 -0
  284. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +98 -0
  285. package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/interaction-presentation.js +437 -33
  286. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-resource-contract.js +4 -0
  287. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +176 -0
  288. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/repository-context-reader.js +87 -0
  289. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/artefact-templates.js +72 -0
  290. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/binding.js +26 -0
  291. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/context.js +70 -0
  292. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/contracts.js +23 -0
  293. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/host-installation.js +200 -0
  294. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +496 -0
  295. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/binding.js +66 -0
  296. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/compact-continuation.js +76 -0
  297. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +430 -0
  298. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +80 -0
  299. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +74 -0
  300. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +39 -0
  301. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +39 -0
  302. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +833 -0
  303. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +41 -0
  304. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/task-target-resolution.js +202 -0
  305. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/LICENSE +11 -0
  306. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/decode.js +3 -0
  307. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  308. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/decode.js +511 -0
  309. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/encode.js +73 -0
  310. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/escape.js +121 -0
  311. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
  312. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
  313. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
  314. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/index.js +131 -0
  315. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/package.json +3 -0
  316. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  317. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/decode.js +497 -0
  318. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/encode.js +69 -0
  319. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/escape.js +117 -0
  320. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  321. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
  322. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
  323. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/index.js +107 -0
  324. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/package.json +3 -0
  325. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/escape.js +3 -0
  326. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/package.json +118 -0
  327. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/entities/src/generated/.eslintrc.json +10 -0
  328. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/LICENSE +20 -0
  329. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.browser.cjs +43 -0
  330. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.browser.js +43 -0
  331. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.cjs +47 -0
  332. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.js +47 -0
  333. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.native.js +38 -0
  334. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/package.json +12 -0
  335. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/bin/nanoid.cjs +55 -0
  336. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.browser.cjs +45 -0
  337. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.browser.js +45 -0
  338. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.cjs +63 -0
  339. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.js +63 -0
  340. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/nanoid.js +1 -0
  341. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/index.cjs +24 -0
  342. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/index.js +24 -0
  343. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/package.json +6 -0
  344. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/package.json +89 -0
  345. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/index.cjs +4 -0
  346. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/index.js +4 -0
  347. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/package.json +6 -0
  348. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/LICENSE +19 -0
  349. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/doctype.js +118 -0
  350. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/error-codes.js +66 -0
  351. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/foreign-content.js +237 -0
  352. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/html.js +528 -0
  353. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/token.js +24 -0
  354. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/unicode.js +70 -0
  355. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/index.js +54 -0
  356. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/package.json +1 -0
  357. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +114 -0
  358. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/index.js +3240 -0
  359. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/open-element-stack.js +328 -0
  360. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/serializer/index.js +172 -0
  361. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tokenizer/index.js +2714 -0
  362. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +200 -0
  363. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/default.js +176 -0
  364. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/interface.js +2 -0
  365. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/doctype.js +114 -0
  366. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/error-codes.js +63 -0
  367. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/foreign-content.js +228 -0
  368. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/html.js +523 -0
  369. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/token.js +20 -0
  370. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/unicode.js +62 -0
  371. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/index.js +42 -0
  372. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
  373. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/index.js +3245 -0
  374. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
  375. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/serializer/index.js +168 -0
  376. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tokenizer/index.js +2710 -0
  377. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
  378. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tree-adapters/default.js +173 -0
  379. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
  380. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/package.json +50 -0
  381. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/LICENSE +15 -0
  382. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/package.json +25 -0
  383. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/picocolors.browser.js +4 -0
  384. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/picocolors.js +75 -0
  385. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/LICENSE +20 -0
  386. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/at-rule.js +25 -0
  387. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/comment.js +13 -0
  388. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/container.js +494 -0
  389. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/css-syntax-error.js +133 -0
  390. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/declaration.js +24 -0
  391. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/document.js +33 -0
  392. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/fromJSON.js +107 -0
  393. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/input.js +282 -0
  394. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/lazy-result.js +626 -0
  395. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/list.js +79 -0
  396. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/map-generator.js +383 -0
  397. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/no-work-result.js +137 -0
  398. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/node.js +494 -0
  399. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/parse.js +42 -0
  400. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/parser.js +626 -0
  401. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/postcss.js +101 -0
  402. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/postcss.mjs +30 -0
  403. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/previous-map.js +176 -0
  404. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/processor.js +67 -0
  405. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/result.js +42 -0
  406. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/root.js +76 -0
  407. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/rule.js +27 -0
  408. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/stringifier.js +457 -0
  409. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/stringify.js +69 -0
  410. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/symbols.js +5 -0
  411. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/terminal-highlight.js +70 -0
  412. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/tokenize.js +270 -0
  413. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/warn-once.js +13 -0
  414. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/warning.js +47 -0
  415. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/package.json +88 -0
  416. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/LICENSE +28 -0
  417. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/array-set.js +121 -0
  418. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  419. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/base64.js +67 -0
  420. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/binary-search.js +111 -0
  421. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/mapping-list.js +79 -0
  422. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/quick-sort.js +141 -0
  423. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-map-consumer.js +1236 -0
  424. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-map-generator.js +446 -0
  425. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-node.js +420 -0
  426. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/util.js +594 -0
  427. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/package.json +71 -0
  428. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/source-map.js +8 -0
  429. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  430. package/generated/plugins/agdf/scripts/agent-skills-conformance.mjs +9 -5
  431. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +1123 -182
  432. package/generated/plugins/agdf/scripts/instruction-footprint.mjs +945 -0
  433. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +67 -5
  434. package/generated/plugins/agdf/skills/clean-implementation-review/SKILL.md +34 -2
  435. package/generated/plugins/agdf/skills/code-review/SKILL.md +36 -2
  436. package/generated/plugins/agdf/skills/delivery-closeout/SKILL.md +34 -2
  437. package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +34 -2
  438. package/generated/plugins/agdf/skills/gate-check/SKILL.md +68 -222
  439. package/generated/plugins/agdf/skills/prd-definition/SKILL.md +51 -0
  440. package/generated/plugins/agdf/skills/prd-definition/help.md +23 -0
  441. package/generated/plugins/agdf/skills/qa-gate/SKILL.md +73 -5
  442. package/generated/plugins/agdf/skills/release-or/SKILL.md +36 -3
  443. package/generated/plugins/agdf/skills/sd-definition/SKILL.md +51 -0
  444. package/generated/plugins/agdf/skills/sd-definition/help.md +17 -0
  445. package/generated/plugins/agdf/skills/task-plan-review/SKILL.md +34 -2
  446. package/generated/plugins/agdf/skills/tp-definition/SKILL.md +51 -0
  447. package/generated/plugins/agdf/skills/tp-definition/help.md +17 -0
  448. package/generated/plugins/agdf/skills/ur-definition/SKILL.md +54 -0
  449. package/generated/plugins/agdf/skills/ur-definition/help.md +19 -0
  450. package/generated/plugins/agdf/skills/ux-intent-definition/SKILL.md +100 -6
  451. package/generated/plugins/agdf/skills/ux-intent-definition/help.md +3 -0
  452. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  453. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  454. package/generated/plugins/agdf/submission/openai/release-notes.md +1 -1
  455. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  456. package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +3314 -409
  457. package/generated/plugins/copilot/agdf/control/README.md +125 -0
  458. package/generated/plugins/copilot/agdf/control/templates/AGDF_RUN.md +139 -0
  459. package/generated/plugins/copilot/agdf/control/templates/AGENT_QUALITY_CONTRACTS.json +126 -0
  460. package/generated/plugins/copilot/agdf/control/templates/CONTEXT_GRAPH.md +51 -0
  461. package/generated/plugins/copilot/agdf/control/templates/MASTER_BACKLOG.md +39 -0
  462. package/generated/plugins/copilot/agdf/control/templates/RUN_STATE.md +93 -0
  463. package/generated/plugins/copilot/agdf/control/templates/SOT_REGISTRY.md +25 -0
  464. package/generated/plugins/copilot/agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +135 -0
  465. package/generated/plugins/copilot/agdf/control/templates/artefacts/OR.md +125 -0
  466. package/generated/plugins/copilot/agdf/control/templates/artefacts/PRD.md +113 -0
  467. package/generated/plugins/copilot/agdf/control/templates/artefacts/QA_REPORT.md +44 -0
  468. package/generated/plugins/copilot/agdf/control/templates/artefacts/SD.md +70 -0
  469. package/generated/plugins/copilot/agdf/control/templates/artefacts/TP.md +71 -0
  470. package/generated/plugins/copilot/agdf/control/templates/artefacts/UR.md +58 -0
  471. package/generated/plugins/copilot/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +61 -0
  472. package/generated/plugins/copilot/agdf/control/templates/artefacts/VERIFIED_CHANGE.md +58 -0
  473. package/generated/plugins/copilot/agdf/mcp/agdf-mcp-launch.js +7 -0
  474. package/generated/plugins/copilot/agdf/mcp/sdk/expected-sdk.json +21 -0
  475. package/generated/plugins/copilot/agdf/mcp/sdk/package-lock.json +47 -0
  476. package/generated/plugins/copilot/agdf/mcp/sdk/package.json +7 -0
  477. package/generated/plugins/copilot/agdf/mcp/server/NOTICE +10 -0
  478. package/generated/plugins/copilot/agdf/mcp/server/README.md +136 -0
  479. package/generated/plugins/copilot/agdf/mcp/server/bin/agdf-mcp.js +24 -0
  480. package/generated/plugins/copilot/agdf/mcp/server/package.json +59 -0
  481. package/generated/plugins/copilot/agdf/mcp/server/src/cockpit-resource.js +20 -0
  482. package/generated/plugins/copilot/agdf/mcp/server/src/generation-entry.js +86 -0
  483. package/generated/plugins/copilot/agdf/mcp/server/src/generation-protocol.js +44 -0
  484. package/generated/plugins/copilot/agdf/mcp/server/src/generation.js +211 -0
  485. package/generated/plugins/copilot/agdf/mcp/server/src/main.js +56 -0
  486. package/generated/plugins/copilot/agdf/mcp/server/src/server.js +187 -0
  487. package/generated/plugins/copilot/agdf/mcp/server/src/ui-capability.js +17 -0
  488. package/generated/plugins/copilot/agdf/mcp/server/src/worker-entry.js +39 -0
  489. package/generated/plugins/copilot/agdf/mcp/server/src/worker.js +134 -0
  490. package/generated/plugins/copilot/agdf/mcp.json +16 -0
  491. package/generated/plugins/copilot/agdf/meta/agdf-agent-router.md +50 -8
  492. package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +354 -17
  493. package/generated/plugins/copilot/agdf/meta/agdf-runtime-contract.md +17 -9
  494. package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +14 -0
  495. package/generated/plugins/copilot/agdf/plugin.json +3 -5
  496. package/generated/plugins/copilot/agdf/runtime/agdf-local.js +5 -4
  497. package/generated/plugins/copilot/agdf/runtime/agdf-session-check.js +110 -47
  498. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +2682 -495
  499. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +354 -17
  500. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/closeout.md +82 -0
  501. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/context-graph.md +48 -0
  502. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/control-scaffold.md +145 -0
  503. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +132 -0
  504. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-transition.md +209 -0
  505. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +777 -0
  506. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +195 -0
  507. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +130 -0
  508. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +228 -0
  509. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +252 -0
  510. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +69 -0
  511. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/task-target-resolution.md +156 -0
  512. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +81 -0
  513. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +94 -0
  514. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +251 -16
  515. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/contract-command.js +24 -0
  516. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/control-maintenance-command.js +44 -0
  517. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +11 -11
  518. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +254 -5
  519. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/runtime-context.js +14 -37
  520. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +205 -7
  521. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-command.js +4 -0
  522. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/git-observation.js +22 -0
  523. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/interaction.js +28 -0
  524. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/repair.js +4 -0
  525. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/service.js +3 -0
  526. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-maintenance/startup.js +25 -0
  527. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-recovery.js +5 -0
  528. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +3 -3
  529. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +3 -3
  530. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +4 -4
  531. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +1 -1
  532. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +3 -3
  533. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +3 -3
  534. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +1 -1
  535. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +1 -1
  536. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +2 -1
  537. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-adapters/claude/session-command.js +2 -0
  538. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-adapters/codex/session-command.js +7 -0
  539. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-adapters/copilot/session-command.js +1 -0
  540. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-adapters/opencode/session-command.js +1 -0
  541. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-adapters/session-command.js +11 -0
  542. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/host-command.js +112 -0
  543. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +360 -0
  544. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-entry.js +26 -0
  545. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/facade-owner-entry.js +34 -0
  546. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +527 -0
  547. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +420 -0
  548. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/npm-invocation.js +27 -0
  549. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/repository-context.js +87 -0
  550. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/control-command-service.js +12 -0
  551. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/control-context.js +11 -0
  552. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/git-history.js +7 -0
  553. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/git-originals.js +36 -0
  554. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/local-validator.js +39 -5
  555. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +1 -298
  556. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/runtime-probe.js +61 -0
  557. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +3 -3
  558. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +9 -8
  559. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/skill-dispatch/binding.js +9 -0
  560. package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +6 -2
  561. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +61 -0
  562. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.d.ts +3 -0
  563. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/backlog-vocabulary.js +15 -0
  564. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +103 -0
  565. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-readiness.js +131 -0
  566. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/definition-sources.js +46 -0
  567. package/{lib → generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/delivery-map.js +31 -37
  568. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/delivery-relationships.js +21 -0
  569. package/generated/plugins/{agdf/runtime/create-agdf → copilot/agdf/runtime/create-agdf/runtime/core}/lib/control-evaluation/doctor.js +85 -17
  570. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +827 -0
  571. package/{lib → generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/gate-policy.js +141 -10
  572. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/markdown-table.js +40 -0
  573. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/next-action.js +32 -0
  574. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/normalized-gaps.js +105 -0
  575. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +51 -0
  576. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/qa-follow-up.js +83 -0
  577. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +237 -0
  578. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-state-policy.js +51 -0
  579. package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/run-state.js +108 -74
  580. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-step-policy.js +20 -0
  581. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/run-work-summary.js +109 -0
  582. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/sd-readiness.js +56 -0
  583. package/{lib → generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib}/control-evaluation/shared.js +5 -2
  584. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/tp-planning.js +118 -0
  585. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +212 -0
  586. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +47 -0
  587. package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/verified-change.js +10 -30
  588. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +122 -0
  589. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +299 -0
  590. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +35 -0
  591. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +319 -0
  592. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/compatibility.js +149 -0
  593. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/contract.js +41 -0
  594. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/interaction.js +57 -0
  595. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/migration.js +85 -0
  596. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/presentation.js +122 -0
  597. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/repair.js +226 -0
  598. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-maintenance/service.js +38 -0
  599. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/fs.js +55 -0
  600. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read/snapshot.js +378 -0
  601. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-read-boundary.js +22 -0
  602. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command-contract.js +73 -0
  603. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-command.js +137 -0
  604. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/approval-operations.js +95 -0
  605. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-binding-proof.js +90 -0
  606. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/artefact-bindings.js +94 -0
  607. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.d.ts +4 -0
  608. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary-shape.js +40 -0
  609. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/backlog-summary.js +67 -0
  610. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/contained-file.js +56 -0
  611. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/control-configuration.js +19 -0
  612. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/decision-material-contract.js +12 -0
  613. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/evidence-bindings.js +132 -0
  614. package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/index.js +2 -0
  615. package/generated/plugins/{agdf/runtime/create-agdf → copilot/agdf/runtime/create-agdf/runtime/core}/lib/control-state/legacy-migration.js +5 -31
  616. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/legacy-projection-reader.js +38 -0
  617. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-decision.js +138 -0
  618. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-render.js +130 -0
  619. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-review.js +136 -0
  620. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/preview-snapshot.js +108 -0
  621. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/qa-deviation-acceptance.js +82 -0
  622. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/recording-formats.js +29 -0
  623. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-artefact-recording.js +81 -0
  624. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog-writer.js +80 -0
  625. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-backlog.js +90 -0
  626. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +143 -0
  627. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +174 -0
  628. package/generated/plugins/{agdf/runtime/create-agdf → copilot/agdf/runtime/create-agdf/runtime/core}/lib/control-state/run-identity.js +1 -0
  629. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-identity.js +31 -0
  630. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-proof.js +103 -0
  631. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operation-status.js +59 -0
  632. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-operations.js +80 -0
  633. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-owned-outputs.js +59 -0
  634. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-envelope.js +36 -0
  635. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +443 -0
  636. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation.js +348 -0
  637. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recording.js +273 -0
  638. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-recovery.js +296 -0
  639. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-relationship-correction.js +74 -0
  640. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-boundary.js +44 -0
  641. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision-history.js +184 -0
  642. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +458 -0
  643. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal-compute.js +141 -0
  644. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-seal.js +26 -0
  645. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +221 -0
  646. package/{lib/control-state/run-state-parser.js → generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-document.js} +17 -47
  647. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-edits.js +170 -0
  648. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-parser.js +106 -0
  649. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +57 -0
  650. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-repository.js +201 -0
  651. package/generated/plugins/{agdf/runtime/create-agdf → copilot/agdf/runtime/create-agdf/runtime/core}/lib/control-state/run-state-resolver.js +1 -1
  652. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-writer.js +484 -0
  653. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-pending.js +15 -0
  654. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-step-transaction.js +359 -0
  655. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +571 -0
  656. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-store-inspection.js +65 -0
  657. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-text.js +8 -0
  658. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/delivery-continuation/service.js +67 -0
  659. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/fs-swap.js +26 -0
  660. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/index.js +14 -0
  661. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +26 -0
  662. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +98 -0
  663. package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/interaction-presentation.js +437 -33
  664. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-resource-contract.js +4 -0
  665. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +176 -0
  666. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/repository-context-reader.js +87 -0
  667. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/artefact-templates.js +72 -0
  668. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/binding.js +27 -0
  669. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/context.js +70 -0
  670. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/contracts.js +23 -0
  671. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/distribution-profile-history.js +173 -0
  672. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +496 -0
  673. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/binding.js +66 -0
  674. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/compact-continuation.js +76 -0
  675. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +430 -0
  676. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +80 -0
  677. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +74 -0
  678. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +39 -0
  679. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +39 -0
  680. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +833 -0
  681. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +41 -0
  682. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/task-target-resolution.js +202 -0
  683. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/LICENSE +11 -0
  684. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/decode.js +3 -0
  685. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  686. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/decode.js +511 -0
  687. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/encode.js +73 -0
  688. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/escape.js +121 -0
  689. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
  690. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
  691. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
  692. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/index.js +131 -0
  693. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/commonjs/package.json +3 -0
  694. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  695. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/decode.js +497 -0
  696. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/encode.js +69 -0
  697. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/escape.js +117 -0
  698. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  699. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
  700. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
  701. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/index.js +107 -0
  702. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/dist/esm/package.json +3 -0
  703. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/escape.js +3 -0
  704. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/package.json +118 -0
  705. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/entities/src/generated/.eslintrc.json +10 -0
  706. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/LICENSE +20 -0
  707. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.browser.cjs +43 -0
  708. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.browser.js +43 -0
  709. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.cjs +47 -0
  710. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.js +47 -0
  711. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/index.native.js +38 -0
  712. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/async/package.json +12 -0
  713. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/bin/nanoid.cjs +55 -0
  714. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.browser.cjs +45 -0
  715. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.browser.js +45 -0
  716. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.cjs +63 -0
  717. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/index.js +63 -0
  718. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/nanoid.js +1 -0
  719. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/index.cjs +24 -0
  720. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/index.js +24 -0
  721. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/non-secure/package.json +6 -0
  722. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/package.json +89 -0
  723. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/index.cjs +4 -0
  724. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/index.js +4 -0
  725. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/nanoid/url-alphabet/package.json +6 -0
  726. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/LICENSE +19 -0
  727. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/doctype.js +118 -0
  728. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/error-codes.js +66 -0
  729. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/foreign-content.js +237 -0
  730. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/html.js +528 -0
  731. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/token.js +24 -0
  732. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/common/unicode.js +70 -0
  733. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/index.js +54 -0
  734. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/package.json +1 -0
  735. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +114 -0
  736. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/index.js +3240 -0
  737. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/parser/open-element-stack.js +328 -0
  738. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/serializer/index.js +172 -0
  739. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tokenizer/index.js +2714 -0
  740. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +200 -0
  741. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/default.js +176 -0
  742. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/interface.js +2 -0
  743. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/doctype.js +114 -0
  744. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/error-codes.js +63 -0
  745. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/foreign-content.js +228 -0
  746. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/html.js +523 -0
  747. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/token.js +20 -0
  748. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/common/unicode.js +62 -0
  749. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/index.js +42 -0
  750. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
  751. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/index.js +3245 -0
  752. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
  753. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/serializer/index.js +168 -0
  754. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tokenizer/index.js +2710 -0
  755. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
  756. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tree-adapters/default.js +173 -0
  757. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
  758. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/parse5/package.json +50 -0
  759. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/LICENSE +15 -0
  760. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/package.json +25 -0
  761. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/picocolors.browser.js +4 -0
  762. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/picocolors/picocolors.js +75 -0
  763. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/LICENSE +20 -0
  764. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/at-rule.js +25 -0
  765. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/comment.js +13 -0
  766. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/container.js +494 -0
  767. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/css-syntax-error.js +133 -0
  768. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/declaration.js +24 -0
  769. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/document.js +33 -0
  770. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/fromJSON.js +107 -0
  771. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/input.js +282 -0
  772. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/lazy-result.js +626 -0
  773. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/list.js +79 -0
  774. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/map-generator.js +383 -0
  775. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/no-work-result.js +137 -0
  776. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/node.js +494 -0
  777. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/parse.js +42 -0
  778. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/parser.js +626 -0
  779. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/postcss.js +101 -0
  780. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/postcss.mjs +30 -0
  781. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/previous-map.js +176 -0
  782. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/processor.js +67 -0
  783. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/result.js +42 -0
  784. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/root.js +76 -0
  785. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/rule.js +27 -0
  786. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/stringifier.js +457 -0
  787. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/stringify.js +69 -0
  788. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/symbols.js +5 -0
  789. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/terminal-highlight.js +70 -0
  790. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/tokenize.js +270 -0
  791. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/warn-once.js +13 -0
  792. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/lib/warning.js +47 -0
  793. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/postcss/package.json +88 -0
  794. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/LICENSE +28 -0
  795. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/array-set.js +121 -0
  796. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  797. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/base64.js +67 -0
  798. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/binary-search.js +111 -0
  799. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/mapping-list.js +79 -0
  800. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/quick-sort.js +141 -0
  801. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-map-consumer.js +1236 -0
  802. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-map-generator.js +446 -0
  803. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/source-node.js +420 -0
  804. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/lib/util.js +594 -0
  805. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/package.json +71 -0
  806. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/node_modules/source-map-js/source-map.js +8 -0
  807. package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
  808. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-brownfield-analysis/SKILL.md +70 -8
  809. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-clean-implementation-review/SKILL.md +35 -3
  810. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-code-review/SKILL.md +36 -2
  811. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-delivery-closeout/SKILL.md +36 -4
  812. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-delivery-path-search/SKILL.md +36 -4
  813. package/generated/plugins/copilot/agdf/skills/agdf-gate-check/SKILL.md +86 -0
  814. package/generated/plugins/copilot/agdf/skills/agdf-interaction-locales.json +1 -0
  815. package/generated/plugins/copilot/agdf/skills/agdf-prd-definition/SKILL.md +51 -0
  816. package/generated/plugins/copilot/agdf/skills/agdf-qa-gate/SKILL.md +205 -0
  817. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-release-or/SKILL.md +44 -11
  818. package/generated/plugins/copilot/agdf/skills/agdf-runtime-contract.md +24 -0
  819. package/generated/plugins/copilot/agdf/skills/agdf-sd-definition/SKILL.md +51 -0
  820. package/generated/plugins/copilot/agdf/{copilot-skills → skills}/agdf-task-plan-review/SKILL.md +35 -3
  821. package/generated/plugins/copilot/agdf/skills/agdf-tp-definition/SKILL.md +51 -0
  822. package/generated/plugins/copilot/agdf/skills/agdf-ur-definition/SKILL.md +54 -0
  823. package/generated/plugins/copilot/agdf/skills/agdf-ux-intent-definition/SKILL.md +188 -0
  824. package/generated/plugins/copilot/agdf/skills/contracts/closeout.md +82 -0
  825. package/generated/plugins/copilot/agdf/skills/contracts/context-graph.md +48 -0
  826. package/generated/plugins/copilot/agdf/skills/contracts/control-scaffold.md +145 -0
  827. package/generated/plugins/copilot/agdf/skills/contracts/gate-artifact-preparation.md +132 -0
  828. package/generated/plugins/copilot/agdf/skills/contracts/gate-transition.md +209 -0
  829. package/generated/plugins/copilot/agdf/skills/contracts/interaction.md +777 -0
  830. package/generated/plugins/copilot/agdf/skills/contracts/modes.md +195 -0
  831. package/generated/plugins/copilot/agdf/skills/contracts/prd-definition.md +130 -0
  832. package/generated/plugins/copilot/agdf/skills/contracts/quality.md +228 -0
  833. package/generated/plugins/copilot/agdf/skills/contracts/request-activation.md +252 -0
  834. package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +69 -0
  835. package/generated/plugins/copilot/agdf/skills/contracts/task-target-resolution.md +156 -0
  836. package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +81 -0
  837. package/generated/plugins/copilot/agdf/skills/contracts/ur-definition.md +94 -0
  838. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
  839. package/generated/submissions/openai/agdf/meta/agdf-agent-router.md +50 -8
  840. package/generated/submissions/openai/agdf/meta/agdf-interaction-locales.json +2682 -495
  841. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +354 -17
  842. package/generated/submissions/openai/agdf/meta/agdf-runtime-contract.md +17 -9
  843. package/generated/submissions/openai/agdf/meta/contracts/closeout.md +6 -2
  844. package/generated/submissions/openai/agdf/meta/contracts/control-scaffold.md +17 -4
  845. package/generated/submissions/openai/agdf/meta/contracts/gate-artifact-preparation.md +132 -0
  846. package/generated/submissions/openai/agdf/meta/contracts/gate-transition.md +48 -4
  847. package/generated/submissions/openai/agdf/meta/contracts/interaction.md +328 -38
  848. package/generated/submissions/openai/agdf/meta/contracts/modes.md +23 -11
  849. package/generated/submissions/openai/agdf/meta/contracts/prd-definition.md +130 -0
  850. package/generated/submissions/openai/agdf/meta/contracts/quality.md +77 -6
  851. package/generated/submissions/openai/agdf/meta/contracts/request-activation.md +252 -0
  852. package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +69 -0
  853. package/generated/submissions/openai/agdf/meta/contracts/task-target-resolution.md +63 -9
  854. package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +81 -0
  855. package/generated/submissions/openai/agdf/meta/contracts/ur-definition.md +94 -0
  856. package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +3 -3
  857. package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +14 -0
  858. package/generated/submissions/openai/agdf/meta/schemas/agent-plugins/1.0.0/mcp.schema.json +120 -0
  859. package/generated/submissions/openai/agdf/meta/schemas/agent-plugins/1.0.0/plugin.schema.json +65 -0
  860. package/generated/submissions/openai/agdf/meta/schemas/agent-plugins/1.0.0/provenance.json +19 -0
  861. package/generated/submissions/openai/agdf/plugin.json +47 -0
  862. package/generated/submissions/openai/agdf/skills/brownfield-analysis/SKILL.md +67 -5
  863. package/generated/submissions/openai/agdf/skills/clean-implementation-review/SKILL.md +34 -2
  864. package/generated/submissions/openai/agdf/skills/code-review/SKILL.md +36 -2
  865. package/generated/submissions/openai/agdf/skills/delivery-closeout/SKILL.md +34 -2
  866. package/generated/submissions/openai/agdf/skills/delivery-path-search/SKILL.md +34 -2
  867. package/generated/submissions/openai/agdf/skills/gate-check/SKILL.md +68 -222
  868. package/generated/submissions/openai/agdf/skills/prd-definition/SKILL.md +51 -0
  869. package/generated/submissions/openai/agdf/skills/prd-definition/help.md +23 -0
  870. package/generated/submissions/openai/agdf/skills/qa-gate/SKILL.md +73 -5
  871. package/generated/submissions/openai/agdf/skills/release-or/SKILL.md +36 -3
  872. package/generated/submissions/openai/agdf/skills/sd-definition/SKILL.md +51 -0
  873. package/generated/submissions/openai/agdf/skills/sd-definition/help.md +17 -0
  874. package/generated/submissions/openai/agdf/skills/task-plan-review/SKILL.md +34 -2
  875. package/generated/submissions/openai/agdf/skills/tp-definition/SKILL.md +51 -0
  876. package/generated/submissions/openai/agdf/skills/tp-definition/help.md +17 -0
  877. package/generated/submissions/openai/agdf/skills/ur-definition/SKILL.md +54 -0
  878. package/generated/submissions/openai/agdf/skills/ur-definition/help.md +19 -0
  879. package/generated/submissions/openai/agdf/skills/ux-intent-definition/SKILL.md +100 -6
  880. package/generated/submissions/openai/agdf/skills/ux-intent-definition/help.md +3 -0
  881. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  882. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  883. package/generated/submissions/openai/agdf/submission/openai/inventory.json +104 -32
  884. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  885. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  886. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  887. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +1 -1
  888. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  889. package/lib/cli/application.js +726 -271
  890. package/lib/cli/command-registry.js +251 -16
  891. package/lib/cli/contract-command.js +24 -0
  892. package/lib/cli/control-maintenance-command.js +44 -0
  893. package/lib/cli/delivery-path-search-command.js +11 -11
  894. package/lib/cli/parse-args.js +254 -5
  895. package/lib/cli/runtime-context.js +14 -37
  896. package/lib/cli/validation-handlers.js +205 -7
  897. package/lib/control-command.js +4 -0
  898. package/lib/control-evaluation/git-observation.js +22 -0
  899. package/lib/control-maintenance/interaction.js +28 -0
  900. package/lib/control-maintenance/repair.js +4 -0
  901. package/lib/control-maintenance/service.js +3 -0
  902. package/lib/control-maintenance/startup.js +25 -0
  903. package/lib/control-state/run-recovery.js +5 -0
  904. package/lib/delivery-path-search/evaluators/claude.js +3 -3
  905. package/lib/delivery-path-search/evaluators/codex.js +3 -3
  906. package/lib/delivery-path-search/evaluators/opencode.js +4 -4
  907. package/lib/delivery-path-search/evaluators/protocol.js +1 -1
  908. package/lib/delivery-path-search/generators/claude.js +3 -3
  909. package/lib/delivery-path-search/generators/codex.js +3 -3
  910. package/lib/delivery-path-search/generators/protocol.js +1 -1
  911. package/lib/delivery-path-search/surfaces/capabilities.js +1 -1
  912. package/lib/delivery-path-search/transports/read-only-guard.js +2 -1
  913. package/lib/host-adapters/claude/loaded-sessions.js +45 -0
  914. package/lib/host-adapters/claude/marketplace.js +2 -0
  915. package/lib/host-adapters/claude/permission-rules.js +20 -0
  916. package/lib/host-adapters/claude/plugin-mcp.js +40 -0
  917. package/lib/host-adapters/claude/plugin.js +285 -0
  918. package/lib/host-adapters/claude/runtime-check.js +39 -0
  919. package/lib/host-adapters/claude/session-command.js +2 -0
  920. package/lib/host-adapters/claude/uninstall.js +80 -0
  921. package/lib/host-adapters/codex/config-source.js +48 -0
  922. package/lib/host-adapters/codex/identity.js +19 -0
  923. package/lib/host-adapters/codex/mcp-startup.js +14 -0
  924. package/lib/host-adapters/codex/plugin-mcp.js +39 -0
  925. package/lib/host-adapters/codex/plugin.js +243 -0
  926. package/lib/host-adapters/codex/runtime-check.js +27 -0
  927. package/lib/host-adapters/codex/session-command.js +7 -0
  928. package/lib/host-adapters/copilot/plugin.js +220 -0
  929. package/lib/host-adapters/copilot/session-command.js +1 -0
  930. package/lib/host-adapters/opencode/runtime-check.js +39 -0
  931. package/lib/host-adapters/opencode/session-command.js +1 -0
  932. package/lib/host-adapters/opencode/status.js +43 -0
  933. package/lib/host-adapters/session-command.js +11 -0
  934. package/lib/host-command.js +112 -0
  935. package/lib/install-setup/contract.js +319 -0
  936. package/lib/install-setup/control-migration.js +10 -0
  937. package/lib/install-setup/control-repair.js +1 -0
  938. package/lib/install-setup/interaction.js +157 -0
  939. package/lib/install-setup/presentation.js +337 -0
  940. package/lib/install-setup/service.js +441 -0
  941. package/lib/installers/copilot-marketplace-transport.js +74 -0
  942. package/lib/installers/copilot-settings.js +34 -3
  943. package/lib/installers/copilot-skill-discovery.js +27 -0
  944. package/lib/installers/local-development.js +107 -11
  945. package/lib/installers/local-marketplace.js +313 -37
  946. package/lib/installers/npm-invocation.js +2 -0
  947. package/lib/installers/opencode-activation.js +5 -31
  948. package/lib/installers/opencode.js +286 -89
  949. package/lib/installers/packaged-app-marketplace.js +67 -0
  950. package/lib/installers/plugin-command.js +115 -0
  951. package/lib/installers/plugin-installers.js +21 -521
  952. package/lib/lifecycle/operations.js +78 -137
  953. package/lib/lifecycle/owned-mutation.js +64 -0
  954. package/lib/lifecycle/presentation.js +47 -4
  955. package/lib/lifecycle/result.js +183 -2
  956. package/lib/lifecycle/status.js +150 -66
  957. package/lib/mcp-dispatch-runtime.js +360 -0
  958. package/lib/mcp-lifecycle/adapter-contract.js +54 -0
  959. package/lib/mcp-lifecycle/adapters/claude.js +123 -0
  960. package/lib/mcp-lifecycle/adapters/codex-origin-probe.js +87 -0
  961. package/lib/mcp-lifecycle/adapters/codex.js +513 -0
  962. package/lib/mcp-lifecycle/adapters/copilot.js +106 -0
  963. package/lib/mcp-lifecycle/adapters/file-utils.js +90 -0
  964. package/lib/mcp-lifecycle/adapters/opencode.js +148 -0
  965. package/lib/mcp-lifecycle/evidence.js +122 -0
  966. package/lib/mcp-lifecycle/facade-entry.js +26 -0
  967. package/lib/mcp-lifecycle/facade-owner-entry.js +34 -0
  968. package/lib/mcp-lifecycle/host-config.js +60 -0
  969. package/lib/mcp-lifecycle/package.js +527 -0
  970. package/lib/mcp-lifecycle/plugin-runtime.js +420 -0
  971. package/lib/mcp-lifecycle/presentation.js +61 -0
  972. package/lib/mcp-lifecycle/profile-context.js +11 -0
  973. package/lib/mcp-lifecycle/profile.js +63 -0
  974. package/lib/mcp-lifecycle/result.js +92 -0
  975. package/lib/mcp-lifecycle/service.js +533 -0
  976. package/lib/npm-invocation.js +27 -0
  977. package/lib/repository-context.js +87 -0
  978. package/lib/runtime/control-command-service.js +12 -0
  979. package/lib/runtime/control-context.js +11 -0
  980. package/lib/runtime/git-history.js +7 -0
  981. package/lib/runtime/git-originals.js +36 -0
  982. package/lib/runtime/local-validator.js +39 -5
  983. package/lib/runtime/plugin-provenance.js +1 -298
  984. package/lib/runtime/runtime-probe.js +61 -0
  985. package/lib/runtime/validator-application.js +3 -3
  986. package/lib/runtime-check-consent/adapters.js +3 -42
  987. package/lib/runtime-check-consent/claude-settings.js +2 -23
  988. package/lib/runtime-check-consent/codex-hooks.js +96 -0
  989. package/lib/runtime-check-consent/codex-plugin-consent.js +118 -0
  990. package/lib/runtime-check-consent/contract.js +9 -8
  991. package/lib/runtime-check-consent/coordinator.js +3 -3
  992. package/lib/runtime-check-consent/service.js +29 -53
  993. package/lib/runtime-check-consent/state.js +1 -1
  994. package/lib/scaffold/canonical-init.js +691 -0
  995. package/lib/scaffold/plan.js +8 -14
  996. package/lib/scaffold/presentation.js +53 -3
  997. package/lib/skill-dispatch/binding.js +9 -0
  998. package/opencode-plugin.js +99 -26
  999. package/package.json +22 -51
  1000. package/runtime/core/lib/control-evaluation/acceptance-criteria.js +61 -0
  1001. package/runtime/core/lib/control-evaluation/backlog-vocabulary.d.ts +3 -0
  1002. package/runtime/core/lib/control-evaluation/backlog-vocabulary.js +15 -0
  1003. package/runtime/core/lib/control-evaluation/closeout-readiness.js +103 -0
  1004. package/runtime/core/lib/control-evaluation/decision-content-readiness.js +131 -0
  1005. package/runtime/core/lib/control-evaluation/definition-sources.js +46 -0
  1006. package/{generated/plugins/copilot/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/delivery-map.js +31 -37
  1007. package/runtime/core/lib/control-evaluation/delivery-relationships.js +21 -0
  1008. package/{generated/plugins/copilot/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/doctor.js +85 -17
  1009. package/runtime/core/lib/control-evaluation/gate-check.js +827 -0
  1010. package/{generated/plugins/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/gate-policy.js +141 -10
  1011. package/runtime/core/lib/control-evaluation/markdown-table.js +40 -0
  1012. package/runtime/core/lib/control-evaluation/next-action.js +32 -0
  1013. package/runtime/core/lib/control-evaluation/normalized-gaps.js +105 -0
  1014. package/runtime/core/lib/control-evaluation/prd-readiness.js +51 -0
  1015. package/runtime/core/lib/control-evaluation/qa-follow-up.js +83 -0
  1016. package/runtime/core/lib/control-evaluation/report-decision.js +237 -0
  1017. package/runtime/core/lib/control-evaluation/run-state-policy.js +51 -0
  1018. package/{generated/plugins/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/run-state.js +108 -74
  1019. package/runtime/core/lib/control-evaluation/run-step-policy.js +20 -0
  1020. package/runtime/core/lib/control-evaluation/run-work-summary.js +109 -0
  1021. package/runtime/core/lib/control-evaluation/sd-readiness.js +56 -0
  1022. package/{generated/plugins/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/shared.js +5 -2
  1023. package/runtime/core/lib/control-evaluation/tp-planning.js +118 -0
  1024. package/runtime/core/lib/control-evaluation/traceability-readiness.js +212 -0
  1025. package/runtime/core/lib/control-evaluation/ur-readiness.js +47 -0
  1026. package/{generated/plugins/agdf/runtime/create-agdf → runtime/core}/lib/control-evaluation/verified-change.js +10 -30
  1027. package/runtime/core/lib/control-inspect/artifact-readiness.js +122 -0
  1028. package/runtime/core/lib/control-inspect/cockpit-backlog.js +135 -0
  1029. package/runtime/core/lib/control-inspect/cockpit-context.js +97 -0
  1030. package/runtime/core/lib/control-inspect/cockpit-contract.js +86 -0
  1031. package/runtime/core/lib/control-inspect/cockpit-list.d.ts +17 -0
  1032. package/runtime/core/lib/control-inspect/cockpit-list.js +45 -0
  1033. package/runtime/core/lib/control-inspect/cockpit-session.js +217 -0
  1034. package/runtime/core/lib/control-inspect/cockpit.js +388 -0
  1035. package/runtime/core/lib/control-inspect/contract.js +299 -0
  1036. package/runtime/core/lib/control-inspect/decision-session.js +243 -0
  1037. package/runtime/core/lib/control-inspect/selection.js +35 -0
  1038. package/runtime/core/lib/control-inspect/service.js +319 -0
  1039. package/runtime/core/lib/control-maintenance/compatibility.js +149 -0
  1040. package/runtime/core/lib/control-maintenance/contract.js +41 -0
  1041. package/runtime/core/lib/control-maintenance/interaction.js +57 -0
  1042. package/runtime/core/lib/control-maintenance/migration.js +85 -0
  1043. package/runtime/core/lib/control-maintenance/presentation.js +122 -0
  1044. package/runtime/core/lib/control-maintenance/repair.js +226 -0
  1045. package/runtime/core/lib/control-maintenance/service.js +38 -0
  1046. package/runtime/core/lib/control-read/cockpit-pool.js +105 -0
  1047. package/runtime/core/lib/control-read/cockpit-worker.js +33 -0
  1048. package/runtime/core/lib/control-read/control-changes.js +33 -0
  1049. package/runtime/core/lib/control-read/fs.js +55 -0
  1050. package/runtime/core/lib/control-read/snapshot.js +378 -0
  1051. package/runtime/core/lib/control-read-boundary.js +22 -0
  1052. package/runtime/core/lib/control-state/approval-command-contract.js +73 -0
  1053. package/runtime/core/lib/control-state/approval-command.js +137 -0
  1054. package/runtime/core/lib/control-state/approval-operations.js +95 -0
  1055. package/runtime/core/lib/control-state/artefact-binding-proof.js +90 -0
  1056. package/runtime/core/lib/control-state/artefact-bindings.js +94 -0
  1057. package/runtime/core/lib/control-state/backlog-summary-shape.d.ts +4 -0
  1058. package/runtime/core/lib/control-state/backlog-summary-shape.js +40 -0
  1059. package/runtime/core/lib/control-state/backlog-summary.js +67 -0
  1060. package/runtime/core/lib/control-state/contained-file.js +56 -0
  1061. package/runtime/core/lib/control-state/control-configuration.js +19 -0
  1062. package/runtime/core/lib/control-state/decision-action-contract.js +32 -0
  1063. package/runtime/core/lib/control-state/decision-action-service.js +55 -0
  1064. package/runtime/core/lib/control-state/decision-material-contract.js +12 -0
  1065. package/runtime/core/lib/control-state/evidence-bindings.js +132 -0
  1066. package/{lib → runtime/core/lib}/control-state/index.js +2 -0
  1067. package/{lib → runtime/core/lib}/control-state/legacy-migration.js +5 -31
  1068. package/runtime/core/lib/control-state/legacy-projection-reader.js +38 -0
  1069. package/runtime/core/lib/control-state/presentation-decision.js +138 -0
  1070. package/runtime/core/lib/control-state/preview-render.js +130 -0
  1071. package/runtime/core/lib/control-state/preview-review.js +136 -0
  1072. package/runtime/core/lib/control-state/preview-snapshot.js +108 -0
  1073. package/runtime/core/lib/control-state/qa-deviation-acceptance.js +82 -0
  1074. package/runtime/core/lib/control-state/recording-formats.js +29 -0
  1075. package/runtime/core/lib/control-state/run-artefact-recording.js +81 -0
  1076. package/runtime/core/lib/control-state/run-backlog-writer.js +80 -0
  1077. package/runtime/core/lib/control-state/run-backlog.js +90 -0
  1078. package/runtime/core/lib/control-state/run-command-contract.js +143 -0
  1079. package/runtime/core/lib/control-state/run-command-service.js +174 -0
  1080. package/{generated/plugins/copilot/agdf/runtime/create-agdf → runtime/core}/lib/control-state/run-identity.js +1 -0
  1081. package/runtime/core/lib/control-state/run-operation-identity.js +31 -0
  1082. package/runtime/core/lib/control-state/run-operation-proof.js +103 -0
  1083. package/runtime/core/lib/control-state/run-operation-status.js +59 -0
  1084. package/runtime/core/lib/control-state/run-operations.js +80 -0
  1085. package/runtime/core/lib/control-state/run-owned-outputs.js +59 -0
  1086. package/runtime/core/lib/control-state/run-presentation-envelope.js +36 -0
  1087. package/runtime/core/lib/control-state/run-presentation-render.js +443 -0
  1088. package/runtime/core/lib/control-state/run-presentation.js +348 -0
  1089. package/runtime/core/lib/control-state/run-recording.js +273 -0
  1090. package/runtime/core/lib/control-state/run-recovery.js +296 -0
  1091. package/runtime/core/lib/control-state/run-relationship-correction.js +74 -0
  1092. package/runtime/core/lib/control-state/run-revision-boundary.js +44 -0
  1093. package/runtime/core/lib/control-state/run-revision-history.js +184 -0
  1094. package/runtime/core/lib/control-state/run-revision.js +458 -0
  1095. package/runtime/core/lib/control-state/run-seal-compute.js +141 -0
  1096. package/runtime/core/lib/control-state/run-seal.js +26 -0
  1097. package/runtime/core/lib/control-state/run-source-revisions.js +221 -0
  1098. package/{generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js → runtime/core/lib/control-state/run-state-document.js} +17 -47
  1099. package/runtime/core/lib/control-state/run-state-edits.js +170 -0
  1100. package/runtime/core/lib/control-state/run-state-parser.js +106 -0
  1101. package/runtime/core/lib/control-state/run-state-reader.js +57 -0
  1102. package/runtime/core/lib/control-state/run-state-repository.js +201 -0
  1103. package/{lib → runtime/core/lib}/control-state/run-state-resolver.js +1 -1
  1104. package/runtime/core/lib/control-state/run-state-writer.js +484 -0
  1105. package/runtime/core/lib/control-state/run-step-pending.js +15 -0
  1106. package/runtime/core/lib/control-state/run-step-transaction.js +359 -0
  1107. package/runtime/core/lib/control-state/run-steps.js +571 -0
  1108. package/runtime/core/lib/control-state/run-store-inspection.js +65 -0
  1109. package/runtime/core/lib/control-state/run-text.js +8 -0
  1110. package/runtime/core/lib/delivery-continuation/service.js +67 -0
  1111. package/runtime/core/lib/fs-swap.js +26 -0
  1112. package/runtime/core/lib/index.js +14 -0
  1113. package/runtime/core/lib/interaction-catalog-validation.js +26 -0
  1114. package/runtime/core/lib/interaction-catalog.d.ts +2 -0
  1115. package/runtime/core/lib/interaction-catalog.js +98 -0
  1116. package/{lib → runtime/core/lib}/interaction-presentation.js +437 -33
  1117. package/runtime/core/lib/mcp-resource-contract.js +4 -0
  1118. package/runtime/core/lib/mcp-tool-errors.js +176 -0
  1119. package/runtime/core/lib/repository-context-reader.js +87 -0
  1120. package/runtime/core/lib/resources/artefact-templates.js +72 -0
  1121. package/runtime/core/lib/resources/binding.js +26 -0
  1122. package/runtime/core/lib/resources/context.js +70 -0
  1123. package/runtime/core/lib/resources/contracts.js +23 -0
  1124. package/runtime/core/lib/runtime/distribution-profile-history.js +173 -0
  1125. package/runtime/core/lib/runtime/host-installation.js +200 -0
  1126. package/runtime/core/lib/runtime/plugin-provenance.js +496 -0
  1127. package/runtime/core/lib/skill-dispatch/binding.js +66 -0
  1128. package/runtime/core/lib/skill-dispatch/compact-continuation.js +76 -0
  1129. package/runtime/core/lib/skill-dispatch/contract.js +430 -0
  1130. package/runtime/core/lib/skill-dispatch/delivery-intake.js +80 -0
  1131. package/runtime/core/lib/skill-dispatch/delivery-run-assignment.js +74 -0
  1132. package/runtime/core/lib/skill-dispatch/prd-definition.js +39 -0
  1133. package/runtime/core/lib/skill-dispatch/sd-definition.js +39 -0
  1134. package/runtime/core/lib/skill-dispatch/service.js +833 -0
  1135. package/runtime/core/lib/skill-dispatch/tp-definition.js +41 -0
  1136. package/runtime/core/lib/task-target-resolution.js +202 -0
  1137. package/runtime/core/node_modules/entities/LICENSE +11 -0
  1138. package/runtime/core/node_modules/entities/decode.js +3 -0
  1139. package/runtime/core/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  1140. package/runtime/core/node_modules/entities/dist/commonjs/decode.js +511 -0
  1141. package/runtime/core/node_modules/entities/dist/commonjs/encode.js +73 -0
  1142. package/runtime/core/node_modules/entities/dist/commonjs/escape.js +121 -0
  1143. package/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
  1144. package/runtime/core/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
  1145. package/runtime/core/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
  1146. package/runtime/core/node_modules/entities/dist/commonjs/index.js +131 -0
  1147. package/runtime/core/node_modules/entities/dist/commonjs/package.json +3 -0
  1148. package/runtime/core/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  1149. package/runtime/core/node_modules/entities/dist/esm/decode.js +497 -0
  1150. package/runtime/core/node_modules/entities/dist/esm/encode.js +69 -0
  1151. package/runtime/core/node_modules/entities/dist/esm/escape.js +117 -0
  1152. package/runtime/core/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  1153. package/runtime/core/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
  1154. package/runtime/core/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
  1155. package/runtime/core/node_modules/entities/dist/esm/index.js +107 -0
  1156. package/runtime/core/node_modules/entities/dist/esm/package.json +3 -0
  1157. package/runtime/core/node_modules/entities/escape.js +3 -0
  1158. package/runtime/core/node_modules/entities/package.json +118 -0
  1159. package/runtime/core/node_modules/entities/src/generated/.eslintrc.json +10 -0
  1160. package/runtime/core/node_modules/nanoid/LICENSE +20 -0
  1161. package/runtime/core/node_modules/nanoid/async/index.browser.cjs +43 -0
  1162. package/runtime/core/node_modules/nanoid/async/index.browser.js +43 -0
  1163. package/runtime/core/node_modules/nanoid/async/index.cjs +47 -0
  1164. package/runtime/core/node_modules/nanoid/async/index.js +47 -0
  1165. package/runtime/core/node_modules/nanoid/async/index.native.js +38 -0
  1166. package/runtime/core/node_modules/nanoid/async/package.json +12 -0
  1167. package/runtime/core/node_modules/nanoid/bin/nanoid.cjs +55 -0
  1168. package/runtime/core/node_modules/nanoid/index.browser.cjs +45 -0
  1169. package/runtime/core/node_modules/nanoid/index.browser.js +45 -0
  1170. package/runtime/core/node_modules/nanoid/index.cjs +63 -0
  1171. package/runtime/core/node_modules/nanoid/index.js +63 -0
  1172. package/runtime/core/node_modules/nanoid/nanoid.js +1 -0
  1173. package/runtime/core/node_modules/nanoid/non-secure/index.cjs +24 -0
  1174. package/runtime/core/node_modules/nanoid/non-secure/index.js +24 -0
  1175. package/runtime/core/node_modules/nanoid/non-secure/package.json +6 -0
  1176. package/runtime/core/node_modules/nanoid/package.json +89 -0
  1177. package/runtime/core/node_modules/nanoid/url-alphabet/index.cjs +4 -0
  1178. package/runtime/core/node_modules/nanoid/url-alphabet/index.js +4 -0
  1179. package/runtime/core/node_modules/nanoid/url-alphabet/package.json +6 -0
  1180. package/runtime/core/node_modules/parse5/LICENSE +19 -0
  1181. package/runtime/core/node_modules/parse5/dist/cjs/common/doctype.js +118 -0
  1182. package/runtime/core/node_modules/parse5/dist/cjs/common/error-codes.js +66 -0
  1183. package/runtime/core/node_modules/parse5/dist/cjs/common/foreign-content.js +237 -0
  1184. package/runtime/core/node_modules/parse5/dist/cjs/common/html.js +528 -0
  1185. package/runtime/core/node_modules/parse5/dist/cjs/common/token.js +24 -0
  1186. package/runtime/core/node_modules/parse5/dist/cjs/common/unicode.js +70 -0
  1187. package/runtime/core/node_modules/parse5/dist/cjs/index.js +54 -0
  1188. package/runtime/core/node_modules/parse5/dist/cjs/package.json +1 -0
  1189. package/runtime/core/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +114 -0
  1190. package/runtime/core/node_modules/parse5/dist/cjs/parser/index.js +3240 -0
  1191. package/runtime/core/node_modules/parse5/dist/cjs/parser/open-element-stack.js +328 -0
  1192. package/runtime/core/node_modules/parse5/dist/cjs/serializer/index.js +172 -0
  1193. package/runtime/core/node_modules/parse5/dist/cjs/tokenizer/index.js +2714 -0
  1194. package/runtime/core/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +200 -0
  1195. package/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/default.js +176 -0
  1196. package/runtime/core/node_modules/parse5/dist/cjs/tree-adapters/interface.js +2 -0
  1197. package/runtime/core/node_modules/parse5/dist/common/doctype.js +114 -0
  1198. package/runtime/core/node_modules/parse5/dist/common/error-codes.js +63 -0
  1199. package/runtime/core/node_modules/parse5/dist/common/foreign-content.js +228 -0
  1200. package/runtime/core/node_modules/parse5/dist/common/html.js +523 -0
  1201. package/runtime/core/node_modules/parse5/dist/common/token.js +20 -0
  1202. package/runtime/core/node_modules/parse5/dist/common/unicode.js +62 -0
  1203. package/runtime/core/node_modules/parse5/dist/index.js +42 -0
  1204. package/runtime/core/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
  1205. package/runtime/core/node_modules/parse5/dist/parser/index.js +3245 -0
  1206. package/runtime/core/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
  1207. package/runtime/core/node_modules/parse5/dist/serializer/index.js +168 -0
  1208. package/runtime/core/node_modules/parse5/dist/tokenizer/index.js +2710 -0
  1209. package/runtime/core/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
  1210. package/runtime/core/node_modules/parse5/dist/tree-adapters/default.js +173 -0
  1211. package/runtime/core/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
  1212. package/runtime/core/node_modules/parse5/package.json +50 -0
  1213. package/runtime/core/node_modules/picocolors/LICENSE +15 -0
  1214. package/runtime/core/node_modules/picocolors/package.json +25 -0
  1215. package/runtime/core/node_modules/picocolors/picocolors.browser.js +4 -0
  1216. package/runtime/core/node_modules/picocolors/picocolors.js +75 -0
  1217. package/runtime/core/node_modules/postcss/LICENSE +20 -0
  1218. package/runtime/core/node_modules/postcss/lib/at-rule.js +25 -0
  1219. package/runtime/core/node_modules/postcss/lib/comment.js +13 -0
  1220. package/runtime/core/node_modules/postcss/lib/container.js +494 -0
  1221. package/runtime/core/node_modules/postcss/lib/css-syntax-error.js +133 -0
  1222. package/runtime/core/node_modules/postcss/lib/declaration.js +24 -0
  1223. package/runtime/core/node_modules/postcss/lib/document.js +33 -0
  1224. package/runtime/core/node_modules/postcss/lib/fromJSON.js +107 -0
  1225. package/runtime/core/node_modules/postcss/lib/input.js +282 -0
  1226. package/runtime/core/node_modules/postcss/lib/lazy-result.js +626 -0
  1227. package/runtime/core/node_modules/postcss/lib/list.js +79 -0
  1228. package/runtime/core/node_modules/postcss/lib/map-generator.js +383 -0
  1229. package/runtime/core/node_modules/postcss/lib/no-work-result.js +137 -0
  1230. package/runtime/core/node_modules/postcss/lib/node.js +494 -0
  1231. package/runtime/core/node_modules/postcss/lib/parse.js +42 -0
  1232. package/runtime/core/node_modules/postcss/lib/parser.js +626 -0
  1233. package/runtime/core/node_modules/postcss/lib/postcss.js +101 -0
  1234. package/runtime/core/node_modules/postcss/lib/postcss.mjs +30 -0
  1235. package/runtime/core/node_modules/postcss/lib/previous-map.js +176 -0
  1236. package/runtime/core/node_modules/postcss/lib/processor.js +67 -0
  1237. package/runtime/core/node_modules/postcss/lib/result.js +42 -0
  1238. package/runtime/core/node_modules/postcss/lib/root.js +76 -0
  1239. package/runtime/core/node_modules/postcss/lib/rule.js +27 -0
  1240. package/runtime/core/node_modules/postcss/lib/stringifier.js +457 -0
  1241. package/runtime/core/node_modules/postcss/lib/stringify.js +69 -0
  1242. package/runtime/core/node_modules/postcss/lib/symbols.js +5 -0
  1243. package/runtime/core/node_modules/postcss/lib/terminal-highlight.js +70 -0
  1244. package/runtime/core/node_modules/postcss/lib/tokenize.js +270 -0
  1245. package/runtime/core/node_modules/postcss/lib/warn-once.js +13 -0
  1246. package/runtime/core/node_modules/postcss/lib/warning.js +47 -0
  1247. package/runtime/core/node_modules/postcss/package.json +88 -0
  1248. package/runtime/core/node_modules/source-map-js/LICENSE +28 -0
  1249. package/runtime/core/node_modules/source-map-js/lib/array-set.js +121 -0
  1250. package/runtime/core/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  1251. package/runtime/core/node_modules/source-map-js/lib/base64.js +67 -0
  1252. package/runtime/core/node_modules/source-map-js/lib/binary-search.js +111 -0
  1253. package/runtime/core/node_modules/source-map-js/lib/mapping-list.js +79 -0
  1254. package/runtime/core/node_modules/source-map-js/lib/quick-sort.js +141 -0
  1255. package/runtime/core/node_modules/source-map-js/lib/source-map-consumer.js +1236 -0
  1256. package/runtime/core/node_modules/source-map-js/lib/source-map-generator.js +446 -0
  1257. package/runtime/core/node_modules/source-map-js/lib/source-node.js +420 -0
  1258. package/runtime/core/node_modules/source-map-js/lib/util.js +594 -0
  1259. package/runtime/core/node_modules/source-map-js/package.json +71 -0
  1260. package/runtime/core/node_modules/source-map-js/source-map.js +8 -0
  1261. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +0 -506
  1262. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +0 -68
  1263. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +0 -97
  1264. package/generated/plugins/copilot/agdf/copilot-skills/agdf-gate-check/SKILL.md +0 -240
  1265. package/generated/plugins/copilot/agdf/copilot-skills/agdf-interaction-locales.json +0 -512
  1266. package/generated/plugins/copilot/agdf/copilot-skills/agdf-qa-gate/SKILL.md +0 -137
  1267. package/generated/plugins/copilot/agdf/copilot-skills/agdf-runtime-contract.md +0 -16
  1268. package/generated/plugins/copilot/agdf/copilot-skills/agdf-ux-intent-definition/SKILL.md +0 -94
  1269. package/generated/plugins/copilot/agdf/copilot-skills/contracts/interaction.md +0 -487
  1270. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +0 -506
  1271. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +0 -68
  1272. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +0 -97
  1273. package/lib/control-evaluation/gate-check.js +0 -506
  1274. package/lib/control-state/run-state-repository.js +0 -68
  1275. package/lib/control-state/run-state-writer.js +0 -97
  1276. package/lib/proportionality-benchmark/blind-prompt.js +0 -38
  1277. package/lib/proportionality-benchmark/contracts.js +0 -129
  1278. package/lib/proportionality-benchmark/corpus-loader.js +0 -221
  1279. package/lib/proportionality-benchmark/evaluator.js +0 -260
  1280. package/lib/proportionality-benchmark/index.js +0 -8
  1281. package/lib/proportionality-benchmark/live-recorder.js +0 -122
  1282. package/lib/proportionality-benchmark/profiles.js +0 -102
  1283. package/lib/proportionality-benchmark/report.js +0 -60
  1284. package/lib/proportionality-benchmark/source-fingerprint.js +0 -34
  1285. package/lib/public-plugin/builder.js +0 -83
  1286. package/lib/public-plugin/contract.js +0 -102
  1287. package/lib/public-plugin/copilot-profile.js +0 -126
  1288. package/lib/public-plugin/manifest.js +0 -104
  1289. package/lib/public-plugin/report.js +0 -33
  1290. package/lib/public-plugin/validator.js +0 -101
  1291. package/lib/release/profile-history.js +0 -222
  1292. package/lib/release/version-bump.js +0 -549
  1293. package/lib/release/version-coherence.js +0 -137
  1294. package/lib/skill-evals/artefact-quality.js +0 -36
  1295. package/lib/skill-evals/index.js +0 -105
  1296. package/lib/skill-evals/live-recorder.js +0 -85
  1297. package/lib/skill-evals/workspace.js +0 -97
  1298. /package/generated/plugins/{copilot/agdf/copilot-skills → agdf/runtime/create-agdf/generated/plugins/agdf/meta}/contracts/context-graph.md +0 -0
  1299. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/parent-reconciliation.js +0 -0
  1300. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/required-files.js +0 -0
  1301. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/aggregate.js +0 -0
  1302. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/gate-approval-validator.js +0 -0
  1303. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/candidate-policy.js +0 -0
  1304. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/contracts.js +0 -0
  1305. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/persistence.js +0 -0
  1306. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/scoring.js +0 -0
  1307. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/search-engine.js +0 -0
  1308. /package/generated/plugins/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/state-adapter.js +0 -0
  1309. /package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/fs-swap.js +0 -0
  1310. /package/{lib → generated/plugins/agdf/runtime/create-agdf/runtime/core/lib}/runtime/distribution-profile-history.js +0 -0
  1311. /package/generated/plugins/copilot/agdf/{hooks/copilot-hooks.json → com.github.copilot/hooks/hooks.json} +0 -0
  1312. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/parent-reconciliation.js +0 -0
  1313. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-evaluation/required-files.js +0 -0
  1314. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/aggregate.js +0 -0
  1315. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/control-state/gate-approval-validator.js +0 -0
  1316. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/candidate-policy.js +0 -0
  1317. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/contracts.js +0 -0
  1318. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/persistence.js +0 -0
  1319. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/scoring.js +0 -0
  1320. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/search-engine.js +0 -0
  1321. /package/generated/plugins/copilot/agdf/runtime/create-agdf/{lib → runtime/core/lib}/delivery-path-search/state-adapter.js +0 -0
  1322. /package/{lib → runtime/core/lib}/control-evaluation/parent-reconciliation.js +0 -0
  1323. /package/{lib → runtime/core/lib}/control-evaluation/required-files.js +0 -0
  1324. /package/{lib → runtime/core/lib}/control-state/aggregate.js +0 -0
  1325. /package/{lib → runtime/core/lib}/control-state/gate-approval-validator.js +0 -0
  1326. /package/{lib → runtime/core/lib}/delivery-path-search/candidate-policy.js +0 -0
  1327. /package/{lib → runtime/core/lib}/delivery-path-search/contracts.js +0 -0
  1328. /package/{lib → runtime/core/lib}/delivery-path-search/persistence.js +0 -0
  1329. /package/{lib → runtime/core/lib}/delivery-path-search/scoring.js +0 -0
  1330. /package/{lib → runtime/core/lib}/delivery-path-search/search-engine.js +0 -0
  1331. /package/{lib → runtime/core/lib}/delivery-path-search/state-adapter.js +0 -0
@@ -0,0 +1,2710 @@
1
+ import { Preprocessor } from './preprocessor.js';
2
+ import { CODE_POINTS as $, SEQUENCES as $$, REPLACEMENT_CHARACTER, isSurrogate, isUndefinedCodePoint, isControlCodePoint, } from '../common/unicode.js';
3
+ import { TokenType, getTokenAttr, } from '../common/token.js';
4
+ import { htmlDecodeTree, EntityDecoder, DecodingMode } from 'entities/decode';
5
+ import { ERR } from '../common/error-codes.js';
6
+ import { TAG_ID, getTagID } from '../common/html.js';
7
+ //States
8
+ var State;
9
+ (function (State) {
10
+ State[State["DATA"] = 0] = "DATA";
11
+ State[State["RCDATA"] = 1] = "RCDATA";
12
+ State[State["RAWTEXT"] = 2] = "RAWTEXT";
13
+ State[State["SCRIPT_DATA"] = 3] = "SCRIPT_DATA";
14
+ State[State["PLAINTEXT"] = 4] = "PLAINTEXT";
15
+ State[State["TAG_OPEN"] = 5] = "TAG_OPEN";
16
+ State[State["END_TAG_OPEN"] = 6] = "END_TAG_OPEN";
17
+ State[State["TAG_NAME"] = 7] = "TAG_NAME";
18
+ State[State["RCDATA_LESS_THAN_SIGN"] = 8] = "RCDATA_LESS_THAN_SIGN";
19
+ State[State["RCDATA_END_TAG_OPEN"] = 9] = "RCDATA_END_TAG_OPEN";
20
+ State[State["RCDATA_END_TAG_NAME"] = 10] = "RCDATA_END_TAG_NAME";
21
+ State[State["RAWTEXT_LESS_THAN_SIGN"] = 11] = "RAWTEXT_LESS_THAN_SIGN";
22
+ State[State["RAWTEXT_END_TAG_OPEN"] = 12] = "RAWTEXT_END_TAG_OPEN";
23
+ State[State["RAWTEXT_END_TAG_NAME"] = 13] = "RAWTEXT_END_TAG_NAME";
24
+ State[State["SCRIPT_DATA_LESS_THAN_SIGN"] = 14] = "SCRIPT_DATA_LESS_THAN_SIGN";
25
+ State[State["SCRIPT_DATA_END_TAG_OPEN"] = 15] = "SCRIPT_DATA_END_TAG_OPEN";
26
+ State[State["SCRIPT_DATA_END_TAG_NAME"] = 16] = "SCRIPT_DATA_END_TAG_NAME";
27
+ State[State["SCRIPT_DATA_ESCAPE_START"] = 17] = "SCRIPT_DATA_ESCAPE_START";
28
+ State[State["SCRIPT_DATA_ESCAPE_START_DASH"] = 18] = "SCRIPT_DATA_ESCAPE_START_DASH";
29
+ State[State["SCRIPT_DATA_ESCAPED"] = 19] = "SCRIPT_DATA_ESCAPED";
30
+ State[State["SCRIPT_DATA_ESCAPED_DASH"] = 20] = "SCRIPT_DATA_ESCAPED_DASH";
31
+ State[State["SCRIPT_DATA_ESCAPED_DASH_DASH"] = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH";
32
+ State[State["SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN"] = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN";
33
+ State[State["SCRIPT_DATA_ESCAPED_END_TAG_OPEN"] = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN";
34
+ State[State["SCRIPT_DATA_ESCAPED_END_TAG_NAME"] = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME";
35
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPE_START"] = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START";
36
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPED"] = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED";
37
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH"] = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH";
38
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH"] = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH";
39
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN"] = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN";
40
+ State[State["SCRIPT_DATA_DOUBLE_ESCAPE_END"] = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END";
41
+ State[State["BEFORE_ATTRIBUTE_NAME"] = 31] = "BEFORE_ATTRIBUTE_NAME";
42
+ State[State["ATTRIBUTE_NAME"] = 32] = "ATTRIBUTE_NAME";
43
+ State[State["AFTER_ATTRIBUTE_NAME"] = 33] = "AFTER_ATTRIBUTE_NAME";
44
+ State[State["BEFORE_ATTRIBUTE_VALUE"] = 34] = "BEFORE_ATTRIBUTE_VALUE";
45
+ State[State["ATTRIBUTE_VALUE_DOUBLE_QUOTED"] = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED";
46
+ State[State["ATTRIBUTE_VALUE_SINGLE_QUOTED"] = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED";
47
+ State[State["ATTRIBUTE_VALUE_UNQUOTED"] = 37] = "ATTRIBUTE_VALUE_UNQUOTED";
48
+ State[State["AFTER_ATTRIBUTE_VALUE_QUOTED"] = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED";
49
+ State[State["SELF_CLOSING_START_TAG"] = 39] = "SELF_CLOSING_START_TAG";
50
+ State[State["BOGUS_COMMENT"] = 40] = "BOGUS_COMMENT";
51
+ State[State["MARKUP_DECLARATION_OPEN"] = 41] = "MARKUP_DECLARATION_OPEN";
52
+ State[State["COMMENT_START"] = 42] = "COMMENT_START";
53
+ State[State["COMMENT_START_DASH"] = 43] = "COMMENT_START_DASH";
54
+ State[State["COMMENT"] = 44] = "COMMENT";
55
+ State[State["COMMENT_LESS_THAN_SIGN"] = 45] = "COMMENT_LESS_THAN_SIGN";
56
+ State[State["COMMENT_LESS_THAN_SIGN_BANG"] = 46] = "COMMENT_LESS_THAN_SIGN_BANG";
57
+ State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH"] = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH";
58
+ State[State["COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH"] = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH";
59
+ State[State["COMMENT_END_DASH"] = 49] = "COMMENT_END_DASH";
60
+ State[State["COMMENT_END"] = 50] = "COMMENT_END";
61
+ State[State["COMMENT_END_BANG"] = 51] = "COMMENT_END_BANG";
62
+ State[State["DOCTYPE"] = 52] = "DOCTYPE";
63
+ State[State["BEFORE_DOCTYPE_NAME"] = 53] = "BEFORE_DOCTYPE_NAME";
64
+ State[State["DOCTYPE_NAME"] = 54] = "DOCTYPE_NAME";
65
+ State[State["AFTER_DOCTYPE_NAME"] = 55] = "AFTER_DOCTYPE_NAME";
66
+ State[State["AFTER_DOCTYPE_PUBLIC_KEYWORD"] = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD";
67
+ State[State["BEFORE_DOCTYPE_PUBLIC_IDENTIFIER"] = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER";
68
+ State[State["DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED"] = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED";
69
+ State[State["DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED"] = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED";
70
+ State[State["AFTER_DOCTYPE_PUBLIC_IDENTIFIER"] = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER";
71
+ State[State["BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS"] = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS";
72
+ State[State["AFTER_DOCTYPE_SYSTEM_KEYWORD"] = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD";
73
+ State[State["BEFORE_DOCTYPE_SYSTEM_IDENTIFIER"] = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER";
74
+ State[State["DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED"] = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED";
75
+ State[State["DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED"] = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED";
76
+ State[State["AFTER_DOCTYPE_SYSTEM_IDENTIFIER"] = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER";
77
+ State[State["BOGUS_DOCTYPE"] = 67] = "BOGUS_DOCTYPE";
78
+ State[State["CDATA_SECTION"] = 68] = "CDATA_SECTION";
79
+ State[State["CDATA_SECTION_BRACKET"] = 69] = "CDATA_SECTION_BRACKET";
80
+ State[State["CDATA_SECTION_END"] = 70] = "CDATA_SECTION_END";
81
+ State[State["CHARACTER_REFERENCE"] = 71] = "CHARACTER_REFERENCE";
82
+ State[State["AMBIGUOUS_AMPERSAND"] = 72] = "AMBIGUOUS_AMPERSAND";
83
+ })(State || (State = {}));
84
+ //Tokenizer initial states for different modes
85
+ export const TokenizerMode = {
86
+ DATA: State.DATA,
87
+ RCDATA: State.RCDATA,
88
+ RAWTEXT: State.RAWTEXT,
89
+ SCRIPT_DATA: State.SCRIPT_DATA,
90
+ PLAINTEXT: State.PLAINTEXT,
91
+ CDATA_SECTION: State.CDATA_SECTION,
92
+ };
93
+ //Utils
94
+ //OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline
95
+ //this functions if they will be situated in another module due to context switch.
96
+ //Always perform inlining check before modifying this functions ('node --trace-inlining').
97
+ function isAsciiDigit(cp) {
98
+ return cp >= $.DIGIT_0 && cp <= $.DIGIT_9;
99
+ }
100
+ function isAsciiUpper(cp) {
101
+ return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z;
102
+ }
103
+ function isAsciiLower(cp) {
104
+ return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z;
105
+ }
106
+ function isAsciiLetter(cp) {
107
+ return isAsciiLower(cp) || isAsciiUpper(cp);
108
+ }
109
+ function isAsciiAlphaNumeric(cp) {
110
+ return isAsciiLetter(cp) || isAsciiDigit(cp);
111
+ }
112
+ function toAsciiLower(cp) {
113
+ return cp + 32;
114
+ }
115
+ function isWhitespace(cp) {
116
+ return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED;
117
+ }
118
+ function isScriptDataDoubleEscapeSequenceEnd(cp) {
119
+ return isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN;
120
+ }
121
+ function getErrorForNumericCharacterReference(code) {
122
+ if (code === $.NULL) {
123
+ return ERR.nullCharacterReference;
124
+ }
125
+ else if (code > 1114111) {
126
+ return ERR.characterReferenceOutsideUnicodeRange;
127
+ }
128
+ else if (isSurrogate(code)) {
129
+ return ERR.surrogateCharacterReference;
130
+ }
131
+ else if (isUndefinedCodePoint(code)) {
132
+ return ERR.noncharacterCharacterReference;
133
+ }
134
+ else if (isControlCodePoint(code) || code === $.CARRIAGE_RETURN) {
135
+ return ERR.controlCharacterReference;
136
+ }
137
+ return null;
138
+ }
139
+ //Tokenizer
140
+ export class Tokenizer {
141
+ constructor(options, handler) {
142
+ this.options = options;
143
+ this.handler = handler;
144
+ this.paused = false;
145
+ /** Ensures that the parsing loop isn't run multiple times at once. */
146
+ this.inLoop = false;
147
+ /**
148
+ * Indicates that the current adjusted node exists, is not an element in the HTML namespace,
149
+ * and that it is not an integration point for either MathML or HTML.
150
+ *
151
+ * @see {@link https://html.spec.whatwg.org/multipage/parsing.html#tree-construction}
152
+ */
153
+ this.inForeignNode = false;
154
+ this.lastStartTagName = '';
155
+ this.active = false;
156
+ this.state = State.DATA;
157
+ this.returnState = State.DATA;
158
+ this.entityStartPos = 0;
159
+ this.consumedAfterSnapshot = -1;
160
+ this.currentCharacterToken = null;
161
+ this.currentToken = null;
162
+ this.currentAttr = { name: '', value: '' };
163
+ this.preprocessor = new Preprocessor(handler);
164
+ this.currentLocation = this.getCurrentLocation(-1);
165
+ this.entityDecoder = new EntityDecoder(htmlDecodeTree, (cp, consumed) => {
166
+ // Note: Set `pos` _before_ flushing, as flushing might drop
167
+ // the current chunk and invalidate `entityStartPos`.
168
+ this.preprocessor.pos = this.entityStartPos + consumed - 1;
169
+ this._flushCodePointConsumedAsCharacterReference(cp);
170
+ }, handler.onParseError
171
+ ? {
172
+ missingSemicolonAfterCharacterReference: () => {
173
+ this._err(ERR.missingSemicolonAfterCharacterReference, 1);
174
+ },
175
+ absenceOfDigitsInNumericCharacterReference: (consumed) => {
176
+ this._err(ERR.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + consumed);
177
+ },
178
+ validateNumericCharacterReference: (code) => {
179
+ const error = getErrorForNumericCharacterReference(code);
180
+ if (error)
181
+ this._err(error, 1);
182
+ },
183
+ }
184
+ : undefined);
185
+ }
186
+ //Errors
187
+ _err(code, cpOffset = 0) {
188
+ var _a, _b;
189
+ (_b = (_a = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a, this.preprocessor.getError(code, cpOffset));
190
+ }
191
+ // NOTE: `offset` may never run across line boundaries.
192
+ getCurrentLocation(offset) {
193
+ if (!this.options.sourceCodeLocationInfo) {
194
+ return null;
195
+ }
196
+ return {
197
+ startLine: this.preprocessor.line,
198
+ startCol: this.preprocessor.col - offset,
199
+ startOffset: this.preprocessor.offset - offset,
200
+ endLine: -1,
201
+ endCol: -1,
202
+ endOffset: -1,
203
+ };
204
+ }
205
+ _runParsingLoop() {
206
+ if (this.inLoop)
207
+ return;
208
+ this.inLoop = true;
209
+ while (this.active && !this.paused) {
210
+ this.consumedAfterSnapshot = 0;
211
+ const cp = this._consume();
212
+ if (!this._ensureHibernation()) {
213
+ this._callState(cp);
214
+ }
215
+ }
216
+ this.inLoop = false;
217
+ }
218
+ //API
219
+ pause() {
220
+ this.paused = true;
221
+ }
222
+ resume(writeCallback) {
223
+ if (!this.paused) {
224
+ throw new Error('Parser was already resumed');
225
+ }
226
+ this.paused = false;
227
+ // Necessary for synchronous resume.
228
+ if (this.inLoop)
229
+ return;
230
+ this._runParsingLoop();
231
+ if (!this.paused) {
232
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
233
+ }
234
+ }
235
+ write(chunk, isLastChunk, writeCallback) {
236
+ this.active = true;
237
+ this.preprocessor.write(chunk, isLastChunk);
238
+ this._runParsingLoop();
239
+ if (!this.paused) {
240
+ writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
241
+ }
242
+ }
243
+ insertHtmlAtCurrentPos(chunk) {
244
+ this.active = true;
245
+ this.preprocessor.insertHtmlAtCurrentPos(chunk);
246
+ this._runParsingLoop();
247
+ }
248
+ //Hibernation
249
+ _ensureHibernation() {
250
+ if (this.preprocessor.endOfChunkHit) {
251
+ this.preprocessor.retreat(this.consumedAfterSnapshot);
252
+ this.consumedAfterSnapshot = 0;
253
+ this.active = false;
254
+ return true;
255
+ }
256
+ return false;
257
+ }
258
+ //Consumption
259
+ _consume() {
260
+ this.consumedAfterSnapshot++;
261
+ return this.preprocessor.advance();
262
+ }
263
+ _advanceBy(count) {
264
+ this.consumedAfterSnapshot += count;
265
+ for (let i = 0; i < count; i++) {
266
+ this.preprocessor.advance();
267
+ }
268
+ }
269
+ _consumeSequenceIfMatch(pattern, caseSensitive) {
270
+ if (this.preprocessor.startsWith(pattern, caseSensitive)) {
271
+ // We will already have consumed one character before calling this method.
272
+ this._advanceBy(pattern.length - 1);
273
+ return true;
274
+ }
275
+ return false;
276
+ }
277
+ //Token creation
278
+ _createStartTagToken() {
279
+ this.currentToken = {
280
+ type: TokenType.START_TAG,
281
+ tagName: '',
282
+ tagID: TAG_ID.UNKNOWN,
283
+ selfClosing: false,
284
+ ackSelfClosing: false,
285
+ attrs: [],
286
+ location: this.getCurrentLocation(1),
287
+ };
288
+ }
289
+ _createEndTagToken() {
290
+ this.currentToken = {
291
+ type: TokenType.END_TAG,
292
+ tagName: '',
293
+ tagID: TAG_ID.UNKNOWN,
294
+ selfClosing: false,
295
+ ackSelfClosing: false,
296
+ attrs: [],
297
+ location: this.getCurrentLocation(2),
298
+ };
299
+ }
300
+ _createCommentToken(offset) {
301
+ this.currentToken = {
302
+ type: TokenType.COMMENT,
303
+ data: '',
304
+ location: this.getCurrentLocation(offset),
305
+ };
306
+ }
307
+ _createDoctypeToken(initialName) {
308
+ this.currentToken = {
309
+ type: TokenType.DOCTYPE,
310
+ name: initialName,
311
+ forceQuirks: false,
312
+ publicId: null,
313
+ systemId: null,
314
+ location: this.currentLocation,
315
+ };
316
+ }
317
+ _createCharacterToken(type, chars) {
318
+ this.currentCharacterToken = {
319
+ type,
320
+ chars,
321
+ location: this.currentLocation,
322
+ };
323
+ }
324
+ //Tag attributes
325
+ _createAttr(attrNameFirstCh) {
326
+ this.currentAttr = {
327
+ name: attrNameFirstCh,
328
+ value: '',
329
+ };
330
+ this.currentLocation = this.getCurrentLocation(0);
331
+ }
332
+ _leaveAttrName() {
333
+ var _a;
334
+ var _b;
335
+ const token = this.currentToken;
336
+ if (getTokenAttr(token, this.currentAttr.name) === null) {
337
+ token.attrs.push(this.currentAttr);
338
+ if (token.location && this.currentLocation) {
339
+ const attrLocations = ((_a = (_b = token.location).attrs) !== null && _a !== void 0 ? _a : (_b.attrs = Object.create(null)));
340
+ attrLocations[this.currentAttr.name] = this.currentLocation;
341
+ // Set end location
342
+ this._leaveAttrValue();
343
+ }
344
+ }
345
+ else {
346
+ this._err(ERR.duplicateAttribute);
347
+ }
348
+ }
349
+ _leaveAttrValue() {
350
+ if (this.currentLocation) {
351
+ this.currentLocation.endLine = this.preprocessor.line;
352
+ this.currentLocation.endCol = this.preprocessor.col;
353
+ this.currentLocation.endOffset = this.preprocessor.offset;
354
+ }
355
+ }
356
+ //Token emission
357
+ prepareToken(ct) {
358
+ this._emitCurrentCharacterToken(ct.location);
359
+ this.currentToken = null;
360
+ if (ct.location) {
361
+ ct.location.endLine = this.preprocessor.line;
362
+ ct.location.endCol = this.preprocessor.col + 1;
363
+ ct.location.endOffset = this.preprocessor.offset + 1;
364
+ }
365
+ this.currentLocation = this.getCurrentLocation(-1);
366
+ }
367
+ emitCurrentTagToken() {
368
+ const ct = this.currentToken;
369
+ this.prepareToken(ct);
370
+ ct.tagID = getTagID(ct.tagName);
371
+ if (ct.type === TokenType.START_TAG) {
372
+ this.lastStartTagName = ct.tagName;
373
+ this.handler.onStartTag(ct);
374
+ }
375
+ else {
376
+ if (ct.attrs.length > 0) {
377
+ this._err(ERR.endTagWithAttributes);
378
+ }
379
+ if (ct.selfClosing) {
380
+ this._err(ERR.endTagWithTrailingSolidus);
381
+ }
382
+ this.handler.onEndTag(ct);
383
+ }
384
+ this.preprocessor.dropParsedChunk();
385
+ }
386
+ emitCurrentComment(ct) {
387
+ this.prepareToken(ct);
388
+ this.handler.onComment(ct);
389
+ this.preprocessor.dropParsedChunk();
390
+ }
391
+ emitCurrentDoctype(ct) {
392
+ this.prepareToken(ct);
393
+ this.handler.onDoctype(ct);
394
+ this.preprocessor.dropParsedChunk();
395
+ }
396
+ _emitCurrentCharacterToken(nextLocation) {
397
+ if (this.currentCharacterToken) {
398
+ //NOTE: if we have a pending character token, make it's end location equal to the
399
+ //current token's start location.
400
+ if (nextLocation && this.currentCharacterToken.location) {
401
+ this.currentCharacterToken.location.endLine = nextLocation.startLine;
402
+ this.currentCharacterToken.location.endCol = nextLocation.startCol;
403
+ this.currentCharacterToken.location.endOffset = nextLocation.startOffset;
404
+ }
405
+ switch (this.currentCharacterToken.type) {
406
+ case TokenType.CHARACTER: {
407
+ this.handler.onCharacter(this.currentCharacterToken);
408
+ break;
409
+ }
410
+ case TokenType.NULL_CHARACTER: {
411
+ this.handler.onNullCharacter(this.currentCharacterToken);
412
+ break;
413
+ }
414
+ case TokenType.WHITESPACE_CHARACTER: {
415
+ this.handler.onWhitespaceCharacter(this.currentCharacterToken);
416
+ break;
417
+ }
418
+ }
419
+ this.currentCharacterToken = null;
420
+ }
421
+ }
422
+ _emitEOFToken() {
423
+ const location = this.getCurrentLocation(0);
424
+ if (location) {
425
+ location.endLine = location.startLine;
426
+ location.endCol = location.startCol;
427
+ location.endOffset = location.startOffset;
428
+ }
429
+ this._emitCurrentCharacterToken(location);
430
+ this.handler.onEof({ type: TokenType.EOF, location });
431
+ this.active = false;
432
+ }
433
+ //Characters emission
434
+ //OPTIMIZATION: The specification uses only one type of character token (one token per character).
435
+ //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.
436
+ //If we have a sequence of characters that belong to the same group, the parser can process it
437
+ //as a single solid character token.
438
+ //So, there are 3 types of character tokens in parse5:
439
+ //1)TokenType.NULL_CHARACTER - \u0000-character sequences (e.g. '\u0000\u0000\u0000')
440
+ //2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\n \r\t \f')
441
+ //3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')
442
+ _appendCharToCurrentCharacterToken(type, ch) {
443
+ if (this.currentCharacterToken) {
444
+ if (this.currentCharacterToken.type === type) {
445
+ this.currentCharacterToken.chars += ch;
446
+ return;
447
+ }
448
+ else {
449
+ this.currentLocation = this.getCurrentLocation(0);
450
+ this._emitCurrentCharacterToken(this.currentLocation);
451
+ this.preprocessor.dropParsedChunk();
452
+ }
453
+ }
454
+ this._createCharacterToken(type, ch);
455
+ }
456
+ _emitCodePoint(cp) {
457
+ const type = isWhitespace(cp)
458
+ ? TokenType.WHITESPACE_CHARACTER
459
+ : cp === $.NULL
460
+ ? TokenType.NULL_CHARACTER
461
+ : TokenType.CHARACTER;
462
+ this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp));
463
+ }
464
+ //NOTE: used when we emit characters explicitly.
465
+ //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
466
+ _emitChars(ch) {
467
+ this._appendCharToCurrentCharacterToken(TokenType.CHARACTER, ch);
468
+ }
469
+ // Character reference helpers
470
+ _startCharacterReference() {
471
+ this.returnState = this.state;
472
+ this.state = State.CHARACTER_REFERENCE;
473
+ this.entityStartPos = this.preprocessor.pos;
474
+ this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? DecodingMode.Attribute : DecodingMode.Legacy);
475
+ }
476
+ _isCharacterReferenceInAttribute() {
477
+ return (this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED ||
478
+ this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED ||
479
+ this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED);
480
+ }
481
+ _flushCodePointConsumedAsCharacterReference(cp) {
482
+ if (this._isCharacterReferenceInAttribute()) {
483
+ this.currentAttr.value += String.fromCodePoint(cp);
484
+ }
485
+ else {
486
+ this._emitCodePoint(cp);
487
+ }
488
+ }
489
+ // Calling states this way turns out to be much faster than any other approach.
490
+ _callState(cp) {
491
+ switch (this.state) {
492
+ case State.DATA: {
493
+ this._stateData(cp);
494
+ break;
495
+ }
496
+ case State.RCDATA: {
497
+ this._stateRcdata(cp);
498
+ break;
499
+ }
500
+ case State.RAWTEXT: {
501
+ this._stateRawtext(cp);
502
+ break;
503
+ }
504
+ case State.SCRIPT_DATA: {
505
+ this._stateScriptData(cp);
506
+ break;
507
+ }
508
+ case State.PLAINTEXT: {
509
+ this._statePlaintext(cp);
510
+ break;
511
+ }
512
+ case State.TAG_OPEN: {
513
+ this._stateTagOpen(cp);
514
+ break;
515
+ }
516
+ case State.END_TAG_OPEN: {
517
+ this._stateEndTagOpen(cp);
518
+ break;
519
+ }
520
+ case State.TAG_NAME: {
521
+ this._stateTagName(cp);
522
+ break;
523
+ }
524
+ case State.RCDATA_LESS_THAN_SIGN: {
525
+ this._stateRcdataLessThanSign(cp);
526
+ break;
527
+ }
528
+ case State.RCDATA_END_TAG_OPEN: {
529
+ this._stateRcdataEndTagOpen(cp);
530
+ break;
531
+ }
532
+ case State.RCDATA_END_TAG_NAME: {
533
+ this._stateRcdataEndTagName(cp);
534
+ break;
535
+ }
536
+ case State.RAWTEXT_LESS_THAN_SIGN: {
537
+ this._stateRawtextLessThanSign(cp);
538
+ break;
539
+ }
540
+ case State.RAWTEXT_END_TAG_OPEN: {
541
+ this._stateRawtextEndTagOpen(cp);
542
+ break;
543
+ }
544
+ case State.RAWTEXT_END_TAG_NAME: {
545
+ this._stateRawtextEndTagName(cp);
546
+ break;
547
+ }
548
+ case State.SCRIPT_DATA_LESS_THAN_SIGN: {
549
+ this._stateScriptDataLessThanSign(cp);
550
+ break;
551
+ }
552
+ case State.SCRIPT_DATA_END_TAG_OPEN: {
553
+ this._stateScriptDataEndTagOpen(cp);
554
+ break;
555
+ }
556
+ case State.SCRIPT_DATA_END_TAG_NAME: {
557
+ this._stateScriptDataEndTagName(cp);
558
+ break;
559
+ }
560
+ case State.SCRIPT_DATA_ESCAPE_START: {
561
+ this._stateScriptDataEscapeStart(cp);
562
+ break;
563
+ }
564
+ case State.SCRIPT_DATA_ESCAPE_START_DASH: {
565
+ this._stateScriptDataEscapeStartDash(cp);
566
+ break;
567
+ }
568
+ case State.SCRIPT_DATA_ESCAPED: {
569
+ this._stateScriptDataEscaped(cp);
570
+ break;
571
+ }
572
+ case State.SCRIPT_DATA_ESCAPED_DASH: {
573
+ this._stateScriptDataEscapedDash(cp);
574
+ break;
575
+ }
576
+ case State.SCRIPT_DATA_ESCAPED_DASH_DASH: {
577
+ this._stateScriptDataEscapedDashDash(cp);
578
+ break;
579
+ }
580
+ case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
581
+ this._stateScriptDataEscapedLessThanSign(cp);
582
+ break;
583
+ }
584
+ case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {
585
+ this._stateScriptDataEscapedEndTagOpen(cp);
586
+ break;
587
+ }
588
+ case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {
589
+ this._stateScriptDataEscapedEndTagName(cp);
590
+ break;
591
+ }
592
+ case State.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
593
+ this._stateScriptDataDoubleEscapeStart(cp);
594
+ break;
595
+ }
596
+ case State.SCRIPT_DATA_DOUBLE_ESCAPED: {
597
+ this._stateScriptDataDoubleEscaped(cp);
598
+ break;
599
+ }
600
+ case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
601
+ this._stateScriptDataDoubleEscapedDash(cp);
602
+ break;
603
+ }
604
+ case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
605
+ this._stateScriptDataDoubleEscapedDashDash(cp);
606
+ break;
607
+ }
608
+ case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
609
+ this._stateScriptDataDoubleEscapedLessThanSign(cp);
610
+ break;
611
+ }
612
+ case State.SCRIPT_DATA_DOUBLE_ESCAPE_END: {
613
+ this._stateScriptDataDoubleEscapeEnd(cp);
614
+ break;
615
+ }
616
+ case State.BEFORE_ATTRIBUTE_NAME: {
617
+ this._stateBeforeAttributeName(cp);
618
+ break;
619
+ }
620
+ case State.ATTRIBUTE_NAME: {
621
+ this._stateAttributeName(cp);
622
+ break;
623
+ }
624
+ case State.AFTER_ATTRIBUTE_NAME: {
625
+ this._stateAfterAttributeName(cp);
626
+ break;
627
+ }
628
+ case State.BEFORE_ATTRIBUTE_VALUE: {
629
+ this._stateBeforeAttributeValue(cp);
630
+ break;
631
+ }
632
+ case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
633
+ this._stateAttributeValueDoubleQuoted(cp);
634
+ break;
635
+ }
636
+ case State.ATTRIBUTE_VALUE_SINGLE_QUOTED: {
637
+ this._stateAttributeValueSingleQuoted(cp);
638
+ break;
639
+ }
640
+ case State.ATTRIBUTE_VALUE_UNQUOTED: {
641
+ this._stateAttributeValueUnquoted(cp);
642
+ break;
643
+ }
644
+ case State.AFTER_ATTRIBUTE_VALUE_QUOTED: {
645
+ this._stateAfterAttributeValueQuoted(cp);
646
+ break;
647
+ }
648
+ case State.SELF_CLOSING_START_TAG: {
649
+ this._stateSelfClosingStartTag(cp);
650
+ break;
651
+ }
652
+ case State.BOGUS_COMMENT: {
653
+ this._stateBogusComment(cp);
654
+ break;
655
+ }
656
+ case State.MARKUP_DECLARATION_OPEN: {
657
+ this._stateMarkupDeclarationOpen(cp);
658
+ break;
659
+ }
660
+ case State.COMMENT_START: {
661
+ this._stateCommentStart(cp);
662
+ break;
663
+ }
664
+ case State.COMMENT_START_DASH: {
665
+ this._stateCommentStartDash(cp);
666
+ break;
667
+ }
668
+ case State.COMMENT: {
669
+ this._stateComment(cp);
670
+ break;
671
+ }
672
+ case State.COMMENT_LESS_THAN_SIGN: {
673
+ this._stateCommentLessThanSign(cp);
674
+ break;
675
+ }
676
+ case State.COMMENT_LESS_THAN_SIGN_BANG: {
677
+ this._stateCommentLessThanSignBang(cp);
678
+ break;
679
+ }
680
+ case State.COMMENT_LESS_THAN_SIGN_BANG_DASH: {
681
+ this._stateCommentLessThanSignBangDash(cp);
682
+ break;
683
+ }
684
+ case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {
685
+ this._stateCommentLessThanSignBangDashDash(cp);
686
+ break;
687
+ }
688
+ case State.COMMENT_END_DASH: {
689
+ this._stateCommentEndDash(cp);
690
+ break;
691
+ }
692
+ case State.COMMENT_END: {
693
+ this._stateCommentEnd(cp);
694
+ break;
695
+ }
696
+ case State.COMMENT_END_BANG: {
697
+ this._stateCommentEndBang(cp);
698
+ break;
699
+ }
700
+ case State.DOCTYPE: {
701
+ this._stateDoctype(cp);
702
+ break;
703
+ }
704
+ case State.BEFORE_DOCTYPE_NAME: {
705
+ this._stateBeforeDoctypeName(cp);
706
+ break;
707
+ }
708
+ case State.DOCTYPE_NAME: {
709
+ this._stateDoctypeName(cp);
710
+ break;
711
+ }
712
+ case State.AFTER_DOCTYPE_NAME: {
713
+ this._stateAfterDoctypeName(cp);
714
+ break;
715
+ }
716
+ case State.AFTER_DOCTYPE_PUBLIC_KEYWORD: {
717
+ this._stateAfterDoctypePublicKeyword(cp);
718
+ break;
719
+ }
720
+ case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
721
+ this._stateBeforeDoctypePublicIdentifier(cp);
722
+ break;
723
+ }
724
+ case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
725
+ this._stateDoctypePublicIdentifierDoubleQuoted(cp);
726
+ break;
727
+ }
728
+ case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
729
+ this._stateDoctypePublicIdentifierSingleQuoted(cp);
730
+ break;
731
+ }
732
+ case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
733
+ this._stateAfterDoctypePublicIdentifier(cp);
734
+ break;
735
+ }
736
+ case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
737
+ this._stateBetweenDoctypePublicAndSystemIdentifiers(cp);
738
+ break;
739
+ }
740
+ case State.AFTER_DOCTYPE_SYSTEM_KEYWORD: {
741
+ this._stateAfterDoctypeSystemKeyword(cp);
742
+ break;
743
+ }
744
+ case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
745
+ this._stateBeforeDoctypeSystemIdentifier(cp);
746
+ break;
747
+ }
748
+ case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
749
+ this._stateDoctypeSystemIdentifierDoubleQuoted(cp);
750
+ break;
751
+ }
752
+ case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
753
+ this._stateDoctypeSystemIdentifierSingleQuoted(cp);
754
+ break;
755
+ }
756
+ case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
757
+ this._stateAfterDoctypeSystemIdentifier(cp);
758
+ break;
759
+ }
760
+ case State.BOGUS_DOCTYPE: {
761
+ this._stateBogusDoctype(cp);
762
+ break;
763
+ }
764
+ case State.CDATA_SECTION: {
765
+ this._stateCdataSection(cp);
766
+ break;
767
+ }
768
+ case State.CDATA_SECTION_BRACKET: {
769
+ this._stateCdataSectionBracket(cp);
770
+ break;
771
+ }
772
+ case State.CDATA_SECTION_END: {
773
+ this._stateCdataSectionEnd(cp);
774
+ break;
775
+ }
776
+ case State.CHARACTER_REFERENCE: {
777
+ this._stateCharacterReference();
778
+ break;
779
+ }
780
+ case State.AMBIGUOUS_AMPERSAND: {
781
+ this._stateAmbiguousAmpersand(cp);
782
+ break;
783
+ }
784
+ default: {
785
+ throw new Error('Unknown state');
786
+ }
787
+ }
788
+ }
789
+ // State machine
790
+ // Data state
791
+ //------------------------------------------------------------------
792
+ _stateData(cp) {
793
+ switch (cp) {
794
+ case $.LESS_THAN_SIGN: {
795
+ this.state = State.TAG_OPEN;
796
+ break;
797
+ }
798
+ case $.AMPERSAND: {
799
+ this._startCharacterReference();
800
+ break;
801
+ }
802
+ case $.NULL: {
803
+ this._err(ERR.unexpectedNullCharacter);
804
+ this._emitCodePoint(cp);
805
+ break;
806
+ }
807
+ case $.EOF: {
808
+ this._emitEOFToken();
809
+ break;
810
+ }
811
+ default: {
812
+ this._emitCodePoint(cp);
813
+ }
814
+ }
815
+ }
816
+ // RCDATA state
817
+ //------------------------------------------------------------------
818
+ _stateRcdata(cp) {
819
+ switch (cp) {
820
+ case $.AMPERSAND: {
821
+ this._startCharacterReference();
822
+ break;
823
+ }
824
+ case $.LESS_THAN_SIGN: {
825
+ this.state = State.RCDATA_LESS_THAN_SIGN;
826
+ break;
827
+ }
828
+ case $.NULL: {
829
+ this._err(ERR.unexpectedNullCharacter);
830
+ this._emitChars(REPLACEMENT_CHARACTER);
831
+ break;
832
+ }
833
+ case $.EOF: {
834
+ this._emitEOFToken();
835
+ break;
836
+ }
837
+ default: {
838
+ this._emitCodePoint(cp);
839
+ }
840
+ }
841
+ }
842
+ // RAWTEXT state
843
+ //------------------------------------------------------------------
844
+ _stateRawtext(cp) {
845
+ switch (cp) {
846
+ case $.LESS_THAN_SIGN: {
847
+ this.state = State.RAWTEXT_LESS_THAN_SIGN;
848
+ break;
849
+ }
850
+ case $.NULL: {
851
+ this._err(ERR.unexpectedNullCharacter);
852
+ this._emitChars(REPLACEMENT_CHARACTER);
853
+ break;
854
+ }
855
+ case $.EOF: {
856
+ this._emitEOFToken();
857
+ break;
858
+ }
859
+ default: {
860
+ this._emitCodePoint(cp);
861
+ }
862
+ }
863
+ }
864
+ // Script data state
865
+ //------------------------------------------------------------------
866
+ _stateScriptData(cp) {
867
+ switch (cp) {
868
+ case $.LESS_THAN_SIGN: {
869
+ this.state = State.SCRIPT_DATA_LESS_THAN_SIGN;
870
+ break;
871
+ }
872
+ case $.NULL: {
873
+ this._err(ERR.unexpectedNullCharacter);
874
+ this._emitChars(REPLACEMENT_CHARACTER);
875
+ break;
876
+ }
877
+ case $.EOF: {
878
+ this._emitEOFToken();
879
+ break;
880
+ }
881
+ default: {
882
+ this._emitCodePoint(cp);
883
+ }
884
+ }
885
+ }
886
+ // PLAINTEXT state
887
+ //------------------------------------------------------------------
888
+ _statePlaintext(cp) {
889
+ switch (cp) {
890
+ case $.NULL: {
891
+ this._err(ERR.unexpectedNullCharacter);
892
+ this._emitChars(REPLACEMENT_CHARACTER);
893
+ break;
894
+ }
895
+ case $.EOF: {
896
+ this._emitEOFToken();
897
+ break;
898
+ }
899
+ default: {
900
+ this._emitCodePoint(cp);
901
+ }
902
+ }
903
+ }
904
+ // Tag open state
905
+ //------------------------------------------------------------------
906
+ _stateTagOpen(cp) {
907
+ if (isAsciiLetter(cp)) {
908
+ this._createStartTagToken();
909
+ this.state = State.TAG_NAME;
910
+ this._stateTagName(cp);
911
+ }
912
+ else
913
+ switch (cp) {
914
+ case $.EXCLAMATION_MARK: {
915
+ this.state = State.MARKUP_DECLARATION_OPEN;
916
+ break;
917
+ }
918
+ case $.SOLIDUS: {
919
+ this.state = State.END_TAG_OPEN;
920
+ break;
921
+ }
922
+ case $.QUESTION_MARK: {
923
+ this._err(ERR.unexpectedQuestionMarkInsteadOfTagName);
924
+ this._createCommentToken(1);
925
+ this.state = State.BOGUS_COMMENT;
926
+ this._stateBogusComment(cp);
927
+ break;
928
+ }
929
+ case $.EOF: {
930
+ this._err(ERR.eofBeforeTagName);
931
+ this._emitChars('<');
932
+ this._emitEOFToken();
933
+ break;
934
+ }
935
+ default: {
936
+ this._err(ERR.invalidFirstCharacterOfTagName);
937
+ this._emitChars('<');
938
+ this.state = State.DATA;
939
+ this._stateData(cp);
940
+ }
941
+ }
942
+ }
943
+ // End tag open state
944
+ //------------------------------------------------------------------
945
+ _stateEndTagOpen(cp) {
946
+ if (isAsciiLetter(cp)) {
947
+ this._createEndTagToken();
948
+ this.state = State.TAG_NAME;
949
+ this._stateTagName(cp);
950
+ }
951
+ else
952
+ switch (cp) {
953
+ case $.GREATER_THAN_SIGN: {
954
+ this._err(ERR.missingEndTagName);
955
+ this.state = State.DATA;
956
+ break;
957
+ }
958
+ case $.EOF: {
959
+ this._err(ERR.eofBeforeTagName);
960
+ this._emitChars('</');
961
+ this._emitEOFToken();
962
+ break;
963
+ }
964
+ default: {
965
+ this._err(ERR.invalidFirstCharacterOfTagName);
966
+ this._createCommentToken(2);
967
+ this.state = State.BOGUS_COMMENT;
968
+ this._stateBogusComment(cp);
969
+ }
970
+ }
971
+ }
972
+ // Tag name state
973
+ //------------------------------------------------------------------
974
+ _stateTagName(cp) {
975
+ const token = this.currentToken;
976
+ switch (cp) {
977
+ case $.SPACE:
978
+ case $.LINE_FEED:
979
+ case $.TABULATION:
980
+ case $.FORM_FEED: {
981
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
982
+ break;
983
+ }
984
+ case $.SOLIDUS: {
985
+ this.state = State.SELF_CLOSING_START_TAG;
986
+ break;
987
+ }
988
+ case $.GREATER_THAN_SIGN: {
989
+ this.state = State.DATA;
990
+ this.emitCurrentTagToken();
991
+ break;
992
+ }
993
+ case $.NULL: {
994
+ this._err(ERR.unexpectedNullCharacter);
995
+ token.tagName += REPLACEMENT_CHARACTER;
996
+ break;
997
+ }
998
+ case $.EOF: {
999
+ this._err(ERR.eofInTag);
1000
+ this._emitEOFToken();
1001
+ break;
1002
+ }
1003
+ default: {
1004
+ token.tagName += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
1005
+ }
1006
+ }
1007
+ }
1008
+ // RCDATA less-than sign state
1009
+ //------------------------------------------------------------------
1010
+ _stateRcdataLessThanSign(cp) {
1011
+ if (cp === $.SOLIDUS) {
1012
+ this.state = State.RCDATA_END_TAG_OPEN;
1013
+ }
1014
+ else {
1015
+ this._emitChars('<');
1016
+ this.state = State.RCDATA;
1017
+ this._stateRcdata(cp);
1018
+ }
1019
+ }
1020
+ // RCDATA end tag open state
1021
+ //------------------------------------------------------------------
1022
+ _stateRcdataEndTagOpen(cp) {
1023
+ if (isAsciiLetter(cp)) {
1024
+ this.state = State.RCDATA_END_TAG_NAME;
1025
+ this._stateRcdataEndTagName(cp);
1026
+ }
1027
+ else {
1028
+ this._emitChars('</');
1029
+ this.state = State.RCDATA;
1030
+ this._stateRcdata(cp);
1031
+ }
1032
+ }
1033
+ handleSpecialEndTag(_cp) {
1034
+ if (!this.preprocessor.startsWith(this.lastStartTagName, false)) {
1035
+ return !this._ensureHibernation();
1036
+ }
1037
+ this._createEndTagToken();
1038
+ const token = this.currentToken;
1039
+ token.tagName = this.lastStartTagName;
1040
+ const cp = this.preprocessor.peek(this.lastStartTagName.length);
1041
+ switch (cp) {
1042
+ case $.SPACE:
1043
+ case $.LINE_FEED:
1044
+ case $.TABULATION:
1045
+ case $.FORM_FEED: {
1046
+ this._advanceBy(this.lastStartTagName.length);
1047
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
1048
+ return false;
1049
+ }
1050
+ case $.SOLIDUS: {
1051
+ this._advanceBy(this.lastStartTagName.length);
1052
+ this.state = State.SELF_CLOSING_START_TAG;
1053
+ return false;
1054
+ }
1055
+ case $.GREATER_THAN_SIGN: {
1056
+ this._advanceBy(this.lastStartTagName.length);
1057
+ this.emitCurrentTagToken();
1058
+ this.state = State.DATA;
1059
+ return false;
1060
+ }
1061
+ default: {
1062
+ return !this._ensureHibernation();
1063
+ }
1064
+ }
1065
+ }
1066
+ // RCDATA end tag name state
1067
+ //------------------------------------------------------------------
1068
+ _stateRcdataEndTagName(cp) {
1069
+ if (this.handleSpecialEndTag(cp)) {
1070
+ this._emitChars('</');
1071
+ this.state = State.RCDATA;
1072
+ this._stateRcdata(cp);
1073
+ }
1074
+ }
1075
+ // RAWTEXT less-than sign state
1076
+ //------------------------------------------------------------------
1077
+ _stateRawtextLessThanSign(cp) {
1078
+ if (cp === $.SOLIDUS) {
1079
+ this.state = State.RAWTEXT_END_TAG_OPEN;
1080
+ }
1081
+ else {
1082
+ this._emitChars('<');
1083
+ this.state = State.RAWTEXT;
1084
+ this._stateRawtext(cp);
1085
+ }
1086
+ }
1087
+ // RAWTEXT end tag open state
1088
+ //------------------------------------------------------------------
1089
+ _stateRawtextEndTagOpen(cp) {
1090
+ if (isAsciiLetter(cp)) {
1091
+ this.state = State.RAWTEXT_END_TAG_NAME;
1092
+ this._stateRawtextEndTagName(cp);
1093
+ }
1094
+ else {
1095
+ this._emitChars('</');
1096
+ this.state = State.RAWTEXT;
1097
+ this._stateRawtext(cp);
1098
+ }
1099
+ }
1100
+ // RAWTEXT end tag name state
1101
+ //------------------------------------------------------------------
1102
+ _stateRawtextEndTagName(cp) {
1103
+ if (this.handleSpecialEndTag(cp)) {
1104
+ this._emitChars('</');
1105
+ this.state = State.RAWTEXT;
1106
+ this._stateRawtext(cp);
1107
+ }
1108
+ }
1109
+ // Script data less-than sign state
1110
+ //------------------------------------------------------------------
1111
+ _stateScriptDataLessThanSign(cp) {
1112
+ switch (cp) {
1113
+ case $.SOLIDUS: {
1114
+ this.state = State.SCRIPT_DATA_END_TAG_OPEN;
1115
+ break;
1116
+ }
1117
+ case $.EXCLAMATION_MARK: {
1118
+ this.state = State.SCRIPT_DATA_ESCAPE_START;
1119
+ this._emitChars('<!');
1120
+ break;
1121
+ }
1122
+ default: {
1123
+ this._emitChars('<');
1124
+ this.state = State.SCRIPT_DATA;
1125
+ this._stateScriptData(cp);
1126
+ }
1127
+ }
1128
+ }
1129
+ // Script data end tag open state
1130
+ //------------------------------------------------------------------
1131
+ _stateScriptDataEndTagOpen(cp) {
1132
+ if (isAsciiLetter(cp)) {
1133
+ this.state = State.SCRIPT_DATA_END_TAG_NAME;
1134
+ this._stateScriptDataEndTagName(cp);
1135
+ }
1136
+ else {
1137
+ this._emitChars('</');
1138
+ this.state = State.SCRIPT_DATA;
1139
+ this._stateScriptData(cp);
1140
+ }
1141
+ }
1142
+ // Script data end tag name state
1143
+ //------------------------------------------------------------------
1144
+ _stateScriptDataEndTagName(cp) {
1145
+ if (this.handleSpecialEndTag(cp)) {
1146
+ this._emitChars('</');
1147
+ this.state = State.SCRIPT_DATA;
1148
+ this._stateScriptData(cp);
1149
+ }
1150
+ }
1151
+ // Script data escape start state
1152
+ //------------------------------------------------------------------
1153
+ _stateScriptDataEscapeStart(cp) {
1154
+ if (cp === $.HYPHEN_MINUS) {
1155
+ this.state = State.SCRIPT_DATA_ESCAPE_START_DASH;
1156
+ this._emitChars('-');
1157
+ }
1158
+ else {
1159
+ this.state = State.SCRIPT_DATA;
1160
+ this._stateScriptData(cp);
1161
+ }
1162
+ }
1163
+ // Script data escape start dash state
1164
+ //------------------------------------------------------------------
1165
+ _stateScriptDataEscapeStartDash(cp) {
1166
+ if (cp === $.HYPHEN_MINUS) {
1167
+ this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH;
1168
+ this._emitChars('-');
1169
+ }
1170
+ else {
1171
+ this.state = State.SCRIPT_DATA;
1172
+ this._stateScriptData(cp);
1173
+ }
1174
+ }
1175
+ // Script data escaped state
1176
+ //------------------------------------------------------------------
1177
+ _stateScriptDataEscaped(cp) {
1178
+ switch (cp) {
1179
+ case $.HYPHEN_MINUS: {
1180
+ this.state = State.SCRIPT_DATA_ESCAPED_DASH;
1181
+ this._emitChars('-');
1182
+ break;
1183
+ }
1184
+ case $.LESS_THAN_SIGN: {
1185
+ this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
1186
+ break;
1187
+ }
1188
+ case $.NULL: {
1189
+ this._err(ERR.unexpectedNullCharacter);
1190
+ this._emitChars(REPLACEMENT_CHARACTER);
1191
+ break;
1192
+ }
1193
+ case $.EOF: {
1194
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1195
+ this._emitEOFToken();
1196
+ break;
1197
+ }
1198
+ default: {
1199
+ this._emitCodePoint(cp);
1200
+ }
1201
+ }
1202
+ }
1203
+ // Script data escaped dash state
1204
+ //------------------------------------------------------------------
1205
+ _stateScriptDataEscapedDash(cp) {
1206
+ switch (cp) {
1207
+ case $.HYPHEN_MINUS: {
1208
+ this.state = State.SCRIPT_DATA_ESCAPED_DASH_DASH;
1209
+ this._emitChars('-');
1210
+ break;
1211
+ }
1212
+ case $.LESS_THAN_SIGN: {
1213
+ this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
1214
+ break;
1215
+ }
1216
+ case $.NULL: {
1217
+ this._err(ERR.unexpectedNullCharacter);
1218
+ this.state = State.SCRIPT_DATA_ESCAPED;
1219
+ this._emitChars(REPLACEMENT_CHARACTER);
1220
+ break;
1221
+ }
1222
+ case $.EOF: {
1223
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1224
+ this._emitEOFToken();
1225
+ break;
1226
+ }
1227
+ default: {
1228
+ this.state = State.SCRIPT_DATA_ESCAPED;
1229
+ this._emitCodePoint(cp);
1230
+ }
1231
+ }
1232
+ }
1233
+ // Script data escaped dash dash state
1234
+ //------------------------------------------------------------------
1235
+ _stateScriptDataEscapedDashDash(cp) {
1236
+ switch (cp) {
1237
+ case $.HYPHEN_MINUS: {
1238
+ this._emitChars('-');
1239
+ break;
1240
+ }
1241
+ case $.LESS_THAN_SIGN: {
1242
+ this.state = State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
1243
+ break;
1244
+ }
1245
+ case $.GREATER_THAN_SIGN: {
1246
+ this.state = State.SCRIPT_DATA;
1247
+ this._emitChars('>');
1248
+ break;
1249
+ }
1250
+ case $.NULL: {
1251
+ this._err(ERR.unexpectedNullCharacter);
1252
+ this.state = State.SCRIPT_DATA_ESCAPED;
1253
+ this._emitChars(REPLACEMENT_CHARACTER);
1254
+ break;
1255
+ }
1256
+ case $.EOF: {
1257
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1258
+ this._emitEOFToken();
1259
+ break;
1260
+ }
1261
+ default: {
1262
+ this.state = State.SCRIPT_DATA_ESCAPED;
1263
+ this._emitCodePoint(cp);
1264
+ }
1265
+ }
1266
+ }
1267
+ // Script data escaped less-than sign state
1268
+ //------------------------------------------------------------------
1269
+ _stateScriptDataEscapedLessThanSign(cp) {
1270
+ if (cp === $.SOLIDUS) {
1271
+ this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;
1272
+ }
1273
+ else if (isAsciiLetter(cp)) {
1274
+ this._emitChars('<');
1275
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START;
1276
+ this._stateScriptDataDoubleEscapeStart(cp);
1277
+ }
1278
+ else {
1279
+ this._emitChars('<');
1280
+ this.state = State.SCRIPT_DATA_ESCAPED;
1281
+ this._stateScriptDataEscaped(cp);
1282
+ }
1283
+ }
1284
+ // Script data escaped end tag open state
1285
+ //------------------------------------------------------------------
1286
+ _stateScriptDataEscapedEndTagOpen(cp) {
1287
+ if (isAsciiLetter(cp)) {
1288
+ this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME;
1289
+ this._stateScriptDataEscapedEndTagName(cp);
1290
+ }
1291
+ else {
1292
+ this._emitChars('</');
1293
+ this.state = State.SCRIPT_DATA_ESCAPED;
1294
+ this._stateScriptDataEscaped(cp);
1295
+ }
1296
+ }
1297
+ // Script data escaped end tag name state
1298
+ //------------------------------------------------------------------
1299
+ _stateScriptDataEscapedEndTagName(cp) {
1300
+ if (this.handleSpecialEndTag(cp)) {
1301
+ this._emitChars('</');
1302
+ this.state = State.SCRIPT_DATA_ESCAPED;
1303
+ this._stateScriptDataEscaped(cp);
1304
+ }
1305
+ }
1306
+ // Script data double escape start state
1307
+ //------------------------------------------------------------------
1308
+ _stateScriptDataDoubleEscapeStart(cp) {
1309
+ if (this.preprocessor.startsWith($$.SCRIPT, false) &&
1310
+ isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek($$.SCRIPT.length))) {
1311
+ this._emitCodePoint(cp);
1312
+ for (let i = 0; i < $$.SCRIPT.length; i++) {
1313
+ this._emitCodePoint(this._consume());
1314
+ }
1315
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1316
+ }
1317
+ else if (!this._ensureHibernation()) {
1318
+ this.state = State.SCRIPT_DATA_ESCAPED;
1319
+ this._stateScriptDataEscaped(cp);
1320
+ }
1321
+ }
1322
+ // Script data double escaped state
1323
+ //------------------------------------------------------------------
1324
+ _stateScriptDataDoubleEscaped(cp) {
1325
+ switch (cp) {
1326
+ case $.HYPHEN_MINUS: {
1327
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH;
1328
+ this._emitChars('-');
1329
+ break;
1330
+ }
1331
+ case $.LESS_THAN_SIGN: {
1332
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
1333
+ this._emitChars('<');
1334
+ break;
1335
+ }
1336
+ case $.NULL: {
1337
+ this._err(ERR.unexpectedNullCharacter);
1338
+ this._emitChars(REPLACEMENT_CHARACTER);
1339
+ break;
1340
+ }
1341
+ case $.EOF: {
1342
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1343
+ this._emitEOFToken();
1344
+ break;
1345
+ }
1346
+ default: {
1347
+ this._emitCodePoint(cp);
1348
+ }
1349
+ }
1350
+ }
1351
+ // Script data double escaped dash state
1352
+ //------------------------------------------------------------------
1353
+ _stateScriptDataDoubleEscapedDash(cp) {
1354
+ switch (cp) {
1355
+ case $.HYPHEN_MINUS: {
1356
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH;
1357
+ this._emitChars('-');
1358
+ break;
1359
+ }
1360
+ case $.LESS_THAN_SIGN: {
1361
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
1362
+ this._emitChars('<');
1363
+ break;
1364
+ }
1365
+ case $.NULL: {
1366
+ this._err(ERR.unexpectedNullCharacter);
1367
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1368
+ this._emitChars(REPLACEMENT_CHARACTER);
1369
+ break;
1370
+ }
1371
+ case $.EOF: {
1372
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1373
+ this._emitEOFToken();
1374
+ break;
1375
+ }
1376
+ default: {
1377
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1378
+ this._emitCodePoint(cp);
1379
+ }
1380
+ }
1381
+ }
1382
+ // Script data double escaped dash dash state
1383
+ //------------------------------------------------------------------
1384
+ _stateScriptDataDoubleEscapedDashDash(cp) {
1385
+ switch (cp) {
1386
+ case $.HYPHEN_MINUS: {
1387
+ this._emitChars('-');
1388
+ break;
1389
+ }
1390
+ case $.LESS_THAN_SIGN: {
1391
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
1392
+ this._emitChars('<');
1393
+ break;
1394
+ }
1395
+ case $.GREATER_THAN_SIGN: {
1396
+ this.state = State.SCRIPT_DATA;
1397
+ this._emitChars('>');
1398
+ break;
1399
+ }
1400
+ case $.NULL: {
1401
+ this._err(ERR.unexpectedNullCharacter);
1402
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1403
+ this._emitChars(REPLACEMENT_CHARACTER);
1404
+ break;
1405
+ }
1406
+ case $.EOF: {
1407
+ this._err(ERR.eofInScriptHtmlCommentLikeText);
1408
+ this._emitEOFToken();
1409
+ break;
1410
+ }
1411
+ default: {
1412
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1413
+ this._emitCodePoint(cp);
1414
+ }
1415
+ }
1416
+ }
1417
+ // Script data double escaped less-than sign state
1418
+ //------------------------------------------------------------------
1419
+ _stateScriptDataDoubleEscapedLessThanSign(cp) {
1420
+ if (cp === $.SOLIDUS) {
1421
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_END;
1422
+ this._emitChars('/');
1423
+ }
1424
+ else {
1425
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1426
+ this._stateScriptDataDoubleEscaped(cp);
1427
+ }
1428
+ }
1429
+ // Script data double escape end state
1430
+ //------------------------------------------------------------------
1431
+ _stateScriptDataDoubleEscapeEnd(cp) {
1432
+ if (this.preprocessor.startsWith($$.SCRIPT, false) &&
1433
+ isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek($$.SCRIPT.length))) {
1434
+ this._emitCodePoint(cp);
1435
+ for (let i = 0; i < $$.SCRIPT.length; i++) {
1436
+ this._emitCodePoint(this._consume());
1437
+ }
1438
+ this.state = State.SCRIPT_DATA_ESCAPED;
1439
+ }
1440
+ else if (!this._ensureHibernation()) {
1441
+ this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
1442
+ this._stateScriptDataDoubleEscaped(cp);
1443
+ }
1444
+ }
1445
+ // Before attribute name state
1446
+ //------------------------------------------------------------------
1447
+ _stateBeforeAttributeName(cp) {
1448
+ switch (cp) {
1449
+ case $.SPACE:
1450
+ case $.LINE_FEED:
1451
+ case $.TABULATION:
1452
+ case $.FORM_FEED: {
1453
+ // Ignore whitespace
1454
+ break;
1455
+ }
1456
+ case $.SOLIDUS:
1457
+ case $.GREATER_THAN_SIGN:
1458
+ case $.EOF: {
1459
+ this.state = State.AFTER_ATTRIBUTE_NAME;
1460
+ this._stateAfterAttributeName(cp);
1461
+ break;
1462
+ }
1463
+ case $.EQUALS_SIGN: {
1464
+ this._err(ERR.unexpectedEqualsSignBeforeAttributeName);
1465
+ this._createAttr('=');
1466
+ this.state = State.ATTRIBUTE_NAME;
1467
+ break;
1468
+ }
1469
+ default: {
1470
+ this._createAttr('');
1471
+ this.state = State.ATTRIBUTE_NAME;
1472
+ this._stateAttributeName(cp);
1473
+ }
1474
+ }
1475
+ }
1476
+ // Attribute name state
1477
+ //------------------------------------------------------------------
1478
+ _stateAttributeName(cp) {
1479
+ switch (cp) {
1480
+ case $.SPACE:
1481
+ case $.LINE_FEED:
1482
+ case $.TABULATION:
1483
+ case $.FORM_FEED:
1484
+ case $.SOLIDUS:
1485
+ case $.GREATER_THAN_SIGN:
1486
+ case $.EOF: {
1487
+ this._leaveAttrName();
1488
+ this.state = State.AFTER_ATTRIBUTE_NAME;
1489
+ this._stateAfterAttributeName(cp);
1490
+ break;
1491
+ }
1492
+ case $.EQUALS_SIGN: {
1493
+ this._leaveAttrName();
1494
+ this.state = State.BEFORE_ATTRIBUTE_VALUE;
1495
+ break;
1496
+ }
1497
+ case $.QUOTATION_MARK:
1498
+ case $.APOSTROPHE:
1499
+ case $.LESS_THAN_SIGN: {
1500
+ this._err(ERR.unexpectedCharacterInAttributeName);
1501
+ this.currentAttr.name += String.fromCodePoint(cp);
1502
+ break;
1503
+ }
1504
+ case $.NULL: {
1505
+ this._err(ERR.unexpectedNullCharacter);
1506
+ this.currentAttr.name += REPLACEMENT_CHARACTER;
1507
+ break;
1508
+ }
1509
+ default: {
1510
+ this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
1511
+ }
1512
+ }
1513
+ }
1514
+ // After attribute name state
1515
+ //------------------------------------------------------------------
1516
+ _stateAfterAttributeName(cp) {
1517
+ switch (cp) {
1518
+ case $.SPACE:
1519
+ case $.LINE_FEED:
1520
+ case $.TABULATION:
1521
+ case $.FORM_FEED: {
1522
+ // Ignore whitespace
1523
+ break;
1524
+ }
1525
+ case $.SOLIDUS: {
1526
+ this.state = State.SELF_CLOSING_START_TAG;
1527
+ break;
1528
+ }
1529
+ case $.EQUALS_SIGN: {
1530
+ this.state = State.BEFORE_ATTRIBUTE_VALUE;
1531
+ break;
1532
+ }
1533
+ case $.GREATER_THAN_SIGN: {
1534
+ this.state = State.DATA;
1535
+ this.emitCurrentTagToken();
1536
+ break;
1537
+ }
1538
+ case $.EOF: {
1539
+ this._err(ERR.eofInTag);
1540
+ this._emitEOFToken();
1541
+ break;
1542
+ }
1543
+ default: {
1544
+ this._createAttr('');
1545
+ this.state = State.ATTRIBUTE_NAME;
1546
+ this._stateAttributeName(cp);
1547
+ }
1548
+ }
1549
+ }
1550
+ // Before attribute value state
1551
+ //------------------------------------------------------------------
1552
+ _stateBeforeAttributeValue(cp) {
1553
+ switch (cp) {
1554
+ case $.SPACE:
1555
+ case $.LINE_FEED:
1556
+ case $.TABULATION:
1557
+ case $.FORM_FEED: {
1558
+ // Ignore whitespace
1559
+ break;
1560
+ }
1561
+ case $.QUOTATION_MARK: {
1562
+ this.state = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
1563
+ break;
1564
+ }
1565
+ case $.APOSTROPHE: {
1566
+ this.state = State.ATTRIBUTE_VALUE_SINGLE_QUOTED;
1567
+ break;
1568
+ }
1569
+ case $.GREATER_THAN_SIGN: {
1570
+ this._err(ERR.missingAttributeValue);
1571
+ this.state = State.DATA;
1572
+ this.emitCurrentTagToken();
1573
+ break;
1574
+ }
1575
+ default: {
1576
+ this.state = State.ATTRIBUTE_VALUE_UNQUOTED;
1577
+ this._stateAttributeValueUnquoted(cp);
1578
+ }
1579
+ }
1580
+ }
1581
+ // Attribute value (double-quoted) state
1582
+ //------------------------------------------------------------------
1583
+ _stateAttributeValueDoubleQuoted(cp) {
1584
+ switch (cp) {
1585
+ case $.QUOTATION_MARK: {
1586
+ this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
1587
+ break;
1588
+ }
1589
+ case $.AMPERSAND: {
1590
+ this._startCharacterReference();
1591
+ break;
1592
+ }
1593
+ case $.NULL: {
1594
+ this._err(ERR.unexpectedNullCharacter);
1595
+ this.currentAttr.value += REPLACEMENT_CHARACTER;
1596
+ break;
1597
+ }
1598
+ case $.EOF: {
1599
+ this._err(ERR.eofInTag);
1600
+ this._emitEOFToken();
1601
+ break;
1602
+ }
1603
+ default: {
1604
+ this.currentAttr.value += String.fromCodePoint(cp);
1605
+ }
1606
+ }
1607
+ }
1608
+ // Attribute value (single-quoted) state
1609
+ //------------------------------------------------------------------
1610
+ _stateAttributeValueSingleQuoted(cp) {
1611
+ switch (cp) {
1612
+ case $.APOSTROPHE: {
1613
+ this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
1614
+ break;
1615
+ }
1616
+ case $.AMPERSAND: {
1617
+ this._startCharacterReference();
1618
+ break;
1619
+ }
1620
+ case $.NULL: {
1621
+ this._err(ERR.unexpectedNullCharacter);
1622
+ this.currentAttr.value += REPLACEMENT_CHARACTER;
1623
+ break;
1624
+ }
1625
+ case $.EOF: {
1626
+ this._err(ERR.eofInTag);
1627
+ this._emitEOFToken();
1628
+ break;
1629
+ }
1630
+ default: {
1631
+ this.currentAttr.value += String.fromCodePoint(cp);
1632
+ }
1633
+ }
1634
+ }
1635
+ // Attribute value (unquoted) state
1636
+ //------------------------------------------------------------------
1637
+ _stateAttributeValueUnquoted(cp) {
1638
+ switch (cp) {
1639
+ case $.SPACE:
1640
+ case $.LINE_FEED:
1641
+ case $.TABULATION:
1642
+ case $.FORM_FEED: {
1643
+ this._leaveAttrValue();
1644
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
1645
+ break;
1646
+ }
1647
+ case $.AMPERSAND: {
1648
+ this._startCharacterReference();
1649
+ break;
1650
+ }
1651
+ case $.GREATER_THAN_SIGN: {
1652
+ this._leaveAttrValue();
1653
+ this.state = State.DATA;
1654
+ this.emitCurrentTagToken();
1655
+ break;
1656
+ }
1657
+ case $.NULL: {
1658
+ this._err(ERR.unexpectedNullCharacter);
1659
+ this.currentAttr.value += REPLACEMENT_CHARACTER;
1660
+ break;
1661
+ }
1662
+ case $.QUOTATION_MARK:
1663
+ case $.APOSTROPHE:
1664
+ case $.LESS_THAN_SIGN:
1665
+ case $.EQUALS_SIGN:
1666
+ case $.GRAVE_ACCENT: {
1667
+ this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);
1668
+ this.currentAttr.value += String.fromCodePoint(cp);
1669
+ break;
1670
+ }
1671
+ case $.EOF: {
1672
+ this._err(ERR.eofInTag);
1673
+ this._emitEOFToken();
1674
+ break;
1675
+ }
1676
+ default: {
1677
+ this.currentAttr.value += String.fromCodePoint(cp);
1678
+ }
1679
+ }
1680
+ }
1681
+ // After attribute value (quoted) state
1682
+ //------------------------------------------------------------------
1683
+ _stateAfterAttributeValueQuoted(cp) {
1684
+ switch (cp) {
1685
+ case $.SPACE:
1686
+ case $.LINE_FEED:
1687
+ case $.TABULATION:
1688
+ case $.FORM_FEED: {
1689
+ this._leaveAttrValue();
1690
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
1691
+ break;
1692
+ }
1693
+ case $.SOLIDUS: {
1694
+ this._leaveAttrValue();
1695
+ this.state = State.SELF_CLOSING_START_TAG;
1696
+ break;
1697
+ }
1698
+ case $.GREATER_THAN_SIGN: {
1699
+ this._leaveAttrValue();
1700
+ this.state = State.DATA;
1701
+ this.emitCurrentTagToken();
1702
+ break;
1703
+ }
1704
+ case $.EOF: {
1705
+ this._err(ERR.eofInTag);
1706
+ this._emitEOFToken();
1707
+ break;
1708
+ }
1709
+ default: {
1710
+ this._err(ERR.missingWhitespaceBetweenAttributes);
1711
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
1712
+ this._stateBeforeAttributeName(cp);
1713
+ }
1714
+ }
1715
+ }
1716
+ // Self-closing start tag state
1717
+ //------------------------------------------------------------------
1718
+ _stateSelfClosingStartTag(cp) {
1719
+ switch (cp) {
1720
+ case $.GREATER_THAN_SIGN: {
1721
+ const token = this.currentToken;
1722
+ token.selfClosing = true;
1723
+ this.state = State.DATA;
1724
+ this.emitCurrentTagToken();
1725
+ break;
1726
+ }
1727
+ case $.EOF: {
1728
+ this._err(ERR.eofInTag);
1729
+ this._emitEOFToken();
1730
+ break;
1731
+ }
1732
+ default: {
1733
+ this._err(ERR.unexpectedSolidusInTag);
1734
+ this.state = State.BEFORE_ATTRIBUTE_NAME;
1735
+ this._stateBeforeAttributeName(cp);
1736
+ }
1737
+ }
1738
+ }
1739
+ // Bogus comment state
1740
+ //------------------------------------------------------------------
1741
+ _stateBogusComment(cp) {
1742
+ const token = this.currentToken;
1743
+ switch (cp) {
1744
+ case $.GREATER_THAN_SIGN: {
1745
+ this.state = State.DATA;
1746
+ this.emitCurrentComment(token);
1747
+ break;
1748
+ }
1749
+ case $.EOF: {
1750
+ this.emitCurrentComment(token);
1751
+ this._emitEOFToken();
1752
+ break;
1753
+ }
1754
+ case $.NULL: {
1755
+ this._err(ERR.unexpectedNullCharacter);
1756
+ token.data += REPLACEMENT_CHARACTER;
1757
+ break;
1758
+ }
1759
+ default: {
1760
+ token.data += String.fromCodePoint(cp);
1761
+ }
1762
+ }
1763
+ }
1764
+ // Markup declaration open state
1765
+ //------------------------------------------------------------------
1766
+ _stateMarkupDeclarationOpen(cp) {
1767
+ if (this._consumeSequenceIfMatch($$.DASH_DASH, true)) {
1768
+ this._createCommentToken($$.DASH_DASH.length + 1);
1769
+ this.state = State.COMMENT_START;
1770
+ }
1771
+ else if (this._consumeSequenceIfMatch($$.DOCTYPE, false)) {
1772
+ // NOTE: Doctypes tokens are created without fixed offsets. We keep track of the moment a doctype *might* start here.
1773
+ this.currentLocation = this.getCurrentLocation($$.DOCTYPE.length + 1);
1774
+ this.state = State.DOCTYPE;
1775
+ }
1776
+ else if (this._consumeSequenceIfMatch($$.CDATA_START, true)) {
1777
+ if (this.inForeignNode) {
1778
+ this.state = State.CDATA_SECTION;
1779
+ }
1780
+ else {
1781
+ this._err(ERR.cdataInHtmlContent);
1782
+ this._createCommentToken($$.CDATA_START.length + 1);
1783
+ this.currentToken.data = '[CDATA[';
1784
+ this.state = State.BOGUS_COMMENT;
1785
+ }
1786
+ }
1787
+ //NOTE: Sequence lookups can be abrupted by hibernation. In that case, lookup
1788
+ //results are no longer valid and we will need to start over.
1789
+ else if (!this._ensureHibernation()) {
1790
+ this._err(ERR.incorrectlyOpenedComment);
1791
+ this._createCommentToken(2);
1792
+ this.state = State.BOGUS_COMMENT;
1793
+ this._stateBogusComment(cp);
1794
+ }
1795
+ }
1796
+ // Comment start state
1797
+ //------------------------------------------------------------------
1798
+ _stateCommentStart(cp) {
1799
+ switch (cp) {
1800
+ case $.HYPHEN_MINUS: {
1801
+ this.state = State.COMMENT_START_DASH;
1802
+ break;
1803
+ }
1804
+ case $.GREATER_THAN_SIGN: {
1805
+ this._err(ERR.abruptClosingOfEmptyComment);
1806
+ this.state = State.DATA;
1807
+ const token = this.currentToken;
1808
+ this.emitCurrentComment(token);
1809
+ break;
1810
+ }
1811
+ default: {
1812
+ this.state = State.COMMENT;
1813
+ this._stateComment(cp);
1814
+ }
1815
+ }
1816
+ }
1817
+ // Comment start dash state
1818
+ //------------------------------------------------------------------
1819
+ _stateCommentStartDash(cp) {
1820
+ const token = this.currentToken;
1821
+ switch (cp) {
1822
+ case $.HYPHEN_MINUS: {
1823
+ this.state = State.COMMENT_END;
1824
+ break;
1825
+ }
1826
+ case $.GREATER_THAN_SIGN: {
1827
+ this._err(ERR.abruptClosingOfEmptyComment);
1828
+ this.state = State.DATA;
1829
+ this.emitCurrentComment(token);
1830
+ break;
1831
+ }
1832
+ case $.EOF: {
1833
+ this._err(ERR.eofInComment);
1834
+ this.emitCurrentComment(token);
1835
+ this._emitEOFToken();
1836
+ break;
1837
+ }
1838
+ default: {
1839
+ token.data += '-';
1840
+ this.state = State.COMMENT;
1841
+ this._stateComment(cp);
1842
+ }
1843
+ }
1844
+ }
1845
+ // Comment state
1846
+ //------------------------------------------------------------------
1847
+ _stateComment(cp) {
1848
+ const token = this.currentToken;
1849
+ switch (cp) {
1850
+ case $.HYPHEN_MINUS: {
1851
+ this.state = State.COMMENT_END_DASH;
1852
+ break;
1853
+ }
1854
+ case $.LESS_THAN_SIGN: {
1855
+ token.data += '<';
1856
+ this.state = State.COMMENT_LESS_THAN_SIGN;
1857
+ break;
1858
+ }
1859
+ case $.NULL: {
1860
+ this._err(ERR.unexpectedNullCharacter);
1861
+ token.data += REPLACEMENT_CHARACTER;
1862
+ break;
1863
+ }
1864
+ case $.EOF: {
1865
+ this._err(ERR.eofInComment);
1866
+ this.emitCurrentComment(token);
1867
+ this._emitEOFToken();
1868
+ break;
1869
+ }
1870
+ default: {
1871
+ token.data += String.fromCodePoint(cp);
1872
+ }
1873
+ }
1874
+ }
1875
+ // Comment less-than sign state
1876
+ //------------------------------------------------------------------
1877
+ _stateCommentLessThanSign(cp) {
1878
+ const token = this.currentToken;
1879
+ switch (cp) {
1880
+ case $.EXCLAMATION_MARK: {
1881
+ token.data += '!';
1882
+ this.state = State.COMMENT_LESS_THAN_SIGN_BANG;
1883
+ break;
1884
+ }
1885
+ case $.LESS_THAN_SIGN: {
1886
+ token.data += '<';
1887
+ break;
1888
+ }
1889
+ default: {
1890
+ this.state = State.COMMENT;
1891
+ this._stateComment(cp);
1892
+ }
1893
+ }
1894
+ }
1895
+ // Comment less-than sign bang state
1896
+ //------------------------------------------------------------------
1897
+ _stateCommentLessThanSignBang(cp) {
1898
+ if (cp === $.HYPHEN_MINUS) {
1899
+ this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH;
1900
+ }
1901
+ else {
1902
+ this.state = State.COMMENT;
1903
+ this._stateComment(cp);
1904
+ }
1905
+ }
1906
+ // Comment less-than sign bang dash state
1907
+ //------------------------------------------------------------------
1908
+ _stateCommentLessThanSignBangDash(cp) {
1909
+ if (cp === $.HYPHEN_MINUS) {
1910
+ this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH;
1911
+ }
1912
+ else {
1913
+ this.state = State.COMMENT_END_DASH;
1914
+ this._stateCommentEndDash(cp);
1915
+ }
1916
+ }
1917
+ // Comment less-than sign bang dash dash state
1918
+ //------------------------------------------------------------------
1919
+ _stateCommentLessThanSignBangDashDash(cp) {
1920
+ if (cp !== $.GREATER_THAN_SIGN && cp !== $.EOF) {
1921
+ this._err(ERR.nestedComment);
1922
+ }
1923
+ this.state = State.COMMENT_END;
1924
+ this._stateCommentEnd(cp);
1925
+ }
1926
+ // Comment end dash state
1927
+ //------------------------------------------------------------------
1928
+ _stateCommentEndDash(cp) {
1929
+ const token = this.currentToken;
1930
+ switch (cp) {
1931
+ case $.HYPHEN_MINUS: {
1932
+ this.state = State.COMMENT_END;
1933
+ break;
1934
+ }
1935
+ case $.EOF: {
1936
+ this._err(ERR.eofInComment);
1937
+ this.emitCurrentComment(token);
1938
+ this._emitEOFToken();
1939
+ break;
1940
+ }
1941
+ default: {
1942
+ token.data += '-';
1943
+ this.state = State.COMMENT;
1944
+ this._stateComment(cp);
1945
+ }
1946
+ }
1947
+ }
1948
+ // Comment end state
1949
+ //------------------------------------------------------------------
1950
+ _stateCommentEnd(cp) {
1951
+ const token = this.currentToken;
1952
+ switch (cp) {
1953
+ case $.GREATER_THAN_SIGN: {
1954
+ this.state = State.DATA;
1955
+ this.emitCurrentComment(token);
1956
+ break;
1957
+ }
1958
+ case $.EXCLAMATION_MARK: {
1959
+ this.state = State.COMMENT_END_BANG;
1960
+ break;
1961
+ }
1962
+ case $.HYPHEN_MINUS: {
1963
+ token.data += '-';
1964
+ break;
1965
+ }
1966
+ case $.EOF: {
1967
+ this._err(ERR.eofInComment);
1968
+ this.emitCurrentComment(token);
1969
+ this._emitEOFToken();
1970
+ break;
1971
+ }
1972
+ default: {
1973
+ token.data += '--';
1974
+ this.state = State.COMMENT;
1975
+ this._stateComment(cp);
1976
+ }
1977
+ }
1978
+ }
1979
+ // Comment end bang state
1980
+ //------------------------------------------------------------------
1981
+ _stateCommentEndBang(cp) {
1982
+ const token = this.currentToken;
1983
+ switch (cp) {
1984
+ case $.HYPHEN_MINUS: {
1985
+ token.data += '--!';
1986
+ this.state = State.COMMENT_END_DASH;
1987
+ break;
1988
+ }
1989
+ case $.GREATER_THAN_SIGN: {
1990
+ this._err(ERR.incorrectlyClosedComment);
1991
+ this.state = State.DATA;
1992
+ this.emitCurrentComment(token);
1993
+ break;
1994
+ }
1995
+ case $.EOF: {
1996
+ this._err(ERR.eofInComment);
1997
+ this.emitCurrentComment(token);
1998
+ this._emitEOFToken();
1999
+ break;
2000
+ }
2001
+ default: {
2002
+ token.data += '--!';
2003
+ this.state = State.COMMENT;
2004
+ this._stateComment(cp);
2005
+ }
2006
+ }
2007
+ }
2008
+ // DOCTYPE state
2009
+ //------------------------------------------------------------------
2010
+ _stateDoctype(cp) {
2011
+ switch (cp) {
2012
+ case $.SPACE:
2013
+ case $.LINE_FEED:
2014
+ case $.TABULATION:
2015
+ case $.FORM_FEED: {
2016
+ this.state = State.BEFORE_DOCTYPE_NAME;
2017
+ break;
2018
+ }
2019
+ case $.GREATER_THAN_SIGN: {
2020
+ this.state = State.BEFORE_DOCTYPE_NAME;
2021
+ this._stateBeforeDoctypeName(cp);
2022
+ break;
2023
+ }
2024
+ case $.EOF: {
2025
+ this._err(ERR.eofInDoctype);
2026
+ this._createDoctypeToken(null);
2027
+ const token = this.currentToken;
2028
+ token.forceQuirks = true;
2029
+ this.emitCurrentDoctype(token);
2030
+ this._emitEOFToken();
2031
+ break;
2032
+ }
2033
+ default: {
2034
+ this._err(ERR.missingWhitespaceBeforeDoctypeName);
2035
+ this.state = State.BEFORE_DOCTYPE_NAME;
2036
+ this._stateBeforeDoctypeName(cp);
2037
+ }
2038
+ }
2039
+ }
2040
+ // Before DOCTYPE name state
2041
+ //------------------------------------------------------------------
2042
+ _stateBeforeDoctypeName(cp) {
2043
+ if (isAsciiUpper(cp)) {
2044
+ this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp)));
2045
+ this.state = State.DOCTYPE_NAME;
2046
+ }
2047
+ else
2048
+ switch (cp) {
2049
+ case $.SPACE:
2050
+ case $.LINE_FEED:
2051
+ case $.TABULATION:
2052
+ case $.FORM_FEED: {
2053
+ // Ignore whitespace
2054
+ break;
2055
+ }
2056
+ case $.NULL: {
2057
+ this._err(ERR.unexpectedNullCharacter);
2058
+ this._createDoctypeToken(REPLACEMENT_CHARACTER);
2059
+ this.state = State.DOCTYPE_NAME;
2060
+ break;
2061
+ }
2062
+ case $.GREATER_THAN_SIGN: {
2063
+ this._err(ERR.missingDoctypeName);
2064
+ this._createDoctypeToken(null);
2065
+ const token = this.currentToken;
2066
+ token.forceQuirks = true;
2067
+ this.emitCurrentDoctype(token);
2068
+ this.state = State.DATA;
2069
+ break;
2070
+ }
2071
+ case $.EOF: {
2072
+ this._err(ERR.eofInDoctype);
2073
+ this._createDoctypeToken(null);
2074
+ const token = this.currentToken;
2075
+ token.forceQuirks = true;
2076
+ this.emitCurrentDoctype(token);
2077
+ this._emitEOFToken();
2078
+ break;
2079
+ }
2080
+ default: {
2081
+ this._createDoctypeToken(String.fromCodePoint(cp));
2082
+ this.state = State.DOCTYPE_NAME;
2083
+ }
2084
+ }
2085
+ }
2086
+ // DOCTYPE name state
2087
+ //------------------------------------------------------------------
2088
+ _stateDoctypeName(cp) {
2089
+ const token = this.currentToken;
2090
+ switch (cp) {
2091
+ case $.SPACE:
2092
+ case $.LINE_FEED:
2093
+ case $.TABULATION:
2094
+ case $.FORM_FEED: {
2095
+ this.state = State.AFTER_DOCTYPE_NAME;
2096
+ break;
2097
+ }
2098
+ case $.GREATER_THAN_SIGN: {
2099
+ this.state = State.DATA;
2100
+ this.emitCurrentDoctype(token);
2101
+ break;
2102
+ }
2103
+ case $.NULL: {
2104
+ this._err(ERR.unexpectedNullCharacter);
2105
+ token.name += REPLACEMENT_CHARACTER;
2106
+ break;
2107
+ }
2108
+ case $.EOF: {
2109
+ this._err(ERR.eofInDoctype);
2110
+ token.forceQuirks = true;
2111
+ this.emitCurrentDoctype(token);
2112
+ this._emitEOFToken();
2113
+ break;
2114
+ }
2115
+ default: {
2116
+ token.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
2117
+ }
2118
+ }
2119
+ }
2120
+ // After DOCTYPE name state
2121
+ //------------------------------------------------------------------
2122
+ _stateAfterDoctypeName(cp) {
2123
+ const token = this.currentToken;
2124
+ switch (cp) {
2125
+ case $.SPACE:
2126
+ case $.LINE_FEED:
2127
+ case $.TABULATION:
2128
+ case $.FORM_FEED: {
2129
+ // Ignore whitespace
2130
+ break;
2131
+ }
2132
+ case $.GREATER_THAN_SIGN: {
2133
+ this.state = State.DATA;
2134
+ this.emitCurrentDoctype(token);
2135
+ break;
2136
+ }
2137
+ case $.EOF: {
2138
+ this._err(ERR.eofInDoctype);
2139
+ token.forceQuirks = true;
2140
+ this.emitCurrentDoctype(token);
2141
+ this._emitEOFToken();
2142
+ break;
2143
+ }
2144
+ default: {
2145
+ if (this._consumeSequenceIfMatch($$.PUBLIC, false)) {
2146
+ this.state = State.AFTER_DOCTYPE_PUBLIC_KEYWORD;
2147
+ }
2148
+ else if (this._consumeSequenceIfMatch($$.SYSTEM, false)) {
2149
+ this.state = State.AFTER_DOCTYPE_SYSTEM_KEYWORD;
2150
+ }
2151
+ //NOTE: sequence lookup can be abrupted by hibernation. In that case lookup
2152
+ //results are no longer valid and we will need to start over.
2153
+ else if (!this._ensureHibernation()) {
2154
+ this._err(ERR.invalidCharacterSequenceAfterDoctypeName);
2155
+ token.forceQuirks = true;
2156
+ this.state = State.BOGUS_DOCTYPE;
2157
+ this._stateBogusDoctype(cp);
2158
+ }
2159
+ }
2160
+ }
2161
+ }
2162
+ // After DOCTYPE public keyword state
2163
+ //------------------------------------------------------------------
2164
+ _stateAfterDoctypePublicKeyword(cp) {
2165
+ const token = this.currentToken;
2166
+ switch (cp) {
2167
+ case $.SPACE:
2168
+ case $.LINE_FEED:
2169
+ case $.TABULATION:
2170
+ case $.FORM_FEED: {
2171
+ this.state = State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
2172
+ break;
2173
+ }
2174
+ case $.QUOTATION_MARK: {
2175
+ this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
2176
+ token.publicId = '';
2177
+ this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
2178
+ break;
2179
+ }
2180
+ case $.APOSTROPHE: {
2181
+ this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
2182
+ token.publicId = '';
2183
+ this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
2184
+ break;
2185
+ }
2186
+ case $.GREATER_THAN_SIGN: {
2187
+ this._err(ERR.missingDoctypePublicIdentifier);
2188
+ token.forceQuirks = true;
2189
+ this.state = State.DATA;
2190
+ this.emitCurrentDoctype(token);
2191
+ break;
2192
+ }
2193
+ case $.EOF: {
2194
+ this._err(ERR.eofInDoctype);
2195
+ token.forceQuirks = true;
2196
+ this.emitCurrentDoctype(token);
2197
+ this._emitEOFToken();
2198
+ break;
2199
+ }
2200
+ default: {
2201
+ this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
2202
+ token.forceQuirks = true;
2203
+ this.state = State.BOGUS_DOCTYPE;
2204
+ this._stateBogusDoctype(cp);
2205
+ }
2206
+ }
2207
+ }
2208
+ // Before DOCTYPE public identifier state
2209
+ //------------------------------------------------------------------
2210
+ _stateBeforeDoctypePublicIdentifier(cp) {
2211
+ const token = this.currentToken;
2212
+ switch (cp) {
2213
+ case $.SPACE:
2214
+ case $.LINE_FEED:
2215
+ case $.TABULATION:
2216
+ case $.FORM_FEED: {
2217
+ // Ignore whitespace
2218
+ break;
2219
+ }
2220
+ case $.QUOTATION_MARK: {
2221
+ token.publicId = '';
2222
+ this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
2223
+ break;
2224
+ }
2225
+ case $.APOSTROPHE: {
2226
+ token.publicId = '';
2227
+ this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
2228
+ break;
2229
+ }
2230
+ case $.GREATER_THAN_SIGN: {
2231
+ this._err(ERR.missingDoctypePublicIdentifier);
2232
+ token.forceQuirks = true;
2233
+ this.state = State.DATA;
2234
+ this.emitCurrentDoctype(token);
2235
+ break;
2236
+ }
2237
+ case $.EOF: {
2238
+ this._err(ERR.eofInDoctype);
2239
+ token.forceQuirks = true;
2240
+ this.emitCurrentDoctype(token);
2241
+ this._emitEOFToken();
2242
+ break;
2243
+ }
2244
+ default: {
2245
+ this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
2246
+ token.forceQuirks = true;
2247
+ this.state = State.BOGUS_DOCTYPE;
2248
+ this._stateBogusDoctype(cp);
2249
+ }
2250
+ }
2251
+ }
2252
+ // DOCTYPE public identifier (double-quoted) state
2253
+ //------------------------------------------------------------------
2254
+ _stateDoctypePublicIdentifierDoubleQuoted(cp) {
2255
+ const token = this.currentToken;
2256
+ switch (cp) {
2257
+ case $.QUOTATION_MARK: {
2258
+ this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
2259
+ break;
2260
+ }
2261
+ case $.NULL: {
2262
+ this._err(ERR.unexpectedNullCharacter);
2263
+ token.publicId += REPLACEMENT_CHARACTER;
2264
+ break;
2265
+ }
2266
+ case $.GREATER_THAN_SIGN: {
2267
+ this._err(ERR.abruptDoctypePublicIdentifier);
2268
+ token.forceQuirks = true;
2269
+ this.emitCurrentDoctype(token);
2270
+ this.state = State.DATA;
2271
+ break;
2272
+ }
2273
+ case $.EOF: {
2274
+ this._err(ERR.eofInDoctype);
2275
+ token.forceQuirks = true;
2276
+ this.emitCurrentDoctype(token);
2277
+ this._emitEOFToken();
2278
+ break;
2279
+ }
2280
+ default: {
2281
+ token.publicId += String.fromCodePoint(cp);
2282
+ }
2283
+ }
2284
+ }
2285
+ // DOCTYPE public identifier (single-quoted) state
2286
+ //------------------------------------------------------------------
2287
+ _stateDoctypePublicIdentifierSingleQuoted(cp) {
2288
+ const token = this.currentToken;
2289
+ switch (cp) {
2290
+ case $.APOSTROPHE: {
2291
+ this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
2292
+ break;
2293
+ }
2294
+ case $.NULL: {
2295
+ this._err(ERR.unexpectedNullCharacter);
2296
+ token.publicId += REPLACEMENT_CHARACTER;
2297
+ break;
2298
+ }
2299
+ case $.GREATER_THAN_SIGN: {
2300
+ this._err(ERR.abruptDoctypePublicIdentifier);
2301
+ token.forceQuirks = true;
2302
+ this.emitCurrentDoctype(token);
2303
+ this.state = State.DATA;
2304
+ break;
2305
+ }
2306
+ case $.EOF: {
2307
+ this._err(ERR.eofInDoctype);
2308
+ token.forceQuirks = true;
2309
+ this.emitCurrentDoctype(token);
2310
+ this._emitEOFToken();
2311
+ break;
2312
+ }
2313
+ default: {
2314
+ token.publicId += String.fromCodePoint(cp);
2315
+ }
2316
+ }
2317
+ }
2318
+ // After DOCTYPE public identifier state
2319
+ //------------------------------------------------------------------
2320
+ _stateAfterDoctypePublicIdentifier(cp) {
2321
+ const token = this.currentToken;
2322
+ switch (cp) {
2323
+ case $.SPACE:
2324
+ case $.LINE_FEED:
2325
+ case $.TABULATION:
2326
+ case $.FORM_FEED: {
2327
+ this.state = State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
2328
+ break;
2329
+ }
2330
+ case $.GREATER_THAN_SIGN: {
2331
+ this.state = State.DATA;
2332
+ this.emitCurrentDoctype(token);
2333
+ break;
2334
+ }
2335
+ case $.QUOTATION_MARK: {
2336
+ this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
2337
+ token.systemId = '';
2338
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
2339
+ break;
2340
+ }
2341
+ case $.APOSTROPHE: {
2342
+ this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
2343
+ token.systemId = '';
2344
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
2345
+ break;
2346
+ }
2347
+ case $.EOF: {
2348
+ this._err(ERR.eofInDoctype);
2349
+ token.forceQuirks = true;
2350
+ this.emitCurrentDoctype(token);
2351
+ this._emitEOFToken();
2352
+ break;
2353
+ }
2354
+ default: {
2355
+ this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
2356
+ token.forceQuirks = true;
2357
+ this.state = State.BOGUS_DOCTYPE;
2358
+ this._stateBogusDoctype(cp);
2359
+ }
2360
+ }
2361
+ }
2362
+ // Between DOCTYPE public and system identifiers state
2363
+ //------------------------------------------------------------------
2364
+ _stateBetweenDoctypePublicAndSystemIdentifiers(cp) {
2365
+ const token = this.currentToken;
2366
+ switch (cp) {
2367
+ case $.SPACE:
2368
+ case $.LINE_FEED:
2369
+ case $.TABULATION:
2370
+ case $.FORM_FEED: {
2371
+ // Ignore whitespace
2372
+ break;
2373
+ }
2374
+ case $.GREATER_THAN_SIGN: {
2375
+ this.emitCurrentDoctype(token);
2376
+ this.state = State.DATA;
2377
+ break;
2378
+ }
2379
+ case $.QUOTATION_MARK: {
2380
+ token.systemId = '';
2381
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
2382
+ break;
2383
+ }
2384
+ case $.APOSTROPHE: {
2385
+ token.systemId = '';
2386
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
2387
+ break;
2388
+ }
2389
+ case $.EOF: {
2390
+ this._err(ERR.eofInDoctype);
2391
+ token.forceQuirks = true;
2392
+ this.emitCurrentDoctype(token);
2393
+ this._emitEOFToken();
2394
+ break;
2395
+ }
2396
+ default: {
2397
+ this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
2398
+ token.forceQuirks = true;
2399
+ this.state = State.BOGUS_DOCTYPE;
2400
+ this._stateBogusDoctype(cp);
2401
+ }
2402
+ }
2403
+ }
2404
+ // After DOCTYPE system keyword state
2405
+ //------------------------------------------------------------------
2406
+ _stateAfterDoctypeSystemKeyword(cp) {
2407
+ const token = this.currentToken;
2408
+ switch (cp) {
2409
+ case $.SPACE:
2410
+ case $.LINE_FEED:
2411
+ case $.TABULATION:
2412
+ case $.FORM_FEED: {
2413
+ this.state = State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
2414
+ break;
2415
+ }
2416
+ case $.QUOTATION_MARK: {
2417
+ this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
2418
+ token.systemId = '';
2419
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
2420
+ break;
2421
+ }
2422
+ case $.APOSTROPHE: {
2423
+ this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
2424
+ token.systemId = '';
2425
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
2426
+ break;
2427
+ }
2428
+ case $.GREATER_THAN_SIGN: {
2429
+ this._err(ERR.missingDoctypeSystemIdentifier);
2430
+ token.forceQuirks = true;
2431
+ this.state = State.DATA;
2432
+ this.emitCurrentDoctype(token);
2433
+ break;
2434
+ }
2435
+ case $.EOF: {
2436
+ this._err(ERR.eofInDoctype);
2437
+ token.forceQuirks = true;
2438
+ this.emitCurrentDoctype(token);
2439
+ this._emitEOFToken();
2440
+ break;
2441
+ }
2442
+ default: {
2443
+ this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
2444
+ token.forceQuirks = true;
2445
+ this.state = State.BOGUS_DOCTYPE;
2446
+ this._stateBogusDoctype(cp);
2447
+ }
2448
+ }
2449
+ }
2450
+ // Before DOCTYPE system identifier state
2451
+ //------------------------------------------------------------------
2452
+ _stateBeforeDoctypeSystemIdentifier(cp) {
2453
+ const token = this.currentToken;
2454
+ switch (cp) {
2455
+ case $.SPACE:
2456
+ case $.LINE_FEED:
2457
+ case $.TABULATION:
2458
+ case $.FORM_FEED: {
2459
+ // Ignore whitespace
2460
+ break;
2461
+ }
2462
+ case $.QUOTATION_MARK: {
2463
+ token.systemId = '';
2464
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
2465
+ break;
2466
+ }
2467
+ case $.APOSTROPHE: {
2468
+ token.systemId = '';
2469
+ this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
2470
+ break;
2471
+ }
2472
+ case $.GREATER_THAN_SIGN: {
2473
+ this._err(ERR.missingDoctypeSystemIdentifier);
2474
+ token.forceQuirks = true;
2475
+ this.state = State.DATA;
2476
+ this.emitCurrentDoctype(token);
2477
+ break;
2478
+ }
2479
+ case $.EOF: {
2480
+ this._err(ERR.eofInDoctype);
2481
+ token.forceQuirks = true;
2482
+ this.emitCurrentDoctype(token);
2483
+ this._emitEOFToken();
2484
+ break;
2485
+ }
2486
+ default: {
2487
+ this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
2488
+ token.forceQuirks = true;
2489
+ this.state = State.BOGUS_DOCTYPE;
2490
+ this._stateBogusDoctype(cp);
2491
+ }
2492
+ }
2493
+ }
2494
+ // DOCTYPE system identifier (double-quoted) state
2495
+ //------------------------------------------------------------------
2496
+ _stateDoctypeSystemIdentifierDoubleQuoted(cp) {
2497
+ const token = this.currentToken;
2498
+ switch (cp) {
2499
+ case $.QUOTATION_MARK: {
2500
+ this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
2501
+ break;
2502
+ }
2503
+ case $.NULL: {
2504
+ this._err(ERR.unexpectedNullCharacter);
2505
+ token.systemId += REPLACEMENT_CHARACTER;
2506
+ break;
2507
+ }
2508
+ case $.GREATER_THAN_SIGN: {
2509
+ this._err(ERR.abruptDoctypeSystemIdentifier);
2510
+ token.forceQuirks = true;
2511
+ this.emitCurrentDoctype(token);
2512
+ this.state = State.DATA;
2513
+ break;
2514
+ }
2515
+ case $.EOF: {
2516
+ this._err(ERR.eofInDoctype);
2517
+ token.forceQuirks = true;
2518
+ this.emitCurrentDoctype(token);
2519
+ this._emitEOFToken();
2520
+ break;
2521
+ }
2522
+ default: {
2523
+ token.systemId += String.fromCodePoint(cp);
2524
+ }
2525
+ }
2526
+ }
2527
+ // DOCTYPE system identifier (single-quoted) state
2528
+ //------------------------------------------------------------------
2529
+ _stateDoctypeSystemIdentifierSingleQuoted(cp) {
2530
+ const token = this.currentToken;
2531
+ switch (cp) {
2532
+ case $.APOSTROPHE: {
2533
+ this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
2534
+ break;
2535
+ }
2536
+ case $.NULL: {
2537
+ this._err(ERR.unexpectedNullCharacter);
2538
+ token.systemId += REPLACEMENT_CHARACTER;
2539
+ break;
2540
+ }
2541
+ case $.GREATER_THAN_SIGN: {
2542
+ this._err(ERR.abruptDoctypeSystemIdentifier);
2543
+ token.forceQuirks = true;
2544
+ this.emitCurrentDoctype(token);
2545
+ this.state = State.DATA;
2546
+ break;
2547
+ }
2548
+ case $.EOF: {
2549
+ this._err(ERR.eofInDoctype);
2550
+ token.forceQuirks = true;
2551
+ this.emitCurrentDoctype(token);
2552
+ this._emitEOFToken();
2553
+ break;
2554
+ }
2555
+ default: {
2556
+ token.systemId += String.fromCodePoint(cp);
2557
+ }
2558
+ }
2559
+ }
2560
+ // After DOCTYPE system identifier state
2561
+ //------------------------------------------------------------------
2562
+ _stateAfterDoctypeSystemIdentifier(cp) {
2563
+ const token = this.currentToken;
2564
+ switch (cp) {
2565
+ case $.SPACE:
2566
+ case $.LINE_FEED:
2567
+ case $.TABULATION:
2568
+ case $.FORM_FEED: {
2569
+ // Ignore whitespace
2570
+ break;
2571
+ }
2572
+ case $.GREATER_THAN_SIGN: {
2573
+ this.emitCurrentDoctype(token);
2574
+ this.state = State.DATA;
2575
+ break;
2576
+ }
2577
+ case $.EOF: {
2578
+ this._err(ERR.eofInDoctype);
2579
+ token.forceQuirks = true;
2580
+ this.emitCurrentDoctype(token);
2581
+ this._emitEOFToken();
2582
+ break;
2583
+ }
2584
+ default: {
2585
+ this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);
2586
+ this.state = State.BOGUS_DOCTYPE;
2587
+ this._stateBogusDoctype(cp);
2588
+ }
2589
+ }
2590
+ }
2591
+ // Bogus DOCTYPE state
2592
+ //------------------------------------------------------------------
2593
+ _stateBogusDoctype(cp) {
2594
+ const token = this.currentToken;
2595
+ switch (cp) {
2596
+ case $.GREATER_THAN_SIGN: {
2597
+ this.emitCurrentDoctype(token);
2598
+ this.state = State.DATA;
2599
+ break;
2600
+ }
2601
+ case $.NULL: {
2602
+ this._err(ERR.unexpectedNullCharacter);
2603
+ break;
2604
+ }
2605
+ case $.EOF: {
2606
+ this.emitCurrentDoctype(token);
2607
+ this._emitEOFToken();
2608
+ break;
2609
+ }
2610
+ default:
2611
+ // Do nothing
2612
+ }
2613
+ }
2614
+ // CDATA section state
2615
+ //------------------------------------------------------------------
2616
+ _stateCdataSection(cp) {
2617
+ switch (cp) {
2618
+ case $.RIGHT_SQUARE_BRACKET: {
2619
+ this.state = State.CDATA_SECTION_BRACKET;
2620
+ break;
2621
+ }
2622
+ case $.EOF: {
2623
+ this._err(ERR.eofInCdata);
2624
+ this._emitEOFToken();
2625
+ break;
2626
+ }
2627
+ default: {
2628
+ this._emitCodePoint(cp);
2629
+ }
2630
+ }
2631
+ }
2632
+ // CDATA section bracket state
2633
+ //------------------------------------------------------------------
2634
+ _stateCdataSectionBracket(cp) {
2635
+ if (cp === $.RIGHT_SQUARE_BRACKET) {
2636
+ this.state = State.CDATA_SECTION_END;
2637
+ }
2638
+ else {
2639
+ this._emitChars(']');
2640
+ this.state = State.CDATA_SECTION;
2641
+ this._stateCdataSection(cp);
2642
+ }
2643
+ }
2644
+ // CDATA section end state
2645
+ //------------------------------------------------------------------
2646
+ _stateCdataSectionEnd(cp) {
2647
+ switch (cp) {
2648
+ case $.GREATER_THAN_SIGN: {
2649
+ this.state = State.DATA;
2650
+ break;
2651
+ }
2652
+ case $.RIGHT_SQUARE_BRACKET: {
2653
+ this._emitChars(']');
2654
+ break;
2655
+ }
2656
+ default: {
2657
+ this._emitChars(']]');
2658
+ this.state = State.CDATA_SECTION;
2659
+ this._stateCdataSection(cp);
2660
+ }
2661
+ }
2662
+ }
2663
+ // Character reference state
2664
+ //------------------------------------------------------------------
2665
+ _stateCharacterReference() {
2666
+ let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
2667
+ if (length < 0) {
2668
+ if (this.preprocessor.lastChunkWritten) {
2669
+ length = this.entityDecoder.end();
2670
+ }
2671
+ else {
2672
+ // Wait for the rest of the entity.
2673
+ this.active = false;
2674
+ // Mark the entire buffer as read.
2675
+ this.preprocessor.pos = this.preprocessor.html.length - 1;
2676
+ this.consumedAfterSnapshot = 0;
2677
+ this.preprocessor.endOfChunkHit = true;
2678
+ return;
2679
+ }
2680
+ }
2681
+ if (length === 0) {
2682
+ // This was not a valid entity. Go back to the beginning, and
2683
+ // figure out what to do.
2684
+ this.preprocessor.pos = this.entityStartPos;
2685
+ this._flushCodePointConsumedAsCharacterReference($.AMPERSAND);
2686
+ this.state =
2687
+ !this._isCharacterReferenceInAttribute() && isAsciiAlphaNumeric(this.preprocessor.peek(1))
2688
+ ? State.AMBIGUOUS_AMPERSAND
2689
+ : this.returnState;
2690
+ }
2691
+ else {
2692
+ // We successfully parsed an entity. Switch to the return state.
2693
+ this.state = this.returnState;
2694
+ }
2695
+ }
2696
+ // Ambiguos ampersand state
2697
+ //------------------------------------------------------------------
2698
+ _stateAmbiguousAmpersand(cp) {
2699
+ if (isAsciiAlphaNumeric(cp)) {
2700
+ this._flushCodePointConsumedAsCharacterReference(cp);
2701
+ }
2702
+ else {
2703
+ if (cp === $.SEMICOLON) {
2704
+ this._err(ERR.unknownNamedCharacterReference);
2705
+ }
2706
+ this.state = this.returnState;
2707
+ this._callState(cp);
2708
+ }
2709
+ }
2710
+ }