codeassembly-agent-logic 0.5.0 → 0.6.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.
- package/.meta/changelog.json +22 -0
- package/CHANGELOG.md +7 -0
- package/README.md +14 -16
- package/dist/esm/react/index.d.ts +3 -1
- package/dist/esm/react/index.js +2 -0
- package/dist/esm/react/source/PromptKey.d.ts +3 -0
- package/dist/esm/react/source/PromptKey.js +10 -0
- package/dist/esm/react/source/PromptPane.d.ts +19 -0
- package/dist/esm/react/source/PromptPane.js +53 -0
- package/dist/esm/react/styles.css +142 -7
- package/package.json +4 -4
package/.meta/changelog.json
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"date": "2026-11-19",
|
|
5
|
+
"sections": [
|
|
6
|
+
{
|
|
7
|
+
"title": "🎉 Features",
|
|
8
|
+
"audience": "all",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Adds `PromptPane` and `PromptKey` to `codeassembly-agent-logic/react`, which show the whole prompt with a key and mark ambient, unused, unconverted, and comment text, leaving the text that the chart uses unmarked. (#2297)",
|
|
12
|
+
"hash": "69ca2afee97618c49a07c257bcf70684b58f8567",
|
|
13
|
+
"entry": 1
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "Adds the custom properties `--agent-logic-passage-background`, `--agent-logic-text-subtlest`, and `--agent-logic-unconverted` to `codeassembly-agent-logic/react/styles.css` for theming the pane, and adds `--agent-logic-font-prose`, which replaces the serif face that was hard-coded for a flow's preamble. (#2297)",
|
|
17
|
+
"hash": "69ca2afee97618c49a07c257bcf70684b58f8567",
|
|
18
|
+
"entry": 2
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
2
24
|
{
|
|
3
25
|
"version": "0.5.0",
|
|
4
26
|
"date": "2026-11-19",
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.6.0 — 2026-11-19
|
|
6
|
+
|
|
7
|
+
### 🎉 Features
|
|
8
|
+
|
|
9
|
+
- Adds `PromptPane` and `PromptKey` to `codeassembly-agent-logic/react`, which show the whole prompt with a key and mark ambient, unused, unconverted, and comment text, leaving the text that the chart uses unmarked. (#2297)
|
|
10
|
+
- Adds the custom properties `--agent-logic-passage-background`, `--agent-logic-text-subtlest`, and `--agent-logic-unconverted` to `codeassembly-agent-logic/react/styles.css` for theming the pane, and adds `--agent-logic-font-prose`, which replaces the serif face that was hard-coded for a flow's preamble. (#2297)
|
|
11
|
+
|
|
5
12
|
## 0.5.0 — 2026-11-19
|
|
6
13
|
|
|
7
14
|
### 🎉 Features
|
package/README.md
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<!-- section:release-notes -->
|
|
2
|
-
## Release notes — v0.
|
|
2
|
+
## Release notes — v0.6.0 (2026-11-19)
|
|
3
3
|
|
|
4
4
|
### 🎉 Features
|
|
5
5
|
|
|
6
|
-
- Adds
|
|
7
|
-
-
|
|
8
|
-
- Adds a dotted underline in the global colour to an ambient instruction on the canvas, the same mark that the prompt pane gives ambient text. (#2296)
|
|
9
|
-
|
|
10
|
-
### 🐛 Bug fixes
|
|
11
|
-
|
|
12
|
-
- Fixes the issue that a consumer's layered reset, such as Tailwind's preflight, removed the padding that React Flow gives the canvas attribution, by setting that padding in the package's `styles.css` outside any cascade layer. (#2295)
|
|
6
|
+
- Adds `PromptPane` and `PromptKey` to `codeassembly-agent-logic/react`, which show the whole prompt with a key and mark ambient, unused, unconverted, and comment text, leaving the text that the chart uses unmarked. (#2297)
|
|
7
|
+
- Adds the custom properties `--agent-logic-passage-background`, `--agent-logic-text-subtlest`, and `--agent-logic-unconverted` to `codeassembly-agent-logic/react/styles.css` for theming the pane, and adds `--agent-logic-font-prose`, which replaces the serif face that was hard-coded for a flow's preamble. (#2297)
|
|
13
8
|
<!-- /section:release-notes -->
|
|
14
9
|
|
|
15
10
|
<!-- readme-type: library -->
|
|
@@ -40,8 +35,8 @@ if (result.ok) {
|
|
|
40
35
|
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
36
|
| `codeassembly-agent-logic` | The config schema and its validation, the converter and coverage check, the chart description, its ELK graph (`buildElkGraph`), its layout, source marking, and the bundled examples. |
|
|
42
37
|
| `codeassembly-agent-logic/agent` | `convertWithAgent`, which converts a prompt by directing an ACP agent through the conversion. |
|
|
43
|
-
| `codeassembly-agent-logic/react` | `StatechartCanvas`, the key's entries as data (`CANVAS_KEY_ENTRIES` and the mark glyphs), and the hooks of a page that presents a chart.
|
|
44
|
-
| `codeassembly-agent-logic/react/styles.css` | The canvas
|
|
38
|
+
| `codeassembly-agent-logic/react` | `StatechartCanvas`, the key's entries as data (`CANVAS_KEY_ENTRIES` and the mark glyphs), `PromptPane` and its `PromptKey`, and the hooks of a page that presents a chart. |
|
|
39
|
+
| `codeassembly-agent-logic/react/styles.css` | The stylesheet of the canvas and the prompt pane. |
|
|
45
40
|
| `codeassembly-agent-logic/server` | `createConversionHandler`, which serves conversions on an ACP agent, and its stores. |
|
|
46
41
|
| `codeassembly-agent-logic/client` | `createConversionClient`, the browser client of the routes that `createConversionHandler` serves. |
|
|
47
42
|
| `codeassembly-agent-logic/job` | `createConversionJob`, which converts a prompt as a job of `@williamthorsen/toolbelt.llm`, in a page or a function. |
|
|
@@ -120,7 +115,9 @@ if (started.ok) {
|
|
|
120
115
|
|
|
121
116
|
## What the app supplies
|
|
122
117
|
|
|
123
|
-
The package draws the chart; the page around
|
|
118
|
+
The package draws the chart and the prompt; the page around them is the app's. The app renders the load controls, the inspector, and the terminal in its own design system, and it renders the canvas's key: `StatechartCanvas` passes the marks that the chart draws to its `renderKey` prop, and `CANVAS_KEY_ENTRIES` gives each mark's name, gloss, and drawing.
|
|
119
|
+
|
|
120
|
+
`PromptPane` shows the whole prompt with its key, marking the text that the chart does not use and leaving used text unmarked. The app supplies its segments, from `buildPromptSegments`, the selected element, the passages to show, and the handler that receives a clicked passage's path. A line that the app draws from the canvas to the selected passage finds the pane's text by `data-prompt-text` and the passage by `data-passage-for`, whose value is the element's path; `PromptPane`'s doc comment lists its other attributes. `PromptKey` renders the key alone, for an app that places it outside the pane. The app also supplies the URL of the conversions resource to `./client`'s `createConversionClient`.
|
|
124
121
|
|
|
125
122
|
## Styling and theming
|
|
126
123
|
|
|
@@ -136,23 +133,24 @@ The colours come in two tiers of custom properties. The seeds are a few base col
|
|
|
136
133
|
}
|
|
137
134
|
```
|
|
138
135
|
|
|
139
|
-
Set the properties on `:root`, or on an ancestor of
|
|
136
|
+
Set the properties on `:root`, or on an ancestor of the canvas, the pane, and any key that the app renders outside them. The seeds, whose defaults [`styles.css`](src/react/styles.css) declares:
|
|
140
137
|
|
|
141
138
|
- `--agent-logic-surface`: the background of a state and of a label
|
|
142
139
|
- `--agent-logic-text`: the text
|
|
143
140
|
- `--agent-logic-accent`: selection and focus
|
|
144
|
-
- `--agent-logic-global`, `--agent-logic-waiting`, `--agent-logic-warning`: the marks for an any-time transition, a state that waits for the user, and an unreachable state
|
|
141
|
+
- `--agent-logic-global`, `--agent-logic-waiting`, `--agent-logic-warning`: the marks for an any-time transition and ambient text, a state that waits for the user, and an unreachable state
|
|
145
142
|
|
|
146
143
|
The component properties, which an app sets to override one part; `styles.css` states each derivation:
|
|
147
144
|
|
|
148
145
|
- `--agent-logic-ambient-background`, `--agent-logic-compound-background`, `--agent-logic-hover-background`: backgrounds, from `text` (and `surface` for a compound state)
|
|
149
146
|
- `--agent-logic-node-background`, `--agent-logic-tooltip-text`: from `surface`
|
|
150
|
-
- `--agent-logic-selected-background`: from `accent` and `surface
|
|
151
|
-
- `--agent-logic-text-subtle`, `--agent-logic-border`, `--agent-logic-border-strong`: from `text` and `surface
|
|
147
|
+
- `--agent-logic-selected-background`, `--agent-logic-passage-background`: from `accent` and `surface`; the second fills the pane's selected and shown passages
|
|
148
|
+
- `--agent-logic-text-subtle`, `--agent-logic-text-subtlest`, `--agent-logic-border`, `--agent-logic-border-strong`: from `text` and `surface`; the pane sets unused text in the first and comments in the second
|
|
149
|
+
- `--agent-logic-unconverted`: the wavy line under unconverted text, from `warning` and `text`
|
|
152
150
|
- `--agent-logic-tooltip-background`: from `text`
|
|
153
151
|
- `--agent-logic-focus-ring`, `--agent-logic-selected`: from `accent`
|
|
154
152
|
|
|
155
|
-
The canvas's ground and its dots also derive from the seeds; React Flow's `--xy-background-color` and `--xy-background-pattern-color` replace them. `--agent-logic-font-code` sets the code font.
|
|
153
|
+
The canvas's ground and its dots also derive from the seeds; React Flow's `--xy-background-color` and `--xy-background-pattern-color` replace them. `--agent-logic-font-code` sets the code font, and `--agent-logic-font-prose` the face in which the pane and a flow's preamble quote the prompt.
|
|
156
154
|
|
|
157
155
|
## The bin
|
|
158
156
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** `./react` entry: the statechart canvas, the data of its key, and the hooks of a page
|
|
1
|
+
/** `./react` entry: the statechart canvas, the data of its key, the prompt pane, and the hooks of a chart's page. */
|
|
2
2
|
export * from './canvas/canvas-key-entries.js';
|
|
3
3
|
export * from './canvas/list-chart-marks.js';
|
|
4
4
|
export * from './canvas/marks.js';
|
|
@@ -15,3 +15,5 @@ export * from './hooks/useEscapeToClear.js';
|
|
|
15
15
|
export * from './hooks/useSelection.js';
|
|
16
16
|
export * from './hooks/useShowAmbient.js';
|
|
17
17
|
export * from './hooks/useUnknownExample.js';
|
|
18
|
+
export * from './source/PromptKey.js';
|
|
19
|
+
export * from './source/PromptPane.js';
|
package/dist/esm/react/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function PromptKey() {
|
|
3
|
+
return (_jsx("ul", { "aria-label": "Prompt marks", className: "prompt-key", children: KEY_ENTRIES.map(({ coverage, label }) => (_jsx("li", { className: "prompt-key__entry", children: _jsx("span", { className: `prompt-key__sample prompt-key__sample--${coverage}`, children: label }) }, coverage))) }));
|
|
4
|
+
}
|
|
5
|
+
const KEY_ENTRIES = [
|
|
6
|
+
{ coverage: 'ambient', label: 'Ambient' },
|
|
7
|
+
{ coverage: 'unused', label: 'Not used' },
|
|
8
|
+
{ coverage: 'unconverted', label: 'Not converted' },
|
|
9
|
+
{ coverage: 'comment', label: 'Comment' },
|
|
10
|
+
];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { ElementDescription } from '../../layout/describe-config.js';
|
|
3
|
+
import type { Span } from '../../schema/agent-logic-schema.js';
|
|
4
|
+
import { type PromptSegment } from '../../source/prompt-segments.js';
|
|
5
|
+
export interface PromptPaneProps {
|
|
6
|
+
segments: PromptSegment[];
|
|
7
|
+
selected: ElementDescription | undefined;
|
|
8
|
+
/** The passages to mark, the earliest of which is brought into view; the segments must be cut at their bounds. */
|
|
9
|
+
shownPassages?: Span[] | undefined;
|
|
10
|
+
/** Receives the path of the element whose passage was clicked. */
|
|
11
|
+
onSelect: (path: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The whole prompt with its key, marking the text that the chart does not use, with the selected element's or the
|
|
15
|
+
* shown passages highlighted. Its text region has `data-prompt-text`, and each passage `data-coverage`; a selected
|
|
16
|
+
* passage has `data-selected`, the first of them `data-passage-for` with the element's path, a shown passage
|
|
17
|
+
* `data-shown`, the earliest of them `data-shown-passage`, and a passage that selects an element `data-select-path`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function PromptPane({ segments, selected, shownPassages, onSelect }: PromptPaneProps): ReactElement;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useRef } from 'react';
|
|
3
|
+
import { listElementWords } from "../../source/prompt-segments.js";
|
|
4
|
+
import { PromptKey } from "./PromptKey.js";
|
|
5
|
+
export function PromptPane({ segments, selected, shownPassages = [], onSelect }) {
|
|
6
|
+
const headingId = useId();
|
|
7
|
+
const textRef = useRef(null);
|
|
8
|
+
const selectedPath = selected?.path;
|
|
9
|
+
const sharedWords = selected === undefined ? new Set() : listElementWords(selected);
|
|
10
|
+
const firstSelectedStart = segments.find(({ paths }) => selectedPath !== undefined && paths.includes(selectedPath))?.start;
|
|
11
|
+
const firstShownStart = Math.min(...shownPassages.map(({ start }) => start));
|
|
12
|
+
const shownKey = shownPassages.map(({ start, end }) => `${start}-${end}`).join(',');
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const container = textRef.current;
|
|
15
|
+
const passage = container?.querySelector('[data-passage-for], [data-shown-passage]');
|
|
16
|
+
const firstLine = passage?.getClientRects()[0];
|
|
17
|
+
if (container === null || firstLine === undefined)
|
|
18
|
+
return;
|
|
19
|
+
const bounds = container.getBoundingClientRect();
|
|
20
|
+
if (firstLine.top >= bounds.top && firstLine.bottom <= bounds.bottom)
|
|
21
|
+
return;
|
|
22
|
+
container.scrollTop += firstLine.top - bounds.top - container.clientHeight * 0.3;
|
|
23
|
+
}, [selectedPath, shownKey]);
|
|
24
|
+
function handleClick(event) {
|
|
25
|
+
if (!(event.target instanceof Element))
|
|
26
|
+
return;
|
|
27
|
+
const path = event.target.closest('[data-select-path]')?.dataset['selectPath'];
|
|
28
|
+
if (path !== undefined)
|
|
29
|
+
onSelect(path);
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs("section", { "aria-labelledby": headingId, className: "prompt-pane", children: [_jsxs("div", { className: "prompt-pane__header", children: [_jsx("h2", { id: headingId, className: "prompt-pane__heading", children: "Prompt" }), _jsx(PromptKey, {})] }), _jsx("div", { ref: textRef, onClick: handleClick, "data-prompt-text": "", className: "prompt-pane__text", children: segments.map((segment) => {
|
|
32
|
+
const isShown = shownPassages.some(({ start, end }) => segment.start >= start && segment.end <= end);
|
|
33
|
+
const isSelected = selectedPath !== undefined && segment.paths.includes(selectedPath);
|
|
34
|
+
const selectPath = segment.coverage === 'used'
|
|
35
|
+
? segment.paths[0]
|
|
36
|
+
: segment.coverage === 'ambient'
|
|
37
|
+
? segment.paths.find((path) => AMBIENT_PATH.test(path))
|
|
38
|
+
: undefined;
|
|
39
|
+
return (_jsx("span", { className: classifyPassage(segment, isSelected || isShown), "data-coverage": segment.coverage, "data-selected": isSelected ? '' : undefined, "data-shown": isShown ? '' : undefined, "data-select-path": selectPath, "data-passage-for": isSelected && segment.start === firstSelectedStart ? selectedPath : undefined, "data-shown-passage": isShown && segment.start === firstShownStart ? '' : undefined, children: isSelected ? boldSharedWords(segment.text, sharedWords) : segment.text }, segment.start));
|
|
40
|
+
}) })] }));
|
|
41
|
+
}
|
|
42
|
+
const AMBIENT_PATH = /(?:^|\.)meta\.ambient\[\d+\]$/;
|
|
43
|
+
const WORD = /[A-Za-z0-9]/;
|
|
44
|
+
function boldSharedWords(text, words) {
|
|
45
|
+
return text
|
|
46
|
+
.split(/([A-Za-z0-9]+)/)
|
|
47
|
+
.map((part, index) => (words.has(part.toLowerCase()) ? _jsx("b", { children: part }, index) : part));
|
|
48
|
+
}
|
|
49
|
+
function classifyPassage({ coverage, text }, isHighlighted) {
|
|
50
|
+
const isMarked = coverage !== 'unused' || WORD.test(text);
|
|
51
|
+
const classes = isMarked ? `prompt-pane__passage prompt-pane__passage--${coverage}` : 'prompt-pane__passage';
|
|
52
|
+
return isHighlighted ? `${classes} prompt-pane__passage--highlighted` : classes;
|
|
53
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Styles for the statechart canvas and the marks of
|
|
3
|
-
* seeds, declared on :root, and the component properties, each of which derives its default from
|
|
4
|
-
* sets either tier on :root or on an ancestor of the
|
|
2
|
+
* Styles for the statechart canvas, the prompt pane, and the marks of their keys. The colours come in two tiers of
|
|
3
|
+
* custom properties: the seeds, declared on :root, and the component properties, each of which derives its default from
|
|
4
|
+
* the seeds. A consumer sets either tier on :root or on an ancestor of the components that it renders.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
@import '@xyflow/react/style.css';
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
:where(:root) {
|
|
10
10
|
--agent-logic-accent: #2346c4;
|
|
11
11
|
--agent-logic-font-code: ui-monospace, monospace;
|
|
12
|
+
--agent-logic-font-prose: 'Iowan Old Style', Charter, 'Source Serif 4', Georgia, ui-serif, serif;
|
|
12
13
|
--agent-logic-global: #b0307f;
|
|
13
14
|
--agent-logic-surface: #ffffff;
|
|
14
15
|
--agent-logic-text: #1c1f24;
|
|
@@ -18,9 +19,17 @@
|
|
|
18
19
|
|
|
19
20
|
/*
|
|
20
21
|
* Each component property resolves here, on the elements that read it, rather than on :root, so that seeds set on any
|
|
21
|
-
* ancestor of the canvas or
|
|
22
|
+
* ancestor of the canvas, the pane, or a key entry reach the derivation. Every rule below reads the private property.
|
|
22
23
|
*/
|
|
23
|
-
:where(
|
|
24
|
+
:where(
|
|
25
|
+
.statechart-canvas,
|
|
26
|
+
.arrowhead-defs,
|
|
27
|
+
.canvas-key__swatch,
|
|
28
|
+
.canvas-key__word,
|
|
29
|
+
.mark-glyph,
|
|
30
|
+
.prompt-pane,
|
|
31
|
+
.prompt-key
|
|
32
|
+
) {
|
|
24
33
|
--_agent-logic-ambient-background: var(
|
|
25
34
|
--agent-logic-ambient-background,
|
|
26
35
|
color-mix(in srgb, var(--agent-logic-text) 7%, transparent)
|
|
@@ -43,6 +52,10 @@
|
|
|
43
52
|
color-mix(in srgb, var(--agent-logic-text) 12.5%, transparent)
|
|
44
53
|
);
|
|
45
54
|
--_agent-logic-node-background: var(--agent-logic-node-background, var(--agent-logic-surface));
|
|
55
|
+
--_agent-logic-passage-background: var(
|
|
56
|
+
--agent-logic-passage-background,
|
|
57
|
+
color-mix(in srgb, var(--agent-logic-accent) 22%, var(--agent-logic-surface))
|
|
58
|
+
);
|
|
46
59
|
--_agent-logic-selected: var(--agent-logic-selected, var(--agent-logic-accent));
|
|
47
60
|
--_agent-logic-selected-background: var(
|
|
48
61
|
--agent-logic-selected-background,
|
|
@@ -52,8 +65,16 @@
|
|
|
52
65
|
--agent-logic-text-subtle,
|
|
53
66
|
color-mix(in srgb, var(--agent-logic-text) 78%, var(--agent-logic-surface))
|
|
54
67
|
);
|
|
68
|
+
--_agent-logic-text-subtlest: var(
|
|
69
|
+
--agent-logic-text-subtlest,
|
|
70
|
+
color-mix(in srgb, var(--agent-logic-text) 72%, var(--agent-logic-surface))
|
|
71
|
+
);
|
|
55
72
|
--_agent-logic-tooltip-background: var(--agent-logic-tooltip-background, var(--agent-logic-text));
|
|
56
73
|
--_agent-logic-tooltip-text: var(--agent-logic-tooltip-text, var(--agent-logic-surface));
|
|
74
|
+
--_agent-logic-unconverted: var(
|
|
75
|
+
--agent-logic-unconverted,
|
|
76
|
+
color-mix(in srgb, var(--agent-logic-warning) 70%, var(--agent-logic-text))
|
|
77
|
+
);
|
|
57
78
|
}
|
|
58
79
|
|
|
59
80
|
.statechart-canvas {
|
|
@@ -356,8 +377,8 @@
|
|
|
356
377
|
background: none;
|
|
357
378
|
color: var(--agent-logic-text);
|
|
358
379
|
cursor: pointer;
|
|
359
|
-
/* The
|
|
360
|
-
font-family:
|
|
380
|
+
/* The prompt pane's face, in which the preamble quotes the prompt. */
|
|
381
|
+
font-family: var(--agent-logic-font-prose);
|
|
361
382
|
font-size: 14px;
|
|
362
383
|
line-height: 20px;
|
|
363
384
|
text-align: start;
|
|
@@ -528,3 +549,117 @@
|
|
|
528
549
|
.canvas-key__word {
|
|
529
550
|
color: var(--_agent-logic-text-subtle);
|
|
530
551
|
}
|
|
552
|
+
|
|
553
|
+
/* -- Prompt pane: the prompt, with marks on the exceptions to used text -- */
|
|
554
|
+
|
|
555
|
+
.prompt-pane {
|
|
556
|
+
display: grid;
|
|
557
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
558
|
+
block-size: 100%;
|
|
559
|
+
min-block-size: 0;
|
|
560
|
+
background: var(--agent-logic-surface);
|
|
561
|
+
color: var(--agent-logic-text);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.prompt-pane__header {
|
|
565
|
+
display: flex;
|
|
566
|
+
flex-wrap: wrap;
|
|
567
|
+
gap: 4px 12px;
|
|
568
|
+
align-items: baseline;
|
|
569
|
+
padding: 12px 20px 4px;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.prompt-pane__heading {
|
|
573
|
+
margin: 0;
|
|
574
|
+
font-size: 12px;
|
|
575
|
+
font-weight: 600;
|
|
576
|
+
line-height: 16px;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.prompt-pane__text {
|
|
580
|
+
overflow: auto;
|
|
581
|
+
padding: 4px 20px 40px;
|
|
582
|
+
font-family: var(--agent-logic-font-prose);
|
|
583
|
+
font-size: 16px;
|
|
584
|
+
line-height: 26px;
|
|
585
|
+
white-space: pre-wrap;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/* Used text is unmarked, so that the marks set apart the exceptions; pointing at a passage shows that it selects. */
|
|
589
|
+
.prompt-pane__passage--used,
|
|
590
|
+
.prompt-pane__passage--ambient {
|
|
591
|
+
cursor: pointer;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.prompt-pane__passage--used:hover {
|
|
595
|
+
background: var(--_agent-logic-hover-background);
|
|
596
|
+
text-decoration: underline solid 1px var(--_agent-logic-border-strong);
|
|
597
|
+
text-underline-offset: 0.25em;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.prompt-pane__passage--ambient:hover {
|
|
601
|
+
background: var(--_agent-logic-hover-background);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/* Each mark pairs its colour with a line style or italic, and its key sample shares the rule. */
|
|
605
|
+
.prompt-pane__passage--ambient,
|
|
606
|
+
.prompt-key__sample--ambient {
|
|
607
|
+
text-decoration: underline dotted 2px var(--agent-logic-global);
|
|
608
|
+
text-underline-offset: 0.2em;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.prompt-pane__passage--unused,
|
|
612
|
+
.prompt-key__sample--unused {
|
|
613
|
+
color: var(--_agent-logic-text-subtle);
|
|
614
|
+
text-decoration: underline dashed 1px var(--_agent-logic-border);
|
|
615
|
+
text-underline-offset: 0.25em;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.prompt-pane__passage--unconverted,
|
|
619
|
+
.prompt-key__sample--unconverted {
|
|
620
|
+
text-decoration: underline wavy 1.5px var(--_agent-logic-unconverted);
|
|
621
|
+
text-underline-offset: 0.3em;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.prompt-pane__passage--comment,
|
|
625
|
+
.prompt-key__sample--comment {
|
|
626
|
+
color: var(--_agent-logic-text-subtlest);
|
|
627
|
+
font-style: italic;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/* A selected or shown passage reads as the active text: a fill without a line of its own, over any hover. */
|
|
631
|
+
.prompt-pane__passage--highlighted,
|
|
632
|
+
.prompt-pane__passage--highlighted:hover {
|
|
633
|
+
background: var(--_agent-logic-passage-background);
|
|
634
|
+
color: var(--agent-logic-text);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/* An unconverted passage keeps its line, which tells the reader why the passage is shown. */
|
|
638
|
+
.prompt-pane__passage--highlighted:not(.prompt-pane__passage--unconverted),
|
|
639
|
+
.prompt-pane__passage--highlighted:not(.prompt-pane__passage--unconverted):hover {
|
|
640
|
+
text-decoration: none;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.prompt-pane__passage--highlighted.prompt-pane__passage--comment {
|
|
644
|
+
color: var(--_agent-logic-text-subtle);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.prompt-key {
|
|
648
|
+
display: flex;
|
|
649
|
+
flex-wrap: wrap;
|
|
650
|
+
gap: 4px 12px;
|
|
651
|
+
margin: 0;
|
|
652
|
+
margin-inline-start: auto;
|
|
653
|
+
padding: 0;
|
|
654
|
+
font-size: 12px;
|
|
655
|
+
line-height: 16px;
|
|
656
|
+
list-style: none;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.prompt-key__entry {
|
|
660
|
+
margin: 0;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.prompt-key__sample {
|
|
664
|
+
font-family: var(--agent-logic-font-prose);
|
|
665
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeassembly-agent-logic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Model of an agent prompt's states and transitions, with React and server entries for the apps that present it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
".meta/changelog.json"
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@williamthorsen/toolbelt.errors": "0.11.
|
|
67
|
+
"@williamthorsen/toolbelt.errors": "0.11.4",
|
|
68
68
|
"@xyflow/react": "13.0.2",
|
|
69
69
|
"elkjs": "0.12.1",
|
|
70
70
|
"zod": "4.6.7"
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@types/react-dom": "19.3.0",
|
|
82
82
|
"@vitejs/plugin-react": "6.3.0",
|
|
83
83
|
"@williamthorsen/nmr": "2.3.0",
|
|
84
|
-
"@williamthorsen/toolbelt.acp": "0.3.
|
|
85
|
-
"@williamthorsen/toolbelt.llm": "0.2.
|
|
84
|
+
"@williamthorsen/toolbelt.acp": "0.3.3",
|
|
85
|
+
"@williamthorsen/toolbelt.llm": "0.2.1",
|
|
86
86
|
"eslint": "10.15.0",
|
|
87
87
|
"eslint-plugin-jest-dom": "5.10.2",
|
|
88
88
|
"eslint-plugin-react": "7.37.5",
|