openplanr 3.0.1 → 3.1.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.
- package/CHANGELOG.md +35 -0
- package/README.md +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +24 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/init-deterministic.d.ts.map +1 -1
- package/dist/cli/commands/init-deterministic.js +49 -6
- package/dist/cli/commands/init-deterministic.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +2 -2
- package/dist/dashboard/assets/{index-Bk8DyO_2.css → index-BU5fzjyz.css} +1 -1
- package/dist/dashboard/assets/index-G7ygVDGg.js +572 -0
- package/dist/dashboard/assets/index-G7ygVDGg.js.map +1 -0
- package/dist/dashboard/dashboard-manifest.json +14 -14
- package/dist/dashboard/index.html +2 -2
- package/dist/models/types.d.ts +0 -46
- package/dist/models/types.d.ts.map +1 -1
- package/dist/services/capability-map-service.d.ts +4 -0
- package/dist/services/capability-map-service.d.ts.map +1 -1
- package/dist/services/capability-map-service.js +7 -1
- package/dist/services/capability-map-service.js.map +1 -1
- package/dist/services/claude-plugin-service.d.ts +6 -1
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +54 -15
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/config-service.d.ts +24 -1
- package/dist/services/config-service.d.ts.map +1 -1
- package/dist/services/config-service.js +69 -2
- package/dist/services/config-service.js.map +1 -1
- package/dist/services/git-service.d.ts +5 -0
- package/dist/services/git-service.d.ts.map +1 -1
- package/dist/services/git-service.js +27 -0
- package/dist/services/git-service.js.map +1 -1
- package/dist/services/global-install-service.d.ts +24 -0
- package/dist/services/global-install-service.d.ts.map +1 -0
- package/dist/services/global-install-service.js +68 -0
- package/dist/services/global-install-service.js.map +1 -0
- package/dist/services/linear-pull-service.d.ts.map +1 -1
- package/dist/services/linear-pull-service.js +1 -2
- package/dist/services/linear-pull-service.js.map +1 -1
- package/dist/services/pipeline-package-service.d.ts +2 -0
- package/dist/services/pipeline-package-service.d.ts.map +1 -1
- package/dist/services/pipeline-package-service.js +2 -1
- package/dist/services/pipeline-package-service.js.map +1 -1
- package/dist/services/runtime-change-summary.d.ts.map +1 -1
- package/dist/services/runtime-change-summary.js +4 -0
- package/dist/services/runtime-change-summary.js.map +1 -1
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +14 -3
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/spec-service.d.ts.map +1 -1
- package/dist/services/spec-service.js +11 -22
- package/dist/services/spec-service.js.map +1 -1
- package/dist/services/upgrade-service.d.ts +15 -1
- package/dist/services/upgrade-service.d.ts.map +1 -1
- package/dist/services/upgrade-service.js +105 -14
- package/dist/services/upgrade-service.js.map +1 -1
- package/dist/templates/rules/shared/capability-map.md.hbs +2 -2
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +89 -29
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +69 -37
- package/lib/host-packages/claude/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/claude/openplanr/README.md +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/claude/openplanr/skills/connect/SKILL.md +60 -0
- package/lib/host-packages/claude/openplanr/skills/connect/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/openplanr/SKILL.md +4 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +4 -1
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/claude/openplanr/skills/share/SKILL.md +87 -0
- package/lib/host-packages/claude/openplanr/skills/share/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +6 -3
- package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +15 -6
- package/lib/host-packages/claude/openplanr/skills/sprint/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +14 -3
- package/lib/host-packages/claude/openplanr/skills/status/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/status/references/tracker-connections.md +9 -13
- package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +25 -10
- package/lib/host-packages/claude/openplanr/skills/sync/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/sync/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +68 -36
- package/lib/host-packages/cursor/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/cursor/openplanr/manifest.json +4 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-connect/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-connect.mdc +58 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-openplanr.mdc +4 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +4 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-share/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-share.mdc +85 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +6 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +15 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-status/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-status/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +14 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +25 -10
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +87 -39
- package/lib/host-packages/openai/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
- package/lib/host-packages/openai/openplanr/skills/connect/SKILL.md +59 -0
- package/lib/host-packages/openai/openplanr/skills/connect/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/connect/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/connect/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/openplanr/SKILL.md +4 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +4 -1
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/openai/openplanr/skills/share/SKILL.md +86 -0
- package/lib/host-packages/openai/openplanr/skills/share/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/share/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/share/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +6 -3
- package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +15 -6
- package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/sprint/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +14 -3
- package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/status/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/status/references/tracker-connections.md +9 -13
- package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +25 -10
- package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/sync/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/sync/references/tracker-connections.md +9 -13
- package/lib/json-schema.mjs +313 -36
- package/lib/schemas/v1.0.0/spec.schema.json +120 -0
- package/lib/schemas/v1.0.0/story.schema.json +95 -0
- package/lib/schemas/v1.0.0/task.schema.json +171 -0
- package/lib/schemas/v1.7.0/spec.schema.json +117 -0
- package/lib/schemas/v1.7.0/story.schema.json +107 -0
- package/lib/schemas/v1.7.0/task.schema.json +217 -0
- package/package.json +31 -31
- package/dist/dashboard/assets/index-n08LJ6bK.js +0 -557
- package/dist/dashboard/assets/index-n08LJ6bK.js.map +0 -1
- package/dist/services/audit-log-service.d.ts +0 -47
- package/dist/services/audit-log-service.d.ts.map +0 -1
- package/dist/services/audit-log-service.js +0 -211
- package/dist/services/audit-log-service.js.map +0 -1
- package/dist/services/delta-apply-service.d.ts +0 -16
- package/dist/services/delta-apply-service.d.ts.map +0 -1
- package/dist/services/delta-apply-service.js +0 -74
- package/dist/services/delta-apply-service.js.map +0 -1
- package/dist/services/evidence-verifier.d.ts +0 -71
- package/dist/services/evidence-verifier.d.ts.map +0 -1
- package/dist/services/evidence-verifier.js +0 -174
- package/dist/services/evidence-verifier.js.map +0 -1
- package/dist/services/revise-apply-service.d.ts +0 -55
- package/dist/services/revise-apply-service.d.ts.map +0 -1
- package/dist/services/revise-apply-service.js +0 -265
- package/dist/services/revise-apply-service.js.map +0 -1
- package/dist/services/revise-cache-service.d.ts +0 -46
- package/dist/services/revise-cache-service.d.ts.map +0 -1
- package/dist/services/revise-cache-service.js +0 -89
- package/dist/services/revise-cache-service.js.map +0 -1
- package/dist/services/revise-plan-service.d.ts +0 -38
- package/dist/services/revise-plan-service.d.ts.map +0 -1
- package/dist/services/revise-plan-service.js +0 -153
- package/dist/services/revise-plan-service.js.map +0 -1
- /package/lib/host-packages/claude/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
- /package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
- /package/lib/host-packages/openai/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
|
@@ -68,17 +68,179 @@ var matchesType = (v, t) => {
|
|
|
68
68
|
};
|
|
69
69
|
var FORMAT_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
70
70
|
var FORMAT_DATETIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
71
|
+
var SUPPORTED_FORMATS = /* @__PURE__ */ new Set(["date", "date-time"]);
|
|
72
|
+
var ANNOTATION_KEYWORDS = [
|
|
73
|
+
"$schema",
|
|
74
|
+
"$id",
|
|
75
|
+
"$defs",
|
|
76
|
+
"$comment",
|
|
77
|
+
"title",
|
|
78
|
+
"description",
|
|
79
|
+
"default",
|
|
80
|
+
"examples",
|
|
81
|
+
"deprecated",
|
|
82
|
+
"readOnly",
|
|
83
|
+
"writeOnly"
|
|
84
|
+
];
|
|
85
|
+
var VALIDATION_KEYWORDS = [
|
|
86
|
+
"$ref",
|
|
87
|
+
"type",
|
|
88
|
+
"const",
|
|
89
|
+
"enum",
|
|
90
|
+
"minLength",
|
|
91
|
+
"maxLength",
|
|
92
|
+
"pattern",
|
|
93
|
+
"format",
|
|
94
|
+
"minimum",
|
|
95
|
+
"maximum",
|
|
96
|
+
"exclusiveMinimum",
|
|
97
|
+
"minItems",
|
|
98
|
+
"maxItems",
|
|
99
|
+
"prefixItems",
|
|
100
|
+
"items",
|
|
101
|
+
"uniqueItems",
|
|
102
|
+
"contains",
|
|
103
|
+
"minContains",
|
|
104
|
+
"maxContains",
|
|
105
|
+
"required",
|
|
106
|
+
"properties",
|
|
107
|
+
"additionalProperties",
|
|
108
|
+
"maxProperties",
|
|
109
|
+
"dependentRequired",
|
|
110
|
+
"unevaluatedProperties",
|
|
111
|
+
"oneOf",
|
|
112
|
+
"anyOf",
|
|
113
|
+
"allOf",
|
|
114
|
+
"if",
|
|
115
|
+
"then",
|
|
116
|
+
"else",
|
|
117
|
+
"not"
|
|
118
|
+
];
|
|
119
|
+
var KNOWN_KEYWORDS = /* @__PURE__ */ new Set([...ANNOTATION_KEYWORDS, ...VALIDATION_KEYWORDS]);
|
|
120
|
+
var TYPE_NAMES = /* @__PURE__ */ new Set(["array", "boolean", "integer", "null", "number", "object", "string"]);
|
|
121
|
+
var isSchema = (value) => typeof value === "boolean" || value !== null && typeof value === "object" && !Array.isArray(value);
|
|
122
|
+
var isPlainObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
123
|
+
var isCount = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
124
|
+
var isUniqueStrings = (value) => Array.isArray(value) && value.every((item2) => typeof item2 === "string") && new Set(value).size === value.length;
|
|
125
|
+
var isSchemaArray = (value) => Array.isArray(value) && value.length > 0 && value.every(isSchema);
|
|
126
|
+
var isSchemaMap = (value) => isPlainObject(value) && Object.values(value).every(isSchema);
|
|
127
|
+
var compiledPatterns = /* @__PURE__ */ new Map();
|
|
128
|
+
var MAX_COMPILED_PATTERNS = 1024;
|
|
129
|
+
var tryCompilePattern = (source) => {
|
|
130
|
+
try {
|
|
131
|
+
return new RegExp(source);
|
|
132
|
+
} catch (error) {
|
|
133
|
+
if (error instanceof SyntaxError) return null;
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var compilePattern = (source) => {
|
|
138
|
+
if (!compiledPatterns.has(source)) {
|
|
139
|
+
if (compiledPatterns.size >= MAX_COMPILED_PATTERNS) compiledPatterns.clear();
|
|
140
|
+
compiledPatterns.set(source, tryCompilePattern(source));
|
|
141
|
+
}
|
|
142
|
+
return compiledPatterns.get(source) ?? null;
|
|
143
|
+
};
|
|
144
|
+
var describeValue = (value) => {
|
|
145
|
+
const text3 = String(JSON.stringify(value));
|
|
146
|
+
return text3.length > 80 ? `${text3.slice(0, 77)}...` : text3;
|
|
147
|
+
};
|
|
148
|
+
var KEYWORD_SHAPES = {
|
|
149
|
+
$ref: ["a string", (value) => typeof value === "string"],
|
|
150
|
+
$defs: ["an object of schemas", isSchemaMap],
|
|
151
|
+
type: [
|
|
152
|
+
"a type name or a non-empty array of unique type names",
|
|
153
|
+
(value) => typeof value === "string" && TYPE_NAMES.has(value) || isUniqueStrings(value) && value.length > 0 && value.every((name) => TYPE_NAMES.has(name))
|
|
154
|
+
],
|
|
155
|
+
enum: ["an array", Array.isArray],
|
|
156
|
+
minLength: ["a non-negative integer", isCount],
|
|
157
|
+
maxLength: ["a non-negative integer", isCount],
|
|
158
|
+
pattern: [
|
|
159
|
+
"a valid regular expression string",
|
|
160
|
+
(value) => typeof value === "string" && compilePattern(value) !== null
|
|
161
|
+
],
|
|
162
|
+
minimum: ["a finite number", Number.isFinite],
|
|
163
|
+
maximum: ["a finite number", Number.isFinite],
|
|
164
|
+
exclusiveMinimum: ["a finite number", Number.isFinite],
|
|
165
|
+
minItems: ["a non-negative integer", isCount],
|
|
166
|
+
maxItems: ["a non-negative integer", isCount],
|
|
167
|
+
prefixItems: ["a non-empty array of schemas", isSchemaArray],
|
|
168
|
+
items: ["a schema", isSchema],
|
|
169
|
+
uniqueItems: ["a boolean", (value) => typeof value === "boolean"],
|
|
170
|
+
contains: ["a schema", isSchema],
|
|
171
|
+
minContains: ["a non-negative integer", isCount],
|
|
172
|
+
maxContains: ["a non-negative integer", isCount],
|
|
173
|
+
required: ["an array of unique strings", isUniqueStrings],
|
|
174
|
+
properties: ["an object of schemas", isSchemaMap],
|
|
175
|
+
additionalProperties: ["a schema", isSchema],
|
|
176
|
+
maxProperties: ["a non-negative integer", isCount],
|
|
177
|
+
dependentRequired: [
|
|
178
|
+
"an object of unique string arrays",
|
|
179
|
+
(value) => isPlainObject(value) && Object.values(value).every(isUniqueStrings)
|
|
180
|
+
],
|
|
181
|
+
unevaluatedProperties: ["a schema", isSchema],
|
|
182
|
+
oneOf: ["a non-empty array of schemas", isSchemaArray],
|
|
183
|
+
anyOf: ["a non-empty array of schemas", isSchemaArray],
|
|
184
|
+
allOf: ["a non-empty array of schemas", isSchemaArray],
|
|
185
|
+
if: ["a schema", isSchema],
|
|
186
|
+
then: ["a schema", isSchema],
|
|
187
|
+
else: ["a schema", isSchema],
|
|
188
|
+
not: ["a schema", isSchema]
|
|
189
|
+
};
|
|
71
190
|
function resolveJsonPointer(root, reference) {
|
|
72
191
|
if (reference === "#") return root;
|
|
73
192
|
if (!reference.startsWith("#/")) return null;
|
|
74
193
|
return reference.slice(2).split("/").map((part) => part.replaceAll("~1", "/").replaceAll("~0", "~")).reduce((value, part) => value?.[part], root);
|
|
75
194
|
}
|
|
195
|
+
var wellFormedSchemas = /* @__PURE__ */ new WeakSet();
|
|
196
|
+
var isFrozenNode = (schema6) => Object.isFrozen(schema6) && Object.values(schema6).every(Object.isFrozen) && (!isPlainObject(schema6.dependentRequired) || Object.values(schema6.dependentRequired).every(Object.isFrozen));
|
|
197
|
+
var checkSchemaNode = (schema6, path, context) => {
|
|
198
|
+
if (wellFormedSchemas.has(schema6) || context.checkedSchemas.has(schema6)) return;
|
|
199
|
+
context.checkedSchemas.add(schema6);
|
|
200
|
+
const errorCount = context.schemaErrors.length;
|
|
201
|
+
for (const keyword of Object.keys(schema6)) {
|
|
202
|
+
if (!KNOWN_KEYWORDS.has(keyword) && !keyword.startsWith("x-")) {
|
|
203
|
+
context.schemaErrors.push({
|
|
204
|
+
path,
|
|
205
|
+
rule: "unsupported-keyword",
|
|
206
|
+
detail: `schema keyword '${keyword}' is not supported by this validator`
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (Object.hasOwn(schema6, "format") && !SUPPORTED_FORMATS.has(schema6.format)) {
|
|
211
|
+
context.schemaErrors.push({
|
|
212
|
+
path,
|
|
213
|
+
rule: "unsupported-format",
|
|
214
|
+
detail: `schema format ${JSON.stringify(schema6.format)} is not supported by this validator`
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
for (const [keyword, [expected, isValid]] of Object.entries(KEYWORD_SHAPES)) {
|
|
218
|
+
if (Object.hasOwn(schema6, keyword) && !isValid(schema6[keyword])) {
|
|
219
|
+
context.schemaErrors.push({
|
|
220
|
+
path,
|
|
221
|
+
rule: "schema",
|
|
222
|
+
detail: `schema keyword '${keyword}' must be ${expected}, got ${describeValue(schema6[keyword])}`
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (context.schemaErrors.length === errorCount && isFrozenNode(schema6)) {
|
|
227
|
+
wellFormedSchemas.add(schema6);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var reportReference = (schema6, path, detail, context) => {
|
|
231
|
+
if (context.reportedReferences.has(schema6)) return;
|
|
232
|
+
context.reportedReferences.add(schema6);
|
|
233
|
+
context.schemaErrors.push({ path, rule: "$ref", detail });
|
|
234
|
+
};
|
|
76
235
|
var validateNode = (value, schema6, path, errs, context) => {
|
|
77
|
-
|
|
236
|
+
const evaluated = /* @__PURE__ */ new Set();
|
|
237
|
+
if (schema6 === true) return evaluated;
|
|
78
238
|
if (schema6 === false) {
|
|
79
239
|
errs.push({ path, rule: "schema:false", detail: "value not allowed" });
|
|
80
|
-
return;
|
|
240
|
+
return evaluated;
|
|
81
241
|
}
|
|
242
|
+
if (!isSchema(schema6)) return evaluated;
|
|
243
|
+
checkSchemaNode(schema6, path, context);
|
|
82
244
|
if (typeof schema6?.$ref === "string") {
|
|
83
245
|
const reference = schema6.$ref;
|
|
84
246
|
let resolved;
|
|
@@ -92,21 +254,23 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
92
254
|
nextRoot = result?.rootSchema ?? resolved;
|
|
93
255
|
resolvedBase = result?.base ?? resolved?.$id ?? context.base;
|
|
94
256
|
}
|
|
95
|
-
if (!resolved) {
|
|
96
|
-
|
|
97
|
-
|
|
257
|
+
if (!isSchema(resolved)) {
|
|
258
|
+
const detail = resolved === void 0 || resolved === null ? `could not resolve schema reference ${reference}` : `schema reference ${reference} resolved to ${typeOf(resolved)}, not a schema`;
|
|
259
|
+
reportReference(schema6, path, detail, context);
|
|
260
|
+
return evaluated;
|
|
98
261
|
}
|
|
99
|
-
const referenceKey = `${context.base ?? "<root>"}:${reference}`;
|
|
262
|
+
const referenceKey = `${path} ${context.base ?? "<root>"}:${reference}`;
|
|
100
263
|
if (context.referenceStack.includes(referenceKey)) {
|
|
101
|
-
|
|
102
|
-
return;
|
|
264
|
+
reportReference(schema6, path, `circular schema reference ${reference}`, context);
|
|
265
|
+
return evaluated;
|
|
103
266
|
}
|
|
104
|
-
validateNode(value, resolved, path, errs, {
|
|
267
|
+
const referenced = validateNode(value, resolved, path, errs, {
|
|
105
268
|
...context,
|
|
106
269
|
rootSchema: nextRoot,
|
|
107
270
|
base: resolvedBase,
|
|
108
271
|
referenceStack: [...context.referenceStack, referenceKey]
|
|
109
272
|
});
|
|
273
|
+
for (const key of referenced) evaluated.add(key);
|
|
110
274
|
}
|
|
111
275
|
if (schema6.type !== void 0) {
|
|
112
276
|
const types = Array.isArray(schema6.type) ? schema6.type : [schema6.type];
|
|
@@ -116,7 +280,7 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
116
280
|
rule: "type",
|
|
117
281
|
detail: `expected ${types.join("|")}, got ${typeOf(value)}`
|
|
118
282
|
});
|
|
119
|
-
return;
|
|
283
|
+
return evaluated;
|
|
120
284
|
}
|
|
121
285
|
}
|
|
122
286
|
if (schema6.const !== void 0) {
|
|
@@ -152,22 +316,13 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
152
316
|
detail: `length ${value.length} > ${schema6.maxLength}`
|
|
153
317
|
});
|
|
154
318
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
} catch (e) {
|
|
165
|
-
errs.push({
|
|
166
|
-
path,
|
|
167
|
-
rule: "pattern",
|
|
168
|
-
detail: `invalid regex /${schema6.pattern}/: ${e instanceof Error ? e.message : String(e)}`
|
|
169
|
-
});
|
|
170
|
-
}
|
|
319
|
+
const pattern = typeof schema6.pattern === "string" ? compilePattern(schema6.pattern) : null;
|
|
320
|
+
if (pattern && !pattern.test(value)) {
|
|
321
|
+
errs.push({
|
|
322
|
+
path,
|
|
323
|
+
rule: "pattern",
|
|
324
|
+
detail: `value ${JSON.stringify(value)} does not match /${schema6.pattern}/`
|
|
325
|
+
});
|
|
171
326
|
}
|
|
172
327
|
if (typeof schema6.format === "string") {
|
|
173
328
|
if (schema6.format === "date" && !FORMAT_DATE.test(value)) {
|
|
@@ -192,6 +347,13 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
192
347
|
if (typeof schema6.maximum === "number" && value > schema6.maximum) {
|
|
193
348
|
errs.push({ path, rule: "maximum", detail: `value ${value} > ${schema6.maximum}` });
|
|
194
349
|
}
|
|
350
|
+
if (typeof schema6.exclusiveMinimum === "number" && value <= schema6.exclusiveMinimum) {
|
|
351
|
+
errs.push({
|
|
352
|
+
path,
|
|
353
|
+
rule: "exclusiveMinimum",
|
|
354
|
+
detail: `value ${value} <= ${schema6.exclusiveMinimum}`
|
|
355
|
+
});
|
|
356
|
+
}
|
|
195
357
|
}
|
|
196
358
|
if (Array.isArray(value)) {
|
|
197
359
|
if (typeof schema6.minItems === "number" && value.length < schema6.minItems) {
|
|
@@ -255,8 +417,31 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
255
417
|
}
|
|
256
418
|
}
|
|
257
419
|
}
|
|
420
|
+
if (typeof schema6.maxProperties === "number" && Object.keys(value).length > schema6.maxProperties) {
|
|
421
|
+
errs.push({
|
|
422
|
+
path,
|
|
423
|
+
rule: "maxProperties",
|
|
424
|
+
detail: `property count ${Object.keys(value).length} > ${schema6.maxProperties}`
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
if (schema6.dependentRequired !== null && typeof schema6.dependentRequired === "object") {
|
|
428
|
+
for (const [trigger, dependencies] of Object.entries(schema6.dependentRequired)) {
|
|
429
|
+
if (!Object.hasOwn(value, trigger) || !Array.isArray(dependencies)) continue;
|
|
430
|
+
for (const dependency of dependencies) {
|
|
431
|
+
if (!Object.hasOwn(value, dependency)) {
|
|
432
|
+
errs.push({
|
|
433
|
+
path,
|
|
434
|
+
rule: "dependentRequired",
|
|
435
|
+
detail: `property '${trigger}' requires property '${dependency}'`
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
258
441
|
const props = schema6.properties || {};
|
|
259
442
|
for (const [k, v] of Object.entries(value)) {
|
|
443
|
+
if (Object.hasOwn(props, k)) evaluated.add(k);
|
|
444
|
+
else if (schema6.additionalProperties !== void 0) evaluated.add(k);
|
|
260
445
|
if (!Object.hasOwn(props, k)) {
|
|
261
446
|
if (schema6.additionalProperties === false) {
|
|
262
447
|
errs.push({ path, rule: "additionalProperties", detail: `unknown property '${k}'` });
|
|
@@ -273,8 +458,11 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
273
458
|
let matched = 0;
|
|
274
459
|
for (const sub of schema6.oneOf) {
|
|
275
460
|
const e = [];
|
|
276
|
-
validateNode(value, sub, path, e, context);
|
|
277
|
-
if (e.length === 0)
|
|
461
|
+
const branch = validateNode(value, sub, path, e, context);
|
|
462
|
+
if (e.length === 0) {
|
|
463
|
+
matched++;
|
|
464
|
+
for (const key of branch) evaluated.add(key);
|
|
465
|
+
}
|
|
278
466
|
}
|
|
279
467
|
if (matched !== 1) {
|
|
280
468
|
const titles = schema6.oneOf.map((s) => s.title || "(unnamed)").join(" | ");
|
|
@@ -289,8 +477,11 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
289
477
|
let matched = 0;
|
|
290
478
|
for (const sub of schema6.anyOf) {
|
|
291
479
|
const candidateErrors = [];
|
|
292
|
-
validateNode(value, sub, path, candidateErrors, context);
|
|
293
|
-
if (candidateErrors.length === 0)
|
|
480
|
+
const branch = validateNode(value, sub, path, candidateErrors, context);
|
|
481
|
+
if (candidateErrors.length === 0) {
|
|
482
|
+
matched += 1;
|
|
483
|
+
for (const key of branch) evaluated.add(key);
|
|
484
|
+
}
|
|
294
485
|
}
|
|
295
486
|
if (matched === 0) {
|
|
296
487
|
const titles = schema6.anyOf.map((sub) => sub.title || "(unnamed)").join(" | ");
|
|
@@ -303,14 +494,21 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
303
494
|
}
|
|
304
495
|
if (Array.isArray(schema6.allOf)) {
|
|
305
496
|
for (const sub of schema6.allOf) {
|
|
306
|
-
validateNode(value, sub, path, errs, context);
|
|
497
|
+
for (const key of validateNode(value, sub, path, errs, context)) evaluated.add(key);
|
|
307
498
|
}
|
|
308
499
|
}
|
|
309
500
|
if (schema6.if !== void 0) {
|
|
310
501
|
const conditionErrors = [];
|
|
311
|
-
validateNode(value, schema6.if, path, conditionErrors, context);
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
502
|
+
const condition = validateNode(value, schema6.if, path, conditionErrors, context);
|
|
503
|
+
const passed = conditionErrors.length === 0;
|
|
504
|
+
if (passed) for (const key of condition) evaluated.add(key);
|
|
505
|
+
const branch = passed ? schema6.then : schema6.else;
|
|
506
|
+
if (branch !== void 0) {
|
|
507
|
+
const branchErrors = [];
|
|
508
|
+
const branchEvaluated = validateNode(value, branch, path, branchErrors, context);
|
|
509
|
+
errs.push(...branchErrors);
|
|
510
|
+
if (branchErrors.length === 0) for (const key of branchEvaluated) evaluated.add(key);
|
|
511
|
+
}
|
|
314
512
|
}
|
|
315
513
|
if (schema6.not !== void 0) {
|
|
316
514
|
const e = [];
|
|
@@ -319,6 +517,18 @@ var validateNode = (value, schema6, path, errs, context) => {
|
|
|
319
517
|
errs.push({ path, rule: "not", detail: "value matched a forbidden subschema" });
|
|
320
518
|
}
|
|
321
519
|
}
|
|
520
|
+
if (schema6.unevaluatedProperties !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
521
|
+
for (const [k, v] of Object.entries(value)) {
|
|
522
|
+
if (evaluated.has(k)) continue;
|
|
523
|
+
if (schema6.unevaluatedProperties === false) {
|
|
524
|
+
errs.push({ path, rule: "unevaluatedProperties", detail: `unevaluated property '${k}'` });
|
|
525
|
+
} else {
|
|
526
|
+
validateNode(v, schema6.unevaluatedProperties, `${path}.${k}`, errs, context);
|
|
527
|
+
}
|
|
528
|
+
evaluated.add(k);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return evaluated;
|
|
322
532
|
};
|
|
323
533
|
var validateJson = (value, schema6, {
|
|
324
534
|
resolveRef,
|
|
@@ -328,13 +538,26 @@ var validateJson = (value, schema6, {
|
|
|
328
538
|
)
|
|
329
539
|
} = {}) => {
|
|
330
540
|
const errs = [];
|
|
541
|
+
const schemaErrors = [];
|
|
542
|
+
if (!isSchema(schema6)) {
|
|
543
|
+
return [
|
|
544
|
+
{
|
|
545
|
+
path: "$",
|
|
546
|
+
rule: "schema",
|
|
547
|
+
detail: `expected a schema object or boolean, got ${typeOf(schema6)}`
|
|
548
|
+
}
|
|
549
|
+
];
|
|
550
|
+
}
|
|
331
551
|
validateNode(value, schema6, "$", errs, {
|
|
332
552
|
rootSchema: schema6,
|
|
333
553
|
resolveRef,
|
|
334
554
|
base,
|
|
335
|
-
referenceStack: []
|
|
555
|
+
referenceStack: [],
|
|
556
|
+
schemaErrors,
|
|
557
|
+
checkedSchemas: /* @__PURE__ */ new WeakSet(),
|
|
558
|
+
reportedReferences: /* @__PURE__ */ new WeakSet()
|
|
336
559
|
});
|
|
337
|
-
return errs;
|
|
560
|
+
return [...schemaErrors, ...errs];
|
|
338
561
|
};
|
|
339
562
|
|
|
340
563
|
// packages/protocol/src/enterprise-contract-validation.mjs
|