@agenticworkflowprotocol/validator 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +201 -0
  3. package/README.md +129 -2
  4. package/bin/awp.js +10 -0
  5. package/dist/browser/awp-validator.mjs +135 -0
  6. package/dist/browser/awp-validator.mjs.map +7 -0
  7. package/package.json +64 -4
  8. package/src/browser/crypto.js +27 -0
  9. package/src/browser.js +15 -0
  10. package/src/cli.js +107 -0
  11. package/src/format.js +54 -0
  12. package/src/index.js +20 -0
  13. package/src/validator.js +126 -0
  14. package/src/yaml.js +61 -0
  15. package/types/index.d.ts +90 -0
  16. package/vendor/awp-v1alpha1/LICENSE +202 -0
  17. package/vendor/awp-v1alpha1/LICENSE-SPEC +51 -0
  18. package/vendor/awp-v1alpha1/PROVENANCE.json +748 -0
  19. package/vendor/awp-v1alpha1/conformance/index.json +1531 -0
  20. package/vendor/awp-v1alpha1/conformance/invalid/10.2-invalid-integrity-mode.yaml +66 -0
  21. package/vendor/awp-v1alpha1/conformance/invalid/10.2-invalid-payload.yaml +65 -0
  22. package/vendor/awp-v1alpha1/conformance/invalid/10.2-invalid-retention.yaml +66 -0
  23. package/vendor/awp-v1alpha1/conformance/invalid/3.1-custom-tag.yaml +63 -0
  24. package/vendor/awp-v1alpha1/conformance/invalid/3.1-non-string-key.yaml +65 -0
  25. package/vendor/awp-v1alpha1/conformance/invalid/3.1-syntax-error.yaml +5 -0
  26. package/vendor/awp-v1alpha1/conformance/invalid/3.2-missing-api-version.yaml +62 -0
  27. package/vendor/awp-v1alpha1/conformance/invalid/3.2-missing-metadata.yaml +55 -0
  28. package/vendor/awp-v1alpha1/conformance/invalid/3.2-missing-spec.yaml +13 -0
  29. package/vendor/awp-v1alpha1/conformance/invalid/3.2-unsupported-api-version.yaml +63 -0
  30. package/vendor/awp-v1alpha1/conformance/invalid/3.2-unsupported-kind.yaml +63 -0
  31. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-a2a-agent.yaml +67 -0
  32. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-approval-step.yaml +71 -0
  33. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-audit-field.yaml +66 -0
  34. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-governance-field.yaml +67 -0
  35. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-high-risk.yaml +64 -0
  36. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-mcp-field.yaml +64 -0
  37. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-policy-kind.yaml +20 -0
  38. package/vendor/awp-v1alpha1/conformance/invalid/3.3-profile-security-field.yaml +67 -0
  39. package/vendor/awp-v1alpha1/conformance/invalid/3.3-unknown-field-near-extension.yaml +64 -0
  40. package/vendor/awp-v1alpha1/conformance/invalid/3.3-unknown-metadata-field.yaml +64 -0
  41. package/vendor/awp-v1alpha1/conformance/invalid/3.3-unknown-step-field.yaml +64 -0
  42. package/vendor/awp-v1alpha1/conformance/invalid/3.3-unknown-top-level-field.yaml +64 -0
  43. package/vendor/awp-v1alpha1/conformance/invalid/3.4-duplicate-agent-id.yaml +70 -0
  44. package/vendor/awp-v1alpha1/conformance/invalid/3.4-duplicate-rule-id.yaml +26 -0
  45. package/vendor/awp-v1alpha1/conformance/invalid/3.4-invalid-metadata-name.yaml +63 -0
  46. package/vendor/awp-v1alpha1/conformance/invalid/3.4-uppercase-agent-id.yaml +63 -0
  47. package/vendor/awp-v1alpha1/conformance/invalid/3.5-version-leading-zero.yaml +63 -0
  48. package/vendor/awp-v1alpha1/conformance/invalid/3.5-version-not-semver.yaml +63 -0
  49. package/vendor/awp-v1alpha1/conformance/invalid/3.6-duration-unknown-unit.yaml +64 -0
  50. package/vendor/awp-v1alpha1/conformance/invalid/3.6-duration-zero.yaml +63 -0
  51. package/vendor/awp-v1alpha1/conformance/invalid/3.7-date-not-calendar-valid.yaml +66 -0
  52. package/vendor/awp-v1alpha1/conformance/invalid/3.7-date-wrong-format.yaml +66 -0
  53. package/vendor/awp-v1alpha1/conformance/invalid/3.8-digest-uppercase-hex.yaml +65 -0
  54. package/vendor/awp-v1alpha1/conformance/invalid/3.8-digest-wrong-length.yaml +65 -0
  55. package/vendor/awp-v1alpha1/conformance/invalid/3.9-expression-function.yaml +63 -0
  56. package/vendor/awp-v1alpha1/conformance/invalid/3.9-expression-in-env-key-ref-bad.yaml +70 -0
  57. package/vendor/awp-v1alpha1/conformance/invalid/3.9-expression-operator.yaml +63 -0
  58. package/vendor/awp-v1alpha1/conformance/invalid/3.9-expression-unknown-root.yaml +63 -0
  59. package/vendor/awp-v1alpha1/conformance/invalid/3.9-expression-unterminated.yaml +63 -0
  60. package/vendor/awp-v1alpha1/conformance/invalid/3.9-step-reference-in-permissions.yaml +65 -0
  61. package/vendor/awp-v1alpha1/conformance/invalid/3.9-step-reference-unknown-step.yaml +63 -0
  62. package/vendor/awp-v1alpha1/conformance/invalid/3.9-step-reference-without-dependency.yaml +62 -0
  63. package/vendor/awp-v1alpha1/conformance/invalid/4-invalid-label-key.yaml +65 -0
  64. package/vendor/awp-v1alpha1/conformance/invalid/4-invalid-risk-level.yaml +63 -0
  65. package/vendor/awp-v1alpha1/conformance/invalid/4-label-value-not-string.yaml +65 -0
  66. package/vendor/awp-v1alpha1/conformance/invalid/4-missing-owner.yaml +61 -0
  67. package/vendor/awp-v1alpha1/conformance/invalid/4-missing-version.yaml +62 -0
  68. package/vendor/awp-v1alpha1/conformance/invalid/4-owner-without-team.yaml +63 -0
  69. package/vendor/awp-v1alpha1/conformance/invalid/5.2-cron-not-five-fields.yaml +66 -0
  70. package/vendor/awp-v1alpha1/conformance/invalid/5.2-event-without-event-type.yaml +66 -0
  71. package/vendor/awp-v1alpha1/conformance/invalid/5.2-schedule-without-cron.yaml +66 -0
  72. package/vendor/awp-v1alpha1/conformance/invalid/5.2-unknown-trigger-type.yaml +65 -0
  73. package/vendor/awp-v1alpha1/conformance/invalid/5.3-default-wrong-type.yaml +63 -0
  74. package/vendor/awp-v1alpha1/conformance/invalid/5.3-invalid-pattern.yaml +63 -0
  75. package/vendor/awp-v1alpha1/conformance/invalid/5.3-required-input-with-default.yaml +64 -0
  76. package/vendor/awp-v1alpha1/conformance/invalid/5.3-unknown-input-type.yaml +62 -0
  77. package/vendor/awp-v1alpha1/conformance/invalid/5.4.1-inline-agent-without-model.yaml +60 -0
  78. package/vendor/awp-v1alpha1/conformance/invalid/5.4.1-instructions-and-prompt-ref.yaml +67 -0
  79. package/vendor/awp-v1alpha1/conformance/invalid/5.4.2-reference-version-range.yaml +67 -0
  80. package/vendor/awp-v1alpha1/conformance/invalid/5.4.2-reference-with-instructions.yaml +68 -0
  81. package/vendor/awp-v1alpha1/conformance/invalid/5.4.2-reference-with-model.yaml +70 -0
  82. package/vendor/awp-v1alpha1/conformance/invalid/5.4.2-reference-without-version.yaml +66 -0
  83. package/vendor/awp-v1alpha1/conformance/invalid/5.4.3-invalid-model-approval-status.yaml +65 -0
  84. package/vendor/awp-v1alpha1/conformance/invalid/5.4.3-model-without-name.yaml +62 -0
  85. package/vendor/awp-v1alpha1/conformance/invalid/5.4.4-remote-agent-http-endpoint.yaml +66 -0
  86. package/vendor/awp-v1alpha1/conformance/invalid/5.4.4-remote-agent-with-model.yaml +69 -0
  87. package/vendor/awp-v1alpha1/conformance/invalid/5.4.4-remote-agent-without-endpoint.yaml +65 -0
  88. package/vendor/awp-v1alpha1/conformance/invalid/5.4.4-remote-agent-wrong-protocol.yaml +66 -0
  89. package/vendor/awp-v1alpha1/conformance/invalid/5.5.1-duplicate-server-name.yaml +68 -0
  90. package/vendor/awp-v1alpha1/conformance/invalid/5.5.1-mcp-url-not-https.yaml +63 -0
  91. package/vendor/awp-v1alpha1/conformance/invalid/5.5.1-streamable-http-without-url.yaml +62 -0
  92. package/vendor/awp-v1alpha1/conformance/invalid/5.5.1-unknown-transport.yaml +63 -0
  93. package/vendor/awp-v1alpha1/conformance/invalid/5.5.2-builtin-tool-source-without-name.yaml +62 -0
  94. package/vendor/awp-v1alpha1/conformance/invalid/5.5.2-mcp-tool-source-without-server.yaml +62 -0
  95. package/vendor/awp-v1alpha1/conformance/invalid/5.5.3-invalid-action-identifier-in-permissions.yaml +63 -0
  96. package/vendor/awp-v1alpha1/conformance/invalid/5.5.3-wildcard-not-final-segment.yaml +63 -0
  97. package/vendor/awp-v1alpha1/conformance/invalid/5.5.4-group-contains-group.yaml +65 -0
  98. package/vendor/awp-v1alpha1/conformance/invalid/5.5.4-invalid-group-identifier.yaml +63 -0
  99. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-agent-step-with-command.yaml +64 -0
  100. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-agent-step-without-agent.yaml +62 -0
  101. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-approval-step-without-approval.yaml +67 -0
  102. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-command-step-with-agent.yaml +67 -0
  103. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-command-step-without-command.yaml +67 -0
  104. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-negative-retries.yaml +64 -0
  105. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-retries-exceed-max-retries.yaml +64 -0
  106. package/vendor/awp-v1alpha1/conformance/invalid/5.6.1-unknown-step-type.yaml +64 -0
  107. package/vendor/awp-v1alpha1/conformance/invalid/5.6.2-env-key-invalid.yaml +70 -0
  108. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-dependency-cycle.yaml +65 -0
  109. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-depends-on-unknown-step.yaml +64 -0
  110. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-duplicate-step-id.yaml +62 -0
  111. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-self-dependency.yaml +65 -0
  112. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-undeclared-step-output.yaml +63 -0
  113. package/vendor/awp-v1alpha1/conformance/invalid/5.6.3-unknown-agent.yaml +63 -0
  114. package/vendor/awp-v1alpha1/conformance/invalid/5.7-negative-cost.yaml +63 -0
  115. package/vendor/awp-v1alpha1/conformance/invalid/5.7-unknown-budget-field.yaml +64 -0
  116. package/vendor/awp-v1alpha1/conformance/invalid/5.7-zero-concurrency.yaml +63 -0
  117. package/vendor/awp-v1alpha1/conformance/invalid/5.7-zero-max-steps.yaml +63 -0
  118. package/vendor/awp-v1alpha1/conformance/invalid/6-agent-instructions-and-prompt-ref.yaml +20 -0
  119. package/vendor/awp-v1alpha1/conformance/invalid/6-agent-kind-with-workflow-spec.yaml +18 -0
  120. package/vendor/awp-v1alpha1/conformance/invalid/6-agent-with-workflow-field.yaml +18 -0
  121. package/vendor/awp-v1alpha1/conformance/invalid/6-agent-without-model.yaml +14 -0
  122. package/vendor/awp-v1alpha1/conformance/invalid/7.1-governance-requires-classification.yaml +62 -0
  123. package/vendor/awp-v1alpha1/conformance/invalid/7.10-environment-without-autonomy.yaml +65 -0
  124. package/vendor/awp-v1alpha1/conformance/invalid/7.10-invalid-autonomy.yaml +66 -0
  125. package/vendor/awp-v1alpha1/conformance/invalid/7.2-invalid-classification.yaml +63 -0
  126. package/vendor/awp-v1alpha1/conformance/invalid/7.2-invalid-external-transfer.yaml +66 -0
  127. package/vendor/awp-v1alpha1/conformance/invalid/7.4-invalid-model-policy-status.yaml +66 -0
  128. package/vendor/awp-v1alpha1/conformance/invalid/7.5-allow-not-boolean.yaml +63 -0
  129. package/vendor/awp-v1alpha1/conformance/invalid/7.5-invalid-default.yaml +63 -0
  130. package/vendor/awp-v1alpha1/conformance/invalid/7.5-invalid-egress.yaml +65 -0
  131. package/vendor/awp-v1alpha1/conformance/invalid/7.5-tool-without-allow.yaml +64 -0
  132. package/vendor/awp-v1alpha1/conformance/invalid/7.6-approver-empty.yaml +66 -0
  133. package/vendor/awp-v1alpha1/conformance/invalid/7.6-approver-role-and-user.yaml +67 -0
  134. package/vendor/awp-v1alpha1/conformance/invalid/7.6-invalid-on-timeout.yaml +65 -0
  135. package/vendor/awp-v1alpha1/conformance/invalid/7.6-min-approvals-zero.yaml +65 -0
  136. package/vendor/awp-v1alpha1/conformance/invalid/7.6-required-for-invalid-key.yaml +66 -0
  137. package/vendor/awp-v1alpha1/conformance/invalid/7.8-unknown-separation-rule.yaml +68 -0
  138. package/vendor/awp-v1alpha1/conformance/invalid/7.9-literal-password-in-free-form-value.yaml +64 -0
  139. package/vendor/awp-v1alpha1/conformance/invalid/7.9-literal-token-field.yaml +64 -0
  140. package/vendor/awp-v1alpha1/conformance/invalid/7.9-remote-agent-secret-ref-out-of-scope.yaml +68 -0
  141. package/vendor/awp-v1alpha1/conformance/invalid/7.9-secret-ref-empty-scope.yaml +61 -0
  142. package/vendor/awp-v1alpha1/conformance/invalid/7.9-secret-ref-out-of-scope.yaml +63 -0
  143. package/vendor/awp-v1alpha1/conformance/invalid/7.9-secret-ref-undeclared.yaml +63 -0
  144. package/vendor/awp-v1alpha1/conformance/invalid/7.9-secret-without-source.yaml +62 -0
  145. package/vendor/awp-v1alpha1/conformance/invalid/8.1-include-without-version.yaml +66 -0
  146. package/vendor/awp-v1alpha1/conformance/invalid/8.1-shorthand-not-boolean.yaml +66 -0
  147. package/vendor/awp-v1alpha1/conformance/invalid/8.1-unknown-shorthand.yaml +66 -0
  148. package/vendor/awp-v1alpha1/conformance/invalid/8.2-no-allow-effect.yaml +19 -0
  149. package/vendor/awp-v1alpha1/conformance/invalid/8.2-policy-without-rules.yaml +11 -0
  150. package/vendor/awp-v1alpha1/conformance/invalid/8.2-require-approval-without-approval.yaml +16 -0
  151. package/vendor/awp-v1alpha1/conformance/invalid/8.2-rule-without-when.yaml +17 -0
  152. package/vendor/awp-v1alpha1/conformance/invalid/8.3-empty-when.yaml +18 -0
  153. package/vendor/awp-v1alpha1/conformance/invalid/8.3-in-not-a-list.yaml +20 -0
  154. package/vendor/awp-v1alpha1/conformance/invalid/8.3-invalid-actor-type.yaml +19 -0
  155. package/vendor/awp-v1alpha1/conformance/invalid/8.3-invalid-classification-value.yaml +20 -0
  156. package/vendor/awp-v1alpha1/conformance/invalid/8.3-ordering-operator-on-unordered-attribute.yaml +20 -0
  157. package/vendor/awp-v1alpha1/conformance/invalid/8.3-unknown-attribute.yaml +19 -0
  158. package/vendor/awp-v1alpha1/conformance/invalid/9.1-digest-mismatch.yaml +66 -0
  159. package/vendor/awp-v1alpha1/conformance/invalid/9.4-unpinned-command-image-security-profile.yaml +69 -0
  160. package/vendor/awp-v1alpha1/conformance/invalid/9.4-unpinned-mcp-image-security-profile.yaml +66 -0
  161. package/vendor/awp-v1alpha1/conformance/semantic.mjs +317 -0
  162. package/vendor/awp-v1alpha1/conformance/valid/10.2-audit-configuration.yaml +70 -0
  163. package/vendor/awp-v1alpha1/conformance/valid/3.1-json-serialization.json +100 -0
  164. package/vendor/awp-v1alpha1/conformance/valid/3.1-multi-document.yaml +80 -0
  165. package/vendor/awp-v1alpha1/conformance/valid/3.2-minimal-workflow.yaml +21 -0
  166. package/vendor/awp-v1alpha1/conformance/valid/3.3-core-profile-only.yaml +23 -0
  167. package/vendor/awp-v1alpha1/conformance/valid/3.3-extension-fields.yaml +71 -0
  168. package/vendor/awp-v1alpha1/conformance/valid/3.6-durations.yaml +65 -0
  169. package/vendor/awp-v1alpha1/conformance/valid/3.9-expression-references.yaml +63 -0
  170. package/vendor/awp-v1alpha1/conformance/valid/4-owner-string-shorthand.yaml +66 -0
  171. package/vendor/awp-v1alpha1/conformance/valid/5.2-triggers.yaml +73 -0
  172. package/vendor/awp-v1alpha1/conformance/valid/5.3-inputs.yaml +86 -0
  173. package/vendor/awp-v1alpha1/conformance/valid/5.4.2-agent-reference.yaml +74 -0
  174. package/vendor/awp-v1alpha1/conformance/valid/5.4.4-remote-agent.yaml +79 -0
  175. package/vendor/awp-v1alpha1/conformance/valid/5.5.4-action-groups.yaml +67 -0
  176. package/vendor/awp-v1alpha1/conformance/valid/5.6.2-command-step-env.yaml +73 -0
  177. package/vendor/awp-v1alpha1/conformance/valid/5.6.3-transitive-step-reference.yaml +68 -0
  178. package/vendor/awp-v1alpha1/conformance/valid/5.7-nested-budgets.yaml +70 -0
  179. package/vendor/awp-v1alpha1/conformance/valid/6-agent-manifest.yaml +35 -0
  180. package/vendor/awp-v1alpha1/conformance/valid/6-agent-prompt-ref.yaml +19 -0
  181. package/vendor/awp-v1alpha1/conformance/valid/7.10-environments.yaml +74 -0
  182. package/vendor/awp-v1alpha1/conformance/valid/7.2-data-and-model-policy.yaml +105 -0
  183. package/vendor/awp-v1alpha1/conformance/valid/7.5-permissions.yaml +80 -0
  184. package/vendor/awp-v1alpha1/conformance/valid/7.6-approval-and-separation-of-duties.yaml +89 -0
  185. package/vendor/awp-v1alpha1/conformance/valid/8.1-policy-shorthands.yaml +77 -0
  186. package/vendor/awp-v1alpha1/conformance/valid/8.2-policy-manifest.yaml +30 -0
  187. package/vendor/awp-v1alpha1/conformance/valid/8.3-conditions.yaml +36 -0
  188. package/vendor/awp-v1alpha1/conformance/valid/9.1-digest-verified.yaml +66 -0
  189. package/vendor/awp-v1alpha1/conformance/valid/9.4-pinned-images-security-profile.yaml +73 -0
  190. package/vendor/awp-v1alpha1/schema/awp.v1alpha1.json +2757 -0
  191. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/audit-events.yaml +120 -0
  192. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/conformance-statement.yaml +17 -0
  193. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/eu-data-residency.policy.yaml +24 -0
  194. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/execution-record.yaml +53 -0
  195. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/invoice-extractor.agent.yaml +38 -0
  196. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/invoice-processing.workflow.yaml +234 -0
  197. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/no-production-autonomy.policy.yaml +31 -0
  198. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/security-review.a2a.workflow.yaml +70 -0
  199. package/vendor/awp-v1alpha1/spec/v1alpha1/examples/vulnerability-fixer.workflow.yaml +155 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes are documented in this file. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0] - 2026-11-19
8
+
9
+ ### Added
10
+
11
+ - `awp validate` with the options, output formats and exit codes of the AWP CLI output formats
12
+ (section 4): `--profiles`, `--verify-digest`, `--strict`, `--output text|json`, `--quiet`,
13
+ standard input with `-`.
14
+ - Library for Node.js (`validateText`, `validateManifest`, formatters, `manifestDigest`, `jcs`,
15
+ `schema`, `provenance`) with TypeScript types.
16
+ - Browser bundle without `eval` (precompiled JSON Schema validator, synchronous SHA-2 for digests).
17
+ - Website for validation in the browser (validator.agenticworkflowprotocol.org).
18
+ - Unchanged copy of the AWP `v1alpha1` schema, semantic rules, conformance suite and examples at
19
+ specification commit `7b3f381`, verified by hash in the tests.
20
+ - Tests: the full conformance suite and the specification examples against the Node.js build and
21
+ the browser bundle (identical diagnostics), CLI and library behaviour.
22
+
23
+ [0.1.0]: https://github.com/agenticworkflowprotocol/awp-validator/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,130 @@
1
- # Temporary Holding Version
1
+ # AWP Validator
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Reference validator for [Agentic Workflow Protocol (AWP)](https://agenticworkflowprotocol.org)
4
+ manifests: the YAML restrictions, the JSON Schema and the semantic rules of AWP `v1alpha1`, per
5
+ conformance profile, with digest verification and machine-readable diagnostics.
6
+
7
+ - **Web:** [validator.agenticworkflowprotocol.org](https://validator.agenticworkflowprotocol.org) – runs
8
+ in the browser, the manifest is not uploaded.
9
+ - **CLI:** `awp validate`, with the output formats and exit codes of the
10
+ [AWP CLI output formats](https://github.com/agenticworkflowprotocol/agenticworkflowprotocol.org/blob/main/docs/cli.md#4-awp-validate).
11
+ - **Library:** for Node.js and for the browser (one ES module, no `eval`), to validate manifests
12
+ inside your own runtime, editor or CI.
13
+
14
+ Status: alpha, like the specification. The validator passes the AWP conformance suite (validator
15
+ role, spec 11.1); it is not a runtime and says nothing about runtime conformance.
16
+
17
+ ## Install
18
+
19
+ Until the package is on the npm registry, install it from a
20
+ [GitHub release](https://github.com/agenticworkflowprotocol/awp-validator/releases):
21
+
22
+ ```sh
23
+ npm install --save-exact \
24
+ https://github.com/agenticworkflowprotocol/awp-validator/releases/download/v0.1.0/agenticworkflowprotocol-validator-0.1.0.tgz
25
+ ```
26
+
27
+ Each release also contains the browser bundle `awp-validator.mjs`, the JSON Schema and
28
+ `SHA256SUMS`. Node.js 20 or newer. Runtime dependencies: `ajv` and `yaml` (pinned).
29
+
30
+ ## Command line
31
+
32
+ ```sh
33
+ npx awp validate workflow.yaml
34
+ npx awp validate --profiles core,mcp --verify-digest workflow.yaml other.yaml
35
+ cat workflow.yaml | npx awp validate --output json -
36
+ ```
37
+
38
+ ```text
39
+ workflow.yaml:31:11: error dependsOn.unknown-step /spec/workflow/1/dependsOn/0: dependsOn names non-existent step "ghost"
40
+
41
+ workflow.yaml (Workflow vulnerability-fixer 0.1.0): invalid, 1 error
42
+ ```
43
+
44
+ | Option | Meaning |
45
+ | --- | --- |
46
+ | `--profiles <list>` | Supported profiles (`core`, `governance`, `audit`, `security`, `mcp`, `a2a`). Fields of other profiles are rejected (spec 3.3). Default: all. |
47
+ | `--verify-digest` | Verify `metadata.integrity.digest` (spec 9.1). |
48
+ | `--strict` | Warnings fail the command. |
49
+ | `--output text\|json` | `json` prints the envelope `{ awp, command, ok, result }`. |
50
+ | `--quiet` | Only diagnostics of severity `error`. |
51
+
52
+ Exit codes: `0` valid, `1` invalid, `2` usage error, `3` file could not be read.
53
+
54
+ ## Library
55
+
56
+ ```js
57
+ import { validateText, validateManifest } from '@agenticworkflowprotocol/validator';
58
+
59
+ // Text (YAML or JSON, several documents allowed), with line and column per diagnostic.
60
+ const { documents } = validateText(text, { file: 'workflow.yaml', profiles: ['core', 'mcp'] });
61
+ if (!documents.every((d) => d.valid)) {
62
+ for (const d of documents.flatMap((doc) => doc.diagnostics)) {
63
+ console.error(`${d.source.line}:${d.source.column} ${d.code} ${d.path}: ${d.message}`);
64
+ }
65
+ }
66
+
67
+ // An already parsed value, for example a request body.
68
+ const result = validateManifest(manifest, { profiles: ['core', 'mcp'] });
69
+ ```
70
+
71
+ Diagnostics follow [section 3 of the CLI output formats](https://github.com/agenticworkflowprotocol/agenticworkflowprotocol.org/blob/main/docs/cli.md#3-diagnostics):
72
+ `severity`, `code` (stable), `message`, `path` (JSON Pointer), `section`, `document`, `source`.
73
+
74
+ Further exports: `formatText`, `formatJson` (the `awp validate` formats), `manifestDigest`, `jcs`,
75
+ `schema`, `provenance`, `KNOWN_PROFILES`. Types are included (`types/index.d.ts`). The schema file
76
+ is also available as `@agenticworkflowprotocol/validator/schema.json`.
77
+
78
+ ### Embedding in a runtime
79
+
80
+ A runtime that supports only some profiles passes exactly those, so that manifests with fields of
81
+ other profiles are rejected instead of being run without them:
82
+
83
+ ```js
84
+ const { valid, diagnostics } = validateManifest(manifest, { profiles: ['core', 'mcp'] });
85
+ if (!valid) throw new ManifestRejected(diagnostics.filter((d) => d.severity === 'error'));
86
+ // Runtime-specific rules (deployment policy) come after this check and may only be stricter.
87
+ ```
88
+
89
+ ### Browser
90
+
91
+ ```js
92
+ import { validateText } from '@agenticworkflowprotocol/validator/browser';
93
+ ```
94
+
95
+ The browser entry is a single bundled ES module (`dist/browser/awp-validator.mjs`, also attached
96
+ to every release). The JSON Schema validator is precompiled, so it runs under a
97
+ Content-Security-Policy without `unsafe-eval`, and digests use a synchronous SHA-2 implementation.
98
+
99
+ ## Specification pin
100
+
101
+ `vendor/awp-v1alpha1/` is an unchanged copy of the schema, the semantic rules, the conformance
102
+ suite and the examples of the specification repository at the commit recorded in
103
+ `PROVENANCE.json`, with a SHA-256 hash per file. `npm test` fails if a vendored file differs.
104
+
105
+ Update to a newer specification commit:
106
+
107
+ ```sh
108
+ node scripts/sync-spec.mjs ../agenticworkflowprotocol.org # clean checkout at the wanted commit
109
+ npm test
110
+ ```
111
+
112
+ ## Development
113
+
114
+ ```sh
115
+ npm ci
116
+ npm test # builds dist/, then runs the conformance suite (Node.js and browser bundle) and unit tests
117
+ npm run build # dist/browser/ and dist/site/
118
+ ```
119
+
120
+ The website in `site/` is built into `dist/site/` and deployed by Cloudflare Pages
121
+ (build command `npm ci && npm run build`, output directory `dist/site`).
122
+
123
+ ## License
124
+
125
+ Apache-2.0. The vendored specification files keep their licenses (`vendor/awp-v1alpha1/LICENSE`,
126
+ `LICENSE-SPEC`). The browser bundle includes ajv (MIT), yaml (ISC) and @noble/hashes (MIT).
127
+
128
+ AWP provides machine-readable governance primitives that can help organizations implement and
129
+ enforce their own compliance requirements. Compliance depends on the implementation,
130
+ organizational controls and applicable regulatory requirements.
package/bin/awp.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli.js';
3
+
4
+ try {
5
+ process.exitCode = main(process.argv.slice(2));
6
+ } catch (err) {
7
+ // Internal error: exit code 3 (the command could not do its work), no stack trace for users.
8
+ process.stderr.write(`awp: internal error: ${err.message}\n`);
9
+ process.exitCode = 3;
10
+ }