@motion-proto/live-tokens 0.87.1 → 0.89.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 (28) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.json +1 -1
  3. package/src/demo/TestingLoops.svelte +100 -0
  4. package/src/demo/evalResults.ts +62 -0
  5. package/src/editor/component-editor/ImageEditor.svelte +25 -14
  6. package/src/editor/skill-atlas/SkillAtlas.svelte +44 -65
  7. package/src/live-tokens/data/themes/autumn.json +4 -0
  8. package/src/live-tokens/data/themes/halloween.json +4 -0
  9. package/src/live-tokens/data/themes/midnight-study.json +4 -0
  10. package/src/live-tokens/data/themes/ocean.json +4 -0
  11. package/src/live-tokens/data/themes/royal-velvet.json +4 -0
  12. package/src/live-tokens/data/themes/sketchy.json +4 -0
  13. package/src/live-tokens/data/themes/spring-meadow.json +4 -0
  14. package/src/live-tokens/data/themes/sunset.json +4 -0
  15. package/src/system/components/Image.svelte +18 -4
  16. package/src/testing-js/{chunk-FTLASW2R.js → chunk-7VSUGI2C.js} +15 -12
  17. package/src/testing-js/chunk-7VSUGI2C.js.map +1 -0
  18. package/src/testing-js/{chunk-NXRFTTVL.js → chunk-YFNMYU54.js} +2 -2
  19. package/src/testing-js/component-behavior.contract.js +1 -1
  20. package/src/testing-js/component-editor.contract.js +1 -1
  21. package/src/testing-js/component-render.contract.js +1 -1
  22. package/src/testing-js/index.js +2 -2
  23. package/src/testing-js/page-compliance.contract.js +1 -1
  24. package/src/testing-js/vitest.js +2 -2
  25. package/src/editor/skill-atlas/SkillValue.svelte +0 -202
  26. package/src/editor/skill-atlas/evalResults.ts +0 -46
  27. package/src/testing-js/chunk-FTLASW2R.js.map +0 -1
  28. /package/src/testing-js/{chunk-NXRFTTVL.js.map → chunk-YFNMYU54.js.map} +0 -0
@@ -8,7 +8,7 @@ import "./chunk-3UKGXCDL.js";
8
8
  import "./chunk-NB3NZRBM.js";
9
9
  import {
10
10
  selectedContracts
11
- } from "./chunk-FTLASW2R.js";
11
+ } from "./chunk-7VSUGI2C.js";
12
12
 
13
13
  // src/testing/component-render.contract.ts
14
14
  import fs from "fs";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-3UKGXCDL.js";
7
7
  import {
8
8
  createVitestConfig
9
- } from "./chunk-NXRFTTVL.js";
9
+ } from "./chunk-YFNMYU54.js";
10
10
  import {
11
11
  COMPONENTS_PATH_ENV,
12
12
  COMPONENT_ENV,
@@ -23,7 +23,7 @@ import {
23
23
  allContracts,
24
24
  selectedContracts,
25
25
  shippedContracts
26
- } from "./chunk-FTLASW2R.js";
26
+ } from "./chunk-7VSUGI2C.js";
27
27
 
28
28
  // src/testing/playwright.ts
29
29
  import path2 from "path";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-NB3NZRBM.js";
9
9
  import {
10
10
  allContracts
11
- } from "./chunk-FTLASW2R.js";
11
+ } from "./chunk-7VSUGI2C.js";
12
12
 
13
13
  // src/testing/page-compliance.contract.ts
14
14
  import { test } from "@playwright/test";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createVitestConfig
3
- } from "./chunk-NXRFTTVL.js";
3
+ } from "./chunk-YFNMYU54.js";
4
4
  import {
5
5
  defineTestingConfig,
6
6
  resolveTestingConfig
7
7
  } from "./chunk-NB3NZRBM.js";
8
- import "./chunk-FTLASW2R.js";
8
+ import "./chunk-7VSUGI2C.js";
9
9
  export {
10
10
  createVitestConfig,
11
11
  defineTestingConfig,
@@ -1,202 +0,0 @@
1
- <script lang="ts">
2
- import Table from '../../system/components/Table.svelte';
3
- import { pickComponentEval } from './evalResults';
4
-
5
- const result = pickComponentEval;
6
- const [withSkills, without] = result.arms;
7
- const difference = (withSkills.score - without.score).toFixed(2);
8
- </script>
9
-
10
- <article class="skill-value" aria-labelledby="skill-value-title">
11
- <div class="measure">
12
- <p class="eyebrow">Measured value</p>
13
- <h2 id="skill-value-title">The skills make an agent faster. The component entries make it right.</h2>
14
- <p class="lead">
15
- An eval asked an agent to choose a component for twelve requirements, three times with the
16
- skills loaded and three times with none. Every run that finished chose all twelve correctly,
17
- in both arms. The skills changed the cost of getting there.
18
- </p>
19
- </div>
20
-
21
- <div class="results">
22
- <Table>
23
- <table>
24
- <thead>
25
- <tr>
26
- <th scope="col"><span class="visually-hidden">Arm</span></th>
27
- <th scope="col">Score</th>
28
- <th scope="col">Requirements right</th>
29
- <th scope="col">Ran the catalogue command</th>
30
- <th scope="col">Turns</th>
31
- <th scope="col">Seconds</th>
32
- </tr>
33
- </thead>
34
- <tbody>
35
- {#each result.arms as arm (arm.label)}
36
- <tr>
37
- <td class="arm">{arm.label}</td>
38
- <td>{arm.score.toFixed(2)}</td>
39
- <td>{arm.rowsRight}</td>
40
- <td>{arm.ranCatalogue}</td>
41
- <td>{arm.turns}</td>
42
- <td>{arm.seconds}</td>
43
- </tr>
44
- {/each}
45
- </tbody>
46
- </table>
47
- </Table>
48
- </div>
49
-
50
- <div class="measure">
51
- <h3>Accuracy comes from the component</h3>
52
- <p>
53
- Each component file carries its own entry: <code>whenToUse</code> states the condition that
54
- makes it right, and <code>whenNotToUse</code> lists the conditions that rule it out, each with
55
- the component to use in its place. An agent with no skills opened the component files, found
56
- those entries, and made the same twelve choices, including the two requirements nothing
57
- shipped fits and the destructive action that belongs in a Dialog.
58
- </p>
59
-
60
- <h3>Efficiency comes from the skill</h3>
61
- <p>
62
- The pick-component skill sends the agent to one command,
63
- <code>npx live-tokens components --json</code>, which returns every entry at once. With the
64
- skills the agent answered in {withSkills.turns} turns and under a minute. Without them it
65
- never found the command, read files one at a time for {without.turns} turns, and one of its
66
- three runs reached the five minute limit before it answered.
67
- </p>
68
-
69
- <h3>Method</h3>
70
- <ul>
71
- <li>Case <code>{result.id}</code>, run on {result.date}.</li>
72
- <li>Twelve requirements: ten with one right component, two that nothing shipped fits.</li>
73
- <li>Three runs per arm. The runner adds the arm without skills on its own.</li>
74
- <li>
75
- Each requirement has its own pattern grader, so a failure names its row. One more grader
76
- checks that the agent ran the catalogue command.
77
- </li>
78
- <li>
79
- The score is the share of graders that pass. The difference of {difference} comes from one
80
- timeout and from the catalogue-command grader. No finished run chose a wrong component.
81
- </li>
82
- </ul>
83
-
84
- <h3>Limits</h3>
85
- <p>
86
- Three runs per arm is a small sample, and one timeout moves the score a long way. The twelve
87
- requirements each have a clear answer in the entries. A harder case, where two components
88
- both fit, has not been measured.
89
- </p>
90
- </div>
91
- </article>
92
-
93
- <style>
94
- /* The atlas locks to the viewport on desktop, so the report scrolls itself. */
95
- .skill-value {
96
- flex: 1 1 auto;
97
- min-height: 0;
98
- overflow-y: auto;
99
- padding-bottom: var(--space-48);
100
- color: var(--text-secondary);
101
- }
102
-
103
- .measure {
104
- max-width: 70ch;
105
- }
106
-
107
- .results {
108
- max-width: 110ch;
109
- margin: var(--space-32) 0 var(--space-40);
110
- }
111
-
112
- .eyebrow {
113
- margin: 0 0 var(--space-8);
114
- font-family: var(--eyebrow-font-family);
115
- font-size: var(--eyebrow-font-size);
116
- font-weight: var(--eyebrow-font-weight);
117
- line-height: var(--eyebrow-line-height);
118
- letter-spacing: var(--eyebrow-letter-spacing);
119
- text-transform: var(--eyebrow-text-transform);
120
- color: var(--text-tertiary);
121
- }
122
-
123
- h2 {
124
- margin: 0 0 var(--space-24);
125
- font-family: var(--heading-lg-font-family);
126
- font-size: var(--heading-lg-font-size);
127
- font-weight: var(--heading-lg-font-weight);
128
- line-height: var(--heading-lg-line-height);
129
- letter-spacing: var(--heading-lg-letter-spacing);
130
- color: var(--text-primary);
131
- }
132
-
133
- h3 {
134
- margin: var(--space-40) 0 var(--space-12);
135
- font-family: var(--heading-sm-font-family);
136
- font-size: var(--heading-sm-font-size);
137
- font-weight: var(--heading-sm-font-weight);
138
- line-height: var(--heading-sm-line-height);
139
- letter-spacing: var(--heading-sm-letter-spacing);
140
- color: var(--text-primary);
141
- }
142
-
143
- .measure > h3:first-child {
144
- margin-top: 0;
145
- }
146
-
147
- p,
148
- li {
149
- font-family: var(--body-md-font-family);
150
- font-size: var(--body-md-font-size);
151
- font-weight: var(--body-md-font-weight);
152
- line-height: var(--body-md-line-height);
153
- letter-spacing: var(--body-md-letter-spacing);
154
- }
155
-
156
- p {
157
- margin: 0 0 var(--space-16);
158
- }
159
-
160
- .lead {
161
- margin-bottom: 0;
162
- color: var(--text-primary);
163
- }
164
-
165
- ul {
166
- margin: 0;
167
- padding-left: var(--space-24);
168
- }
169
-
170
- li + li {
171
- margin-top: var(--space-8);
172
- }
173
-
174
- code {
175
- font-family: var(--code-font-family);
176
- font-size: var(--code-font-size);
177
- font-weight: var(--code-font-weight);
178
- line-height: var(--code-line-height);
179
- letter-spacing: var(--code-letter-spacing);
180
- background: var(--tint-low);
181
- padding-inline: var(--space-4);
182
- border-radius: var(--radius-sm);
183
- /* The code face joins `--` into one dash, and a line may break between the
184
- two hyphens. Either misprints a CLI flag. */
185
- font-variant-ligatures: none;
186
- white-space: nowrap;
187
- }
188
-
189
- .results td.arm {
190
- color: var(--text-primary);
191
- white-space: nowrap;
192
- }
193
-
194
- .visually-hidden {
195
- position: absolute;
196
- width: 1px;
197
- height: 1px;
198
- overflow: hidden;
199
- clip-path: inset(50%);
200
- white-space: nowrap;
201
- }
202
- </style>
@@ -1,46 +0,0 @@
1
- /** One arm of an eval: the same case run with the skills loaded, or without them. */
2
- export interface EvalArm {
3
- label: string;
4
- score: number;
5
- rowsRight: string;
6
- ranCatalogue: string;
7
- turns: string;
8
- seconds: string;
9
- }
10
-
11
- export interface EvalResult {
12
- id: string;
13
- date: string;
14
- packageVersion: string;
15
- runsPerArm: number;
16
- requirements: number;
17
- arms: [withSkills: EvalArm, without: EvalArm];
18
- }
19
-
20
- // Recorded by hand from `npm run eval` in the live-tokens repository. The
21
- // evals do not ship, so the page cannot read a result file at runtime.
22
- export const pickComponentEval: EvalResult = {
23
- id: 'outcome-pick-component',
24
- date: '2026-09-20',
25
- packageVersion: '0.82.0, plus the unreleased catalogue entry',
26
- runsPerArm: 3,
27
- requirements: 12,
28
- arms: [
29
- {
30
- label: 'With the skills',
31
- score: 1,
32
- rowsRight: '12 of 12 in all 3 runs',
33
- ranCatalogue: '3 of 3 runs',
34
- turns: '9 to 10',
35
- seconds: '42 to 58',
36
- },
37
- {
38
- label: 'Without',
39
- score: 0.62,
40
- rowsRight: '12 of 12 in the 2 runs that finished',
41
- ranCatalogue: '0 of 3 runs',
42
- turns: '15 to 16',
43
- seconds: '70 to 72, and one run timed out at 300',
44
- },
45
- ],
46
- };