motionspec 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -20,8 +20,9 @@ request ──> Routing (small model, Stage A) ──> MotionSpec (JSON)
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Version | **v1.0.0** · schema frozen at spec v1 (ADR-0001, signed) |
24
- | Tests | **151** green · CI on Node 18/20/22 |
23
+ | Version | **v1.0.3** · schema frozen at spec v1 (ADR-0001, signed) |
24
+ | Published | **npm `motionspec`** · MCP Registry `io.github.MasterPlayspots/motionspec` |
25
+ | Tests | **155** green · CI on Node 18/20/22 |
25
26
  | Catalog | **8** primitives, all device-verified |
26
27
  | Dependencies | **0 vulnerabilities** · SBOM committed · all permissive licenses |
27
28
  | Coverage | **98.4% lines / 95.9% functions** of `src/` + `worker/` (CI gate fails under 90%) |
@@ -31,7 +32,22 @@ request ──> Routing (small model, Stage A) ──> MotionSpec (JSON)
31
32
 
32
33
  Schema v1 is frozen: `specVersion "1.0"` is the stable public contract; `"0.1"` is deprecated and accepted until v1.2. The `[MS-XXX]` error-code registry is public API. Phase B (test & security) is closed — CI is green on the x86 runner incl. Playwright `e2e` for every primitive (all jobs pass on every push to `main` — see the repo Actions tab; the x86 runner is the source of truth). **Phase C (observability + hosted MCP) is live and gate-proven**: the MCP server runs as a private, secret-gated Cloudflare Worker; a per-minute cron canary runs `validate→compile` and pings an external heartbeat, so a failure alerts by email within 5 minutes (verified on real infra). A gated `/dashboard` renders live telemetry.
33
34
 
34
- ## Quickstart
35
+ ## Install
36
+
37
+ ```bash
38
+ npm install -g motionspec # CLI: `motion compile spec.json` writes ./out in your cwd
39
+ npx motionspec # start the stdio MCP server (no global install needed)
40
+ ```
41
+
42
+ Use it as an MCP server in any MCP-capable agent (Claude Code, Cowork, Cursor, …) — the host LLM authors the spec, the Trust Boundary stays enforced:
43
+
44
+ ```bash
45
+ claude mcp add motionspec -- npx motionspec
46
+ ```
47
+
48
+ Listed on the MCP Registry as `io.github.MasterPlayspots/motionspec`.
49
+
50
+ ## Quickstart (from a clone of the repo)
35
51
 
36
52
  ```bash
37
53
  npm ci # install (0 runtime deps beyond MCP SDK + zod)
@@ -59,10 +75,12 @@ npm run e2e # real-browser Playwright (CI x86 only — the sandbox
59
75
  Any MCP-capable agent (Claude Code, Cowork, Cursor, …) can use MotionSpec directly — the host LLM is the spec author, the Trust Boundary stays enforced:
60
76
 
61
77
  ```bash
62
- npm run mcp # start stdio server
63
- claude mcp add motionspec -- node <repo>/src/mcp/server.mjs
78
+ npx motionspec # start stdio server from the published package
79
+ claude mcp add motionspec -- npx motionspec # register in a host agent
64
80
  ```
65
81
 
82
+ From a clone of the repo, `npm run mcp` runs the same server. Listed on the MCP Registry as `io.github.MasterPlayspots/motionspec`.
83
+
66
84
  Tools: `motion_catalog` (primitives + authoring rules) · `motion_validate` (fail-closed, surfaces deprecations) · `motion_compile` (deterministic) · `motion_stats`. Input is size-capped (`MS-INPUT-TOO-LARGE`, 64 KB). Tested in `test/mcp.test.mjs`.
67
85
 
68
86
  ## Guarantees
package/bin/motion.js CHANGED
@@ -20,8 +20,10 @@ const { route } = require("../src/router/route.js");
20
20
  const { mockClient, openAICompatClient } = require("../src/router/clients.js");
21
21
  const telemetry = require("../src/router/telemetry.js");
22
22
 
23
- const ROOT = path.join(__dirname, "..");
24
- const OUT = path.join(ROOT, "out");
23
+ /* Ausgabe relativ zum Arbeitsverzeichnis des Nutzers, NICHT zum Paket-Pfad.
24
+ * Sonst schreibt der installierte Bin in node_modules/motionspec/out (beim
25
+ * globalen Install droht EACCES) und der Nutzer findet seine Artefakte nicht. */
26
+ const OUT = path.join(process.cwd(), "out");
25
27
 
26
28
  function writeOut(name, result) {
27
29
  if (!fs.existsSync(OUT)) fs.mkdirSync(OUT, { recursive: true });
@@ -72,7 +74,7 @@ async function main() {
72
74
  if (!fs.existsSync(OUT)) fs.mkdirSync(OUT, { recursive: true });
73
75
  const md = path.join(OUT, "gap-report-" + (r.project || "discovery") + ".md");
74
76
  fs.writeFileSync(md, toMarkdown(r));
75
- console.log("\n Discovery: " + r.covered.length + "/" + r.total + " abgedeckt, " + r.gaps.length + " Luecke(n) -> " + path.relative(ROOT, md) + "\n");
77
+ console.log("\n Discovery: " + r.covered.length + "/" + r.total + " abgedeckt, " + r.gaps.length + " Luecke(n) -> " + path.relative(process.cwd(), md) + "\n");
76
78
  return;
77
79
  }
78
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motionspec",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "mcpName": "io.github.MasterPlayspots/motionspec",
5
5
  "description": "MotionSpec — a formal intermediate language for scroll-driven web motion. A small model writes schema-validated specs; a deterministic compiler emits GSAP/CSS, hallucination-proof by construction with enforced reduced-motion fallbacks.",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "catalog.lock.json"
39
39
  ],
40
40
  "scripts": {
41
- "test": "node --test test/validate.test.js test/compile.test.js test/specversion-v1.test.js test/route.test.js test/route-live.test.js test/catalog-wave1.test.js test/catalog-semver.test.js test/schema-parity.test.js test/catalog-pin.test.js test/css-safety.test.js test/fuzz.test.js test/hardening.test.js test/cache.test.js test/errorcodes.test.js test/catalog-integrity.test.js test/discover.test.js test/telemetry-sink.test.js test/worker-contract.test.mjs test/analytics-engine-sink.test.mjs test/canary.test.mjs test/dashboard.test.mjs test/mcp.test.mjs",
41
+ "test": "node --test test/validate.test.js test/compile.test.js test/specversion-v1.test.js test/route.test.js test/route-live.test.js test/catalog-wave1.test.js test/catalog-semver.test.js test/schema-parity.test.js test/catalog-pin.test.js test/css-safety.test.js test/fuzz.test.js test/hardening.test.js test/cache.test.js test/errorcodes.test.js test/catalog-integrity.test.js test/discover.test.js test/telemetry-sink.test.js test/worker-contract.test.mjs test/analytics-engine-sink.test.mjs test/canary.test.mjs test/dashboard.test.mjs test/mcp.test.mjs test/cli-output.test.mjs",
42
42
  "coverage": "node --test --experimental-test-coverage --test-coverage-exclude=test/** --test-coverage-exclude=bin/** --test-coverage-lines=90 --test-coverage-functions=90 --test-coverage-branches=75 test/*.test.js test/*.test.mjs",
43
43
  "e2e": "playwright test",
44
44
  "sbom": "npm sbom --sbom-format cyclonedx --omit dev > sbom.cdx.json",